ksk-design-system 1.42.2 → 1.43.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/NATIVE_RECIPES.md +46 -0
- package/contracts/components.json +48 -3
- package/dist/index.js +1320 -1257
- package/dist/native/ui.js +434 -382
- package/dist/{native-D6LJPc6D.js → native-BelCzh9_.js} +10 -0
- package/dist/native.js +1 -1
- package/dist/types/components/ui/commit-auto-grow-textarea.d.ts +21 -0
- package/dist/types/components/ui/commit-input.d.ts +21 -0
- package/dist/types/components/ui/commit-textarea.d.ts +16 -0
- package/dist/types/components/ui/progress.d.ts +12 -1
- package/dist/types/components/ui/sheet.d.ts +22 -1
- package/dist/types/components/ui/use-commit-draft.d.ts +48 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/native/components/DocumentScreen.d.ts +22 -0
- package/dist/types/native/components/Progress.d.ts +9 -9
- package/dist/types/native/components/Prose.d.ts +15 -0
- package/dist/types/native/components/Text.d.ts +6 -1
- package/dist/types/native/components/index.d.ts +2 -0
- package/dist/types/native/progress-logic.d.ts +23 -0
- package/dist/types/native/typography.d.ts +4 -2
- package/dist/types/tokens/native/scales.d.ts +10 -0
- package/package.json +1 -1
- package/src/components/COMPONENT_LOOKUP.md +4 -1
- package/src/native/COMPONENT_LOOKUP.md +3 -1
- package/src/preset.css +1 -0
- package/src/styles/sheet-keyboard.css +72 -0
- package/tokens.json +12 -0
package/NATIVE_RECIPES.md
CHANGED
|
@@ -184,3 +184,49 @@ Web では `CompactFilePicker` / `ImageAttachmentPicker` が hidden file input
|
|
|
184
184
|
</BottomSheetFrame>
|
|
185
185
|
</Sheet>
|
|
186
186
|
```
|
|
187
|
+
|
|
188
|
+
## Caption / attribution text
|
|
189
|
+
|
|
190
|
+
出典・著作権表示など、控えめな注釈は `Text` の `variant="caption-strong"` を使います(11px・font-semibold 相当)。`text-[11px] font-semibold leading-4 text-hint` のようなマジックナンバーをローカルに書きません。色は未指定なら自動で hint 相当(`text.low-emphasis`)になります。
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { Text } from "ksk-design-system/native/ui"
|
|
194
|
+
|
|
195
|
+
{citationOf(question) && (
|
|
196
|
+
<Text variant="caption-strong" style={{ marginTop: 12 }}>
|
|
197
|
+
{citationOf(question)}
|
|
198
|
+
</Text>
|
|
199
|
+
)}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
通常の注釈(強調不要)には既存の `variant="caption"`(11px・通常ウェイト)を使います。
|
|
203
|
+
|
|
204
|
+
## Masked / teaser progress bars
|
|
205
|
+
|
|
206
|
+
未課金ユーザー向けのティザー表示など、実データを見せたくない進捗バーは `Progress` の `masked` を使います。`masked=true` の間はバー幅・色ともに `value`/`autoColor` を無視し固定表示になるため、幅から実データを逆算されません。
|
|
207
|
+
|
|
208
|
+
```tsx
|
|
209
|
+
import { Progress, Text } from "ksk-design-system/native/ui"
|
|
210
|
+
|
|
211
|
+
<Text variant="body.sm">{masked ? "🔒 ??%" : `${accuracy}%(${correct}/${answered})`}</Text>
|
|
212
|
+
<Progress value={accuracy} masked={masked} />
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Web 版 `Progress`(`ksk-design-system` の `Progress`)にも同じ `masked` prop があります。
|
|
216
|
+
|
|
217
|
+
## Static document viewer (privacy policy / terms)
|
|
218
|
+
|
|
219
|
+
プライバシーポリシー・利用規約などの静的文書画面は `DocumentScreen` + `Prose` を使います。見出し・本文・最終更新日・戻るヘッダのタイポとスペーシングは DS 側で一元管理されるため、consumer は `sections` の原稿データだけ持てば済みます。
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
import { DocumentScreen, Prose } from "ksk-design-system/native/ui"
|
|
223
|
+
|
|
224
|
+
const POLICY_SECTIONS = [
|
|
225
|
+
{ title: "個人情報の取得", body: ["本アプリは以下の情報を取得します。", "…"] },
|
|
226
|
+
{ title: "個人情報の利用目的", body: ["取得した情報は次の目的で利用します。"] },
|
|
227
|
+
]
|
|
228
|
+
|
|
229
|
+
<DocumentScreen title="プライバシーポリシー" lastUpdated="2026年7月7日" onBack={() => navigation.goBack()}>
|
|
230
|
+
<Prose sections={POLICY_SECTIONS} />
|
|
231
|
+
</DocumentScreen>
|
|
232
|
+
```
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"name": "KSK Design System — Component Contracts",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.43.0",
|
|
5
5
|
"description": "全コンポーネントの構造化定義。バリアント・アクセシビリティ要件・使用ルールを機械可読形式で管理。",
|
|
6
6
|
"counts": {
|
|
7
|
-
"ui":
|
|
7
|
+
"ui": 61,
|
|
8
8
|
"patterns": 52,
|
|
9
9
|
"commerce": 12,
|
|
10
10
|
"admin": 8,
|
|
11
11
|
"shells": 3,
|
|
12
|
-
"total":
|
|
12
|
+
"total": 136
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"ui": [
|
|
@@ -72,6 +72,51 @@
|
|
|
72
72
|
"Must use <Input> not <input>"
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
"name": "CommitInput",
|
|
77
|
+
"path": "src/components/ui/commit-input.tsx",
|
|
78
|
+
"description": "IME(日本語変換)を壊さない Input の確定時コミット版。value + onCommit contract。store 直結の inline 編集で、変換中に onChange が store へ書き込んで変換が中断される問題を防ぐ。視覚は Input に完全委譲。共通ロジックは useCommitDraft フック。",
|
|
79
|
+
"variants": [],
|
|
80
|
+
"accessibility": [
|
|
81
|
+
"Must pair with <Label>"
|
|
82
|
+
],
|
|
83
|
+
"rules": [
|
|
84
|
+
"value/onCommit contract。value は controlled、確定タイミングでのみ onCommit が呼ばれる",
|
|
85
|
+
"変換(composition)中は commit せず draft のみ更新。compositionEnd / 非変換入力時に commit",
|
|
86
|
+
"外部 value 変更は非変換中のみ draft へ反映(realtime 同期対応)",
|
|
87
|
+
"store 直結 controlled input で IME が壊れる場合に Input の代わりに使う"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "CommitTextarea",
|
|
92
|
+
"path": "src/components/ui/commit-textarea.tsx",
|
|
93
|
+
"description": "IME(日本語変換)を壊さない Textarea の確定時コミット版。value + onCommit contract。CommitInput と同じ流儀で compositionEnd / 非変換入力時のみ commit。視覚は Textarea に完全委譲。共通ロジックは useCommitDraft フック。",
|
|
94
|
+
"variants": [],
|
|
95
|
+
"accessibility": [
|
|
96
|
+
"Must pair with <Label>"
|
|
97
|
+
],
|
|
98
|
+
"rules": [
|
|
99
|
+
"value/onCommit contract。value は controlled、確定タイミングでのみ onCommit が呼ばれる",
|
|
100
|
+
"変換(composition)中は commit せず draft のみ更新。compositionEnd / 非変換入力時に commit",
|
|
101
|
+
"外部 value 変更は非変換中のみ draft へ反映(realtime 同期対応)",
|
|
102
|
+
"store 直結 controlled textarea で IME が壊れる場合に Textarea の代わりに使う"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "CommitAutoGrowTextarea",
|
|
107
|
+
"path": "src/components/ui/commit-auto-grow-textarea.tsx",
|
|
108
|
+
"description": "IME(日本語変換)を壊さない AutoGrowTextarea の確定時コミット版。value + onCommit contract。AutoGrowTextarea の onChange は (value:string) を渡すため変換中判定は内部 composingRef のみで行う。視覚・auto-grow は AutoGrowTextarea に完全委譲。共通ロジックは useCommitDraft フック。",
|
|
109
|
+
"variants": [],
|
|
110
|
+
"accessibility": [
|
|
111
|
+
"Must pair with <Label>"
|
|
112
|
+
],
|
|
113
|
+
"rules": [
|
|
114
|
+
"value/onCommit contract。value は controlled、確定タイミングでのみ onCommit が呼ばれる",
|
|
115
|
+
"変換(composition)中は commit せず draft のみ更新。compositionEnd / 非変換入力時に commit",
|
|
116
|
+
"外部 value 変更は非変換中のみ draft へ反映(realtime 同期対応)",
|
|
117
|
+
"store 直結 controlled AutoGrowTextarea で IME が壊れる場合に代わりに使う"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
75
120
|
{
|
|
76
121
|
"name": "Calendar",
|
|
77
122
|
"path": "src/components/ui/calendar.tsx",
|