@eifi1/ui-kit 0.34.0 → 0.36.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 (446) hide show
  1. package/README.md +115 -41
  2. package/dist/admin/role-select.d.ts +3 -2
  3. package/dist/admin/role-select.js +2 -0
  4. package/dist/admin/role-select.js.map +1 -1
  5. package/dist/billing/billing-banner.d.ts +5 -2
  6. package/dist/billing/billing-banner.js.map +1 -1
  7. package/dist/billing/plan-limit-notice.d.ts +5 -2
  8. package/dist/billing/plan-limit-notice.js.map +1 -1
  9. package/dist/chart.js.map +1 -1
  10. package/dist/components/amount-input.d.ts +2 -5
  11. package/dist/components/amount-input.js +2 -2
  12. package/dist/components/amount-input.js.map +1 -1
  13. package/dist/components/autocomplete.d.ts +2 -2
  14. package/dist/components/autocomplete.js +2 -1
  15. package/dist/components/autocomplete.js.map +1 -1
  16. package/dist/components/button-look.d.ts +1 -1
  17. package/dist/components/button-look.js +9 -4
  18. package/dist/components/button-look.js.map +1 -1
  19. package/dist/components/calculator.d.ts +1 -4
  20. package/dist/components/calculator.js +1 -3
  21. package/dist/components/calculator.js.map +1 -1
  22. package/dist/components/chart-zoom.d.ts +0 -37
  23. package/dist/components/chart-zoom.js +1 -28
  24. package/dist/components/chart-zoom.js.map +1 -1
  25. package/dist/components/checkbox-group.d.ts +5 -2
  26. package/dist/components/checkbox-group.js +15 -4
  27. package/dist/components/checkbox-group.js.map +1 -1
  28. package/dist/components/chip-input.d.ts +0 -4
  29. package/dist/components/chip-input.js +1 -5
  30. package/dist/components/chip-input.js.map +1 -1
  31. package/dist/components/column-mapper.d.ts +5 -3
  32. package/dist/components/column-mapper.js +2 -0
  33. package/dist/components/column-mapper.js.map +1 -1
  34. package/dist/components/combobox.d.ts +3 -3
  35. package/dist/components/combobox.js +2 -1
  36. package/dist/components/combobox.js.map +1 -1
  37. package/dist/components/copy-button.d.ts +5 -1
  38. package/dist/components/copy-button.js.map +1 -1
  39. package/dist/components/country-select.d.ts +3 -3
  40. package/dist/components/country-select.js +3 -0
  41. package/dist/components/country-select.js.map +1 -1
  42. package/dist/components/currency-option-list.d.ts +3 -8
  43. package/dist/components/currency-option-list.js +1 -29
  44. package/dist/components/currency-option-list.js.map +1 -1
  45. package/dist/components/currency-select.d.ts +3 -2
  46. package/dist/components/currency-select.js +10 -1
  47. package/dist/components/currency-select.js.map +1 -1
  48. package/dist/components/danger-confirm.d.ts +3 -3
  49. package/dist/components/danger-confirm.js.map +1 -1
  50. package/dist/components/data-table-filter-popover.d.ts +1 -1
  51. package/dist/components/data-table-filter-popover.js +1 -1
  52. package/dist/components/data-table-filter-popover.js.map +1 -1
  53. package/dist/components/data-table-labels.d.ts +1 -42
  54. package/dist/components/data-table-labels.js +2 -31
  55. package/dist/components/data-table-labels.js.map +1 -1
  56. package/dist/components/data-table-shared.d.ts +17 -1
  57. package/dist/components/data-table-shared.js +22 -0
  58. package/dist/components/data-table-shared.js.map +1 -1
  59. package/dist/components/data-table.d.ts +12 -2
  60. package/dist/components/data-table.js +18 -14
  61. package/dist/components/data-table.js.map +1 -1
  62. package/dist/components/date-field.d.ts +2 -1
  63. package/dist/components/date-field.js.map +1 -1
  64. package/dist/components/date-picker.js +3 -0
  65. package/dist/components/date-picker.js.map +1 -1
  66. package/dist/components/date-range-picker.js +3 -0
  67. package/dist/components/date-range-picker.js.map +1 -1
  68. package/dist/components/dialog-frame.d.ts +3 -1
  69. package/dist/components/dialog-frame.js.map +1 -1
  70. package/dist/components/dropdown.d.ts +18 -15
  71. package/dist/components/dropdown.js +11 -3
  72. package/dist/components/dropdown.js.map +1 -1
  73. package/dist/components/entity-combobox.d.ts +3 -3
  74. package/dist/components/entity-combobox.js +2 -1
  75. package/dist/components/entity-combobox.js.map +1 -1
  76. package/dist/components/field-base.d.ts +0 -5
  77. package/dist/components/field-base.js +0 -5
  78. package/dist/components/field-base.js.map +1 -1
  79. package/dist/components/field-parts.d.ts +69 -22
  80. package/dist/components/field-parts.js +33 -19
  81. package/dist/components/field-parts.js.map +1 -1
  82. package/dist/components/field-strip.d.ts +9 -23
  83. package/dist/components/field-strip.js +26 -23
  84. package/dist/components/field-strip.js.map +1 -1
  85. package/dist/components/field-sync.d.ts +0 -4
  86. package/dist/components/field-sync.js +0 -4
  87. package/dist/components/field-sync.js.map +1 -1
  88. package/dist/components/field.d.ts +7 -6
  89. package/dist/components/field.js +24 -15
  90. package/dist/components/field.js.map +1 -1
  91. package/dist/components/full-bleed-dialog.js +2 -2
  92. package/dist/components/full-bleed-dialog.js.map +1 -1
  93. package/dist/components/help-popover.d.ts +9 -7
  94. package/dist/components/help-popover.js.map +1 -1
  95. package/dist/components/hover-menu.d.ts +6 -13
  96. package/dist/components/hover-menu.js +3 -3
  97. package/dist/components/hover-menu.js.map +1 -1
  98. package/dist/components/icon-picker.d.ts +3 -2
  99. package/dist/components/icon-picker.js +3 -0
  100. package/dist/components/icon-picker.js.map +1 -1
  101. package/dist/components/inline-entity-combobox.d.ts +3 -3
  102. package/dist/components/inline-entity-combobox.js +2 -1
  103. package/dist/components/inline-entity-combobox.js.map +1 -1
  104. package/dist/components/input.d.ts +2 -2
  105. package/dist/components/input.js +2 -1
  106. package/dist/components/input.js.map +1 -1
  107. package/dist/components/modal.d.ts +9 -1
  108. package/dist/components/modal.js +7 -4
  109. package/dist/components/modal.js.map +1 -1
  110. package/dist/components/month-picker.d.ts +2 -1
  111. package/dist/components/month-picker.js +8 -1
  112. package/dist/components/month-picker.js.map +1 -1
  113. package/dist/components/multi-entity-combobox.d.ts +2 -2
  114. package/dist/components/multi-entity-combobox.js +2 -1
  115. package/dist/components/multi-entity-combobox.js.map +1 -1
  116. package/dist/components/multi-select.d.ts +7 -18
  117. package/dist/components/multi-select.js +8 -10
  118. package/dist/components/multi-select.js.map +1 -1
  119. package/dist/components/number-input.d.ts +2 -5
  120. package/dist/components/number-input.js +2 -4
  121. package/dist/components/number-input.js.map +1 -1
  122. package/dist/components/numeric-field.d.ts +5 -2
  123. package/dist/components/numeric-field.js +4 -1
  124. package/dist/components/numeric-field.js.map +1 -1
  125. package/dist/components/one-time-code-input.d.ts +2 -1
  126. package/dist/components/one-time-code-input.js +2 -1
  127. package/dist/components/one-time-code-input.js.map +1 -1
  128. package/dist/components/phone-input.d.ts +1 -1
  129. package/dist/components/phone-input.js +4 -0
  130. package/dist/components/phone-input.js.map +1 -1
  131. package/dist/components/popover.js +3 -3
  132. package/dist/components/popover.js.map +1 -1
  133. package/dist/components/select.d.ts +4 -3
  134. package/dist/components/select.js +2 -1
  135. package/dist/components/select.js.map +1 -1
  136. package/dist/components/series-chart.js.map +1 -1
  137. package/dist/components/server-wake.d.ts +0 -6
  138. package/dist/components/server-wake.js.map +1 -1
  139. package/dist/components/settings-fields.d.ts +4 -2
  140. package/dist/components/settings-fields.js.map +1 -1
  141. package/dist/components/slider.d.ts +3 -2
  142. package/dist/components/slider.js +7 -1
  143. package/dist/components/slider.js.map +1 -1
  144. package/dist/components/stat-tile.d.ts +8 -2
  145. package/dist/components/stat-tile.js +2 -11
  146. package/dist/components/stat-tile.js.map +1 -1
  147. package/dist/components/swatch-picker.d.ts +3 -2
  148. package/dist/components/swatch-picker.js +3 -0
  149. package/dist/components/swatch-picker.js.map +1 -1
  150. package/dist/components/swipeable-row.d.ts +2 -17
  151. package/dist/components/swipeable-row.js +11 -16
  152. package/dist/components/swipeable-row.js.map +1 -1
  153. package/dist/components/text-link.js +3 -1
  154. package/dist/components/text-link.js.map +1 -1
  155. package/dist/components/textarea.d.ts +2 -1
  156. package/dist/components/textarea.js +9 -3
  157. package/dist/components/textarea.js.map +1 -1
  158. package/dist/components/toggle-group.d.ts +2 -2
  159. package/dist/components/toggle-group.js +7 -3
  160. package/dist/components/toggle-group.js.map +1 -1
  161. package/dist/components/tooltip.d.ts +9 -1
  162. package/dist/components/tooltip.js +20 -5
  163. package/dist/components/tooltip.js.map +1 -1
  164. package/dist/components/translation-review.d.ts +10 -2
  165. package/dist/components/translation-review.js +11 -3
  166. package/dist/components/translation-review.js.map +1 -1
  167. package/dist/components/use-table-state.d.ts +31 -3
  168. package/dist/components/use-table-state.js +53 -8
  169. package/dist/components/use-table-state.js.map +1 -1
  170. package/dist/components/user-avatar.d.ts +2 -2
  171. package/dist/components/user-avatar.js.map +1 -1
  172. package/dist/components/wizard-stepper.d.ts +1 -4
  173. package/dist/components/wizard-stepper.js +2 -3
  174. package/dist/components/wizard-stepper.js.map +1 -1
  175. package/dist/currencies.d.ts +23 -0
  176. package/dist/currencies.js +38 -0
  177. package/dist/currencies.js.map +1 -0
  178. package/dist/demo/demo-banner.d.ts +7 -2
  179. package/dist/demo/demo-banner.js.map +1 -1
  180. package/dist/eslint/index.d.ts +83 -0
  181. package/dist/eslint/index.js +69 -0
  182. package/dist/eslint/index.js.map +1 -0
  183. package/dist/eslint/role-utilities.d.ts +48 -0
  184. package/dist/eslint/role-utilities.generated.d.ts +2 -0
  185. package/dist/eslint/role-utilities.generated.js +143 -0
  186. package/dist/eslint/role-utilities.generated.js.map +1 -0
  187. package/dist/eslint/role-utilities.js +43 -0
  188. package/dist/eslint/role-utilities.js.map +1 -0
  189. package/dist/feedback/feedback-menu.d.ts +2 -2
  190. package/dist/feedback/feedback-menu.js.map +1 -1
  191. package/dist/feedback/feedback-thread.d.ts +3 -8
  192. package/dist/feedback/feedback-thread.js +0 -2
  193. package/dist/feedback/feedback-thread.js.map +1 -1
  194. package/dist/hooks/use-dismiss.d.ts +16 -3
  195. package/dist/hooks/use-dismiss.js +14 -2
  196. package/dist/hooks/use-dismiss.js.map +1 -1
  197. package/dist/i18n/defaults.js +5 -1
  198. package/dist/i18n/defaults.js.map +1 -1
  199. package/dist/i18n/german.js +97 -1
  200. package/dist/i18n/german.js.map +1 -1
  201. package/dist/i18n/kit-labels.d.ts +29 -4
  202. package/dist/i18n/kit-labels.js +21 -1
  203. package/dist/i18n/kit-labels.js.map +1 -1
  204. package/dist/i18n/locales/en.js +104 -3
  205. package/dist/i18n/locales/en.js.map +3 -3
  206. package/dist/i18n/locales/es.js +95 -1
  207. package/dist/i18n/locales/es.js.map +1 -1
  208. package/dist/i18n/locales/fr.js +99 -3
  209. package/dist/i18n/locales/fr.js.map +1 -1
  210. package/dist/i18n/locales/hu.js +95 -1
  211. package/dist/i18n/locales/hu.js.map +1 -1
  212. package/dist/i18n/locales/it.js +99 -3
  213. package/dist/i18n/locales/it.js.map +1 -1
  214. package/dist/i18n/locales/zh.js +95 -1
  215. package/dist/i18n/locales/zh.js.map +1 -1
  216. package/dist/i18n/review.js +13 -0
  217. package/dist/i18n/review.js.map +1 -1
  218. package/dist/i18n/shared-labels.js +3 -1
  219. package/dist/i18n/shared-labels.js.map +1 -1
  220. package/dist/index.d.ts +23 -1
  221. package/dist/index.js +40 -2
  222. package/dist/index.js.map +1 -1
  223. package/dist/lib/device-settings.d.ts +72 -0
  224. package/dist/lib/device-settings.js +64 -0
  225. package/dist/lib/device-settings.js.map +1 -0
  226. package/dist/lib/plain-text.d.ts +11 -0
  227. package/dist/lib/plain-text.js +16 -0
  228. package/dist/lib/plain-text.js.map +1 -0
  229. package/dist/lib/refs.d.ts +13 -0
  230. package/dist/lib/refs.js +15 -0
  231. package/dist/lib/refs.js.map +1 -0
  232. package/dist/lib/safe-storage.d.ts +6 -0
  233. package/dist/lib/safe-storage.js +11 -0
  234. package/dist/lib/safe-storage.js.map +1 -1
  235. package/dist/notifications/notification-parts.d.ts +39 -0
  236. package/dist/notifications/notification-parts.js +47 -0
  237. package/dist/notifications/notification-parts.js.map +1 -0
  238. package/dist/notifications/notification-types-setting.d.ts +62 -0
  239. package/dist/notifications/notification-types-setting.js +192 -0
  240. package/dist/notifications/notification-types-setting.js.map +1 -0
  241. package/dist/notifications/notification-types.d.ts +75 -0
  242. package/dist/notifications/notification-types.js +2 -0
  243. package/dist/notifications/notification-types.js.map +1 -0
  244. package/dist/notifications/notifications-labels.d.ts +131 -0
  245. package/dist/notifications/notifications-labels.js +83 -0
  246. package/dist/notifications/notifications-labels.js.map +1 -0
  247. package/dist/notifications/push-device-setting.d.ts +37 -0
  248. package/dist/notifications/push-device-setting.js +164 -0
  249. package/dist/notifications/push-device-setting.js.map +1 -0
  250. package/dist/notifications/push-devices-setting.d.ts +44 -0
  251. package/dist/notifications/push-devices-setting.js +203 -0
  252. package/dist/notifications/push-devices-setting.js.map +1 -0
  253. package/dist/notifications/quiet-hours-setting.d.ts +47 -0
  254. package/dist/notifications/quiet-hours-setting.js +131 -0
  255. package/dist/notifications/quiet-hours-setting.js.map +1 -0
  256. package/dist/notifications/time-zone-select.d.ts +50 -0
  257. package/dist/notifications/time-zone-select.js +76 -0
  258. package/dist/notifications/time-zone-select.js.map +1 -0
  259. package/dist/notifications/unsubscribe-panel.d.ts +53 -0
  260. package/dist/notifications/unsubscribe-panel.js +139 -0
  261. package/dist/notifications/unsubscribe-panel.js.map +1 -0
  262. package/dist/notifications/use-push-device.d.ts +122 -0
  263. package/dist/notifications/use-push-device.js +230 -0
  264. package/dist/notifications/use-push-device.js.map +1 -0
  265. package/dist/rhf/fields.d.ts +36 -29
  266. package/dist/rhf/fields.js +51 -22
  267. package/dist/rhf/fields.js.map +1 -1
  268. package/dist/rhf/form-core.d.ts +5 -4
  269. package/dist/rhf/form-core.js.map +1 -1
  270. package/dist/rhf/form.d.ts +7 -36
  271. package/dist/rhf/form.js +1 -16
  272. package/dist/rhf/form.js.map +1 -1
  273. package/dist/rhf/line-items.d.ts +1 -1
  274. package/dist/rhf/line-items.js.map +1 -1
  275. package/dist/rhf/use-rhf-wizard-step.js.map +1 -1
  276. package/dist/rhf.js.map +1 -1
  277. package/dist/settings/device-reset-setting-labels.d.ts +3 -0
  278. package/dist/settings/device-reset-setting-labels.js +15 -0
  279. package/dist/settings/device-reset-setting-labels.js.map +1 -0
  280. package/dist/settings/device-reset-setting.d.ts +58 -0
  281. package/dist/settings/device-reset-setting.js +51 -0
  282. package/dist/settings/device-reset-setting.js.map +1 -0
  283. package/dist/shell/app-shell.js +5 -0
  284. package/dist/shell/app-shell.js.map +1 -1
  285. package/dist/shell/option-switcher-menu.d.ts +5 -17
  286. package/dist/shell/option-switcher-menu.js +1 -3
  287. package/dist/shell/option-switcher-menu.js.map +1 -1
  288. package/dist/shell/role-switcher.d.ts +1 -4
  289. package/dist/shell/role-switcher.js +2 -3
  290. package/dist/shell/role-switcher.js.map +1 -1
  291. package/dist/shell/topbar-action-menu.d.ts +7 -19
  292. package/dist/shell/topbar-action-menu.js +1 -3
  293. package/dist/shell/topbar-action-menu.js.map +1 -1
  294. package/dist/shell/topbar-controls.d.ts +3 -12
  295. package/dist/shell/topbar-controls.js +6 -9
  296. package/dist/shell/topbar-controls.js.map +1 -1
  297. package/dist/testing/index.d.ts +1 -1
  298. package/dist/testing/index.js +2 -0
  299. package/dist/testing/index.js.map +1 -1
  300. package/dist/testing/viewport.d.ts +25 -2
  301. package/dist/testing/viewport.js +61 -10
  302. package/dist/testing/viewport.js.map +1 -1
  303. package/dist/theme/contrast-tokens.d.ts +42 -4
  304. package/dist/theme/contrast-tokens.js +56 -9
  305. package/dist/theme/contrast-tokens.js.map +1 -1
  306. package/dist/theme/contrast.d.ts +4 -2
  307. package/dist/theme/contrast.js +13 -0
  308. package/dist/theme/contrast.js.map +1 -1
  309. package/dist/theme/palette-derive.d.ts +15 -1
  310. package/dist/theme/palette-derive.js +37 -8
  311. package/dist/theme/palette-derive.js.map +1 -1
  312. package/dist/theme/palette-presets.d.ts +2 -8
  313. package/dist/theme/palette-presets.js +5 -284
  314. package/dist/theme/palette-presets.js.map +1 -1
  315. package/dist/theme/palette-store.js +6 -0
  316. package/dist/theme/palette-store.js.map +1 -1
  317. package/dist/theme/text-size.js +6 -0
  318. package/dist/theme/text-size.js.map +1 -1
  319. package/dist/theme/theme-store.js +6 -0
  320. package/dist/theme/theme-store.js.map +1 -1
  321. package/dist/wizard/types.d.ts +0 -5
  322. package/dist/wizard/types.js +1 -5
  323. package/dist/wizard/types.js.map +1 -1
  324. package/package.json +9 -1
  325. package/src/admin/role-select.tsx +4 -1
  326. package/src/billing/billing-banner.tsx +5 -2
  327. package/src/billing/plan-limit-notice.tsx +5 -2
  328. package/src/chart.ts +5 -3
  329. package/src/components/amount-input.tsx +4 -7
  330. package/src/components/autocomplete.tsx +5 -2
  331. package/src/components/button-look.ts +15 -5
  332. package/src/components/calculator.tsx +2 -7
  333. package/src/components/chart-zoom.tsx +4 -47
  334. package/src/components/checkbox-group.tsx +22 -4
  335. package/src/components/chip-input.tsx +0 -7
  336. package/src/components/column-mapper.tsx +6 -2
  337. package/src/components/combobox.tsx +6 -3
  338. package/src/components/copy-button.tsx +5 -1
  339. package/src/components/country-select.tsx +6 -1
  340. package/src/components/currency-option-list.tsx +8 -42
  341. package/src/components/currency-select.tsx +12 -3
  342. package/src/components/danger-confirm.tsx +3 -3
  343. package/src/components/data-table-filter-popover.tsx +2 -1
  344. package/src/components/data-table-labels.ts +2 -84
  345. package/src/components/data-table-shared.tsx +55 -2
  346. package/src/components/data-table.tsx +29 -17
  347. package/src/components/date-field.tsx +2 -2
  348. package/src/components/date-picker.tsx +3 -0
  349. package/src/components/date-range-picker.tsx +3 -0
  350. package/src/components/dialog-frame.tsx +3 -1
  351. package/src/components/dropdown.tsx +42 -18
  352. package/src/components/entity-combobox.tsx +6 -3
  353. package/src/components/field-base.tsx +0 -11
  354. package/src/components/field-parts.tsx +112 -38
  355. package/src/components/field-strip.tsx +12 -27
  356. package/src/components/field-sync.tsx +0 -7
  357. package/src/components/field.tsx +32 -19
  358. package/src/components/full-bleed-dialog.tsx +4 -3
  359. package/src/components/help-popover.tsx +9 -7
  360. package/src/components/hover-menu.tsx +12 -16
  361. package/src/components/icon-picker.tsx +8 -3
  362. package/src/components/inline-entity-combobox.tsx +6 -3
  363. package/src/components/input.tsx +4 -2
  364. package/src/components/modal.tsx +20 -4
  365. package/src/components/month-picker.tsx +10 -3
  366. package/src/components/multi-entity-combobox.tsx +5 -2
  367. package/src/components/multi-select.tsx +19 -31
  368. package/src/components/number-input.tsx +5 -10
  369. package/src/components/numeric-field.ts +10 -2
  370. package/src/components/one-time-code-input.tsx +5 -3
  371. package/src/components/phone-input.tsx +4 -0
  372. package/src/components/popover.tsx +8 -4
  373. package/src/components/select.tsx +6 -3
  374. package/src/components/series-chart.tsx +1 -1
  375. package/src/components/server-wake.tsx +0 -6
  376. package/src/components/settings-fields.tsx +4 -2
  377. package/src/components/slider.tsx +10 -3
  378. package/src/components/stat-tile.tsx +11 -20
  379. package/src/components/swatch-picker.tsx +9 -4
  380. package/src/components/swipeable-row.tsx +15 -37
  381. package/src/components/text-link.tsx +3 -1
  382. package/src/components/textarea.tsx +11 -4
  383. package/src/components/toggle-group.tsx +21 -5
  384. package/src/components/tooltip.tsx +37 -6
  385. package/src/components/translation-review.tsx +25 -7
  386. package/src/components/use-table-state.ts +91 -10
  387. package/src/components/user-avatar.tsx +2 -2
  388. package/src/components/wizard-stepper.tsx +2 -6
  389. package/src/currencies.ts +70 -0
  390. package/src/demo/demo-banner.tsx +7 -2
  391. package/src/eslint/index.ts +161 -0
  392. package/src/eslint/role-utilities.generated.ts +146 -0
  393. package/src/eslint/role-utilities.ts +99 -0
  394. package/src/feedback/feedback-menu.tsx +2 -2
  395. package/src/feedback/feedback-thread.tsx +3 -8
  396. package/src/hooks/use-dismiss.ts +39 -4
  397. package/src/i18n/defaults.ts +4 -0
  398. package/src/i18n/german.ts +113 -0
  399. package/src/i18n/kit-labels.tsx +66 -6
  400. package/src/i18n/locales/en.ts +6 -0
  401. package/src/i18n/locales/es.ts +106 -0
  402. package/src/i18n/locales/fr.ts +109 -2
  403. package/src/i18n/locales/hu.ts +104 -0
  404. package/src/i18n/locales/it.ts +108 -2
  405. package/src/i18n/locales/zh.ts +96 -0
  406. package/src/i18n/review.ts +13 -0
  407. package/src/i18n/shared-labels.ts +2 -0
  408. package/src/index.ts +53 -1
  409. package/src/lib/device-settings.ts +146 -0
  410. package/src/lib/plain-text.ts +22 -0
  411. package/src/lib/refs.ts +22 -0
  412. package/src/lib/safe-storage.ts +16 -0
  413. package/src/notifications/notification-parts.tsx +83 -0
  414. package/src/notifications/notification-types-setting.tsx +309 -0
  415. package/src/notifications/notification-types.ts +80 -0
  416. package/src/notifications/notifications-labels.ts +238 -0
  417. package/src/notifications/push-device-setting.tsx +224 -0
  418. package/src/notifications/push-devices-setting.tsx +306 -0
  419. package/src/notifications/quiet-hours-setting.tsx +185 -0
  420. package/src/notifications/time-zone-select.tsx +126 -0
  421. package/src/notifications/unsubscribe-panel.tsx +203 -0
  422. package/src/notifications/use-push-device.ts +392 -0
  423. package/src/rhf/fields.tsx +87 -39
  424. package/src/rhf/form-core.tsx +5 -4
  425. package/src/rhf/form.tsx +7 -43
  426. package/src/rhf/line-items.tsx +1 -1
  427. package/src/rhf/use-rhf-wizard-step.ts +4 -4
  428. package/src/rhf.ts +3 -2
  429. package/src/settings/device-reset-setting-labels.ts +20 -0
  430. package/src/settings/device-reset-setting.tsx +119 -0
  431. package/src/shell/app-shell.tsx +8 -0
  432. package/src/shell/option-switcher-menu.tsx +5 -22
  433. package/src/shell/role-switcher.tsx +2 -6
  434. package/src/shell/topbar-action-menu.tsx +7 -24
  435. package/src/shell/topbar-controls.tsx +6 -18
  436. package/src/testing/index.ts +3 -1
  437. package/src/testing/viewport.ts +125 -19
  438. package/src/theme/contrast-tokens.ts +106 -12
  439. package/src/theme/contrast.ts +30 -4
  440. package/src/theme/palette-derive.ts +68 -7
  441. package/src/theme/palette-presets.ts +16 -299
  442. package/src/theme/palette-store.ts +12 -0
  443. package/src/theme/text-size.ts +8 -0
  444. package/src/theme/theme-store.ts +10 -0
  445. package/src/wizard/types.ts +0 -8
  446. package/tokens.css +38 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/rhf/fields.tsx"],"sourcesContent":["/**\n * Bound fields: one line per field of a react-hook-form form. `@eifi1/ui-kit/rhf`.\n *\n * ```tsx\n * <Form {...form}>\n * <RhfTextField name=\"name\" label=\"Name\" hint=\"As on the lease\" required\n * rules={{ required: \"Enter a name\" }} />\n * <RhfMoneyField name=\"rent\" label=\"Net rent\" currency=\"CHF\" />\n * <RhfDateField name=\"start\" label=\"Start\" />\n * <RhfSelect name=\"type\" label=\"Type\" options={TYPES} />\n * <RhfCombobox name=\"tenantId\" label=\"Tenant\" options={tenants} clearable />\n * <RhfInlineEntityCombobox name=\"accountId\" label=\"Account\" options={accounts} />\n * <RhfCheckbox name=\"isDefault\" label=\"Default account\" />\n * <RhfTimeInput name=\"meetingTime\" label=\"Time\" />\n * <RhfDateRangePicker fromName=\"periodFrom\" toName=\"periodTo\" label=\"Period\" />\n * <RhfToggleGroup name=\"interval\" label=\"Interval\" options={INTERVALS} />\n * <RhfCountrySelect name=\"country\" label=\"Country\" preferred={[\"CH\", \"DE\"]} />\n * <RhfMonthPicker name=\"fiscalYear\" label=\"Fiscal year\" mode=\"year\" valueAsNumber />\n * </Form>\n * ```\n *\n * Each folds the `FormField → FormItem → FormLabel → FormControl → field →\n * FormDescription → FormMessage` scaffold (see ./form-core) into one element, the way\n * kastlan's shared/components/form/fields.tsx does for its forms — with what that file\n * left out:\n *\n * - **The red border.** Every field gets `invalid` from the field state, so an errored\n * field PAINTS as well as announces. kastlan's number, money, date and entity fields\n * passed only `aria-invalid` through `FormControl`, or nothing, and `Input`, `Select`\n * and `Textarea` paint only from the prop (see the note in ./form).\n * - **Focus on error.** `field.ref` reaches the focusable element itself — the input,\n * a picker's trigger, a toggle group whose `focus()` lands on its option (since 0.34\n * every kit field takes a ref; the number field and the pickers were reached by an id\n * lookup before, API-3) — so `handleSubmit` and `trigger(…, { shouldFocus })` land the\n * caret on the first field in error, and `setFocus`'s `shouldSelect` selects.\n * - **`control` is optional**: under `<Form {...form}>` the fields find the form\n * through react-hook-form's context. Pass it for the field's value types\n * (`control={form.control}` checks `name` against the form's values).\n *\n * The common props: `name`, `control`, `label` (a {@link FormLabel} above the field;\n * omitted, none — then give the field an `aria-label`), `hint` (standing advice under\n * the field, attached to it with `aria-describedby`), `required` (the label's mark,\n * and `aria-required` where the control takes it — validation is `rules`' or the\n * resolver's), `rules`, `disabled` (the control only — the value is still submitted;\n * `excludeWhenDisabled` for react-hook-form's drop-the-value semantics), and\n * `className` for the item's box.\n *\n * {@link RhfField} is the shell they are all built on, for a control the kit does not\n * ship (an address autocomplete): it takes a `render` and wires the rest.\n */\nimport { useLayoutEffect, useMemo, useRef, type FocusEvent, type ReactElement, type ReactNode } from \"react\";\nimport {\n useController,\n type ControllerFieldState,\n type ControllerProps,\n type ControllerRenderProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from \"./form-core\";\nimport { Input, type InputProps } from \"../components/input\";\nimport { Select, type SelectProps } from \"../components/select\";\nimport { Textarea, type TextareaProps } from \"../components/textarea\";\nimport { NumberField, type NumberFieldProps } from \"../components/number-field\";\nimport { AmountInput } from \"../components/amount-input\";\nimport type { MoneyFieldProps } from \"../components/money-field\";\nimport { useMoneyDraft } from \"../components/money-draft\";\nimport {\n DatePicker,\n DateRangePicker,\n type DatePickerProps,\n type DateRangePickerProps,\n} from \"../components/date-picker\";\nimport { TimeInput, type TimeInputProps } from \"../components/time-input\";\nimport { IbanInput, type IbanInputProps } from \"../components/iban-input\";\nimport { PhoneInput, type PhoneInputProps } from \"../components/phone-input\";\nimport { CountrySelect, type CountrySelectProps } from \"../components/country-select\";\nimport { MonthPicker, type MonthPickerProps } from \"../components/month-picker\";\nimport {\n ToggleGroup,\n type ToggleGroupBaseProps,\n type ToggleGroupClearableProps,\n type ToggleGroupRequiredProps,\n} from \"../components/toggle-group\";\nimport { Checkbox, type CheckboxProps } from \"../components/checkbox\";\nimport { EntityCombobox, type EntityComboboxProps } from \"../components/entity-combobox\";\nimport {\n Combobox,\n InlineEntityCombobox,\n type ComboboxProps,\n type InlineEntityComboboxProps,\n} from \"../components/combobox\";\nimport type { ComboClearValue } from \"../components/combobox-core\";\nimport { mergeRefs, useInlineHint } from \"../components/field-parts\";\nimport { useKitLocale } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { decimalMark, readTyped } from \"../lib/decimal-marks\";\nimport { hasContent } from \"../lib/presence\";\n\n// ── the shell ────────────────────────────────────────────────────────────────\n\n/** What every bound field takes. */\nexport interface RhfFieldBaseProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> {\n name: TName;\n /** `form.control`. Optional under `<Form {...form}>`; pass it to type-check `name`. */\n control?: ControllerProps<TFieldValues, TName, TTransformed>[\"control\"];\n /** react-hook-form's `rules` (`required`, `min`, `validate` …). */\n rules?: ControllerProps<TFieldValues, TName, TTransformed>[\"rules\"];\n /** A {@link FormLabel} above the field. Omitted: no label — name the control with\n * an `aria-label` instead. */\n label?: ReactNode;\n /** Standing advice under the field (\"As printed on the card\"), attached to the\n * control with `aria-describedby`. A `FieldHint` is its words at Large and on a\n * touch screen (§4, DUP-2), not a lone \"?\"; a `HelpPopover` stays a \"?\". */\n hint?: ReactNode;\n /** Draws the label's required mark and sets `aria-required` where the control\n * takes it. Whether the field IS required is `rules`' or the resolver's to say. */\n required?: boolean;\n /** Disables the control and KEEPS the value: a field locked to a preset (a lease's\n * preselected unit, a fixed period) still submits it, and `rules` still run.\n * react-hook-form's own Controller `disabled` drops the value from `handleSubmit`'s\n * data instead, which a locked preset must never do (kastlan, 0.12). To get that,\n * add `excludeWhenDisabled`. A form-wide `useForm({ disabled })` still disables\n * every field the RHF way. */\n disabled?: boolean;\n /** With `disabled`: disable through react-hook-form, so the value is left out of\n * the submitted data and validation skips it, like a disabled native input in a\n * plain form post. Default `false`. */\n excludeWhenDisabled?: boolean;\n /** Classes for the item's box (a `grid gap-1`). */\n className?: string;\n}\n\n/** What {@link RhfField}'s `render` receives. */\nexport interface RhfFieldRenderContext<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n field: ControllerRenderProps<TFieldValues, TName>;\n fieldState: ControllerFieldState;\n /** The field has an error: pass it to the control's `invalid` so it paints. */\n invalid: boolean;\n /** The error's message, if any. */\n error: string | undefined;\n /** The control's id, which the label points at. `FormControl` sets it on the\n * rendered element already; this is for a control that routes it elsewhere. */\n id: string;\n /** The label's id, for a control that is named with `aria-labelledby`. */\n labelId: string;\n /** The ids of the rendered hint and message, if any. */\n describedBy: string | undefined;\n}\n\nexport interface RhfFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> extends RhfFieldBaseProps<TFieldValues, TName, TTransformed> {\n /** The control. Wrapped in {@link FormControl} (its `id`, `aria-describedby` and\n * `aria-invalid`) unless `asControl` is false. */\n render: (ctx: RhfFieldRenderContext<TFieldValues, TName>) => ReactElement;\n /** `false`: render the control as is, for one that wires its own ids from the\n * context. Default `true`. */\n asControl?: boolean;\n /** `false`: no {@link FormMessage}, for a control that renders its own error (its\n * `error` prop). Default `true`. */\n message?: boolean;\n /** `false`: no {@link FormLabel}, for a control that carries its label itself (a\n * checkbox). Default `true`. */\n showLabel?: boolean;\n}\n\n/** The label, with an id the control can be named by. Inside the item, so it can read\n * the item's id. */\nfunction RhfLabel({ required, children }: { required?: boolean; children: ReactNode }) {\n const { id } = useFormField();\n return (\n <FormLabel id={`${id}-label`} required={required}>\n {children}\n </FormLabel>\n );\n}\n\nfunction ControlSlot<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({\n field,\n fieldState,\n render,\n asControl,\n}: {\n field: ControllerRenderProps<TFieldValues, TName>;\n fieldState: ControllerFieldState;\n render: RhfFieldProps<TFieldValues, TName>[\"render\"];\n asControl: boolean;\n}) {\n const { id, formItemId, describedBy } = useFormField();\n const element = render({\n field,\n fieldState,\n invalid: fieldState.invalid,\n error: fieldState.error?.message,\n id: formItemId,\n labelId: `${id}-label`,\n describedBy,\n });\n return asControl ? <FormControl>{element}</FormControl> : element;\n}\n\n/**\n * The shell every bound field is built on: label, control, hint and message around\n * a `render` of your own.\n *\n * ```tsx\n * <RhfField name=\"address\" label=\"Address\" render={({ field, invalid }) => (\n * <AddressAutocomplete value={field.value ?? \"\"} onChange={field.onChange} invalid={invalid} />\n * )} />\n * ```\n */\nexport function RhfField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n render,\n asControl = true,\n message = true,\n showLabel = true,\n}: RhfFieldProps<TFieldValues, TName, TTransformed>) {\n // §4: a FieldHint is a fact, so at Large and on a touch screen it is its words under\n // the field, not a lone \"?\" there (DUP-2, refactor audit 2026-10). A HelpPopover stays\n // a \"?\" at every size.\n const shownHint = useInlineHint(hint);\n return (\n <FormField\n control={control}\n name={name}\n rules={rules}\n disabled={excludeWhenDisabled ? disabled : undefined}\n render={({ field, fieldState }) => (\n <FormItem className={className}>\n {showLabel && hasContent(label) && <RhfLabel required={required}>{label}</RhfLabel>}\n <ControlSlot\n field={disabled && !field.disabled ? { ...field, disabled: true } : field}\n fieldState={fieldState}\n render={render}\n asControl={asControl}\n />\n {hasContent(shownHint) && <FormDescription>{shownHint}</FormDescription>}\n {message && <FormMessage />}\n </FormItem>\n )}\n />\n );\n}\n\n// ── text ─────────────────────────────────────────────────────────────────────\n\ntype OwnInputProps = Omit<\n InputProps,\n \"name\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"label\" | \"error\" | \"invalid\" | \"className\" | \"disabled\" | \"required\" | \"inputClassName\"\n> & {\n /**\n * Classes for the `<input>` — `className` is the item's box (kastlan 42: a\n * `font-mono` IBAN, a `tabular-nums` reference number). {@link RhfTextarea} and\n * {@link RhfNumberField} had it; this one only reached `Input`'s prop of the same\n * name by accident of the rest-spread, undocumented and one refactor from being\n * dropped. Declared, it is part of the contract the three share.\n */\n inputClassName?: string;\n};\n\nexport type RhfTextFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnInputProps;\n\n/** A text {@link Input} — `type` for email, tel, password, url. Stores the string. */\nexport function RhfTextField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...inputProps\n}: RhfTextFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Input\n aria-required={required || undefined}\n {...inputProps}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n )}\n />\n );\n}\n\ntype OwnTextareaProps = Omit<\n TextareaProps,\n \"name\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"label\" | \"error\" | \"invalid\" | \"className\" | \"disabled\" | \"required\"\n> & {\n /** Classes for the `<textarea>`. */\n inputClassName?: string;\n};\n\nexport type RhfTextareaProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextareaProps;\n\n/** A multi-line {@link Textarea}; takes `rows`. Stores the string. */\nexport function RhfTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n ...areaProps\n}: RhfTextareaProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Textarea\n aria-required={required || undefined}\n {...areaProps}\n className={inputClassName}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n )}\n />\n );\n}\n\n// ── numbers ──────────────────────────────────────────────────────────────────\n\n/**\n * A form value → the number field's `number | null`. Defaults hold `\"\"`, `null`, a\n * number, or a numeric string: a plain JS spelling (\"12.5\", \"1e-7\", what an API sends)\n * as it is, anything else the way the field reads typing in `mark` — \"1,234.5\", or\n * \"1.234,56\" in a comma locale (DUP-9, refactor audit 2026-10: a single\n * `replace(\",\", \".\")` read \"1,234,567\" as NaN, the U-14 pattern).\n */\nfunction toNumber(value: unknown, mark: \",\" | \".\"): number | null {\n if (value === null || value === undefined || value === \"\") return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n const text = String(value).trim();\n const plain = text === \"\" ? NaN : Number(text);\n const typed = readTyped(text, mark);\n const n = Number.isFinite(plain) ? plain : typed === \"\" ? NaN : Number(typed);\n return Number.isFinite(n) ? n : null;\n}\n\n/** What a twin sets on its field itself — the value and its change, what the form\n * decides (`disabled`, `invalid`, the error, the ids) and what the shell draws (the\n * label, the hint, the item's `className`). Everything else of the field's passes\n * through (DUP-9, refactor audit 2026-10: a `Pick` allow-list dropped what the field\n * gained without a word). */\ntype BoundByForm = \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"name\" | \"disabled\" | \"required\"\n | \"invalid\" | \"error\" | \"label\" | \"hint\" | \"className\" | \"aria-describedby\" | \"aria-invalid\" | \"aria-required\";\n\nexport type RhfNumberFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // NumberField's own (the lock since 0.33.1, `onValueChange`, …), less the commit and\n // the id the shell owns.\n Omit<NumberFieldProps, BoundByForm | \"onCommit\" | \"nullable\" | \"id\"> & {\n /** What an emptied field stores. Default `null`; `\"\"` for a schema written\n * against a native number input (`z.coerce.number()` over `\"\"`). */\n emptyValue?: null | \"\";\n /** `false`: an emptied field snaps back to its last number instead of storing\n * `emptyValue`. Default `true`. */\n nullable?: boolean;\n };\n\n/**\n * The kit's {@link NumberField}: a parsed, rounded (`digits`) and clamped (`min` /\n * `max`) number, committed on blur or Enter in the locale's decimal mark. Stores a\n * number, or `emptyValue` when emptied.\n */\nexport function RhfNumberField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n emptyValue = null,\n nullable = true,\n ...numberProps\n}: RhfNumberFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which NumberControl hands on to the field.\n <NumberControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n required={required}\n id={id}\n emptyValue={emptyValue}\n nullable={nullable}\n numberProps={numberProps}\n />\n )}\n />\n );\n}\n\nfunction NumberControl({\n field,\n focusRef,\n invalid,\n required,\n id,\n emptyValue,\n nullable,\n numberProps,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n required?: boolean;\n id: string;\n emptyValue: null | \"\";\n nullable: boolean;\n numberProps: Omit<RhfNumberFieldProps, keyof RhfFieldBaseProps | \"emptyValue\" | \"nullable\">;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: NumberFieldProps[\"aria-invalid\"];\n}) {\n // The field's own mark, for a stored text written the way it is typed.\n const mark = decimalMark(useKitLocale(numberProps.locale));\n return (\n <NumberField\n {...numberProps}\n // The <input> itself (API-3, refactor audit 2026-10): focus on error, and\n // `setFocus`'s `shouldSelect`, which an id-found stand-in had no `select()` for.\n ref={focusRef}\n aria-describedby={aria[\"aria-describedby\"]}\n aria-invalid={aria[\"aria-invalid\"]}\n aria-required={required || undefined}\n id={id}\n value={toNumber(field.value, mark)}\n onCommit={(n) => {\n field.onChange(n ?? emptyValue);\n field.onBlur();\n }}\n nullable={nullable}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n}\n\nexport type RhfIntegerFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfNumberFieldProps<TFieldValues, TName, TTransformed>;\n\n/**\n * {@link RhfNumberField} for a whole number — a floor, a room count, a year, a\n * notice period in months. Every such call site in kastlan (item 41) spelled out the\n * same three props, `digits={0} calculator={false} emptyValue=\"\"`, and a preset\n * written thirty times is one that is eventually written wrong once:\n *\n * - `digits={0}`: rounds on commit, so \"2.5\" rooms settles to 3 instead of reaching\n * an `Integer` column and failing server-side;\n * - `calculator={false}`: a count is typed, not worked out — the trigger is noise\n * beside a two-digit field;\n * - `emptyValue=\"\"`: kastlan's integer schemas are `z.coerce.number()` over `\"\"`,\n * written against the native number inputs these fields replaced.\n *\n * Each is only a default: pass the prop to override it (`emptyValue={null}` for a\n * nullable column). Everything else is {@link RhfNumberField}'s.\n */\nexport function RhfIntegerField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>(props: RhfIntegerFieldProps<TFieldValues, TName, TTransformed>) {\n // `??` / `=== undefined` rather than a spread over the defaults, so a caller\n // forwarding its own optional prop (`digits={props.digits}`) still gets the preset,\n // while an explicit `emptyValue={null}` keeps its null.\n return (\n <RhfNumberField\n {...props}\n digits={props.digits ?? 0}\n calculator={props.calculator ?? false}\n emptyValue={props.emptyValue === undefined ? \"\" : props.emptyValue}\n />\n );\n}\n\n// ── money ────────────────────────────────────────────────────────────────────\n\nexport type RhfMoneyFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // MoneyField's — AmountInput's, with the lock, `calculator` (keksdose K6), `labels`,\n // `currencyNames` and `variant` the hand-written list here had dropped (DUP-9) — less\n // what the form binds and the commit, which is the form's store.\n Omit<MoneyFieldProps, BoundByForm | \"onCommit\" | \"id\"> & {\n /**\n * What the form stores: `\"number\"` (default) — `12.5`, or `emptyValue` while the\n * field is empty — or `\"string\"`, the field's own text (\"12.50\") for a schema that\n * parses it itself. A half-typed sum (\"12+\") leaves the stored number as it was\n * until it resolves; a lone \"-\" left on blur goes back to it, as on MoneyField.\n */\n valueAs?: \"number\" | \"string\";\n /** What an emptied field stores when `valueAs` is `\"number\"`. Default `null`. */\n emptyValue?: null | \"\";\n };\n\nfunction MoneyControl({\n field,\n invalid,\n required,\n id,\n describedBy,\n props,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n id: string;\n describedBy: string | undefined;\n props: Omit<RhfMoneyFieldProps, keyof RhfFieldBaseProps>;\n}) {\n const { valueAs = \"number\", emptyValue = null, ...amountProps } = props;\n // MoneyField's draft and settle (DUP-9): the text being typed, re-read from the form\n // only when its value moves away from what the draft says, and a lone \"-\" back on the\n // stored amount when the figure settles.\n const money = useMoneyDraft(field.value, valueAs);\n const input = useRef<HTMLInputElement | null>(null);\n // AmountInput reports no blur, and react-hook-form needs one to mark the field\n // touched: listen on its <input>.\n const onBlur = field.onBlur;\n useLayoutEffect(() => {\n const el = input.current;\n if (!el) return;\n el.addEventListener(\"blur\", onBlur);\n return () => el.removeEventListener(\"blur\", onBlur);\n }, [onBlur]);\n return (\n <div>\n <AmountInput\n {...amountProps}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n ref={(el) => {\n input.current = el;\n field.ref(el);\n }}\n value={money.draft}\n disabled={field.disabled}\n invalid={invalid}\n onChange={(text) => {\n const parsed = money.change(text);\n if (valueAs === \"string\") {\n field.onChange(text);\n return;\n }\n if (parsed === undefined) return;\n field.onChange(parsed ?? emptyValue);\n }}\n onCommit={money.settle}\n />\n </div>\n );\n}\n\n/**\n * The kit's {@link AmountInput}: a money figure with its currency chip and the\n * calculator (\"1200+80\" resolves on blur or Enter). Stores a number by default — see\n * `valueAs`.\n */\nexport function RhfMoneyField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...amountProps\n}: RhfMoneyFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n render={({ field, invalid, id, describedBy }) => (\n <MoneyControl\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n id={id}\n describedBy={describedBy}\n props={amountProps}\n />\n )}\n />\n );\n}\n\n// ── date ─────────────────────────────────────────────────────────────────────\n\nexport type RhfDateFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // `error`: the form's message is shown by the binding (FormMessage); the picker's own\n // `error` (0.22) would show it a second time.\n Omit<DatePickerProps, \"value\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"error\"> & {\n /** Classes for the picker. Default `w-full`. */\n inputClassName?: string;\n /** What a cleared date stores. Default `\"\"`, the empty ISO string; `null` for a\n * nullable schema. */\n emptyValue?: \"\" | null;\n };\n\nfunction DateControl({\n field,\n focusRef,\n invalid,\n required,\n id,\n emptyValue,\n inputClassName,\n pickerProps,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n required?: boolean;\n id: string;\n emptyValue: \"\" | null;\n inputClassName?: string;\n pickerProps: Omit<DatePickerProps, \"value\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\">;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: DatePickerProps[\"aria-invalid\"];\n}) {\n const value: unknown = field.value;\n return (\n <DatePicker\n {...pickerProps}\n {...aria}\n // The trigger itself (API-3, refactor audit 2026-10), not an id lookup.\n ref={focusRef}\n aria-required={required || undefined}\n id={id}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(iso) => {\n field.onChange(iso === \"\" ? emptyValue : iso);\n field.onBlur();\n }}\n disabled={field.disabled}\n invalid={invalid}\n className={inputClassName ?? \"w-full\"}\n />\n );\n}\n\n/** The kit's {@link DatePicker}, holding an ISO `\"YYYY-MM-DD\"` string. */\nexport function RhfDateField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n emptyValue = \"\",\n ...pickerProps\n}: RhfDateFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `aria-describedby` / `aria-invalid`,\n // which DateControl hands on to the picker's trigger.\n <DateControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n required={required}\n id={id}\n emptyValue={emptyValue}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n />\n )}\n />\n );\n}\n\n// ── date range ───────────────────────────────────────────────────────────────\n\ntype OwnDateRangeProps = Omit<\n DateRangePickerProps,\n \"from\" | \"to\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"error\"\n>;\n\nexport type RhfDateRangePickerProps<\n TFieldValues extends FieldValues = FieldValues,\n TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = Omit<RhfFieldBaseProps<TFieldValues, TFromName, TTransformed>, \"name\" | \"rules\"> &\n OwnDateRangeProps & {\n /** The form field holding the range's first day, an ISO `\"YYYY-MM-DD\"`. */\n fromName: TFromName;\n /** The form field holding the range's last day. */\n toName: TToName;\n /** react-hook-form's `rules` for the start (`required`, a `validate` …). */\n fromRules?: ControllerProps<TFieldValues, TFromName, TTransformed>[\"rules\"];\n /** react-hook-form's `rules` for the end — the place for \"not before the start\",\n * which can read the start with `getValues`: the start is always written first. */\n toRules?: ControllerProps<TFieldValues, TToName, TTransformed>[\"rules\"];\n /** Classes for the picker. Default `w-full`. */\n inputClassName?: string;\n /** What an empty end stores — a clear, or the half-made range between the first\n * and second click. Default `\"\"`, the empty ISO string; `null` for a nullable\n * schema. */\n emptyValue?: \"\" | null;\n };\n\n/**\n * The kit's {@link DateRangePicker} over TWO form fields — `fromName` and `toName` —\n * the way a period is stored: as two columns, each its own schema key, not one\n * `{ from, to }` object (kastlan 4).\n *\n * ```tsx\n * <RhfDateRangePicker fromName=\"periodFrom\" toName=\"periodTo\" label=\"Billing period\"\n * presets={presets} clearable />\n * ```\n *\n * Why it is not {@link RhfField}: a `Controller` binds one name, and the range is\n * two. Built by hand — an `RhfField` on the start and a second `useController` for\n * the end, which is what kastlan's period fields needed — it works until the END is\n * the one in error: the shell's label, message and `aria-invalid` all read the\n * start's state alone, so \"End before start\" (a `refine` with `path: [\"periodTo\"]`,\n * where such a rule goes) never shows. Here both states are read:\n *\n * - **Either field's error is shown and paints.** The label turns, the trigger is\n * `aria-invalid` and wears the danger border when EITHER field has an error, and\n * both messages are listed under the field (once, if the two say the same thing),\n * each pointed at by the trigger's `aria-describedby`.\n * - **One change writes both.** The picker reports the range whole, so the start and\n * then the end are written on every change — the end too when only the start\n * moved, so a cross-field rule on the end re-runs and an \"End before start\" clears\n * the moment the start is fixed. A clear (`clearable`'s ×) empties both.\n * - **Focus on error** lands on the trigger whichever of the two is in error.\n * - **Touched** once a range is complete or cleared — not on the first click of a\n * pick, which would mark (and, with `mode: \"onTouched\"`, validate) an end the user\n * is still choosing.\n *\n * In `commit=\"immediate\"` mode (the picker's default) the first calendar click is\n * reported on its own, so the form holds `(from, emptyValue)` until the second; with\n * `commit=\"apply\"` nothing reaches the form until Apply.\n *\n * The common props (`label`, `hint`, `required`, `disabled`, `excludeWhenDisabled`,\n * `control`, `className`) apply to the pair; `rules` are per field.\n */\nexport function RhfDateRangePicker<\n TFieldValues extends FieldValues = FieldValues,\n TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n fromName,\n toName,\n control,\n fromRules,\n toRules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n emptyValue = \"\",\n ...pickerProps\n}: RhfDateRangePickerProps<TFieldValues, TFromName, TToName, TTransformed>) {\n const rhfDisabled = excludeWhenDisabled ? disabled : undefined;\n // The end, read here; the start is the FormField below, which gives the label, hint\n // and ids their context. This component re-renders on the end's state, and with it\n // the FormField's render.\n const to = useController<TFieldValues, TToName, TTransformed>({\n name: toName,\n control,\n rules: toRules,\n disabled: rhfDisabled,\n });\n return (\n <FormField\n control={control}\n name={fromName}\n rules={fromRules}\n disabled={rhfDisabled}\n render={({ field, fieldState }) => (\n <FormItem className={className}>\n <RangeBody\n from={field as unknown as ControllerRenderProps}\n fromState={fieldState}\n to={to.field as unknown as ControllerRenderProps}\n toState={to.fieldState}\n label={label}\n hint={hint}\n required={required}\n disabled={Boolean(disabled)}\n emptyValue={emptyValue}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n />\n </FormItem>\n )}\n />\n );\n}\n\nfunction RangeBody({\n from,\n fromState,\n to,\n toState,\n label,\n hint,\n required,\n disabled,\n emptyValue,\n inputClassName,\n pickerProps,\n}: {\n from: ControllerRenderProps;\n fromState: ControllerFieldState;\n to: ControllerRenderProps;\n toState: ControllerFieldState;\n label: ReactNode;\n hint: ReactNode;\n required?: boolean;\n disabled: boolean;\n emptyValue: \"\" | null;\n inputClassName?: string;\n pickerProps: OwnDateRangeProps;\n}) {\n const { id, formItemId, formMessageId, describedBy } = useFormField();\n // RhfField's rule: a FieldHint is its words at Large and on touch (DUP-2).\n const shownHint = useInlineHint(hint);\n // Both fields' refs go to the one trigger (API-3, refactor audit 2026-10), so\n // `shouldFocusError` lands there whichever of the two is first in error.\n const triggerRef = useMemo(() => mergeRefs(from.ref, to.ref), [from.ref, to.ref]);\n const invalid = fromState.invalid || toState.invalid;\n const messages = [fromState.error?.message, toState.error?.message].filter(\n (m, i, all): m is string => typeof m === \"string\" && m !== \"\" && all.indexOf(m) === i,\n );\n const messageIds = messages.map((_, i) => `${formMessageId}-${i}`);\n const fromValue: unknown = from.value;\n const toValue: unknown = to.value;\n return (\n <>\n {hasContent(label) && (\n // FormLabel colours from the START's error alone (its context is that field);\n // the pair's state says it here.\n <FormLabel id={`${id}-label`} required={required} data-error={invalid || undefined}>\n {label}\n </FormLabel>\n )}\n <DateRangePicker\n {...pickerProps}\n ref={triggerRef}\n id={formItemId}\n // Merged, never replaced — a caller's own reference first, as FormControl does.\n aria-describedby={\n [pickerProps[\"aria-describedby\"], describedBy, ...messageIds].filter(Boolean).join(\" \") || undefined\n }\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n from={typeof fromValue === \"string\" ? fromValue : \"\"}\n to={typeof toValue === \"string\" ? toValue : \"\"}\n onChange={(f, t) => {\n from.onChange(f === \"\" ? emptyValue : f);\n to.onChange(t === \"\" ? emptyValue : t);\n if (t !== \"\" || f === \"\") {\n from.onBlur();\n to.onBlur();\n }\n }}\n disabled={disabled || from.disabled || to.disabled}\n invalid={invalid}\n className={inputClassName ?? \"w-full\"}\n />\n {hasContent(shownHint) && <FormDescription>{shownHint}</FormDescription>}\n {messages.map((message, i) => (\n // FormMessage's look and its rule: no `role=\"alert\"` — read when focus reaches\n // the trigger, which names these in its description.\n <p\n key={message}\n id={messageIds[i]}\n data-slot=\"form-message\"\n className=\"text-caption leading-tight text-danger\"\n >\n {message}\n </p>\n ))}\n </>\n );\n}\n\n// ── time ─────────────────────────────────────────────────────────────────────\n\nexport type RhfTimeInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n Omit<\n TimeInputProps,\n | \"name\"\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onValueChange\"\n | \"onBlur\"\n | \"label\"\n | \"error\"\n | \"invalid\"\n | \"className\"\n | \"disabled\"\n | \"required\"\n > & {\n /** What a cleared time stores. Default `\"\"`; `null` for a nullable schema. */\n emptyValue?: \"\" | null;\n };\n\n/**\n * The kit's {@link TimeInput}: a time of day as `\"HH:mm\"` (`\"HH:mm:ss\"` when `step`\n * asks for seconds), normalised before it reaches the form, so the stored value\n * compares and sorts as a string. kastlan 4: the owner meeting's time was an\n * {@link RhfField} with a hand-wired `TimeInput` in its render — `ref`, `name`, the\n * `?? \"\"`, `onValueChange`, `onBlur`, `invalid` — the seven lines every bound field\n * folds into one.\n *\n * `min` / `max` paint an out-of-window time (see TimeInput) but do not fail the form:\n * validation stays the schema's or `rules`'. `rules={{ validate: (v) =>\n * isTimeInRange(v, min, max) || \"…\" }}` says it with the same window.\n */\nexport function RhfTimeInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n emptyValue = \"\",\n ...timeProps\n}: RhfTimeInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <TimeInput\n aria-required={required || undefined}\n {...timeProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={(v) => field.onChange(v === \"\" ? emptyValue : v)}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\n// ── IBAN and phone (0.22) ────────────────────────────────────────────────────\n\ntype OwnTextishProps<P> = Omit<\n P,\n | \"name\"\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onValueChange\"\n | \"onBlur\"\n | \"label\"\n | \"error\"\n | \"invalid\"\n | \"className\"\n | \"disabled\"\n | \"required\"\n>;\n\nexport type RhfIbanInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextishProps<IbanInputProps>;\n\n/**\n * {@link IbanInput} bound to one field, which stores the COMPACT upper-case IBAN (what\n * kastlan's server checks and its QR bill prints). The field's own checksum and\n * `kind` messages show while the form has nothing to say; a form error (the schema's\n * or `rules`') replaces them, as a caller's `error` does on the bare field. kastlan\n * asked for the field; it binds everything through react-hook-form.\n */\nexport function RhfIbanInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...ibanProps\n}: RhfIbanInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <IbanInput\n aria-required={required || undefined}\n {...ibanProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\nexport type RhfPhoneInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextishProps<PhoneInputProps>;\n\n/**\n * {@link PhoneInput} bound to one field, which stores E.164 when the number reads as\n * one and the typed text unchanged otherwise — kastlan's contacts keep their old free\n * text until someone edits it. Validation (required, a pattern for E.164 only) is the\n * schema's or `rules`'.\n */\nexport function RhfPhoneInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...phoneProps\n}: RhfPhoneInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <PhoneInput\n aria-required={required || undefined}\n {...phoneProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\n// ── country and month (0.23) ─────────────────────────────────────────────────\n\ntype OwnCountrySelectProps = Omit<\n CountrySelectProps<boolean>,\n | \"value\"\n | \"onChange\"\n | \"onBlur\"\n | \"label\"\n | \"hint\"\n | \"error\"\n | \"invalid\"\n | \"disabled\"\n | \"className\"\n | \"id\"\n | \"ref\"\n | \"clearable\"\n>;\n\nexport type RhfCountrySelectProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnCountrySelectProps & {\n /** Offer the picker's clear \"×\" (and Delete on the trigger) while a country is\n * chosen. A clear stores `clearValue`. */\n clearable?: boolean;\n /** What a clear stores. Default `null`; `\"\"` for a schema that spells \"no\n * country\" as an empty string (a zod `z.string().max(2)`, kastlan's). The picker\n * reads either back as empty. */\n clearValue?: ComboClearValue;\n /** Classes for the picker — `className` is the item's box. */\n selectClassName?: string;\n };\n\n/**\n * {@link CountrySelect} bound to one field, which stores the ISO 3166-1 alpha-2 code\n * (\"CH\", always upper-case), or `clearValue` once cleared (`clearable`). kastlan asked\n * for it (0.22 adoption): its address form wired a `CountrySelect` through\n * {@link RhfField}'s render, and with no ref on the picker react-hook-form's\n * focus-on-error had nothing to focus — the one field on the form a failed submit\n * could not take you to.\n *\n * Bound the way {@link RhfIbanInput} and {@link RhfPhoneInput} are: `field.ref` reaches\n * the trigger (the picker's `ref`, 0.23), the form's error paints the trigger and is\n * the shell's message under it, the hint is the shell's description — so neither is\n * ever handed to the picker, and its box never changes when one comes or goes. The\n * form's label names the trigger together with the chosen country, and is the phone\n * sheet's title. `commit` and `disabledReason` are the picker's own: a country that\n * saves itself stays focusable under a lock and says why.\n *\n * ```tsx\n * <RhfCountrySelect name=\"country\" label=\"Country\" required\n * preferred={[\"CH\", \"LI\", \"DE\", \"AT\", \"FR\", \"IT\"]} rules={{ required: \"Choose a country\" }} />\n * ```\n */\nexport function RhfCountrySelect<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearable,\n clearValue = null,\n selectClassName,\n labels,\n ...countryProps\n}: RhfCountrySelectProps<TFieldValues, TName, TTransformed>) {\n const labelled = hasContent(label);\n // A string label is also what the field IS — the picker's `country` word, which\n // titles the phone sheet. A caller's own `labels.country` still wins.\n const ownLabels = typeof label === \"string\" ? { country: label, ...labels } : labels;\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, labelId }) => {\n const value: unknown = field.value;\n return (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which the picker routes to its trigger.\n <CountrySelect<boolean>\n aria-required={required || undefined}\n // The form's label, then the country (see the picker's `aria-labelledby`).\n aria-labelledby={labelled ? labelId : undefined}\n {...countryProps}\n labels={ownLabels}\n className={selectClassName}\n ref={field.ref}\n value={typeof value === \"string\" ? value : null}\n clearable={clearable}\n onChange={(code) => field.onChange(code ?? clearValue)}\n // Focus leaving the picker (the wrapper's focusout) marks the field touched.\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\ntype OwnMonthPickerProps = Omit<\n MonthPickerProps,\n \"value\" | \"onChange\" | \"onBlur\" | \"label\" | \"hint\" | \"error\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"mode\"\n>;\n\n/** `mode` picks what the form stores, and `valueAsNumber` is only offered for a year. */\ntype RhfMonthPickerMode =\n | {\n /** A month, stored as `\"YYYY-MM\"` (the default). */\n mode?: \"month\";\n valueAsNumber?: undefined;\n }\n | {\n /** A year, stored as `\"YYYY\"` — or as a number with `valueAsNumber`. */\n mode: \"year\";\n /** Store the year as a number (`2026`) rather than `\"2026\"` — kastlan's budget\n * `fiscal_year` is an integer column. A number in the form reads back as its\n * year. */\n valueAsNumber?: boolean;\n };\n\nexport type RhfMonthPickerProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnMonthPickerProps & {\n /** Classes for the picker — `className` is the item's box. As {@link RhfDateField}'s. */\n inputClassName?: string;\n } & RhfMonthPickerMode;\n\nfunction MonthControl({\n field,\n focusRef,\n invalid,\n id,\n valueAsNumber,\n mode,\n inputClassName,\n pickerProps,\n required,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n id: string;\n valueAsNumber?: boolean;\n mode?: \"month\" | \"year\";\n inputClassName?: string;\n pickerProps: OwnMonthPickerProps;\n required?: boolean;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: MonthPickerProps[\"aria-invalid\"];\n}) {\n const value: unknown = field.value;\n return (\n <MonthPicker\n {...pickerProps}\n {...aria}\n // The trigger itself (API-3, refactor audit 2026-10) — RhfDateField's way.\n ref={focusRef}\n // MonthPicker routes `aria-required` to its trigger since 0.23.0.\n aria-required={required || undefined}\n id={id}\n mode={mode}\n value={value === null || value === undefined ? \"\" : String(value)}\n onChange={(key) => {\n field.onChange(mode === \"year\" && valueAsNumber ? Number(key) : key);\n // A pick is the whole interaction — there is no text to leave — so it touches.\n field.onBlur();\n }}\n disabled={field.disabled}\n invalid={invalid}\n className={inputClassName}\n />\n );\n}\n\n/**\n * {@link MonthPicker} bound to one field: a month as `\"YYYY-MM\"`, or with `mode=\"year\"` a\n * year as `\"YYYY\"` (`valueAsNumber` stores `2026`). kastlan asked for it with\n * {@link RhfCountrySelect}: its budget wizard's fiscal year was a `MonthPicker\n * mode=\"year\"` inside {@link RhfField}'s render — the `String()` in, the `Number()`\n * out, `invalid` by hand — and a failed submit could not focus it, because the picker\n * forwards no ref.\n *\n * Bound as {@link RhfDateField} is: `field.ref` is the picker's `ref`, its trigger (an id\n * lookup until 0.34, API-3), so focus-on-error lands there; the form's error paints the\n * trigger and is the shell's message; the hint is the shell's description; neither is\n * handed to the picker, so its box never changes. Picking marks the field touched.\n *\n * ```tsx\n * <RhfMonthPicker name=\"fiscalYear\" label=\"Fiscal year\" mode=\"year\" valueAsNumber\n * min=\"2020\" max=\"2029\" rules={{ required: \"Choose a year\" }} />\n * ```\n */\nexport function RhfMonthPicker<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n mode,\n valueAsNumber,\n ...pickerProps\n}: RhfMonthPickerProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `aria-describedby` / `aria-invalid`,\n // which MonthControl hands on to the picker's trigger.\n <MonthControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n id={id}\n mode={mode}\n valueAsNumber={valueAsNumber}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n required={required}\n />\n )}\n />\n );\n}\n\n// ── select ───────────────────────────────────────────────────────────────────\n\nexport interface RhfSelectOption {\n value: string | number;\n label: ReactNode;\n disabled?: boolean;\n}\n\nexport type RhfSelectProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // Select's own — its lock (`commit`, `disabledReason`), `size`, … — which a `Pick`\n // list dropped until 0.34 (DUP-9). One value, so not `multiple`.\n Omit<SelectProps, BoundByForm | \"children\" | \"multiple\" | \"selectClassName\"> & {\n /** The options, as data. Or pass `<option>` children. */\n options?: readonly RhfSelectOption[];\n children?: ReactNode;\n /** A first, empty option (\"Choose…\"), selected while the value is empty. */\n placeholder?: string;\n /** Store `Number(value)` rather than the option's string. An empty choice still\n * stores `\"\"`. */\n valueAsNumber?: boolean;\n /** Classes for the select. Default `w-full`. */\n selectClassName?: string;\n };\n\n/** A native {@link Select}, from `options` or `<option>` children. */\nexport function RhfSelect<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n options,\n children,\n placeholder,\n valueAsNumber,\n selectClassName,\n ...selectProps\n}: RhfSelectProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Select\n aria-required={required || undefined}\n {...selectProps}\n className={cn(\"w-full\", selectClassName)}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string | number}\n onChange={(e) => {\n const raw = e.target.value;\n field.onChange(valueAsNumber && raw !== \"\" ? Number(raw) : raw);\n }}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n >\n {placeholder !== undefined && <option value=\"\">{placeholder}</option>}\n {options\n ? options.map((o) => (\n <option key={String(o.value)} value={o.value} disabled={o.disabled}>\n {o.label}\n </option>\n ))\n : children}\n </Select>\n )}\n />\n );\n}\n\n// ── checkbox ─────────────────────────────────────────────────────────────────\n\nexport type RhfCheckboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // Checkbox's own — its lock (`commit`, `disabledReason`) among them, which a `Pick`\n // list dropped until 0.34 (DUP-9) — less the box's state the form holds, and its\n // `description`, which is the twin's `hint`.\n Omit<CheckboxProps, BoundByForm | \"checked\" | \"defaultChecked\" | \"onCheckedChange\" | \"description\">;\n\n/**\n * The kit's {@link Checkbox}, label beside the box and `hint` under it (the\n * checkbox's own `description`). Stores a boolean. `required` is the native one here\n * — see Checkbox — so a `<form>` refuses to submit it unticked.\n */\nexport function RhfCheckbox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...boxProps\n}: RhfCheckboxProps<TFieldValues, TName, TTransformed>) {\n // RhfField's rule for the box's own description: a FieldHint is its words at Large\n // and on touch (DUP-2).\n const description = useInlineHint(hint);\n return (\n <RhfField\n {...{ name, control, rules, required, disabled, excludeWhenDisabled, className }}\n showLabel={false}\n render={({ field, invalid }) => (\n <Checkbox\n {...boxProps}\n ref={field.ref}\n name={field.name}\n checked={Boolean(field.value)}\n onCheckedChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n required={required}\n invalid={invalid}\n label={label}\n description={description}\n />\n )}\n />\n );\n}\n\n// ── toggle group ─────────────────────────────────────────────────────────────\n\n/** The two shapes a {@link ToggleGroup} comes in, carried over: `allowEmpty` picks\n * whether a press on the chosen option clears it, and types the caption to match. */\ntype RhfToggleGroupMode<T extends string> =\n | {\n /** One option is always the answer (the default): a press on the chosen\n * option re-sends it. */\n allowEmpty?: false;\n semantics?: ToggleGroupRequiredProps<T>[\"semantics\"];\n caption?: ToggleGroupRequiredProps<T>[\"caption\"];\n emptyValue?: undefined;\n }\n | {\n /** A press on the chosen option clears it, and the form stores `emptyValue`. */\n allowEmpty: true;\n semantics?: ToggleGroupClearableProps<T>[\"semantics\"];\n caption?: ToggleGroupClearableProps<T>[\"caption\"];\n /** What a cleared group stores. Default `null`; `\"\"` for a schema that spells\n * \"no choice\" as an empty string. */\n emptyValue?: null | \"\";\n };\n\nexport type RhfToggleGroupProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n T extends string = string,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The group's own (its `disabledReasonDisplay` was not on the `Pick` list this was\n // until 0.34, DUP-9), less what the form binds, the ids, and the label's placement:\n // the label is the form's, above.\n Omit<\n ToggleGroupBaseProps<T>,\n BoundByForm | \"id\" | \"aria-labelledby\" | \"labelPlacement\" | \"chromeClassName\"\n > & {\n /** Classes for the group itself — `className` is the item's box. */\n groupClassName?: string;\n } & RhfToggleGroupMode<T>;\n\n/**\n * The kit's {@link ToggleGroup} bound to one field: a choice between a few answers\n * (\"Monthly / Quarterly / Yearly\"), stored as the chosen option's `value`. kastlan 4\n * asked for it with {@link RhfTimeInput} and {@link RhfDateRangePicker}: the controls\n * its forms still had to wire by hand through {@link RhfField}'s render.\n *\n * The label is the form's {@link FormLabel} above the bare group, as on every other\n * bound field — the `labelPlacement=\"above\"` shape, not the group's own field chrome —\n * and it names the group (`aria-labelledby`); the hint and the message describe it,\n * and an error paints the group's border. Focus on error goes to the option a\n * keyboard user would land on (the chosen one, else the first); touched is set when\n * focus leaves the group, not when it moves between options.\n *\n * Required by default, as the group is: a press on the chosen option keeps it. With\n * `allowEmpty`, a second press clears the choice and the form stores `emptyValue`\n * (`null` by default) — the options then become toggle buttons, see ToggleGroup. A\n * value that matches no option (an empty default) leaves nothing pressed; that the\n * field still needs answering is the schema's or `rules`' to say.\n */\nexport function RhfToggleGroup<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n T extends string = string,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...groupProps\n}: RhfToggleGroupProps<TFieldValues, TName, T, TTransformed>) {\n const labelled = hasContent(label);\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n render={({ field, invalid, id, labelId, describedBy }) => (\n <ToggleControl<T>\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n id={id}\n labelledBy={labelled ? labelId : undefined}\n describedBy={describedBy}\n groupProps={groupProps}\n />\n )}\n />\n );\n}\n\nfunction ToggleControl<T extends string>({\n field,\n invalid,\n required,\n id,\n labelledBy,\n describedBy,\n groupProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n id: string;\n labelledBy: string | undefined;\n describedBy: string | undefined;\n groupProps: Omit<RhfToggleGroupProps<FieldValues, string, T>, keyof RhfFieldBaseProps>;\n}) {\n const { groupClassName, emptyValue, allowEmpty, semantics, caption, ...rest } = groupProps;\n // React's onBlur is focusout: it fires on every move between options as well, and\n // only leaving the group is a blur of the FIELD.\n const onBlur = (e: FocusEvent<HTMLDivElement>) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) field.onBlur();\n };\n const raw: unknown = field.value;\n const value = raw === null || raw === undefined || raw === \"\" ? null : (String(raw) as T);\n const common = {\n ...rest,\n // The group (API-3, refactor audit 2026-10): its `focus()` lands on the radio shape's\n // tab stop, or the pressed shape's pressed option — the rule this adapter carried\n // as an id lookup until ToggleGroup took a ref.\n ref: field.ref,\n id,\n className: groupClassName,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid || undefined,\n disabled: field.disabled,\n onBlur,\n };\n // The props' union pairs `allowEmpty` with its caption's type; taken apart above it no\n // longer narrows, so each branch says which half it is.\n if (allowEmpty) {\n return (\n <ToggleGroup<T>\n {...common}\n allowEmpty\n caption={caption as ToggleGroupClearableProps<T>[\"caption\"]}\n value={value}\n onChange={(v) => field.onChange(v ?? emptyValue ?? null)}\n />\n );\n }\n return (\n <ToggleGroup<T>\n {...common}\n allowEmpty={false}\n semantics={semantics}\n caption={caption as ToggleGroupRequiredProps<T>[\"caption\"]}\n // A radiogroup takes `aria-required`; a group of toggle buttons does not.\n aria-required={required && semantics !== \"pressed\" ? true : undefined}\n // An empty default matches no option: nothing pressed, the first option the tab\n // stop.\n value={(value ?? \"\") as T}\n onChange={(v) => field.onChange(v)}\n />\n );\n}\n\n// ── comboboxes ───────────────────────────────────────────────────────────────\n\nexport type RhfComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The picker's own, as an `Omit` since 0.34 (DUP-9) rather than the `Pick` list it\n // was, less what the form binds and the clear value, which is the twin's below.\n Omit<EntityComboboxProps<V>, BoundByForm | \"id\" | \"clearValue\"> & {\n /** What a clear stores — the picker's `clearValue`. Default `null`; `\"\"` for a\n * schema that spells \"no choice\" as an empty string. */\n clearValue?: ComboClearValue;\n /** Classes for the picker. */\n comboClassName?: string;\n };\n\nfunction EntityControl<V extends string | number>({\n field,\n invalid,\n required,\n error,\n id,\n describedBy,\n clearValue,\n comboClassName,\n sheetTitle,\n focusRef,\n comboProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n error: string | undefined;\n id: string;\n describedBy: string | undefined;\n clearValue: ComboClearValue;\n comboClassName?: string;\n sheetTitle: ReactNode;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n comboProps: Omit<RhfComboboxProps<FieldValues, string, V>, keyof RhfFieldBaseProps | \"clearValue\" | \"comboClassName\">;\n}) {\n const box = useRef<HTMLDivElement>(null);\n // EntityCombobox puts `id` and the ARIA below on its trigger, so the label's\n // `htmlFor` names it and the hint describes it; `field.ref` reaches the trigger\n // through the picker's own `ref` (0.24), as RhfCountrySelect's does.\n // EntityCombobox reports no blur: focus leaving the picker marks the field touched.\n const onBlur = field.onBlur;\n useLayoutEffect(() => {\n const el = box.current;\n if (!el) return;\n el.addEventListener(\"focusout\", onBlur);\n return () => el.removeEventListener(\"focusout\", onBlur);\n }, [onBlur]);\n const value: unknown = field.value;\n return (\n <div ref={box}>\n <EntityCombobox<V, ComboClearValue>\n // The form's label titles the phone sheet: the picker is not handed `label`,\n // which the FormLabel above already draws.\n sheetTitle={sheetTitle}\n {...comboProps}\n ref={focusRef}\n className={comboClassName}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n value={(value ?? null) as V | ComboClearValue | null}\n clearValue={clearValue}\n onChange={(v) => field.onChange(v)}\n disabled={field.disabled}\n invalid={invalid}\n // Its own message, which it merges into the trigger's aria-describedby after\n // the hint.\n error={error}\n />\n </div>\n );\n}\n\n/**\n * The kit's {@link EntityCombobox}: an id-keyed pick from `options` or `loadOptions`.\n * Stores the option's `value`, or `clearValue` on a clear (only offered with\n * `clearable`).\n *\n * 0.24: `field.ref` goes through the picker's own `ref` to its trigger (it used to be\n * a focus handle that found the trigger by id — the same element, now by the route\n * every other binding takes); the write lock (`commit`, `disabledReason`), the create\n * row's `createEmptyLabel` / `createCommit`, `closeLabel` and `aria-label` pass\n * through; and the form's label titles the phone sheet, which fell back to the\n * placeholder. For the INLINE picker — a text input, the account field typed into —\n * see {@link RhfInlineEntityCombobox}.\n */\nexport function RhfCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearValue = null,\n comboClassName,\n ...comboProps\n}: RhfComboboxProps<TFieldValues, TName, V, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n message={false}\n render={({ field, invalid, error, id, describedBy }) => (\n <EntityControl<V>\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n error={error}\n id={id}\n describedBy={describedBy}\n clearValue={clearValue}\n comboClassName={comboClassName}\n sheetTitle={hasContent(label) ? label : undefined}\n focusRef={field.ref}\n comboProps={comboProps}\n />\n )}\n />\n );\n}\n\ntype OwnInlineEntityComboboxProps<V extends string | number> = Omit<\n InlineEntityComboboxProps<V, ComboClearValue>,\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onBlur\"\n | \"label\"\n | \"hint\"\n | \"error\"\n | \"invalid\"\n | \"disabled\"\n | \"className\"\n | \"id\"\n | \"ref\"\n | \"clearValue\"\n>;\n\nexport type RhfInlineEntityComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnInlineEntityComboboxProps<V> & {\n /** What a clear stores — emptying the text, or the \"×\" with `clearable`. Default\n * `null`; `\"\"` for a schema that spells \"no choice\" as an empty string. The\n * picker reads either back as empty. */\n clearValue?: ComboClearValue;\n /** Classes for the picker — `className` is the item's box. As {@link RhfCombobox}'s. */\n comboClassName?: string;\n };\n\n/**\n * {@link InlineEntityCombobox} bound to one field, which stores the chosen option's\n * `value` (an id), or `clearValue` once the text is emptied or the \"×\" pressed.\n *\n * kastlan asked for it (0.24): its account picker IS an `InlineEntityCombobox` — the\n * account number is typed straight into the field — and the budget line-item form\n * wired it through {@link RhfField}'s render. The picker took no `ref`, so react-hook-\n * form's focus-on-error had nothing to focus: a line item saved without an account\n * failed its submit and left the caret where it was, the one field on the form a\n * failed submit could not take you to. (The same gap {@link RhfCountrySelect} closed\n * for the address form's country in 0.23.)\n *\n * Bound the way {@link RhfCountrySelect} is: `field.ref` reaches the `<input>` (the\n * picker's `ref`, 0.24), the form's error paints the input and is the shell's message\n * under it, and the hint is the shell's description — so neither is ever handed to the\n * picker, and its box never changes when one comes or goes. The form's label names\n * the input through `<label for>` and titles the phone sheet (`sheetTitle`); the picker\n * draws no floating label of its own. Focus leaving the picker marks the field\n * touched.\n *\n * Everything else is the picker's and passes through: `commit` and `disabledReason`\n * (a picker whose choice saves stays focusable under a lock and says why), `clearable`,\n * `autoFocus`, `aria-label` for an unlabelled cell, and the create row — `onCreate`,\n * `createLabel`, `createEmptyLabel`, `createCommit`. Making the record is the\n * caller's, and so is storing its id once it exists:\n *\n * ```tsx\n * <RhfInlineEntityCombobox<LineItem, \"account_id\", number>\n * name=\"account_id\" label=\"Account\" required options={accounts}\n * rules={{ required: \"Choose an account\" }}\n * onCreate={async (name) => form.setValue(\"account_id\", (await createAccount(name)).id)} />\n * ```\n *\n * For the button-shaped picker with an async `loadOptions`, see {@link RhfCombobox}.\n */\nexport function RhfInlineEntityCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearValue = null,\n comboClassName,\n ...comboProps\n}: RhfInlineEntityComboboxProps<TFieldValues, TName, V, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which the picker routes to its <input>.\n <InlineEntityCombobox<V, ComboClearValue>\n aria-required={required || undefined}\n // The form's label is the phone sheet's heading — the picker is not handed\n // `label`, which the FormLabel above already draws. A caller's own wins.\n sheetTitle={hasContent(label) ? label : undefined}\n {...comboProps}\n className={comboClassName}\n ref={field.ref}\n value={(value ?? null) as V | ComboClearValue | null}\n clearValue={clearValue}\n onChange={(v) => field.onChange(v)}\n // The wrapper's blur, which the <input>'s bubbles to after the picker has\n // judged any loose text — so the value is in before the field is touched.\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\nexport type RhfTextComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The combobox's own, as an `Omit` since 0.34 (DUP-9) rather than the `Pick` list it\n // was, less what the form binds.\n Omit<ComboboxProps, BoundByForm | \"id\"> & {\n /** Classes for the combobox. */\n comboClassName?: string;\n };\n\n/**\n * The kit's free-text {@link Combobox}: type anything, or pick one of `options`.\n * Stores the string.\n */\nexport function RhfTextCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n comboClassName,\n ...comboProps\n}: RhfTextComboboxProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n message={false}\n render={({ field, invalid, error, id, describedBy }) => (\n <TextComboControl\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n error={error}\n id={id}\n describedBy={describedBy}\n className={comboClassName}\n sheetTitle={hasContent(label) ? label : undefined}\n focusRef={field.ref}\n comboProps={comboProps}\n />\n )}\n />\n );\n}\n\nfunction TextComboControl({\n field,\n invalid,\n required,\n error,\n id,\n describedBy,\n className,\n sheetTitle,\n focusRef,\n comboProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n error: string | undefined;\n id: string;\n describedBy: string | undefined;\n className?: string;\n sheetTitle: ReactNode;\n /** `field.ref` — see EntityControl. */\n focusRef: ControllerRenderProps[\"ref\"];\n comboProps: Omit<RhfTextComboboxProps, keyof RhfFieldBaseProps | \"comboClassName\">;\n}) {\n // The combobox routes `id` and its ARIA to its <input>, so the label's `htmlFor`\n // names it and the hint describes it; `field.ref` reaches the <input> through the\n // combobox's own `ref` (0.24). The error is its own `error` prop, which it merges\n // in after the hint.\n const value: unknown = field.value;\n return (\n <Combobox\n // The form's label titles the phone sheet (see EntityControl).\n sheetTitle={sheetTitle}\n {...comboProps}\n ref={focusRef}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n className={className}\n value={typeof value === \"string\" ? value : value == null ? \"\" : String(value)}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n error={error}\n />\n );\n}\n"],"mappings":";AAqLI,SAsvBA,UAtvBA,KAsEI,YAtEJ;AAnIJ,SAAS,iBAAiB,SAAS,cAAkE;AACrG;AAAA,EACE;AAAA,OAMK;AACP,SAAS,aAAa,iBAAiB,WAAW,UAAU,WAAW,aAAa,oBAAoB;AACxG,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,gBAAoC;AAC7C,SAAS,mBAA0C;AACnD,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,iBAAsC;AAC/C,SAAS,iBAAsC;AAC/C,SAAS,kBAAwC;AACjD,SAAS,qBAA8C;AACvD,SAAS,mBAA0C;AACnD;AAAA,EACE;AAAA,OAIK;AACP,SAAS,gBAAoC;AAC7C,SAAS,sBAAgD;AACzD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,WAAW,qBAAqB;AACzC,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,kBAAkB;AAiF3B,SAAS,SAAS,EAAE,UAAU,SAAS,GAAgD;AACrF,QAAM,EAAE,GAAG,IAAI,aAAa;AAC5B,SACE,oBAAC,aAAU,IAAI,GAAG,EAAE,UAAU,UAC3B,UACH;AAEJ;AAEA,SAAS,YAAqF;AAAA,EAC5F;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAKG;AACD,QAAM,EAAE,IAAI,YAAY,YAAY,IAAI,aAAa;AACrD,QAAM,UAAU,OAAO;AAAA,IACrB;AAAA,IACA;AAAA,IACA,SAAS,WAAW;AAAA,IACpB,OAAO,WAAW,OAAO;AAAA,IACz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EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAYG;AAKD,QAAM,QAAiB,MAAM;AAC7B,SACE;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACC,GAAG;AAAA,MACJ,KAAK;AAAA,MACL;AAAA,MACA,oBAAkB;AAAA,MAClB,iBAAe,YAAY;AAAA,MAC3B;AAAA,MACA,OAAO,OAAO,UAAU,WAAW,QAAQ,SAAS,OAAO,KAAK,OAAO,KAAK;AAAA,MAC5E,UAAU,MAAM;AAAA,MAChB,QAAQ,MAAM;AAAA,MACd,UAAU,MAAM;AAAA,MAChB;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../src/rhf/fields.tsx"],"sourcesContent":["/**\n * Bound fields: one line per field of a react-hook-form form. `@eifi1/ui-kit/rhf`.\n *\n * ```tsx\n * <Form {...form}>\n * <RhfTextField name=\"name\" label=\"Name\" hint=\"As on the lease\" required\n * rules={{ required: \"Enter a name\" }} />\n * <RhfMoneyField name=\"rent\" label=\"Net rent\" currency=\"CHF\" />\n * <RhfDateField name=\"start\" label=\"Start\" />\n * <RhfSelect name=\"type\" label=\"Type\" options={TYPES} />\n * <RhfCombobox name=\"tenantId\" label=\"Tenant\" options={tenants} clearable />\n * <RhfInlineEntityCombobox name=\"accountId\" label=\"Account\" options={accounts} />\n * <RhfCheckbox name=\"isDefault\" label=\"Default account\" />\n * <RhfTimeInput name=\"meetingTime\" label=\"Time\" />\n * <RhfDateRangePicker fromName=\"periodFrom\" toName=\"periodTo\" label=\"Period\" />\n * <RhfToggleGroup name=\"interval\" label=\"Interval\" options={INTERVALS} />\n * <RhfCountrySelect name=\"country\" label=\"Country\" preferred={[\"CH\", \"DE\"]} />\n * <RhfMonthPicker name=\"fiscalYear\" label=\"Fiscal year\" mode=\"year\" valueAsNumber />\n * </Form>\n * ```\n *\n * Each folds the `FormField → FormItem → FormLabel → FormControl → field →\n * FormDescription → FormMessage` scaffold (see ./form-core) into one element, the way\n * kastlan's shared/components/form/fields.tsx does for its forms — with what that file\n * left out:\n *\n * - **The red border.** Every field gets `invalid` from the field state, so an errored\n * field PAINTS as well as announces. kastlan's number, money, date and entity fields\n * passed only `aria-invalid` through `FormControl`, or nothing, and `Input`, `Select`\n * and `Textarea` paint only from the prop (see the note in ./form-core).\n * - **Focus on error.** `field.ref` reaches the focusable element itself — the input,\n * a picker's trigger, a toggle group whose `focus()` lands on its option (since 0.34\n * every kit field takes a ref; the number field and the pickers were reached by an id\n * lookup before, API-3) — so `handleSubmit` and `trigger(…, { shouldFocus })` land the\n * caret on the first field in error, and `setFocus`'s `shouldSelect` selects.\n * - **`control` is optional**: under `<Form {...form}>` the fields find the form\n * through react-hook-form's context. Pass it for the field's value types\n * (`control={form.control}` checks `name` against the form's values).\n *\n * The common props: `name`, `control`, `label` (the label above the field;\n * omitted, none — then give the field an `aria-label`), `hint` (standing advice under\n * the field, attached to it with `aria-describedby`), `required` (the label's mark,\n * and `aria-required` where the control takes it — validation is `rules`' or the\n * resolver's), `rules`, `disabled` (the control only — the value is still submitted;\n * `excludeWhenDisabled` for react-hook-form's drop-the-value semantics), and\n * `className` for the item's box.\n *\n * {@link RhfField} is the shell they are all built on, for a control the kit does not\n * ship (an address autocomplete): it takes a `render` and wires the rest.\n */\nimport { useLayoutEffect, useMemo, useRef, type FocusEvent, type ReactElement, type ReactNode } from \"react\";\nimport {\n useController,\n type ControllerFieldState,\n type ControllerProps,\n type ControllerRenderProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\";\nimport { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField } from \"./form-core\";\nimport { Input, type InputProps } from \"../components/input\";\nimport { Select, type SelectProps } from \"../components/select\";\nimport { Textarea, type TextareaProps } from \"../components/textarea\";\nimport { NumberField, type NumberFieldProps } from \"../components/number-field\";\nimport { AmountInput } from \"../components/amount-input\";\nimport type { MoneyFieldProps } from \"../components/money-field\";\nimport { useMoneyDraft } from \"../components/money-draft\";\nimport {\n DatePicker,\n DateRangePicker,\n type DatePickerProps,\n type DateRangePickerProps,\n} from \"../components/date-picker\";\nimport { TimeInput, type TimeInputProps } from \"../components/time-input\";\nimport { IbanInput, type IbanInputProps } from \"../components/iban-input\";\nimport { PhoneInput, type PhoneInputProps } from \"../components/phone-input\";\nimport { CountrySelect, type CountrySelectProps } from \"../components/country-select\";\nimport { MonthPicker, type MonthPickerProps } from \"../components/month-picker\";\nimport {\n ToggleGroup,\n type ToggleGroupBaseProps,\n type ToggleGroupClearableProps,\n type ToggleGroupRequiredProps,\n} from \"../components/toggle-group\";\nimport { Checkbox, type CheckboxProps } from \"../components/checkbox\";\nimport { EntityCombobox, type EntityComboboxProps } from \"../components/entity-combobox\";\nimport {\n Combobox,\n InlineEntityCombobox,\n type ComboboxProps,\n type InlineEntityComboboxProps,\n} from \"../components/combobox\";\nimport type { ComboClearValue } from \"../components/combobox-core\";\nimport { fieldHelpMark, mergeRefs, useInlineHint } from \"../components/field-parts\";\nimport { useKitLocale } from \"../i18n/kit-labels\";\nimport { cn } from \"../lib/cn\";\nimport { decimalMark, readTyped } from \"../lib/decimal-marks\";\nimport { hasContent } from \"../lib/presence\";\n\n// ── the shell ────────────────────────────────────────────────────────────────\n\n/** What every bound field takes. */\nexport interface RhfFieldBaseProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> {\n name: TName;\n /** `form.control`. Optional under `<Form {...form}>`; pass it to type-check `name`. */\n control?: ControllerProps<TFieldValues, TName, TTransformed>[\"control\"];\n /** react-hook-form's `rules` (`required`, `min`, `validate` …). */\n rules?: ControllerProps<TFieldValues, TName, TTransformed>[\"rules\"];\n /** The label above the field. Omitted: no label — name the control with\n * an `aria-label` instead. */\n label?: ReactNode;\n /** Standing advice under the field (\"As printed on the card\"), attached to the\n * control with `aria-describedby`. A `FieldHint` is its words at Large and on a\n * touch screen (§4, DUP-2), not a lone \"?\"; a `HelpPopover` stays a \"?\". Beside a\n * `help` it is that caption at every size. */\n hint?: ReactNode;\n /** Help the field is usable without — why, how to choose — behind the field's one\n * \"?\" after the label: a `HelpPopover` named \"About <label>\" (round 0.36,\n * docs/text-size-harmonization.md §4); pass a `HelpPopover` to name it yourself.\n * `hint` stays the visible fact under the field. */\n help?: ReactNode;\n /** Draws the label's required mark and sets `aria-required` where the control\n * takes it. Whether the field IS required is `rules`' or the resolver's to say. */\n required?: boolean;\n /** Disables the control and KEEPS the value: a field locked to a preset (a lease's\n * preselected unit, a fixed period) still submits it, and `rules` still run.\n * react-hook-form's own Controller `disabled` drops the value from `handleSubmit`'s\n * data instead, which a locked preset must never do (kastlan, 0.12). To get that,\n * add `excludeWhenDisabled`. A form-wide `useForm({ disabled })` still disables\n * every field the RHF way. */\n disabled?: boolean;\n /** With `disabled`: disable through react-hook-form, so the value is left out of\n * the submitted data and validation skips it, like a disabled native input in a\n * plain form post. Default `false`. */\n excludeWhenDisabled?: boolean;\n /** Classes for the item's box (a `grid gap-1`). */\n className?: string;\n}\n\n/** What {@link RhfField}'s `render` receives. */\nexport interface RhfFieldRenderContext<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n field: ControllerRenderProps<TFieldValues, TName>;\n fieldState: ControllerFieldState;\n /** The field has an error: pass it to the control's `invalid` so it paints. */\n invalid: boolean;\n /** The error's message, if any. */\n error: string | undefined;\n /** The control's id, which the label points at. The rendered element has it already\n * (unless `asControl` is false); this is for a control that routes it elsewhere. */\n id: string;\n /** The label's id, for a control that is named with `aria-labelledby`. */\n labelId: string;\n /** The ids of the rendered hint and message, if any. */\n describedBy: string | undefined;\n}\n\nexport interface RhfFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> extends RhfFieldBaseProps<TFieldValues, TName, TTransformed> {\n /** The control. Given the field's `id`, `aria-describedby` and `aria-invalid` unless\n * `asControl` is false. */\n render: (ctx: RhfFieldRenderContext<TFieldValues, TName>) => ReactElement;\n /** `false`: render the control as is, for one that wires its own ids from the\n * context. Default `true`. */\n asControl?: boolean;\n /** `false`: no error message under the field, for a control that renders its own (its\n * `error` prop). Default `true`. */\n message?: boolean;\n /** `false`: no label above the field, for a control that carries its label itself (a\n * checkbox). Default `true`. */\n showLabel?: boolean;\n}\n\n/** The label, with an id the control can be named by. Inside the item, so it can read\n * the item's id. */\nfunction RhfLabel({ required, children }: { required?: boolean; children: ReactNode }) {\n const { id } = useFormField();\n return (\n <FormLabel id={`${id}-label`} required={required}>\n {children}\n </FormLabel>\n );\n}\n\nfunction ControlSlot<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues>>({\n field,\n fieldState,\n render,\n asControl,\n}: {\n field: ControllerRenderProps<TFieldValues, TName>;\n fieldState: ControllerFieldState;\n render: RhfFieldProps<TFieldValues, TName>[\"render\"];\n asControl: boolean;\n}) {\n const { id, formItemId, describedBy } = useFormField();\n const element = render({\n field,\n fieldState,\n invalid: fieldState.invalid,\n error: fieldState.error?.message,\n id: formItemId,\n labelId: `${id}-label`,\n describedBy,\n });\n return asControl ? <FormControl>{element}</FormControl> : element;\n}\n\n/**\n * The shell every bound field is built on: label, control, hint and message around\n * a `render` of your own.\n *\n * ```tsx\n * <RhfField name=\"address\" label=\"Address\" render={({ field, invalid }) => (\n * <AddressAutocomplete value={field.value ?? \"\"} onChange={field.onChange} invalid={invalid} />\n * )} />\n * ```\n */\nexport function RhfField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n render,\n asControl = true,\n message = true,\n showLabel = true,\n}: RhfFieldProps<TFieldValues, TName, TTransformed>) {\n // §4: a FieldHint is a fact, so at Large and on a touch screen it is its words under\n // the field, not a lone \"?\" there (DUP-2, refactor audit 2026-10). A HelpPopover stays\n // a \"?\" at every size. With a `help` (0.36) its \"?\" follows the label and is the\n // field's only one, so a FieldHint is its words at every size.\n const helpMark = fieldHelpMark(help, label);\n const shownHint = useInlineHint(hint, helpMark !== undefined);\n const labelEl = showLabel && hasContent(label) && <RhfLabel required={required}>{label}</RhfLabel>;\n return (\n <FormField\n control={control}\n name={name}\n rules={rules}\n disabled={excludeWhenDisabled ? disabled : undefined}\n render={({ field, fieldState }) => (\n <FormItem className={className}>\n {helpMark === undefined ? (\n labelEl\n ) : (\n <div className=\"flex items-center gap-1\">\n {labelEl}\n <span className=\"flex shrink-0 items-center\">{helpMark}</span>\n </div>\n )}\n <ControlSlot\n field={disabled && !field.disabled ? { ...field, disabled: true } : field}\n fieldState={fieldState}\n render={render}\n asControl={asControl}\n />\n {hasContent(shownHint) && <FormDescription>{shownHint}</FormDescription>}\n {message && <FormMessage />}\n </FormItem>\n )}\n />\n );\n}\n\n// ── text ─────────────────────────────────────────────────────────────────────\n\ntype OwnInputProps = Omit<\n InputProps,\n \"name\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"label\" | \"error\" | \"invalid\" | \"className\" | \"disabled\" | \"required\" | \"inputClassName\"\n> & {\n /**\n * Classes for the `<input>` — `className` is the item's box (kastlan 42: a\n * `font-mono` IBAN, a `tabular-nums` reference number). {@link RhfTextarea} and\n * {@link RhfNumberField} had it; this one only reached `Input`'s prop of the same\n * name by accident of the rest-spread, undocumented and one refactor from being\n * dropped. Declared, it is part of the contract the three share.\n */\n inputClassName?: string;\n};\n\nexport type RhfTextFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnInputProps;\n\n/** A text {@link Input} — `type` for email, tel, password, url. Stores the string. */\nexport function RhfTextField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...inputProps\n}: RhfTextFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Input\n aria-required={required || undefined}\n {...inputProps}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n )}\n />\n );\n}\n\ntype OwnTextareaProps = Omit<\n TextareaProps,\n \"name\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"label\" | \"error\" | \"invalid\" | \"className\" | \"disabled\" | \"required\"\n> & {\n /** Classes for the `<textarea>`. */\n inputClassName?: string;\n};\n\nexport type RhfTextareaProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextareaProps;\n\n/** A multi-line {@link Textarea}; takes `rows`. Stores the string. */\nexport function RhfTextarea<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n ...areaProps\n}: RhfTextareaProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Textarea\n aria-required={required || undefined}\n {...areaProps}\n className={inputClassName}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n )}\n />\n );\n}\n\n// ── numbers ──────────────────────────────────────────────────────────────────\n\n/**\n * A form value → the number field's `number | null`. Defaults hold `\"\"`, `null`, a\n * number, or a numeric string: a plain JS spelling (\"12.5\", \"1e-7\", what an API sends)\n * as it is, anything else the way the field reads typing in `mark` — \"1,234.5\", or\n * \"1.234,56\" in a comma locale (DUP-9, refactor audit 2026-10: a single\n * `replace(\",\", \".\")` read \"1,234,567\" as NaN, the U-14 pattern).\n */\nfunction toNumber(value: unknown, mark: \",\" | \".\"): number | null {\n if (value === null || value === undefined || value === \"\") return null;\n if (typeof value === \"number\") return Number.isFinite(value) ? value : null;\n const text = String(value).trim();\n const plain = text === \"\" ? NaN : Number(text);\n const typed = readTyped(text, mark);\n const n = Number.isFinite(plain) ? plain : typed === \"\" ? NaN : Number(typed);\n return Number.isFinite(n) ? n : null;\n}\n\n/** What a twin sets on its field itself — the value and its change, what the form\n * decides (`disabled`, `invalid`, the error, the ids) and what the shell draws (the\n * label, the hint, the item's `className`). Everything else of the field's passes\n * through (DUP-9, refactor audit 2026-10: a `Pick` allow-list dropped what the field\n * gained without a word). */\ntype BoundByForm = \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"ref\" | \"name\" | \"disabled\" | \"required\"\n | \"invalid\" | \"error\" | \"label\" | \"hint\" | \"className\" | \"aria-describedby\" | \"aria-invalid\" | \"aria-required\";\n\nexport type RhfNumberFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // NumberField's own (the lock since 0.33.1, `onValueChange`, …), less the commit and\n // the id the shell owns.\n Omit<NumberFieldProps, BoundByForm | \"onCommit\" | \"nullable\" | \"id\"> & {\n /** What an emptied field stores. Default `null`; `\"\"` for a schema written\n * against a native number input (`z.coerce.number()` over `\"\"`). */\n emptyValue?: null | \"\";\n /** `false`: an emptied field snaps back to its last number instead of storing\n * `emptyValue`. Default `true`. */\n nullable?: boolean;\n };\n\n/**\n * The kit's {@link NumberField}: a parsed, rounded (`digits`) and clamped (`min` /\n * `max`) number, committed on blur or Enter in the locale's decimal mark. Stores a\n * number, or `emptyValue` when emptied.\n */\nexport function RhfNumberField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n emptyValue = null,\n nullable = true,\n ...numberProps\n}: RhfNumberFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which NumberControl hands on to the field.\n <NumberControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n required={required}\n id={id}\n emptyValue={emptyValue}\n nullable={nullable}\n numberProps={numberProps}\n />\n )}\n />\n );\n}\n\nfunction NumberControl({\n field,\n focusRef,\n invalid,\n required,\n id,\n emptyValue,\n nullable,\n numberProps,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n required?: boolean;\n id: string;\n emptyValue: null | \"\";\n nullable: boolean;\n numberProps: Omit<RhfNumberFieldProps, keyof RhfFieldBaseProps | \"emptyValue\" | \"nullable\">;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: NumberFieldProps[\"aria-invalid\"];\n}) {\n // The field's own mark, for a stored text written the way it is typed.\n const mark = decimalMark(useKitLocale(numberProps.locale));\n return (\n <NumberField\n {...numberProps}\n // The <input> itself (API-3, refactor audit 2026-10): focus on error, and\n // `setFocus`'s `shouldSelect`, which an id-found stand-in had no `select()` for.\n ref={focusRef}\n aria-describedby={aria[\"aria-describedby\"]}\n aria-invalid={aria[\"aria-invalid\"]}\n aria-required={required || undefined}\n id={id}\n value={toNumber(field.value, mark)}\n onCommit={(n) => {\n field.onChange(n ?? emptyValue);\n field.onBlur();\n }}\n nullable={nullable}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n}\n\nexport type RhfIntegerFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfNumberFieldProps<TFieldValues, TName, TTransformed>;\n\n/**\n * {@link RhfNumberField} for a whole number — a floor, a room count, a year, a\n * notice period in months. Every such call site in kastlan (item 41) spelled out the\n * same three props, `digits={0} calculator={false} emptyValue=\"\"`, and a preset\n * written thirty times is one that is eventually written wrong once:\n *\n * - `digits={0}`: rounds on commit, so \"2.5\" rooms settles to 3 instead of reaching\n * an `Integer` column and failing server-side;\n * - `calculator={false}`: a count is typed, not worked out — the trigger is noise\n * beside a two-digit field;\n * - `emptyValue=\"\"`: kastlan's integer schemas are `z.coerce.number()` over `\"\"`,\n * written against the native number inputs these fields replaced.\n *\n * Each is only a default: pass the prop to override it (`emptyValue={null}` for a\n * nullable column). Everything else is {@link RhfNumberField}'s.\n */\nexport function RhfIntegerField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>(props: RhfIntegerFieldProps<TFieldValues, TName, TTransformed>) {\n // `??` / `=== undefined` rather than a spread over the defaults, so a caller\n // forwarding its own optional prop (`digits={props.digits}`) still gets the preset,\n // while an explicit `emptyValue={null}` keeps its null.\n return (\n <RhfNumberField\n {...props}\n digits={props.digits ?? 0}\n calculator={props.calculator ?? false}\n emptyValue={props.emptyValue === undefined ? \"\" : props.emptyValue}\n />\n );\n}\n\n// ── money ────────────────────────────────────────────────────────────────────\n\nexport type RhfMoneyFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // MoneyField's — AmountInput's, with the lock, `calculator` (keksdose K6), `labels`,\n // `currencyNames` and `variant` the hand-written list here had dropped (DUP-9) — less\n // what the form binds and the commit, which is the form's store.\n Omit<MoneyFieldProps, BoundByForm | \"onCommit\" | \"id\"> & {\n /**\n * What the form stores: `\"number\"` (default) — `12.5`, or `emptyValue` while the\n * field is empty — or `\"string\"`, the field's own text (\"12.50\") for a schema that\n * parses it itself. A half-typed sum (\"12+\") leaves the stored number as it was\n * until it resolves; a lone \"-\" left on blur goes back to it, as on MoneyField.\n */\n valueAs?: \"number\" | \"string\";\n /** What an emptied field stores when `valueAs` is `\"number\"`. Default `null`. */\n emptyValue?: null | \"\";\n };\n\nfunction MoneyControl({\n field,\n invalid,\n required,\n id,\n describedBy,\n props,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n id: string;\n describedBy: string | undefined;\n props: Omit<RhfMoneyFieldProps, keyof RhfFieldBaseProps>;\n}) {\n const { valueAs = \"number\", emptyValue = null, ...amountProps } = props;\n // MoneyField's draft and settle (DUP-9): the text being typed, re-read from the form\n // only when its value moves away from what the draft says, and a lone \"-\" back on the\n // stored amount when the figure settles.\n const money = useMoneyDraft(field.value, valueAs);\n const input = useRef<HTMLInputElement | null>(null);\n // AmountInput reports no blur, and react-hook-form needs one to mark the field\n // touched: listen on its <input>.\n const onBlur = field.onBlur;\n useLayoutEffect(() => {\n const el = input.current;\n if (!el) return;\n el.addEventListener(\"blur\", onBlur);\n return () => el.removeEventListener(\"blur\", onBlur);\n }, [onBlur]);\n return (\n <div>\n <AmountInput\n {...amountProps}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n ref={(el) => {\n input.current = el;\n field.ref(el);\n }}\n value={money.draft}\n disabled={field.disabled}\n invalid={invalid}\n onChange={(text) => {\n const parsed = money.change(text);\n if (valueAs === \"string\") {\n field.onChange(text);\n return;\n }\n if (parsed === undefined) return;\n field.onChange(parsed ?? emptyValue);\n }}\n onCommit={money.settle}\n />\n </div>\n );\n}\n\n/**\n * The kit's {@link AmountInput}: a money figure with its currency chip and the\n * calculator (\"1200+80\" resolves on blur or Enter). Stores a number by default — see\n * `valueAs`.\n */\nexport function RhfMoneyField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...amountProps\n}: RhfMoneyFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n render={({ field, invalid, id, describedBy }) => (\n <MoneyControl\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n id={id}\n describedBy={describedBy}\n props={amountProps}\n />\n )}\n />\n );\n}\n\n// ── date ─────────────────────────────────────────────────────────────────────\n\nexport type RhfDateFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // `error`: the form's message is shown by the binding (FormMessage); the picker's own\n // `error` (0.22) would show it a second time.\n Omit<DatePickerProps, \"value\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"error\"> & {\n /** Classes for the picker. Default `w-full`. */\n inputClassName?: string;\n /** What a cleared date stores. Default `\"\"`, the empty ISO string; `null` for a\n * nullable schema. */\n emptyValue?: \"\" | null;\n };\n\nfunction DateControl({\n field,\n focusRef,\n invalid,\n required,\n id,\n emptyValue,\n inputClassName,\n pickerProps,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n required?: boolean;\n id: string;\n emptyValue: \"\" | null;\n inputClassName?: string;\n pickerProps: Omit<DatePickerProps, \"value\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\">;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: DatePickerProps[\"aria-invalid\"];\n}) {\n const value: unknown = field.value;\n return (\n <DatePicker\n {...pickerProps}\n {...aria}\n // The trigger itself (API-3, refactor audit 2026-10), not an id lookup.\n ref={focusRef}\n aria-required={required || undefined}\n id={id}\n value={typeof value === \"string\" ? value : \"\"}\n onChange={(iso) => {\n field.onChange(iso === \"\" ? emptyValue : iso);\n field.onBlur();\n }}\n disabled={field.disabled}\n invalid={invalid}\n className={inputClassName ?? \"w-full\"}\n />\n );\n}\n\n/** The kit's {@link DatePicker}, holding an ISO `\"YYYY-MM-DD\"` string. */\nexport function RhfDateField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n emptyValue = \"\",\n ...pickerProps\n}: RhfDateFieldProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `aria-describedby` / `aria-invalid`,\n // which DateControl hands on to the picker's trigger.\n <DateControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n required={required}\n id={id}\n emptyValue={emptyValue}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n />\n )}\n />\n );\n}\n\n// ── date range ───────────────────────────────────────────────────────────────\n\ntype OwnDateRangeProps = Omit<\n DateRangePickerProps,\n \"from\" | \"to\" | \"onChange\" | \"label\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"error\"\n>;\n\nexport type RhfDateRangePickerProps<\n TFieldValues extends FieldValues = FieldValues,\n TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = Omit<RhfFieldBaseProps<TFieldValues, TFromName, TTransformed>, \"name\" | \"rules\"> &\n OwnDateRangeProps & {\n /** The form field holding the range's first day, an ISO `\"YYYY-MM-DD\"`. */\n fromName: TFromName;\n /** The form field holding the range's last day. */\n toName: TToName;\n /** react-hook-form's `rules` for the start (`required`, a `validate` …). */\n fromRules?: ControllerProps<TFieldValues, TFromName, TTransformed>[\"rules\"];\n /** react-hook-form's `rules` for the end — the place for \"not before the start\",\n * which can read the start with `getValues`: the start is always written first. */\n toRules?: ControllerProps<TFieldValues, TToName, TTransformed>[\"rules\"];\n /** Classes for the picker. Default `w-full`. */\n inputClassName?: string;\n /** What an empty end stores — a clear, or the half-made range between the first\n * and second click. Default `\"\"`, the empty ISO string; `null` for a nullable\n * schema. */\n emptyValue?: \"\" | null;\n };\n\n/**\n * The kit's {@link DateRangePicker} over TWO form fields — `fromName` and `toName` —\n * the way a period is stored: as two columns, each its own schema key, not one\n * `{ from, to }` object (kastlan 4).\n *\n * ```tsx\n * <RhfDateRangePicker fromName=\"periodFrom\" toName=\"periodTo\" label=\"Billing period\"\n * presets={presets} clearable />\n * ```\n *\n * Why it is not {@link RhfField}: a `Controller` binds one name, and the range is\n * two. Built by hand — an `RhfField` on the start and a second `useController` for\n * the end, which is what kastlan's period fields needed — it works until the END is\n * the one in error: the shell's label, message and `aria-invalid` all read the\n * start's state alone, so \"End before start\" (a `refine` with `path: [\"periodTo\"]`,\n * where such a rule goes) never shows. Here both states are read:\n *\n * - **Either field's error is shown and paints.** The label turns, the trigger is\n * `aria-invalid` and wears the danger border when EITHER field has an error, and\n * both messages are listed under the field (once, if the two say the same thing),\n * each pointed at by the trigger's `aria-describedby`.\n * - **One change writes both.** The picker reports the range whole, so the start and\n * then the end are written on every change — the end too when only the start\n * moved, so a cross-field rule on the end re-runs and an \"End before start\" clears\n * the moment the start is fixed. A clear (`clearable`'s ×) empties both.\n * - **Focus on error** lands on the trigger whichever of the two is in error.\n * - **Touched** once a range is complete or cleared — not on the first click of a\n * pick, which would mark (and, with `mode: \"onTouched\"`, validate) an end the user\n * is still choosing.\n *\n * In `commit=\"immediate\"` mode (the picker's default) the first calendar click is\n * reported on its own, so the form holds `(from, emptyValue)` until the second; with\n * `commit=\"apply\"` nothing reaches the form until Apply.\n *\n * The common props (`label`, `hint`, `required`, `disabled`, `excludeWhenDisabled`,\n * `control`, `className`) apply to the pair; `rules` are per field.\n */\nexport function RhfDateRangePicker<\n TFieldValues extends FieldValues = FieldValues,\n TFromName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TToName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n fromName,\n toName,\n control,\n fromRules,\n toRules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n emptyValue = \"\",\n ...pickerProps\n}: RhfDateRangePickerProps<TFieldValues, TFromName, TToName, TTransformed>) {\n const rhfDisabled = excludeWhenDisabled ? disabled : undefined;\n // The end, read here; the start is the FormField below, which gives the label, hint\n // and ids their context. This component re-renders on the end's state, and with it\n // the FormField's render.\n const to = useController<TFieldValues, TToName, TTransformed>({\n name: toName,\n control,\n rules: toRules,\n disabled: rhfDisabled,\n });\n return (\n <FormField\n control={control}\n name={fromName}\n rules={fromRules}\n disabled={rhfDisabled}\n render={({ field, fieldState }) => (\n <FormItem className={className}>\n <RangeBody\n from={field as unknown as ControllerRenderProps}\n fromState={fieldState}\n to={to.field as unknown as ControllerRenderProps}\n toState={to.fieldState}\n label={label}\n hint={hint}\n help={help}\n required={required}\n disabled={Boolean(disabled)}\n emptyValue={emptyValue}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n />\n </FormItem>\n )}\n />\n );\n}\n\nfunction RangeBody({\n from,\n fromState,\n to,\n toState,\n label,\n hint,\n help,\n required,\n disabled,\n emptyValue,\n inputClassName,\n pickerProps,\n}: {\n from: ControllerRenderProps;\n fromState: ControllerFieldState;\n to: ControllerRenderProps;\n toState: ControllerFieldState;\n label: ReactNode;\n hint: ReactNode;\n help: ReactNode;\n required?: boolean;\n disabled: boolean;\n emptyValue: \"\" | null;\n inputClassName?: string;\n pickerProps: OwnDateRangeProps;\n}) {\n const { id, formItemId, formMessageId, describedBy } = useFormField();\n // RhfField's rule: a FieldHint is its words at Large and on touch (DUP-2) — and at\n // every size beside a `help`, whose \"?\" follows the label (0.36).\n const helpMark = fieldHelpMark(help, label);\n const shownHint = useInlineHint(hint, helpMark !== undefined);\n // Both fields' refs go to the one trigger (API-3, refactor audit 2026-10), so\n // `shouldFocusError` lands there whichever of the two is first in error.\n const triggerRef = useMemo(() => mergeRefs(from.ref, to.ref), [from.ref, to.ref]);\n const invalid = fromState.invalid || toState.invalid;\n const messages = [fromState.error?.message, toState.error?.message].filter(\n (m, i, all): m is string => typeof m === \"string\" && m !== \"\" && all.indexOf(m) === i,\n );\n const messageIds = messages.map((_, i) => `${formMessageId}-${i}`);\n const fromValue: unknown = from.value;\n const toValue: unknown = to.value;\n const labelEl = hasContent(label) && (\n // FormLabel colours from the START's error alone (its context is that field); the\n // pair's state says it here.\n <FormLabel id={`${id}-label`} required={required} data-error={invalid || undefined}>\n {label}\n </FormLabel>\n );\n return (\n <>\n {helpMark === undefined ? (\n labelEl\n ) : (\n <div className=\"flex items-center gap-1\">\n {labelEl}\n <span className=\"flex shrink-0 items-center\">{helpMark}</span>\n </div>\n )}\n <DateRangePicker\n {...pickerProps}\n ref={triggerRef}\n id={formItemId}\n // Merged, never replaced — a caller's own reference first, as FormControl does.\n aria-describedby={\n [pickerProps[\"aria-describedby\"], describedBy, ...messageIds].filter(Boolean).join(\" \") || undefined\n }\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n from={typeof fromValue === \"string\" ? fromValue : \"\"}\n to={typeof toValue === \"string\" ? toValue : \"\"}\n onChange={(f, t) => {\n from.onChange(f === \"\" ? emptyValue : f);\n to.onChange(t === \"\" ? emptyValue : t);\n if (t !== \"\" || f === \"\") {\n from.onBlur();\n to.onBlur();\n }\n }}\n disabled={disabled || from.disabled || to.disabled}\n invalid={invalid}\n className={inputClassName ?? \"w-full\"}\n />\n {hasContent(shownHint) && <FormDescription>{shownHint}</FormDescription>}\n {messages.map((message, i) => (\n // FormMessage's look and its rule: no `role=\"alert\"` — read when focus reaches\n // the trigger, which names these in its description.\n <p\n key={message}\n id={messageIds[i]}\n data-slot=\"form-message\"\n className=\"text-caption leading-tight text-danger\"\n >\n {message}\n </p>\n ))}\n </>\n );\n}\n\n// ── time ─────────────────────────────────────────────────────────────────────\n\nexport type RhfTimeInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n Omit<\n TimeInputProps,\n | \"name\"\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onValueChange\"\n | \"onBlur\"\n | \"label\"\n | \"error\"\n | \"invalid\"\n | \"className\"\n | \"disabled\"\n | \"required\"\n > & {\n /** What a cleared time stores. Default `\"\"`; `null` for a nullable schema. */\n emptyValue?: \"\" | null;\n };\n\n/**\n * The kit's {@link TimeInput}: a time of day as `\"HH:mm\"` (`\"HH:mm:ss\"` when `step`\n * asks for seconds), normalised before it reaches the form, so the stored value\n * compares and sorts as a string. kastlan 4: the owner meeting's time was an\n * {@link RhfField} with a hand-wired `TimeInput` in its render — `ref`, `name`, the\n * `?? \"\"`, `onValueChange`, `onBlur`, `invalid` — the seven lines every bound field\n * folds into one.\n *\n * `min` / `max` paint an out-of-window time (see TimeInput) but do not fail the form:\n * validation stays the schema's or `rules`'. `rules={{ validate: (v) =>\n * isTimeInRange(v, min, max) || \"…\" }}` says it with the same window.\n */\nexport function RhfTimeInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n emptyValue = \"\",\n ...timeProps\n}: RhfTimeInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <TimeInput\n aria-required={required || undefined}\n {...timeProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={(v) => field.onChange(v === \"\" ? emptyValue : v)}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\n// ── IBAN and phone (0.22) ────────────────────────────────────────────────────\n\ntype OwnTextishProps<P> = Omit<\n P,\n | \"name\"\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onValueChange\"\n | \"onBlur\"\n | \"label\"\n | \"error\"\n | \"invalid\"\n | \"className\"\n | \"disabled\"\n | \"required\"\n>;\n\nexport type RhfIbanInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextishProps<IbanInputProps>;\n\n/**\n * {@link IbanInput} bound to one field, which stores the COMPACT upper-case IBAN (what\n * kastlan's server checks and its QR bill prints). The field's own checksum and\n * `kind` messages show while the form has nothing to say; a form error (the schema's\n * or `rules`') replaces them, as a caller's `error` does on the bare field. kastlan\n * asked for the field; it binds everything through react-hook-form.\n */\nexport function RhfIbanInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...ibanProps\n}: RhfIbanInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <IbanInput\n aria-required={required || undefined}\n {...ibanProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\nexport type RhfPhoneInputProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> & OwnTextishProps<PhoneInputProps>;\n\n/**\n * {@link PhoneInput} bound to one field, which stores E.164 when the number reads as\n * one and the typed text unchanged otherwise — kastlan's contacts keep their old free\n * text until someone edits it. Validation (required, a pattern for E.164 only) is the\n * schema's or `rules`'.\n */\nexport function RhfPhoneInput<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...phoneProps\n}: RhfPhoneInputProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n <PhoneInput\n aria-required={required || undefined}\n {...phoneProps}\n name={field.name}\n ref={field.ref}\n value={typeof value === \"string\" ? value : \"\"}\n onValueChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\n// ── country and month (0.23) ─────────────────────────────────────────────────\n\ntype OwnCountrySelectProps = Omit<\n CountrySelectProps<boolean>,\n | \"value\"\n | \"onChange\"\n | \"onBlur\"\n | \"label\"\n | \"hint\"\n | \"error\"\n | \"invalid\"\n | \"disabled\"\n | \"className\"\n | \"id\"\n | \"ref\"\n | \"clearable\"\n>;\n\nexport type RhfCountrySelectProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnCountrySelectProps & {\n /** Offer the picker's clear \"×\" (and Delete on the trigger) while a country is\n * chosen. A clear stores `clearValue`. */\n clearable?: boolean;\n /** What a clear stores. Default `null`; `\"\"` for a schema that spells \"no\n * country\" as an empty string (a zod `z.string().max(2)`, kastlan's). The picker\n * reads either back as empty. */\n clearValue?: ComboClearValue;\n /** Classes for the picker — `className` is the item's box. */\n selectClassName?: string;\n };\n\n/**\n * {@link CountrySelect} bound to one field, which stores the ISO 3166-1 alpha-2 code\n * (\"CH\", always upper-case), or `clearValue` once cleared (`clearable`). kastlan asked\n * for it (0.22 adoption): its address form wired a `CountrySelect` through\n * {@link RhfField}'s render, and with no ref on the picker react-hook-form's\n * focus-on-error had nothing to focus — the one field on the form a failed submit\n * could not take you to.\n *\n * Bound the way {@link RhfIbanInput} and {@link RhfPhoneInput} are: `field.ref` reaches\n * the trigger (the picker's `ref`, 0.23), the form's error paints the trigger and is\n * the shell's message under it, the hint is the shell's description — so neither is\n * ever handed to the picker, and its box never changes when one comes or goes. The\n * form's label names the trigger together with the chosen country, and is the phone\n * sheet's title. `commit` and `disabledReason` are the picker's own: a country that\n * saves itself stays focusable under a lock and says why.\n *\n * ```tsx\n * <RhfCountrySelect name=\"country\" label=\"Country\" required\n * preferred={[\"CH\", \"LI\", \"DE\", \"AT\", \"FR\", \"IT\"]} rules={{ required: \"Choose a country\" }} />\n * ```\n */\nexport function RhfCountrySelect<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearable,\n clearValue = null,\n selectClassName,\n labels,\n ...countryProps\n}: RhfCountrySelectProps<TFieldValues, TName, TTransformed>) {\n const labelled = hasContent(label);\n // A string label is also what the field IS — the picker's `country` word, which\n // titles the phone sheet. A caller's own `labels.country` still wins.\n const ownLabels = typeof label === \"string\" ? { country: label, ...labels } : labels;\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, labelId }) => {\n const value: unknown = field.value;\n return (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which the picker routes to its trigger.\n <CountrySelect<boolean>\n aria-required={required || undefined}\n // The form's label, then the country (see the picker's `aria-labelledby`).\n aria-labelledby={labelled ? labelId : undefined}\n {...countryProps}\n labels={ownLabels}\n className={selectClassName}\n ref={field.ref}\n value={typeof value === \"string\" ? value : null}\n clearable={clearable}\n onChange={(code) => field.onChange(code ?? clearValue)}\n // Focus leaving the picker (the wrapper's focusout) marks the field touched.\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\ntype OwnMonthPickerProps = Omit<\n MonthPickerProps,\n \"value\" | \"onChange\" | \"onBlur\" | \"label\" | \"hint\" | \"error\" | \"invalid\" | \"disabled\" | \"className\" | \"id\" | \"mode\"\n>;\n\n/** `mode` picks what the form stores, and `valueAsNumber` is only offered for a year. */\ntype RhfMonthPickerMode =\n | {\n /** A month, stored as `\"YYYY-MM\"` (the default). */\n mode?: \"month\";\n valueAsNumber?: undefined;\n }\n | {\n /** A year, stored as `\"YYYY\"` — or as a number with `valueAsNumber`. */\n mode: \"year\";\n /** Store the year as a number (`2026`) rather than `\"2026\"` — kastlan's budget\n * `fiscal_year` is an integer column. A number in the form reads back as its\n * year. */\n valueAsNumber?: boolean;\n };\n\nexport type RhfMonthPickerProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnMonthPickerProps & {\n /** Classes for the picker — `className` is the item's box. As {@link RhfDateField}'s. */\n inputClassName?: string;\n } & RhfMonthPickerMode;\n\nfunction MonthControl({\n field,\n focusRef,\n invalid,\n id,\n valueAsNumber,\n mode,\n inputClassName,\n pickerProps,\n required,\n ...aria\n}: {\n field: ControllerRenderProps;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n invalid: boolean;\n id: string;\n valueAsNumber?: boolean;\n mode?: \"month\" | \"year\";\n inputClassName?: string;\n pickerProps: OwnMonthPickerProps;\n required?: boolean;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: MonthPickerProps[\"aria-invalid\"];\n}) {\n const value: unknown = field.value;\n return (\n <MonthPicker\n {...pickerProps}\n {...aria}\n // The trigger itself (API-3, refactor audit 2026-10) — RhfDateField's way.\n ref={focusRef}\n // MonthPicker routes `aria-required` to its trigger since 0.23.0.\n aria-required={required || undefined}\n id={id}\n mode={mode}\n value={value === null || value === undefined ? \"\" : String(value)}\n onChange={(key) => {\n field.onChange(mode === \"year\" && valueAsNumber ? Number(key) : key);\n // A pick is the whole interaction — there is no text to leave — so it touches.\n field.onBlur();\n }}\n disabled={field.disabled}\n invalid={invalid}\n className={inputClassName}\n />\n );\n}\n\n/**\n * {@link MonthPicker} bound to one field: a month as `\"YYYY-MM\"`, or with `mode=\"year\"` a\n * year as `\"YYYY\"` (`valueAsNumber` stores `2026`). kastlan asked for it with\n * {@link RhfCountrySelect}: its budget wizard's fiscal year was a `MonthPicker\n * mode=\"year\"` inside {@link RhfField}'s render — the `String()` in, the `Number()`\n * out, `invalid` by hand — and a failed submit could not focus it, because the picker\n * forwards no ref.\n *\n * Bound as {@link RhfDateField} is: `field.ref` is the picker's `ref`, its trigger (an id\n * lookup until 0.34, API-3), so focus-on-error lands there; the form's error paints the\n * trigger and is the shell's message; the hint is the shell's description; neither is\n * handed to the picker, so its box never changes. Picking marks the field touched.\n *\n * ```tsx\n * <RhfMonthPicker name=\"fiscalYear\" label=\"Fiscal year\" mode=\"year\" valueAsNumber\n * min=\"2020\" max=\"2029\" rules={{ required: \"Choose a year\" }} />\n * ```\n */\nexport function RhfMonthPicker<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n inputClassName,\n mode,\n valueAsNumber,\n ...pickerProps\n}: RhfMonthPickerProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid, id }) => (\n // FormControl clones this element with `aria-describedby` / `aria-invalid`,\n // which MonthControl hands on to the picker's trigger.\n <MonthControl\n field={field as unknown as ControllerRenderProps}\n focusRef={field.ref}\n invalid={invalid}\n id={id}\n mode={mode}\n valueAsNumber={valueAsNumber}\n inputClassName={inputClassName}\n pickerProps={pickerProps}\n required={required}\n />\n )}\n />\n );\n}\n\n// ── select ───────────────────────────────────────────────────────────────────\n\nexport interface RhfSelectOption {\n value: string | number;\n label: ReactNode;\n disabled?: boolean;\n}\n\nexport type RhfSelectProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // Select's own — its lock (`commit`, `disabledReason`), `size`, … — which a `Pick`\n // list dropped until 0.34 (DUP-9). One value, so not `multiple`.\n Omit<SelectProps, BoundByForm | \"children\" | \"multiple\" | \"selectClassName\"> & {\n /** The options, as data. Or pass `<option>` children. */\n options?: readonly RhfSelectOption[];\n children?: ReactNode;\n /** A first, empty option (\"Choose…\"), selected while the value is empty. */\n placeholder?: string;\n /** Store `Number(value)` rather than the option's string. An empty choice still\n * stores `\"\"`. */\n valueAsNumber?: boolean;\n /** Classes for the select. Default `w-full`. */\n selectClassName?: string;\n };\n\n/** A native {@link Select}, from `options` or `<option>` children. */\nexport function RhfSelect<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n options,\n children,\n placeholder,\n valueAsNumber,\n selectClassName,\n ...selectProps\n}: RhfSelectProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => (\n <Select\n aria-required={required || undefined}\n {...selectProps}\n className={cn(\"w-full\", selectClassName)}\n name={field.name}\n ref={field.ref}\n value={(field.value ?? \"\") as string | number}\n onChange={(e) => {\n const raw = e.target.value;\n field.onChange(valueAsNumber && raw !== \"\" ? Number(raw) : raw);\n }}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n >\n {placeholder !== undefined && <option value=\"\">{placeholder}</option>}\n {options\n ? options.map((o) => (\n <option key={String(o.value)} value={o.value} disabled={o.disabled}>\n {o.label}\n </option>\n ))\n : children}\n </Select>\n )}\n />\n );\n}\n\n// ── checkbox ─────────────────────────────────────────────────────────────────\n\nexport type RhfCheckboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = // No `help` (0.36): a box has no label line — its label sits beside it, inside the\n // `<label>` a \"?\" cannot join — and Checkbox takes none.\n Omit<RhfFieldBaseProps<TFieldValues, TName, TTransformed>, \"help\"> &\n // Checkbox's own — its lock (`commit`, `disabledReason`) among them, which a `Pick`\n // list dropped until 0.34 (DUP-9) — less the box's state the form holds, and its\n // `description`, which is the twin's `hint`.\n Omit<CheckboxProps, BoundByForm | \"checked\" | \"defaultChecked\" | \"onCheckedChange\" | \"description\">;\n\n/**\n * The kit's {@link Checkbox}, label beside the box and `hint` under it (the\n * checkbox's own `description`). Stores a boolean. `required` is the native one here\n * — see Checkbox — so a `<form>` refuses to submit it unticked.\n */\nexport function RhfCheckbox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...boxProps\n}: RhfCheckboxProps<TFieldValues, TName, TTransformed>) {\n // RhfField's rule for the box's own description: a FieldHint is its words at Large\n // and on touch (DUP-2).\n const description = useInlineHint(hint);\n return (\n <RhfField\n {...{ name, control, rules, required, disabled, excludeWhenDisabled, className }}\n showLabel={false}\n render={({ field, invalid }) => (\n <Checkbox\n {...boxProps}\n ref={field.ref}\n name={field.name}\n checked={Boolean(field.value)}\n onCheckedChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n required={required}\n invalid={invalid}\n label={label}\n description={description}\n />\n )}\n />\n );\n}\n\n// ── toggle group ─────────────────────────────────────────────────────────────\n\n/** The two shapes a {@link ToggleGroup} comes in, carried over: `allowEmpty` picks\n * whether a press on the chosen option clears it, and types the caption to match. */\ntype RhfToggleGroupMode<T extends string> =\n | {\n /** One option is always the answer (the default): a press on the chosen\n * option re-sends it. */\n allowEmpty?: false;\n semantics?: ToggleGroupRequiredProps<T>[\"semantics\"];\n caption?: ToggleGroupRequiredProps<T>[\"caption\"];\n emptyValue?: undefined;\n }\n | {\n /** A press on the chosen option clears it, and the form stores `emptyValue`. */\n allowEmpty: true;\n semantics?: ToggleGroupClearableProps<T>[\"semantics\"];\n caption?: ToggleGroupClearableProps<T>[\"caption\"];\n /** What a cleared group stores. Default `null`; `\"\"` for a schema that spells\n * \"no choice\" as an empty string. */\n emptyValue?: null | \"\";\n };\n\nexport type RhfToggleGroupProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n T extends string = string,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The group's own (its `disabledReasonDisplay` was not on the `Pick` list this was\n // until 0.34, DUP-9), less what the form binds, the ids, and the label's placement:\n // the label is the form's, above.\n Omit<\n ToggleGroupBaseProps<T>,\n BoundByForm | \"id\" | \"aria-labelledby\" | \"labelPlacement\" | \"chromeClassName\"\n > & {\n /** Classes for the group itself — `className` is the item's box. */\n groupClassName?: string;\n } & RhfToggleGroupMode<T>;\n\n/**\n * The kit's {@link ToggleGroup} bound to one field: a choice between a few answers\n * (\"Monthly / Quarterly / Yearly\"), stored as the chosen option's `value`. kastlan 4\n * asked for it with {@link RhfTimeInput} and {@link RhfDateRangePicker}: the controls\n * its forms still had to wire by hand through {@link RhfField}'s render.\n *\n * The label is the field's own label above the bare group, as on every other\n * bound field — the `labelPlacement=\"above\"` shape, not the group's own field chrome —\n * and it names the group (`aria-labelledby`); the hint and the message describe it,\n * and an error paints the group's border. Focus on error goes to the option a\n * keyboard user would land on (the chosen one, else the first); touched is set when\n * focus leaves the group, not when it moves between options.\n *\n * Required by default, as the group is: a press on the chosen option keeps it. With\n * `allowEmpty`, a second press clears the choice and the form stores `emptyValue`\n * (`null` by default) — the options then become toggle buttons, see ToggleGroup. A\n * value that matches no option (an empty default) leaves nothing pressed; that the\n * field still needs answering is the schema's or `rules`' to say.\n */\nexport function RhfToggleGroup<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n T extends string = string,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n ...groupProps\n}: RhfToggleGroupProps<TFieldValues, TName, T, TTransformed>) {\n const labelled = hasContent(label);\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n render={({ field, invalid, id, labelId, describedBy }) => (\n <ToggleControl<T>\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n id={id}\n labelledBy={labelled ? labelId : undefined}\n describedBy={describedBy}\n groupProps={groupProps}\n />\n )}\n />\n );\n}\n\nfunction ToggleControl<T extends string>({\n field,\n invalid,\n required,\n id,\n labelledBy,\n describedBy,\n groupProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n id: string;\n labelledBy: string | undefined;\n describedBy: string | undefined;\n groupProps: Omit<RhfToggleGroupProps<FieldValues, string, T>, keyof RhfFieldBaseProps>;\n}) {\n const { groupClassName, emptyValue, allowEmpty, semantics, caption, ...rest } = groupProps;\n // React's onBlur is focusout: it fires on every move between options as well, and\n // only leaving the group is a blur of the FIELD.\n const onBlur = (e: FocusEvent<HTMLDivElement>) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) field.onBlur();\n };\n const raw: unknown = field.value;\n const value = raw === null || raw === undefined || raw === \"\" ? null : (String(raw) as T);\n const common = {\n ...rest,\n // The group (API-3, refactor audit 2026-10): its `focus()` lands on the radio shape's\n // tab stop, or the pressed shape's pressed option — the rule this adapter carried\n // as an id lookup until ToggleGroup took a ref.\n ref: field.ref,\n id,\n className: groupClassName,\n \"aria-labelledby\": labelledBy,\n \"aria-describedby\": describedBy,\n \"aria-invalid\": invalid || undefined,\n disabled: field.disabled,\n onBlur,\n };\n // The props' union pairs `allowEmpty` with its caption's type; taken apart above it no\n // longer narrows, so each branch says which half it is.\n if (allowEmpty) {\n return (\n <ToggleGroup<T>\n {...common}\n allowEmpty\n caption={caption as ToggleGroupClearableProps<T>[\"caption\"]}\n value={value}\n onChange={(v) => field.onChange(v ?? emptyValue ?? null)}\n />\n );\n }\n return (\n <ToggleGroup<T>\n {...common}\n allowEmpty={false}\n semantics={semantics}\n caption={caption as ToggleGroupRequiredProps<T>[\"caption\"]}\n // A radiogroup takes `aria-required`; a group of toggle buttons does not.\n aria-required={required && semantics !== \"pressed\" ? true : undefined}\n // An empty default matches no option: nothing pressed, the first option the tab\n // stop.\n value={(value ?? \"\") as T}\n onChange={(v) => field.onChange(v)}\n />\n );\n}\n\n// ── comboboxes ───────────────────────────────────────────────────────────────\n\nexport type RhfComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The picker's own, as an `Omit` since 0.34 (DUP-9) rather than the `Pick` list it\n // was, less what the form binds and the clear value, which is the twin's below.\n Omit<EntityComboboxProps<V>, BoundByForm | \"id\" | \"clearValue\"> & {\n /** What a clear stores — the picker's `clearValue`. Default `null`; `\"\"` for a\n * schema that spells \"no choice\" as an empty string. */\n clearValue?: ComboClearValue;\n /** Classes for the picker. */\n comboClassName?: string;\n };\n\nfunction EntityControl<V extends string | number>({\n field,\n invalid,\n required,\n error,\n id,\n describedBy,\n clearValue,\n comboClassName,\n sheetTitle,\n focusRef,\n comboProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n error: string | undefined;\n id: string;\n describedBy: string | undefined;\n clearValue: ComboClearValue;\n comboClassName?: string;\n sheetTitle: ReactNode;\n /** `field.ref`, handed over on its own so the compiler reads `field` as data. */\n focusRef: ControllerRenderProps[\"ref\"];\n comboProps: Omit<RhfComboboxProps<FieldValues, string, V>, keyof RhfFieldBaseProps | \"clearValue\" | \"comboClassName\">;\n}) {\n const box = useRef<HTMLDivElement>(null);\n // EntityCombobox puts `id` and the ARIA below on its trigger, so the label's\n // `htmlFor` names it and the hint describes it; `field.ref` reaches the trigger\n // through the picker's own `ref` (0.24), as RhfCountrySelect's does.\n // EntityCombobox reports no blur: focus leaving the picker marks the field touched.\n const onBlur = field.onBlur;\n useLayoutEffect(() => {\n const el = box.current;\n if (!el) return;\n el.addEventListener(\"focusout\", onBlur);\n return () => el.removeEventListener(\"focusout\", onBlur);\n }, [onBlur]);\n const value: unknown = field.value;\n return (\n <div ref={box}>\n <EntityCombobox<V, ComboClearValue>\n // The form's label titles the phone sheet: the picker is not handed `label`,\n // which the FormLabel above already draws.\n sheetTitle={sheetTitle}\n {...comboProps}\n ref={focusRef}\n className={comboClassName}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n value={(value ?? null) as V | ComboClearValue | null}\n clearValue={clearValue}\n onChange={(v) => field.onChange(v)}\n disabled={field.disabled}\n invalid={invalid}\n // Its own message, which it merges into the trigger's aria-describedby after\n // the hint.\n error={error}\n />\n </div>\n );\n}\n\n/**\n * The kit's {@link EntityCombobox}: an id-keyed pick from `options` or `loadOptions`.\n * Stores the option's `value`, or `clearValue` on a clear (only offered with\n * `clearable`).\n *\n * 0.24: `field.ref` goes through the picker's own `ref` to its trigger (it used to be\n * a focus handle that found the trigger by id — the same element, now by the route\n * every other binding takes); the write lock (`commit`, `disabledReason`), the create\n * row's `createEmptyLabel` / `createCommit`, `closeLabel` and `aria-label` pass\n * through; and the form's label titles the phone sheet, which fell back to the\n * placeholder. For the INLINE picker — a text input, the account field typed into —\n * see {@link RhfInlineEntityCombobox}.\n */\nexport function RhfCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearValue = null,\n comboClassName,\n ...comboProps\n}: RhfComboboxProps<TFieldValues, TName, V, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n message={false}\n render={({ field, invalid, error, id, describedBy }) => (\n <EntityControl<V>\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n error={error}\n id={id}\n describedBy={describedBy}\n clearValue={clearValue}\n comboClassName={comboClassName}\n sheetTitle={hasContent(label) ? label : undefined}\n focusRef={field.ref}\n comboProps={comboProps}\n />\n )}\n />\n );\n}\n\ntype OwnInlineEntityComboboxProps<V extends string | number> = Omit<\n InlineEntityComboboxProps<V, ComboClearValue>,\n | \"value\"\n | \"defaultValue\"\n | \"onChange\"\n | \"onBlur\"\n | \"label\"\n | \"hint\"\n | \"error\"\n | \"invalid\"\n | \"disabled\"\n | \"className\"\n | \"id\"\n | \"ref\"\n | \"clearValue\"\n>;\n\nexport type RhfInlineEntityComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n OwnInlineEntityComboboxProps<V> & {\n /** What a clear stores — emptying the text, or the \"×\" with `clearable`. Default\n * `null`; `\"\"` for a schema that spells \"no choice\" as an empty string. The\n * picker reads either back as empty. */\n clearValue?: ComboClearValue;\n /** Classes for the picker — `className` is the item's box. As {@link RhfCombobox}'s. */\n comboClassName?: string;\n };\n\n/**\n * {@link InlineEntityCombobox} bound to one field, which stores the chosen option's\n * `value` (an id), or `clearValue` once the text is emptied or the \"×\" pressed.\n *\n * kastlan asked for it (0.24): its account picker IS an `InlineEntityCombobox` — the\n * account number is typed straight into the field — and the budget line-item form\n * wired it through {@link RhfField}'s render. The picker took no `ref`, so react-hook-\n * form's focus-on-error had nothing to focus: a line item saved without an account\n * failed its submit and left the caret where it was, the one field on the form a\n * failed submit could not take you to. (The same gap {@link RhfCountrySelect} closed\n * for the address form's country in 0.23.)\n *\n * Bound the way {@link RhfCountrySelect} is: `field.ref` reaches the `<input>` (the\n * picker's `ref`, 0.24), the form's error paints the input and is the shell's message\n * under it, and the hint is the shell's description — so neither is ever handed to the\n * picker, and its box never changes when one comes or goes. The form's label names\n * the input through `<label for>` and titles the phone sheet (`sheetTitle`); the picker\n * draws no floating label of its own. Focus leaving the picker marks the field\n * touched.\n *\n * Everything else is the picker's and passes through: `commit` and `disabledReason`\n * (a picker whose choice saves stays focusable under a lock and says why), `clearable`,\n * `autoFocus`, `aria-label` for an unlabelled cell, and the create row — `onCreate`,\n * `createLabel`, `createEmptyLabel`, `createCommit`. Making the record is the\n * caller's, and so is storing its id once it exists:\n *\n * ```tsx\n * <RhfInlineEntityCombobox<LineItem, \"account_id\", number>\n * name=\"account_id\" label=\"Account\" required options={accounts}\n * rules={{ required: \"Choose an account\" }}\n * onCreate={async (name) => form.setValue(\"account_id\", (await createAccount(name)).id)} />\n * ```\n *\n * For the button-shaped picker with an async `loadOptions`, see {@link RhfCombobox}.\n */\nexport function RhfInlineEntityCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n V extends string | number = string | number,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n clearValue = null,\n comboClassName,\n ...comboProps\n}: RhfInlineEntityComboboxProps<TFieldValues, TName, V, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n render={({ field, invalid }) => {\n const value: unknown = field.value;\n return (\n // FormControl clones this element with `id` / `aria-describedby` /\n // `aria-invalid`, which the picker routes to its <input>.\n <InlineEntityCombobox<V, ComboClearValue>\n aria-required={required || undefined}\n // The form's label is the phone sheet's heading — the picker is not handed\n // `label`, which the FormLabel above already draws. A caller's own wins.\n sheetTitle={hasContent(label) ? label : undefined}\n {...comboProps}\n className={comboClassName}\n ref={field.ref}\n value={(value ?? null) as V | ComboClearValue | null}\n clearValue={clearValue}\n onChange={(v) => field.onChange(v)}\n // The wrapper's blur, which the <input>'s bubbles to after the picker has\n // judged any loose text — so the value is in before the field is touched.\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n />\n );\n }}\n />\n );\n}\n\nexport type RhfTextComboboxProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n> = RhfFieldBaseProps<TFieldValues, TName, TTransformed> &\n // The combobox's own, as an `Omit` since 0.34 (DUP-9) rather than the `Pick` list it\n // was, less what the form binds.\n Omit<ComboboxProps, BoundByForm | \"id\"> & {\n /** Classes for the combobox. */\n comboClassName?: string;\n };\n\n/**\n * The kit's free-text {@link Combobox}: type anything, or pick one of `options`.\n * Stores the string.\n */\nexport function RhfTextCombobox<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n TTransformed = TFieldValues,\n>({\n name,\n control,\n rules,\n label,\n hint,\n help,\n required,\n disabled,\n excludeWhenDisabled,\n className,\n comboClassName,\n ...comboProps\n}: RhfTextComboboxProps<TFieldValues, TName, TTransformed>) {\n return (\n <RhfField\n {...{ name, control, rules, label, hint, help, required, disabled, excludeWhenDisabled, className }}\n asControl={false}\n message={false}\n render={({ field, invalid, error, id, describedBy }) => (\n <TextComboControl\n field={field as unknown as ControllerRenderProps}\n invalid={invalid}\n required={required}\n error={error}\n id={id}\n describedBy={describedBy}\n className={comboClassName}\n sheetTitle={hasContent(label) ? label : undefined}\n focusRef={field.ref}\n comboProps={comboProps}\n />\n )}\n />\n );\n}\n\nfunction TextComboControl({\n field,\n invalid,\n required,\n error,\n id,\n describedBy,\n className,\n sheetTitle,\n focusRef,\n comboProps,\n}: {\n field: ControllerRenderProps;\n invalid: boolean;\n required?: boolean;\n error: string | undefined;\n id: string;\n describedBy: string | undefined;\n className?: string;\n sheetTitle: ReactNode;\n /** `field.ref` — see EntityControl. */\n focusRef: ControllerRenderProps[\"ref\"];\n comboProps: Omit<RhfTextComboboxProps, keyof RhfFieldBaseProps | \"comboClassName\">;\n}) {\n // The combobox routes `id` and its ARIA to its <input>, so the label's `htmlFor`\n // names it and the hint describes it; `field.ref` reaches the <input> through the\n // combobox's own `ref` (0.24). The error is its own `error` prop, which it merges\n // in after the hint.\n const value: unknown = field.value;\n return (\n <Combobox\n // The form's label titles the phone sheet (see EntityControl).\n sheetTitle={sheetTitle}\n {...comboProps}\n ref={focusRef}\n id={id}\n aria-describedby={describedBy}\n aria-required={required || undefined}\n className={className}\n value={typeof value === \"string\" ? value : value == null ? \"\" : String(value)}\n onChange={field.onChange}\n onBlur={field.onBlur}\n disabled={field.disabled}\n invalid={invalid}\n error={error}\n />\n );\n}\n"],"mappings":";AA2LI,SAmxBA,UAnxBA,KA8EQ,YA9ER;AAzIJ,SAAS,iBAAiB,SAAS,cAAkE;AACrG;AAAA,EACE;AAAA,OAMK;AACP,SAAS,aAAa,iBAAiB,WAAW,UAAU,WAAW,aAAa,oBAAoB;AACxG,SAAS,aAA8B;AACvC,SAAS,cAAgC;AACzC,SAAS,gBAAoC;AAC7C,SAAS,mBAA0C;AACnD,SAAS,mBAAmB;AAE5B,SAAS,qBAAqB;AAC9B;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AACP,SAAS,iBAAsC;AAC/C,SAAS,iBAAsC;AAC/C,SAAS,kBAAwC;AACjD,SAAS,qBAA8C;AACvD,SAAS,mBAA0C;AACnD;AAAA,EACE;AAAA,OAIK;AACP,SAAS,gBAAoC;AAC7C,SAAS,sBAAgD;AACzD;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAEP,SAAS,eAAe,WAAW,qBAAqB;AACxD,SAAS,oBAAoB;AAC7B,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,kBAAkB;AAuF3B,SAAS,SAAS,EAAE,UAAU,SAAS,GAAgD;AACrF,QAAM,EAAE,GAAG,IAAI,aAAa;AAC5B,SACE,oBAAC,aAAU,IAAI,GAAG,EAAE,UAAU,UAC3B,UACH;AAEJ;AAEA,SAAS,YAAqF;AAAA,EAC5F;AAAA,EACA;AAAA,EAC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A;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1,10 +1,11 @@
1
1
  /**
2
- * The react-hook-form adapter: the five parts every form is built from, and the hook
3
- * they share. `@eifi1/ui-kit/rhf`.
2
+ * The react-hook-form adapter: the five parts every bound field is built from, and the
3
+ * hook they share. Behind `@eifi1/ui-kit/rhf`, which exports `Form` alone of them.
4
4
  *
5
5
  * The kit's own module since 0.34 (refactor audit 2026-10, API-6f): the bound `Rhf*`
6
- * fields build on these parts, and import them from here. ./form is the public face —
7
- * `Form`, and until 0.35 the parts under their deprecated names, which no app imports.
6
+ * fields and `RhfField` build on these parts, and import them from here. ./form is the
7
+ * public face — `Form`; the parts left the public surface in 0.35 (deprecated in 0.34),
8
+ * when no app imported them any more.
8
9
  *
9
10
  * ```tsx
10
11
  * <Form {...form}>