ksk-design-system 1.65.0 → 1.66.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/contracts/components.json +1 -1
- package/contracts/rules.json +1 -1
- package/contracts/token-hex-cache.json +1 -1
- package/dist/index.js +11 -10
- package/dist/native/ui.js +16 -11
- package/dist/types/components/patterns/stat-card.d.ts +3 -4
- package/dist/types/native/components/SearchBar.d.ts +8 -2
- package/package.json +1 -1
- package/src/styles/source-safelist.css +1 -0
package/contracts/rules.json
CHANGED
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
"severity": "warning",
|
|
270
270
|
"category": "accessibility",
|
|
271
271
|
"appliesTo": ["dom"],
|
|
272
|
-
"pattern": "<div
|
|
272
|
+
"pattern": "<div\\b(?:(?!<|>)[\\s\\S])*?\\sonClick\\b|<span\\b(?:(?!<|>)[\\s\\S])*?\\sonClick\\b",
|
|
273
273
|
"excludePaths": [".stories."],
|
|
274
274
|
"excludeLines": [],
|
|
275
275
|
"message": "<div onClick> 禁止(キーボード操作・スクリーンリーダー不可)",
|
|
@@ -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.66.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
|
@@ -11439,16 +11439,21 @@ function Fu({ images: e, indicatorType: t = "thumbnail", aspectRatio: n = "4/3",
|
|
|
11439
11439
|
className: G("flex flex-col gap-2", i),
|
|
11440
11440
|
children: [
|
|
11441
11441
|
/* @__PURE__ */ V("div", {
|
|
11442
|
-
className: G("relative w-full overflow-hidden rounded-xl bg-[var(--Surface-Tertiary)] cursor-pointer", Pu[n] ?? "aspect-[4/3]"),
|
|
11442
|
+
className: G("relative w-full overflow-hidden rounded-xl bg-[var(--Surface-Tertiary)]", r && "cursor-pointer", Pu[n] ?? "aspect-[4/3]"),
|
|
11443
11443
|
onTouchStart: m,
|
|
11444
11444
|
onTouchEnd: h,
|
|
11445
|
-
onClick: () => r?.(c),
|
|
11446
11445
|
children: [
|
|
11447
11446
|
g && /* @__PURE__ */ B("img", {
|
|
11448
11447
|
src: g.src,
|
|
11449
11448
|
alt: g.alt ?? s(c),
|
|
11450
11449
|
className: "w-full h-full object-cover transition-opacity duration-[var(--Motion-Duration-Base)]"
|
|
11451
11450
|
}, c),
|
|
11451
|
+
r && /* @__PURE__ */ B("button", {
|
|
11452
|
+
type: "button",
|
|
11453
|
+
className: "absolute inset-0 z-0 h-full w-full cursor-pointer appearance-none",
|
|
11454
|
+
"aria-label": s(c),
|
|
11455
|
+
onClick: () => r(c)
|
|
11456
|
+
}),
|
|
11452
11457
|
e.length > 1 && /* @__PURE__ */ V("span", {
|
|
11453
11458
|
className: "absolute bottom-2 right-2 bg-[var(--Overlay-Medium)] text-[var(--Text-on-Media)] typo-label-xs px-2 py-0.5 rounded-full",
|
|
11454
11459
|
children: [
|
|
@@ -13727,18 +13732,14 @@ var df = {
|
|
|
13727
13732
|
};
|
|
13728
13733
|
function ff({ className: e, label: t, value: n, unit: r, trend: i, icon: a, variant: o = "default", interactive: s, onClick: c, ...l }) {
|
|
13729
13734
|
let u = df[o], d = s ?? !!c;
|
|
13730
|
-
return /* @__PURE__ */ V("div", {
|
|
13735
|
+
return /* @__PURE__ */ V(d ? "button" : "div", {
|
|
13736
|
+
type: d ? "button" : void 0,
|
|
13731
13737
|
"data-slot": "stat-card",
|
|
13732
13738
|
"data-variant": o,
|
|
13733
13739
|
"data-interactive": d || void 0,
|
|
13734
|
-
role: d ? "button" : void 0,
|
|
13735
|
-
tabIndex: d ? 0 : void 0,
|
|
13736
13740
|
onClick: d ? c : void 0,
|
|
13737
|
-
|
|
13738
|
-
|
|
13739
|
-
} : void 0,
|
|
13740
|
-
className: G("flex flex-col gap-2 rounded-lg border border-[var(--Border-Low-Emphasis)] p-4 shadow-[var(--shadow-md)]", u.card, d && [
|
|
13741
|
-
"cursor-pointer transition-all",
|
|
13741
|
+
className: G("flex flex-col gap-2 rounded-lg border border-[var(--Border-Low-Emphasis)] p-4 text-left shadow-[var(--shadow-md)]", u.card, d && [
|
|
13742
|
+
"w-full appearance-none cursor-pointer transition-all",
|
|
13742
13743
|
u.hoverBg,
|
|
13743
13744
|
"active:scale-[0.98]",
|
|
13744
13745
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--Focus-High-Emphasis)] focus-visible:ring-offset-2"
|
package/dist/native/ui.js
CHANGED
|
@@ -5839,21 +5839,21 @@ function xi({ banners: e, itemWidth: t, height: n = 160, showIndicator: r = !0 }
|
|
|
5839
5839
|
}
|
|
5840
5840
|
//#endregion
|
|
5841
5841
|
//#region src/native/components/SearchBar.tsx
|
|
5842
|
-
function Si({ value: e, onChange: t, placeholder: n = "検索", onSubmit: r, onClear: i, autoFocus: a }) {
|
|
5843
|
-
let { theme:
|
|
5842
|
+
function Si({ value: e, onChange: t, placeholder: n = "検索", onSubmit: r, onClear: i, autoFocus: a, accessibilityLabel: o, accessibilityHint: s, accessibilityRole: c, accessibilityState: l, ...u }) {
|
|
5843
|
+
let { theme: d, scales: f } = G();
|
|
5844
5844
|
return /* @__PURE__ */ D(H, {
|
|
5845
5845
|
style: {
|
|
5846
5846
|
flexDirection: "row",
|
|
5847
5847
|
alignItems: "center",
|
|
5848
|
-
gap:
|
|
5849
|
-
paddingHorizontal:
|
|
5848
|
+
gap: f.spacing.scale[2],
|
|
5849
|
+
paddingHorizontal: f.spacing.scale[3],
|
|
5850
5850
|
height: 44,
|
|
5851
|
-
backgroundColor:
|
|
5852
|
-
borderRadius:
|
|
5851
|
+
backgroundColor: d.surface.secondary,
|
|
5852
|
+
borderRadius: f.borderRadius.full
|
|
5853
5853
|
},
|
|
5854
5854
|
children: [
|
|
5855
5855
|
/* @__PURE__ */ E(B, {
|
|
5856
|
-
style: [Y("label.md"), { color:
|
|
5856
|
+
style: [Y("label.md"), { color: d.text["low-emphasis"] }],
|
|
5857
5857
|
children: "🔍"
|
|
5858
5858
|
}),
|
|
5859
5859
|
/* @__PURE__ */ E(V, {
|
|
@@ -5861,12 +5861,17 @@ function Si({ value: e, onChange: t, placeholder: n = "検索", onSubmit: r, onC
|
|
|
5861
5861
|
onChangeText: t,
|
|
5862
5862
|
onSubmitEditing: r,
|
|
5863
5863
|
placeholder: n,
|
|
5864
|
-
placeholderTextColor:
|
|
5864
|
+
placeholderTextColor: d.text["low-emphasis"],
|
|
5865
5865
|
returnKeyType: "search",
|
|
5866
5866
|
autoFocus: a,
|
|
5867
|
+
accessibilityLabel: o ?? n,
|
|
5868
|
+
accessibilityHint: s,
|
|
5869
|
+
accessibilityRole: c,
|
|
5870
|
+
accessibilityState: l,
|
|
5871
|
+
...u,
|
|
5867
5872
|
style: [Y("body.md"), {
|
|
5868
5873
|
flex: 1,
|
|
5869
|
-
color:
|
|
5874
|
+
color: d.text["high-emphasis"],
|
|
5870
5875
|
paddingVertical: 0
|
|
5871
5876
|
}]
|
|
5872
5877
|
}),
|
|
@@ -5880,12 +5885,12 @@ function Si({ value: e, onChange: t, placeholder: n = "検索", onSubmit: r, onC
|
|
|
5880
5885
|
width: 20,
|
|
5881
5886
|
height: 20,
|
|
5882
5887
|
borderRadius: 10,
|
|
5883
|
-
backgroundColor:
|
|
5888
|
+
backgroundColor: d.surface.tertiary,
|
|
5884
5889
|
alignItems: "center",
|
|
5885
5890
|
justifyContent: "center"
|
|
5886
5891
|
},
|
|
5887
5892
|
children: /* @__PURE__ */ E(B, {
|
|
5888
|
-
style: [Y("label.xs"), { color:
|
|
5893
|
+
style: [Y("label.xs"), { color: d.text["medium-emphasis"] }],
|
|
5889
5894
|
children: "×"
|
|
5890
5895
|
})
|
|
5891
5896
|
})
|
|
@@ -20,10 +20,9 @@ interface StatCardProps extends Omit<React.ComponentProps<"div">, "onClick"> {
|
|
|
20
20
|
*/
|
|
21
21
|
variant?: StatCardVariant;
|
|
22
22
|
/**
|
|
23
|
-
* Interactive モード: true にすると card
|
|
24
|
-
* -
|
|
25
|
-
* -
|
|
26
|
-
* - hover で軽い陰り、cursor-pointer
|
|
23
|
+
* Interactive モード: true にすると card が実 `<button>` として描画される。
|
|
24
|
+
* - ネイティブ button のフォーカスリング・キーボード操作(Enter/Space)を自動付与
|
|
25
|
+
* - hover で軽い陰り、cursor-pointer、active:scale
|
|
27
26
|
*
|
|
28
27
|
* onClick だけ渡しても interactive=true 扱いする。
|
|
29
28
|
*/
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
|
|
2
|
+
import { type AccessibilityProps } from "react-native";
|
|
3
|
+
/**
|
|
4
|
+
* `AccessibilityProps` を継承しているため、`accessibilityLabel` /
|
|
5
|
+
* `accessibilityHint` / `accessibilityState` / `accessibilityRole` を
|
|
6
|
+
* そのまま渡せる(issue #465)。内部の `TextInput` へそのまま転送する。
|
|
7
|
+
*/
|
|
8
|
+
export interface SearchBarProps extends AccessibilityProps {
|
|
3
9
|
value: string;
|
|
4
10
|
onChange: (value: string) => void;
|
|
5
11
|
placeholder?: string;
|
|
@@ -7,4 +13,4 @@ export interface SearchBarProps {
|
|
|
7
13
|
onClear?: () => void;
|
|
8
14
|
autoFocus?: boolean;
|
|
9
15
|
}
|
|
10
|
-
export declare function SearchBar({ value, onChange, placeholder, onSubmit, onClear, autoFocus, }: SearchBarProps): React.JSX.Element;
|
|
16
|
+
export declare function SearchBar({ value, onChange, placeholder, onSubmit, onClear, autoFocus, accessibilityLabel, accessibilityHint, accessibilityRole, accessibilityState, ...accessibilityProps }: SearchBarProps): React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -100,6 +100,7 @@
|
|
|
100
100
|
@source inline("animate-in");
|
|
101
101
|
@source inline("animate-pulse");
|
|
102
102
|
@source inline("animate-spin");
|
|
103
|
+
@source inline("appearance-none");
|
|
103
104
|
@source inline("aria-disabled:opacity-50");
|
|
104
105
|
@source inline("aria-invalid:border-[var(--Border-Caution)]");
|
|
105
106
|
@source inline("aria-invalid:ring-[var(--Caution-Base)]/20");
|