@godxjp/ui 31.31.7 → 32.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 (728) hide show
  1. package/README.md +102 -121
  2. package/agent/START-HERE.md +10 -10
  3. package/agent/components/Accordion.json +2 -2
  4. package/agent/components/AccountChip.json +1 -1
  5. package/agent/components/Actions.json +1 -1
  6. package/agent/components/Activity.json +2 -2
  7. package/agent/components/Affix.json +1 -1
  8. package/agent/components/Alert.json +22 -6
  9. package/agent/components/AlertDialog.json +8 -1
  10. package/agent/components/Anchor.json +4 -3
  11. package/agent/components/AppLauncher.json +2 -2
  12. package/agent/components/AppProvider.json +19 -11
  13. package/agent/components/AppSettingPicker.json +18 -2
  14. package/agent/components/AppShell.json +4 -5
  15. package/agent/components/AreaChart.json +0 -1
  16. package/agent/components/AspectRatio.json +2 -2
  17. package/agent/components/Attachments.json +3 -3
  18. package/agent/components/AuthAccountSummary.json +1 -1
  19. package/agent/components/AuthDivider.json +1 -1
  20. package/agent/components/AuthExpiryProvider.json +0 -1
  21. package/agent/components/AuthFooter.json +2 -2
  22. package/agent/components/AuthIdentity.json +3 -3
  23. package/agent/components/AuthStack.json +1 -1
  24. package/agent/components/Avatar.json +2 -12
  25. package/agent/components/Badge.json +1 -1
  26. package/agent/components/BarChart.json +0 -1
  27. package/agent/components/BranchScopePicker.json +1 -1
  28. package/agent/components/Breadcrumb.json +1 -1
  29. package/agent/components/Button.json +3 -3
  30. package/agent/components/Calendar.json +1 -1
  31. package/agent/components/Card.json +2 -2
  32. package/agent/components/CardBar.json +0 -1
  33. package/agent/components/CardContent.json +0 -1
  34. package/agent/components/Carousel.json +4 -3
  35. package/agent/components/Cascader.json +1 -1
  36. package/agent/components/CenteredShell.json +78 -17
  37. package/agent/components/ChatBubble.json +3 -3
  38. package/agent/components/ChatBubbleList.json +3 -3
  39. package/agent/components/ChatComposer.json +3 -3
  40. package/agent/components/ChatSuggestion.json +3 -3
  41. package/agent/components/Checkbox.json +1 -1
  42. package/agent/components/CheckboxGroup.json +0 -1
  43. package/agent/components/CodeBlock.json +1 -1
  44. package/agent/components/Collapsible.json +4 -4
  45. package/agent/components/ColorPicker.json +1 -1
  46. package/agent/components/Command.json +5 -5
  47. package/agent/components/CommandPalette.json +1 -1
  48. package/agent/components/CompactBarTrend.json +1 -1
  49. package/agent/components/Conversations.json +3 -3
  50. package/agent/components/CredentialReveal.json +1 -1
  51. package/agent/components/DataState.json +2 -2
  52. package/agent/components/DataTable.json +1 -1
  53. package/agent/components/DatePicker.json +1 -1
  54. package/agent/components/Descriptions.json +1 -1
  55. package/agent/components/Dialog.json +2 -2
  56. package/agent/components/DraggablePanel.json +5 -4
  57. package/agent/components/DropdownMenu.json +1 -1
  58. package/agent/components/EmojiPicker.json +3 -2
  59. package/agent/components/EmptyState.json +1 -1
  60. package/agent/components/ErrorSurface.json +3 -3
  61. package/agent/components/FeatureList.json +1 -1
  62. package/agent/components/Field.json +0 -1
  63. package/agent/components/Flex.json +34 -4
  64. package/agent/components/FloatButton.json +6 -5
  65. package/agent/components/Form.json +1 -1
  66. package/agent/components/FormErrors.json +0 -1
  67. package/agent/components/FormField.json +6 -6
  68. package/agent/components/FormFieldArray.json +0 -1
  69. package/agent/components/FormFieldControl.json +0 -1
  70. package/agent/components/FormRoot.json +1 -1
  71. package/agent/components/Heading.json +3 -0
  72. package/agent/components/Icon.json +1 -1
  73. package/agent/components/Image.json +7 -4
  74. package/agent/components/InfiniteQueryState.json +1 -1
  75. package/agent/components/Input.json +1 -1
  76. package/agent/components/InputOTP.json +2 -2
  77. package/agent/components/Label.json +3 -3
  78. package/agent/components/LegalDocumentShell.json +5 -4
  79. package/agent/components/Legend.json +1 -1
  80. package/agent/components/LineChart.json +0 -1
  81. package/agent/components/Link.json +0 -1
  82. package/agent/components/ListRow.json +1 -1
  83. package/agent/components/Logo.json +5 -4
  84. package/agent/components/Marquee.json +4 -3
  85. package/agent/components/Masonry.json +4 -3
  86. package/agent/components/MasterDetail.json +1 -1
  87. package/agent/components/MegaMenu.json +4 -3
  88. package/agent/components/MobileShell.json +4 -4
  89. package/agent/components/NavList.json +1 -1
  90. package/agent/components/NumberInput.json +1 -1
  91. package/agent/components/OrgChart.json +4 -3
  92. package/agent/components/OrgSwitcher.json +1 -1
  93. package/agent/components/OverlayPortalProvider.json +0 -1
  94. package/agent/components/PageContainer.json +3 -3
  95. package/agent/components/PageCover.json +3 -2
  96. package/agent/components/Pagination.json +1 -1
  97. package/agent/components/PasswordInput.json +1 -1
  98. package/agent/components/PasswordStrength.json +1 -1
  99. package/agent/components/PermissionMatrix.json +1 -1
  100. package/agent/components/PieChart.json +0 -1
  101. package/agent/components/Popover.json +31 -6
  102. package/agent/components/PrefetchLink.json +1 -1
  103. package/agent/components/Progress.json +1 -1
  104. package/agent/components/Prose.json +1 -1
  105. package/agent/components/QrCode.json +1 -1
  106. package/agent/components/Radio.json +0 -1
  107. package/agent/components/RadioGroup.json +2 -2
  108. package/agent/components/RangeTimeline.json +2 -1
  109. package/agent/components/Rating.json +1 -1
  110. package/agent/components/RecordPicker.json +1 -1
  111. package/agent/components/ResizablePanel.json +1 -1
  112. package/agent/components/ResponsiveGrid.json +2 -2
  113. package/agent/components/Reveal.json +3 -3
  114. package/agent/components/ScrollArea.json +2 -2
  115. package/agent/components/SearchInput.json +1 -1
  116. package/agent/components/Segmented.json +1 -1
  117. package/agent/components/Select.json +7 -5
  118. package/agent/components/Separator.json +1 -1
  119. package/agent/components/ServiceCatalogCta.json +0 -1
  120. package/agent/components/ServiceLauncherCard.json +1 -1
  121. package/agent/components/ServiceRolePanel.json +1 -1
  122. package/agent/components/Sheet.json +5 -5
  123. package/agent/components/Sidebar.json +1 -1
  124. package/agent/components/Skeleton.json +26 -12
  125. package/agent/components/Slider.json +2 -2
  126. package/agent/components/SortableList.json +3 -2
  127. package/agent/components/SplitPane.json +1 -1
  128. package/agent/components/StatCard.json +1 -1
  129. package/agent/components/Steps.json +1 -1
  130. package/agent/components/Swatch.json +1 -1
  131. package/agent/components/Switch.json +1 -1
  132. package/agent/components/Table.json +1 -1
  133. package/agent/components/Tabs.json +3 -3
  134. package/agent/components/Text.json +5 -1
  135. package/agent/components/TextDiff.json +5 -4
  136. package/agent/components/Textarea.json +1 -1
  137. package/agent/components/ThemeScope.json +1 -1
  138. package/agent/components/ThoughtChain.json +3 -3
  139. package/agent/components/TimePicker.json +1 -1
  140. package/agent/components/Timeline.json +1 -1
  141. package/agent/components/TimelineGrid.json +5 -4
  142. package/agent/components/Toaster.json +0 -1
  143. package/agent/components/Toggle.json +3 -3
  144. package/agent/components/ToggleGroup.json +1 -1
  145. package/agent/components/Toolbar.json +10 -3
  146. package/agent/components/Tooltip.json +9 -9
  147. package/agent/components/Topbar.json +1 -1
  148. package/agent/components/TopbarItem.json +1 -1
  149. package/agent/components/Transfer.json +2 -2
  150. package/agent/components/Tree.json +1 -1
  151. package/agent/components/TreeSelect.json +1 -1
  152. package/agent/components/TwoFactorSetup.json +1 -1
  153. package/agent/components/Upload.json +1 -1
  154. package/agent/components/UploadCropDialog.json +1 -1
  155. package/agent/components/Welcome.json +3 -3
  156. package/agent/components/formatDate.json +2 -2
  157. package/agent/components/inertiaUpload.json +0 -1
  158. package/agent/components/useZodForm.json +0 -1
  159. package/agent/components-index.json +80 -154
  160. package/agent/components.json +541 -1737
  161. package/agent/index.json +10 -10
  162. package/agent/llms.txt +9 -9
  163. package/agent/patterns/account-recovery-settings.json +1 -1
  164. package/agent/patterns/auth-recovery-panels.json +2 -2
  165. package/agent/patterns/error-pages.json +1 -1
  166. package/agent/patterns/pricing-plans.json +17 -0
  167. package/agent/patterns-index.json +17 -1
  168. package/agent/patterns.json +21 -4
  169. package/agent/rules.json +30 -65
  170. package/agent/tokens.json +27 -57
  171. package/agent/vocabulary.json +3 -3
  172. package/dist/app/app-provider.d.ts +5 -3
  173. package/dist/app/app-provider.js +47 -12
  174. package/dist/app/date-format-labels.d.ts +3 -1
  175. package/dist/app/date-format-labels.js +2 -4
  176. package/dist/app/date-formats.d.ts +21 -2
  177. package/dist/app/date-formats.js +51 -2
  178. package/dist/app/index.d.ts +3 -1
  179. package/dist/app/index.js +5 -0
  180. package/dist/app/locales.d.ts +58 -3
  181. package/dist/app/locales.js +134 -8
  182. package/dist/app/preset.d.ts +25 -0
  183. package/dist/app/preset.js +10 -0
  184. package/dist/app/request-headers.d.ts +3 -3
  185. package/dist/app/request-headers.js +19 -10
  186. package/dist/app/settings-scope.d.ts +54 -0
  187. package/dist/app/settings-scope.js +46 -0
  188. package/dist/app/tenant-theme.js +8 -3
  189. package/dist/app/time-format-labels.d.ts +4 -1
  190. package/dist/app/time-format-labels.js +7 -1
  191. package/dist/app/types.d.ts +10 -2
  192. package/dist/app/use-formatting.d.ts +1 -1
  193. package/dist/components/admin/index.d.ts +1 -1
  194. package/dist/components/admin/index.js +1 -1
  195. package/dist/components/data-display/accordion.d.ts +51 -1
  196. package/dist/components/data-display/accordion.js +247 -1
  197. package/dist/components/data-display/avatar.d.ts +16 -1
  198. package/dist/components/data-display/avatar.js +109 -1
  199. package/dist/components/data-display/credential-reveal.d.ts +9 -2
  200. package/dist/components/data-display/credential-reveal.js +156 -1
  201. package/dist/components/data-display/image.js +5 -3
  202. package/dist/components/data-display/index.d.ts +0 -21
  203. package/dist/components/data-display/index.js +1 -43
  204. package/dist/components/data-display/popover.d.ts +15 -3
  205. package/dist/components/data-display/popover.js +168 -2
  206. package/dist/components/data-entry/branch-scope-picker.d.ts +1 -1
  207. package/dist/components/data-entry/index.d.ts +5 -12
  208. package/dist/components/data-entry/index.js +11 -12
  209. package/dist/components/data-entry/input-otp.d.ts +48 -2
  210. package/dist/components/data-entry/input-otp.js +94 -1
  211. package/dist/components/data-entry/number-input.d.ts +1 -1
  212. package/dist/components/data-entry/password-input.d.ts +38 -2
  213. package/dist/components/data-entry/password-input.js +56 -1
  214. package/dist/components/data-entry/rating.d.ts +38 -2
  215. package/dist/components/data-entry/rating.js +127 -1
  216. package/dist/components/data-entry/segmented.d.ts +94 -2
  217. package/dist/components/data-entry/segmented.js +104 -1
  218. package/dist/components/{ui/tag-input.d.ts → data-entry/select-tags-inline.d.ts} +7 -4
  219. package/dist/components/{ui/tag-input.js → data-entry/select-tags-inline.js} +4 -4
  220. package/dist/components/data-entry/select.js +4 -0
  221. package/dist/components/data-entry/toggle-group.d.ts +108 -2
  222. package/dist/components/data-entry/toggle-group.js +189 -1
  223. package/dist/components/data-entry/toggle.d.ts +86 -2
  224. package/dist/components/data-entry/toggle.js +153 -2
  225. package/dist/components/feedback/alert.d.ts +5 -3
  226. package/dist/components/feedback/alert.js +14 -2
  227. package/dist/components/feedback/index.d.ts +2 -6
  228. package/dist/components/feedback/index.js +1 -13
  229. package/dist/components/feedback/skeleton.d.ts +4 -17
  230. package/dist/components/feedback/skeleton.js +3 -40
  231. package/dist/components/general/index.d.ts +2 -4
  232. package/dist/components/general/index.js +1 -6
  233. package/dist/components/general/typography.d.ts +4 -58
  234. package/dist/components/general/typography.js +7 -141
  235. package/dist/components/layout/aspect-ratio.d.ts +24 -1
  236. package/dist/components/layout/aspect-ratio.js +18 -1
  237. package/dist/components/layout/auth-divider.js +1 -1
  238. package/dist/components/layout/auth-identity.js +6 -2
  239. package/dist/components/layout/centered-shell.d.ts +13 -8
  240. package/dist/components/layout/centered-shell.js +43 -1
  241. package/dist/components/layout/flex.d.ts +1 -1
  242. package/dist/components/layout/flex.js +73 -1
  243. package/dist/components/layout/index.d.ts +1 -13
  244. package/dist/components/layout/index.js +0 -12
  245. package/dist/components/layout/separator.d.ts +25 -2
  246. package/dist/components/layout/separator.js +71 -1
  247. package/dist/components/navigation/{app-setting-toggle.d.ts → app-setting-cycle.d.ts} +3 -4
  248. package/dist/components/navigation/{app-setting-toggle.js → app-setting-cycle.js} +3 -3
  249. package/dist/components/navigation/app-setting-picker.d.ts +6 -2
  250. package/dist/components/navigation/app-setting-picker.js +20 -2
  251. package/dist/components/navigation/index.d.ts +3 -11
  252. package/dist/components/navigation/index.js +1 -9
  253. package/dist/components/navigation/tabs.js +1 -1
  254. package/dist/components/ui/carousel.d.ts +1 -1
  255. package/dist/components/ui/carousel.js +1 -1
  256. package/dist/components/ui/index.d.ts +11 -5
  257. package/dist/components/ui/index.js +5 -5
  258. package/dist/contracts/measurement.json +2 -2
  259. package/dist/email/brand-mark.d.ts +3 -2
  260. package/dist/email/brand-mark.js +1 -1
  261. package/dist/email/tokens.generated.d.ts +6 -6
  262. package/dist/email/tokens.generated.js +6 -6
  263. package/dist/i18n/locale-tags.d.ts +25 -0
  264. package/dist/i18n/locale-tags.js +59 -0
  265. package/dist/i18n/translate.d.ts +20 -3
  266. package/dist/i18n/translate.js +25 -14
  267. package/dist/i18n/use-translation.d.ts +3 -3
  268. package/dist/i18n/use-translation.js +4 -2
  269. package/dist/{components/navigation → lab}/anchor.d.ts +2 -2
  270. package/dist/{components/navigation → lab}/anchor.js +5 -5
  271. package/dist/{components/data-display → lab}/carousel.js +2 -2
  272. package/dist/{components/layout → lab}/draggable-panel.d.ts +8 -8
  273. package/dist/{components/layout → lab}/draggable-panel.js +2 -2
  274. package/dist/{components/data-entry → lab}/emoji-picker.d.ts +2 -2
  275. package/dist/{components/data-entry → lab}/emoji-picker.js +6 -6
  276. package/dist/{components/general → lab}/float-button.d.ts +8 -8
  277. package/dist/{components/general → lab}/float-button.js +7 -7
  278. package/dist/lab/index.d.ts +39 -0
  279. package/dist/lab/index.js +48 -0
  280. package/dist/{components/layout → lab}/legal-document-shell.d.ts +2 -2
  281. package/dist/{components/layout → lab}/legal-document-shell.js +4 -4
  282. package/dist/{components/data-display → lab}/marquee.d.ts +5 -5
  283. package/dist/{components/data-display → lab}/marquee.js +5 -5
  284. package/dist/{components/layout → lab}/masonry.d.ts +2 -2
  285. package/dist/{components/layout → lab}/masonry.js +3 -3
  286. package/dist/{components/navigation → lab}/mega-menu.d.ts +4 -4
  287. package/dist/{components/navigation → lab}/mega-menu.js +2 -2
  288. package/dist/{components/data-display → lab}/org-chart.d.ts +2 -2
  289. package/dist/{components/data-display → lab}/org-chart.js +4 -4
  290. package/dist/{components/layout → lab}/page-cover.d.ts +2 -2
  291. package/dist/{components/layout → lab}/page-cover.js +2 -2
  292. package/dist/{components/data-display → lab}/range-timeline.d.ts +1 -1
  293. package/dist/{components/data-display → lab}/range-timeline.js +6 -6
  294. package/dist/{components/data-entry → lab}/sortable-list.d.ts +2 -2
  295. package/dist/{components/data-entry → lab}/sortable-list.js +3 -3
  296. package/dist/{components/data-display → lab}/text-diff.d.ts +3 -3
  297. package/dist/{components/data-display → lab}/text-diff.js +4 -4
  298. package/dist/{components/data-display → lab}/timeline-grid.d.ts +2 -2
  299. package/dist/{components/data-display → lab}/timeline-grid.js +1 -1
  300. package/dist/lib/control-styles.js +1 -1
  301. package/dist/lib/datetime/format.js +20 -6
  302. package/dist/lib/datetime/sync.d.ts +6 -2
  303. package/dist/lib/datetime/sync.js +14 -18
  304. package/dist/lib/platform.d.ts +1 -1
  305. package/dist/props/components/app.prop.d.ts +28 -13
  306. package/dist/props/components/data-display.prop.d.ts +19 -29
  307. package/dist/props/components/feedback.prop.d.ts +15 -44
  308. package/dist/props/components/general.prop.d.ts +2 -64
  309. package/dist/props/components/index.d.ts +9 -1
  310. package/dist/props/components/layout.prop.d.ts +41 -57
  311. package/dist/props/registry.d.ts +48 -101
  312. package/dist/props/registry.js +45 -129
  313. package/dist/props/vocabulary/index.d.ts +1 -1
  314. package/dist/props/vocabulary/interaction.prop.d.ts +3 -12
  315. package/dist/styles/alert-layout.css +0 -29
  316. package/dist/styles/data-display-layout.css +14 -22
  317. package/dist/styles/dialog-layout.css +4 -0
  318. package/dist/styles/fonts/OFL.txt +93 -0
  319. package/dist/styles/form-layout.css +4 -0
  320. package/dist/styles/index.css +0 -2
  321. package/dist/styles/layers.json +44 -179
  322. package/dist/styles/text-layout.css +0 -15
  323. package/dist/styles.css +2 -0
  324. package/dist/themes/godx.css +43 -0
  325. package/dist/themes/godx.d.ts +13 -0
  326. package/dist/themes/godx.js +12 -0
  327. package/dist/tokens/components/feedback.css +0 -6
  328. package/dist/tokens/derived.css +23 -22
  329. package/dist/tokens/foundation.css +4 -6
  330. package/docs/COMPOSITION-VS-COMPONENT.md +58 -33
  331. package/docs/CONSUMER-RULES.md +1 -1
  332. package/docs/CUSTOMER-THEMING.md +17 -53
  333. package/docs/migrations/v32.md +98 -0
  334. package/package.json +58 -19
  335. package/scripts/_agent-setup.mjs +54 -3
  336. package/scripts/brand-accent.generated.mjs +15 -2
  337. package/scripts/cli.mjs +36 -11
  338. package/scripts/codemod.mjs +522 -0
  339. package/scripts/consumer-rule.md +21 -43
  340. package/scripts/postinstall.mjs +10 -47
  341. package/scripts/prune-css.mjs +1 -1
  342. package/scripts/ui-audit.mjs +5 -2
  343. package/dist/components/data-display/chat-bubble.d.ts +0 -30
  344. package/dist/components/data-display/chat-bubble.js +0 -229
  345. package/dist/components/data-display/hover-card.d.ts +0 -1
  346. package/dist/components/data-display/hover-card.js +0 -7
  347. package/dist/components/data-display/thought-chain.d.ts +0 -42
  348. package/dist/components/data-display/thought-chain.js +0 -177
  349. package/dist/components/data-display/thumbnail.d.ts +0 -37
  350. package/dist/components/data-display/thumbnail.js +0 -20
  351. package/dist/components/data-display/welcome.d.ts +0 -26
  352. package/dist/components/data-display/welcome.js +0 -37
  353. package/dist/components/data-entry/attachments.d.ts +0 -19
  354. package/dist/components/data-entry/attachments.js +0 -366
  355. package/dist/components/data-entry/chat-composer.d.ts +0 -51
  356. package/dist/components/data-entry/chat-composer.js +0 -200
  357. package/dist/components/data-entry/chat-suggestion.d.ts +0 -28
  358. package/dist/components/data-entry/chat-suggestion.js +0 -309
  359. package/dist/components/data-entry/tag-input.d.ts +0 -2
  360. package/dist/components/data-entry/tag-input.js +0 -5
  361. package/dist/components/feedback/banner.d.ts +0 -21
  362. package/dist/components/feedback/banner.js +0 -19
  363. package/dist/components/feedback/callout.d.ts +0 -23
  364. package/dist/components/feedback/callout.js +0 -42
  365. package/dist/components/layout/auth-shell.d.ts +0 -10
  366. package/dist/components/layout/auth-shell.js +0 -42
  367. package/dist/components/layout/space-compact.d.ts +0 -65
  368. package/dist/components/layout/space-compact.js +0 -52
  369. package/dist/components/navigation/conversations.d.ts +0 -39
  370. package/dist/components/navigation/conversations.js +0 -371
  371. package/dist/components/ui/accordion.d.ts +0 -51
  372. package/dist/components/ui/accordion.js +0 -254
  373. package/dist/components/ui/aspect-ratio.d.ts +0 -24
  374. package/dist/components/ui/aspect-ratio.js +0 -21
  375. package/dist/components/ui/avatar.d.ts +0 -16
  376. package/dist/components/ui/avatar.js +0 -115
  377. package/dist/components/ui/credential-reveal.d.ts +0 -9
  378. package/dist/components/ui/credential-reveal.js +0 -160
  379. package/dist/components/ui/hover-card.d.ts +0 -47
  380. package/dist/components/ui/hover-card.js +0 -205
  381. package/dist/components/ui/input-otp.d.ts +0 -48
  382. package/dist/components/ui/input-otp.js +0 -101
  383. package/dist/components/ui/password-input.d.ts +0 -38
  384. package/dist/components/ui/password-input.js +0 -60
  385. package/dist/components/ui/rating.d.ts +0 -38
  386. package/dist/components/ui/rating.js +0 -131
  387. package/dist/components/ui/segmented.d.ts +0 -94
  388. package/dist/components/ui/segmented.js +0 -108
  389. package/dist/components/ui/separator.d.ts +0 -25
  390. package/dist/components/ui/separator.js +0 -74
  391. package/dist/components/ui/toggle-group.d.ts +0 -108
  392. package/dist/components/ui/toggle-group.js +0 -194
  393. package/dist/components/ui/toggle.d.ts +0 -86
  394. package/dist/components/ui/toggle.js +0 -156
  395. package/docs/CANONICAL-CONTRACTS.md +0 -206
  396. package/docs/COMPONENTS.md +0 -163
  397. package/docs/DATETIME.md +0 -78
  398. package/docs/DEVELOPMENT.md +0 -269
  399. package/docs/FRAME-A11Y-CI.md +0 -287
  400. package/docs/FRAME-COVERAGE-LEDGER.md +0 -123
  401. package/docs/FRAME-COVERAGE-REPORT.md +0 -228
  402. package/docs/FRAME-COVERAGE-STANDARD.md +0 -65
  403. package/docs/FRAME-COVERAGE.md +0 -29
  404. package/docs/MEASUREMENT-CONTRACT.md +0 -109
  405. package/docs/PROPS-REGISTRY.md +0 -61
  406. package/docs/PROPS-VOCABULARY.md +0 -100
  407. package/docs/REGISTRY.md +0 -70
  408. package/docs/TESTING.md +0 -107
  409. package/docs/THEME-API-COVERAGE.md +0 -538
  410. package/docs/WHAT-BELONGS-HERE.md +0 -179
  411. package/docs/asset-modules.d.ts +0 -53
  412. package/docs/assets/cover-terrain.svg +0 -6
  413. package/docs/assets/portrait-amber.svg +0 -5
  414. package/docs/assets/portrait-clay.svg +0 -5
  415. package/docs/assets/portrait-indigo.svg +0 -5
  416. package/docs/assets/portrait-iris.svg +0 -5
  417. package/docs/assets/portrait-moss.svg +0 -5
  418. package/docs/assets/portrait-plum.svg +0 -5
  419. package/docs/assets/portrait-slate.svg +0 -5
  420. package/docs/assets/service-mark-rose.svg +0 -6
  421. package/docs/assets/service-mark-teal.svg +0 -5
  422. package/docs/assets/shot-landscape.svg +0 -12
  423. package/docs/assets/shot-portrait.svg +0 -10
  424. package/docs/assets/tcgm/card-1.svg +0 -1
  425. package/docs/assets/tcgm/card-2.svg +0 -1
  426. package/docs/assets/tcgm/card-3.svg +0 -1
  427. package/docs/assets/tcgm/card-4.svg +0 -1
  428. package/docs/assets/tcgm/card-5.svg +0 -1
  429. package/docs/assets/tcgm/card-6.svg +0 -1
  430. package/docs/assets/tcgm/hero-prism.svg +0 -1
  431. package/docs/assets/tcgm/scene-1.svg +0 -1
  432. package/docs/assets/tcgm/scene-2.svg +0 -1
  433. package/docs/assets/tcgm/scene-3.svg +0 -1
  434. package/docs/assets/tcgm/scene-4.svg +0 -1
  435. package/docs/assets/tcgm/scene-5.svg +0 -1
  436. package/docs/assets/tcgm/tcgm-lockup-color.svg +0 -1
  437. package/docs/assets/tcgm/tcgm-symbol-color.svg +0 -1
  438. package/docs/charts/cjk-category-axis.tsx +0 -81
  439. package/docs/charts/compact-bar-trend.tsx +0 -327
  440. package/docs/charts/size-tiers.tsx +0 -192
  441. package/docs/data-display/accordion.tsx +0 -99
  442. package/docs/data-display/avatar.tsx +0 -502
  443. package/docs/data-display/badge.tsx +0 -335
  444. package/docs/data-display/card/examples/detail-panel.tsx +0 -106
  445. package/docs/data-display/card/examples/tab-list.tsx +0 -97
  446. package/docs/data-display/card/index.md +0 -3
  447. package/docs/data-display/card/index.tsx +0 -390
  448. package/docs/data-display/carousel.tsx +0 -160
  449. package/docs/data-display/charts.tsx +0 -278
  450. package/docs/data-display/chat-bubble.tsx +0 -397
  451. package/docs/data-display/code-block.tsx +0 -188
  452. package/docs/data-display/collapsible.tsx +0 -162
  453. package/docs/data-display/credential-reveal.tsx +0 -148
  454. package/docs/data-display/data-table/examples/antd-parity.tsx +0 -257
  455. package/docs/data-display/data-table/examples/approval-queue.tsx +0 -212
  456. package/docs/data-display/data-table/examples/grid-features.tsx +0 -158
  457. package/docs/data-display/data-table/examples/list-page.tsx +0 -175
  458. package/docs/data-display/data-table/examples/selectable-inbox.tsx +0 -113
  459. package/docs/data-display/data-table/examples/server-paged.tsx +0 -179
  460. package/docs/data-display/data-table/examples/striped-list.tsx +0 -173
  461. package/docs/data-display/data-table/index.md +0 -9
  462. package/docs/data-display/data-table/index.tsx +0 -407
  463. package/docs/data-display/descriptions.tsx +0 -263
  464. package/docs/data-display/empty-state.tsx +0 -164
  465. package/docs/data-display/feature-list.tsx +0 -159
  466. package/docs/data-display/hover-card.tsx +0 -181
  467. package/docs/data-display/image.tsx +0 -170
  468. package/docs/data-display/legend.tsx +0 -158
  469. package/docs/data-display/list-row.tsx +0 -441
  470. package/docs/data-display/markdown.tsx +0 -86
  471. package/docs/data-display/marquee.tsx +0 -254
  472. package/docs/data-display/org-chart.tsx +0 -165
  473. package/docs/data-display/permission-matrix.tsx +0 -188
  474. package/docs/data-display/popover-touch.tsx +0 -27
  475. package/docs/data-display/popover.tsx +0 -331
  476. package/docs/data-display/progress.tsx +0 -162
  477. package/docs/data-display/prose.tsx +0 -169
  478. package/docs/data-display/qr-code.tsx +0 -68
  479. package/docs/data-display/scroll-area.tsx +0 -420
  480. package/docs/data-display/service-launcher-card.tsx +0 -445
  481. package/docs/data-display/stat-card.tsx +0 -354
  482. package/docs/data-display/swatch.tsx +0 -107
  483. package/docs/data-display/table.tsx +0 -362
  484. package/docs/data-display/text-diff.tsx +0 -89
  485. package/docs/data-display/thought-chain.tsx +0 -176
  486. package/docs/data-display/thumbnail.tsx +0 -128
  487. package/docs/data-display/timeline-grid.tsx +0 -119
  488. package/docs/data-display/timeline.tsx +0 -671
  489. package/docs/data-display/touch-actions.tsx +0 -36
  490. package/docs/data-display/tree.tsx +0 -724
  491. package/docs/data-display/welcome.tsx +0 -115
  492. package/docs/data-entry/attachments.tsx +0 -160
  493. package/docs/data-entry/block-editor.tsx +0 -105
  494. package/docs/data-entry/branch-scope-picker.tsx +0 -128
  495. package/docs/data-entry/calendar.tsx +0 -226
  496. package/docs/data-entry/cascader.tsx +0 -380
  497. package/docs/data-entry/chat-composer.tsx +0 -619
  498. package/docs/data-entry/chat-suggestion.tsx +0 -301
  499. package/docs/data-entry/checkbox.tsx +0 -256
  500. package/docs/data-entry/color-picker.tsx +0 -189
  501. package/docs/data-entry/command-palette.tsx +0 -179
  502. package/docs/data-entry/command.tsx +0 -341
  503. package/docs/data-entry/country-picker-recipe.tsx +0 -175
  504. package/docs/data-entry/date-picker.tsx +0 -452
  505. package/docs/data-entry/emoji-picker.tsx +0 -35
  506. package/docs/data-entry/form/examples/employee-settings.tsx +0 -267
  507. package/docs/data-entry/form/examples/invoice-form.tsx +0 -387
  508. package/docs/data-entry/form-dynamic-fields.tsx +0 -199
  509. package/docs/data-entry/form-field/examples/a11y-contract.tsx +0 -242
  510. package/docs/data-entry/form-field/examples/create-form.tsx +0 -107
  511. package/docs/data-entry/form-field/index.md +0 -8
  512. package/docs/data-entry/form-field/index.tsx +0 -337
  513. package/docs/data-entry/form-inertia.tsx +0 -80
  514. package/docs/data-entry/form-root.tsx +0 -112
  515. package/docs/data-entry/form.tsx +0 -1498
  516. package/docs/data-entry/input-otp.tsx +0 -258
  517. package/docs/data-entry/input.tsx +0 -796
  518. package/docs/data-entry/label.tsx +0 -102
  519. package/docs/data-entry/markdown-editor.tsx +0 -69
  520. package/docs/data-entry/number-input.tsx +0 -279
  521. package/docs/data-entry/password-input.tsx +0 -102
  522. package/docs/data-entry/password-strength.tsx +0 -99
  523. package/docs/data-entry/radio-group.tsx +0 -316
  524. package/docs/data-entry/rating.tsx +0 -91
  525. package/docs/data-entry/record-picker.tsx +0 -209
  526. package/docs/data-entry/search-input.tsx +0 -121
  527. package/docs/data-entry/segmented-in-filter-row.tsx +0 -60
  528. package/docs/data-entry/segmented.tsx +0 -300
  529. package/docs/data-entry/select-async-contracts.tsx +0 -108
  530. package/docs/data-entry/select-matrix.tsx +0 -209
  531. package/docs/data-entry/select.tsx +0 -547
  532. package/docs/data-entry/slider.tsx +0 -212
  533. package/docs/data-entry/sortable-list.tsx +0 -76
  534. package/docs/data-entry/switch.tsx +0 -314
  535. package/docs/data-entry/tag-input.tsx +0 -145
  536. package/docs/data-entry/textarea.tsx +0 -249
  537. package/docs/data-entry/time-picker.tsx +0 -187
  538. package/docs/data-entry/time-range-picker.tsx +0 -55
  539. package/docs/data-entry/toggle-count.tsx +0 -348
  540. package/docs/data-entry/toggle-group.tsx +0 -438
  541. package/docs/data-entry/toggle.tsx +0 -217
  542. package/docs/data-entry/transfer.tsx +0 -115
  543. package/docs/data-entry/tree-select.tsx +0 -204
  544. package/docs/data-entry/upload-crop-dialog.tsx +0 -109
  545. package/docs/data-entry/upload.tsx +0 -310
  546. package/docs/feedback/alert-dialog.tsx +0 -270
  547. package/docs/feedback/alert.tsx +0 -248
  548. package/docs/feedback/auth-expiry.tsx +0 -104
  549. package/docs/feedback/banner.tsx +0 -183
  550. package/docs/feedback/callout.tsx +0 -220
  551. package/docs/feedback/danger-confirm.tsx +0 -91
  552. package/docs/feedback/dialog-touch.tsx +0 -24
  553. package/docs/feedback/dialog.tsx +0 -373
  554. package/docs/feedback/sheet.tsx +0 -510
  555. package/docs/feedback/skeleton.tsx +0 -168
  556. package/docs/feedback/toast.tsx +0 -135
  557. package/docs/feedback/tooltip.tsx +0 -171
  558. package/docs/feedback/two-factor-setup.tsx +0 -68
  559. package/docs/foundation/_email-specimen.ts +0 -274
  560. package/docs/foundation/_theme-editor-scope.ts +0 -222
  561. package/docs/foundation/colors.tsx +0 -207
  562. package/docs/foundation/density.tsx +0 -242
  563. package/docs/foundation/email-tokens.tsx +0 -323
  564. package/docs/foundation/radius-shadow.tsx +0 -154
  565. package/docs/foundation/spacing.tsx +0 -216
  566. package/docs/foundation/theme-editor.tsx +0 -654
  567. package/docs/foundation/typography.tsx +0 -147
  568. package/docs/general/actions.tsx +0 -175
  569. package/docs/general/activity.tsx +0 -289
  570. package/docs/general/button/examples/destructive-confirm.tsx +0 -90
  571. package/docs/general/button/examples/form-actions.tsx +0 -87
  572. package/docs/general/button/examples/toolbar.tsx +0 -160
  573. package/docs/general/button/index.md +0 -16
  574. package/docs/general/button/index.tsx +0 -236
  575. package/docs/general/float-button.tsx +0 -133
  576. package/docs/general/icon.tsx +0 -217
  577. package/docs/general/logo.tsx +0 -194
  578. package/docs/general/reveal.tsx +0 -309
  579. package/docs/general/typography.tsx +0 -542
  580. package/docs/i18n/messages/en.json +0 -1715
  581. package/docs/i18n/messages/ja.json +0 -1708
  582. package/docs/i18n/messages/vi.json +0 -1708
  583. package/docs/layout/account-chip.tsx +0 -72
  584. package/docs/layout/admin-collection.tsx +0 -122
  585. package/docs/layout/affix.tsx +0 -209
  586. package/docs/layout/app-launcher.tsx +0 -211
  587. package/docs/layout/app-shell-arrangements.tsx +0 -225
  588. package/docs/layout/app-shell-narrow-bar.tsx +0 -205
  589. package/docs/layout/app-shell-states.tsx +0 -171
  590. package/docs/layout/app-shell.tsx +0 -395
  591. package/docs/layout/aspect-ratio.tsx +0 -135
  592. package/docs/layout/auth-account-summary.tsx +0 -103
  593. package/docs/layout/auth-divider.tsx +0 -28
  594. package/docs/layout/auth-footer.tsx +0 -37
  595. package/docs/layout/auth-identity.tsx +0 -70
  596. package/docs/layout/auth-recovery/examples/mfa-challenge.md +0 -41
  597. package/docs/layout/auth-recovery/examples/mfa-challenge.tsx +0 -254
  598. package/docs/layout/auth-recovery/examples/mobile-390.md +0 -25
  599. package/docs/layout/auth-recovery/examples/mobile-390.tsx +0 -82
  600. package/docs/layout/auth-recovery/examples/password-recovery.md +0 -24
  601. package/docs/layout/auth-recovery/examples/password-recovery.tsx +0 -197
  602. package/docs/layout/auth-recovery/examples/wrapping-ja-en-vi.md +0 -27
  603. package/docs/layout/auth-recovery/examples/wrapping-ja-en-vi.tsx +0 -156
  604. package/docs/layout/auth-recovery/index.md +0 -140
  605. package/docs/layout/auth-recovery/index.tsx +0 -96
  606. package/docs/layout/auth-shell-context.tsx +0 -103
  607. package/docs/layout/auth-shell-device.tsx +0 -112
  608. package/docs/layout/auth-shell-registration.tsx +0 -338
  609. package/docs/layout/auth-shell-variants.tsx +0 -143
  610. package/docs/layout/auth-shell.tsx +0 -59
  611. package/docs/layout/auth-stack.tsx +0 -40
  612. package/docs/layout/centered-shell.tsx +0 -102
  613. package/docs/layout/draggable-panel.tsx +0 -127
  614. package/docs/layout/error-surface/examples/application-403.tsx +0 -84
  615. package/docs/layout/error-surface/examples/application-404.tsx +0 -77
  616. package/docs/layout/error-surface/examples/system-500.tsx +0 -47
  617. package/docs/layout/error-surface/examples/system-503.tsx +0 -48
  618. package/docs/layout/error-surface/index.md +0 -153
  619. package/docs/layout/error-surface/index.tsx +0 -239
  620. package/docs/layout/flex.tsx +0 -444
  621. package/docs/layout/legal-document-shell/_data.ts +0 -110
  622. package/docs/layout/legal-document-shell/examples/desktop-1440.md +0 -12
  623. package/docs/layout/legal-document-shell/examples/desktop-1440.tsx +0 -83
  624. package/docs/layout/legal-document-shell/examples/mobile-390.md +0 -22
  625. package/docs/layout/legal-document-shell/examples/mobile-390.tsx +0 -70
  626. package/docs/layout/legal-document-shell/examples/tablet-1024.md +0 -3
  627. package/docs/layout/legal-document-shell/examples/tablet-1024.tsx +0 -84
  628. package/docs/layout/legal-document-shell/examples/wrapping-ja-en-vi.md +0 -18
  629. package/docs/layout/legal-document-shell/examples/wrapping-ja-en-vi.tsx +0 -61
  630. package/docs/layout/legal-document-shell/index.md +0 -51
  631. package/docs/layout/legal-document-shell/index.tsx +0 -101
  632. package/docs/layout/masonry.tsx +0 -291
  633. package/docs/layout/master-detail.tsx +0 -390
  634. package/docs/layout/mobile-shell.tsx +0 -106
  635. package/docs/layout/nav-list.tsx +0 -584
  636. package/docs/layout/org-switcher.tsx +0 -131
  637. package/docs/layout/page-container.tsx +0 -1020
  638. package/docs/layout/page-cover.tsx +0 -56
  639. package/docs/layout/resizable-panel.tsx +0 -419
  640. package/docs/layout/responsive-grid.tsx +0 -403
  641. package/docs/layout/separator.tsx +0 -327
  642. package/docs/layout/service-role-panel.tsx +0 -144
  643. package/docs/layout/sidebar.tsx +0 -689
  644. package/docs/layout/space-compact.tsx +0 -202
  645. package/docs/layout/split-pane.tsx +0 -532
  646. package/docs/layout/topbar-item.tsx +0 -233
  647. package/docs/layout/topbar.tsx +0 -360
  648. package/docs/navigation/anchor.tsx +0 -295
  649. package/docs/navigation/app-setting-picker.tsx +0 -178
  650. package/docs/navigation/app-setting-toggle.tsx +0 -111
  651. package/docs/navigation/breadcrumb.tsx +0 -207
  652. package/docs/navigation/card-tabs.tsx +0 -344
  653. package/docs/navigation/conversations.tsx +0 -176
  654. package/docs/navigation/dropdown-menu.tsx +0 -345
  655. package/docs/navigation/filter-bar.tsx +0 -247
  656. package/docs/navigation/mega-menu-panel.tsx +0 -86
  657. package/docs/navigation/mega-menu.tsx +0 -254
  658. package/docs/navigation/pagination.tsx +0 -293
  659. package/docs/navigation/steps.tsx +0 -315
  660. package/docs/navigation/tabs-rtl.tsx +0 -28
  661. package/docs/navigation/tabs.tsx +0 -755
  662. package/docs/navigation/toolbar.tsx +0 -347
  663. package/docs/providers/app-provider.tsx +0 -191
  664. package/docs/providers/format-date.tsx +0 -230
  665. package/docs/providers/theme-scope.tsx +0 -186
  666. package/docs/query/button-refetch.tsx +0 -161
  667. package/docs/query/data-state.tsx +0 -262
  668. package/docs/query/infinite-query-state.tsx +0 -97
  669. package/docs/query/mutation-feedback.tsx +0 -128
  670. package/docs/query/touch-actions.tsx +0 -68
  671. package/docs/react-router/prefetch-link.tsx +0 -262
  672. package/docs/roadmap/ai-chat-components.md +0 -206
  673. package/docs/roadmap/antd-parity.md +0 -155
  674. package/docs/roadmap/badge-tag-chip-count.md +0 -172
  675. package/docs/roadmap/list-masonry.md +0 -159
  676. package/docs/roadmap/parity-audit-data-display-feedback.md +0 -567
  677. package/docs/roadmap/parity-audit-data-entry.md +0 -368
  678. package/docs/roadmap/parity-audit-layout-navigation-general.md +0 -459
  679. package/docs/roadmap/parity-backlog.md +0 -77
  680. package/docs/roadmap/tree-components.md +0 -151
  681. package/docs/roadmap/website-components.md +0 -813
  682. package/docs/showcase/acme-portal.tsx +0 -461
  683. package/docs/showcase/acme-website.tsx +0 -499
  684. package/docs/showcase/caimono-price-comparison.tsx +0 -919
  685. package/docs/showcase/case1-warehouse-dashboard.tsx +0 -358
  686. package/docs/showcase/case2-employee-me.tsx +0 -438
  687. package/docs/showcase/case3-approval-workflow.tsx +0 -531
  688. package/docs/showcase/case4-login.tsx +0 -312
  689. package/docs/showcase/case5-shift-calendar.tsx +0 -702
  690. package/docs/showcase/case6-agency-handy.tsx +0 -1120
  691. package/docs/showcase/futurelastic-web.tsx +0 -441
  692. package/docs/showcase/marketing-page.tsx +0 -895
  693. package/docs/showcase/org-switcher.tsx +0 -320
  694. package/docs/showcase/permission-matrix.tsx +0 -354
  695. package/docs/showcase/public-landing.tsx +0 -210
  696. package/docs/showcase/settings-account-sections.tsx +0 -559
  697. package/docs/showcase/settings-security-mfa.tsx +0 -145
  698. package/docs/showcase/table-approval-queue.tsx +0 -199
  699. package/docs/showcase/table-bulk-actions.tsx +0 -468
  700. package/docs/showcase/table-compact-kintone.tsx +0 -438
  701. package/docs/showcase/table-conditional-format.tsx +0 -367
  702. package/docs/showcase/table-crud-list.tsx +0 -544
  703. package/docs/showcase/table-density.tsx +0 -349
  704. package/docs/showcase/table-expandable-rows.tsx +0 -496
  705. package/docs/showcase/table-filter-chips.tsx +0 -468
  706. package/docs/showcase/table-footer-totals.tsx +0 -328
  707. package/docs/showcase/table-grouped-subtotals.tsx +0 -398
  708. package/docs/showcase/table-master-detail.tsx +0 -482
  709. package/docs/showcase/table-pagination.tsx +0 -409
  710. package/docs/showcase/table-states.tsx +0 -371
  711. package/docs/showcase/table-sticky-columns.tsx +0 -377
  712. package/docs/showcase/table-tree-rows.tsx +0 -451
  713. package/docs/showcase/table-view-tabs.tsx +0 -488
  714. package/docs/showcase/tcgm-website.tsx +0 -1047
  715. package/docs/showcase/tenant-brand-color.tsx +0 -338
  716. package/docs/showcase/theme-customization.tsx +0 -1292
  717. package/docs/showcase/theme-lab.tsx +0 -2125
  718. package/docs/themes/flat.css +0 -466
  719. package/docs/themes/glassmorphism.css +0 -960
  720. package/docs/themes/index.ts +0 -219
  721. package/docs/themes/neubrutalism.css +0 -481
  722. /package/dist/components/navigation/{filter-bar.d.ts → toolbar.d.ts} +0 -0
  723. /package/dist/components/navigation/{filter-bar.js → toolbar.js} +0 -0
  724. /package/dist/{components/data-display → lab}/carousel.d.ts +0 -0
  725. /package/dist/{components/data-entry → lab}/emoji-data.d.ts +0 -0
  726. /package/dist/{components/data-entry → lab}/emoji-data.js +0 -0
  727. /package/dist/{components/data-display → lab}/marquee-reveal.d.ts +0 -0
  728. /package/dist/{components/data-display → lab}/marquee-reveal.js +0 -0
@@ -1,1498 +0,0 @@
1
- import { useState } from "react";
2
-
3
- import {
4
- Cascader,
5
- Checkbox,
6
- CheckboxGroup,
7
- DatePicker,
8
- Field,
9
- Form,
10
- FormErrors,
11
- FormErrorsProvider,
12
- FormField,
13
- Input,
14
- InputOTP,
15
- InputOTPGroup,
16
- InputOTPSlot,
17
- NumberInput,
18
- PasswordInput,
19
- Rating,
20
- RadioGroup,
21
- SearchInput,
22
- Select,
23
- Slider,
24
- Switch,
25
- TagInput,
26
- Textarea,
27
- TimePicker,
28
- ToggleGroup,
29
- ToggleGroupItem,
30
- TreeSelect,
31
- Upload,
32
- type UploadFileItem,
33
- } from "@godxjp/ui/data-entry";
34
- import type { DateRange } from "react-day-picker";
35
- import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display";
36
- import { Button, Heading, Text } from "@godxjp/ui/general";
37
- import { Flex, PageContainer } from "@godxjp/ui/layout";
38
-
39
- /** Keep the upload lifecycle visible in the form example. */
40
- async function noopUpload(_file: File, _item: UploadFileItem) {
41
- await new Promise((resolve) => setTimeout(resolve, 800));
42
- return { mediaId: crypto.randomUUID() };
43
- }
44
-
45
- /** Expense category tree for the Cascader field. */
46
- const EXPENSE_CATEGORIES = [
47
- {
48
- value: "operating",
49
- label: "営業費用",
50
- children: [
51
- { value: "travel", label: "旅費交通費" },
52
- { value: "communication", label: "通信費" },
53
- { value: "supplies", label: "消耗品費" },
54
- ],
55
- },
56
- {
57
- value: "labor",
58
- label: "人件費",
59
- children: [
60
- { value: "salary", label: "給与手当" },
61
- { value: "bonus", label: "賞与" },
62
- ],
63
- },
64
- ];
65
-
66
- /** Account tree for the TreeSelect field. */
67
- const ACCOUNT_TREE = [
68
- {
69
- value: "assets",
70
- label: "資産",
71
- children: [
72
- { value: "cash", label: "現金" },
73
- { value: "bank", label: "普通預金" },
74
- { value: "ar", label: "売掛金" },
75
- ],
76
- },
77
- {
78
- value: "expenses",
79
- label: "費用",
80
- children: [
81
- { value: "rent", label: "地代家賃" },
82
- { value: "utilities", label: "水道光熱費" },
83
- ],
84
- },
85
- ];
86
-
87
- /** 都道府県 — 住所の複合行の先頭。value は ISO 3166-2:JP のサブディビジョンコード。 */
88
- const PREFECTURES = [
89
- { value: "JP-13", label: "東京都" },
90
- { value: "JP-14", label: "神奈川県" },
91
- { value: "JP-27", label: "大阪府" },
92
- { value: "JP-23", label: "愛知県" },
93
- { value: "JP-01", label: "北海道" },
94
- ];
95
-
96
- /** 生年月日の 年/月/日 3連 Select — 日本の業務フォームで最も多い複合フィールド。 */
97
- const BIRTH_YEARS = Array.from({ length: 60 }, (_, index) => {
98
- const year = 2006 - index;
99
- return { value: String(year), label: `${year}年` };
100
- });
101
- const MONTHS = Array.from({ length: 12 }, (_, index) => ({
102
- value: String(index + 1),
103
- label: `${index + 1}月`,
104
- }));
105
- const DAYS = Array.from({ length: 31 }, (_, index) => ({
106
- value: String(index + 1),
107
- label: `${index + 1}日`,
108
- }));
109
-
110
- /**
111
- * Form — the comprehensive catalogue. One page proving (1) EVERY data-entry field type wired in a
112
- * FormField, (2) every Form LAYOUT (vertical / horizontal / inline / multi-column / responsive
113
- * collapse), and (3) every Form STATE (pristine · filled · required-error · helper · disabled ·
114
- * read-only · pending · success). Composed only from real @godxjp/ui primitives; all typography is
115
- * the Text/Heading primitive (never a hand-rolled span). For the full controlled validation flow,
116
- * see the example screens under Form → examples.
117
- */
118
- export default function Demo() {
119
- // ── Field-catalogue state (each field independent) ─────────────────────────
120
- const [text, setText] = useState("");
121
- const [search, setSearch] = useState("");
122
- const [memo, setMemo] = useState("");
123
- const [account, setAccount] = useState("");
124
- const [tree, setTree] = useState<string | undefined>();
125
- const [category, setCategory] = useState<string[]>([]);
126
- const [terms, setTerms] = useState(false);
127
- const [channels, setChannels] = useState<string[]>(["email"]);
128
- const [rounding, setRounding] = useState("round");
129
- const [active, setActive] = useState(true);
130
- const [taxRate, setTaxRate] = useState<number[]>([10]);
131
- const [issueDate, setIssueDate] = useState<Date | undefined>(new Date(2026, 0, 15));
132
- const [period, setPeriod] = useState<DateRange | undefined>();
133
- const [closeTime, setCloseTime] = useState("17:30");
134
- const [startTime, setStartTime] = useState("09:00");
135
- const [endTime, setEndTime] = useState("");
136
- const [score, setScore] = useState(4);
137
- const [tags, setTags] = useState<string[]>(["優先"]);
138
- const [otp, setOtp] = useState("");
139
- const [files, setFiles] = useState<UploadFileItem[]>([]);
140
- const [period2, setPeriod2] = useState("monthly");
141
-
142
- // ── 複合フィールド(1ラベル × 複数入力)の状態 ─────────────────────────────
143
- const [lastName, setLastName] = useState("山田");
144
- const [firstName, setFirstName] = useState("太郎");
145
- const [kanaLast, setKanaLast] = useState("ヤマダ");
146
- const [kanaFirst, setKanaFirst] = useState("タロウ");
147
- const [zip1, setZip1] = useState("100");
148
- const [zip2, setZip2] = useState("0005");
149
- const [prefecture, setPrefecture] = useState("JP-13");
150
- const [birthYear, setBirthYear] = useState("1988");
151
- const [birthMonth, setBirthMonth] = useState("4");
152
- const [birthDay, setBirthDay] = useState("");
153
-
154
- // ── Textarea 系の状態(文字数カウンタ・自動伸長) ──────────────────────────
155
- const [remarks, setRemarks] = useState("初回取引のため与信枠は50万円で開始する。");
156
- const [thread, setThread] = useState("");
157
-
158
- return (
159
- <PageContainer
160
- title="Form"
161
- subtitle="全フィールド型 × 全レイアウト × 全状態 · 実画面のフォーム例 (real primitives only)"
162
- >
163
- <Flex direction="col" gap="lg">
164
- <Card>
165
- <CardHeader>
166
- <CardTitle level={2}>Validation feedback</CardTitle>
167
- <CardDescription>確認中・成功・注意・エラーを区別します。</CardDescription>
168
- </CardHeader>
169
- <CardContent>
170
- <Form requiredMark="optional">
171
- <FormField label="確認済み" hasFeedback validateStatus="success">
172
- <Input defaultValue="verified@example.jp" />
173
- </FormField>
174
- <FormField label="確認中" hasFeedback validateStatus="validating">
175
- <Input defaultValue="checking@example.jp" />
176
- </FormField>
177
- <FormField
178
- label="注意"
179
- hasFeedback
180
- validateStatus="warning"
181
- helper="内容を確認してください。"
182
- >
183
- <Input defaultValue="review@example.jp" />
184
- </FormField>
185
- <FormField
186
- label="エラー"
187
- required
188
- hasFeedback
189
- error="メールアドレスを入力してください。"
190
- >
191
- <Input />
192
- </FormField>
193
- </Form>
194
- </CardContent>
195
- </Card>
196
-
197
- {/* ════════════════════ 1. COMPOUND FIELDS ════════════════════ */}
198
- <Heading level={2}>1. 複合フィールド · 1つのラベルに複数の入力欄</Heading>
199
- <Text tone="muted" size="sm">
200
- 日本の業務フォームでは氏名・郵便番号・電話番号・生年月日がいずれも「1項目 ×
201
- 複数入力欄」になる。FormField は直下の 1 要素にしか属性を注入できないので、直下が Flex
202
- のときはラベルを FieldNameContext で配り、Flex 自身を role=group にする。これが無いと中の
203
- Input / Select は全て無名になり、axe の label · button-name が一気に赤くなる(gh#303)。
204
- </Text>
205
-
206
- <Card>
207
- <CardHeader>
208
- <CardTitle level={2}>氏名 · フリガナ(1ラベル × 2入力)</CardTitle>
209
- <CardDescription>
210
- 「氏名」は 1 項目・2 欄。Flex でくるんでも姓と名の両方にラベルが届く。ただし各欄の
211
- aria-label を省くと両方が「氏名」と読み上げられ、どちらが姓か分からなくなる。
212
- 複合フィールドで最初に壊れるのがここ。data-field は各 Input 自身の id から解決され、
213
- cmp-name-last / cmp-name-first として別々に自動テストから掴める。
214
- </CardDescription>
215
- </CardHeader>
216
- <CardContent>
217
- <Form layout="horizontal" labelWidth="9rem">
218
- <FormField id="cmp-name" label="氏名" required helper="戸籍上の表記で入力">
219
- <Flex direction="row" gap="sm" align="center">
220
- <Input
221
- id="cmp-name-last"
222
- aria-label="姓"
223
- value={lastName}
224
- onValueChange={setLastName}
225
- placeholder="山田"
226
- />
227
- <Input
228
- id="cmp-name-first"
229
- aria-label="名"
230
- value={firstName}
231
- onValueChange={setFirstName}
232
- placeholder="太郎"
233
- />
234
- </Flex>
235
- </FormField>
236
- <FormField id="cmp-kana" label="フリガナ" required helper="全角カタカナ">
237
- <Flex direction="row" gap="sm" align="center">
238
- <Input
239
- id="cmp-kana-last"
240
- aria-label="セイ"
241
- value={kanaLast}
242
- onValueChange={setKanaLast}
243
- placeholder="ヤマダ"
244
- />
245
- <Input
246
- id="cmp-kana-first"
247
- aria-label="メイ"
248
- value={kanaFirst}
249
- onValueChange={setKanaFirst}
250
- placeholder="タロウ"
251
- />
252
- </Flex>
253
- </FormField>
254
- </Form>
255
- </CardContent>
256
- </Card>
257
-
258
- <Card>
259
- <CardHeader>
260
- <CardTitle level={2}>郵便番号 · 住所(狭い欄と広い欄が同じ行に並ぶ)</CardTitle>
261
- <CardDescription>
262
- 郵便番号は 3桁 + 4桁 の固定幅、住所は残り全部。幅を Input
263
- に持たせる方法は無いので、狭い欄だけを Flex width で囲み shrink={false}
264
- で潰れないようにする。区切りの「-」は Text aria-hidden で、読み上げには混ぜない。
265
- 住所行は都道府県 Select(width=auto)+市区町村+番地で、grow が効かないと番地欄が
266
- 3文字幅に潰れるのが見える。
267
- </CardDescription>
268
- </CardHeader>
269
- <CardContent>
270
- <Form layout="horizontal" labelWidth="9rem">
271
- <FormField
272
- id="cmp-zip"
273
- label="郵便番号"
274
- required
275
- helper="ハイフンなしの7桁でも可"
276
- labelAddon={
277
- <Button type="button" variant="link" size="xs">
278
- 住所を自動入力
279
- </Button>
280
- }
281
- >
282
- <Flex direction="row" gap="sm" align="center">
283
- <Text aria-hidden tone="muted">
284
- 〒
285
- </Text>
286
- <Flex width="5.5rem" shrink={false}>
287
- <Input
288
- id="cmp-zip-head"
289
- aria-label="郵便番号 上3桁"
290
- inputMode="numeric"
291
- maxLength={3}
292
- value={zip1}
293
- onValueChange={setZip1}
294
- placeholder="100"
295
- />
296
- </Flex>
297
- <Text aria-hidden tone="muted">
298
- -
299
- </Text>
300
- <Flex width="6.5rem" shrink={false}>
301
- <Input
302
- id="cmp-zip-tail"
303
- aria-label="郵便番号 下4桁"
304
- inputMode="numeric"
305
- maxLength={4}
306
- value={zip2}
307
- onValueChange={setZip2}
308
- placeholder="0005"
309
- />
310
- </Flex>
311
- </Flex>
312
- </FormField>
313
- <FormField id="cmp-address" label="住所" required>
314
- <Flex direction="row" gap="sm" align="center" wrap>
315
- <Flex width="9rem" shrink={false}>
316
- <Select
317
- id="cmp-address-pref"
318
- aria-label="都道府県"
319
- name="prefecture"
320
- value={prefecture}
321
- onValueChange={setPrefecture}
322
- options={PREFECTURES}
323
- placeholder="都道府県"
324
- />
325
- </Flex>
326
- <Flex width="11rem" shrink={false}>
327
- <Input
328
- id="cmp-address-city"
329
- aria-label="市区町村"
330
- defaultValue="千代田区丸の内"
331
- />
332
- </Flex>
333
- <Flex grow>
334
- <Input
335
- id="cmp-address-street"
336
- aria-label="番地・建物名"
337
- defaultValue="1-9-1 グラントウキョウノースタワー 18F"
338
- />
339
- </Flex>
340
- </Flex>
341
- </FormField>
342
- </Form>
343
- </CardContent>
344
- </Card>
345
-
346
- <Card>
347
- <CardHeader>
348
- <CardTitle level={2}>電話番号 3分割 · 生年月日 年/月/日 Select</CardTitle>
349
- <CardDescription>
350
- 桁数の決まった 3 分割と、型の違うコントロールを 1 ラベル下に混ぜる場合。生年月日は
351
- Select × 3(年は60件、月日は固定)で、どれか一つでも未選択なら値として不完全になる。
352
- その「部分入力」をどう検証するかが複合フィールドの本題。DatePicker
353
- で足りる画面ではこのパターンを使わない。
354
- </CardDescription>
355
- </CardHeader>
356
- <CardContent>
357
- <Form layout="horizontal" labelWidth="9rem">
358
- <FormField id="cmp-tel" label="電話番号" helper="市外局番から">
359
- {/* The three parts never split across lines — "03 -" alone on a row reads as a
360
- whole number. The extension is a separate value, so it is what wraps on a phone. */}
361
- <Flex direction="row" gap="sm" align="center" wrap>
362
- <Flex direction="row" gap="sm" align="center" shrink={false}>
363
- <Flex width="4rem" shrink={false}>
364
- <Input
365
- id="cmp-tel-area"
366
- aria-label="市外局番"
367
- inputMode="numeric"
368
- maxLength={4}
369
- defaultValue="03"
370
- />
371
- </Flex>
372
- <Text aria-hidden tone="muted">
373
- -
374
- </Text>
375
- <Flex width="4rem" shrink={false}>
376
- <Input
377
- id="cmp-tel-city"
378
- aria-label="市内局番"
379
- inputMode="numeric"
380
- maxLength={4}
381
- defaultValue="6273"
382
- />
383
- </Flex>
384
- <Text aria-hidden tone="muted">
385
- -
386
- </Text>
387
- <Flex width="4rem" shrink={false}>
388
- <Input
389
- id="cmp-tel-line"
390
- aria-label="加入者番号"
391
- inputMode="numeric"
392
- maxLength={4}
393
- defaultValue="0001"
394
- />
395
- </Flex>
396
- </Flex>
397
- <Flex width="6rem" shrink={false}>
398
- <NumberInput
399
- id="cmp-tel-ext"
400
- aria-label="内線番号"
401
- controls={false}
402
- min={0}
403
- max={9999}
404
- defaultValue={281}
405
- />
406
- </Flex>
407
- </Flex>
408
- </FormField>
409
- <FormField
410
- id="cmp-birth"
411
- label="生年月日"
412
- required
413
- error={birthDay === "" ? "日を選択してください。" : undefined}
414
- >
415
- <Flex direction="row" gap="sm" align="center" wrap>
416
- <Flex width="8rem" shrink={false}>
417
- <Select
418
- id="cmp-birth-year"
419
- aria-label="生年"
420
- name="birth_year"
421
- value={birthYear}
422
- onValueChange={setBirthYear}
423
- options={BIRTH_YEARS}
424
- placeholder="年"
425
- showSearch
426
- />
427
- </Flex>
428
- <Flex width="6rem" shrink={false}>
429
- <Select
430
- id="cmp-birth-month"
431
- aria-label="生月"
432
- name="birth_month"
433
- value={birthMonth}
434
- onValueChange={setBirthMonth}
435
- options={MONTHS}
436
- placeholder="月"
437
- />
438
- </Flex>
439
- <Flex width="6rem" shrink={false}>
440
- <Select
441
- id="cmp-birth-day"
442
- aria-label="生日"
443
- name="birth_day"
444
- value={birthDay}
445
- onValueChange={setBirthDay}
446
- options={DAYS}
447
- placeholder="日"
448
- status={birthDay === "" ? "error" : undefined}
449
- />
450
- </Flex>
451
- </Flex>
452
- </FormField>
453
- </Form>
454
- </CardContent>
455
- </Card>
456
-
457
- <Card>
458
- <CardHeader>
459
- <CardTitle level={2}>複合フィールドのエラー · どちらの欄が悪いのか</CardTitle>
460
- <CardDescription>
461
- FormField のエラーは 1 行しか出ない。欄が 3 つある行で「形式が正しくありません」
462
- だけ出しても、利用者はどこを直せばいいか分からない。行のメッセージは FormField の
463
- error に、犯人の特定は各コントロールの status="error" に分担させる。status
464
- は塗るだけ(aria-invalid は error の側)なので二重に読み上げられない。
465
- </CardDescription>
466
- </CardHeader>
467
- <CardContent>
468
- <Form layout="horizontal" labelWidth="9rem">
469
- <FormField
470
- id="cmp-err-zip"
471
- label="郵便番号"
472
- required
473
- error="下4桁が数字ではありません。"
474
- >
475
- <Flex direction="row" gap="sm" align="center">
476
- <Flex width="5.5rem" shrink={false}>
477
- <Input id="cmp-err-zip-head" aria-label="郵便番号 上3桁" defaultValue="100" />
478
- </Flex>
479
- <Text aria-hidden tone="muted">
480
- -
481
- </Text>
482
- <Flex width="6.5rem" shrink={false}>
483
- <Input
484
- id="cmp-err-zip-tail"
485
- aria-label="郵便番号 下4桁"
486
- status="error"
487
- defaultValue="00O5"
488
- />
489
- </Flex>
490
- </Flex>
491
- </FormField>
492
- <FormField
493
- id="cmp-warn-name"
494
- label="氏名"
495
- validateStatus="warning"
496
- hasFeedback
497
- helper="フリガナと姓が一致しません。登録は可能です。"
498
- >
499
- <Flex direction="row" gap="sm" align="center">
500
- <Input id="cmp-warn-name-last" aria-label="姓" defaultValue="山田" />
501
- <Input id="cmp-warn-name-first" aria-label="名" defaultValue="太郎" />
502
- </Flex>
503
- </FormField>
504
- <FormField id="cmp-ok-tel" label="電話番号" validateStatus="success" hasFeedback>
505
- <Flex direction="row" gap="sm" align="center">
506
- <Flex width="4rem" shrink={false}>
507
- <Input id="cmp-ok-tel-area" aria-label="市外局番" defaultValue="03" />
508
- </Flex>
509
- <Text aria-hidden tone="muted">
510
- -
511
- </Text>
512
- <Flex width="4rem" shrink={false}>
513
- <Input id="cmp-ok-tel-city" aria-label="市内局番" defaultValue="6273" />
514
- </Flex>
515
- <Text aria-hidden tone="muted">
516
- -
517
- </Text>
518
- <Flex width="4rem" shrink={false}>
519
- <Input id="cmp-ok-tel-line" aria-label="加入者番号" defaultValue="0001" />
520
- </Flex>
521
- </Flex>
522
- </FormField>
523
- </Form>
524
- </CardContent>
525
- </Card>
526
-
527
- {/* ════════════════════ 2. EVERY FIELD TYPE ════════════════════ */}
528
- <Heading level={2}>2. 全フィールド型 · すべての入力コントロール</Heading>
529
- <Text tone="muted" size="sm">
530
- ライブラリが提供するデータ入力コンポーネントを 1 つずつ FormField
531
- でラップ。ラベル・ヘルパー・必須マークを付与し、aria-* は自動配線される。
532
- </Text>
533
-
534
- <Card>
535
- <CardHeader>
536
- <CardTitle level={2}>
537
- テキスト系 · Input / SearchInput / PasswordInput / Textarea
538
- </CardTitle>
539
- <CardDescription>
540
- 文字列・検索・パスワード・複数行。type=email / inputMode=numeric も Input で表現する。
541
- </CardDescription>
542
- </CardHeader>
543
- <CardContent>
544
- <Form columns={2}>
545
- <FormField id="f-text" label="件名" required helper="最大50文字">
546
- <Input
547
- id="f-text"
548
- value={text}
549
- onChange={(e) => setText(e.target.value)}
550
- placeholder="2026年1月度 請求書"
551
- />
552
- </FormField>
553
- <FormField id="f-email" label="メールアドレス" helper="連絡先として使用します">
554
- <Input id="f-email" type="email" placeholder="taro@example.co.jp" />
555
- </FormField>
556
- <FormField id="f-search" label="取引先を検索">
557
- <SearchInput
558
- id="f-search"
559
- value={search}
560
- onValueChange={setSearch}
561
- onSearch={() => {}}
562
- placeholder="社名・コードで検索…"
563
- />
564
- </FormField>
565
- <FormField id="f-pass" label="パスワード" required helper="8文字以上">
566
- <PasswordInput id="f-pass" placeholder="••••••••" />
567
- </FormField>
568
- <FormField id="f-memo" label="摘要" helper="任意" colSpan={2}>
569
- <Textarea
570
- id="f-memo"
571
- value={memo}
572
- onChange={(e) => setMemo(e.target.value)}
573
- placeholder="例: 4月分から取引開始"
574
- />
575
- </FormField>
576
- </Form>
577
- </CardContent>
578
- </Card>
579
-
580
- <Card>
581
- <CardHeader>
582
- <CardTitle level={2}>Textarea · 固定行数 / 文字数カウンタ / 自動伸長</CardTitle>
583
- <CardDescription>
584
- 複数行欄は 3 種類しかない。行数固定(rows)・上限付きカウンタ(count)・内容に合わせて
585
- 伸びる(autoGrow minRows/maxRows)。カウンタはコードポイント単位で数え、超過を
586
- 報告するだけで値を切らない。IME 変換中に切ると日本語が途中で壊れるため。autoGrow は
587
- CSS で測るので貼り付け・IME 確定・プログラムからの代入でも追従し、maxRows
588
- を超えたらページを押し広げずに内部スクロールする。
589
- </CardDescription>
590
- </CardHeader>
591
- <CardContent>
592
- <Form>
593
- <FormField id="ta-remarks" label="備考" helper="取引条件の申し送り事項">
594
- <Textarea
595
- id="ta-remarks"
596
- rows={3}
597
- value={remarks}
598
- onValueChange={setRemarks}
599
- count={{ max: 200, show: true }}
600
- allowClear
601
- placeholder="例: 初回取引のため与信枠は50万円で開始する。"
602
- />
603
- </FormField>
604
- <FormField
605
- id="ta-thread"
606
- label="社内コメント"
607
- helper="1行から始まり、8行まで伸びてから内部スクロールに切り替わる"
608
- >
609
- <Textarea
610
- id="ta-thread"
611
- autoGrow
612
- minRows={1}
613
- maxRows={8}
614
- value={thread}
615
- onValueChange={setThread}
616
- placeholder="承認者への申し送りを入力…"
617
- />
618
- </FormField>
619
- <FormField id="ta-template" label="請求メール定型文(read-only)">
620
- <Textarea
621
- id="ta-template"
622
- rows={4}
623
- readOnly
624
- defaultValue={
625
- "いつもお世話になっております。\n2026年1月度のご請求書を添付いたします。\nお支払期限は2026年2月28日です。\nご不明点はご返信ください。"
626
- }
627
- />
628
- </FormField>
629
- <FormField id="ta-disabled" label="監査コメント(権限なし · disabled)">
630
- <Textarea id="ta-disabled" rows={2} disabled defaultValue="監査部門のみ編集可能" />
631
- </FormField>
632
- </Form>
633
- </CardContent>
634
- </Card>
635
-
636
- <Card>
637
- <CardHeader>
638
- <CardTitle level={2}>Responsive collapse contract · every breakpoint</CardTitle>
639
- <CardDescription>
640
- The horizontal form collapse union is rendered at false, sm, md, lg and xl; the
641
- viewport matrix verifies each transition without consumer CSS.
642
- </CardDescription>
643
- </CardHeader>
644
- <CardContent>
645
- <Flex direction="col" gap="md">
646
- {([false, "sm", "md", "lg", "xl"] as const).map((collapseBelow) => (
647
- <Form
648
- key={String(collapseBelow)}
649
- layout="horizontal"
650
- collapseBelow={collapseBelow}
651
- labelWidth="8rem"
652
- controlWidth="18rem"
653
- labelAlign="end"
654
- className="contract-collapse-form"
655
- >
656
- <FormField id={`collapse-${String(collapseBelow)}`} label={String(collapseBelow)}>
657
- <Input defaultValue="Responsive value" />
658
- </FormField>
659
- </Form>
660
- ))}
661
- </Flex>
662
- </CardContent>
663
- </Card>
664
-
665
- <Card>
666
- <CardHeader>
667
- <CardTitle level={2}>asChild · the router owns the form element</CardTitle>
668
- <CardDescription>
669
- Inertia&apos;s <code>&lt;Form action method&gt;</code> and TanStack Form render their
670
- own <code>&lt;form&gt;</code>, and two form elements cannot nest. <code>asChild</code>
671
- keeps the layout context and hands the element back, so a consumer keeps the
672
- router&apos;s submission handling AND the label column instead of hand-rolling one.
673
- </CardDescription>
674
- </CardHeader>
675
- <CardContent>
676
- <Form
677
- asChild
678
- layout="horizontal"
679
- labelWidth="8rem"
680
- controlWidth="18rem"
681
- labelAlign="end"
682
- >
683
- <form className="contract-aschild-form" onSubmit={(event) => event.preventDefault()}>
684
- <FormField id="aschild-name" label="取引先名" required>
685
- <Input id="aschild-name" defaultValue="株式会社ゴドー" />
686
- </FormField>
687
- <FormField id="aschild-code" label="コード" helper="ルータ側が form 要素を持つ">
688
- <Input id="aschild-code" defaultValue="BTY-0012" />
689
- </FormField>
690
- </form>
691
- </Form>
692
- </CardContent>
693
- </Card>
694
-
695
- <Card>
696
- <CardHeader>
697
- <CardTitle level={2}>Density · compact / default / comfortable</CardTitle>
698
- <CardDescription>
699
- density はフォーム全体の縦方向リズムを変更する。入力サイズやラベル関係は変えない。
700
- </CardDescription>
701
- </CardHeader>
702
- <CardContent>
703
- <Flex direction="col" gap="lg">
704
- {(["compact", "default", "comfortable"] as const).map((density) => (
705
- <Form key={density} density={density} columns={2}>
706
- <FormField id={`density-${density}-name`} label={`${density} · 氏名`}>
707
- <Input id={`density-${density}-name`} defaultValue="山田 太郎" />
708
- </FormField>
709
- <FormField id={`density-${density}-email`} label="メール" helper="連絡先">
710
- <Input id={`density-${density}-email`} defaultValue="taro@example.jp" />
711
- </FormField>
712
- </Form>
713
- ))}
714
- </Flex>
715
- </CardContent>
716
- </Card>
717
-
718
- <Card>
719
- <CardHeader>
720
- <CardTitle level={2}>選択系 · Select / TreeSelect / Cascader</CardTitle>
721
- <CardDescription>
722
- 単一選択・階層ツリー選択・カスケード選択。いずれも options/treeData
723
- でデータ駆動し、value/onValueChange で制御する。
724
- </CardDescription>
725
- </CardHeader>
726
- <CardContent>
727
- <Form columns={2}>
728
- <FormField id="f-account" label="勘定科目" required>
729
- <Select
730
- id="f-account"
731
- name="account"
732
- value={account}
733
- onValueChange={setAccount}
734
- placeholder="選択してください"
735
- options={[
736
- { value: "cash", label: "現金" },
737
- { value: "sales", label: "売上高" },
738
- { value: "rent", label: "地代家賃" },
739
- ]}
740
- />
741
- </FormField>
742
- <FormField id="f-tree" label="計上先科目">
743
- <TreeSelect
744
- id="f-tree"
745
- treeData={ACCOUNT_TREE}
746
- value={tree}
747
- onValueChange={(v) => setTree(v as string | undefined)}
748
- placeholder="科目ツリーから選択…"
749
- />
750
- </FormField>
751
- <FormField id="f-category" label="経費カテゴリ" colSpan={2}>
752
- <Cascader
753
- id="f-category"
754
- options={EXPENSE_CATEGORIES}
755
- value={category}
756
- onValueChange={(v) => setCategory(v as string[])}
757
- showSearch
758
- placeholder="カテゴリを選択…"
759
- />
760
- </FormField>
761
- </Form>
762
- </CardContent>
763
- </Card>
764
-
765
- <Card>
766
- <CardHeader>
767
- <CardTitle level={2}>
768
- 真偽・選択肢系 · Checkbox / CheckboxGroup / RadioGroup / Switch
769
- </CardTitle>
770
- <CardDescription>
771
- 単一チェック・複数チェック・排他選択・トグル。Checkbox/Switch は Field
772
- でラベルと横並びにする。
773
- </CardDescription>
774
- </CardHeader>
775
- <CardContent>
776
- <Form>
777
- <Flex direction="col" gap="md">
778
- <Field
779
- id="f-terms"
780
- label="利用規約に同意する"
781
- description="同意しないと送信できません"
782
- >
783
- <Checkbox id="f-terms" checked={terms} onCheckedChange={(c) => setTerms(!!c)} />
784
- </Field>
785
- <FormField id="f-channels" label="通知チャネル" helper="複数選択可">
786
- <CheckboxGroup
787
- value={channels}
788
- onValueChange={setChannels}
789
- options={[
790
- { value: "email", label: "メール" },
791
- { value: "slack", label: "Slack" },
792
- { value: "sms", label: "SMS" },
793
- ]}
794
- />
795
- </FormField>
796
- <FormField id="f-rounding" label="端数処理">
797
- <RadioGroup
798
- value={rounding}
799
- onValueChange={setRounding}
800
- orientation="horizontal"
801
- options={[
802
- { value: "round", label: "四捨五入" },
803
- { value: "floor", label: "切り捨て" },
804
- { value: "ceil", label: "切り上げ" },
805
- ]}
806
- />
807
- </FormField>
808
- <Field
809
- id="f-active"
810
- label="取引を有効にする"
811
- description="無効にすると新規取引を登録できません"
812
- >
813
- <Switch id="f-active" checked={active} onCheckedChange={setActive} />
814
- </Field>
815
- </Flex>
816
- </Form>
817
- </CardContent>
818
- </Card>
819
-
820
- <Card>
821
- <CardHeader>
822
- <CardTitle level={2}>数値・範囲系 · Slider / Rating</CardTitle>
823
- <CardDescription>
824
- 連続値スライダーと星評価。value は配列/数値で制御する。
825
- </CardDescription>
826
- </CardHeader>
827
- <CardContent>
828
- <Form>
829
- <Flex direction="col" gap="md">
830
- <FormField id="f-tax" label={`消費税率: ${taxRate[0]}%`} helper="0% / 8% / 10%">
831
- <Slider
832
- id="f-tax"
833
- value={taxRate}
834
- onValueChange={setTaxRate}
835
- min={0}
836
- max={10}
837
- step={2}
838
- name="tax_rate"
839
- aria-label="消費税率"
840
- />
841
- </FormField>
842
- <FormField id="f-score" label="取引先評価">
843
- <Rating
844
- name="vendor_score"
845
- aria-label="取引先評価"
846
- value={score}
847
- onValueChange={setScore}
848
- />
849
- </FormField>
850
- </Flex>
851
- </Form>
852
- </CardContent>
853
- </Card>
854
-
855
- <Card>
856
- <CardHeader>
857
- <CardTitle level={2}>日時系 · DatePicker / DatePicker range / TimePicker</CardTitle>
858
- <CardDescription>
859
- 単一日付・期間・時刻。ISO-8601 / IANA タイムゾーンに準拠し locale
860
- 連動でフォーマットする。
861
- </CardDescription>
862
- </CardHeader>
863
- <CardContent>
864
- <Form columns={2}>
865
- <FormField id="f-issue" label="発行日" required>
866
- <DatePicker
867
- id="f-issue"
868
- name="issue_date"
869
- value={issueDate}
870
- onValueChange={setIssueDate}
871
- />
872
- </FormField>
873
- <FormField id="f-time" label="締め時刻">
874
- <TimePicker
875
- id="f-time"
876
- name="close_time"
877
- value={closeTime}
878
- onValueChange={setCloseTime}
879
- minuteStep={15}
880
- />
881
- </FormField>
882
- {/* 開始/終了 の対 — 終了は開始より前を選べない。`disabledTime` が列と
883
- 入力欄の両方を止めるので、キーボードから規則をすり抜けられない。 */}
884
- <FormField id="f-start" label="開始時刻" required>
885
- <TimePicker
886
- id="f-start"
887
- name="start_time"
888
- value={startTime}
889
- onValueChange={setStartTime}
890
- minuteStep={15}
891
- />
892
- </FormField>
893
- <FormField id="f-end" label="終了時刻" required>
894
- <TimePicker
895
- id="f-end"
896
- name="end_time"
897
- value={endTime}
898
- onValueChange={setEndTime}
899
- minuteStep={15}
900
- disabledTime={() => {
901
- const [startHour, startMinute] = startTime.split(":").map(Number);
902
- return {
903
- disabledHours: () => Array.from({ length: startHour }, (_, hour) => hour),
904
- disabledMinutes: (hour) =>
905
- hour === startHour
906
- ? Array.from({ length: 60 }, (_, minute) => minute).filter(
907
- (minute) => minute <= startMinute,
908
- )
909
- : [],
910
- };
911
- }}
912
- />
913
- </FormField>
914
- <FormField id="f-period" label="会計期間" colSpan={2}>
915
- <DatePicker
916
- range
917
- id="f-period"
918
- name="period"
919
- value={period}
920
- onValueChange={setPeriod}
921
- // 土日は選べない。minDate/maxDate では表せない規則。
922
- disabledDate={(date) => date.getDay() === 0 || date.getDay() === 6}
923
- />
924
- </FormField>
925
- </Form>
926
- </CardContent>
927
- </Card>
928
-
929
- <Card>
930
- <CardHeader>
931
- <CardTitle level={2}>その他 · TagInput / ToggleGroup / InputOTP / Upload</CardTitle>
932
- <CardDescription>
933
- タグ入力・セグメント切替・ワンタイムコード・ファイル添付。すべて FormField
934
- でラベル付けする。
935
- </CardDescription>
936
- </CardHeader>
937
- <CardContent>
938
- <Form>
939
- <Flex direction="col" gap="md">
940
- <FormField id="f-tags" label="ラベル" helper="Enter またはカンマで追加">
941
- <TagInput
942
- value={tags}
943
- onValueChange={setTags}
944
- placeholder="ラベルを追加…"
945
- name="labels"
946
- />
947
- </FormField>
948
- <FormField id="f-period2" label="集計期間">
949
- <ToggleGroup
950
- type="single"
951
- value={period2}
952
- onValueChange={(v) => {
953
- if (v) setPeriod2(v);
954
- }}
955
- >
956
- <ToggleGroupItem value="daily">日次</ToggleGroupItem>
957
- <ToggleGroupItem value="monthly">月次</ToggleGroupItem>
958
- <ToggleGroupItem value="yearly">年次</ToggleGroupItem>
959
- </ToggleGroup>
960
- </FormField>
961
- <FormField id="f-otp" label="認証コード" helper="メールに届いた6桁の数字">
962
- <InputOTP id="f-otp" maxLength={6} value={otp} onChange={setOtp}>
963
- <InputOTPGroup>
964
- <InputOTPSlot index={0} />
965
- <InputOTPSlot index={1} />
966
- <InputOTPSlot index={2} />
967
- <InputOTPSlot index={3} />
968
- <InputOTPSlot index={4} />
969
- <InputOTPSlot index={5} />
970
- </InputOTPGroup>
971
- </InputOTP>
972
- </FormField>
973
- <FormField id="f-files" label="添付ファイル" helper="PDF・Excel(最大5件)">
974
- <Upload
975
- variant="dropzone"
976
- value={files}
977
- onValueChange={setFiles}
978
- accept=".pdf,.xlsx,.csv"
979
- maxCount={5}
980
- onUpload={noopUpload}
981
- />
982
- </FormField>
983
- </Flex>
984
- </Form>
985
- </CardContent>
986
- </Card>
987
-
988
- {/* ════════════════════ 3. EVERY LAYOUT ════════════════════ */}
989
- <Heading level={2}>3. レイアウト · vertical / horizontal / inline / columns / 混在</Heading>
990
-
991
- <Card>
992
- <CardHeader>
993
- <CardTitle level={2}>Vertical(デフォルト)</CardTitle>
994
- <CardDescription>ラベルをコントロールの上に積む。狭いフォームの既定。</CardDescription>
995
- </CardHeader>
996
- <CardContent>
997
- <Form>
998
- <FormField id="l-v-name" label="氏名" required>
999
- <Input id="l-v-name" placeholder="山田 太郎" />
1000
- </FormField>
1001
- <FormField id="l-v-email" label="メールアドレス" helper="連絡先として使用します">
1002
- <Input id="l-v-email" type="email" placeholder="taro@example.co.jp" />
1003
- </FormField>
1004
- </Form>
1005
- </CardContent>
1006
- </Card>
1007
-
1008
- <Card>
1009
- <CardHeader>
1010
- <CardTitle level={2}>Horizontal(labelWidth 120 · md未満で縦に折り返し)</CardTitle>
1011
- <CardDescription>
1012
- ラベルを固定幅120pxの列に置き、コントロールと横並び。768px (md)
1013
- 未満で自動的に縦積みへ。
1014
- </CardDescription>
1015
- </CardHeader>
1016
- <CardContent>
1017
- <Form layout="horizontal" labelWidth={120}>
1018
- <FormField id="l-h-account" label="勘定科目" required>
1019
- <Select
1020
- id="l-h-account"
1021
- name="h_account"
1022
- placeholder="選択してください"
1023
- options={[
1024
- { value: "cash", label: "現金" },
1025
- { value: "sales", label: "売上高" },
1026
- ]}
1027
- />
1028
- </FormField>
1029
- <FormField id="l-h-amount" label="金額" helper="税込">
1030
- <Input id="l-h-amount" inputMode="numeric" placeholder="100000" />
1031
- </FormField>
1032
- {/* Per-field override: keep this one vertical even though the Form is horizontal. */}
1033
- <FormField id="l-h-memo" label="摘要(この行だけ vertical)" layout="vertical">
1034
- <Input id="l-h-memo" />
1035
- </FormField>
1036
- </Form>
1037
- </CardContent>
1038
- </Card>
1039
-
1040
- <Card>
1041
- <CardHeader>
1042
- <CardTitle level={2}>
1043
- Inline · フィルターバー(layout=inline · Flex で横並び)
1044
- </CardTitle>
1045
- <CardDescription>
1046
- 一覧画面上部の絞り込みバー。layout=inline でラベルをコントロールの左に詰め、Flex
1047
- direction=row でフィールドを横一列に並べ、末尾に適用ボタンを置く。
1048
- </CardDescription>
1049
- </CardHeader>
1050
- <CardContent>
1051
- <Form layout="inline">
1052
- <Flex direction="row" gap="md" wrap align="end">
1053
- <FormField id="l-i-keyword" label="キーワード">
1054
- <SearchInput id="l-i-keyword" onSearch={() => {}} placeholder="取引先名…" />
1055
- </FormField>
1056
- <FormField id="l-i-status" label="ステータス">
1057
- <Select
1058
- id="l-i-status"
1059
- name="i_status"
1060
- placeholder="すべて"
1061
- options={[
1062
- { value: "draft", label: "下書き" },
1063
- { value: "paid", label: "入金済" },
1064
- ]}
1065
- />
1066
- </FormField>
1067
- <Button type="button">絞り込む</Button>
1068
- </Flex>
1069
- </Form>
1070
- </CardContent>
1071
- </Card>
1072
-
1073
- <Card>
1074
- <CardHeader>
1075
- <CardTitle level={2}>Columns(columns=2 · 姓+名ペア · 住所は2列span)</CardTitle>
1076
- <CardDescription>
1077
- 複数列グリッド(ResponsiveGrid · 小画面では1列)。広いフィールドは colSpan
1078
- で列をまたぐ。
1079
- </CardDescription>
1080
- </CardHeader>
1081
- <CardContent>
1082
- <Form columns={2}>
1083
- <FormField id="l-c-last" label="姓" required>
1084
- <Input id="l-c-last" placeholder="山田" />
1085
- </FormField>
1086
- <FormField id="l-c-first" label="名" required>
1087
- <Input id="l-c-first" placeholder="太郎" />
1088
- </FormField>
1089
- <FormField id="l-c-address" label="住所" colSpan={2}>
1090
- <Input id="l-c-address" placeholder="東京都千代田区…" />
1091
- </FormField>
1092
- </Form>
1093
- </CardContent>
1094
- </Card>
1095
-
1096
- <Card>
1097
- <CardHeader>
1098
- <CardTitle level={2}>Horizontal · 常時(collapseBelow=false)</CardTitle>
1099
- <CardDescription>
1100
- スマホでもラベル横並びを維持(多用しない)。labelAlign=start で左揃えに。
1101
- </CardDescription>
1102
- </CardHeader>
1103
- <CardContent>
1104
- <Form layout="horizontal" labelWidth="6rem" labelAlign="start" collapseBelow={false}>
1105
- <FormField id="l-a-code" label="コード">
1106
- <Input id="l-a-code" placeholder="BTY-0012" />
1107
- </FormField>
1108
- </Form>
1109
- </CardContent>
1110
- </Card>
1111
-
1112
- <Card>
1113
- <CardHeader>
1114
- <CardTitle level={2}>ラベル長 · 2文字のラベルと3行に折り返すラベルが同じ列に</CardTitle>
1115
- <CardDescription>
1116
- ラベル列の幅は1つしか無いので、「氏名」と「適格請求書発行事業者登録番号…」は必ず
1117
- 同じ列に入る。長い方が折り返したとき、1行の入力欄がラベルの1行目に揃うか、
1118
- ブロックの中央に落ちるかでフォーム全体の読みやすさが決まる。labelAlign は end と start
1119
- の両方を並べて比較できるようにした。
1120
- </CardDescription>
1121
- </CardHeader>
1122
- <CardContent>
1123
- <Flex direction="col" gap="lg">
1124
- <Form layout="horizontal" labelWidth="14rem" labelAlign="end">
1125
- <FormField id="len-e-name" label="氏名" required>
1126
- <Input id="len-e-name" defaultValue="山田 太郎" />
1127
- </FormField>
1128
- <FormField
1129
- id="len-e-invoice"
1130
- label="適格請求書発行事業者 登録番号(インボイス制度・国税庁公表サイトと突合)"
1131
- required
1132
- helper="T + 13桁"
1133
- >
1134
- <Input id="len-e-invoice" defaultValue="T1234567890123" />
1135
- </FormField>
1136
- <FormField id="len-e-note" label="略称">
1137
- <Input id="len-e-note" defaultValue="ゴドー商事" />
1138
- </FormField>
1139
- </Form>
1140
- <Form layout="horizontal" labelWidth="14rem" labelAlign="start">
1141
- <FormField id="len-s-name" label="氏名" required>
1142
- <Input id="len-s-name" defaultValue="山田 太郎" />
1143
- </FormField>
1144
- <FormField
1145
- id="len-s-invoice"
1146
- label="適格請求書発行事業者 登録番号(インボイス制度・国税庁公表サイトと突合)"
1147
- required
1148
- helper="T + 13桁"
1149
- >
1150
- <Input id="len-s-invoice" defaultValue="T1234567890123" />
1151
- </FormField>
1152
- <FormField id="len-s-note" label="略称">
1153
- <Input id="len-s-note" defaultValue="ゴドー商事" />
1154
- </FormField>
1155
- </Form>
1156
- </Flex>
1157
- </CardContent>
1158
- </Card>
1159
-
1160
- <Card>
1161
- <CardHeader>
1162
- <CardTitle level={2}>混在レイアウト · 1つのフォームに horizontal と vertical</CardTitle>
1163
- <CardDescription>
1164
- 実画面はどれか1つでは足りない。短い項目は horizontal
1165
- でラベル列に揃え、複合行と自由記述だけは幅いっぱいの vertical に落とす。layout は Form
1166
- に1度書き、はみ出す行だけ FormField 側で上書きする。ここを className
1167
- で殴ると、密度変更やテナントの再テーマでその行だけ取り残される。
1168
- </CardDescription>
1169
- </CardHeader>
1170
- <CardContent>
1171
- <Form layout="horizontal" labelWidth="9rem">
1172
- <FormField id="mix-code" label="取引先コード" required helper="発番後は変更不可">
1173
- <Input id="mix-code" defaultValue="BTY-0012" />
1174
- </FormField>
1175
- <FormField id="mix-name" label="取引先名" required>
1176
- <Input id="mix-name" defaultValue="株式会社ゴドー商事" />
1177
- </FormField>
1178
- <FormField id="mix-pay" label="支払条件">
1179
- <Select
1180
- id="mix-pay"
1181
- name="payment_terms"
1182
- defaultValue="eom30"
1183
- options={[
1184
- { value: "eom30", label: "月末締め翌月末払い" },
1185
- { value: "eom60", label: "月末締め翌々月末払い" },
1186
- { value: "prepaid", label: "前払い" },
1187
- ]}
1188
- />
1189
- </FormField>
1190
- {/* 複合行: ラベル列に収めると3欄が潰れるので、この行だけ vertical で幅を取る。 */}
1191
- <FormField id="mix-addr" label="請求書送付先" layout="vertical">
1192
- <Flex direction="row" gap="sm" align="center" wrap>
1193
- <Flex width="9rem" shrink={false}>
1194
- <Select
1195
- id="mix-addr-pref"
1196
- aria-label="都道府県"
1197
- defaultValue="JP-13"
1198
- options={PREFECTURES}
1199
- />
1200
- </Flex>
1201
- <Flex width="11rem" shrink={false}>
1202
- <Input id="mix-addr-city" aria-label="市区町村" defaultValue="千代田区丸の内" />
1203
- </Flex>
1204
- <Flex grow>
1205
- <Input id="mix-addr-street" aria-label="番地・建物名" defaultValue="1-9-1" />
1206
- </Flex>
1207
- </Flex>
1208
- </FormField>
1209
- {/* 自由記述も vertical。9rem のラベル列の右に押し込むと1行が短すぎる。 */}
1210
- <FormField
1211
- id="mix-memo"
1212
- label="社内申し送り"
1213
- layout="vertical"
1214
- helper="与信・取引条件の背景を残す"
1215
- >
1216
- <Textarea
1217
- id="mix-memo"
1218
- autoGrow
1219
- minRows={3}
1220
- maxRows={10}
1221
- defaultValue="代表者の交代に伴い、2026年4月から請求先部署が経理部に変更。"
1222
- />
1223
- </FormField>
1224
- <FormField id="mix-owner" label="担当者">
1225
- <Input id="mix-owner" defaultValue="佐藤 花子" />
1226
- </FormField>
1227
- </Form>
1228
- </CardContent>
1229
- </Card>
1230
-
1231
- <Card>
1232
- <CardHeader>
1233
- <CardTitle level={2}>
1234
- 幅 · 狭い項目と広い項目を同じ行に(controlWidth / colSpan)
1235
- </CardTitle>
1236
- <CardDescription>
1237
- 郵便番号の欄が住所と同じ幅で伸びていると、7桁しか入らない欄だと見て分からない。
1238
- controlWidth はラベル行の幅を保ったままコントロールだけを狭める(FormField 自体を
1239
- width で縛ると、ラベルとエラー行まで一緒に縮む)。columns グリッドでは広い項目を
1240
- colSpan で跨がせ、スマホ幅では 1 列に畳んで全ての欄が全幅に戻る。
1241
- </CardDescription>
1242
- </CardHeader>
1243
- <CardContent>
1244
- <Flex direction="col" gap="lg">
1245
- <Form layout="horizontal" labelWidth="9rem">
1246
- <FormField id="w-zip" label="郵便番号" controlWidth="10rem" helper="7桁">
1247
- <Input id="w-zip" inputMode="numeric" defaultValue="1000005" />
1248
- </FormField>
1249
- <FormField id="w-qty" label="数量" controlWidth="7rem">
1250
- <NumberInput id="w-qty" defaultValue={12} min={1} max={999} />
1251
- </FormField>
1252
- <FormField id="w-rate" label="適用税率" controlWidth="7rem">
1253
- <NumberInput id="w-rate" defaultValue={10} min={0} max={100} suffix="%" />
1254
- </FormField>
1255
- <FormField id="w-addr" label="住所">
1256
- <Input id="w-addr" defaultValue="東京都千代田区丸の内1-9-1" />
1257
- </FormField>
1258
- </Form>
1259
- <Form columns={2}>
1260
- <FormField id="w-g-zip" label="郵便番号" controlWidth="10rem">
1261
- <Input id="w-g-zip" inputMode="numeric" defaultValue="1000005" />
1262
- </FormField>
1263
- <FormField id="w-g-pref" label="都道府県" controlWidth="10rem">
1264
- <Select id="w-g-pref" defaultValue="JP-13" options={PREFECTURES} />
1265
- </FormField>
1266
- <FormField id="w-g-addr" label="住所(2列を跨ぐ)" colSpan={2}>
1267
- <Input id="w-g-addr" defaultValue="東京都千代田区丸の内1-9-1 18F" />
1268
- </FormField>
1269
- </Form>
1270
- </Flex>
1271
- </CardContent>
1272
- </Card>
1273
-
1274
- {/* ════════════════════ 4. EVERY STATE ════════════════════ */}
1275
- <Heading level={2}>4. 状態 · pristine / filled / error / disabled / read-only</Heading>
1276
-
1277
- <Card>
1278
- <CardHeader>
1279
- <CardTitle level={2}>必須エラー · ヘルパー · disabled · read-only</CardTitle>
1280
- <CardDescription>
1281
- required は赤いアスタリスク、error (role=alert) はヘルパーを上書きし aria-invalid
1282
- を立てる。 disabled は操作不可、read-only は値を表示するが編集不可。
1283
- </CardDescription>
1284
- </CardHeader>
1285
- <CardContent>
1286
- <Form>
1287
- <FormField id="s-name" label="取引先名" required error="取引先名は必須です">
1288
- <Input id="s-name" placeholder="株式会社…" />
1289
- </FormField>
1290
- <FormField id="s-email" label="メール" error="メールアドレスの形式が正しくありません">
1291
- <Input id="s-email" type="email" defaultValue="invalid@" />
1292
- </FormField>
1293
- <FormField id="s-filled" label="コード" helper="一意のコードを入力">
1294
- <Input id="s-filled" defaultValue="BTY-0012" />
1295
- </FormField>
1296
- <FormField id="s-disabled" label="登録番号(システム発番 · disabled)">
1297
- <Input id="s-disabled" disabled defaultValue="INV-2026-0001" />
1298
- </FormField>
1299
- <FormField id="s-readonly" label="作成日時(read-only)">
1300
- <Input id="s-readonly" readOnly defaultValue="2026-01-15 09:32" />
1301
- </FormField>
1302
- </Form>
1303
- </CardContent>
1304
- </Card>
1305
-
1306
- <Card>
1307
- <CardHeader>
1308
- <CardTitle level={2}>ヘルパーの位置 · 答える前に要る注記は label の下へ</CardTitle>
1309
- <CardDescription>
1310
- 書式や単位の注記は、入力した後に読んでも遅い。helperPlacement="before"
1311
- はラベルと入力欄の間に置くだけで、id も aria-describedby も変わらない。ラベルを
1312
- ReactNode にして2行目を足すと string ラベルの aria フォールバックを失い、labelAddon
1313
- に押し込むとラベル行が2段に膨らむ。どちらも同じ見た目で壊れ方だけが違う。
1314
- </CardDescription>
1315
- </CardHeader>
1316
- <CardContent>
1317
- <Form layout="horizontal" labelWidth="9rem">
1318
- <FormField
1319
- id="hp-before"
1320
- label="振込予定日"
1321
- helper="YYYY/MM/DD · 銀行営業日のみ指定できます"
1322
- helperPlacement="before"
1323
- required
1324
- >
1325
- <Input id="hp-before" defaultValue="2026/02/27" />
1326
- </FormField>
1327
- <FormField
1328
- id="hp-after"
1329
- label="振込手数料"
1330
- helper="当社負担の場合は0を入力"
1331
- controlWidth="9rem"
1332
- >
1333
- <NumberInput id="hp-after" defaultValue={330} min={0} prefix="¥" />
1334
- </FormField>
1335
- </Form>
1336
- </CardContent>
1337
- </Card>
1338
-
1339
- <Card>
1340
- <CardHeader>
1341
- <CardTitle level={2}>staticText · 編集できない値を同じフォームの同じ列に</CardTitle>
1342
- <CardDescription>
1343
- 発番済みのコードや作成者は入力欄ですらない。readOnly の Input
1344
- で見せると「押せば直せそう」に見え、別の Descriptions
1345
- ブロックに逃がすとラベル列の幅と行間を手で合わせ直すことになる。staticText
1346
- は制御要素を持たない FormField で、同じ Form の layout · labelAlign · 行間を
1347
- そのまま引き継ぐ。
1348
- </CardDescription>
1349
- </CardHeader>
1350
- <CardContent>
1351
- <Form layout="horizontal" labelWidth="9rem" requiredMark="optional">
1352
- <FormField id="st-code" label="伝票番号" staticText="INV-2026-0001" />
1353
- <FormField id="st-created" label="作成日時" staticText="2026年1月15日 09:32" />
1354
- <FormField id="st-author" label="作成者" staticText="佐藤 花子(経理部)" />
1355
- <FormField id="st-status" label="ステータス" staticText="承認待ち" />
1356
- <FormField id="st-owner" label="承認者" required>
1357
- <Select
1358
- id="st-owner"
1359
- name="approver"
1360
- placeholder="選択してください"
1361
- options={[
1362
- { value: "tanaka", label: "田中 一郎(経理部長)" },
1363
- { value: "suzuki", label: "鈴木 次郎(管理本部長)" },
1364
- ]}
1365
- />
1366
- </FormField>
1367
- <FormField id="st-memo" label="承認コメント" layout="vertical">
1368
- <Textarea id="st-memo" autoGrow minRows={2} maxRows={6} />
1369
- </FormField>
1370
- </Form>
1371
- </CardContent>
1372
- </Card>
1373
-
1374
- <Card>
1375
- <CardHeader>
1376
- <CardTitle level={2}>フォーム全体の無効化 · 送信中と閲覧権限</CardTitle>
1377
- <CardDescription>
1378
- 送信中や閲覧のみの権限では、フィールドを1つずつ disabled にして回る必要はない。Form の
1379
- disabled が中のコントロール(ネイティブ要素まで)を まとめて止める。requiredMark を
1380
- false にすると全項目必須の申請フォームでアスタリスクの列が消え、"optional"
1381
- にすると逆に任意項目だけに印が付く。
1382
- </CardDescription>
1383
- </CardHeader>
1384
- <CardContent>
1385
- <Flex direction="col" gap="lg">
1386
- <Form layout="horizontal" labelWidth="9rem" disabled>
1387
- <FormField id="dis-name" label="取引先名" required>
1388
- <Input id="dis-name" defaultValue="株式会社ゴドー商事" />
1389
- </FormField>
1390
- <FormField id="dis-pay" label="支払条件" required>
1391
- <Select
1392
- id="dis-pay"
1393
- defaultValue="eom30"
1394
- options={[{ value: "eom30", label: "月末締め翌月末払い" }]}
1395
- />
1396
- </FormField>
1397
- <FormField id="dis-memo" label="社内申し送り" layout="vertical">
1398
- <Textarea id="dis-memo" rows={2} defaultValue="送信中は編集できません。" />
1399
- </FormField>
1400
- </Form>
1401
- <Form layout="horizontal" labelWidth="9rem" requiredMark={false}>
1402
- <FormField id="nm-name" label="申請者" required>
1403
- <Input id="nm-name" defaultValue="山田 太郎" />
1404
- </FormField>
1405
- <FormField id="nm-dept" label="所属部署" required>
1406
- <Input id="nm-dept" defaultValue="営業第一部" />
1407
- </FormField>
1408
- <FormField id="nm-note" label="備考">
1409
- <Input id="nm-note" placeholder="全項目必須のため印を出さない" />
1410
- </FormField>
1411
- </Form>
1412
- </Flex>
1413
- </CardContent>
1414
- </Card>
1415
-
1416
- <Card>
1417
- <CardHeader>
1418
- <CardTitle level={2}>
1419
- サーバーエラーバッグ · Form errors + FormField name + FormErrors
1420
- </CardTitle>
1421
- <CardDescription>
1422
- Form に errors(Inertia の form.errors)を渡すと、name
1423
- を持つフィールドは自分のメッセージをバッグから自動解決してキーを消費(claim)する。
1424
- FormErrors は残り ·
1425
- 隠し・派生フィールド(action_mode、page…)に付いた、どのフィールドにも表示先が無いエラー
1426
- · だけを role=alert のバナーとして表示する。
1427
- </CardDescription>
1428
- </CardHeader>
1429
- <CardContent>
1430
- <Form
1431
- layout="horizontal"
1432
- labelWidth={140}
1433
- errors={{
1434
- customer_nm: "顧客名は必須です",
1435
- action_mode: "操作モードが不正です",
1436
- page: ["ページ番号が不正です", "ページ範囲を超えています"],
1437
- }}
1438
- >
1439
- <FormErrors />
1440
- {/* claimed: このフィールドが customer_nm のメッセージを表示するのでバナーには出ない */}
1441
- <FormField name="customer_nm" label="顧客名" required>
1442
- <Input placeholder="株式会社…" />
1443
- </FormField>
1444
- {/* エラーの無いキー: バッグに tel_no が無いのでこのフィールドは無風 */}
1445
- <FormField name="tel_no" label="電話番号" helper="ハイフンなし">
1446
- <Input inputMode="numeric" placeholder="0312345678" />
1447
- </FormField>
1448
- </Form>
1449
- </CardContent>
1450
- </Card>
1451
-
1452
- <Card>
1453
- <CardHeader>
1454
- <CardTitle level={2}>兄弟 Form の共有バッグ · FormErrorsProvider</CardTitle>
1455
- <CardDescription>
1456
- 編集画面を複数の Card+Form セクションに分けても、サーバーのエラーバッグは 1 つ。 各
1457
- Form に errors を渡す代わりに領域を FormErrorsProvider で包むと、errors を持たない
1458
- Form は外側のレジストリに参加し、全セクションの claim が 1 つの FormErrors
1459
- から差し引かれる。
1460
- </CardDescription>
1461
- </CardHeader>
1462
- <CardContent>
1463
- <FormErrorsProvider
1464
- errors={{
1465
- customer_nm: "顧客名は必須です",
1466
- mail_subject: "件名は必須です",
1467
- source_slip_id: "元伝票が存在しません",
1468
- }}
1469
- >
1470
- <Flex direction="col" gap="md" align="stretch">
1471
- <FormErrors />
1472
- {/* セクション A: errors を渡さない Form — 外側のレジストリに参加する */}
1473
- <Form layout="horizontal" labelWidth={140}>
1474
- <FormField name="customer_nm" label="顧客名" required>
1475
- <Input placeholder="株式会社…" />
1476
- </FormField>
1477
- </Form>
1478
- {/* セクション B: 別の Form でも claim は同じレジストリへ */}
1479
- <Form layout="horizontal" labelWidth={140}>
1480
- <FormField name="mail_subject" label="件名">
1481
- <Input placeholder="ご請求書の送付" />
1482
- </FormField>
1483
- </Form>
1484
- {/* source_slip_id はどのフィールドも claim しないのでバナーに残る */}
1485
- </Flex>
1486
- </FormErrorsProvider>
1487
- </CardContent>
1488
- </Card>
1489
-
1490
- <Flex justify="end">
1491
- <Text tone="muted" size="sm">
1492
- 送信・pending・成功を含む完全な検証フローは Form → examples を参照。
1493
- </Text>
1494
- </Flex>
1495
- </Flex>
1496
- </PageContainer>
1497
- );
1498
- }