ksk-design-system 1.42.2 → 1.44.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 +74 -7
- package/dist/index.js +3517 -3311
- package/dist/native/ui.js +1604 -1309
- package/dist/{native-D6LJPc6D.js → native-BelCzh9_.js} +10 -0
- package/dist/native.js +1 -1
- package/dist/types/components/patterns/bottom-sheet-frame.d.ts +1 -1
- package/dist/types/components/patterns/commerce/bottom-tab-bar.d.ts +6 -0
- package/dist/types/components/patterns/document-page.d.ts +29 -0
- package/dist/types/components/patterns/prose.d.ts +21 -0
- 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/date-picker.d.ts +14 -2
- package/dist/types/components/ui/progress.d.ts +12 -1
- package/dist/types/components/ui/sheet.d.ts +56 -2
- package/dist/types/components/ui/skeleton.d.ts +22 -1
- package/dist/types/components/ui/use-commit-draft.d.ts +48 -0
- package/dist/types/index.d.ts +14 -2
- package/dist/types/native/components/AutoGrowTextarea.d.ts +2 -2
- package/dist/types/native/components/CommitAutoGrowTextarea.d.ts +14 -0
- package/dist/types/native/components/CommitInput.d.ts +23 -0
- package/dist/types/native/components/CommitTextarea.d.ts +14 -0
- package/dist/types/native/components/DocumentScreen.d.ts +22 -0
- package/dist/types/native/components/ErrorBoundary.d.ts +53 -0
- package/dist/types/native/components/Form.d.ts +25 -0
- package/dist/types/native/components/Input.d.ts +2 -2
- 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/Textarea.d.ts +2 -2
- package/dist/types/native/components/Toast.d.ts +52 -2
- package/dist/types/native/components/index.d.ts +8 -1
- package/dist/types/native/progress-logic.d.ts +23 -0
- package/dist/types/native/typography.d.ts +4 -2
- package/dist/types/native/use-commit-draft.d.ts +44 -0
- package/dist/types/native/use-web-composition-guard.d.ts +3 -0
- package/dist/types/tokens/native/scales.d.ts +10 -0
- package/package.json +1 -1
- package/src/components/COMPONENT_LOOKUP.md +9 -4
- package/src/native/COMPONENT_LOOKUP.md +10 -1
- package/src/preset.css +1 -0
- package/src/styles/glass.css +102 -1
- 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.44.0",
|
|
5
5
|
"description": "全コンポーネントの構造化定義。バリアント・アクセシビリティ要件・使用ルールを機械可読形式で管理。",
|
|
6
6
|
"counts": {
|
|
7
|
-
"ui":
|
|
8
|
-
"patterns":
|
|
7
|
+
"ui": 61,
|
|
8
|
+
"patterns": 54,
|
|
9
9
|
"commerce": 12,
|
|
10
10
|
"admin": 8,
|
|
11
11
|
"shells": 3,
|
|
12
|
-
"total":
|
|
12
|
+
"total": 138
|
|
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",
|
|
@@ -249,7 +294,7 @@
|
|
|
249
294
|
{
|
|
250
295
|
"name": "Sheet",
|
|
251
296
|
"path": "src/components/ui/sheet.tsx",
|
|
252
|
-
"description": "サイドパネル・ボトムシート。フィルター・メニュー・補助入力に使用。モーダルより軽いコンテキストに。snapPoints でスナップ式、swipeToClose で下スワイプ閉じを有効化。autoFocus / restoreFocusOnClose / closeOnEsc / bodyScrollLock でフォーカス・スクロール挙動を制御可能。",
|
|
297
|
+
"description": "サイドパネル・ボトムシート。フィルター・メニュー・補助入力に使用。モーダルより軽いコンテキストに。snapPoints でスナップ式、swipeToClose で下スワイプ閉じを有効化。autoFocus / restoreFocusOnClose / closeOnEsc / bodyScrollLock でフォーカス・スクロール挙動を制御可能。 多段(シートの上にシート)では open 順に overlay/content の z-index が自動繰り上げされ、zIndex / overlayClassName で上書き可能。",
|
|
253
298
|
"subcomponents": [
|
|
254
299
|
"SheetTrigger",
|
|
255
300
|
"SheetContent",
|
|
@@ -383,10 +428,13 @@
|
|
|
383
428
|
{
|
|
384
429
|
"name": "Skeleton",
|
|
385
430
|
"path": "src/components/ui/skeleton.tsx",
|
|
386
|
-
"description": "読み込み中プレースホルダ。width/height/rounded shorthand 対応。",
|
|
431
|
+
"description": "読み込み中プレースホルダ。width/height/rounded shorthand 対応。SkeletonText は lines 指定の複数行テキストプレースホルダ(最終行短縮)。",
|
|
387
432
|
"rules": [
|
|
388
433
|
"数値は px、文字列は CSS 値として渡る",
|
|
389
434
|
"rounded: none/sm/md/lg/xl/2xl/full プリセット"
|
|
435
|
+
],
|
|
436
|
+
"subcomponents": [
|
|
437
|
+
"SkeletonText"
|
|
390
438
|
]
|
|
391
439
|
},
|
|
392
440
|
{
|
|
@@ -922,6 +970,24 @@
|
|
|
922
970
|
"Color + icon + text. Include retry action."
|
|
923
971
|
]
|
|
924
972
|
},
|
|
973
|
+
{
|
|
974
|
+
"name": "Prose",
|
|
975
|
+
"path": "src/components/patterns/prose.tsx",
|
|
976
|
+
"description": "静的文書(プライバシーポリシー・利用規約等)の本文レンダラー。sections: {title, body: string[]}[] を受けて見出し+段落を統一タイポで描画する。native の Prose.tsx と props 形が一致。",
|
|
977
|
+
"rules": [
|
|
978
|
+
"見出しは typo-heading-md、段落は typo-body-md",
|
|
979
|
+
"DocumentPage の子として使う想定だが単体でも利用可"
|
|
980
|
+
]
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"name": "DocumentPage",
|
|
984
|
+
"path": "src/components/patterns/document-page.tsx",
|
|
985
|
+
"description": "プライバシーポリシー・利用規約などの静的文書ページ。タイトル・最終更新日・本文(Prose)を固定スペーシングで組む。native の DocumentScreen.tsx に対応(web は単体ページのため命名を DocumentPage とし、戻るナビは呼び出し側のシェルに委ねる)。",
|
|
986
|
+
"rules": [
|
|
987
|
+
"本文は max-w-2xl に収めて読みやすい行長にする",
|
|
988
|
+
"戻るナビは持たない。必要なら呼び出し側のレイアウトシェルで用意する"
|
|
989
|
+
]
|
|
990
|
+
},
|
|
925
991
|
{
|
|
926
992
|
"name": "SectionHeader",
|
|
927
993
|
"path": "src/components/patterns/section-header.tsx",
|
|
@@ -1575,9 +1641,10 @@
|
|
|
1575
1641
|
{
|
|
1576
1642
|
"name": "BottomSheetFrame",
|
|
1577
1643
|
"path": "src/components/patterns/bottom-sheet-frame.tsx",
|
|
1578
|
-
"description": "SheetContent の responsive outer frame preset。mobile-full / mobile-form / desktop-floating を宣言し、DetailSheetScaffold と KeyboardAwareSheetFooter を内側で合成する。",
|
|
1644
|
+
"description": "SheetContent の responsive outer frame preset。mobile-full / mobile-page(iOS ページシート風・上端 2rem ギャップ)/ mobile-form / desktop-floating を宣言し、DetailSheetScaffold と KeyboardAwareSheetFooter を内側で合成する。",
|
|
1579
1645
|
"variants": [
|
|
1580
1646
|
"mobile-full",
|
|
1647
|
+
"mobile-page",
|
|
1581
1648
|
"mobile-form",
|
|
1582
1649
|
"desktop-floating"
|
|
1583
1650
|
],
|