@godxjp/ui 20.0.0 → 20.1.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 (250) hide show
  1. package/README.md +8 -2
  2. package/dist/app/theme-axes.d.ts +2 -0
  3. package/dist/app/theme-axes.js +45 -0
  4. package/dist/components/charts/chart-cartesian.d.ts +2 -1
  5. package/dist/components/charts/chart-cartesian.js +52 -3
  6. package/dist/components/charts/chart-category-axis.d.ts +55 -0
  7. package/dist/components/charts/chart-category-axis.js +93 -0
  8. package/dist/components/charts/chart-frame.d.ts +10 -1
  9. package/dist/components/charts/chart-frame.js +19 -3
  10. package/dist/components/charts/compact-bar-trend.d.ts +1 -1
  11. package/dist/components/charts/compact-bar-trend.js +2 -0
  12. package/dist/components/charts/pie-chart.d.ts +1 -1
  13. package/dist/components/charts/pie-chart.js +12 -1
  14. package/dist/components/charts/recharts-peer.d.ts +49 -0
  15. package/dist/components/charts/recharts-peer.js +45 -0
  16. package/dist/components/data-display/card.d.ts +12 -1
  17. package/dist/components/data-display/card.js +22 -4
  18. package/dist/components/data-display/code-block.js +6 -2
  19. package/dist/components/data-display/data-table.d.ts +39 -4
  20. package/dist/components/data-display/data-table.js +802 -270
  21. package/dist/components/data-display/descriptions.d.ts +27 -6
  22. package/dist/components/data-display/descriptions.js +58 -17
  23. package/dist/components/data-display/index.d.ts +2 -0
  24. package/dist/components/data-display/index.js +2 -0
  25. package/dist/components/data-display/list-row.d.ts +10 -1
  26. package/dist/components/data-display/list-row.js +7 -1
  27. package/dist/components/data-display/popover.d.ts +2 -2
  28. package/dist/components/data-display/popover.js +61 -11
  29. package/dist/components/data-display/range-timeline.d.ts +38 -0
  30. package/dist/components/data-display/range-timeline.js +161 -0
  31. package/dist/components/data-display/scroll-area.js +13 -2
  32. package/dist/components/data-display/service-launcher-card.js +10 -10
  33. package/dist/components/data-display/table.d.ts +11 -3
  34. package/dist/components/data-display/table.js +48 -18
  35. package/dist/components/data-display/tree-list.js +4 -9
  36. package/dist/components/data-entry/calendar.d.ts +2 -2
  37. package/dist/components/data-entry/calendar.js +12 -1
  38. package/dist/components/data-entry/cascader.d.ts +1 -1
  39. package/dist/components/data-entry/cascader.js +188 -24
  40. package/dist/components/data-entry/color-picker.d.ts +1 -1
  41. package/dist/components/data-entry/color-picker.js +17 -5
  42. package/dist/components/data-entry/control-appearance.d.ts +64 -0
  43. package/dist/components/data-entry/control-appearance.js +39 -0
  44. package/dist/components/data-entry/control-surface.d.ts +61 -0
  45. package/dist/components/data-entry/control-surface.js +39 -0
  46. package/dist/components/data-entry/date-picker.d.ts +1 -1
  47. package/dist/components/data-entry/date-picker.js +344 -113
  48. package/dist/components/data-entry/date-range-picker.d.ts +1 -1
  49. package/dist/components/data-entry/date-range-picker.js +278 -140
  50. package/dist/components/data-entry/form-field.d.ts +1 -1
  51. package/dist/components/data-entry/form-field.js +39 -4
  52. package/dist/components/data-entry/form.d.ts +4 -0
  53. package/dist/components/data-entry/form.js +4 -2
  54. package/dist/components/data-entry/index.d.ts +7 -3
  55. package/dist/components/data-entry/index.js +10 -1
  56. package/dist/components/data-entry/input-otp.d.ts +1 -1
  57. package/dist/components/data-entry/input.d.ts +12 -34
  58. package/dist/components/data-entry/input.js +92 -24
  59. package/dist/components/data-entry/month-picker.d.ts +1 -1
  60. package/dist/components/data-entry/month-picker.js +47 -10
  61. package/dist/components/data-entry/month-range-picker.d.ts +1 -1
  62. package/dist/components/data-entry/month-range-picker.js +51 -11
  63. package/dist/components/data-entry/number-input.d.ts +7 -0
  64. package/dist/components/data-entry/number-input.js +147 -98
  65. package/dist/components/data-entry/password-input.d.ts +1 -1
  66. package/dist/components/data-entry/radio.d.ts +1 -1
  67. package/dist/components/data-entry/radio.js +61 -13
  68. package/dist/components/data-entry/search-input.d.ts +1 -1
  69. package/dist/components/data-entry/search-input.js +16 -2
  70. package/dist/components/data-entry/search-select.d.ts +2 -2
  71. package/dist/components/data-entry/search-select.js +209 -78
  72. package/dist/components/data-entry/select.d.ts +22 -4
  73. package/dist/components/data-entry/select.js +215 -163
  74. package/dist/components/data-entry/slider.d.ts +9 -1
  75. package/dist/components/data-entry/slider.js +87 -9
  76. package/dist/components/data-entry/switch.d.ts +3 -0
  77. package/dist/components/data-entry/switch.js +29 -3
  78. package/dist/components/data-entry/textarea.d.ts +14 -56
  79. package/dist/components/data-entry/textarea.js +80 -33
  80. package/dist/components/data-entry/time-picker.d.ts +2 -2
  81. package/dist/components/data-entry/time-picker.js +333 -109
  82. package/dist/components/data-entry/time-range-picker.d.ts +5 -0
  83. package/dist/components/data-entry/time-range-picker.js +89 -0
  84. package/dist/components/data-entry/transfer.d.ts +1 -1
  85. package/dist/components/data-entry/transfer.js +86 -28
  86. package/dist/components/data-entry/tree-select.d.ts +1 -1
  87. package/dist/components/data-entry/tree-select.js +201 -113
  88. package/dist/components/data-entry/tree-utils.js +7 -14
  89. package/dist/components/data-entry/upload-files.d.ts +2 -0
  90. package/dist/components/data-entry/upload-files.js +31 -0
  91. package/dist/components/data-entry/upload-request.d.ts +4 -0
  92. package/dist/components/data-entry/upload-request.js +53 -0
  93. package/dist/components/data-entry/upload-types.d.ts +28 -0
  94. package/dist/components/data-entry/upload-types.js +2 -0
  95. package/dist/components/data-entry/upload.d.ts +2 -2
  96. package/dist/components/data-entry/upload.js +475 -115
  97. package/dist/components/feedback/dialog.js +16 -19
  98. package/dist/components/general/button.d.ts +1 -1
  99. package/dist/components/general/button.js +5 -1
  100. package/dist/components/general/index.d.ts +1 -0
  101. package/dist/components/general/index.js +2 -0
  102. package/dist/components/general/typography.d.ts +3 -0
  103. package/dist/components/general/typography.js +15 -1
  104. package/dist/components/general/visually-hidden.d.ts +3 -0
  105. package/dist/components/general/visually-hidden.js +9 -0
  106. package/dist/components/layout/app-launcher.d.ts +34 -0
  107. package/dist/components/layout/app-launcher.js +228 -0
  108. package/dist/components/layout/app-shell.d.ts +2 -0
  109. package/dist/components/layout/app-shell.js +20 -7
  110. package/dist/components/layout/breadcrumb.d.ts +14 -2
  111. package/dist/components/layout/breadcrumb.js +46 -4
  112. package/dist/components/layout/flex.d.ts +1 -1
  113. package/dist/components/layout/flex.js +23 -2
  114. package/dist/components/layout/index.d.ts +3 -0
  115. package/dist/components/layout/index.js +5 -1
  116. package/dist/components/layout/org-switcher.js +20 -1
  117. package/dist/components/layout/page-container.d.ts +1 -1
  118. package/dist/components/layout/page-container.js +5 -3
  119. package/dist/components/layout/responsive-grid.d.ts +16 -2
  120. package/dist/components/layout/responsive-grid.js +29 -2
  121. package/dist/components/layout/topbar-item.d.ts +3 -0
  122. package/dist/components/layout/topbar-item.js +18 -3
  123. package/dist/components/layout/topbar.d.ts +1 -1
  124. package/dist/components/layout/topbar.js +27 -6
  125. package/dist/components/navigation/dropdown-menu.d.ts +30 -2
  126. package/dist/components/navigation/dropdown-menu.js +68 -11
  127. package/dist/components/navigation/pagination.d.ts +2 -2
  128. package/dist/components/navigation/pagination.js +155 -83
  129. package/dist/components/navigation/steps.d.ts +2 -2
  130. package/dist/components/navigation/steps.js +29 -4
  131. package/dist/components/navigation/tabs.d.ts +5 -33
  132. package/dist/components/navigation/tabs.js +232 -64
  133. package/dist/components/ui/input-otp.d.ts +26 -28
  134. package/dist/components/ui/input-otp.js +50 -7
  135. package/dist/components/ui/password-input.d.ts +36 -2
  136. package/dist/components/ui/password-input.js +27 -7
  137. package/dist/components/ui/rating.d.ts +25 -0
  138. package/dist/components/ui/rating.js +67 -27
  139. package/dist/components/ui/segmented.d.ts +9 -0
  140. package/dist/components/ui/segmented.js +17 -2
  141. package/dist/components/ui/separator.d.ts +4 -0
  142. package/dist/components/ui/separator.js +13 -0
  143. package/dist/components/ui/tag-input.d.ts +45 -0
  144. package/dist/components/ui/tag-input.js +109 -27
  145. package/dist/form/form-context.d.ts +29 -0
  146. package/dist/form/form-context.js +44 -4
  147. package/dist/form/form-field-array.d.ts +22 -0
  148. package/dist/form/form-field-array.js +50 -0
  149. package/dist/form/form-field-control.d.ts +2 -1
  150. package/dist/form/form-field-control.js +116 -40
  151. package/dist/form/form-root.d.ts +2 -1
  152. package/dist/form/form-root.js +142 -23
  153. package/dist/form/index.d.ts +3 -1
  154. package/dist/form/index.js +12 -1
  155. package/dist/i18n/messages/en.json +56 -5
  156. package/dist/i18n/messages/ja.json +56 -5
  157. package/dist/i18n/messages/vi.json +56 -5
  158. package/dist/inertia/index.d.ts +20 -0
  159. package/dist/inertia/index.js +60 -1
  160. package/dist/lib/control-styles.d.ts +25 -3
  161. package/dist/lib/control-styles.js +9 -3
  162. package/dist/lib/datetime/picker-format.d.ts +8 -0
  163. package/dist/lib/datetime/picker-format.js +54 -0
  164. package/dist/props/components/charts.prop.d.ts +21 -0
  165. package/dist/props/components/data-display.prop.d.ts +55 -4
  166. package/dist/props/components/data-entry.prop.d.ts +687 -43
  167. package/dist/props/components/form.prop.d.ts +142 -4
  168. package/dist/props/components/general.prop.d.ts +17 -1
  169. package/dist/props/components/index.d.ts +2 -2
  170. package/dist/props/components/layout.prop.d.ts +163 -6
  171. package/dist/props/components/navigation.prop.d.ts +113 -3
  172. package/dist/props/registry.d.ts +376 -10
  173. package/dist/props/registry.js +493 -9
  174. package/dist/props/vocabulary/data.prop.d.ts +179 -1
  175. package/dist/props/vocabulary/index.d.ts +4 -4
  176. package/dist/props/vocabulary/interaction.prop.d.ts +51 -2
  177. package/dist/props/vocabulary/navigation.prop.d.ts +40 -0
  178. package/dist/props/vocabulary/shared.prop.d.ts +33 -0
  179. package/dist/styles/badge-layout.css +2 -1
  180. package/dist/styles/card-layout.css +26 -4
  181. package/dist/styles/chart-layout.css +15 -0
  182. package/dist/styles/control.css +515 -14
  183. package/dist/styles/data-display-layout.css +241 -6
  184. package/dist/styles/data-entry-layout.css +13 -0
  185. package/dist/styles/layout.css +221 -4
  186. package/dist/styles/navigation-layout.css +227 -0
  187. package/dist/styles/shell-layout.css +229 -5
  188. package/dist/styles/table-layout.css +95 -6
  189. package/dist/styles/text-layout.css +5 -0
  190. package/dist/tokens/base.css +1 -0
  191. package/dist/tokens/components/badge.css +1 -0
  192. package/dist/tokens/components/chart.css +6 -0
  193. package/dist/tokens/components/control.css +79 -2
  194. package/dist/tokens/components/data-display.css +9 -0
  195. package/dist/tokens/components/descriptions.css +11 -0
  196. package/dist/tokens/components/flex.css +8 -0
  197. package/dist/tokens/components/navigation.css +55 -0
  198. package/dist/tokens/components/shell.css +50 -2
  199. package/dist/tokens/components/table.css +14 -0
  200. package/dist/tokens/semantic/layout.css +9 -0
  201. package/docs/CONSUMER-RULES.md +13 -0
  202. package/docs/DESIGN-AUTHORITY.md +43 -6
  203. package/docs/DEVELOPMENT.md +4 -3
  204. package/docs/FORMS.md +151 -6
  205. package/docs/FRAME-COVERAGE-REPORT.md +29 -16
  206. package/docs/README.md +1 -1
  207. package/docs/STANDARDS-vocabulary-tokens.md +1 -1
  208. package/docs/TESTING.md +15 -6
  209. package/docs/charts/cjk-category-axis.tsx +81 -0
  210. package/docs/data-display/card/index.tsx +22 -0
  211. package/docs/data-display/data-table/examples/antd-parity.tsx +257 -0
  212. package/docs/data-display/data-table/index.tsx +23 -0
  213. package/docs/data-display/descriptions.tsx +41 -0
  214. package/docs/data-display/scroll-area.tsx +31 -25
  215. package/docs/data-display/table.tsx +104 -45
  216. package/docs/data-display/timeline.tsx +41 -0
  217. package/docs/data-entry/date-picker.tsx +85 -0
  218. package/docs/data-entry/date-range-picker.tsx +26 -0
  219. package/docs/data-entry/form-dynamic-fields.tsx +199 -0
  220. package/docs/data-entry/form.tsx +74 -4
  221. package/docs/data-entry/input-otp.tsx +24 -0
  222. package/docs/data-entry/input.tsx +46 -1
  223. package/docs/data-entry/month-range-picker.tsx +1 -1
  224. package/docs/data-entry/select.tsx +27 -0
  225. package/docs/data-entry/switch.tsx +41 -0
  226. package/docs/data-entry/textarea.tsx +38 -0
  227. package/docs/data-entry/time-picker.tsx +85 -1
  228. package/docs/data-entry/time-range-picker.tsx +55 -0
  229. package/docs/data-entry/transfer.tsx +17 -0
  230. package/docs/data-entry/upload.tsx +56 -12
  231. package/docs/feedback/tooltip.tsx +1 -1
  232. package/docs/general/activity.tsx +2 -2
  233. package/docs/general/button/index.tsx +14 -1
  234. package/docs/general/typography.tsx +14 -1
  235. package/docs/layout/app-launcher.tsx +151 -0
  236. package/docs/layout/app-shell.tsx +11 -0
  237. package/docs/layout/flex.tsx +50 -0
  238. package/docs/layout/responsive-grid.tsx +21 -1
  239. package/docs/layout/topbar.tsx +5 -9
  240. package/docs/navigation/app-setting-picker.tsx +11 -0
  241. package/docs/navigation/breadcrumb.tsx +48 -0
  242. package/docs/navigation/dropdown-menu.tsx +21 -0
  243. package/docs/navigation/pagination.tsx +52 -0
  244. package/docs/navigation/steps.tsx +37 -0
  245. package/docs/navigation/tabs.tsx +97 -1
  246. package/docs/query/button-refetch.tsx +1 -0
  247. package/package.json +19 -2
  248. package/scripts/_agent-setup.mjs +19 -2
  249. package/scripts/init-guinea-pig.mjs +26 -4
  250. package/scripts/ui-audit.mjs +243 -30
@@ -61,6 +61,47 @@ export default function Demo() {
61
61
  </Flex>
62
62
  </CardContent>
63
63
  </Card>
64
+
65
+ <Card>
66
+ <CardHeader>
67
+ <CardTitle level={2}>Ant Design axes · loading, checkedChildren</CardTitle>
68
+ <CardDescription>
69
+ loading は通信中の状態です。disabled ではなく aria-busy / aria-disabled
70
+ を使います。disabled はタブ順から外れるため、保存中にキーボードの
71
+ フォーカスが次の項目へ飛んでしまうからです。
72
+ </CardDescription>
73
+ </CardHeader>
74
+ <CardContent>
75
+ <Flex direction="col" gap="md">
76
+ <Field
77
+ id="sw-loading"
78
+ label="公開設定 (保存中)"
79
+ description="通信が終わるまで操作を受け付けません"
80
+ >
81
+ <Switch id="sw-loading" loading defaultChecked />
82
+ </Field>
83
+ <Field
84
+ id="sw-words-off"
85
+ label="ラベル付き (オフ)"
86
+ description="トラックの中に状態の語を表示します"
87
+ >
88
+ <Switch id="sw-words-off" checkedChildren="有効" unCheckedChildren="無効" />
89
+ </Field>
90
+ <Field
91
+ id="sw-words-on"
92
+ label="ラベル付き (オン)"
93
+ description="語が入ってもつまみは端まで届きます"
94
+ >
95
+ <Switch
96
+ id="sw-words-on"
97
+ checkedChildren="有効"
98
+ unCheckedChildren="無効"
99
+ defaultChecked
100
+ />
101
+ </Field>
102
+ </Flex>
103
+ </CardContent>
104
+ </Card>
64
105
  </Flex>
65
106
  </PageContainer>
66
107
  );
@@ -192,6 +192,44 @@ export default function Demo() {
192
192
  </CardContent>
193
193
  </Card>
194
194
 
195
+ <Card>
196
+ <CardHeader>
197
+ <CardTitle level={2}>
198
+ Ant Design axes · status, variant, size, count, autoSize
199
+ </CardTitle>
200
+ <CardDescription>
201
+ variant carries five accepted spellings for three states: outlined / filled /
202
+ borderless are Ant Design&apos;s, and this library&apos;s older default / ghost
203
+ resolve onto the first and the last. autoSize is autoGrow plus its row bounds in one
204
+ prop.
205
+ </CardDescription>
206
+ </CardHeader>
207
+ <CardContent>
208
+ <Flex direction="col" gap="md">
209
+ <Textarea aria-label="エラー状態" status="error" defaultValue="不正な値" />
210
+ <Textarea aria-label="警告状態" status="warning" defaultValue="確認してください" />
211
+ <Textarea aria-label="枠線あり" variant="outlined" defaultValue="outlined" />
212
+ <Textarea aria-label="塗りつぶし" variant="filled" defaultValue="filled" />
213
+ <Textarea aria-label="枠線なし" variant="borderless" defaultValue="borderless" />
214
+ <Textarea aria-label="既定 (旧称)" variant="default" defaultValue="default" />
215
+ <Textarea aria-label="ゴースト (旧称)" variant="ghost" defaultValue="ghost" />
216
+ <Textarea aria-label="小さいサイズ" size="sm" placeholder="sm" />
217
+ <Textarea aria-label="標準サイズ" size="md" placeholder="md" />
218
+ <Textarea aria-label="大きいサイズ" size="lg" placeholder="lg" />
219
+ <Textarea
220
+ aria-label="文字数カウンタ"
221
+ count={{ max: 140 }}
222
+ defaultValue="東京都の請求書について"
223
+ />
224
+ <Textarea
225
+ aria-label="自動リサイズ"
226
+ autoSize={{ minRows: 2, maxRows: 6 }}
227
+ placeholder="2行から6行まで伸びます"
228
+ />
229
+ </Flex>
230
+ </CardContent>
231
+ </Card>
232
+
195
233
  <Card>
196
234
  <CardHeader>
197
235
  <CardTitle level={2}>In FormField</CardTitle>
@@ -1,7 +1,7 @@
1
1
  import { useState } from "react";
2
2
 
3
3
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
4
- import { FormField, TimePicker } from "@godxjp/ui/data-entry";
4
+ import { FormField, TimePicker, TimeRangePicker } from "@godxjp/ui/data-entry";
5
5
  import { Flex, PageContainer } from "@godxjp/ui/layout";
6
6
 
7
7
  /**
@@ -93,6 +93,90 @@ export default function Demo() {
93
93
  </FormField>
94
94
  </CardContent>
95
95
  </Card>
96
+
97
+ <Card>
98
+ <CardHeader>
99
+ <CardTitle level={2}>秒単位の締切</CardTitle>
100
+ </CardHeader>
101
+ <CardContent>
102
+ <FormField id="precision-time" label="締切時刻">
103
+ <TimePicker
104
+ id="precision-time"
105
+ name="precision"
106
+ defaultValue="17:50:15"
107
+ format="HH:mm:ss"
108
+ hourStep={2}
109
+ minuteStep={10}
110
+ secondStep={15}
111
+ changeOnScroll
112
+ needConfirm
113
+ />
114
+ </FormField>
115
+ </CardContent>
116
+ </Card>
117
+ <Card>
118
+ <CardHeader>
119
+ <CardTitle level={2}>12時間表示</CardTitle>
120
+ </CardHeader>
121
+ <CardContent>
122
+ <FormField id="twelve-time" label="開始時刻">
123
+ <TimePicker
124
+ id="twelve-time"
125
+ name="twelve"
126
+ defaultValue="13:30"
127
+ format="h:mm A"
128
+ use12Hours
129
+ />
130
+ </FormField>
131
+ </CardContent>
132
+ </Card>
133
+ <Card>
134
+ <CardHeader>
135
+ <CardTitle level={2}>入力状態</CardTitle>
136
+ </CardHeader>
137
+ <CardContent>
138
+ <Flex direction="col" gap="md">
139
+ <FormField id="readonly-time" label="選択のみ">
140
+ <TimePicker
141
+ id="readonly-time"
142
+ inputReadOnly
143
+ defaultValue="09:00"
144
+ allowClear={false}
145
+ size="sm"
146
+ variant="filled"
147
+ />
148
+ </FormField>
149
+ <FormField id="invalid-time" label="入力を保持">
150
+ <TimePicker id="invalid-time" preserveInvalidOnBlur status="error" size="lg" />
151
+ </FormField>
152
+ <FormField id="quiet-time" label="任意時刻">
153
+ <TimePicker
154
+ id="quiet-time"
155
+ variant="borderless"
156
+ status="warning"
157
+ placement="top-start"
158
+ showNow={false}
159
+ />
160
+ </FormField>
161
+ </Flex>
162
+ </CardContent>
163
+ </Card>
164
+ <Card>
165
+ <CardHeader>
166
+ <CardTitle level={2}>勤務時間帯</CardTitle>
167
+ </CardHeader>
168
+ <CardContent>
169
+ <FormField id="shift-range" label="勤務時間">
170
+ <TimeRangePicker
171
+ id="shift-range"
172
+ name="shift"
173
+ defaultValue={["09:00", "18:00"]}
174
+ allowEmpty={[false, true]}
175
+ minuteStep={15}
176
+ />
177
+ </FormField>
178
+ </CardContent>
179
+ </Card>
96
180
  </Flex>
97
181
  </PageContainer>
98
182
  );
@@ -0,0 +1,55 @@
1
+ import { TimeRangePicker, FormField } from "@godxjp/ui/data-entry";
2
+ import { Card, CardContent, CardHeader, CardTitle } from "@godxjp/ui/data-display";
3
+ import { Flex, PageContainer } from "@godxjp/ui/layout";
4
+
5
+ export default function Demo() {
6
+ return (
7
+ <PageContainer title="TimeRangePicker" subtitle="勤務時間と受付時間の範囲選択">
8
+ <Flex direction="col" gap="lg">
9
+ <Card>
10
+ <CardHeader>
11
+ <CardTitle level={2}>勤務時間</CardTitle>
12
+ </CardHeader>
13
+ <CardContent>
14
+ <FormField id="work-period" label="勤務時間">
15
+ <TimeRangePicker
16
+ id="work-period"
17
+ name="work"
18
+ defaultValue={["09:00", "18:00"]}
19
+ minuteStep={15}
20
+ allowEmpty={[false, false]}
21
+ />
22
+ </FormField>
23
+ </CardContent>
24
+ </Card>
25
+ <Card>
26
+ <CardHeader>
27
+ <CardTitle level={2}>終了時刻は任意</CardTitle>
28
+ </CardHeader>
29
+ <CardContent>
30
+ <FormField id="optional-end" label="受付時間">
31
+ <TimeRangePicker
32
+ id="optional-end"
33
+ name="reception"
34
+ defaultValue={["09:00", ""]}
35
+ allowEmpty={[false, true]}
36
+ format="HH:mm:ss"
37
+ showSeconds
38
+ />
39
+ </FormField>
40
+ </CardContent>
41
+ </Card>
42
+ <Card>
43
+ <CardHeader>
44
+ <CardTitle level={2}>日をまたぐ勤務</CardTitle>
45
+ </CardHeader>
46
+ <CardContent>
47
+ <FormField id="overnight" label="夜勤">
48
+ <TimeRangePicker id="overnight" defaultValue={["22:00", "06:00"]} order={false} />
49
+ </FormField>
50
+ </CardContent>
51
+ </Card>
52
+ </Flex>
53
+ </PageContainer>
54
+ );
55
+ }
@@ -91,6 +91,23 @@ export default function Demo() {
91
91
  />
92
92
  </CardContent>
93
93
  </Card>
94
+ <Card>
95
+ <CardHeader>
96
+ <CardTitle level={2}>検索・ページ分割・初期値</CardTitle>
97
+ <CardDescription>
98
+ 表示中の有効な行だけを一括選択。移動後も別ページの選択を保持します。
99
+ </CardDescription>
100
+ </CardHeader>
101
+ <CardContent>
102
+ <Transfer
103
+ dataSource={ALL_ACCOUNTS}
104
+ defaultValue={[]}
105
+ showSearch
106
+ pagination={{ pageSize: 3 }}
107
+ name="accounts[]"
108
+ />
109
+ </CardContent>
110
+ </Card>
94
111
  </Flex>
95
112
  </PageContainer>
96
113
  );
@@ -1,7 +1,13 @@
1
1
  import { useState } from "react";
2
2
 
3
3
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
4
- import { Upload, type UploadFileItem } from "@godxjp/ui/data-entry";
4
+ import {
5
+ Form,
6
+ Upload,
7
+ type UploadFileItem,
8
+ type UploadRequestContext,
9
+ } from "@godxjp/ui/data-entry";
10
+ import { Button, Text } from "@godxjp/ui/general";
5
11
  import { Flex, PageContainer } from "@godxjp/ui/layout";
6
12
 
7
13
  /**
@@ -11,12 +17,19 @@ import { Flex, PageContainer } from "@godxjp/ui/layout";
11
17
  * Composed only from real @godxjp/ui components.
12
18
  */
13
19
 
14
- /** No-op uploader: resolves immediately with a fake mediaId for preview purposes. */
15
- async function noopUpload(_file: File, _item: UploadFileItem) {
16
- return { mediaId: "preview-media-id" };
20
+ /** Simulated transport: progress, abort, and retry remain observable in the preview. */
21
+ async function demoUpload(file: File, _item: UploadFileItem, context: UploadRequestContext) {
22
+ for (let percent = 0; percent <= 100; percent += 20) {
23
+ await new Promise((resolve) => setTimeout(resolve, 180));
24
+ context.signal.throwIfAborted();
25
+ context.onProgress(percent);
26
+ }
27
+ if (file.name.startsWith("fail")) throw new Error("アップロードに失敗しました。再試行できます。");
28
+ return { mediaId: crypto.randomUUID() };
17
29
  }
18
30
 
19
31
  export default function Demo() {
32
+ const [submittedFiles, setSubmittedFiles] = useState<string[]>([]);
20
33
  const [dropzoneItems, setDropzoneItems] = useState<UploadFileItem[]>([]);
21
34
  const [buttonItems, setButtonItems] = useState<UploadFileItem[]>([]);
22
35
  const [pictureCardItems, setPictureCardItems] = useState<UploadFileItem[]>([]);
@@ -40,6 +53,37 @@ export default function Demo() {
40
53
  subtitle="ファイルアップロード · 6バリアント(dropzone / button / picture-card / picture / avatar / avatar-crop)"
41
54
  >
42
55
  <Flex direction="col" gap="lg">
56
+ <Card>
57
+ <CardHeader>
58
+ <CardTitle level={2}>Multipart form</CardTitle>
59
+ <CardDescription>
60
+ 選択・ドロップ・貼り付けしたファイルをフォームでまとめて送信します。
61
+ </CardDescription>
62
+ </CardHeader>
63
+ <CardContent>
64
+ <Form
65
+ onReset={() => setSubmittedFiles([])}
66
+ onSubmit={(event) => {
67
+ event.preventDefault();
68
+ const data = new FormData(event.currentTarget);
69
+ setSubmittedFiles(
70
+ data
71
+ .getAll("attachments[]")
72
+ .filter((value): value is File => value instanceof File)
73
+ .map((value) => value.name),
74
+ );
75
+ }}
76
+ >
77
+ <Upload name="attachments[]" pastable maxCount={3} />
78
+ <Button type="submit">添付ファイルを確認</Button>
79
+ <Button type="reset" variant="outline">
80
+ リセット
81
+ </Button>
82
+ <Text>{submittedFiles.join("、")}</Text>
83
+ </Form>
84
+ </CardContent>
85
+ </Card>
86
+
43
87
  <Card>
44
88
  <CardHeader>
45
89
  <CardTitle level={2}>Dropzone</CardTitle>
@@ -53,9 +97,10 @@ export default function Demo() {
53
97
  value={dropzoneItems}
54
98
  onValueChange={setDropzoneItems}
55
99
  accept=".pdf,.xlsx,.csv"
100
+ pastable
56
101
  maxCount={5}
57
102
  maxSizeBytes={20 * 1024 * 1024}
58
- onUpload={noopUpload}
103
+ onUpload={demoUpload}
59
104
  />
60
105
  </CardContent>
61
106
  </Card>
@@ -64,8 +109,7 @@ export default function Demo() {
64
109
  <CardHeader>
65
110
  <CardTitle level={2}>Error and recovery</CardTitle>
66
111
  <CardDescription>
67
- 失敗理由は対象ファイルの行に表示する。Upload は自動 retry prop を持たないため、
68
- 不正なファイルを削除して修正済みファイルを再選択する。
112
+ 失敗したファイルは再試行できます。処理中のファイルはキャンセルできます。
69
113
  </CardDescription>
70
114
  </CardHeader>
71
115
  <CardContent>
@@ -98,7 +142,7 @@ export default function Demo() {
98
142
  value={buttonItems}
99
143
  onValueChange={setButtonItems}
100
144
  accept=".csv"
101
- onUpload={noopUpload}
145
+ onUpload={demoUpload}
102
146
  >
103
147
  CSVをインポート
104
148
  </Upload>
@@ -119,7 +163,7 @@ export default function Demo() {
119
163
  onValueChange={setPictureCardItems}
120
164
  accept="image/*"
121
165
  maxCount={6}
122
- onUpload={noopUpload}
166
+ onUpload={demoUpload}
123
167
  />
124
168
  </CardContent>
125
169
  </Card>
@@ -138,7 +182,7 @@ export default function Demo() {
138
182
  onValueChange={setPictureItem}
139
183
  accept="image/*"
140
184
  maxCount={1}
141
- onUpload={noopUpload}
185
+ onUpload={demoUpload}
142
186
  />
143
187
  </CardContent>
144
188
  </Card>
@@ -154,7 +198,7 @@ export default function Demo() {
154
198
  value={avatarItem}
155
199
  onValueChange={setAvatarItem}
156
200
  accept="image/*"
157
- onUpload={noopUpload}
201
+ onUpload={demoUpload}
158
202
  />
159
203
  </CardContent>
160
204
  </Card>
@@ -174,7 +218,7 @@ export default function Demo() {
174
218
  onValueChange={setAvatarCropItem}
175
219
  accept="image/*"
176
220
  maxSizeBytes={5 * 1024 * 1024}
177
- onUpload={noopUpload}
221
+ onUpload={demoUpload}
178
222
  />
179
223
  </CardContent>
180
224
  </Card>
@@ -125,7 +125,7 @@ export default function Demo() {
125
125
  <CardHeader>
126
126
  <CardTitle level={2}>Shared delay across a toolbar (TooltipProvider)</CardTitle>
127
127
  <CardDescription>
128
- Wrap a cluster in TooltipProvider to set one delayDuration for every tooltip inside
128
+ Wrap a cluster in TooltipProvider to set one delayDuration for every tooltip inside ·
129
129
  a dense toolbar feels snappy without repeating the prop on each Tooltip.
130
130
  </CardDescription>
131
131
  </CardHeader>
@@ -99,7 +99,7 @@ export default function Demo() {
99
99
  <Flex direction="col" gap="md">
100
100
  <Flex direction="col" gap="xs">
101
101
  <Text size="xs" tone="muted">
102
- dots(既定)— 3 点が順に浮く。&ldquo;入力中&rdquo; の省略記号の慣習。
102
+ dots(既定)· 3 点が順に浮く。&ldquo;入力中&rdquo; の省略記号の慣習。
103
103
  </Text>
104
104
  <Activity variant="dots" label="佐藤さんが入力しています…" />
105
105
  </Flex>
@@ -156,7 +156,7 @@ export default function Demo() {
156
156
  <Flex direction="col" gap="md">
157
157
  <Flex direction="col" gap="xs">
158
158
  <Text size="xs" tone="muted">
159
- label のみ
159
+ label のみ ·
160
160
  マークの隣に可視テキストとして描画される。アニメーションだけで意味を運ばせない。
161
161
  </Text>
162
162
  <Activity label="佐藤さんが入力しています…" />
@@ -1,4 +1,11 @@
1
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
1
+ import {
2
+ Badge,
3
+ Card,
4
+ CardContent,
5
+ CardDescription,
6
+ CardHeader,
7
+ CardTitle,
8
+ } from "@godxjp/ui/data-display";
2
9
  import { Button } from "@godxjp/ui/general";
3
10
  import { Flex, PageContainer } from "@godxjp/ui/layout";
4
11
  import { Pencil, Plus, Trash2 } from "lucide-react";
@@ -56,6 +63,12 @@ export default function Demo() {
56
63
  <Button variant="dashed">追加 Add row</Button>
57
64
  <Button variant="ghost">詳細 Details</Button>
58
65
  <Button variant="link">もっと見る More</Button>
66
+ <Button id="bare-count" variant="bare">
67
+ 返信 <Badge icon={null}>12</Badge>
68
+ </Button>
69
+ <Button id="ghost-count" variant="ghost">
70
+ 返信 <Badge icon={null}>12</Badge>
71
+ </Button>
59
72
  <Button variant="destructive">削除 Delete</Button>
60
73
  </Flex>
61
74
  </CardContent>
@@ -1,4 +1,5 @@
1
- import { Button, Heading, Text } from "@godxjp/ui/general";
1
+ import { useTranslation } from "@godxjp/ui/i18n";
2
+ import { Button, Heading, Text, VisuallyHidden } from "@godxjp/ui/general";
2
3
  import {
3
4
  Card,
4
5
  CardContent,
@@ -35,6 +36,7 @@ const headingTones = [
35
36
  ] as const;
36
37
 
37
38
  export default function Demo() {
39
+ const { t } = useTranslation();
38
40
  return (
39
41
  <PageContainer
40
42
  title="Typography"
@@ -229,6 +231,17 @@ export default function Demo() {
229
231
  </Flex>
230
232
  </CardContent>
231
233
  </Card>
234
+ <Card>
235
+ <CardHeader>
236
+ <CardTitle level={2}>{t("textExamples.preservedText")}</CardTitle>
237
+ </CardHeader>
238
+ <CardContent>
239
+ <Text as="p" whitespace="pre-wrap">
240
+ {t("textExamples.sampleText")}
241
+ </Text>
242
+ <VisuallyHidden>{t("textExamples.preservedText")}</VisuallyHidden>
243
+ </CardContent>
244
+ </Card>
232
245
  </Flex>
233
246
  </PageContainer>
234
247
  );
@@ -0,0 +1,151 @@
1
+ import { useState } from "react";
2
+ import { BarChart3, LifeBuoy, MessagesSquare, Receipt, Users } from "lucide-react";
3
+
4
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
5
+ import { Button, Text } from "@godxjp/ui/general";
6
+ import {
7
+ AppLauncher,
8
+ type AppLauncherLabels,
9
+ Flex,
10
+ PageContainer,
11
+ ResponsiveGrid,
12
+ Topbar,
13
+ } from "@godxjp/ui/layout";
14
+
15
+ const apps = [
16
+ { id: "console", name: "Console", href: "/console", icon: <BarChart3 />, current: true },
17
+ { id: "billing", name: "Billing", href: "/billing", icon: <Receipt /> },
18
+ { id: "people", name: "People", href: "/people", icon: <Users /> },
19
+ { id: "chat", name: "Chat", href: "/chat", icon: <MessagesSquare /> },
20
+ ];
21
+
22
+ const groups = [
23
+ {
24
+ label: "More from Acme",
25
+ apps: [
26
+ {
27
+ id: "support",
28
+ name: "Support",
29
+ href: "https://support.example.test",
30
+ icon: <LifeBuoy />,
31
+ // An external destination renders a plain anchor and bypasses `linkComponent` — a
32
+ // client-side router link to another origin is a router asked to route somewhere it
33
+ // does not own.
34
+ external: true,
35
+ },
36
+ ],
37
+ },
38
+ ];
39
+
40
+ const labels: AppLauncherLabels = {
41
+ trigger: "Acme のアプリ",
42
+ title: "アプリを切り替える",
43
+ empty: "利用できるアプリがありません。",
44
+ loading: "アプリを読み込み中",
45
+ retry: "再試行",
46
+ externalHint: "(新しいタブで開きます)",
47
+ };
48
+
49
+ /**
50
+ * AppLauncher — the nine-dot platform app grid.
51
+ *
52
+ * WHERE IT SITS AMONG THINGS THAT LOOK LIKE IT:
53
+ *
54
+ * - `ServiceLauncherCard` (data-display) is also a launcher tile, but a PAGE-SIZED one — status,
55
+ * hostname, plan, an action button, a reason it is locked — for a service-catalogue page where
56
+ * choosing is a considered act. This tile is bar-sized: mark plus name, the whole tile one link,
57
+ * because changing app is a reflex. A grid of `ServiceLauncherCard`s inside a popover is the
58
+ * wrong component, not a smaller version of this one.
59
+ * - `AppShell navRail` says the SAME platform scope as a docked column. Pick ONE. The launcher for
60
+ * a platform with MANY apps where switching is occasional (the Google Workspace shape); the rail
61
+ * for a single product where switching workspace is constant enough to deserve permanent screen
62
+ * width (the Slack shape). Shipping both puts one scope in two places.
63
+ */
64
+ export default function Demo() {
65
+ const [error, setError] = useState<string | undefined>("アプリ一覧を取得できませんでした。");
66
+
67
+ return (
68
+ <PageContainer title="AppLauncher" subtitle="topbar のセル · popover/sheet · グループ · 状態">
69
+ <ResponsiveGrid columns={{ sm: 1, lg: 2 }}>
70
+ <Card>
71
+ <CardHeader>
72
+ <CardTitle level={2}>バーの中のセル</CardTitle>
73
+ <CardDescription>
74
+ trigger は `TopbarItem` なので、高さはバーそのもの(`align-self: stretch`)。 `Button
75
+ variant=&quot;ghost&quot;` を置くと、背の高い帯の中に浮いた丸薬になります。 panel は
76
+ `responsive=&quot;auto&quot;` で、共有トークン
77
+ `--sheet-responsive-breakpoint-width`(48rem)を境に popover と bottom sheet
78
+ が入れ替わります。
79
+ </CardDescription>
80
+ </CardHeader>
81
+ <CardContent>
82
+ <Flex direction="col" gap="md">
83
+ <Topbar
84
+ start={<Text weight="medium">Acme Console</Text>}
85
+ end={<AppLauncher apps={apps} groups={groups} labels={labels} />}
86
+ />
87
+ <Text size="sm" tone="muted">
88
+ current のアプリだけが `aria-current=&quot;page&quot;` を持ちます。
89
+ </Text>
90
+ </Flex>
91
+ </CardContent>
92
+ </Card>
93
+
94
+ <Card>
95
+ <CardHeader>
96
+ <CardTitle level={2}>列数と非同期状態</CardTitle>
97
+ <CardDescription>
98
+ 既定は3列(Google と同じ形)。`columns` は1インスタンスの上書きです。 loading と error
99
+ は grid の代わりに同じ所有 surface へ表示されます。
100
+ </CardDescription>
101
+ </CardHeader>
102
+ <CardContent>
103
+ <Flex direction="col" gap="md">
104
+ <Topbar
105
+ start={<Text weight="medium">4 列</Text>}
106
+ end={
107
+ <AppLauncher
108
+ apps={apps}
109
+ groups={groups}
110
+ labels={labels}
111
+ columns={4}
112
+ responsive="popover"
113
+ />
114
+ }
115
+ />
116
+ <Topbar
117
+ start={<Text weight="medium">loading</Text>}
118
+ end={<AppLauncher apps={apps} labels={labels} loading responsive="popover" />}
119
+ />
120
+ <Topbar
121
+ start={<Text weight="medium">empty</Text>}
122
+ end={<AppLauncher apps={[]} labels={labels} responsive="sheet" />}
123
+ />
124
+ <Topbar
125
+ start={<Text weight="medium">error</Text>}
126
+ end={
127
+ <AppLauncher
128
+ apps={apps}
129
+ labels={labels}
130
+ error={error}
131
+ onRetry={() => setError(undefined)}
132
+ responsive="popover"
133
+ />
134
+ }
135
+ />
136
+ {!error ? (
137
+ <Button
138
+ variant="outline"
139
+ size="sm"
140
+ onClick={() => setError("再試行に失敗しました。")}
141
+ >
142
+ エラーを復元
143
+ </Button>
144
+ ) : null}
145
+ </Flex>
146
+ </CardContent>
147
+ </Card>
148
+ </ResponsiveGrid>
149
+ </PageContainer>
150
+ );
151
+ }
@@ -372,3 +372,14 @@ export default function Demo() {
372
372
  </AppShell>
373
373
  );
374
374
  }
375
+
376
+ /** A dashboard keeps the canonical topbar and main area without a sidebar track. */
377
+ export function WithoutSidebar() {
378
+ return (
379
+ <AppShell topbar={<Topbar start={<Text>Workspace</Text>} />}>
380
+ <PageContainer title="Dashboard">
381
+ <Text>Project overview</Text>
382
+ </PageContainer>
383
+ </AppShell>
384
+ );
385
+ }