@12-apps/ui 6.73.1 → 6.74.1

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 (392) hide show
  1. package/NATIVE.md +1 -1
  2. package/dist/_internal/components/data-display/AsyncStateContainer/AsyncStateContainer.js +6 -6
  3. package/dist/_internal/components/data-display/Avatar/Avatar.js +4 -4
  4. package/dist/_internal/components/data-display/Avatar/Avatar.view.js +2 -2
  5. package/dist/_internal/components/data-display/CardKit/use-remove-confirm.js +8 -5
  6. package/dist/_internal/components/data-display/CardKit/use-row-confirm.js +8 -5
  7. package/dist/_internal/components/data-display/Carousel/Carousel.js +2 -2
  8. package/dist/_internal/components/data-display/Chart/Chart.js +3 -3
  9. package/dist/_internal/components/data-display/Chart/SpecChart.js +6 -6
  10. package/dist/_internal/components/data-display/Chart/chart-renderers.js +2 -2
  11. package/dist/_internal/components/data-display/Chart/chart-spec.js +2 -2
  12. package/dist/_internal/components/data-display/DataGrid/DataGrid.js +2 -2
  13. package/dist/_internal/components/data-display/DataViews/DataViewsGrid.js +38 -38
  14. package/dist/_internal/components/data-display/DataViews/DataViewsTableBase.js +60 -57
  15. package/dist/_internal/components/data-display/DataViews/DeleteViewDialog.js +3 -3
  16. package/dist/_internal/components/data-display/DataViews/ManageViewsDialog.js +10 -7
  17. package/dist/_internal/components/data-display/DataViews/SaveViewModal.js +7 -5
  18. package/dist/_internal/components/data-display/DataViews/base-card.js +3 -3
  19. package/dist/_internal/components/data-display/DataViews/base-list-card-geometry.js +3 -3
  20. package/dist/_internal/components/data-display/DataViews/base-list-card-layout.js +3 -3
  21. package/dist/_internal/components/data-display/DataViews/base-list-card-slots.js +2 -2
  22. package/dist/_internal/components/data-display/DataViews/base-list-card.js +7 -7
  23. package/dist/_internal/components/data-display/DataViews/data-views-category-pill.js +9 -9
  24. package/dist/_internal/components/data-display/DataViews/data-views-filter-panel.js +12 -12
  25. package/dist/_internal/components/data-display/DataViews/data-views-grid-bodies.js +6 -6
  26. package/dist/_internal/components/data-display/DataViews/data-views-grid-parts.js +33 -33
  27. package/dist/_internal/components/data-display/DataViews/data-views-inline-bar.js +16 -16
  28. package/dist/_internal/components/data-display/DataViews/data-views-more-fields.js +13 -13
  29. package/dist/_internal/components/data-display/DataViews/data-views-more-filters.js +14 -14
  30. package/dist/_internal/components/data-display/DataViews/data-views-range-pill.js +2 -2
  31. package/dist/_internal/components/data-display/DataViews/data-views-shell-toolbar.js +5 -5
  32. package/dist/_internal/components/data-display/DataViews/data-views-table-parts.js +15 -12
  33. package/dist/_internal/components/data-display/DataViews/data-views-toolbar.js +4 -4
  34. package/dist/_internal/components/data-display/DataViews/list-card-rails.js +2 -2
  35. package/dist/_internal/components/data-display/DataViews/use-data-views-state.js +4 -4
  36. package/dist/_internal/components/data-display/EmptyState/EmptyState.js +2 -2
  37. package/dist/_internal/components/data-display/FleetMap/FleetBody.js +10 -10
  38. package/dist/_internal/components/data-display/FleetMap/FleetCanvas.js +6 -6
  39. package/dist/_internal/components/data-display/FleetMap/FleetMap.js +14 -14
  40. package/dist/_internal/components/data-display/FleetMap/FleetRoster.js +3 -3
  41. package/dist/_internal/components/data-display/HoverCard/HoverCard.js +2 -2
  42. package/dist/_internal/components/data-display/InteractiveTooltip/InteractiveTooltip.js +2 -2
  43. package/dist/_internal/components/data-display/LazyImage/LazyImage.js +3 -3
  44. package/dist/_internal/components/data-display/Lightbox/Lightbox.js +6 -6
  45. package/dist/_internal/components/data-display/LoadingState/LoadingState.js +3 -3
  46. package/dist/_internal/components/data-display/MapPreview/MapLayers.js +3 -3
  47. package/dist/_internal/components/data-display/MapPreview/MapPreview.js +5 -5
  48. package/dist/_internal/components/data-display/Progress/Progress.js +2 -2
  49. package/dist/_internal/components/data-display/SectionOnboarding/SectionOnboarding.js +3 -3
  50. package/dist/_internal/components/data-display/Sheet/Sheet.hooks.js +2 -2
  51. package/dist/_internal/components/data-display/Sheet/Sheet.js +4 -4
  52. package/dist/_internal/components/data-display/StatCard/StatCard.js +3 -3
  53. package/dist/_internal/components/data-display/Table/Table.js +2 -2
  54. package/dist/_internal/components/data-display/index.js +56 -56
  55. package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.js +5 -2
  56. package/dist/_internal/components/feedback/ConfirmAction/ConfirmAction.parts.js +4 -1
  57. package/dist/_internal/components/feedback/ConfirmAction/ConfirmButton.js +6 -3
  58. package/dist/_internal/components/feedback/ConfirmAction/with-confirmation.js +5 -2
  59. package/dist/_internal/components/feedback/Dialog/Dialog.js +2 -2
  60. package/dist/_internal/components/feedback/TutorialOverlay/TutorialOverlay.js +2 -2
  61. package/dist/_internal/components/feedback/index.js +13 -11
  62. package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.hooks.js +4 -4
  63. package/dist/_internal/components/form/AddressAutocomplete/AddressAutocomplete.js +8 -8
  64. package/dist/_internal/components/form/AddressAutocomplete/AddressAutocompleteField.js +2 -2
  65. package/dist/_internal/components/form/Autocomplete/Autocomplete.js +1 -1
  66. package/dist/_internal/components/form/Calendar/Calendar.hooks.js +2 -2
  67. package/dist/_internal/components/form/Calendar/Calendar.js +6 -6
  68. package/dist/_internal/components/form/Calendar/CalendarDayCell.js +2 -2
  69. package/dist/_internal/components/form/Calendar/CalendarMonth.js +3 -3
  70. package/dist/_internal/components/form/CategorySelect/CategoryPanel.js +3 -3
  71. package/dist/_internal/components/form/CategorySelect/CategorySelect.js +7 -7
  72. package/dist/_internal/components/form/CepField/CepField.js +5 -4
  73. package/dist/_internal/components/form/CodeEditor/CodeEditor.js +2 -2
  74. package/dist/_internal/components/form/Command/Command.js +2 -2
  75. package/dist/_internal/components/form/DateRangePicker/DateRangePicker.js +9 -9
  76. package/dist/_internal/components/form/Input/Input.factory.js +23 -0
  77. package/dist/_internal/components/form/Input/Input.factory.js.map +1 -0
  78. package/dist/_internal/components/form/Input/Input.js +4 -2
  79. package/dist/_internal/components/form/Input/outlined/text-field-slim-outlined.js +10 -0
  80. package/dist/_internal/components/form/Input/outlined/text-field-slim-outlined.js.map +1 -0
  81. package/dist/_internal/components/form/Input/text-field-slim.factory.js +10 -0
  82. package/dist/_internal/components/form/Input/text-field-slim.factory.js.map +1 -0
  83. package/dist/_internal/components/form/Input/text-field-slim.js +2 -1
  84. package/dist/_internal/components/form/NumberField/NumberField.js +5 -3
  85. package/dist/_internal/components/form/PickerSheet/PickerSheet.js +2 -2
  86. package/dist/_internal/components/form/index.js +44 -40
  87. package/dist/_internal/components/form/total-form/Fields/CategoryField.js +8 -8
  88. package/dist/_internal/components/form/total-form/Fields/CepField.js +6 -5
  89. package/dist/_internal/components/form/total-form/Fields/TextField.js +5 -3
  90. package/dist/_internal/components/form/total-form/Fields/index.js +21 -17
  91. package/dist/_internal/components/index.js +161 -157
  92. package/dist/_internal/components/layout/Card/Card.js +2 -2
  93. package/dist/_internal/components/layout/ScrollArea/ScrollArea.js +3 -3
  94. package/dist/_internal/components/layout/SettingCard/SettingCard.js +4 -4
  95. package/dist/_internal/components/layout/SettingCard/SettingCard.summary.js +3 -3
  96. package/dist/_internal/components/layout/SettingCard/SettingGroup.js +5 -5
  97. package/dist/_internal/components/layout/SettingCard/SettingSwitch.js +4 -4
  98. package/dist/_internal/components/layout/SettingCard/SettingToggle.js +5 -5
  99. package/dist/_internal/components/layout/SettingsLayout/SettingsLayout.js +5 -5
  100. package/dist/_internal/components/layout/SettingsLayout/SettingsPanel.js +2 -2
  101. package/dist/_internal/components/layout/Skeleton/Skeleton.js +2 -2
  102. package/dist/_internal/components/layout/index.js +17 -17
  103. package/dist/_internal/components/navigation/AppHeader/AppHeader.details.js +7 -7
  104. package/dist/_internal/components/navigation/NavigationMenu/NavigationMegaSection.js +3 -3
  105. package/dist/_internal/components/navigation/NavigationMenu/NavigationMenu.js +5 -5
  106. package/dist/_internal/components/navigation/NavigationMenu/NavigationMenuItem.js +2 -2
  107. package/dist/_internal/components/navigation/NavigationMenu/NavigationStandardBody.js +3 -3
  108. package/dist/_internal/components/navigation/index.js +36 -36
  109. package/dist/_internal/components/utility/InfiniteScroll/InfiniteScroll.js +2 -2
  110. package/dist/_internal/components/utility/InstallPrompt/InstallPrompt.js +2 -2
  111. package/dist/_internal/components/utility/index.js +8 -8
  112. package/dist/_internal/pt-BR.data-display.js +2 -2
  113. package/dist/_internal/social-login-button/social-login-button.js +3 -3
  114. package/dist/_internal/user-avatar/user-avatar.js +7 -7
  115. package/dist/charts.js +11 -11
  116. package/dist/{chunk-GMJBWOIU.js → chunk-2ILXXBMG.js} +5 -5
  117. package/dist/{chunk-LVATGJZO.js → chunk-2K2Q7VGV.js} +2 -2
  118. package/dist/{chunk-ISW5K72V.js → chunk-2ZRZTGWP.js} +5 -5
  119. package/dist/{chunk-BM3MKZL2.js → chunk-3BDMYTH6.js} +2 -2
  120. package/dist/{chunk-Q7BGMLCX.js → chunk-3FDSXSEP.js} +3 -3
  121. package/dist/{chunk-5WJFCQFN.js → chunk-3O2OJW4O.js} +4 -4
  122. package/dist/{chunk-L4FWEI2P.js → chunk-3V3Z4EML.js} +5 -5
  123. package/dist/{chunk-7KAZ3B5B.js → chunk-3VLVLZ6W.js} +4 -4
  124. package/dist/{chunk-CE74DKHT.js → chunk-44PBCQ7E.js} +7 -7
  125. package/dist/chunk-4JNC5AEF.js +14 -0
  126. package/dist/chunk-4JNC5AEF.js.map +1 -0
  127. package/dist/{chunk-U5YOOHR6.js → chunk-4QGPRORO.js} +2 -2
  128. package/dist/{chunk-W2RXXF7K.js → chunk-4XBAEKQQ.js} +4 -4
  129. package/dist/{chunk-7SPFK73H.js → chunk-52CLMR47.js} +7 -7
  130. package/dist/{chunk-LYVTJLCF.js → chunk-56JF5PZK.js} +4 -4
  131. package/dist/{chunk-QBY3TWV3.js → chunk-5HFB4WFE.js} +3 -3
  132. package/dist/{chunk-3DPPDGOF.js → chunk-62SXUU5U.js} +5 -5
  133. package/dist/{chunk-QADTI63U.js → chunk-6ATXOJVQ.js} +4 -4
  134. package/dist/{chunk-F3AYISXT.js → chunk-6PU3JYVY.js} +4 -4
  135. package/dist/{chunk-WVIJFS5Y.js → chunk-725H45MT.js} +7 -7
  136. package/dist/{chunk-XP522FFM.js → chunk-7JKDB5J5.js} +5 -5
  137. package/dist/{chunk-V45JGJ3W.js → chunk-7K23NEZO.js} +8 -8
  138. package/dist/{chunk-EOQ6EKTS.js → chunk-7XSCEHGA.js} +7 -7
  139. package/dist/{chunk-7VUXSNVZ.js → chunk-A4B27HYU.js} +2 -2
  140. package/dist/{chunk-ADSA76T7.js → chunk-AG3DY5TH.js} +2 -2
  141. package/dist/{chunk-G5ORAVSP.js → chunk-AJ5LXKLQ.js} +8 -8
  142. package/dist/{chunk-HI7JPDD6.js → chunk-AMLHEKSV.js} +5 -5
  143. package/dist/{chunk-XZILNBAU.js → chunk-ARVLS57B.js} +6 -6
  144. package/dist/{chunk-ZEH6MGP5.js → chunk-BEHM2VLH.js} +9 -9
  145. package/dist/{chunk-EBMWYRXW.js → chunk-BEYLI32I.js} +2 -2
  146. package/dist/{chunk-YKKHNYEW.js → chunk-BF3SGOWT.js} +3 -3
  147. package/dist/{chunk-MA6SUE7F.js → chunk-BGGVYKVZ.js} +4 -4
  148. package/dist/{chunk-EQK3K65G.js → chunk-C6LW34TV.js} +2 -2
  149. package/dist/chunk-C6LW34TV.js.map +1 -0
  150. package/dist/{chunk-E5GYHN4X.js → chunk-CAX3NFFE.js} +3 -3
  151. package/dist/{chunk-LIN4A2BW.js → chunk-CSD6SWBZ.js} +5 -5
  152. package/dist/{chunk-QK63RXLG.js → chunk-CYH5QQUP.js} +8 -8
  153. package/dist/{chunk-CJGSQL77.js → chunk-CZV6NVCA.js} +4 -4
  154. package/dist/{chunk-755VS7NA.js → chunk-DOWVAC4U.js} +3 -3
  155. package/dist/{chunk-V6OC2PSQ.js → chunk-DQ3O252B.js} +2 -2
  156. package/dist/{chunk-PIP7XII2.js → chunk-E54XIRY2.js} +5 -5
  157. package/dist/{chunk-SL6454K7.js → chunk-EEB66IVH.js} +26 -32
  158. package/dist/chunk-EEB66IVH.js.map +1 -0
  159. package/dist/{chunk-YNIOCELQ.js → chunk-ERI6JC4M.js} +3 -3
  160. package/dist/{chunk-U57NFQYE.js → chunk-FIOBPQL2.js} +4 -4
  161. package/dist/{chunk-6VUVSYP4.js → chunk-FR2RJXHS.js} +2 -2
  162. package/dist/{chunk-FWPQUYND.js → chunk-FS55MQ4Q.js} +2 -2
  163. package/dist/{chunk-UXVB423Q.js → chunk-FVL6U72V.js} +6 -6
  164. package/dist/{chunk-2ZHF5VE4.js → chunk-FXECKKPW.js} +32 -29
  165. package/dist/chunk-FXECKKPW.js.map +1 -0
  166. package/dist/{chunk-LWZ2K225.js → chunk-FXZUVZON.js} +6 -6
  167. package/dist/{chunk-RGR6YKK5.js → chunk-GBKIGUNP.js} +2 -2
  168. package/dist/{chunk-YBAK2WN5.js → chunk-HBHBRRSW.js} +7 -7
  169. package/dist/{chunk-HNFZLXZI.js → chunk-HBP2OU4Q.js} +5 -5
  170. package/dist/{chunk-4MKVGSHX.js → chunk-HN3PZTUK.js} +5 -5
  171. package/dist/{chunk-ZOUWHGV3.js → chunk-HOJL2GKW.js} +7 -7
  172. package/dist/{chunk-JVOEVTCZ.js → chunk-HQCZT6TO.js} +5 -5
  173. package/dist/{chunk-PCM4VEPO.js → chunk-HSIUVFXE.js} +7 -7
  174. package/dist/{chunk-L5R2FB4T.js → chunk-HVGQH54G.js} +2 -2
  175. package/dist/{chunk-RQF4NXDC.js → chunk-IWJTLCTF.js} +2 -2
  176. package/dist/{chunk-IICBAAL7.js → chunk-IZ7JTG3Z.js} +4 -4
  177. package/dist/{chunk-2QB4WIU5.js → chunk-J5QNJERV.js} +10 -10
  178. package/dist/{chunk-6OLERKNC.js → chunk-JA3WJPXH.js} +2 -2
  179. package/dist/{chunk-5ZOJLYD2.js → chunk-JE6RZ5L6.js} +4 -4
  180. package/dist/{chunk-GICG3XJK.js → chunk-K44FSPU7.js} +4 -4
  181. package/dist/{chunk-J2RUDZVJ.js → chunk-KARMRTTM.js} +7 -7
  182. package/dist/{chunk-RIAZPGHT.js → chunk-KKVM723A.js} +4 -4
  183. package/dist/{chunk-6QOJEZDH.js → chunk-KYTADPS2.js} +4 -4
  184. package/dist/{chunk-CDYQKIBL.js → chunk-LABIUXDM.js} +2 -2
  185. package/dist/{chunk-4W6AQFMO.js → chunk-LBEZ7A3F.js} +3 -3
  186. package/dist/{chunk-5JRAQ4D5.js → chunk-LTLOZQPP.js} +5 -3
  187. package/dist/chunk-LTLOZQPP.js.map +1 -0
  188. package/dist/chunk-LZRVUOMU.js +12 -0
  189. package/dist/chunk-LZRVUOMU.js.map +1 -0
  190. package/dist/{chunk-ZAPP32GD.js → chunk-M7HYNXCU.js} +2 -2
  191. package/dist/{chunk-QVEQOUQY.js → chunk-MA6ENJDP.js} +3 -3
  192. package/dist/{chunk-D34PZJH3.js → chunk-MBMZNSBP.js} +2 -2
  193. package/dist/{chunk-Z2J4MRTF.js → chunk-MKNW4FRR.js} +4 -4
  194. package/dist/{chunk-NJMAFII4.js → chunk-NDQJDA7O.js} +2 -2
  195. package/dist/{chunk-RCZ4KL2H.js → chunk-NIENIKZ5.js} +2 -2
  196. package/dist/{chunk-6QRN4JK7.js → chunk-NKBCUR4V.js} +2 -2
  197. package/dist/{chunk-2B3NX5HJ.js → chunk-NPSARV2I.js} +6 -6
  198. package/dist/{chunk-YPAH2NWN.js → chunk-NQ6P7O7C.js} +2 -2
  199. package/dist/{chunk-EWVJJ32N.js → chunk-OKYYHBGS.js} +6 -6
  200. package/dist/{chunk-WQ32YFM5.js → chunk-P7VAMJFJ.js} +5 -5
  201. package/dist/{chunk-RX2XP7V5.js → chunk-QBH36OBQ.js} +4 -4
  202. package/dist/{chunk-KYPHR4TT.js → chunk-QWSYHENP.js} +2 -2
  203. package/dist/chunk-RHVJ3L4U.js +14 -0
  204. package/dist/chunk-RHVJ3L4U.js.map +1 -0
  205. package/dist/{chunk-SE5WHKCB.js → chunk-RPKUZDRY.js} +6 -6
  206. package/dist/{chunk-V6SRBQMN.js → chunk-S4JXSC4D.js} +5 -5
  207. package/dist/{chunk-TIM4PXWN.js → chunk-SB2SEGR6.js} +3 -3
  208. package/dist/{chunk-7PTE6HBW.js → chunk-SUXT6QAY.js} +2 -2
  209. package/dist/{chunk-DAT4XWYX.js → chunk-TRYYYWV3.js} +14 -14
  210. package/dist/{chunk-65NYUQXD.js → chunk-TSID4257.js} +9 -9
  211. package/dist/{chunk-DWFUT45A.js → chunk-VEBNL5MG.js} +3 -3
  212. package/dist/{chunk-LVXGCXKB.js → chunk-VMTOLAZ5.js} +7 -7
  213. package/dist/{chunk-BRBQNPM2.js → chunk-VQSBZPKO.js} +3 -3
  214. package/dist/{chunk-ZEVFMQAQ.js → chunk-VWVA74JY.js} +2 -2
  215. package/dist/{chunk-YULI2EBC.js → chunk-XICRCPEQ.js} +4 -4
  216. package/dist/{chunk-Q4WTVAJ5.js → chunk-XLCVMRSO.js} +2 -2
  217. package/dist/{chunk-3DFWHF6O.js → chunk-YRF7WFAQ.js} +6 -6
  218. package/dist/{chunk-ZIHSCBMN.js → chunk-Z5V5E3JW.js} +10 -10
  219. package/dist/{chunk-G3JFESKD.js → chunk-Z5WUSI47.js} +6 -6
  220. package/dist/chunk-ZLMKGVB2.js +21 -0
  221. package/dist/chunk-ZLMKGVB2.js.map +1 -0
  222. package/dist/{chunk-JPYNGWV4.js → chunk-ZOLUUX4B.js} +2 -2
  223. package/dist/data-display/AsyncStateContainer.js +6 -6
  224. package/dist/data-display/Avatar.js +4 -4
  225. package/dist/data-display/CardKit.js +16 -13
  226. package/dist/data-display/Carousel.js +2 -2
  227. package/dist/data-display/Chart.js +11 -11
  228. package/dist/data-display/DataGrid.js +2 -2
  229. package/dist/data-display/DataViews.js +73 -70
  230. package/dist/data-display/EmptyState.js +2 -2
  231. package/dist/data-display/FleetMap.js +14 -14
  232. package/dist/data-display/HoverCard.js +2 -2
  233. package/dist/data-display/InteractiveTooltip.js +2 -2
  234. package/dist/data-display/LazyImage.js +3 -3
  235. package/dist/data-display/Lightbox.js +6 -6
  236. package/dist/data-display/LoadingState.js +3 -3
  237. package/dist/data-display/MapPreview.js +5 -5
  238. package/dist/data-display/Progress.js +2 -2
  239. package/dist/data-display/SectionOnboarding.js +3 -3
  240. package/dist/data-display/Sheet.js +4 -4
  241. package/dist/data-display/StatCard.js +3 -3
  242. package/dist/data-display/Table.js +2 -2
  243. package/dist/feedback/ConfirmAction.js +10 -7
  244. package/dist/feedback/Dialog.js +2 -2
  245. package/dist/feedback/TutorialOverlay.js +2 -2
  246. package/dist/form/AddressAutocomplete.js +8 -8
  247. package/dist/form/Autocomplete.js +1 -1
  248. package/dist/form/Calendar.js +6 -6
  249. package/dist/form/CategorySelect.js +7 -7
  250. package/dist/form/CepField.js +5 -4
  251. package/dist/form/CodeEditor.js +2 -2
  252. package/dist/form/Command.js +2 -2
  253. package/dist/form/DateRangePicker.js +9 -9
  254. package/dist/form/Input/outlined.js +27 -0
  255. package/dist/form/Input/outlined.js.map +1 -0
  256. package/dist/form/Input.js +4 -2
  257. package/dist/form/NumberField.js +5 -3
  258. package/dist/form/PickerSheet.js +2 -2
  259. package/dist/form/total-form.js +21 -17
  260. package/dist/layout/Card.js +2 -2
  261. package/dist/layout/ContentToolbar.js +3 -3
  262. package/dist/layout/ScrollArea.js +3 -3
  263. package/dist/layout/SettingCard.js +7 -7
  264. package/dist/layout/SettingsLayout.js +5 -5
  265. package/dist/layout/Skeleton.js +2 -2
  266. package/dist/locales.js +6 -6
  267. package/dist/navigation/AppHeader.js +9 -9
  268. package/dist/navigation/NavigationMenu.js +5 -5
  269. package/dist/pt-BR.js +6 -6
  270. package/dist/social-login-button.js +3 -3
  271. package/dist/types/components/feedback/ConfirmAction/ConfirmAction.parts.d.ts.map +1 -1
  272. package/dist/types/components/form/CepField/CepField.d.ts.map +1 -1
  273. package/dist/types/components/form/Input/Input.d.ts +9 -3
  274. package/dist/types/components/form/Input/Input.d.ts.map +1 -1
  275. package/dist/types/components/form/Input/Input.factory.d.ts +13 -0
  276. package/dist/types/components/form/Input/Input.factory.d.ts.map +1 -0
  277. package/dist/types/components/form/Input/outlined/index.d.ts +24 -0
  278. package/dist/types/components/form/Input/outlined/index.d.ts.map +1 -0
  279. package/dist/types/components/form/Input/outlined/text-field-slim-outlined.d.ts +10 -0
  280. package/dist/types/components/form/Input/outlined/text-field-slim-outlined.d.ts.map +1 -0
  281. package/dist/types/components/form/Input/text-field-slim.d.ts +8 -40
  282. package/dist/types/components/form/Input/text-field-slim.d.ts.map +1 -1
  283. package/dist/types/components/form/Input/text-field-slim.factory.d.ts +61 -0
  284. package/dist/types/components/form/Input/text-field-slim.factory.d.ts.map +1 -0
  285. package/dist/user-avatar.js +7 -7
  286. package/dist/utility/InfiniteScroll.js +2 -2
  287. package/dist/utility/InstallPrompt.js +2 -2
  288. package/package.json +5 -1
  289. package/src/components/feedback/ConfirmAction/ConfirmAction.parts.tsx +8 -2
  290. package/src/components/form/CepField/CepField.tsx +3 -1
  291. package/src/components/form/Input/Input.factory.tsx +221 -0
  292. package/src/components/form/Input/Input.md +20 -0
  293. package/src/components/form/Input/Input.tsx +9 -196
  294. package/src/components/form/Input/outlined/index.ts +27 -0
  295. package/src/components/form/Input/outlined/text-field-slim-outlined.tsx +13 -0
  296. package/src/components/form/Input/text-field-slim.factory.tsx +248 -0
  297. package/src/components/form/Input/text-field-slim.tsx +9 -209
  298. package/dist/chunk-2ZHF5VE4.js.map +0 -1
  299. package/dist/chunk-5JRAQ4D5.js.map +0 -1
  300. package/dist/chunk-EQK3K65G.js.map +0 -1
  301. package/dist/chunk-SL6454K7.js.map +0 -1
  302. /package/dist/{chunk-GMJBWOIU.js.map → chunk-2ILXXBMG.js.map} +0 -0
  303. /package/dist/{chunk-LVATGJZO.js.map → chunk-2K2Q7VGV.js.map} +0 -0
  304. /package/dist/{chunk-ISW5K72V.js.map → chunk-2ZRZTGWP.js.map} +0 -0
  305. /package/dist/{chunk-BM3MKZL2.js.map → chunk-3BDMYTH6.js.map} +0 -0
  306. /package/dist/{chunk-Q7BGMLCX.js.map → chunk-3FDSXSEP.js.map} +0 -0
  307. /package/dist/{chunk-5WJFCQFN.js.map → chunk-3O2OJW4O.js.map} +0 -0
  308. /package/dist/{chunk-L4FWEI2P.js.map → chunk-3V3Z4EML.js.map} +0 -0
  309. /package/dist/{chunk-7KAZ3B5B.js.map → chunk-3VLVLZ6W.js.map} +0 -0
  310. /package/dist/{chunk-CE74DKHT.js.map → chunk-44PBCQ7E.js.map} +0 -0
  311. /package/dist/{chunk-U5YOOHR6.js.map → chunk-4QGPRORO.js.map} +0 -0
  312. /package/dist/{chunk-W2RXXF7K.js.map → chunk-4XBAEKQQ.js.map} +0 -0
  313. /package/dist/{chunk-7SPFK73H.js.map → chunk-52CLMR47.js.map} +0 -0
  314. /package/dist/{chunk-LYVTJLCF.js.map → chunk-56JF5PZK.js.map} +0 -0
  315. /package/dist/{chunk-QBY3TWV3.js.map → chunk-5HFB4WFE.js.map} +0 -0
  316. /package/dist/{chunk-3DPPDGOF.js.map → chunk-62SXUU5U.js.map} +0 -0
  317. /package/dist/{chunk-QADTI63U.js.map → chunk-6ATXOJVQ.js.map} +0 -0
  318. /package/dist/{chunk-F3AYISXT.js.map → chunk-6PU3JYVY.js.map} +0 -0
  319. /package/dist/{chunk-WVIJFS5Y.js.map → chunk-725H45MT.js.map} +0 -0
  320. /package/dist/{chunk-XP522FFM.js.map → chunk-7JKDB5J5.js.map} +0 -0
  321. /package/dist/{chunk-V45JGJ3W.js.map → chunk-7K23NEZO.js.map} +0 -0
  322. /package/dist/{chunk-EOQ6EKTS.js.map → chunk-7XSCEHGA.js.map} +0 -0
  323. /package/dist/{chunk-7VUXSNVZ.js.map → chunk-A4B27HYU.js.map} +0 -0
  324. /package/dist/{chunk-ADSA76T7.js.map → chunk-AG3DY5TH.js.map} +0 -0
  325. /package/dist/{chunk-G5ORAVSP.js.map → chunk-AJ5LXKLQ.js.map} +0 -0
  326. /package/dist/{chunk-HI7JPDD6.js.map → chunk-AMLHEKSV.js.map} +0 -0
  327. /package/dist/{chunk-XZILNBAU.js.map → chunk-ARVLS57B.js.map} +0 -0
  328. /package/dist/{chunk-ZEH6MGP5.js.map → chunk-BEHM2VLH.js.map} +0 -0
  329. /package/dist/{chunk-EBMWYRXW.js.map → chunk-BEYLI32I.js.map} +0 -0
  330. /package/dist/{chunk-YKKHNYEW.js.map → chunk-BF3SGOWT.js.map} +0 -0
  331. /package/dist/{chunk-MA6SUE7F.js.map → chunk-BGGVYKVZ.js.map} +0 -0
  332. /package/dist/{chunk-E5GYHN4X.js.map → chunk-CAX3NFFE.js.map} +0 -0
  333. /package/dist/{chunk-LIN4A2BW.js.map → chunk-CSD6SWBZ.js.map} +0 -0
  334. /package/dist/{chunk-QK63RXLG.js.map → chunk-CYH5QQUP.js.map} +0 -0
  335. /package/dist/{chunk-CJGSQL77.js.map → chunk-CZV6NVCA.js.map} +0 -0
  336. /package/dist/{chunk-755VS7NA.js.map → chunk-DOWVAC4U.js.map} +0 -0
  337. /package/dist/{chunk-V6OC2PSQ.js.map → chunk-DQ3O252B.js.map} +0 -0
  338. /package/dist/{chunk-PIP7XII2.js.map → chunk-E54XIRY2.js.map} +0 -0
  339. /package/dist/{chunk-YNIOCELQ.js.map → chunk-ERI6JC4M.js.map} +0 -0
  340. /package/dist/{chunk-U57NFQYE.js.map → chunk-FIOBPQL2.js.map} +0 -0
  341. /package/dist/{chunk-6VUVSYP4.js.map → chunk-FR2RJXHS.js.map} +0 -0
  342. /package/dist/{chunk-FWPQUYND.js.map → chunk-FS55MQ4Q.js.map} +0 -0
  343. /package/dist/{chunk-UXVB423Q.js.map → chunk-FVL6U72V.js.map} +0 -0
  344. /package/dist/{chunk-LWZ2K225.js.map → chunk-FXZUVZON.js.map} +0 -0
  345. /package/dist/{chunk-RGR6YKK5.js.map → chunk-GBKIGUNP.js.map} +0 -0
  346. /package/dist/{chunk-YBAK2WN5.js.map → chunk-HBHBRRSW.js.map} +0 -0
  347. /package/dist/{chunk-HNFZLXZI.js.map → chunk-HBP2OU4Q.js.map} +0 -0
  348. /package/dist/{chunk-4MKVGSHX.js.map → chunk-HN3PZTUK.js.map} +0 -0
  349. /package/dist/{chunk-ZOUWHGV3.js.map → chunk-HOJL2GKW.js.map} +0 -0
  350. /package/dist/{chunk-JVOEVTCZ.js.map → chunk-HQCZT6TO.js.map} +0 -0
  351. /package/dist/{chunk-PCM4VEPO.js.map → chunk-HSIUVFXE.js.map} +0 -0
  352. /package/dist/{chunk-L5R2FB4T.js.map → chunk-HVGQH54G.js.map} +0 -0
  353. /package/dist/{chunk-RQF4NXDC.js.map → chunk-IWJTLCTF.js.map} +0 -0
  354. /package/dist/{chunk-IICBAAL7.js.map → chunk-IZ7JTG3Z.js.map} +0 -0
  355. /package/dist/{chunk-2QB4WIU5.js.map → chunk-J5QNJERV.js.map} +0 -0
  356. /package/dist/{chunk-6OLERKNC.js.map → chunk-JA3WJPXH.js.map} +0 -0
  357. /package/dist/{chunk-5ZOJLYD2.js.map → chunk-JE6RZ5L6.js.map} +0 -0
  358. /package/dist/{chunk-GICG3XJK.js.map → chunk-K44FSPU7.js.map} +0 -0
  359. /package/dist/{chunk-J2RUDZVJ.js.map → chunk-KARMRTTM.js.map} +0 -0
  360. /package/dist/{chunk-RIAZPGHT.js.map → chunk-KKVM723A.js.map} +0 -0
  361. /package/dist/{chunk-6QOJEZDH.js.map → chunk-KYTADPS2.js.map} +0 -0
  362. /package/dist/{chunk-CDYQKIBL.js.map → chunk-LABIUXDM.js.map} +0 -0
  363. /package/dist/{chunk-4W6AQFMO.js.map → chunk-LBEZ7A3F.js.map} +0 -0
  364. /package/dist/{chunk-ZAPP32GD.js.map → chunk-M7HYNXCU.js.map} +0 -0
  365. /package/dist/{chunk-QVEQOUQY.js.map → chunk-MA6ENJDP.js.map} +0 -0
  366. /package/dist/{chunk-D34PZJH3.js.map → chunk-MBMZNSBP.js.map} +0 -0
  367. /package/dist/{chunk-Z2J4MRTF.js.map → chunk-MKNW4FRR.js.map} +0 -0
  368. /package/dist/{chunk-NJMAFII4.js.map → chunk-NDQJDA7O.js.map} +0 -0
  369. /package/dist/{chunk-RCZ4KL2H.js.map → chunk-NIENIKZ5.js.map} +0 -0
  370. /package/dist/{chunk-6QRN4JK7.js.map → chunk-NKBCUR4V.js.map} +0 -0
  371. /package/dist/{chunk-2B3NX5HJ.js.map → chunk-NPSARV2I.js.map} +0 -0
  372. /package/dist/{chunk-YPAH2NWN.js.map → chunk-NQ6P7O7C.js.map} +0 -0
  373. /package/dist/{chunk-EWVJJ32N.js.map → chunk-OKYYHBGS.js.map} +0 -0
  374. /package/dist/{chunk-WQ32YFM5.js.map → chunk-P7VAMJFJ.js.map} +0 -0
  375. /package/dist/{chunk-RX2XP7V5.js.map → chunk-QBH36OBQ.js.map} +0 -0
  376. /package/dist/{chunk-KYPHR4TT.js.map → chunk-QWSYHENP.js.map} +0 -0
  377. /package/dist/{chunk-SE5WHKCB.js.map → chunk-RPKUZDRY.js.map} +0 -0
  378. /package/dist/{chunk-V6SRBQMN.js.map → chunk-S4JXSC4D.js.map} +0 -0
  379. /package/dist/{chunk-TIM4PXWN.js.map → chunk-SB2SEGR6.js.map} +0 -0
  380. /package/dist/{chunk-7PTE6HBW.js.map → chunk-SUXT6QAY.js.map} +0 -0
  381. /package/dist/{chunk-DAT4XWYX.js.map → chunk-TRYYYWV3.js.map} +0 -0
  382. /package/dist/{chunk-65NYUQXD.js.map → chunk-TSID4257.js.map} +0 -0
  383. /package/dist/{chunk-DWFUT45A.js.map → chunk-VEBNL5MG.js.map} +0 -0
  384. /package/dist/{chunk-LVXGCXKB.js.map → chunk-VMTOLAZ5.js.map} +0 -0
  385. /package/dist/{chunk-BRBQNPM2.js.map → chunk-VQSBZPKO.js.map} +0 -0
  386. /package/dist/{chunk-ZEVFMQAQ.js.map → chunk-VWVA74JY.js.map} +0 -0
  387. /package/dist/{chunk-YULI2EBC.js.map → chunk-XICRCPEQ.js.map} +0 -0
  388. /package/dist/{chunk-Q4WTVAJ5.js.map → chunk-XLCVMRSO.js.map} +0 -0
  389. /package/dist/{chunk-3DFWHF6O.js.map → chunk-YRF7WFAQ.js.map} +0 -0
  390. /package/dist/{chunk-ZIHSCBMN.js.map → chunk-Z5V5E3JW.js.map} +0 -0
  391. /package/dist/{chunk-G3JFESKD.js.map → chunk-Z5WUSI47.js.map} +0 -0
  392. /package/dist/{chunk-JPYNGWV4.js.map → chunk-ZOLUUX4B.js.map} +0 -0
@@ -1,199 +1,12 @@
1
- import CircularProgress from '@mui/material/CircularProgress/index.js';
2
- import InputAdornment from '@mui/material/InputAdornment/index.js';
3
- import { styled, useTheme } from '@mui/material/styles/index.js';
4
- import React from 'react';
5
-
6
- import { INPUT_LOADING } from './Input.metrics';
7
- import { TextFieldSlim } from './text-field-slim';
8
-
9
- import {
10
- filledStyles,
11
- floatingLabelStyles,
12
- glowStyles,
13
- inputBaseStyles,
14
- inputRadiusStyles,
15
- muiVariantFor,
16
- outlinedStyles,
17
- pulseStyles,
18
- SIZE_MAP,
19
- } from './Input.styles';
20
- import type { InputProps } from './Input.types';
21
- import { splitTestId } from '../../../platform/test-id';
22
- import { fieldControlStyles } from '../../../tokens/field-height';
23
- import { rem } from '../../../tokens/relative';
24
- import type { SizeValue } from '../../../tokens/vocabulary';
25
-
26
- /**
27
- * `TextFieldSlim`, not `TextField` — see `text-field-slim.tsx`. MUI's own
28
- * `TextField` imports `Select` unconditionally, and through it `Menu`,
29
- * `Popover`, `Modal` and seven more component modules, so every screen with one
30
- * text box shipped a dropdown it can never render. Same composition, same DOM,
31
- * same prop routing; the select branch is the only thing missing.
32
- */
33
- const StyledTextField = styled(TextFieldSlim, {
34
- shouldForwardProp: (prop) =>
35
- !['customVariant', 'fieldSize', 'floating', 'glow', 'pulse', 'loading'].includes(prop as string),
36
- })<{
37
- customVariant?: InputProps['variant'];
38
- fieldSize: SizeValue;
39
- floating?: boolean;
40
- glow?: boolean;
41
- pulse?: boolean;
42
- loading?: boolean;
43
- }>(({ theme, customVariant, fieldSize, floating, glow, pulse, loading }) => ({
44
- position: 'relative',
45
- // The theme's field height for this size (outlined family, one line).
46
- ...fieldControlStyles(theme, fieldSize),
47
- opacity: loading ? INPUT_LOADING.opacity : 1,
48
-
49
- ...(glow ? glowStyles(theme) : {}),
50
- ...(pulse ? pulseStyles(theme, fieldSize) : {}),
51
- ...(floating ? floatingLabelStyles(theme) : {}),
52
-
53
- '& .MuiInputBase-root': {
54
- transition: 'all 0.3s ease',
55
- ...inputRadiusStyles(theme, customVariant),
56
- ...inputBaseStyles(theme, customVariant),
57
- },
58
-
59
- '& .MuiOutlinedInput-root': outlinedStyles(theme),
60
- '& .MuiFilledInput-root': filledStyles(theme),
61
- }));
62
-
63
- /** Only one adornment shows at a time: the spinner replaces the caller's while loading. */
64
- const EndAdornment: React.FC<{ loading: boolean; endAdornment?: React.ReactNode }> = ({
65
- loading,
66
- endAdornment,
67
- }) => {
68
- const theme = useTheme();
69
- if (loading) {
70
- return (
71
- <InputAdornment position="end">
72
- <CircularProgress size={rem(theme, INPUT_LOADING.spinnerSize)} />
73
- </InputAdornment>
74
- );
75
- }
76
-
77
- if (!endAdornment) return null;
78
-
79
- return <InputAdornment position="end">{endAdornment}</InputAdornment>;
80
- };
81
-
82
- /** While loading the field is inert: no clicks, and disabled to assistive tech. */
83
- const interactionProps = (
84
- loading: boolean,
85
- onClick: InputProps['onClick'],
86
- disabled?: boolean,
87
- ) => ({
88
- disabled: loading || disabled,
89
- onClick: loading ? undefined : onClick,
90
- });
1
+ import { createInput } from "./Input.factory";
2
+ import type { InputComponent } from "./Input.factory";
3
+ import { TextFieldSlim } from "./text-field-slim";
91
4
 
92
5
  /**
93
- * The ARIA that describes the field has to sit on the `<input>`: the text
94
- * field puts every attribute it does not recognise on its root `FormControl`,
95
- * a `<div>` with no role, where a screen reader never reads it.
96
- *
97
- * `aria-label` has ridden `inputProps` since FUT-755. `aria-describedby` and
98
- * `aria-busy` fell through to the div until FUT-2619, so CepField's input
99
- * pointed at nothing while its lookup status lived in a live region beside it.
100
- *
101
- * `inputProps` are spread onto the `<input>` AFTER the `aria-describedby` MUI
102
- * writes for helper text, so a caller's ids REPLACE the helper text's: MUI's
103
- * `TextField` on its own keeps only one of the two. This joins both, helper
104
- * text first. The helper id is MUI's `<id>-helper-text` (the parity test pins
105
- * that spelling), which is why the field's id is fixed here rather than left
106
- * to the text field.
6
+ * The text input, over `TextFieldSlim` — see `text-field-slim.tsx` for why not
7
+ * MUI's `TextField`, and `Input.factory.tsx` for the body. This entry renders
8
+ * any of the five variants; a control that only ever renders the outlined
9
+ * family can import `@12-apps/ui/form/Input/outlined`, which ships one MUI
10
+ * input instead of three (FUT-1054).
107
11
  */
108
- function inputAriaOf(a: {
109
- id: string;
110
- helperText: React.ReactNode;
111
- label?: string;
112
- describedBy?: string;
113
- busy?: InputProps['aria-busy'];
114
- }): Record<string, unknown> {
115
- const describedBy = [a.helperText ? `${a.id}-helper-text` : undefined, a.describedBy]
116
- .filter(Boolean)
117
- .join(' ');
118
- return {
119
- ...(a.label === undefined ? {} : { 'aria-label': a.label }),
120
- ...(a.describedBy === undefined ? {} : { 'aria-describedby': describedBy }),
121
- ...(a.busy === undefined ? {} : { 'aria-busy': a.busy }),
122
- };
123
- }
124
-
125
- export const Input = React.forwardRef<HTMLInputElement, InputProps>(
126
- (
127
- {
128
- variant = 'outlined',
129
- size = 'md',
130
- label,
131
- error,
132
- helperText,
133
- startAdornment,
134
- endAdornment,
135
- fullWidth = true,
136
- floating = false,
137
- glow = false,
138
- pulse = false,
139
- loading = false,
140
- onClick,
141
- onFocus,
142
- onBlur,
143
- 'aria-label': ariaLabel,
144
- 'aria-describedby': ariaDescribedBy,
145
- 'aria-busy': ariaBusy,
146
- inputProps,
147
- ...rest
148
- },
149
- ref,
150
- ) => {
151
- const { testId: dataTestId, rest: props } = splitTestId(rest);
152
- const generatedId = React.useId();
153
- const id = props.id ?? generatedId;
154
- return (
155
- <StyledTextField
156
- ref={ref}
157
- variant={muiVariantFor(variant)}
158
- customVariant={variant}
159
- fieldSize={size}
160
- floating={floating}
161
- glow={glow}
162
- pulse={pulse}
163
- loading={loading}
164
- label={label}
165
- error={error}
166
- helperText={helperText}
167
- fullWidth={fullWidth}
168
- {...interactionProps(loading, onClick, props.disabled)}
169
- onFocus={onFocus}
170
- onBlur={onBlur}
171
- /*
172
- * `aria-label` has to ride `inputProps` to reach the `<input>` (FUT-755).
173
- * Spread with the rest it lands on the FormControl DIV that the text
174
- * field renders as its root, which carries no role — so the field kept
175
- * no accessible name, and a source grep saying "this input is labelled"
176
- * disagreed with the DOM. The reports search box and the block-title
177
- * inputs were both named in source and anonymous to a screen reader.
178
- * `aria-describedby` and `aria-busy` are the same case: `inputAriaOf`.
179
- */
180
- inputProps={{
181
- 'data-testid': dataTestId,
182
- ...inputProps,
183
- ...inputAriaOf({ id, helperText, label: ariaLabel, describedBy: ariaDescribedBy, busy: ariaBusy }),
184
- }}
185
- InputProps={{
186
- startAdornment: startAdornment && (
187
- <InputAdornment position="start">{startAdornment}</InputAdornment>
188
- ),
189
- endAdornment: <EndAdornment loading={loading} endAdornment={endAdornment} />,
190
- }}
191
- {...SIZE_MAP[size]}
192
- {...props}
193
- id={id}
194
- />
195
- );
196
- },
197
- );
198
-
199
- Input.displayName = 'Input';
12
+ export const Input: InputComponent = createInput(TextFieldSlim);
@@ -0,0 +1,27 @@
1
+ import { createInput } from '../Input.factory';
2
+ import type { InputComponent } from '../Input.factory';
3
+ import type { InputProps as GenericInputProps, InputVariant } from '../Input.types';
4
+ import { OutlinedTextFieldSlim } from './text-field-slim-outlined';
5
+
6
+ /**
7
+ * The house variants MUI draws as `outlined`: `muiVariantFor` maps `glass` and
8
+ * `gradient` onto an outline (`Input.metrics.ts`). `filled` and `underline`
9
+ * need the inputs this entry exists to leave out, so they are a type error here
10
+ * rather than a silent fallback.
11
+ */
12
+ export type OutlinedInputVariant = Extract<InputVariant, 'outlined' | 'glass' | 'gradient'>;
13
+
14
+ export type InputProps = Omit<GenericInputProps, 'variant'> & { variant?: OutlinedInputVariant };
15
+
16
+ /**
17
+ * `@12-apps/ui/form/Input/outlined` — the same `Input`, with the same props,
18
+ * styles and DOM, built on a field that imports `OutlinedInput` and no other
19
+ * MUI input (FUT-1054). For a control that only ever renders the outlined
20
+ * family and sits where its bytes matter: a storefront header, a first screen.
21
+ *
22
+ * Not re-exported from `form/Input` or the `form` barrel: a second `Input`
23
+ * there would collide. Reach it only through this subpath.
24
+ */
25
+ export const Input = createInput(OutlinedTextFieldSlim) as InputComponent<InputProps>;
26
+
27
+ export type { InputSize } from '../Input.types';
@@ -0,0 +1,13 @@
1
+ import OutlinedInput from '@mui/material/OutlinedInput/index.js';
2
+
3
+ import { createTextFieldSlim } from '../text-field-slim.factory';
4
+ import type { TextFieldSlimComponent } from '../text-field-slim.factory';
5
+
6
+ /**
7
+ * `TextFieldSlim` pinned to MUI's outlined input (FUT-1054). The generic field
8
+ * picks its input from a three-way table at runtime, so a bundler has to keep
9
+ * `FilledInput` and `Input` for every caller; this one imports `OutlinedInput`
10
+ * alone. Every variant it can be asked for renders outlined, which is what the
11
+ * outlined `Input` entry ever asks for.
12
+ */
13
+ export const OutlinedTextFieldSlim: TextFieldSlimComponent = createTextFieldSlim(() => OutlinedInput);
@@ -0,0 +1,248 @@
1
+ 'use client';
2
+
3
+ /**
4
+ * `TextFieldSlim`'s body, with the input implementation left to the caller
5
+ * (FUT-1054). Why the field exists at all, and what it transcribes from MUI's
6
+ * `TextField`, is in `text-field-slim.tsx`.
7
+ */
8
+ import FormControl from '@mui/material/FormControl/index.js';
9
+ import FormHelperText from '@mui/material/FormHelperText/index.js';
10
+ import InputLabel from '@mui/material/InputLabel/index.js';
11
+ import { styled } from '@mui/material/styles/index.js';
12
+ import type { FilledInputProps } from '@mui/material/FilledInput/index.js';
13
+ import type { FormControlProps } from '@mui/material/FormControl/index.js';
14
+ import type { FormHelperTextProps } from '@mui/material/FormHelperText/index.js';
15
+ import type { InputProps as MuiInputProps } from '@mui/material/Input/index.js';
16
+ import type { InputBaseComponentProps } from '@mui/material/InputBase/index.js';
17
+ import type { InputLabelProps } from '@mui/material/InputLabel/index.js';
18
+ import type { OutlinedInputProps } from '@mui/material/OutlinedInput/index.js';
19
+ import React from 'react';
20
+
21
+ import { withDefaults } from '../../../utils/withDefaults';
22
+
23
+ /** MUI's three input variants, by the name `TextField` gives them. */
24
+ export type MuiFieldVariant = 'standard' | 'filled' | 'outlined';
25
+
26
+ /**
27
+ * Which input renders a variant. The generic `TextFieldSlim` maps all three;
28
+ * a pinned field maps the one it renders, so the other two are never imported
29
+ * (FUT-1054).
30
+ */
31
+ export type InputForVariant = (variant: MuiFieldVariant) => React.ElementType;
32
+
33
+ /** What `createTextFieldSlim` returns, and what `createInput` composes. */
34
+ export type TextFieldSlimComponent = React.ForwardRefExoticComponent<
35
+ TextFieldSlimProps & React.RefAttributes<HTMLDivElement>
36
+ >;
37
+
38
+ /**
39
+ * `MuiTextField-root`, by hand.
40
+ *
41
+ * `@mui/material` does not re-export `textFieldClasses` from its root barrel,
42
+ * and the deep path that does would import `TextField` — the whole thing this
43
+ * file exists to avoid. So the class name is written out, and the parity test
44
+ * asserts it against a REAL `TextField`'s root rather than against itself.
45
+ *
46
+ * It has to be there at all because it is part of MUI's public surface: two of
47
+ * this package's own suites reach for `.closest('.MuiTextField-root')`, and a
48
+ * consumer's stylesheet may too.
49
+ */
50
+ const TEXT_FIELD_ROOT_CLASS = 'MuiTextField-root';
51
+
52
+ /**
53
+ * Named `MuiTextField` so a theme's `components.MuiTextField.styleOverrides`
54
+ * keeps applying. Nothing in this repo sets one today; a consumer's theme is
55
+ * not this package's to break.
56
+ */
57
+ const TextFieldSlimRoot = styled(FormControl, {
58
+ name: 'MuiTextField',
59
+ slot: 'Root',
60
+ overridesResolver: (_props, styles) => styles.root,
61
+ })({});
62
+
63
+ export interface TextFieldSlimProps
64
+ extends Omit<FormControlProps, 'onChange' | 'onBlur' | 'onFocus' | 'defaultValue'> {
65
+ autoComplete?: string;
66
+ autoFocus?: boolean;
67
+ defaultValue?: unknown;
68
+ helperText?: React.ReactNode;
69
+ label?: React.ReactNode;
70
+ maxRows?: number | string;
71
+ minRows?: number | string;
72
+ multiline?: boolean;
73
+ name?: string;
74
+ placeholder?: string;
75
+ rows?: number | string;
76
+ type?: React.InputHTMLAttributes<HTMLInputElement>['type'];
77
+ value?: unknown;
78
+ inputRef?: React.Ref<unknown>;
79
+ onBlur?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
80
+ onChange?: React.ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
81
+ onFocus?: React.FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;
82
+ /** Props for the rendered input variant. */
83
+ InputProps?: Partial<MuiInputProps & FilledInputProps & OutlinedInputProps>;
84
+ /**
85
+ * Props for the `<input>` itself — where an `aria-label` has to ride.
86
+ *
87
+ * MUI's own type, because it is deliberately open: a caller puts `data-*`
88
+ * and `aria-*` here precisely because the root would swallow them, and
89
+ * `InputHTMLAttributes` alone rejects both.
90
+ */
91
+ inputProps?: InputBaseComponentProps;
92
+ InputLabelProps?: Partial<InputLabelProps>;
93
+ FormHelperTextProps?: Partial<FormHelperTextProps>;
94
+ }
95
+
96
+ /**
97
+ * `TextField`'s own defaults, as a table.
98
+ *
99
+ * One `= default` per destructured prop is one branch per prop, and eight of
100
+ * them put this component over the complexity bar before it rendered anything —
101
+ * which is the same reason `AppHeader` keeps its defaults in a table. The values
102
+ * are `TextField`'s, unchanged; the parity test would fail if any drifted.
103
+ */
104
+ const DEFAULTS: Partial<TextFieldSlimProps> = {
105
+ autoFocus: false,
106
+ color: 'primary',
107
+ disabled: false,
108
+ error: false,
109
+ fullWidth: false,
110
+ multiline: false,
111
+ required: false,
112
+ variant: 'outlined',
113
+ };
114
+
115
+ /** The two ids a labelled, described field needs, and the input's own. */
116
+ function idsOf(props: TextFieldSlimProps, generated: string): {
117
+ id: string;
118
+ helperTextId: string | undefined;
119
+ inputLabelId: string | undefined;
120
+ } {
121
+ const id = props.id ?? generated;
122
+ return {
123
+ id,
124
+ helperTextId: props.helperText && id ? `${id}-helper-text` : undefined,
125
+ inputLabelId: props.label && id ? `${id}-label` : undefined,
126
+ };
127
+ }
128
+
129
+ /**
130
+ * What only the OUTLINED variant needs: it draws its own notch around the
131
+ * label, so it has to be told the label and whether the caller pinned it shrunk
132
+ * (FUT-729's `shrink` case).
133
+ */
134
+ function outlinedPropsOf(props: TextFieldSlimProps): Record<string, unknown> {
135
+ if (props.variant !== 'outlined') return {};
136
+ const shrink = props.InputLabelProps?.shrink;
137
+ return { label: props.label, ...(shrink === undefined ? {} : { notched: shrink }) };
138
+ }
139
+
140
+ interface FieldIds {
141
+ id: string;
142
+ helperTextId: string | undefined;
143
+ inputLabelId: string | undefined;
144
+ }
145
+
146
+ /**
147
+ * Everything the input (or this component) consumes by name.
148
+ *
149
+ * A key LIST rather than the omit-by-destructuring idiom, which would name
150
+ * twenty-four bindings only to leave every one of them unused — twenty-four
151
+ * lint warnings, in a package that allows none.
152
+ *
153
+ * `fullWidth`, `disabled`, `error`, `required`, `color` and `variant` are
154
+ * deliberately absent: `TextField` hands those to the root, and `fullWidth` to
155
+ * both.
156
+ */
157
+ const CONSUMED_BY_FIELD: ReadonlySet<string> = new Set([
158
+ 'autoComplete', 'autoFocus', 'children', 'className', 'defaultValue',
159
+ 'FormHelperTextProps', 'helperText', 'id', 'InputLabelProps', 'inputProps',
160
+ 'InputProps', 'inputRef', 'label', 'maxRows', 'minRows', 'multiline', 'name',
161
+ 'onBlur', 'onChange', 'onFocus', 'placeholder', 'rows', 'type', 'value',
162
+ ]);
163
+
164
+ /**
165
+ * What the ROOT `FormControl` gets: the props `TextField` hands it by name,
166
+ * plus everything it did not recognise.
167
+ *
168
+ * That second half is `TextField`'s behaviour and not a choice made here: an
169
+ * unrecognised HTML attribute lands on the root `div`, which is why `Input` has
170
+ * to route `aria-label` through `inputProps`. The parity test pins it.
171
+ */
172
+ function rootPropsOf(props: TextFieldSlimProps): Record<string, unknown> {
173
+ return Object.fromEntries(
174
+ Object.entries(props).filter(([key]) => !CONSUMED_BY_FIELD.has(key)),
175
+ );
176
+ }
177
+
178
+ /** What the INPUT gets, by name, exactly as `TextField` names them. */
179
+ function fieldPropsOf(props: TextFieldSlimProps, ids: FieldIds): Record<string, unknown> {
180
+ return {
181
+ 'aria-describedby': ids.helperTextId,
182
+ autoComplete: props.autoComplete,
183
+ autoFocus: props.autoFocus,
184
+ defaultValue: props.defaultValue,
185
+ fullWidth: props.fullWidth,
186
+ multiline: props.multiline,
187
+ name: props.name,
188
+ rows: props.rows,
189
+ maxRows: props.maxRows,
190
+ minRows: props.minRows,
191
+ type: props.type,
192
+ value: props.value,
193
+ id: ids.id,
194
+ inputRef: props.inputRef,
195
+ onBlur: props.onBlur,
196
+ onChange: props.onChange,
197
+ onFocus: props.onFocus,
198
+ placeholder: props.placeholder,
199
+ inputProps: props.inputProps,
200
+ ...outlinedPropsOf(props),
201
+ ...props.InputProps,
202
+ };
203
+ }
204
+
205
+ /**
206
+ * The field, with the input implementation chosen by `inputFor`.
207
+ *
208
+ * A factory rather than a component so the variant table lives in the CALLER's
209
+ * module: this module imports none of `Input`, `FilledInput` or
210
+ * `OutlinedInput`, so what `inputFor` returns is the only input a caller's
211
+ * bundle keeps. The caller's own module-scope `createTextFieldSlim(...)` call
212
+ * is kept by the bundler, and with it every module its argument reaches
213
+ * (FUT-3402), so that argument must name only the variants it serves.
214
+ */
215
+ export function createTextFieldSlim(inputFor: InputForVariant): TextFieldSlimComponent {
216
+ return React.forwardRef<HTMLDivElement, TextFieldSlimProps>(
217
+ function TextFieldSlim(rawProps, ref) {
218
+ const props = withDefaults(rawProps, DEFAULTS);
219
+ // `TextField` uses `@mui/utils`'s `useId`, which is React's with a fallback
220
+ // for React 17. The peer here is React 19, so React's own is the same thing
221
+ // without the dependency. The override still wins, exactly as it did — and
222
+ // it is read from the RAW props, before `withDefaults` could supply one.
223
+ const ids = idsOf(rawProps, React.useId());
224
+ const InputComponent = inputFor(props.variant ?? 'outlined');
225
+ const { label, helperText } = props;
226
+
227
+ return (
228
+ <TextFieldSlimRoot
229
+ className={[TEXT_FIELD_ROOT_CLASS, props.className].filter(Boolean).join(' ')}
230
+ ref={ref}
231
+ {...rootPropsOf(props)}
232
+ >
233
+ {label !== null && label !== undefined && label !== '' ? (
234
+ <InputLabel htmlFor={ids.id} id={ids.inputLabelId} {...props.InputLabelProps}>
235
+ {label}
236
+ </InputLabel>
237
+ ) : null}
238
+ <InputComponent {...fieldPropsOf(props, ids)} />
239
+ {helperText ? (
240
+ <FormHelperText id={ids.helperTextId} {...props.FormHelperTextProps}>
241
+ {helperText}
242
+ </FormHelperText>
243
+ ) : null}
244
+ </TextFieldSlimRoot>
245
+ );
246
+ },
247
+ );
248
+ }