@k8ordo/ui 1.0.0 → 2.0.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.
Files changed (85) hide show
  1. package/README.md +37 -12
  2. package/dist/components/ai/conversation/conversation.d.mts +8 -10
  3. package/dist/components/ai/conversation/conversation.mjs +1 -6
  4. package/dist/components/ai/conversation/index.d.mts +15 -1
  5. package/dist/components/ai/conversation/index.mjs +8 -1
  6. package/dist/components/ai/index.d.mts +5 -9
  7. package/dist/components/ai/index.mjs +4 -4
  8. package/dist/components/ai/message/index.d.mts +12 -1
  9. package/dist/components/ai/message/index.mjs +7 -1
  10. package/dist/components/ai/message/message.d.mts +3 -5
  11. package/dist/components/ai/message/message.mjs +1 -5
  12. package/dist/components/ai/prompt-input/index.d.mts +23 -1
  13. package/dist/components/ai/prompt-input/index.mjs +8 -1
  14. package/dist/components/ai/prompt-input/prompt-input.d.mts +4 -6
  15. package/dist/components/ai/prompt-input/prompt-input.mjs +1 -6
  16. package/dist/components/ai/suggestion/index.d.mts +13 -1
  17. package/dist/components/ai/suggestion/index.mjs +7 -1
  18. package/dist/components/ai/suggestion/suggestion.d.mts +3 -5
  19. package/dist/components/ai/suggestion/suggestion.mjs +1 -5
  20. package/dist/components/buttons/icon-button/icon-button.mjs +1 -1
  21. package/dist/components/form/checkbox/checkbox.d.mts +1 -0
  22. package/dist/components/form/checkbox/checkbox.mjs +3 -2
  23. package/dist/components/form/checkbox-group/index.d.mts +1 -0
  24. package/dist/components/form/file-field/file-field.d.mts +12 -15
  25. package/dist/components/form/file-field/file-field.mjs +1 -6
  26. package/dist/components/form/file-field/index.d.mts +17 -1
  27. package/dist/components/form/file-field/index.mjs +8 -1
  28. package/dist/components/form/radio/radio.d.mts +1 -0
  29. package/dist/components/form/radio/radio.mjs +3 -2
  30. package/dist/components/index.d.mts +15 -21
  31. package/dist/components/index.mjs +7 -7
  32. package/dist/components/navigation/anchor/anchor.mjs +1 -1
  33. package/dist/components/navigation/tabs/index.d.mts +19 -1
  34. package/dist/components/navigation/tabs/index.mjs +9 -1
  35. package/dist/components/navigation/tabs/tabs.d.mts +16 -18
  36. package/dist/components/navigation/tabs/tabs.mjs +1 -7
  37. package/dist/components/overlays/dialog/dialog.d.mts +12 -16
  38. package/dist/components/overlays/dialog/dialog.mjs +1 -6
  39. package/dist/components/overlays/dialog/index.d.mts +17 -1
  40. package/dist/components/overlays/dialog/index.mjs +8 -1
  41. package/dist/components/overlays/dropdown-menu/dropdown-menu.d.mts +20 -24
  42. package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +2 -11
  43. package/dist/components/overlays/dropdown-menu/index.d.mts +31 -1
  44. package/dist/components/overlays/dropdown-menu/index.mjs +12 -1
  45. package/dist/components/overlays/dropdown-menu/sub-menu.mjs +1 -1
  46. package/dist/components/overlays/list-box/index.d.mts +27 -1
  47. package/dist/components/overlays/list-box/index.mjs +9 -1
  48. package/dist/components/overlays/list-box/list-box.d.mts +20 -22
  49. package/dist/components/overlays/list-box/list-box.mjs +2 -8
  50. package/dist/components/overlays/popover/index.d.mts +24 -1
  51. package/dist/components/overlays/popover/index.mjs +8 -1
  52. package/dist/components/overlays/popover/popover.d.mts +18 -20
  53. package/dist/components/overlays/popover/popover.mjs +2 -7
  54. package/dist/components/overlays/tooltip/index.d.mts +21 -1
  55. package/dist/components/overlays/tooltip/index.mjs +8 -1
  56. package/dist/components/overlays/tooltip/tooltip.d.mts +18 -22
  57. package/dist/components/overlays/tooltip/tooltip.mjs +2 -7
  58. package/dist/hooks/index.d.mts +1 -4
  59. package/dist/hooks/index.mjs +2 -5
  60. package/dist/index.d.mts +13 -15
  61. package/dist/index.mjs +9 -12
  62. package/dist/integrations/_shared/renderers.mjs +7 -7
  63. package/dist/integrations/_shared/schemas.d.mts +1 -1
  64. package/dist/{hooks/focus-trap/index.d.mts → internal/focus-trap.d.mts} +1 -1
  65. package/dist/{hooks/focus-trap/index.mjs → internal/focus-trap.mjs} +1 -1
  66. package/dist/styles/index.css +0 -8
  67. package/docs/GUIDE.md +148 -133
  68. package/docs/llms.txt +11 -7
  69. package/docs/props.generated.json +18 -0
  70. package/docs/references/ai-chat.md +67 -67
  71. package/docs/references/color.md +108 -107
  72. package/docs/references/components.md +318 -310
  73. package/docs/references/generative-ui.md +51 -30
  74. package/docs/references/helpers.md +155 -52
  75. package/docs/references/hooks.md +61 -74
  76. package/docs/references/interaction-design.md +47 -47
  77. package/docs/references/spatial-design.md +83 -81
  78. package/docs/references/typography.md +68 -67
  79. package/package.json +32 -33
  80. package/dist/hooks/hash/index.d.mts +0 -4
  81. package/dist/hooks/hash/index.mjs +0 -25
  82. package/dist/hooks/local-storage/index.d.mts +0 -4
  83. package/dist/hooks/local-storage/index.mjs +0 -46
  84. package/dist/hooks/session-storage/index.d.mts +0 -4
  85. package/dist/hooks/session-storage/index.mjs +0 -46
@@ -1,137 +1,139 @@
1
- # スペーシング・レイアウト
1
+ # Spacing and layout
2
2
 
3
- k8ordo UI は「余白で語る」デザイン。詰め込まず、空間にゆとりを持たせる。
3
+ `@k8ordo/ui` is a design that lets the spacing speak. Do not pack things in;
4
+ leave room.
4
5
 
5
- ## スペーシングの原則
6
+ ## Spacing principles
6
7
 
7
- 4pt ベースのスペーシングシステム。Tailwind の標準スケールを使用。
8
+ A 4pt spacing system, using Tailwind's standard scale.
8
9
 
9
- ### コンポーネント内部パディング
10
+ ### Padding inside a component
10
11
 
11
- | 用途 | クラス | 値 |
12
- | -------------- | ------ | ---- |
13
- | コンパクト | `p-4` | 16px |
14
- | 標準 | `p-6` | 24px |
15
- | ゆったり | `p-8` | 32px |
16
- | 大きなカード内 | `p-10` | 40px |
12
+ | Use | Class | Value |
13
+ | ----------------- | ------ | ----- |
14
+ | Compact | `p-4` | 16px |
15
+ | Standard | `p-6` | 24px |
16
+ | Generous | `p-8` | 32px |
17
+ | Inside a big card | `p-10` | 40px |
17
18
 
18
- ### テキスト間の余白
19
+ ### Spacing between blocks of text
19
20
 
20
- | 関係性 | クラス | 用途 |
21
- | -------------- | ------- | ---------------------------- |
22
- | 近い要素 | `mt-2` | 説明テキスト、ヘルプテキスト |
23
- | 標準 | `mt-4` | 段落間、フォームフィールド間 |
24
- | セクション間 | `mt-8` | セクション区切り |
25
- | 大セクション間 | `mt-12` | ページレベルの区切り |
21
+ | Relationship | Class | Use |
22
+ | ---------------------- | ------- | --------------------------------------- |
23
+ | Closely related | `mt-2` | Descriptions, help text |
24
+ | Standard | `mt-4` | Between paragraphs, between form fields |
25
+ | Between sections | `mt-8` | A section break |
26
+ | Between major sections | `mt-12` | A page-level break |
26
27
 
27
- ### セクション間の余白
28
+ ### Spacing between sections
28
29
 
29
- | 関係性 | クラス | 用途 |
30
- | ------------ | ------------------- | -------------------------- |
31
- | カード間 | `gap-6` | 横並びカード(グリッド内) |
32
- | セクション間 | `gap-8` 〜 `gap-10` | 縦に並ぶセクション |
30
+ | Relationship | Class | Use |
31
+ | ---------------- | ------------------ | ------------------------------ |
32
+ | Between cards | `gap-6` | Cards side by side (in a grid) |
33
+ | Between sections | `gap-8` – `gap-10` | Sections stacked vertically |
33
34
 
34
- ## 角丸
35
+ ## Border radius
35
36
 
36
- **「触れるものは柔らかく、読むものは端正に」**
37
+ **"Soft where you touch, precise where you read."**
37
38
 
38
- 要素の性格に応じて角丸を使い分ける。
39
+ Vary the radius with the element's role.
39
40
 
40
- ### 触れるもの(柔らかく)
41
+ ### Things you touch (soft)
41
42
 
42
- | 用途 | クラス | 値 |
43
- | ----------------------------- | -------------- | ------ |
44
- | Button | `rounded-full` | ピル型 |
45
- | Input, Textarea, Select | `rounded-xl` | 1rem |
46
- | Card, CheckboxCard, RadioCard | `rounded-xl` | 1rem |
43
+ | Use | Class | Value |
44
+ | ----------------------------- | -------------- | ----- |
45
+ | Button | `rounded-full` | Pill |
46
+ | Input, Textarea, Select | `rounded-xl` | 1rem |
47
+ | Card, CheckboxCard, RadioCard | `rounded-xl` | 1rem |
47
48
 
48
- ### 読むもの(端正に)
49
+ ### Things you read (precise)
49
50
 
50
- | 用途 | クラス | 値 |
51
- | -------- | -------------- | ---------------------------- |
52
- | Alert | `rounded-lg` | 0.75rem |
53
- | Badge | `rounded-full` | ピル型(小さいので問題ない) |
54
- | Tabs | 現行のまま | |
55
- | Checkbox | `rounded-md` | 0.5rem |
51
+ | Use | Class | Value |
52
+ | -------- | -------------- | ------------------------------ |
53
+ | Alert | `rounded-lg` | 0.75rem |
54
+ | Badge | `rounded-full` | Pill (fine, since it is small) |
55
+ | Tabs | As-is | |
56
+ | Checkbox | `rounded-md` | 0.5rem |
56
57
 
57
- ### その他
58
+ ### Everything else
58
59
 
59
- | 用途 | クラス |
60
- | ---------------------------------- | -------------- |
61
- | Dialog, Modal | `rounded-lg` |
62
- | Avatar, IconButton, プログレスバー | `rounded-full` |
60
+ | Use | Class |
61
+ | -------------------------------- | -------------- |
62
+ | Dialog, Modal | `rounded-lg` |
63
+ | Avatar, IconButton, progress bar | `rounded-full` |
63
64
 
64
- ## シャドウ
65
+ ## Shadow
65
66
 
66
- ふんわり柔らかい影で奥行きを表現する。
67
+ Express depth with a soft, gentle shadow.
67
68
 
68
- | 用途 | スタイル |
69
- | ------------------------ | ------------------------------------------------------- |
70
- | Card(デフォルト) | `shadow-sm`(appearance="shadow" 時) |
71
- | Card(ボーダー) | `border border-border-mute`(appearance="bordered" 時) |
72
- | Modal / Dialog / Tooltip | `shadow-md` |
73
- | Dropdown / ListBox | `shadow-md` |
74
- | Button | なし |
69
+ | Use | Style |
70
+ | ------------------------ | ---------------------------------------------------------- |
71
+ | Card (default) | `shadow-sm` (with `appearance="shadow"`) |
72
+ | Card (bordered) | `border border-border-mute` (with `appearance="bordered"`) |
73
+ | Modal / Dialog / Tooltip | `shadow-md` |
74
+ | Dropdown / ListBox | `shadow-md` |
75
+ | Button | None |
75
76
 
76
- `shadow-xl` 以上は使わない。
77
+ Never use `shadow-xl` or heavier.
77
78
 
78
- ## ページ構造
79
+ ## Page structure
79
80
 
80
- ### bg-subtle + 白カードの基本パターン
81
+ ### The bg-subtle plus white card pattern
81
82
 
82
- ページ背景を `bg-bg-subtle`(薄いグレー)にし、コンテンツを白いカードで浮かせる。
83
+ Make the page background `bg-bg-subtle` (a light grey) and float the content on
84
+ white cards.
83
85
 
84
86
  ```tsx
85
- // Good: 灰色背景に白カードが浮く
87
+ // Good: a white card floating on a grey ground
86
88
  <div className="bg-bg-subtle min-h-screen">
87
89
  <Card appearance="shadow">
88
- <div className="p-8">コンテンツ</div>
90
+ <div className="p-8">Content</div>
89
91
  </Card>
90
92
  </div>
91
93
  ```
92
94
 
93
- ### 余白で階層を作る
95
+ ### Build hierarchy out of spacing
94
96
 
95
97
  ```tsx
96
- // Good: 余白の差で関連度を示す
98
+ // Good: the size of the gap shows how related things are
97
99
  <section className="mt-12">
98
- <Heading level="h2">セクション</Heading>
99
- <p className="mt-2">直接関連する説明</p>
100
- <div className="mt-8">やや離れたコンテンツ</div>
100
+ <Heading level="h2">Section</Heading>
101
+ <p className="mt-2">A description that belongs to it</p>
102
+ <div className="mt-8">Content that sits a little apart</div>
101
103
  </section>
102
104
 
103
- // Bad: すべて同じ余白
105
+ // Bad: the same gap everywhere
104
106
  <section className="mt-4">
105
- <Heading level="h2">セクション</Heading>
106
- <p className="mt-4">説明</p>
107
- <div className="mt-4">コンテンツ</div>
107
+ <Heading level="h2">Section</Heading>
108
+ <p className="mt-4">Description</p>
109
+ <div className="mt-4">Content</div>
108
110
  </section>
109
111
  ```
110
112
 
111
- ### カードは万能ではない
113
+ ### A card is not the answer to everything
112
114
 
113
- すべてのコンテンツをカードに入れる必要はない。余白とセパレーターで十分なケースが多い。
115
+ Content does not have to go in a card. Spacing and a separator are often enough.
114
116
 
115
117
  ```tsx
116
118
  import { Separator } from '@k8ordo/ui';
117
119
 
118
- // Good: セパレーターで区切る
120
+ // Good: divide with a separator
119
121
  <div>
120
- <section>コンテンツA</section>
122
+ <section>Content A</section>
121
123
  <div className="py-8">
122
124
  <Separator />
123
125
  </div>
124
- <section>コンテンツB</section>
126
+ <section>Content B</section>
125
127
  </div>
126
128
 
127
- // 過剰: すべてカードに入れる
128
- <Card>コンテンツA</Card>
129
- <Card>コンテンツB</Card>
129
+ // Excessive: everything in a card
130
+ <Card>Content A</Card>
131
+ <Card>Content B</Card>
130
132
  ```
131
133
 
132
- ## やってはいけないこと
134
+ ## What not to do
133
135
 
134
- - `gap-1` や `p-1` のような極端に狭いスペーシング
135
- - コンテンツの詰め込み(情報密度より余白を優先)
136
- - ネストされたカード(Card in Card)
137
- - 12 を超える z-index 値
136
+ - Extremely tight spacing such as `gap-1` or `p-1`
137
+ - Cramming content in (space wins over information density)
138
+ - Nested cards (Card in Card)
139
+ - A z-index above 12
@@ -1,110 +1,111 @@
1
- # タイポグラフィ
1
+ # Typography
2
2
 
3
- k8ordo UI のタイポグラフィは「読みやすさ」と「静けさ」を両立する。
3
+ Typography in `@k8ordo/ui` aims for readability and quiet at the same time.
4
4
 
5
- ## フォントファミリー
5
+ ## Font family
6
6
 
7
- 日本語最適化のフォントスタック。
7
+ A font stack tuned for Japanese.
8
8
 
9
9
  ```css
10
10
  font-family: 'Noto Sans JP', 'M PLUS 2', sans-serif;
11
11
  ```
12
12
 
13
- - **Inter / Roboto / Open Sans は使わない** — AI が生成した感が出る
14
- - 日本語テキストが主体のため、和文フォントを優先
13
+ - **Do not use Inter / Roboto / Open Sans** — they read as AI-generated
14
+ - Japanese text dominates, so Japanese faces come first
15
15
 
16
- ## フォントサイズスケール
16
+ ## Font size scale
17
17
 
18
- | Tailwind クラス | 値 | 用途 |
19
- | ---------------- | -------- | -------------------- |
20
- | `text-xs` | 0.75rem | 注釈、キャプション |
21
- | `text-sm` | 0.875rem | 補足テキスト、ラベル |
22
- | `text-md` | 1rem | 本文(デフォルト) |
23
- | `text-lg` | 1.125rem | 小見出し |
24
- | `text-xl` | 1.25rem | 見出し |
25
- | `text-2xl` | 1.5rem | 大見出し |
26
- | `text-3xl` | 1.875rem | ページタイトル |
27
- | `text-emphasize` | 3rem | 強調表示 |
28
- | `text-highlight` | 6rem | ハイライト表示 |
18
+ | Tailwind class | Value | Use |
19
+ | ---------------- | -------- | ----------------------- |
20
+ | `text-xs` | 0.75rem | Annotations, captions |
21
+ | `text-sm` | 0.875rem | Supporting text, labels |
22
+ | `text-md` | 1rem | Body text (default) |
23
+ | `text-lg` | 1.125rem | Subheadings |
24
+ | `text-xl` | 1.25rem | Headings |
25
+ | `text-2xl` | 1.5rem | Large headings |
26
+ | `text-3xl` | 1.875rem | Page titles |
27
+ | `text-emphasize` | 3rem | Emphasis display |
28
+ | `text-highlight` | 6rem | Highlight display |
29
29
 
30
- ## フォントウェイト
30
+ ## Font weight
31
31
 
32
- ウェイトは控えめに使う。太字の多用は「静けさ」を損なう。
32
+ Use weight sparingly. Heavy type undermines the quiet.
33
33
 
34
- | Tailwind クラス | 値 | 用途 |
35
- | --------------- | --- | ---------------------------- |
36
- | `font-normal` | 400 | 本文 |
37
- | `font-medium` | 450 | 強調テキスト(控えめな強調) |
38
- | `font-bold` | 700 | 見出し、ボタンラベル |
34
+ | Tailwind class | Value | Use |
35
+ | -------------- | ----- | ------------------------------------- |
36
+ | `font-normal` | 400 | Body text |
37
+ | `font-medium` | 450 | Emphasized text (restrained emphasis) |
38
+ | `font-bold` | 700 | Headings, button labels |
39
39
 
40
- - `font-semibold` (600) や `font-extrabold` (800) は使わない
41
- - `font-medium` が 450 であることに注意(一般的な 500 より軽い)
40
+ - Do not use `font-semibold` (600) or `font-extrabold` (800)
41
+ - Note that `font-medium` is 450 here — lighter than the usual 500
42
42
 
43
- ## 行間
43
+ ## Line height
44
44
 
45
- 日本語テキストは欧文より広い行間が必要。
45
+ Japanese text needs more leading than Latin text.
46
46
 
47
- | Tailwind クラス | 値 | 用途 |
48
- | ----------------- | ----- | ------------------------ |
49
- | `leading-none` | 1 | 特殊用途(highlight 等) |
50
- | `leading-tight` | 1.25 | 見出し |
51
- | `leading-snug` | 1.375 | 小見出し |
52
- | `leading-normal` | 1.5 | リスト内、デフォルト |
53
- | `leading-relaxed` | 1.625 | 本文(推奨) |
54
- | `leading-loose` | 2 | 広い行間が必要な場合 |
47
+ | Tailwind class | Value | Use |
48
+ | ----------------- | ----- | ------------------------------- |
49
+ | `leading-none` | 1 | Special cases (highlight, …) |
50
+ | `leading-tight` | 1.25 | Headings |
51
+ | `leading-snug` | 1.375 | Subheadings |
52
+ | `leading-normal` | 1.5 | Inside lists; the default |
53
+ | `leading-relaxed` | 1.625 | Body text (recommended) |
54
+ | `leading-loose` | 2 | When wide leading is called for |
55
55
 
56
- ## 字間
56
+ ## Letter spacing
57
57
 
58
- | Tailwind クラス | 値 | 用途 |
59
- | ----------------- | ------- | ---------------- |
60
- | `tracking-none` | 0em | デフォルト |
61
- | `tracking-normal` | 0.025em | 少し広げたい場合 |
58
+ | Tailwind class | Value | Use |
59
+ | ----------------- | ------- | --------------------------- |
60
+ | `tracking-none` | 0em | Default |
61
+ | `tracking-normal` | 0.025em | When a little air is wanted |
62
62
 
63
- ## Heading コンポーネント
63
+ ## The Heading component
64
64
 
65
- 見出しには `Heading` コンポーネントを使う。
65
+ Use the `Heading` component for headings.
66
66
 
67
67
  ```tsx
68
68
  import { Heading } from '@k8ordo/ui';
69
69
 
70
- <Heading level="h1">ページタイトル</Heading>
71
- <Heading level="h2">セクション見出し</Heading>
72
- <Heading level="h3">サブセクション</Heading>
70
+ <Heading level="h1">Page title</Heading>
71
+ <Heading level="h2">Section heading</Heading>
72
+ <Heading level="h3">Subsection</Heading>
73
73
  ```
74
74
 
75
- ## 縦書きモード
75
+ ## Vertical writing mode
76
76
 
77
- 縦書き表示には専用のユーティリティと variant を用意している。
77
+ Dedicated utilities and a variant are provided for vertical writing.
78
78
 
79
- ### ユーティリティ
79
+ ### Utilities
80
80
 
81
- | Tailwind クラス | 用途 |
82
- | --------------- | ----------------------------------------------------------------------------------------------------------- |
83
- | `writing-h` | 横書き (`writing-mode: horizontal-tb`) に戻す。縦書きツリー内の図表・コードブロック・置換要素などで使う。 |
84
- | `writing-v` | 縦書き (`writing-mode: vertical-rl`) を適用し、`text-orientation: mixed` などの推奨初期値も一括で設定する。 |
81
+ | Tailwind class | Use |
82
+ | -------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
83
+ | `writing-h` | Return to horizontal (`writing-mode: horizontal-tb`). Use it for figures, code blocks, and replaced elements inside a vertical tree. |
84
+ | `writing-v` | Apply vertical writing (`writing-mode: vertical-rl`) together with the recommended defaults such as `text-orientation: mixed`. |
85
85
 
86
- ### `vertical:` variant
86
+ ### The `vertical:` variant
87
87
 
88
- `.writing-v` 子孫で活性化し、`.writing-h` 子孫では無効化する Tailwind variant。横書きデフォルトに対する上書きを宣言的に書ける。
88
+ A Tailwind variant that activates inside a `.writing-v` subtree and is disabled
89
+ inside `.writing-h`. It lets you override a horizontal default declaratively.
89
90
 
90
91
  ```tsx
91
92
  <div className="writing-v">
92
93
  <p className="my-4 vertical:my-0">
93
- {/* 横書き時のみ縦マージン、縦書きでは外す */}
94
+ {/* Vertical margin only in horizontal mode; dropped when vertical */}
94
95
  </p>
95
96
  </div>
96
97
  ```
97
98
 
98
- ### 注意点
99
+ ### Caveats
99
100
 
100
- - 画像・iframe などの置換要素は `vertical-rl` で大きさが想定通りにならないことがある。`<img className="vertical:writing-h" />` のように要素自体は横書きに戻す。
101
- - `-webkit-line-clamp` (`line-clamp-*`) は Safari で `writing-mode` と干渉する。縦書きでは `block-size` 上限 + `overflow: hidden` に置き換える。
102
- - KaTeX など内部で水平レイアウトを前提とするライブラリは、必要箇所だけ `writing-h` を上書きする。
101
+ - Replaced elements such as images and iframes may not size as expected under `vertical-rl`. Return the element itself to horizontal, as in `<img className="vertical:writing-h" />`.
102
+ - `-webkit-line-clamp` (`line-clamp-*`) conflicts with `writing-mode` in Safari. In vertical mode, replace it with a `block-size` cap plus `overflow: hidden`.
103
+ - Libraries that assume horizontal layout internally, such as KaTeX, need `writing-h` applied only where required.
103
104
 
104
- ## やってはいけないこと
105
+ ## What not to do
105
106
 
106
- - 3種類以上のフォントウェイトを1画面で使う
107
- - `text-3xl` より大きいサイズを通常テキストに使う(`text-emphasize` / `text-highlight` は特殊用途)
108
- - `uppercase` や `tracking-widest` を日本語テキストに適用する
109
- - テキストにグラデーションをかける
110
- - フォントサイズだけで階層を作る(余白も活用する)
107
+ - Use three or more font weights on one screen
108
+ - Use anything larger than `text-3xl` for ordinary text (`text-emphasize` and `text-highlight` are for special cases)
109
+ - Apply `uppercase` or `tracking-widest` to Japanese text
110
+ - Apply a gradient to text
111
+ - Build hierarchy from font size alone — use spacing as well
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@k8ordo/ui",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "k8o's React UI library with built-in generative UI adapters (json-render & OpenUI) for LLM-driven, on-brand interfaces",
5
5
  "keywords": [
6
6
  "ai",
@@ -26,7 +26,6 @@
26
26
  "url": "git+https://github.com/k35o/k8ordo.git"
27
27
  },
28
28
  "files": [
29
- "CHANGELOG.md",
30
29
  "dist/**",
31
30
  "docs/**"
32
31
  ],
@@ -83,24 +82,6 @@
83
82
  "access": "public",
84
83
  "registry": "https://registry.npmjs.org"
85
84
  },
86
- "scripts": {
87
- "build": "vp pack && pnpm build:css",
88
- "build:css": "node scripts/build-css.ts",
89
- "generate:tokens": "tailwind-token-extractor src/styles/index.css -o src/styles/tokens.generated.ts",
90
- "check:tokens": "tailwind-token-extractor check src/styles/index.css -o src/styles/tokens.generated.ts",
91
- "generate:props": "node scripts/extract-props.ts && node scripts/generate-components-md.ts",
92
- "check:props": "node scripts/extract-props.ts --check && node scripts/generate-components-md.ts --check",
93
- "check:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css ./tailwind.css",
94
- "storybook": "storybook dev -p 6006 --no-open",
95
- "build-storybook": "storybook build",
96
- "test:vrt": "VRT=1 vitest run --project=components",
97
- "test": "vitest run",
98
- "test:ui": "vitest --ui --coverage",
99
- "test:coverage": "vitest run --coverage",
100
- "typecheck": "tsc --noEmit",
101
- "check": "vp check",
102
- "check:write": "vp check --fix"
103
- },
104
85
  "dependencies": {
105
86
  "clsx": "2.1.1",
106
87
  "lucide-react": "1.31.0",
@@ -118,29 +99,29 @@
118
99
  "@storybook/addon-mcp": "0.7.0",
119
100
  "@storybook/addon-vitest": "10.5.8",
120
101
  "@storybook/react-vite": "10.5.8",
121
- "@tailwindcss/postcss": "catalog:",
122
- "@types/react": "catalog:",
123
- "@types/react-dom": "catalog:",
124
- "@vitejs/plugin-react": "catalog:",
102
+ "@tailwindcss/postcss": "4.3.3",
103
+ "@types/react": "19.2.18",
104
+ "@types/react-dom": "19.2.4",
105
+ "@vitejs/plugin-react": "6.0.5",
125
106
  "@vitest/browser-playwright": "4.1.10",
126
107
  "@vitest/coverage-v8": "4.1.10",
127
108
  "@vitest/ui": "4.1.10",
128
109
  "ai": "7.0.65",
129
- "postcss": "catalog:",
110
+ "postcss": "8.5.26",
130
111
  "publint": "0.3.23",
131
- "react": "catalog:",
132
- "react-dom": "catalog:",
112
+ "react": "19.2.8",
113
+ "react-dom": "19.2.8",
133
114
  "storybook": "10.5.8",
134
115
  "storybook-addon-determinism": "0.1.2",
135
116
  "storybook-addon-mock-date": "3.1.1",
136
117
  "storybook-addon-vrt": "0.4.0",
137
118
  "streamdown": "2.5.0",
138
119
  "tailwind-token-extractor": "0.2.1",
139
- "tailwindcss": "catalog:",
120
+ "tailwindcss": "4.3.3",
140
121
  "typescript": "7.0.2",
141
- "vite": "catalog:",
142
- "vite-plus": "catalog:",
143
- "vitest": "catalog:",
122
+ "vite": "8.2.1",
123
+ "vite-plus": "0.2.9",
124
+ "vitest": "4.1.10",
144
125
  "vitest-browser-react": "2.2.0",
145
126
  "zod": "4.4.3"
146
127
  },
@@ -157,7 +138,7 @@
157
138
  "streamdown": ">=2.5.0",
158
139
  "tailwindcss": ">=4.3.3",
159
140
  "typescript": ">=7.0.2",
160
- "zod": ">=4.4.3"
141
+ "zod": "^4.4.3"
161
142
  },
162
143
  "peerDependenciesMeta": {
163
144
  "@json-render/core": {
@@ -193,5 +174,23 @@
193
174
  "zod": {
194
175
  "optional": true
195
176
  }
177
+ },
178
+ "scripts": {
179
+ "build": "vp pack && pnpm build:css",
180
+ "build:css": "node scripts/build-css.ts",
181
+ "generate:tokens": "tailwind-token-extractor src/styles/index.css -o src/styles/tokens.generated.ts",
182
+ "check:tokens": "tailwind-token-extractor check src/styles/index.css -o src/styles/tokens.generated.ts",
183
+ "generate:props": "node scripts/extract-props.ts && node scripts/generate-components-md.ts && node scripts/check-helpers-md.ts",
184
+ "check:props": "node scripts/extract-props.ts --check && node scripts/generate-components-md.ts --check && node scripts/check-helpers-md.ts",
185
+ "check:package": "publint && attw --pack . --profile esm-only --exclude-entrypoints ./styles.css ./tailwind.css",
186
+ "storybook": "storybook dev -p 6006 --no-open",
187
+ "build-storybook": "storybook build",
188
+ "test:vrt": "VRT=1 vitest run --project=components",
189
+ "test": "vitest run",
190
+ "test:ui": "vitest --ui --coverage",
191
+ "test:coverage": "vitest run --coverage",
192
+ "typecheck": "tsc --noEmit",
193
+ "check": "vp check",
194
+ "check:write": "vp check --fix"
196
195
  }
197
- }
196
+ }
@@ -1,4 +0,0 @@
1
- //#region src/hooks/hash/index.d.ts
2
- declare const useHash: () => string | null;
3
- //#endregion
4
- export { useHash };
@@ -1,25 +0,0 @@
1
- "use client";
2
- import { useSyncExternalStore } from "react";
3
- //#region src/hooks/hash/index.ts
4
- const getHash = () => typeof window === "undefined" ? null : decodeURIComponent(window.location.hash.replace("#", ""));
5
- const subscribe = (callback) => {
6
- const originalPushState = window.history.pushState.bind(window.history);
7
- const originalReplaceState = window.history.replaceState.bind(window.history);
8
- window.history.pushState = (...args) => {
9
- originalPushState(...args);
10
- setTimeout(callback);
11
- };
12
- window.history.replaceState = (...args) => {
13
- originalReplaceState(...args);
14
- setTimeout(callback);
15
- };
16
- window.addEventListener("hashchange", callback);
17
- return () => {
18
- window.removeEventListener("hashchange", callback);
19
- };
20
- };
21
- const useHash = () => {
22
- return useSyncExternalStore(subscribe, () => getHash(), () => null);
23
- };
24
- //#endregion
25
- export { useHash };
@@ -1,4 +0,0 @@
1
- //#region src/hooks/local-storage/index.d.ts
2
- declare const useLocalStorage: <T>(key: string, initialValue: T) => readonly [T, (value: T) => void, () => void];
3
- //#endregion
4
- export { useLocalStorage };
@@ -1,46 +0,0 @@
1
- "use client";
2
- import { useCallback, useMemo, useRef, useSyncExternalStore } from "react";
3
- //#region src/hooks/local-storage/index.ts
4
- const dispatchStorageEvent = (key, newValue) => window.dispatchEvent(new StorageEvent("storage", {
5
- key,
6
- newValue
7
- }));
8
- const getLocalStorageItem = (key) => window.localStorage.getItem(key);
9
- const localStorageSubscribe = (cb) => {
10
- window.addEventListener("storage", cb);
11
- return () => {
12
- window.removeEventListener("storage", cb);
13
- };
14
- };
15
- const useLocalStorage = (key, initialValue) => {
16
- const initialValueRef = useRef(initialValue);
17
- const getSnapshot = () => getLocalStorageItem(key);
18
- const store = useSyncExternalStore(localStorageSubscribe, getSnapshot, () => null);
19
- const current = useMemo(() => {
20
- try {
21
- if (store === null) return initialValueRef.current;
22
- return JSON.parse(store);
23
- } catch (e) {
24
- console.error(e);
25
- return initialValueRef.current;
26
- }
27
- }, [store]);
28
- const handleRemove = useCallback(() => {
29
- window.localStorage.removeItem(key);
30
- dispatchStorageEvent(key, null);
31
- }, [key]);
32
- return [
33
- current,
34
- useCallback((value) => {
35
- if (value === void 0 || value === null) handleRemove();
36
- else {
37
- const stringifiedValue = JSON.stringify(value);
38
- window.localStorage.setItem(key, stringifiedValue);
39
- dispatchStorageEvent(key, stringifiedValue);
40
- }
41
- }, [key, handleRemove]),
42
- handleRemove
43
- ];
44
- };
45
- //#endregion
46
- export { useLocalStorage };
@@ -1,4 +0,0 @@
1
- //#region src/hooks/session-storage/index.d.ts
2
- declare const useSessionStorage: <T>(key: string, initialValue: T) => readonly [T, (value: T) => void, () => void];
3
- //#endregion
4
- export { useSessionStorage };