@portnet/ui 6.0.2 → 6.0.3

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 (980) hide show
  1. package/CHANGELOG.md +652 -0
  2. package/dist/esm/index.js +72 -3
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
  5. package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
  6. package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
  7. package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
  8. package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
  9. package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
  10. package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
  11. package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
  12. package/dist/esm/v2/__tests__/FieldError.test.js +71 -38
  13. package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
  14. package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
  15. package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
  16. package/dist/esm/v2/__tests__/FieldWidth.test.js +11 -11
  17. package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -1
  18. package/dist/esm/v2/__tests__/FileCard.test.js +18 -17
  19. package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
  20. package/dist/esm/v2/__tests__/FormikCheckbox.test.js +87 -179
  21. package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -1
  22. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +32 -44
  23. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
  24. package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
  25. package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
  26. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +118 -199
  27. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
  28. package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -42
  29. package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
  30. package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
  31. package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
  32. package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
  33. package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
  34. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
  35. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  36. package/dist/esm/v2/__tests__/apiError.test.js +50 -69
  37. package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
  38. package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
  39. package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
  40. package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
  41. package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
  42. package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
  43. package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
  44. package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
  45. package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
  46. package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
  47. package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
  48. package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
  49. package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
  50. package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
  51. package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
  52. package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
  53. package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
  54. package/dist/esm/v2/__tests__/labels-merge.test.js +17 -21
  55. package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
  56. package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
  57. package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
  58. package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
  59. package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
  60. package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
  61. package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
  62. package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
  63. package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
  64. package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
  65. package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
  66. package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
  67. package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
  68. package/dist/esm/v2/components/Accordion.js +48 -70
  69. package/dist/esm/v2/components/Accordion.js.map +1 -1
  70. package/dist/esm/v2/components/ActionStrip.js +31 -43
  71. package/dist/esm/v2/components/ActionStrip.js.map +1 -1
  72. package/dist/esm/v2/components/Banner.js +25 -22
  73. package/dist/esm/v2/components/Banner.js.map +1 -1
  74. package/dist/esm/v2/components/Busy.js +14 -19
  75. package/dist/esm/v2/components/Busy.js.map +1 -1
  76. package/dist/esm/v2/components/Button.js +34 -45
  77. package/dist/esm/v2/components/Button.js.map +1 -1
  78. package/dist/esm/v2/components/CategoryTag.js +44 -27
  79. package/dist/esm/v2/components/CategoryTag.js.map +1 -1
  80. package/dist/esm/v2/components/Checkbox.js +32 -38
  81. package/dist/esm/v2/components/Checkbox.js.map +1 -1
  82. package/dist/esm/v2/components/Chip.js +23 -36
  83. package/dist/esm/v2/components/Chip.js.map +1 -1
  84. package/dist/esm/v2/components/Combobox.js +112 -136
  85. package/dist/esm/v2/components/Combobox.js.map +1 -1
  86. package/dist/esm/v2/components/CommandPalette.js +113 -198
  87. package/dist/esm/v2/components/CommandPalette.js.map +1 -1
  88. package/dist/esm/v2/components/ConfirmDialog.js +36 -45
  89. package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
  90. package/dist/esm/v2/components/DatePicker.js +78 -81
  91. package/dist/esm/v2/components/DatePicker.js.map +1 -1
  92. package/dist/esm/v2/components/DateRangePicker.js +63 -74
  93. package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
  94. package/dist/esm/v2/components/DateTimePicker.js +81 -86
  95. package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
  96. package/dist/esm/v2/components/Drawer.js +71 -65
  97. package/dist/esm/v2/components/Drawer.js.map +1 -1
  98. package/dist/esm/v2/components/Dropzone.js +130 -177
  99. package/dist/esm/v2/components/Dropzone.js.map +1 -1
  100. package/dist/esm/v2/components/EmptyState.js +9 -9
  101. package/dist/esm/v2/components/EmptyState.js.map +1 -1
  102. package/dist/esm/v2/components/FavoriteToggle.js +24 -33
  103. package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
  104. package/dist/esm/v2/components/Field.js +155 -59
  105. package/dist/esm/v2/components/Field.js.map +1 -1
  106. package/dist/esm/v2/components/FieldError.js +9 -13
  107. package/dist/esm/v2/components/FieldError.js.map +1 -1
  108. package/dist/esm/v2/components/FieldHelp.js +28 -49
  109. package/dist/esm/v2/components/FieldHelp.js.map +1 -1
  110. package/dist/esm/v2/components/FileCard.js +14 -19
  111. package/dist/esm/v2/components/FileCard.js.map +1 -1
  112. package/dist/esm/v2/components/FilterTab.js +22 -31
  113. package/dist/esm/v2/components/FilterTab.js.map +1 -1
  114. package/dist/esm/v2/components/ForbiddenPage.js +28 -8
  115. package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
  116. package/dist/esm/v2/components/FormGrid.js +48 -54
  117. package/dist/esm/v2/components/FormGrid.js.map +1 -1
  118. package/dist/esm/v2/components/FormikDisplay.js +98 -24
  119. package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
  120. package/dist/esm/v2/components/Input.js +75 -34
  121. package/dist/esm/v2/components/Input.js.map +1 -1
  122. package/dist/esm/v2/components/KPICard.js +42 -51
  123. package/dist/esm/v2/components/KPICard.js.map +1 -1
  124. package/dist/esm/v2/components/KPIStrip.js +9 -15
  125. package/dist/esm/v2/components/KPIStrip.js.map +1 -1
  126. package/dist/esm/v2/components/KV.js +16 -23
  127. package/dist/esm/v2/components/KV.js.map +1 -1
  128. package/dist/esm/v2/components/KVGrid.js +15 -23
  129. package/dist/esm/v2/components/KVGrid.js.map +1 -1
  130. package/dist/esm/v2/components/Layout.js +81 -117
  131. package/dist/esm/v2/components/Layout.js.map +1 -1
  132. package/dist/esm/v2/components/MobileRowCard.js +64 -75
  133. package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
  134. package/dist/esm/v2/components/Modal.js +44 -53
  135. package/dist/esm/v2/components/Modal.js.map +1 -1
  136. package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
  137. package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
  138. package/dist/esm/v2/components/NotFoundPage.js +28 -9
  139. package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
  140. package/dist/esm/v2/components/NumberInput.js +77 -107
  141. package/dist/esm/v2/components/NumberInput.js.map +1 -1
  142. package/dist/esm/v2/components/OverflowMenu.js +24 -42
  143. package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
  144. package/dist/esm/v2/components/PdfViewer.js +24 -33
  145. package/dist/esm/v2/components/PdfViewer.js.map +1 -1
  146. package/dist/esm/v2/components/ProgressBar.js +28 -36
  147. package/dist/esm/v2/components/ProgressBar.js.map +1 -1
  148. package/dist/esm/v2/components/Radio.js +49 -57
  149. package/dist/esm/v2/components/Radio.js.map +1 -1
  150. package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
  151. package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
  152. package/dist/esm/v2/components/SectionHeader.js +24 -31
  153. package/dist/esm/v2/components/SectionHeader.js.map +1 -1
  154. package/dist/esm/v2/components/Segmented.js +59 -84
  155. package/dist/esm/v2/components/Segmented.js.map +1 -1
  156. package/dist/esm/v2/components/Select.js +100 -138
  157. package/dist/esm/v2/components/Select.js.map +1 -1
  158. package/dist/esm/v2/components/ServerErrorPage.js +27 -10
  159. package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
  160. package/dist/esm/v2/components/Skeleton.js +81 -96
  161. package/dist/esm/v2/components/Skeleton.js.map +1 -1
  162. package/dist/esm/v2/components/SkipLink.js +6 -7
  163. package/dist/esm/v2/components/SkipLink.js.map +1 -1
  164. package/dist/esm/v2/components/Spinner.js +13 -22
  165. package/dist/esm/v2/components/Spinner.js.map +1 -1
  166. package/dist/esm/v2/components/Status.js +14 -25
  167. package/dist/esm/v2/components/Status.js.map +1 -1
  168. package/dist/esm/v2/components/Stepper.js +68 -71
  169. package/dist/esm/v2/components/Stepper.js.map +1 -1
  170. package/dist/esm/v2/components/Surface.js +25 -44
  171. package/dist/esm/v2/components/Surface.js.map +1 -1
  172. package/dist/esm/v2/components/Switch.js +21 -29
  173. package/dist/esm/v2/components/Switch.js.map +1 -1
  174. package/dist/esm/v2/components/TabPanel.js +84 -0
  175. package/dist/esm/v2/components/TabPanel.js.map +1 -0
  176. package/dist/esm/v2/components/Tabs.js +43 -19
  177. package/dist/esm/v2/components/Tabs.js.map +1 -1
  178. package/dist/esm/v2/components/TelInput.js +75 -108
  179. package/dist/esm/v2/components/TelInput.js.map +1 -1
  180. package/dist/esm/v2/components/Textarea.js +21 -30
  181. package/dist/esm/v2/components/Textarea.js.map +1 -1
  182. package/dist/esm/v2/components/TimePicker.js +59 -69
  183. package/dist/esm/v2/components/TimePicker.js.map +1 -1
  184. package/dist/esm/v2/components/Toast.js +109 -163
  185. package/dist/esm/v2/components/Toast.js.map +1 -1
  186. package/dist/esm/v2/components/Tooltip.js +18 -31
  187. package/dist/esm/v2/components/Tooltip.js.map +1 -1
  188. package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
  189. package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
  190. package/dist/esm/v2/components/_pickerShared.js +2 -2
  191. package/dist/esm/v2/components/_pickerShared.js.map +1 -1
  192. package/dist/esm/v2/components/index.js +37 -0
  193. package/dist/esm/v2/components/index.js.map +1 -1
  194. package/dist/esm/v2/hooks/index.js +62 -0
  195. package/dist/esm/v2/hooks/index.js.map +1 -1
  196. package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
  197. package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
  198. package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
  199. package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
  200. package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
  201. package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
  202. package/dist/esm/v2/hooks/useDensity.js +13 -17
  203. package/dist/esm/v2/hooks/useDensity.js.map +1 -1
  204. package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
  205. package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
  206. package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
  207. package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
  208. package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
  209. package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
  210. package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
  211. package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
  212. package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
  213. package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
  214. package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
  215. package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
  216. package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
  217. package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
  218. package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
  219. package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
  220. package/dist/esm/v2/hooks/useSortedRows.js +3 -5
  221. package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
  222. package/dist/esm/v2/hooks/useTabLoading.js +6 -21
  223. package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
  224. package/dist/esm/v2/index.js +2 -3
  225. package/dist/esm/v2/index.js.map +1 -1
  226. package/dist/esm/v2/modalContext.js +2 -2
  227. package/dist/esm/v2/modalContext.js.map +1 -1
  228. package/dist/esm/v2/models/favorite.js.map +1 -1
  229. package/dist/esm/v2/models/personalization.js.map +1 -1
  230. package/dist/esm/v2/models/referentiel.js.map +1 -1
  231. package/dist/esm/v2/models/savedFilter.js.map +1 -1
  232. package/dist/esm/v2/patterns/ActionBar.js +115 -159
  233. package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
  234. package/dist/esm/v2/patterns/AppMain.js +108 -0
  235. package/dist/esm/v2/patterns/AppMain.js.map +1 -0
  236. package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
  237. package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
  238. package/dist/esm/v2/patterns/ChartFigure.js +151 -0
  239. package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
  240. package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
  241. package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  242. package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
  243. package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
  244. package/dist/esm/v2/patterns/DataGrid.js +221 -255
  245. package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
  246. package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
  247. package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  248. package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
  249. package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
  250. package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
  251. package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
  252. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
  253. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  254. package/dist/esm/v2/patterns/DetailSplit.js +108 -0
  255. package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
  256. package/dist/esm/v2/patterns/FavoriteColumn.js +15 -17
  257. package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
  258. package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
  259. package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
  260. package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
  261. package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
  262. package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
  263. package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
  264. package/dist/esm/v2/patterns/FormPageShell.js +43 -41
  265. package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
  266. package/dist/esm/v2/patterns/FormSection.js +30 -38
  267. package/dist/esm/v2/patterns/FormSection.js.map +1 -1
  268. package/dist/esm/v2/patterns/FormikCheckbox.js +29 -39
  269. package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -1
  270. package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
  271. package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  272. package/dist/esm/v2/patterns/FormikCombobox.js +51 -69
  273. package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
  274. package/dist/esm/v2/patterns/FormikDatePicker.js +44 -58
  275. package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
  276. package/dist/esm/v2/patterns/FormikDateTimePicker.js +44 -58
  277. package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -1
  278. package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
  279. package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
  280. package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
  281. package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
  282. package/dist/esm/v2/patterns/FormikFile.js +94 -78
  283. package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
  284. package/dist/esm/v2/patterns/FormikInput.js +40 -53
  285. package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
  286. package/dist/esm/v2/patterns/FormikRadioGroup.js +39 -51
  287. package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -1
  288. package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
  289. package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
  290. package/dist/esm/v2/patterns/FormikSelect.js +64 -87
  291. package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
  292. package/dist/esm/v2/patterns/FormikTextarea.js +30 -46
  293. package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
  294. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +53 -71
  295. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  296. package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
  297. package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
  298. package/dist/esm/v2/patterns/PageContent.js +10 -14
  299. package/dist/esm/v2/patterns/PageContent.js.map +1 -1
  300. package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
  301. package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
  302. package/dist/esm/v2/patterns/ReferentielField.js +327 -312
  303. package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
  304. package/dist/esm/v2/patterns/RowFavoriteToggle.js +27 -22
  305. package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -1
  306. package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
  307. package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
  308. package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
  309. package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
  310. package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
  311. package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
  312. package/dist/esm/v2/patterns/SortableHeader.js +22 -45
  313. package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
  314. package/dist/esm/v2/patterns/Tour.js +94 -120
  315. package/dist/esm/v2/patterns/Tour.js.map +1 -1
  316. package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
  317. package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
  318. package/dist/esm/v2/patterns/_pickerSerialisation.js +6 -8
  319. package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -1
  320. package/dist/esm/v2/patterns/_sort.js +17 -33
  321. package/dist/esm/v2/patterns/_sort.js.map +1 -1
  322. package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
  323. package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
  324. package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
  325. package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
  326. package/dist/esm/v2/patterns/filterCriteria.js +102 -0
  327. package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
  328. package/dist/esm/v2/patterns/index.js +152 -0
  329. package/dist/esm/v2/patterns/index.js.map +1 -1
  330. package/dist/esm/v2/patterns/rowActions.js +223 -0
  331. package/dist/esm/v2/patterns/rowActions.js.map +1 -0
  332. package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
  333. package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
  334. package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
  335. package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
  336. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
  337. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  338. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
  339. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  340. package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
  341. package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
  342. package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
  343. package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
  344. package/dist/esm/v2/personalization/capabilities/gridPreferences.js +28 -34
  345. package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -1
  346. package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
  347. package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
  348. package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
  349. package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
  350. package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
  351. package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
  352. package/dist/esm/v2/personalization/index.js +17 -0
  353. package/dist/esm/v2/personalization/index.js.map +1 -1
  354. package/dist/esm/v2/personalization/personalizationContext.js +9 -9
  355. package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
  356. package/dist/esm/v2/personalization/schema.js +8 -9
  357. package/dist/esm/v2/personalization/schema.js.map +1 -1
  358. package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
  359. package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
  360. package/dist/esm/v2/referentiel/types.js +2 -0
  361. package/dist/esm/v2/referentiel/types.js.map +1 -0
  362. package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
  363. package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
  364. package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
  365. package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
  366. package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
  367. package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
  368. package/dist/esm/v2/theme/_brand.js +8 -24
  369. package/dist/esm/v2/theme/_brand.js.map +1 -1
  370. package/dist/esm/v2/theme/_brandSecondary.js +8 -24
  371. package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
  372. package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
  373. package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
  374. package/dist/esm/v2/theme/cssVariables.js +62 -69
  375. package/dist/esm/v2/theme/cssVariables.js.map +1 -1
  376. package/dist/esm/v2/theme/index.js +5 -5
  377. package/dist/esm/v2/theme/index.js.map +1 -1
  378. package/dist/esm/v2/tokens/breakpoints.js +14 -14
  379. package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
  380. package/dist/esm/v2/tokens/chart.js +261 -0
  381. package/dist/esm/v2/tokens/chart.js.map +1 -0
  382. package/dist/esm/v2/tokens/colors.js +22 -22
  383. package/dist/esm/v2/tokens/colors.js.map +1 -1
  384. package/dist/esm/v2/tokens/density.js +62 -7
  385. package/dist/esm/v2/tokens/density.js.map +1 -1
  386. package/dist/esm/v2/tokens/index.js +49 -34
  387. package/dist/esm/v2/tokens/index.js.map +1 -1
  388. package/dist/esm/v2/tokens/motion.js +12 -20
  389. package/dist/esm/v2/tokens/motion.js.map +1 -1
  390. package/dist/esm/v2/tokens/radius.js +1 -1
  391. package/dist/esm/v2/tokens/radius.js.map +1 -1
  392. package/dist/esm/v2/tokens/shadows.js +6 -6
  393. package/dist/esm/v2/tokens/shadows.js.map +1 -1
  394. package/dist/esm/v2/tokens/spacing.js +2 -2
  395. package/dist/esm/v2/tokens/spacing.js.map +1 -1
  396. package/dist/esm/v2/tokens/state.js +1 -1
  397. package/dist/esm/v2/tokens/state.js.map +1 -1
  398. package/dist/esm/v2/tokens/statusPalette.js +17 -21
  399. package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
  400. package/dist/esm/v2/tokens/tokens.json +6 -1
  401. package/dist/esm/v2/tokens/typography.js +13 -13
  402. package/dist/esm/v2/tokens/typography.js.map +1 -1
  403. package/dist/esm/v2/tokens/zIndex.js +1 -1
  404. package/dist/esm/v2/tokens/zIndex.js.map +1 -1
  405. package/dist/esm/v2/types/datagrid.js.map +1 -1
  406. package/dist/esm/v2/utils/apiError.js +16 -37
  407. package/dist/esm/v2/utils/apiError.js.map +1 -1
  408. package/dist/esm/v2/utils/contrast.js +31 -32
  409. package/dist/esm/v2/utils/contrast.js.map +1 -1
  410. package/dist/esm/v2/utils/cx.js +5 -25
  411. package/dist/esm/v2/utils/cx.js.map +1 -1
  412. package/dist/esm/v2/utils/fileDownload.js +23 -26
  413. package/dist/esm/v2/utils/fileDownload.js.map +1 -1
  414. package/dist/esm/v2/utils/fileValidation.js +209 -0
  415. package/dist/esm/v2/utils/fileValidation.js.map +1 -0
  416. package/dist/esm/v2/utils/fmtDate.js +111 -0
  417. package/dist/esm/v2/utils/fmtDate.js.map +1 -0
  418. package/dist/esm/v2/utils/fmtMoney.js +8 -10
  419. package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
  420. package/dist/esm/v2/utils/formikErrors.js +78 -0
  421. package/dist/esm/v2/utils/formikErrors.js.map +1 -0
  422. package/dist/esm/v2/utils/index.js +35 -2
  423. package/dist/esm/v2/utils/index.js.map +1 -1
  424. package/dist/esm/v2/utils/mergeLabels.js +7 -12
  425. package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
  426. package/dist/esm/v2/utils/networkStatus.js +12 -12
  427. package/dist/esm/v2/utils/networkStatus.js.map +1 -1
  428. package/dist/index.d.ts +7 -1
  429. package/dist/index.d.ts.map +1 -1
  430. package/dist/index.js +110 -49
  431. package/dist/index.js.map +1 -1
  432. package/dist/v2/__tests__/AppMain.test.js +133 -0
  433. package/dist/v2/__tests__/AppMain.test.js.map +1 -0
  434. package/dist/v2/__tests__/ChartFigure.test.js +183 -0
  435. package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
  436. package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
  437. package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
  438. package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
  439. package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
  440. package/dist/v2/__tests__/FieldError.test.js +82 -49
  441. package/dist/v2/__tests__/FieldError.test.js.map +1 -1
  442. package/dist/v2/__tests__/FieldNaming.test.js +161 -0
  443. package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
  444. package/dist/v2/__tests__/FieldWidth.test.js +23 -25
  445. package/dist/v2/__tests__/FieldWidth.test.js.map +1 -1
  446. package/dist/v2/__tests__/FileCard.test.js +29 -28
  447. package/dist/v2/__tests__/FileCard.test.js.map +1 -1
  448. package/dist/v2/__tests__/FormikCheckbox.test.js +90 -183
  449. package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -1
  450. package/dist/v2/__tests__/FormikDateTimePicker.test.js +38 -48
  451. package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
  452. package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
  453. package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
  454. package/dist/v2/__tests__/FormikRadioGroup.test.js +123 -204
  455. package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
  456. package/dist/v2/__tests__/MobileRowCard.test.js +63 -61
  457. package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
  458. package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
  459. package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
  460. package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
  461. package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
  462. package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
  463. package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  464. package/dist/v2/__tests__/apiError.test.js +50 -69
  465. package/dist/v2/__tests__/apiError.test.js.map +1 -1
  466. package/dist/v2/__tests__/banned-patterns.test.js +42 -123
  467. package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
  468. package/dist/v2/__tests__/chart-palette.test.js +205 -0
  469. package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
  470. package/dist/v2/__tests__/contrast-palette.test.js +42 -74
  471. package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
  472. package/dist/v2/__tests__/cssVariables.test.js +44 -51
  473. package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
  474. package/dist/v2/__tests__/fileValidation.test.js +136 -0
  475. package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
  476. package/dist/v2/__tests__/filterCriteria.test.js +324 -0
  477. package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
  478. package/dist/v2/__tests__/fmtDate.test.js +69 -0
  479. package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
  480. package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
  481. package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
  482. package/dist/v2/__tests__/labels-merge.test.js +23 -27
  483. package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
  484. package/dist/v2/__tests__/locale-fallback.test.js +47 -52
  485. package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
  486. package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
  487. package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
  488. package/dist/v2/__tests__/rowActions.test.js +186 -0
  489. package/dist/v2/__tests__/rowActions.test.js.map +1 -0
  490. package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
  491. package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
  492. package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
  493. package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
  494. package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
  495. package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
  496. package/dist/v2/components/Accordion.js +60 -82
  497. package/dist/v2/components/Accordion.js.map +1 -1
  498. package/dist/v2/components/ActionStrip.js +40 -52
  499. package/dist/v2/components/ActionStrip.js.map +1 -1
  500. package/dist/v2/components/Banner.js +42 -41
  501. package/dist/v2/components/Banner.js.map +1 -1
  502. package/dist/v2/components/Busy.js +22 -27
  503. package/dist/v2/components/Busy.js.map +1 -1
  504. package/dist/v2/components/Button.js +39 -50
  505. package/dist/v2/components/Button.js.map +1 -1
  506. package/dist/v2/components/CategoryTag.d.ts.map +1 -1
  507. package/dist/v2/components/CategoryTag.js +49 -32
  508. package/dist/v2/components/CategoryTag.js.map +1 -1
  509. package/dist/v2/components/Checkbox.js +39 -45
  510. package/dist/v2/components/Checkbox.js.map +1 -1
  511. package/dist/v2/components/Chip.js +29 -42
  512. package/dist/v2/components/Chip.js.map +1 -1
  513. package/dist/v2/components/Combobox.js +122 -144
  514. package/dist/v2/components/Combobox.js.map +1 -1
  515. package/dist/v2/components/CommandPalette.js +138 -225
  516. package/dist/v2/components/CommandPalette.js.map +1 -1
  517. package/dist/v2/components/ConfirmDialog.js +46 -56
  518. package/dist/v2/components/ConfirmDialog.js.map +1 -1
  519. package/dist/v2/components/DatePicker.js +81 -86
  520. package/dist/v2/components/DatePicker.js.map +1 -1
  521. package/dist/v2/components/DateRangePicker.js +77 -87
  522. package/dist/v2/components/DateRangePicker.js.map +1 -1
  523. package/dist/v2/components/DateTimePicker.js +84 -91
  524. package/dist/v2/components/DateTimePicker.js.map +1 -1
  525. package/dist/v2/components/Drawer.d.ts.map +1 -1
  526. package/dist/v2/components/Drawer.js +93 -88
  527. package/dist/v2/components/Drawer.js.map +1 -1
  528. package/dist/v2/components/Dropzone.js +150 -196
  529. package/dist/v2/components/Dropzone.js.map +1 -1
  530. package/dist/v2/components/EmptyState.js +18 -20
  531. package/dist/v2/components/EmptyState.js.map +1 -1
  532. package/dist/v2/components/FavoriteToggle.js +28 -39
  533. package/dist/v2/components/FavoriteToggle.js.map +1 -1
  534. package/dist/v2/components/Field.d.ts +62 -4
  535. package/dist/v2/components/Field.d.ts.map +1 -1
  536. package/dist/v2/components/Field.js +169 -70
  537. package/dist/v2/components/Field.js.map +1 -1
  538. package/dist/v2/components/FieldError.js +18 -21
  539. package/dist/v2/components/FieldError.js.map +1 -1
  540. package/dist/v2/components/FieldHelp.js +40 -60
  541. package/dist/v2/components/FieldHelp.js.map +1 -1
  542. package/dist/v2/components/FileCard.js +27 -31
  543. package/dist/v2/components/FileCard.js.map +1 -1
  544. package/dist/v2/components/FilterTab.js +30 -38
  545. package/dist/v2/components/FilterTab.js.map +1 -1
  546. package/dist/v2/components/ForbiddenPage.d.ts +25 -1
  547. package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
  548. package/dist/v2/components/ForbiddenPage.js +37 -17
  549. package/dist/v2/components/ForbiddenPage.js.map +1 -1
  550. package/dist/v2/components/FormGrid.js +53 -59
  551. package/dist/v2/components/FormGrid.js.map +1 -1
  552. package/dist/v2/components/FormikDisplay.d.ts +50 -1
  553. package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
  554. package/dist/v2/components/FormikDisplay.js +108 -33
  555. package/dist/v2/components/FormikDisplay.js.map +1 -1
  556. package/dist/v2/components/Input.d.ts +40 -0
  557. package/dist/v2/components/Input.d.ts.map +1 -1
  558. package/dist/v2/components/Input.js +81 -41
  559. package/dist/v2/components/Input.js.map +1 -1
  560. package/dist/v2/components/KPICard.js +57 -67
  561. package/dist/v2/components/KPICard.js.map +1 -1
  562. package/dist/v2/components/KPIStrip.js +16 -22
  563. package/dist/v2/components/KPIStrip.js.map +1 -1
  564. package/dist/v2/components/KV.js +25 -31
  565. package/dist/v2/components/KV.js.map +1 -1
  566. package/dist/v2/components/KVGrid.js +19 -26
  567. package/dist/v2/components/KVGrid.js.map +1 -1
  568. package/dist/v2/components/Layout.js +91 -120
  569. package/dist/v2/components/Layout.js.map +1 -1
  570. package/dist/v2/components/MobileRowCard.js +79 -91
  571. package/dist/v2/components/MobileRowCard.js.map +1 -1
  572. package/dist/v2/components/Modal.js +61 -69
  573. package/dist/v2/components/Modal.js.map +1 -1
  574. package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
  575. package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
  576. package/dist/v2/components/NetworkErrorPage.js +38 -21
  577. package/dist/v2/components/NetworkErrorPage.js.map +1 -1
  578. package/dist/v2/components/NotFoundPage.d.ts +17 -1
  579. package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
  580. package/dist/v2/components/NotFoundPage.js +37 -18
  581. package/dist/v2/components/NotFoundPage.js.map +1 -1
  582. package/dist/v2/components/NumberInput.js +88 -118
  583. package/dist/v2/components/NumberInput.js.map +1 -1
  584. package/dist/v2/components/OverflowMenu.js +38 -56
  585. package/dist/v2/components/OverflowMenu.js.map +1 -1
  586. package/dist/v2/components/PdfViewer.js +34 -45
  587. package/dist/v2/components/PdfViewer.js.map +1 -1
  588. package/dist/v2/components/ProgressBar.js +42 -49
  589. package/dist/v2/components/ProgressBar.js.map +1 -1
  590. package/dist/v2/components/Radio.js +59 -67
  591. package/dist/v2/components/Radio.js.map +1 -1
  592. package/dist/v2/components/SectionErrorBoundary.js +90 -135
  593. package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
  594. package/dist/v2/components/SectionHeader.js +34 -41
  595. package/dist/v2/components/SectionHeader.js.map +1 -1
  596. package/dist/v2/components/Segmented.js +69 -93
  597. package/dist/v2/components/Segmented.js.map +1 -1
  598. package/dist/v2/components/Select.d.ts +26 -2
  599. package/dist/v2/components/Select.d.ts.map +1 -1
  600. package/dist/v2/components/Select.js +120 -155
  601. package/dist/v2/components/Select.js.map +1 -1
  602. package/dist/v2/components/ServerErrorPage.d.ts +27 -1
  603. package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
  604. package/dist/v2/components/ServerErrorPage.js +37 -20
  605. package/dist/v2/components/ServerErrorPage.js.map +1 -1
  606. package/dist/v2/components/Skeleton.js +86 -100
  607. package/dist/v2/components/Skeleton.js.map +1 -1
  608. package/dist/v2/components/SkipLink.js +9 -12
  609. package/dist/v2/components/SkipLink.js.map +1 -1
  610. package/dist/v2/components/Spinner.js +16 -25
  611. package/dist/v2/components/Spinner.js.map +1 -1
  612. package/dist/v2/components/Status.js +18 -29
  613. package/dist/v2/components/Status.js.map +1 -1
  614. package/dist/v2/components/Stepper.js +80 -82
  615. package/dist/v2/components/Stepper.js.map +1 -1
  616. package/dist/v2/components/Surface.js +34 -49
  617. package/dist/v2/components/Surface.js.map +1 -1
  618. package/dist/v2/components/Switch.js +29 -37
  619. package/dist/v2/components/Switch.js.map +1 -1
  620. package/dist/v2/components/TabPanel.d.ts +17 -0
  621. package/dist/v2/components/TabPanel.d.ts.map +1 -0
  622. package/dist/v2/components/TabPanel.js +90 -0
  623. package/dist/v2/components/TabPanel.js.map +1 -0
  624. package/dist/v2/components/Tabs.d.ts +25 -0
  625. package/dist/v2/components/Tabs.d.ts.map +1 -1
  626. package/dist/v2/components/Tabs.js +53 -29
  627. package/dist/v2/components/Tabs.js.map +1 -1
  628. package/dist/v2/components/TelInput.js +80 -115
  629. package/dist/v2/components/TelInput.js.map +1 -1
  630. package/dist/v2/components/Textarea.js +26 -35
  631. package/dist/v2/components/Textarea.js.map +1 -1
  632. package/dist/v2/components/TimePicker.js +62 -74
  633. package/dist/v2/components/TimePicker.js.map +1 -1
  634. package/dist/v2/components/Toast.js +119 -174
  635. package/dist/v2/components/Toast.js.map +1 -1
  636. package/dist/v2/components/Tooltip.js +23 -38
  637. package/dist/v2/components/Tooltip.js.map +1 -1
  638. package/dist/v2/components/_ErrorPageBody.js +15 -16
  639. package/dist/v2/components/_ErrorPageBody.js.map +1 -1
  640. package/dist/v2/components/_pickerShared.js +5 -5
  641. package/dist/v2/components/_pickerShared.js.map +1 -1
  642. package/dist/v2/components/index.d.ts +40 -1
  643. package/dist/v2/components/index.d.ts.map +1 -1
  644. package/dist/v2/components/index.js +153 -136
  645. package/dist/v2/components/index.js.map +1 -1
  646. package/dist/v2/hooks/index.d.ts +65 -0
  647. package/dist/v2/hooks/index.d.ts.map +1 -1
  648. package/dist/v2/hooks/index.js +63 -24
  649. package/dist/v2/hooks/index.js.map +1 -1
  650. package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
  651. package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
  652. package/dist/v2/hooks/useAppliedFilters.js +117 -0
  653. package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
  654. package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
  655. package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
  656. package/dist/v2/hooks/useDebouncedCallback.js +87 -0
  657. package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
  658. package/dist/v2/hooks/useDelayedFlag.js +6 -20
  659. package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
  660. package/dist/v2/hooks/useDensity.d.ts.map +1 -1
  661. package/dist/v2/hooks/useDensity.js +14 -18
  662. package/dist/v2/hooks/useDensity.js.map +1 -1
  663. package/dist/v2/hooks/useFocusFirstError.js +26 -34
  664. package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
  665. package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
  666. package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
  667. package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
  668. package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
  669. package/dist/v2/hooks/useFocusTrap.js +20 -24
  670. package/dist/v2/hooks/useFocusTrap.js.map +1 -1
  671. package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
  672. package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
  673. package/dist/v2/hooks/useFormAutoSave.js +39 -54
  674. package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
  675. package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
  676. package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
  677. package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
  678. package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
  679. package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
  680. package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  681. package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
  682. package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
  683. package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
  684. package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
  685. package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
  686. package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
  687. package/dist/v2/hooks/useResolvedDensity.js +5 -13
  688. package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
  689. package/dist/v2/hooks/useSortedRows.js +4 -6
  690. package/dist/v2/hooks/useSortedRows.js.map +1 -1
  691. package/dist/v2/hooks/useTabLoading.js +7 -22
  692. package/dist/v2/hooks/useTabLoading.js.map +1 -1
  693. package/dist/v2/index.js +143 -145
  694. package/dist/v2/index.js.map +1 -1
  695. package/dist/v2/modalContext.js +2 -2
  696. package/dist/v2/modalContext.js.map +1 -1
  697. package/dist/v2/models/favorite.d.ts +8 -9
  698. package/dist/v2/models/favorite.d.ts.map +1 -1
  699. package/dist/v2/models/favorite.js.map +1 -1
  700. package/dist/v2/models/index.js +4 -4
  701. package/dist/v2/models/index.js.map +1 -1
  702. package/dist/v2/models/personalization.d.ts +44 -48
  703. package/dist/v2/models/personalization.d.ts.map +1 -1
  704. package/dist/v2/models/personalization.js.map +1 -1
  705. package/dist/v2/models/referentiel.d.ts +32 -50
  706. package/dist/v2/models/referentiel.d.ts.map +1 -1
  707. package/dist/v2/models/referentiel.js.map +1 -1
  708. package/dist/v2/models/savedFilter.d.ts +8 -17
  709. package/dist/v2/models/savedFilter.d.ts.map +1 -1
  710. package/dist/v2/models/savedFilter.js.map +1 -1
  711. package/dist/v2/patterns/ActionBar.js +152 -187
  712. package/dist/v2/patterns/ActionBar.js.map +1 -1
  713. package/dist/v2/patterns/AppMain.d.ts +109 -0
  714. package/dist/v2/patterns/AppMain.d.ts.map +1 -0
  715. package/dist/v2/patterns/AppMain.js +115 -0
  716. package/dist/v2/patterns/AppMain.js.map +1 -0
  717. package/dist/v2/patterns/BulkActionBar.js +40 -42
  718. package/dist/v2/patterns/BulkActionBar.js.map +1 -1
  719. package/dist/v2/patterns/ChartFigure.d.ts +124 -0
  720. package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
  721. package/dist/v2/patterns/ChartFigure.js +159 -0
  722. package/dist/v2/patterns/ChartFigure.js.map +1 -0
  723. package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
  724. package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  725. package/dist/v2/patterns/ColumnsToggle.js +60 -94
  726. package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
  727. package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
  728. package/dist/v2/patterns/DataGrid.js +262 -297
  729. package/dist/v2/patterns/DataGrid.js.map +1 -1
  730. package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
  731. package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
  732. package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
  733. package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  734. package/dist/v2/patterns/DataGridToolbar.js +103 -106
  735. package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
  736. package/dist/v2/patterns/DataGridVirtualized.js +179 -217
  737. package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
  738. package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
  739. package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  740. package/dist/v2/patterns/DetailSplit.d.ts +87 -0
  741. package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
  742. package/dist/v2/patterns/DetailSplit.js +116 -0
  743. package/dist/v2/patterns/DetailSplit.js.map +1 -0
  744. package/dist/v2/patterns/FavoriteColumn.js +22 -23
  745. package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
  746. package/dist/v2/patterns/FavoritesFilter.js +36 -44
  747. package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
  748. package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
  749. package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
  750. package/dist/v2/patterns/FilterTabBar.js +120 -0
  751. package/dist/v2/patterns/FilterTabBar.js.map +1 -0
  752. package/dist/v2/patterns/FormErrorSummary.js +20 -23
  753. package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
  754. package/dist/v2/patterns/FormPageShell.js +53 -50
  755. package/dist/v2/patterns/FormPageShell.js.map +1 -1
  756. package/dist/v2/patterns/FormSection.d.ts +8 -3
  757. package/dist/v2/patterns/FormSection.d.ts.map +1 -1
  758. package/dist/v2/patterns/FormSection.js +44 -51
  759. package/dist/v2/patterns/FormSection.js.map +1 -1
  760. package/dist/v2/patterns/FormikCheckbox.js +36 -45
  761. package/dist/v2/patterns/FormikCheckbox.js.map +1 -1
  762. package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
  763. package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
  764. package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
  765. package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  766. package/dist/v2/patterns/FormikCombobox.js +55 -72
  767. package/dist/v2/patterns/FormikCombobox.js.map +1 -1
  768. package/dist/v2/patterns/FormikDatePicker.js +50 -64
  769. package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
  770. package/dist/v2/patterns/FormikDateTimePicker.js +50 -64
  771. package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -1
  772. package/dist/v2/patterns/FormikErrorFocus.js +25 -26
  773. package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
  774. package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
  775. package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
  776. package/dist/v2/patterns/FormikErrorSummary.js +97 -0
  777. package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
  778. package/dist/v2/patterns/FormikFile.d.ts +14 -1
  779. package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
  780. package/dist/v2/patterns/FormikFile.js +99 -83
  781. package/dist/v2/patterns/FormikFile.js.map +1 -1
  782. package/dist/v2/patterns/FormikInput.js +45 -58
  783. package/dist/v2/patterns/FormikInput.js.map +1 -1
  784. package/dist/v2/patterns/FormikRadioGroup.js +45 -56
  785. package/dist/v2/patterns/FormikRadioGroup.js.map +1 -1
  786. package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
  787. package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
  788. package/dist/v2/patterns/FormikReferentielField.js +54 -64
  789. package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
  790. package/dist/v2/patterns/FormikSelect.js +70 -92
  791. package/dist/v2/patterns/FormikSelect.js.map +1 -1
  792. package/dist/v2/patterns/FormikTextarea.js +35 -51
  793. package/dist/v2/patterns/FormikTextarea.js.map +1 -1
  794. package/dist/v2/patterns/KeyboardShortcutsHelp.js +60 -80
  795. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  796. package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
  797. package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
  798. package/dist/v2/patterns/PageContent.js +17 -20
  799. package/dist/v2/patterns/PageContent.js.map +1 -1
  800. package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
  801. package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
  802. package/dist/v2/patterns/PreviewDrawer.js +159 -0
  803. package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
  804. package/dist/v2/patterns/ReferentielField.d.ts +86 -2
  805. package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
  806. package/dist/v2/patterns/ReferentielField.js +347 -327
  807. package/dist/v2/patterns/ReferentielField.js.map +1 -1
  808. package/dist/v2/patterns/RowFavoriteToggle.d.ts +6 -0
  809. package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -1
  810. package/dist/v2/patterns/RowFavoriteToggle.js +38 -30
  811. package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -1
  812. package/dist/v2/patterns/SaveFilterDialog.js +50 -77
  813. package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
  814. package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
  815. package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
  816. package/dist/v2/patterns/SkeletonPageShell.js +122 -143
  817. package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
  818. package/dist/v2/patterns/SortableHeader.js +35 -57
  819. package/dist/v2/patterns/SortableHeader.js.map +1 -1
  820. package/dist/v2/patterns/Tour.js +121 -142
  821. package/dist/v2/patterns/Tour.js.map +1 -1
  822. package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
  823. package/dist/v2/patterns/_dataGridShared.js +131 -147
  824. package/dist/v2/patterns/_dataGridShared.js.map +1 -1
  825. package/dist/v2/patterns/_pickerSerialisation.js +9 -10
  826. package/dist/v2/patterns/_pickerSerialisation.js.map +1 -1
  827. package/dist/v2/patterns/_sort.js +17 -33
  828. package/dist/v2/patterns/_sort.js.map +1 -1
  829. package/dist/v2/patterns/_useColumnReorder.js +124 -163
  830. package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
  831. package/dist/v2/patterns/_useColumnResize.js +80 -99
  832. package/dist/v2/patterns/_useColumnResize.js.map +1 -1
  833. package/dist/v2/patterns/filterCriteria.d.ts +78 -0
  834. package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
  835. package/dist/v2/patterns/filterCriteria.js +110 -0
  836. package/dist/v2/patterns/filterCriteria.js.map +1 -0
  837. package/dist/v2/patterns/index.d.ts +160 -0
  838. package/dist/v2/patterns/index.d.ts.map +1 -1
  839. package/dist/v2/patterns/index.js +157 -79
  840. package/dist/v2/patterns/index.js.map +1 -1
  841. package/dist/v2/patterns/rowActions.d.ts +150 -0
  842. package/dist/v2/patterns/rowActions.d.ts.map +1 -0
  843. package/dist/v2/patterns/rowActions.js +232 -0
  844. package/dist/v2/patterns/rowActions.js.map +1 -0
  845. package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
  846. package/dist/v2/personalization/PersonalizationProvider.js +57 -53
  847. package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
  848. package/dist/v2/personalization/adapters/_storageKey.js +5 -5
  849. package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
  850. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
  851. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  852. package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
  853. package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  854. package/dist/v2/personalization/adapters/index.js +5 -5
  855. package/dist/v2/personalization/adapters/index.js.map +1 -1
  856. package/dist/v2/personalization/capabilities/favorites.js +39 -62
  857. package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
  858. package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
  859. package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
  860. package/dist/v2/personalization/capabilities/gridPreferences.js +31 -36
  861. package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -1
  862. package/dist/v2/personalization/capabilities/index.js +12 -12
  863. package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
  864. package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
  865. package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
  866. package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
  867. package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
  868. package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
  869. package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
  870. package/dist/v2/personalization/createPersonalizationStore.js +81 -182
  871. package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
  872. package/dist/v2/personalization/index.d.ts +16 -0
  873. package/dist/v2/personalization/index.d.ts.map +1 -1
  874. package/dist/v2/personalization/index.js +30 -23
  875. package/dist/v2/personalization/index.js.map +1 -1
  876. package/dist/v2/personalization/personalizationContext.js +10 -12
  877. package/dist/v2/personalization/personalizationContext.js.map +1 -1
  878. package/dist/v2/personalization/schema.js +8 -9
  879. package/dist/v2/personalization/schema.js.map +1 -1
  880. package/dist/v2/referentiel/ReferentielProvider.js +31 -45
  881. package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
  882. package/dist/v2/referentiel/index.js +11 -13
  883. package/dist/v2/referentiel/index.js.map +1 -1
  884. package/dist/v2/referentiel/types.d.ts +105 -0
  885. package/dist/v2/referentiel/types.d.ts.map +1 -0
  886. package/dist/v2/referentiel/types.js +6 -0
  887. package/dist/v2/referentiel/types.js.map +1 -0
  888. package/dist/v2/referentiel/useReferentielClient.js +13 -16
  889. package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
  890. package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
  891. package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
  892. package/dist/v2/referentiel/useReferentielOptions.js +63 -120
  893. package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
  894. package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
  895. package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
  896. package/dist/v2/referentiel/useReferentielSearch.js +40 -95
  897. package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
  898. package/dist/v2/theme/_brand.js +12 -26
  899. package/dist/v2/theme/_brand.js.map +1 -1
  900. package/dist/v2/theme/_brandSecondary.js +12 -26
  901. package/dist/v2/theme/_brandSecondary.js.map +1 -1
  902. package/dist/v2/theme/createPortnetTheme.js +41 -49
  903. package/dist/v2/theme/createPortnetTheme.js.map +1 -1
  904. package/dist/v2/theme/cssVariables.d.ts +3 -3
  905. package/dist/v2/theme/cssVariables.d.ts.map +1 -1
  906. package/dist/v2/theme/cssVariables.js +65 -70
  907. package/dist/v2/theme/cssVariables.js.map +1 -1
  908. package/dist/v2/theme/index.js +10 -10
  909. package/dist/v2/theme/index.js.map +1 -1
  910. package/dist/v2/tokens/breakpoints.js +16 -16
  911. package/dist/v2/tokens/breakpoints.js.map +1 -1
  912. package/dist/v2/tokens/chart.d.ts +103 -0
  913. package/dist/v2/tokens/chart.d.ts.map +1 -0
  914. package/dist/v2/tokens/chart.js +270 -0
  915. package/dist/v2/tokens/chart.js.map +1 -0
  916. package/dist/v2/tokens/colors.js +24 -24
  917. package/dist/v2/tokens/colors.js.map +1 -1
  918. package/dist/v2/tokens/density.d.ts +104 -0
  919. package/dist/v2/tokens/density.d.ts.map +1 -1
  920. package/dist/v2/tokens/density.js +67 -12
  921. package/dist/v2/tokens/density.js.map +1 -1
  922. package/dist/v2/tokens/index.d.ts +50 -1
  923. package/dist/v2/tokens/index.d.ts.map +1 -1
  924. package/dist/v2/tokens/index.js +116 -68
  925. package/dist/v2/tokens/index.js.map +1 -1
  926. package/dist/v2/tokens/motion.js +16 -22
  927. package/dist/v2/tokens/motion.js.map +1 -1
  928. package/dist/v2/tokens/radius.js +3 -3
  929. package/dist/v2/tokens/radius.js.map +1 -1
  930. package/dist/v2/tokens/shadows.js +8 -8
  931. package/dist/v2/tokens/shadows.js.map +1 -1
  932. package/dist/v2/tokens/spacing.js +4 -4
  933. package/dist/v2/tokens/spacing.js.map +1 -1
  934. package/dist/v2/tokens/state.js +3 -3
  935. package/dist/v2/tokens/state.js.map +1 -1
  936. package/dist/v2/tokens/statusPalette.js +21 -23
  937. package/dist/v2/tokens/statusPalette.js.map +1 -1
  938. package/dist/v2/tokens/tokens.json +6 -1
  939. package/dist/v2/tokens/typography.js +15 -15
  940. package/dist/v2/tokens/typography.js.map +1 -1
  941. package/dist/v2/tokens/zIndex.js +3 -3
  942. package/dist/v2/tokens/zIndex.js.map +1 -1
  943. package/dist/v2/types/datagrid.d.ts +9 -1
  944. package/dist/v2/types/datagrid.d.ts.map +1 -1
  945. package/dist/v2/types/datagrid.js.map +1 -1
  946. package/dist/v2/types/index.js +2 -2
  947. package/dist/v2/types/index.js.map +1 -1
  948. package/dist/v2/utils/apiError.js +16 -37
  949. package/dist/v2/utils/apiError.js.map +1 -1
  950. package/dist/v2/utils/contrast.js +31 -32
  951. package/dist/v2/utils/contrast.js.map +1 -1
  952. package/dist/v2/utils/cx.js +7 -27
  953. package/dist/v2/utils/cx.js.map +1 -1
  954. package/dist/v2/utils/fileDownload.js +25 -28
  955. package/dist/v2/utils/fileDownload.js.map +1 -1
  956. package/dist/v2/utils/fileValidation.d.ts +116 -0
  957. package/dist/v2/utils/fileValidation.d.ts.map +1 -0
  958. package/dist/v2/utils/fileValidation.js +220 -0
  959. package/dist/v2/utils/fileValidation.js.map +1 -0
  960. package/dist/v2/utils/fmtDate.d.ts +103 -0
  961. package/dist/v2/utils/fmtDate.d.ts.map +1 -0
  962. package/dist/v2/utils/fmtDate.js +119 -0
  963. package/dist/v2/utils/fmtDate.js.map +1 -0
  964. package/dist/v2/utils/fmtMoney.d.ts +3 -3
  965. package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
  966. package/dist/v2/utils/fmtMoney.js +9 -11
  967. package/dist/v2/utils/fmtMoney.js.map +1 -1
  968. package/dist/v2/utils/formikErrors.d.ts +67 -0
  969. package/dist/v2/utils/formikErrors.d.ts.map +1 -0
  970. package/dist/v2/utils/formikErrors.js +85 -0
  971. package/dist/v2/utils/formikErrors.js.map +1 -0
  972. package/dist/v2/utils/index.d.ts +5 -0
  973. package/dist/v2/utils/index.d.ts.map +1 -1
  974. package/dist/v2/utils/index.js +67 -18
  975. package/dist/v2/utils/index.js.map +1 -1
  976. package/dist/v2/utils/mergeLabels.js +9 -14
  977. package/dist/v2/utils/mergeLabels.js.map +1 -1
  978. package/dist/v2/utils/networkStatus.js +14 -14
  979. package/dist/v2/utils/networkStatus.js.map +1 -1
  980. package/package.json +26 -9
@@ -1,9 +1,3 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  import * as React from "react";
8
2
  import FormControl from "@mui/material/FormControl";
9
3
  import FormLabel from "@mui/material/FormLabel";
@@ -19,7 +13,47 @@ import FieldError from "./FieldError";
19
13
  * for any form control (Input, Select, Textarea, Autocomplete, Combobox, …).
20
14
  *
21
15
  * Strict rules enforced:
22
- * R-I.1 — Label is associated to the control via `htmlFor` / `id`.
16
+ * R-I.1 — Label is associated to the control via `htmlFor` / `id`, plus
17
+ * `labelId` for children whose visible surface is NOT labelable.
18
+ *
19
+ * >>> THE SECOND CHANNEL WAS MISSING, AND HALF THE CONTROLS NEED IT.
20
+ * >>> `htmlFor` / `id` names LABELABLE elements only — input, select,
21
+ * >>> textarea, button, meter, output, progress. `Select` renders its
22
+ * >>> visible surface as a `div[role="combobox"]`, which is not one,
23
+ * >>> so the pair resolved to NOTHING: the control had no accessible
24
+ * >>> name and a screen reader announced "combobox, collapsed"
25
+ * >>> without saying which field. WCAG 4.1.2 / 1.3.1, invisible on
26
+ * >>> screen, in every filter drawer and every form of every module.
27
+ * >>>
28
+ * >>> Found by the axe-core suite of
29
+ * >>> `autorisation-admis-pour-conforme-fe` (Area 10), failing with
30
+ * >>> `aria-input-field-name` on the first `Select` rendered.
31
+ *
32
+ * WHY `labelId` AND NOT `aria-labelledby`. A first attempt passed
33
+ * `aria-labelledby` to every child. It does not work and it breaks
34
+ * things: MUI spreads unknown props onto its ROOT wrapper, so the
35
+ * attribute landed on `div.MuiInputBase-root` — never on the inner
36
+ * control. For `Select` the combobox stayed anonymous; for `Input`
37
+ * the wrapper became a SECOND element carrying the label, which is
38
+ * both wrong for assistive tech and enough to break any
39
+ * `getByLabelText` in a host's tests. `labelId` is MUI's own channel:
40
+ * `SelectInput` merges it into the combobox's `aria-labelledby`.
41
+ *
42
+ * It is passed only to children that DECLARE they consume it, via
43
+ * the `puiLabelTarget` marker (see `Select`). A blanket `labelId`
44
+ * would reach `<input>` and MUI text fields, which do not know it —
45
+ * React then warns about an unrecognised DOM attribute on every
46
+ * render, in every host console.
47
+ *
48
+ * KNOWN LIMITATION, stated because it is asymmetric with R-I.3: a
49
+ * consumer-supplied `aria-labelledby` on a non-group child is NOT
50
+ * merged into the name. `aria-describedby` is merged, here, by this
51
+ * component; naming goes through MUI's `labelId`, and MUI does not
52
+ * concatenate the two. Nothing is silently lost — the field is named
53
+ * by its own label, which is the name a user should hear — but a host
54
+ * wanting to ADD to that name must put it in `label`. Widening this
55
+ * would mean interpolating a token list into `labelId`, a prop
56
+ * documented as "the ID of an element".
23
57
  * R-I.2 — Required adds the asterisk + `aria-required`.
24
58
  * R-I.3 — Error: `aria-invalid` + `aria-describedby` linking the message.
25
59
  * Field MERGES with the child's existing `aria-describedby` so a
@@ -39,9 +73,14 @@ import FieldError from "./FieldError";
39
73
  * Grouping controls (RadioGroup / CheckboxGroup) — pass `group`:
40
74
  * A native `<label htmlFor>` cannot name an ARIA group (only labelable
41
75
  * elements can be `for`-targeted), so in `group` mode the label is rendered
42
- * as a <span> with an id and the child group is associated via
43
- * `aria-labelledby` instead. The child must forward `aria-labelledby`
44
- * (and `aria-describedby`) onto its `role="group"`/`"radiogroup"` element.
76
+ * as a <span> and the child group is associated via `aria-labelledby`
77
+ * instead. The child must forward `aria-labelledby` (and
78
+ * `aria-describedby`) onto its `role="group"`/`"radiogroup"` element.
79
+ *
80
+ * Since R-I.1 above, `group` keeps its own `aria-labelledby` channel: a
81
+ * `role="group"` element is not labelable either, but it is the CHILD's own
82
+ * root that carries the role, so the attribute reaches the right element
83
+ * there — unlike a MUI control, whose root is a wrapper.
45
84
  *
46
85
  * <Field label="Genre" group error={errors.genre}>
47
86
  * <RadioGroup … />
@@ -96,62 +135,103 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
96
135
  * que jsdom ne resout pas. Un test de rendu ne peut donc pas lire la largeur
97
136
  * effective ; il peut en revanche epingler les cinq valeurs, ce qui est le
98
137
  * point sensible (elles sont une decision de design, voir la note ci-dessus).
138
+ *
139
+ * ─── Les variables CSS EXISTENT desormais ─────────────────────────
140
+ *
141
+ * La note ci-dessus affirmait que les cinq nombres etaient "exposes en
142
+ * variables CSS pour etre revus sans toucher au code". C'etait FAUX jusqu'a
143
+ * l'audit Area 4 d'addm-fe : `cssVariables` n'emettait aucun `--field-w-*`,
144
+ * donc seuls les REPLIS ci-dessous rendaient, et la revision annoncee
145
+ * n'existait pas.
146
+ *
147
+ * Les valeurs vivent maintenant dans `tokens.layout.fieldWidth` et sont
148
+ * emises. Les replis restent : un hote qui n'appelle jamais
149
+ * `injectCssVariables` doit continuer a rendre des largeurs correctes. Les
150
+ * deux doivent donc rester d'accord, ce qu'epingle le test de contrat.
99
151
  */
100
- export var FIELD_MAX_WIDTH = {
152
+ export const FIELD_MAX_WIDTH = {
101
153
  xs: "var(--field-w-xs, 120px)",
102
154
  s: "var(--field-w-s, 200px)",
103
155
  m: "var(--field-w-m, 400px)",
104
156
  l: "var(--field-w-l, 600px)",
105
157
  xl: "100%"
106
158
  };
107
- function Field(_ref) {
108
- var label = _ref.label,
109
- _ref$required = _ref.required,
110
- required = _ref$required === void 0 ? false : _ref$required,
111
- hint = _ref.hint,
112
- error = _ref.error,
113
- htmlFor = _ref.htmlFor,
114
- _ref$fullWidth = _ref.fullWidth,
115
- fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
116
- disabled = _ref.disabled,
117
- _ref$group = _ref.group,
118
- group = _ref$group === void 0 ? false : _ref$group,
119
- width = _ref.width,
120
- children = _ref.children,
121
- helpAdornment = _ref.helpAdornment,
122
- sx = _ref.sx,
123
- className = _ref.className;
159
+ function Field({
160
+ label,
161
+ required = false,
162
+ hint,
163
+ error,
164
+ htmlFor,
165
+ fullWidth = true,
166
+ disabled,
167
+ group = false,
168
+ width,
169
+ children,
170
+ helpAdornment,
171
+ // optional <FieldHelp> element
172
+ sx,
173
+ className
174
+ }) {
124
175
  // R-I.1 — useId provides SSR-safe, per-instance, stable IDs.
125
176
  // Replaces the previous module-scoped counter (`let __uid = 0`) which broke
126
177
  // hydration and Concurrent Mode.
127
- var reactId = React.useId();
128
- var auto = "pui-".concat(reactId.replace(/:/g, ""));
129
- var inputId = htmlFor || auto;
130
- var hintId = "".concat(inputId, "-h");
131
- var errorId = "".concat(inputId, "-e");
132
- var labelId = "".concat(inputId, "-l");
133
- var hasError = !!error;
134
- var child = React.Children.only(children);
178
+ const reactId = React.useId();
179
+ const auto = `pui-${reactId.replace(/:/g, "")}`;
180
+ const inputId = htmlFor || auto;
181
+ const hintId = `${inputId}-h`;
182
+ const errorId = `${inputId}-e`;
183
+ const labelId = `${inputId}-l`;
184
+ const hasError = !!error;
185
+ const child = React.Children.only(children);
186
+
187
+ /**
188
+ * Does this child consume `labelId` (R-I.1)?
189
+ *
190
+ * A component whose visible surface is a `div[role="combobox"]` cannot be
191
+ * named by `htmlFor`/`id`, and cannot receive `aria-labelledby` through
192
+ * props either — MUI spreads unknown props onto its root WRAPPER. Those
193
+ * components therefore declare a static marker and take MUI's own `labelId`
194
+ * channel instead. See the R-I.1 note at the head of this file for the
195
+ * attempt that did not work.
196
+ *
197
+ * A marker rather than a type check: `Field` must not import `Select` (a
198
+ * cycle, and it would pull the whole control into every `Field` call site),
199
+ * and it cannot infer from the element what its rendered DOM will be.
200
+ */
201
+ const childType = child.type;
202
+ const wantsLabelId = childType?.puiLabelTarget === "labelId";
135
203
  // The wrapped control is polymorphic (Input/Select/NumberInput/Combobox/…);
136
204
  // type only the props Field reads/merges, replacing React's `props: any`.
137
- var childProps = child.props;
205
+ const childProps = child.props;
138
206
 
139
207
  // R-I.3 — MERGE the child's existing aria-describedby with our hint/error
140
208
  // ids. cloneElement replaces props, so without an explicit merge any
141
209
  // consumer-supplied describedby was silently discarded.
142
- var describedBy = [childProps["aria-describedby"], hint && !hasError ? hintId : null, hasError ? errorId : null].filter(Boolean).join(" ") || undefined;
210
+ const describedBy = [childProps["aria-describedby"], hint && !hasError ? hintId : null, hasError ? errorId : null].filter(Boolean).join(" ") || undefined;
143
211
 
144
- // CC-6 — in group mode the label names the group via aria-labelledby.
145
- // Merge with any consumer-supplied labelledby so it is never lost.
146
- var labelledBy = group ? [childProps["aria-labelledby"], label ? labelId : null].filter(Boolean).join(" ") || undefined : undefined;
147
- var enhanced = /*#__PURE__*/React.cloneElement(child, _objectSpread(_objectSpread({
212
+ /**
213
+ * R-I.1 `group` mode only.
214
+ *
215
+ * The child's own root carries `role="group"`, so an `aria-labelledby`
216
+ * passed through props reaches the element that needs it. That is NOT true
217
+ * of a MUI control, whose root is a wrapper div — hence `labelId` for those.
218
+ * Merged with any consumer-supplied value so it is never lost.
219
+ */
220
+ const labelledBy = group ? [childProps["aria-labelledby"], label ? labelId : null].filter(Boolean).join(" ") || undefined : undefined;
221
+ const enhanced = /*#__PURE__*/React.cloneElement(child, {
148
222
  id: childProps.id || inputId,
149
223
  "aria-invalid": hasError ? "true" : undefined,
150
224
  "aria-required": required ? "true" : undefined,
151
- "aria-describedby": describedBy
152
- }, group ? {
153
- "aria-labelledby": labelledBy
154
- } : {}), {}, {
225
+ "aria-describedby": describedBy,
226
+ ...(group ? {
227
+ "aria-labelledby": labelledBy
228
+ } : {}),
229
+ /* R-I.1 — MUI's own labelling channel, for the controls that declare they
230
+ consume it. `SelectInput` merges this into the combobox's
231
+ `aria-labelledby`; nothing else in the tree is touched. */
232
+ ...(wantsLabelId && label ? {
233
+ labelId
234
+ } : {}),
155
235
  // `error` / `disabled` are broadcast by FormControl via context for MUI
156
236
  // inputs, but several v2 inputs (NumberInput, Combobox renderInput) are
157
237
  // not pure MUI children and read the props directly — keep them explicit.
@@ -161,17 +241,17 @@ function Field(_ref) {
161
241
  // inline filter input). Only fall back to Field's value when the child
162
242
  // hasn't expressed an opinion.
163
243
  fullWidth: childProps.fullWidth !== undefined ? childProps.fullWidth : fullWidth
164
- }));
244
+ });
165
245
 
166
246
  // R-I.6 — RTL-safe margin reset. `marginLeft: 0` only zeroes the LTR
167
247
  // inline-start; in [dir="rtl"] the helper picks up MUI's default on
168
248
  // the (now physical-right but logical-start) side and is mis-aligned.
169
249
  // `marginInlineStart` resets the correct edge in both directions.
170
- var helperResetSx = {
250
+ const helperResetSx = {
171
251
  marginInlineStart: 0,
172
252
  fontSize: "var(--text-xs)"
173
253
  };
174
- var LABEL_SX = {
254
+ const LABEL_SX = {
175
255
  display: "flex",
176
256
  alignItems: "center",
177
257
  gap: "var(--s-1)",
@@ -188,7 +268,12 @@ function Field(_ref) {
188
268
  };
189
269
 
190
270
  // Shared label content (text + required marker + optional help adornment).
191
- var labelContent = /*#__PURE__*/_jsxs(_Fragment, {
271
+ //
272
+ // NO wrapper span around `{label}`: an earlier attempt added one to anchor
273
+ // the id on the text alone, and it changed what `getByText("…")` returns —
274
+ // a host test expecting the `<label>` element got the inner span instead.
275
+ // The id stays on the label element, as it always has in `group` mode.
276
+ const labelContent = /*#__PURE__*/_jsxs(_Fragment, {
192
277
  children: [label, required && /*#__PURE__*/_jsx(Box, {
193
278
  component: "span",
194
279
  "aria-hidden": "true",
@@ -205,12 +290,17 @@ function Field(_ref) {
205
290
  disabled: disabled,
206
291
  fullWidth: fullWidth,
207
292
  className: className,
208
- sx: _objectSpread(_objectSpread({}, width ? {
209
- maxWidth: {
210
- xs: "100%",
211
- sm: FIELD_MAX_WIDTH[width]
212
- }
213
- } : {}), sx),
293
+ sx: {
294
+ /* G-H — plafond a partir de `sm` seulement : sur mobile le standard
295
+ * impose 100% de la largeur de grille. */
296
+ ...(width ? {
297
+ maxWidth: {
298
+ xs: "100%",
299
+ sm: FIELD_MAX_WIDTH[width]
300
+ }
301
+ } : {}),
302
+ ...sx
303
+ },
214
304
  children: [label && (group ?
215
305
  /*#__PURE__*/
216
306
  // Group mode: render as a <span> carrying an id (no <label for>),
@@ -221,16 +311,22 @@ function Field(_ref) {
221
311
  required: false,
222
312
  sx: LABEL_SX,
223
313
  children: labelContent
224
- }) : /*#__PURE__*/_jsx(FormLabel, {
314
+ }) :
315
+ /*#__PURE__*/
316
+ // The id is present here too: a child declaring `puiLabelTarget`
317
+ // points MUI's `labelId` at this element.
318
+ _jsx(FormLabel, {
225
319
  htmlFor: inputId,
320
+ id: labelId,
226
321
  required: false /* we render the * ourselves */,
227
322
  sx: LABEL_SX,
228
323
  children: labelContent
229
324
  })), enhanced, hint && !hasError && /*#__PURE__*/_jsx(FormHelperText, {
230
325
  id: hintId,
231
- sx: _objectSpread(_objectSpread({}, helperResetSx), {}, {
326
+ sx: {
327
+ ...helperResetSx,
232
328
  color: "var(--fg-subtle)"
233
- }),
329
+ },
234
330
  children: hint
235
331
  }), hasError &&
236
332
  /*#__PURE__*/
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["React","FormControl","FormLabel","FormHelperText","Box","FieldError","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FIELD_MAX_WIDTH","xs","s","m","l","xl","Field","_ref","label","_ref$required","required","hint","error","htmlFor","_ref$fullWidth","fullWidth","disabled","_ref$group","group","width","children","helpAdornment","sx","className","reactId","useId","auto","concat","replace","inputId","hintId","errorId","labelId","hasError","child","Children","only","childProps","props","describedBy","filter","Boolean","join","undefined","labelledBy","enhanced","cloneElement","_objectSpread","id","helperResetSx","marginInlineStart","fontSize","LABEL_SX","display","alignItems","gap","fontWeight","color","marginBottom","labelContent","component","maxWidth","sm","marginTop"],"sources":["../../../../src/lib/v2/components/Field.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport FormControl from \"@mui/material/FormControl\";\r\nimport FormLabel from \"@mui/material/FormLabel\";\r\nimport FormHelperText from \"@mui/material/FormHelperText\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport FieldError from \"./FieldError\";\r\n\r\n/**\r\n * Field — Portnet UI v2\r\n *\r\n * Charter §03 · Component \"Input · Field\".\r\n * Universal wrapper providing label / required marker / hint / error / a11y bindings\r\n * for any form control (Input, Select, Textarea, Autocomplete, Combobox, …).\r\n *\r\n * Strict rules enforced:\r\n * R-I.1 — Label is associated to the control via `htmlFor` / `id`.\r\n * R-I.2 — Required adds the asterisk + `aria-required`.\r\n * R-I.3 — Error: `aria-invalid` + `aria-describedby` linking the message.\r\n * Field MERGES with the child's existing `aria-describedby` so a\r\n * consumer-supplied external help id is never lost. The message\r\n * itself is rendered by the shared `FieldError` primitive, which\r\n * carries the R-4.1 MUST icon (gap G-18) — previously this component\r\n * rendered a bare red `FormHelperText` with no icon, so the canonical\r\n * field wrapper did not satisfy a MUST and every module inherited the\r\n * gap on every form.\r\n * R-I.4 — Validation in `blur`, not `change` (caller's responsibility).\r\n * R-I.6 — Hint visible above error; never both at once.\r\n *\r\n * <Field label=\"Référence\" required hint=\"Format AAAA-IM-NNNNN\" error={errors.ref}>\r\n * <Input value={value} onChange={onChange} />\r\n * </Field>\r\n *\r\n * Grouping controls (RadioGroup / CheckboxGroup) — pass `group`:\r\n * A native `<label htmlFor>` cannot name an ARIA group (only labelable\r\n * elements can be `for`-targeted), so in `group` mode the label is rendered\r\n * as a <span> with an id and the child group is associated via\r\n * `aria-labelledby` instead. The child must forward `aria-labelledby`\r\n * (and `aria-describedby`) onto its `role=\"group\"`/`\"radiogroup\"` element.\r\n *\r\n * <Field label=\"Genre\" group error={errors.genre}>\r\n * <RadioGroup … />\r\n * </Field>\r\n *\r\n * ── LARGEUR SEMANTIQUE (gap G-H) ──────────────────────────────\r\n *\r\n * `width` rattache le champ a l'un des cinq gabarits imposes par la section\r\n * « Form Field Width & Layout Standards » des Platform Mandatory UX Patterns.\r\n * Le standard y interdit explicitement les « arbitrary input field widths » et\r\n * les « jagged alignment fields within forms », et impose de mapper chaque\r\n * champ a un gabarit d'apres sa contrainte de CARACTERES :\r\n *\r\n * xs 1 a 5 caracteres code postal, CVV, age\r\n * s 6 a 15 telephone, montant, date, identifiant court\r\n * m 16 a 60 nom, courriel, ville, liste simple\r\n * l 61 a 256 adresse, recherche complexe, longue liste\r\n * xl 257 et plus zone de texte, description, editeur\r\n *\r\n * POURQUOI SUR `Field` ET NON SUR CHAQUE CONTROLE. Le gabarit est une\r\n * contrainte de MISE EN PAGE, pas une propriete de l'input : c'est la boite du\r\n * champ - libelle, controle, indication, erreur - qui doit etre bornee, sinon\r\n * le message d'erreur s'etale sur toute la cellule pendant que l'input est\r\n * borne. `Field` est le seul endroit qui voit cette boite entiere.\r\n *\r\n * POURQUOI UN PLAFOND ET NON UNE LARGEUR FIXE. Le standard exige aussi que les\r\n * champs soient empiles « 100% grid width » sur mobile, et que des champs\r\n * heterogenes s'alignent sur des fractions de colonnes. Un `maxWidth`\r\n * n'est donc pose qu'a partir de `sm` : la grille continue de decider des\r\n * COLONNES, le gabarit borne le champ DANS sa cellule. Les deux regles\r\n * coexistent au lieu de se contredire.\r\n *\r\n * >>> LES CINQ VALEURS SONT UNE DECISION DE DESIGN, PAS UNE LECTURE. Le\r\n * >>> standard donne des FOURCHETTES (« ~80px to 120px max »). J'ai retenu le\r\n * >>> HAUT de chaque fourchette, ces largeurs etant des plafonds : prendre le\r\n * >>> bas tronquerait des valeurs qui tiennent dans la contrainte de\r\n * >>> caracteres annoncee. A confirmer par l'equipe design ; les cinq nombres\r\n * >>> sont exposes en variables CSS pour etre revus sans toucher au code. <<<\r\n */\r\n\r\n/**\r\n * Gabarits de largeur semantique (G-H). Voir la note en tete de fichier.\r\n *\r\n * Les valeurs passent par des variables CSS pour que l'equipe design puisse\r\n * les revoir sans modification de code. Les replis sont le HAUT de chaque\r\n * fourchette du standard, ces largeurs etant des plafonds.\r\n */\r\nexport type FieldWidth = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\r\n\r\n/**\r\n * Exporte pour etre TESTABLE : le plafond ne s'applique qu'a partir de `sm`,\r\n * donc via une requete media qu'`emotion` injecte dans la feuille de style et\r\n * que jsdom ne resout pas. Un test de rendu ne peut donc pas lire la largeur\r\n * effective ; il peut en revanche epingler les cinq valeurs, ce qui est le\r\n * point sensible (elles sont une decision de design, voir la note ci-dessus).\r\n */\r\nexport const FIELD_MAX_WIDTH: Record<FieldWidth, string> = {\r\n xs: \"var(--field-w-xs, 120px)\",\r\n s: \"var(--field-w-s, 200px)\",\r\n m: \"var(--field-w-m, 400px)\",\r\n l: \"var(--field-w-l, 600px)\",\r\n xl: \"100%\",\r\n};\r\n\r\nexport interface FieldProps {\r\n label?: React.ReactNode | undefined;\r\n required?: boolean | undefined;\r\n hint?: React.ReactNode | undefined;\r\n error?: React.ReactNode | undefined;\r\n htmlFor?: string | undefined;\r\n fullWidth?: boolean | undefined;\r\n disabled?: boolean | undefined;\r\n /**\r\n * The wrapped child is an ARIA group (RadioGroup / CheckboxGroup) rather than\r\n * a single labelable control. Associates the label via `aria-labelledby`\r\n * instead of `htmlFor` / `id`.\r\n */\r\n group?: boolean | undefined;\r\n /**\r\n * Gabarit de largeur semantique (G-H) : `xs` | `s` | `m` | `l` | `xl`,\r\n * choisi d'apres la contrainte de CARACTERES du champ. Voir la note en tete\r\n * de fichier. Omis = aucun plafond, la cellule de grille decide seule -\r\n * c'est le comportement d'avant G-H, donc rien ne change pour les appelants\r\n * existants.\r\n */\r\n width?: FieldWidth | undefined;\r\n /** Optional <FieldHelp> element rendered next to the label. */\r\n helpAdornment?: React.ReactNode | undefined;\r\n /** The single form-control element to wrap. */\r\n children: React.ReactElement;\r\n sx?: SxProps<Theme> | undefined;\r\n className?: string | undefined;\r\n}\r\n\r\nfunction Field({\r\n label,\r\n required = false,\r\n hint,\r\n error,\r\n htmlFor,\r\n fullWidth = true,\r\n disabled,\r\n group = false,\r\n width,\r\n children,\r\n helpAdornment, // optional <FieldHelp> element\r\n sx,\r\n className,\r\n}: FieldProps) {\r\n // R-I.1 — useId provides SSR-safe, per-instance, stable IDs.\r\n // Replaces the previous module-scoped counter (`let __uid = 0`) which broke\r\n // hydration and Concurrent Mode.\r\n const reactId = React.useId();\r\n const auto = `pui-${reactId.replace(/:/g, \"\")}`;\r\n const inputId = htmlFor || auto;\r\n const hintId = `${inputId}-h`;\r\n const errorId = `${inputId}-e`;\r\n const labelId = `${inputId}-l`;\r\n const hasError = !!error;\r\n\r\n const child = React.Children.only(children);\r\n // The wrapped control is polymorphic (Input/Select/NumberInput/Combobox/…);\r\n // type only the props Field reads/merges, replacing React's `props: any`.\r\n const childProps = child.props as {\r\n id?: string;\r\n disabled?: boolean;\r\n fullWidth?: boolean;\r\n \"aria-describedby\"?: string;\r\n \"aria-labelledby\"?: string;\r\n };\r\n\r\n // R-I.3 — MERGE the child's existing aria-describedby with our hint/error\r\n // ids. cloneElement replaces props, so without an explicit merge any\r\n // consumer-supplied describedby was silently discarded.\r\n const describedBy = [\r\n childProps[\"aria-describedby\"],\r\n hint && !hasError ? hintId : null,\r\n hasError ? errorId : null,\r\n ].filter(Boolean).join(\" \") || undefined;\r\n\r\n // CC-6 — in group mode the label names the group via aria-labelledby.\r\n // Merge with any consumer-supplied labelledby so it is never lost.\r\n const labelledBy = group\r\n ? [childProps[\"aria-labelledby\"], label ? labelId : null]\r\n .filter(Boolean)\r\n .join(\" \") || undefined\r\n : undefined;\r\n\r\n const enhanced = React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\r\n id: childProps.id || inputId,\r\n \"aria-invalid\": hasError ? \"true\" : undefined,\r\n \"aria-required\": required ? \"true\" : undefined,\r\n \"aria-describedby\": describedBy,\r\n // Only in group mode — a single labelable control is named by the\r\n // htmlFor/id pair below, not by aria-labelledby.\r\n ...(group ? { \"aria-labelledby\": labelledBy } : {}),\r\n // `error` / `disabled` are broadcast by FormControl via context for MUI\r\n // inputs, but several v2 inputs (NumberInput, Combobox renderInput) are\r\n // not pure MUI children and read the props directly — keep them explicit.\r\n error: hasError,\r\n disabled: disabled || childProps.disabled,\r\n // Respect the child's explicit fullWidth when defined (e.g. a narrow\r\n // inline filter input). Only fall back to Field's value when the child\r\n // hasn't expressed an opinion.\r\n fullWidth: childProps.fullWidth !== undefined ? childProps.fullWidth : fullWidth,\r\n });\r\n\r\n // R-I.6 — RTL-safe margin reset. `marginLeft: 0` only zeroes the LTR\r\n // inline-start; in [dir=\"rtl\"] the helper picks up MUI's default on\r\n // the (now physical-right but logical-start) side and is mis-aligned.\r\n // `marginInlineStart` resets the correct edge in both directions.\r\n const helperResetSx = { marginInlineStart: 0, fontSize: \"var(--text-xs)\" };\r\n\r\n const LABEL_SX = {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: \"var(--s-1)\",\r\n fontSize: \"var(--text-xs, 12px)\",\r\n fontWeight: \"var(--fw-semibold, 600)\",\r\n color: \"var(--fg-muted)\",\r\n marginBottom: \"var(--s-2)\",\r\n \"&.Mui-focused\": { color: \"var(--fg-muted)\" },\r\n \"&.Mui-error\": { color: \"var(--fg-muted)\" },\r\n } as const;\r\n\r\n // Shared label content (text + required marker + optional help adornment).\r\n const labelContent = (\r\n <>\r\n {label}\r\n {required && (\r\n <Box\r\n component=\"span\"\r\n aria-hidden=\"true\"\r\n sx={{ color: \"var(--danger)\", fontWeight: \"var(--fw-bold, 700)\" }}\r\n >\r\n *\r\n </Box>\r\n )}\r\n {helpAdornment}\r\n </>\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={hasError}\r\n required={required}\r\n disabled={disabled}\r\n fullWidth={fullWidth}\r\n className={className}\r\n sx={{\r\n /* G-H — plafond a partir de `sm` seulement : sur mobile le standard\r\n * impose 100% de la largeur de grille. */\r\n ...(width\r\n ? { maxWidth: { xs: \"100%\", sm: FIELD_MAX_WIDTH[width] } }\r\n : {}),\r\n ...sx,\r\n }}\r\n >\r\n {label &&\r\n (group ? (\r\n // Group mode: render as a <span> carrying an id (no <label for>),\r\n // referenced by the group's aria-labelledby.\r\n <FormLabel component=\"span\" id={labelId} required={false} sx={LABEL_SX}>\r\n {labelContent}\r\n </FormLabel>\r\n ) : (\r\n <FormLabel htmlFor={inputId} required={false /* we render the * ourselves */} sx={LABEL_SX}>\r\n {labelContent}\r\n </FormLabel>\r\n ))}\r\n\r\n {enhanced}\r\n\r\n {hint && !hasError && (\r\n <FormHelperText\r\n id={hintId}\r\n sx={{ ...helperResetSx, color: \"var(--fg-subtle)\" }}\r\n >\r\n {hint}\r\n </FormHelperText>\r\n )}\r\n\r\n {hasError && (\r\n /*\r\n * Rendered by the shared `FieldError` (gap G-18) rather than an inline\r\n * `FormHelperText`: R-4.1 MUST requires the icon, and a host with a\r\n * LIST-level error (a Formik array, an upload slot) has no single\r\n * control to wrap in a `Field` and needs the exact same renderer\r\n * standalone. One component, both paths, no drift.\r\n *\r\n * `marginTop: var(--s-1)` (4px) replaces `FormHelperText`'s hard-coded\r\n * 3px default — same optical result, on the spacing scale (R-S.1).\r\n * Dropping FormHelperText also removed a `color: … !important` that\r\n * only existed to beat MUI's own `Mui-error` colour.\r\n */\r\n <FieldError id={errorId} sx={{ marginTop: \"var(--s-1)\" }}>\r\n {error}\r\n </FieldError>\r\n )}\r\n </FormControl>\r\n );\r\n}\r\n\r\nexport default Field;\r\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"Field.js","names":["React","FormControl","FormLabel","FormHelperText","Box","FieldError","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","FIELD_MAX_WIDTH","xs","s","m","l","xl","Field","label","required","hint","error","htmlFor","fullWidth","disabled","group","width","children","helpAdornment","sx","className","reactId","useId","auto","replace","inputId","hintId","errorId","labelId","hasError","child","Children","only","childType","type","wantsLabelId","puiLabelTarget","childProps","props","describedBy","filter","Boolean","join","undefined","labelledBy","enhanced","cloneElement","id","helperResetSx","marginInlineStart","fontSize","LABEL_SX","display","alignItems","gap","fontWeight","color","marginBottom","labelContent","component","maxWidth","sm","marginTop"],"sources":["../../../../src/lib/v2/components/Field.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport FormControl from \"@mui/material/FormControl\";\r\nimport FormLabel from \"@mui/material/FormLabel\";\r\nimport FormHelperText from \"@mui/material/FormHelperText\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport FieldError from \"./FieldError\";\r\n\r\n/**\r\n * Field — Portnet UI v2\r\n *\r\n * Charter §03 · Component \"Input · Field\".\r\n * Universal wrapper providing label / required marker / hint / error / a11y bindings\r\n * for any form control (Input, Select, Textarea, Autocomplete, Combobox, …).\r\n *\r\n * Strict rules enforced:\r\n * R-I.1 — Label is associated to the control via `htmlFor` / `id`, plus\r\n * `labelId` for children whose visible surface is NOT labelable.\r\n *\r\n * >>> THE SECOND CHANNEL WAS MISSING, AND HALF THE CONTROLS NEED IT.\r\n * >>> `htmlFor` / `id` names LABELABLE elements only — input, select,\r\n * >>> textarea, button, meter, output, progress. `Select` renders its\r\n * >>> visible surface as a `div[role=\"combobox\"]`, which is not one,\r\n * >>> so the pair resolved to NOTHING: the control had no accessible\r\n * >>> name and a screen reader announced \"combobox, collapsed\"\r\n * >>> without saying which field. WCAG 4.1.2 / 1.3.1, invisible on\r\n * >>> screen, in every filter drawer and every form of every module.\r\n * >>>\r\n * >>> Found by the axe-core suite of\r\n * >>> `autorisation-admis-pour-conforme-fe` (Area 10), failing with\r\n * >>> `aria-input-field-name` on the first `Select` rendered.\r\n *\r\n * WHY `labelId` AND NOT `aria-labelledby`. A first attempt passed\r\n * `aria-labelledby` to every child. It does not work and it breaks\r\n * things: MUI spreads unknown props onto its ROOT wrapper, so the\r\n * attribute landed on `div.MuiInputBase-root` — never on the inner\r\n * control. For `Select` the combobox stayed anonymous; for `Input`\r\n * the wrapper became a SECOND element carrying the label, which is\r\n * both wrong for assistive tech and enough to break any\r\n * `getByLabelText` in a host's tests. `labelId` is MUI's own channel:\r\n * `SelectInput` merges it into the combobox's `aria-labelledby`.\r\n *\r\n * It is passed only to children that DECLARE they consume it, via\r\n * the `puiLabelTarget` marker (see `Select`). A blanket `labelId`\r\n * would reach `<input>` and MUI text fields, which do not know it —\r\n * React then warns about an unrecognised DOM attribute on every\r\n * render, in every host console.\r\n *\r\n * KNOWN LIMITATION, stated because it is asymmetric with R-I.3: a\r\n * consumer-supplied `aria-labelledby` on a non-group child is NOT\r\n * merged into the name. `aria-describedby` is merged, here, by this\r\n * component; naming goes through MUI's `labelId`, and MUI does not\r\n * concatenate the two. Nothing is silently lost — the field is named\r\n * by its own label, which is the name a user should hear — but a host\r\n * wanting to ADD to that name must put it in `label`. Widening this\r\n * would mean interpolating a token list into `labelId`, a prop\r\n * documented as \"the ID of an element\".\r\n * R-I.2 — Required adds the asterisk + `aria-required`.\r\n * R-I.3 — Error: `aria-invalid` + `aria-describedby` linking the message.\r\n * Field MERGES with the child's existing `aria-describedby` so a\r\n * consumer-supplied external help id is never lost. The message\r\n * itself is rendered by the shared `FieldError` primitive, which\r\n * carries the R-4.1 MUST icon (gap G-18) — previously this component\r\n * rendered a bare red `FormHelperText` with no icon, so the canonical\r\n * field wrapper did not satisfy a MUST and every module inherited the\r\n * gap on every form.\r\n * R-I.4 — Validation in `blur`, not `change` (caller's responsibility).\r\n * R-I.6 — Hint visible above error; never both at once.\r\n *\r\n * <Field label=\"Référence\" required hint=\"Format AAAA-IM-NNNNN\" error={errors.ref}>\r\n * <Input value={value} onChange={onChange} />\r\n * </Field>\r\n *\r\n * Grouping controls (RadioGroup / CheckboxGroup) — pass `group`:\r\n * A native `<label htmlFor>` cannot name an ARIA group (only labelable\r\n * elements can be `for`-targeted), so in `group` mode the label is rendered\r\n * as a <span> and the child group is associated via `aria-labelledby`\r\n * instead. The child must forward `aria-labelledby` (and\r\n * `aria-describedby`) onto its `role=\"group\"`/`\"radiogroup\"` element.\r\n *\r\n * Since R-I.1 above, `group` keeps its own `aria-labelledby` channel: a\r\n * `role=\"group\"` element is not labelable either, but it is the CHILD's own\r\n * root that carries the role, so the attribute reaches the right element\r\n * there — unlike a MUI control, whose root is a wrapper.\r\n *\r\n * <Field label=\"Genre\" group error={errors.genre}>\r\n * <RadioGroup … />\r\n * </Field>\r\n *\r\n * ── LARGEUR SEMANTIQUE (gap G-H) ──────────────────────────────\r\n *\r\n * `width` rattache le champ a l'un des cinq gabarits imposes par la section\r\n * « Form Field Width & Layout Standards » des Platform Mandatory UX Patterns.\r\n * Le standard y interdit explicitement les « arbitrary input field widths » et\r\n * les « jagged alignment fields within forms », et impose de mapper chaque\r\n * champ a un gabarit d'apres sa contrainte de CARACTERES :\r\n *\r\n * xs 1 a 5 caracteres code postal, CVV, age\r\n * s 6 a 15 telephone, montant, date, identifiant court\r\n * m 16 a 60 nom, courriel, ville, liste simple\r\n * l 61 a 256 adresse, recherche complexe, longue liste\r\n * xl 257 et plus zone de texte, description, editeur\r\n *\r\n * POURQUOI SUR `Field` ET NON SUR CHAQUE CONTROLE. Le gabarit est une\r\n * contrainte de MISE EN PAGE, pas une propriete de l'input : c'est la boite du\r\n * champ - libelle, controle, indication, erreur - qui doit etre bornee, sinon\r\n * le message d'erreur s'etale sur toute la cellule pendant que l'input est\r\n * borne. `Field` est le seul endroit qui voit cette boite entiere.\r\n *\r\n * POURQUOI UN PLAFOND ET NON UNE LARGEUR FIXE. Le standard exige aussi que les\r\n * champs soient empiles « 100% grid width » sur mobile, et que des champs\r\n * heterogenes s'alignent sur des fractions de colonnes. Un `maxWidth`\r\n * n'est donc pose qu'a partir de `sm` : la grille continue de decider des\r\n * COLONNES, le gabarit borne le champ DANS sa cellule. Les deux regles\r\n * coexistent au lieu de se contredire.\r\n *\r\n * >>> LES CINQ VALEURS SONT UNE DECISION DE DESIGN, PAS UNE LECTURE. Le\r\n * >>> standard donne des FOURCHETTES (« ~80px to 120px max »). J'ai retenu le\r\n * >>> HAUT de chaque fourchette, ces largeurs etant des plafonds : prendre le\r\n * >>> bas tronquerait des valeurs qui tiennent dans la contrainte de\r\n * >>> caracteres annoncee. A confirmer par l'equipe design ; les cinq nombres\r\n * >>> sont exposes en variables CSS pour etre revus sans toucher au code. <<<\r\n */\r\n\r\n/**\r\n * Gabarits de largeur semantique (G-H). Voir la note en tete de fichier.\r\n *\r\n * Les valeurs passent par des variables CSS pour que l'equipe design puisse\r\n * les revoir sans modification de code. Les replis sont le HAUT de chaque\r\n * fourchette du standard, ces largeurs etant des plafonds.\r\n */\r\nexport type FieldWidth = \"xs\" | \"s\" | \"m\" | \"l\" | \"xl\";\r\n\r\n/**\r\n * Exporte pour etre TESTABLE : le plafond ne s'applique qu'a partir de `sm`,\r\n * donc via une requete media qu'`emotion` injecte dans la feuille de style et\r\n * que jsdom ne resout pas. Un test de rendu ne peut donc pas lire la largeur\r\n * effective ; il peut en revanche epingler les cinq valeurs, ce qui est le\r\n * point sensible (elles sont une decision de design, voir la note ci-dessus).\r\n *\r\n * ─── Les variables CSS EXISTENT desormais ─────────────────────────\r\n *\r\n * La note ci-dessus affirmait que les cinq nombres etaient \"exposes en\r\n * variables CSS pour etre revus sans toucher au code\". C'etait FAUX jusqu'a\r\n * l'audit Area 4 d'addm-fe : `cssVariables` n'emettait aucun `--field-w-*`,\r\n * donc seuls les REPLIS ci-dessous rendaient, et la revision annoncee\r\n * n'existait pas.\r\n *\r\n * Les valeurs vivent maintenant dans `tokens.layout.fieldWidth` et sont\r\n * emises. Les replis restent : un hote qui n'appelle jamais\r\n * `injectCssVariables` doit continuer a rendre des largeurs correctes. Les\r\n * deux doivent donc rester d'accord, ce qu'epingle le test de contrat.\r\n */\r\nexport const FIELD_MAX_WIDTH: Record<FieldWidth, string> = {\r\n xs: \"var(--field-w-xs, 120px)\",\r\n s: \"var(--field-w-s, 200px)\",\r\n m: \"var(--field-w-m, 400px)\",\r\n l: \"var(--field-w-l, 600px)\",\r\n xl: \"100%\",\r\n};\r\n\r\nexport interface FieldProps {\r\n label?: React.ReactNode | undefined;\r\n required?: boolean | undefined;\r\n hint?: React.ReactNode | undefined;\r\n error?: React.ReactNode | undefined;\r\n htmlFor?: string | undefined;\r\n fullWidth?: boolean | undefined;\r\n disabled?: boolean | undefined;\r\n /**\r\n * The wrapped child is an ARIA group (RadioGroup / CheckboxGroup) rather than\r\n * a single labelable control. Associates the label via `aria-labelledby`\r\n * instead of `htmlFor` / `id`.\r\n */\r\n group?: boolean | undefined;\r\n /**\r\n * Gabarit de largeur semantique (G-H) : `xs` | `s` | `m` | `l` | `xl`,\r\n * choisi d'apres la contrainte de CARACTERES du champ. Voir la note en tete\r\n * de fichier. Omis = aucun plafond, la cellule de grille decide seule -\r\n * c'est le comportement d'avant G-H, donc rien ne change pour les appelants\r\n * existants.\r\n */\r\n width?: FieldWidth | undefined;\r\n /** Optional <FieldHelp> element rendered next to the label. */\r\n helpAdornment?: React.ReactNode | undefined;\r\n /** The single form-control element to wrap. */\r\n children: React.ReactElement;\r\n sx?: SxProps<Theme> | undefined;\r\n className?: string | undefined;\r\n}\r\n\r\nfunction Field({\r\n label,\r\n required = false,\r\n hint,\r\n error,\r\n htmlFor,\r\n fullWidth = true,\r\n disabled,\r\n group = false,\r\n width,\r\n children,\r\n helpAdornment, // optional <FieldHelp> element\r\n sx,\r\n className,\r\n}: FieldProps) {\r\n // R-I.1 — useId provides SSR-safe, per-instance, stable IDs.\r\n // Replaces the previous module-scoped counter (`let __uid = 0`) which broke\r\n // hydration and Concurrent Mode.\r\n const reactId = React.useId();\r\n const auto = `pui-${reactId.replace(/:/g, \"\")}`;\r\n const inputId = htmlFor || auto;\r\n const hintId = `${inputId}-h`;\r\n const errorId = `${inputId}-e`;\r\n const labelId = `${inputId}-l`;\r\n const hasError = !!error;\r\n\r\n const child = React.Children.only(children);\r\n\r\n /**\r\n * Does this child consume `labelId` (R-I.1)?\r\n *\r\n * A component whose visible surface is a `div[role=\"combobox\"]` cannot be\r\n * named by `htmlFor`/`id`, and cannot receive `aria-labelledby` through\r\n * props either — MUI spreads unknown props onto its root WRAPPER. Those\r\n * components therefore declare a static marker and take MUI's own `labelId`\r\n * channel instead. See the R-I.1 note at the head of this file for the\r\n * attempt that did not work.\r\n *\r\n * A marker rather than a type check: `Field` must not import `Select` (a\r\n * cycle, and it would pull the whole control into every `Field` call site),\r\n * and it cannot infer from the element what its rendered DOM will be.\r\n */\r\n const childType = child.type as { puiLabelTarget?: \"labelId\" } | undefined;\r\n const wantsLabelId = childType?.puiLabelTarget === \"labelId\";\r\n // The wrapped control is polymorphic (Input/Select/NumberInput/Combobox/…);\r\n // type only the props Field reads/merges, replacing React's `props: any`.\r\n const childProps = child.props as {\r\n id?: string;\r\n disabled?: boolean;\r\n fullWidth?: boolean;\r\n \"aria-describedby\"?: string;\r\n \"aria-labelledby\"?: string;\r\n };\r\n\r\n // R-I.3 — MERGE the child's existing aria-describedby with our hint/error\r\n // ids. cloneElement replaces props, so without an explicit merge any\r\n // consumer-supplied describedby was silently discarded.\r\n const describedBy = [\r\n childProps[\"aria-describedby\"],\r\n hint && !hasError ? hintId : null,\r\n hasError ? errorId : null,\r\n ].filter(Boolean).join(\" \") || undefined;\r\n\r\n /**\r\n * R-I.1 — `group` mode only.\r\n *\r\n * The child's own root carries `role=\"group\"`, so an `aria-labelledby`\r\n * passed through props reaches the element that needs it. That is NOT true\r\n * of a MUI control, whose root is a wrapper div — hence `labelId` for those.\r\n * Merged with any consumer-supplied value so it is never lost.\r\n */\r\n const labelledBy = group\r\n ? [childProps[\"aria-labelledby\"], label ? labelId : null]\r\n .filter(Boolean)\r\n .join(\" \") || undefined\r\n : undefined;\r\n\r\n const enhanced = React.cloneElement(child as React.ReactElement<Record<string, unknown>>, {\r\n id: childProps.id || inputId,\r\n \"aria-invalid\": hasError ? \"true\" : undefined,\r\n \"aria-required\": required ? \"true\" : undefined,\r\n \"aria-describedby\": describedBy,\r\n ...(group ? { \"aria-labelledby\": labelledBy } : {}),\r\n /* R-I.1 — MUI's own labelling channel, for the controls that declare they\r\n consume it. `SelectInput` merges this into the combobox's\r\n `aria-labelledby`; nothing else in the tree is touched. */\r\n ...(wantsLabelId && label ? { labelId } : {}),\r\n // `error` / `disabled` are broadcast by FormControl via context for MUI\r\n // inputs, but several v2 inputs (NumberInput, Combobox renderInput) are\r\n // not pure MUI children and read the props directly — keep them explicit.\r\n error: hasError,\r\n disabled: disabled || childProps.disabled,\r\n // Respect the child's explicit fullWidth when defined (e.g. a narrow\r\n // inline filter input). Only fall back to Field's value when the child\r\n // hasn't expressed an opinion.\r\n fullWidth: childProps.fullWidth !== undefined ? childProps.fullWidth : fullWidth,\r\n });\r\n\r\n // R-I.6 — RTL-safe margin reset. `marginLeft: 0` only zeroes the LTR\r\n // inline-start; in [dir=\"rtl\"] the helper picks up MUI's default on\r\n // the (now physical-right but logical-start) side and is mis-aligned.\r\n // `marginInlineStart` resets the correct edge in both directions.\r\n const helperResetSx = { marginInlineStart: 0, fontSize: \"var(--text-xs)\" };\r\n\r\n const LABEL_SX = {\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: \"var(--s-1)\",\r\n fontSize: \"var(--text-xs, 12px)\",\r\n fontWeight: \"var(--fw-semibold, 600)\",\r\n color: \"var(--fg-muted)\",\r\n marginBottom: \"var(--s-2)\",\r\n \"&.Mui-focused\": { color: \"var(--fg-muted)\" },\r\n \"&.Mui-error\": { color: \"var(--fg-muted)\" },\r\n } as const;\r\n\r\n // Shared label content (text + required marker + optional help adornment).\r\n //\r\n // NO wrapper span around `{label}`: an earlier attempt added one to anchor\r\n // the id on the text alone, and it changed what `getByText(\"…\")` returns —\r\n // a host test expecting the `<label>` element got the inner span instead.\r\n // The id stays on the label element, as it always has in `group` mode.\r\n const labelContent = (\r\n <>\r\n {label}\r\n {required && (\r\n <Box\r\n component=\"span\"\r\n aria-hidden=\"true\"\r\n sx={{ color: \"var(--danger)\", fontWeight: \"var(--fw-bold, 700)\" }}\r\n >\r\n *\r\n </Box>\r\n )}\r\n {helpAdornment}\r\n </>\r\n );\r\n\r\n return (\r\n <FormControl\r\n error={hasError}\r\n required={required}\r\n disabled={disabled}\r\n fullWidth={fullWidth}\r\n className={className}\r\n sx={{\r\n /* G-H — plafond a partir de `sm` seulement : sur mobile le standard\r\n * impose 100% de la largeur de grille. */\r\n ...(width\r\n ? { maxWidth: { xs: \"100%\", sm: FIELD_MAX_WIDTH[width] } }\r\n : {}),\r\n ...sx,\r\n }}\r\n >\r\n {label &&\r\n (group ? (\r\n // Group mode: render as a <span> carrying an id (no <label for>),\r\n // referenced by the group's aria-labelledby.\r\n <FormLabel component=\"span\" id={labelId} required={false} sx={LABEL_SX}>\r\n {labelContent}\r\n </FormLabel>\r\n ) : (\r\n // The id is present here too: a child declaring `puiLabelTarget`\r\n // points MUI's `labelId` at this element.\r\n <FormLabel\r\n htmlFor={inputId}\r\n id={labelId}\r\n required={false /* we render the * ourselves */}\r\n sx={LABEL_SX}\r\n >\r\n {labelContent}\r\n </FormLabel>\r\n ))}\r\n\r\n {enhanced}\r\n\r\n {hint && !hasError && (\r\n <FormHelperText\r\n id={hintId}\r\n sx={{ ...helperResetSx, color: \"var(--fg-subtle)\" }}\r\n >\r\n {hint}\r\n </FormHelperText>\r\n )}\r\n\r\n {hasError && (\r\n /*\r\n * Rendered by the shared `FieldError` (gap G-18) rather than an inline\r\n * `FormHelperText`: R-4.1 MUST requires the icon, and a host with a\r\n * LIST-level error (a Formik array, an upload slot) has no single\r\n * control to wrap in a `Field` and needs the exact same renderer\r\n * standalone. One component, both paths, no drift.\r\n *\r\n * `marginTop: var(--s-1)` (4px) replaces `FormHelperText`'s hard-coded\r\n * 3px default — same optical result, on the spacing scale (R-S.1).\r\n * Dropping FormHelperText also removed a `color: … !important` that\r\n * only existed to beat MUI's own `Mui-error` colour.\r\n */\r\n <FieldError id={errorId} sx={{ marginTop: \"var(--s-1)\" }}>\r\n {error}\r\n </FieldError>\r\n )}\r\n </FormControl>\r\n );\r\n}\r\n\r\nexport default Field;\r\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,WAAW,MAAM,2BAA2B;AACnD,OAAOC,SAAS,MAAM,yBAAyB;AAC/C,OAAOC,cAAc,MAAM,8BAA8B;AACzD,OAAOC,GAAG,MAAM,mBAAmB;AAEnC,OAAOC,UAAU,MAAM,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAA2C,GAAG;EACzDC,EAAE,EAAE,0BAA0B;EAC9BC,CAAC,EAAE,yBAAyB;EAC5BC,CAAC,EAAE,yBAAyB;EAC5BC,CAAC,EAAE,yBAAyB;EAC5BC,EAAE,EAAE;AACN,CAAC;AAgCD,SAASC,KAAKA,CAAC;EACbC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC,IAAI;EACJC,KAAK;EACLC,OAAO;EAC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","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
1
  import * as React from "react";
8
2
  import Box from "@mui/material/Box";
9
3
  import ErrorIcon from "@mui/icons-material/ErrorOutlined";
@@ -68,14 +62,15 @@ import ErrorIcon from "@mui/icons-material/ErrorOutlined";
68
62
  * `Mui-error` colour; rendering a plain Box removes the specificity fight.
69
63
  */
70
64
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
71
- function FieldError(_ref) {
72
- var children = _ref.children,
73
- id = _ref.id,
74
- sx = _ref.sx;
65
+ function FieldError({
66
+ children,
67
+ id,
68
+ sx
69
+ }) {
75
70
  return /*#__PURE__*/_jsxs(Box, {
76
71
  role: "alert",
77
72
  id: id,
78
- sx: _objectSpread({
73
+ sx: {
79
74
  display: "flex",
80
75
  // `flex-start`, not `center`: a message that wraps to two lines must
81
76
  // keep its icon aligned with the FIRST line, not vertically centred
@@ -90,8 +85,9 @@ function FieldError(_ref) {
90
85
  lineHeight: "var(--lh-normal)",
91
86
  // RTL-safe: resets the logical inline-start edge, so the message is
92
87
  // flush with the control in both directions.
93
- marginInlineStart: 0
94
- }, sx),
88
+ marginInlineStart: 0,
89
+ ...sx
90
+ },
95
91
  children: [/*#__PURE__*/_jsx(ErrorIcon, {
96
92
  "aria-hidden": "true"
97
93
  /* Test hook — the glyph has no role and no accessible name by design
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.js","names":["React","Box","ErrorIcon","jsx","_jsx","jsxs","_jsxs","FieldError","_ref","children","id","sx","role","_objectSpread","display","alignItems","gap","color","fontSize","fontWeight","lineHeight","marginInlineStart","flexShrink","style","marginTop","component"],"sources":["../../../../src/lib/v2/components/FieldError.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport ErrorIcon from \"@mui/icons-material/ErrorOutlined\";\r\n\r\n/**\r\n * FieldError — Portnet UI v2\r\n *\r\n * Charter R-4.1 MUST: « Toute erreur de champ s'affiche SOUS le champ, en rouge,\r\n * AVEC ICÔNE, max 1 phrase, verbe d'action. »\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-18)\r\n *\r\n * Two defects closed at once, and they were the same defect seen from both ends.\r\n *\r\n * 1. `Field` rendered its error message as a bare `FormHelperText` — red, under\r\n * the field, one sentence, and NO ICON. R-4.1 is a MUST and the canonical\r\n * field wrapper of the design system did not satisfy it, so every module\r\n * inherited the gap on every form.\r\n *\r\n * 2. A field error is not always attached to a `Field`. A LIST-level error\r\n * (`errors.articles`, `errors.autorisationPdf` — a Formik array or an upload\r\n * slot) has no single control to wrap, and `Field` requires exactly one\r\n * `children` element. Hosts therefore hand-rolled the block: addpe-fe's\r\n * `InlineFieldAlert` reimplemented the icon + `role=\"alert\"` + danger token\r\n * recipe locally — and, ironically, was MORE charter-compliant than the\r\n * shared component it could not use.\r\n *\r\n * Owning the renderer here means the two paths cannot drift: the error a user\r\n * sees under an `<Input>` and the one under an articles table are the same\r\n * component.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * Used INSIDE `Field` (it supplies `id`, wired to the control's\r\n * `aria-describedby`), and standalone by a host:\r\n *\r\n * {typeof errors.articles === \"string\" && (\r\n * <FieldError sx={{ marginTop: \"var(--s-2)\" }}>{errors.articles}</FieldError>\r\n * )}\r\n *\r\n * Accessibility\r\n * - `role=\"alert\"`: the element MOUNTS when the error appears, which is what\r\n * makes a screen reader announce it. Do not render it permanently with empty\r\n * content — an always-present live region announces nothing on change.\r\n * - The icon is `aria-hidden`: it is redundant with the message, and R-Ar.2\r\n * forbids a decorative icon carrying an accessible name.\r\n * - Iconography is deliberately the SAME as `Banner`'s error variant\r\n * (`ErrorOutlined`), so \"something is wrong\" reads identically whether it\r\n * surfaces inline or in a banner.\r\n *\r\n * Colour: the message TEXT takes `--danger-fg`, the icon takes `--danger`. That\r\n * split is not cosmetic and it is the rule `KPICard` already documents for its\r\n * delta indicator: `--danger` is the VIVID UI colour, held to WCAG 1.4.11's 3:1\r\n * non-text threshold, while `--danger-fg` is the TEXT colour, held to 1.4.3's\r\n * 4.5:1. Using `--danger` for the message would render it at a ratio calibrated\r\n * for icons and borders — which is what the module-local `InlineFieldAlert` this\r\n * component replaced did, and what `Field`'s own error text did before it\r\n * delegated here. Promoting that mistake into a shared component would have made\r\n * it fleet-wide, on every field error of every module.\r\n *\r\n * No `!important` — the previous `FormHelperText` needed one to beat MUI's own\r\n * `Mui-error` colour; rendering a plain Box removes the specificity fight.\r\n */\r\n\r\nexport interface FieldErrorProps {\r\n /** The message. One sentence, action verb (Charter §09.3). */\r\n children: React.ReactNode;\r\n /**\r\n * DOM id referenced by the control's `aria-describedby`. `Field` supplies it;\r\n * a standalone list-level error usually has nothing to bind to and omits it.\r\n */\r\n id?: string | undefined;\r\n /**\r\n * Spacing / layout overrides. Standalone call sites typically need a\r\n * `marginTop`; inside `Field` the vertical rhythm is already handled.\r\n */\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FieldError({ children, id, sx }: FieldErrorProps) {\r\n return (\r\n <Box\r\n role=\"alert\"\r\n id={id}\r\n sx={{\r\n display: \"flex\",\r\n // `flex-start`, not `center`: a message that wraps to two lines must\r\n // keep its icon aligned with the FIRST line, not vertically centred\r\n // against the whole block.\r\n alignItems: \"flex-start\",\r\n gap: \"var(--s-1)\",\r\n // WCAG 1.4.3 — message text at the 4.5:1-calibrated token, NOT `--danger`\r\n // (see the colour note in this file's header).\r\n color: \"var(--danger-fg)\",\r\n fontSize: \"var(--text-xs)\",\r\n fontWeight: \"var(--fw-medium)\",\r\n lineHeight: \"var(--lh-normal)\",\r\n // RTL-safe: resets the logical inline-start edge, so the message is\r\n // flush with the control in both directions.\r\n marginInlineStart: 0,\r\n ...sx,\r\n }}\r\n >\r\n <ErrorIcon\r\n aria-hidden=\"true\"\r\n /* Test hook — the glyph has no role and no accessible name by design\r\n * (R-Ar.2), so no semantic query reaches it. Same sanctioned escape\r\n * hatch as FileCard's filecard-icon, and it guards the same contract:\r\n * a decorative icon must not be announced. */\r\n data-testid=\"fielderror-icon\"\r\n sx={{\r\n // --text-h3 is the 16px token; matches the message's optical scale.\r\n fontSize: \"var(--text-h3)\",\r\n flexShrink: 0,\r\n // WCAG 1.4.11 — the glyph stays VIVID at the 3:1 non-text threshold,\r\n // which is the whole point of keeping two danger tokens.\r\n color: \"var(--danger)\",\r\n }}\r\n // Optical alignment of the glyph with the first text line. Same\r\n // rationale (and same 1px order of magnitude) as Banner's leading icon:\r\n // a deliberate non-token value, not a spacing-scale concern.\r\n style={{ marginTop: 1 }}\r\n />\r\n <Box component=\"span\">{children}</Box>\r\n </Box>\r\n );\r\n}\r\n\r\nexport default FieldError;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,MAAM,mBAAmB;AAEnC,OAAOC,SAAS,MAAM,mCAAmC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1DA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA2EA,SAASC,UAAUA,CAAAC,IAAA,EAAwC;EAAA,IAArCC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAEC,EAAE,GAAAF,IAAA,CAAFE,EAAE;IAAEC,EAAE,GAAAH,IAAA,CAAFG,EAAE;EACpC,oBACEL,KAAA,CAACL,GAAG;IACFW,IAAI,EAAC,OAAO;IACZF,EAAE,EAAEA,EAAG;IACPC,EAAE,EAAAE,aAAA;MACAC,OAAO,EAAE,MAAM;MACf;MACA;MACA;MACAC,UAAU,EAAE,YAAY;MACxBC,GAAG,EAAE,YAAY;MACjB;MACA;MACAC,KAAK,EAAE,kBAAkB;MACzBC,QAAQ,EAAE,gBAAgB;MAC1BC,UAAU,EAAE,kBAAkB;MAC9BC,UAAU,EAAE,kBAAkB;MAC9B;MACA;MACAC,iBAAiB,EAAE;IAAC,GACjBV,EAAE,CACL;IAAAF,QAAA,gBAEFL,IAAA,CAACF,SAAS;MACR,eAAY;MACZ;AACR;AACA;AACA,oDAHQ;MAIA,eAAY,iBAAiB;MAC7BS,EAAE,EAAE;QACF;QACAO,QAAQ,EAAE,gBAAgB;QAC1BI,UAAU,EAAE,CAAC;QACb;QACA;QACAL,KAAK,EAAE;MACT;MACA;MACA;MACA;MAAA;MACAM,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAE;IAAE,CACzB,CAAC,eACFpB,IAAA,CAACH,GAAG;MAACwB,SAAS,EAAC,MAAM;MAAAhB,QAAA,EAAEA;IAAQ,CAAM,CAAC;EAAA,CACnC,CAAC;AAEV;AAEA,eAAeF,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"FieldError.js","names":["React","Box","ErrorIcon","jsx","_jsx","jsxs","_jsxs","FieldError","children","id","sx","role","display","alignItems","gap","color","fontSize","fontWeight","lineHeight","marginInlineStart","flexShrink","style","marginTop","component"],"sources":["../../../../src/lib/v2/components/FieldError.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport ErrorIcon from \"@mui/icons-material/ErrorOutlined\";\r\n\r\n/**\r\n * FieldError — Portnet UI v2\r\n *\r\n * Charter R-4.1 MUST: « Toute erreur de champ s'affiche SOUS le champ, en rouge,\r\n * AVEC ICÔNE, max 1 phrase, verbe d'action. »\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-18)\r\n *\r\n * Two defects closed at once, and they were the same defect seen from both ends.\r\n *\r\n * 1. `Field` rendered its error message as a bare `FormHelperText` — red, under\r\n * the field, one sentence, and NO ICON. R-4.1 is a MUST and the canonical\r\n * field wrapper of the design system did not satisfy it, so every module\r\n * inherited the gap on every form.\r\n *\r\n * 2. A field error is not always attached to a `Field`. A LIST-level error\r\n * (`errors.articles`, `errors.autorisationPdf` — a Formik array or an upload\r\n * slot) has no single control to wrap, and `Field` requires exactly one\r\n * `children` element. Hosts therefore hand-rolled the block: addpe-fe's\r\n * `InlineFieldAlert` reimplemented the icon + `role=\"alert\"` + danger token\r\n * recipe locally — and, ironically, was MORE charter-compliant than the\r\n * shared component it could not use.\r\n *\r\n * Owning the renderer here means the two paths cannot drift: the error a user\r\n * sees under an `<Input>` and the one under an articles table are the same\r\n * component.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * Used INSIDE `Field` (it supplies `id`, wired to the control's\r\n * `aria-describedby`), and standalone by a host:\r\n *\r\n * {typeof errors.articles === \"string\" && (\r\n * <FieldError sx={{ marginTop: \"var(--s-2)\" }}>{errors.articles}</FieldError>\r\n * )}\r\n *\r\n * Accessibility\r\n * - `role=\"alert\"`: the element MOUNTS when the error appears, which is what\r\n * makes a screen reader announce it. Do not render it permanently with empty\r\n * content — an always-present live region announces nothing on change.\r\n * - The icon is `aria-hidden`: it is redundant with the message, and R-Ar.2\r\n * forbids a decorative icon carrying an accessible name.\r\n * - Iconography is deliberately the SAME as `Banner`'s error variant\r\n * (`ErrorOutlined`), so \"something is wrong\" reads identically whether it\r\n * surfaces inline or in a banner.\r\n *\r\n * Colour: the message TEXT takes `--danger-fg`, the icon takes `--danger`. That\r\n * split is not cosmetic and it is the rule `KPICard` already documents for its\r\n * delta indicator: `--danger` is the VIVID UI colour, held to WCAG 1.4.11's 3:1\r\n * non-text threshold, while `--danger-fg` is the TEXT colour, held to 1.4.3's\r\n * 4.5:1. Using `--danger` for the message would render it at a ratio calibrated\r\n * for icons and borders — which is what the module-local `InlineFieldAlert` this\r\n * component replaced did, and what `Field`'s own error text did before it\r\n * delegated here. Promoting that mistake into a shared component would have made\r\n * it fleet-wide, on every field error of every module.\r\n *\r\n * No `!important` — the previous `FormHelperText` needed one to beat MUI's own\r\n * `Mui-error` colour; rendering a plain Box removes the specificity fight.\r\n */\r\n\r\nexport interface FieldErrorProps {\r\n /** The message. One sentence, action verb (Charter §09.3). */\r\n children: React.ReactNode;\r\n /**\r\n * DOM id referenced by the control's `aria-describedby`. `Field` supplies it;\r\n * a standalone list-level error usually has nothing to bind to and omits it.\r\n */\r\n id?: string | undefined;\r\n /**\r\n * Spacing / layout overrides. Standalone call sites typically need a\r\n * `marginTop`; inside `Field` the vertical rhythm is already handled.\r\n */\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FieldError({ children, id, sx }: FieldErrorProps) {\r\n return (\r\n <Box\r\n role=\"alert\"\r\n id={id}\r\n sx={{\r\n display: \"flex\",\r\n // `flex-start`, not `center`: a message that wraps to two lines must\r\n // keep its icon aligned with the FIRST line, not vertically centred\r\n // against the whole block.\r\n alignItems: \"flex-start\",\r\n gap: \"var(--s-1)\",\r\n // WCAG 1.4.3 — message text at the 4.5:1-calibrated token, NOT `--danger`\r\n // (see the colour note in this file's header).\r\n color: \"var(--danger-fg)\",\r\n fontSize: \"var(--text-xs)\",\r\n fontWeight: \"var(--fw-medium)\",\r\n lineHeight: \"var(--lh-normal)\",\r\n // RTL-safe: resets the logical inline-start edge, so the message is\r\n // flush with the control in both directions.\r\n marginInlineStart: 0,\r\n ...sx,\r\n }}\r\n >\r\n <ErrorIcon\r\n aria-hidden=\"true\"\r\n /* Test hook — the glyph has no role and no accessible name by design\r\n * (R-Ar.2), so no semantic query reaches it. Same sanctioned escape\r\n * hatch as FileCard's filecard-icon, and it guards the same contract:\r\n * a decorative icon must not be announced. */\r\n data-testid=\"fielderror-icon\"\r\n sx={{\r\n // --text-h3 is the 16px token; matches the message's optical scale.\r\n fontSize: \"var(--text-h3)\",\r\n flexShrink: 0,\r\n // WCAG 1.4.11 — the glyph stays VIVID at the 3:1 non-text threshold,\r\n // which is the whole point of keeping two danger tokens.\r\n color: \"var(--danger)\",\r\n }}\r\n // Optical alignment of the glyph with the first text line. Same\r\n // rationale (and same 1px order of magnitude) as Banner's leading icon:\r\n // a deliberate non-token value, not a spacing-scale concern.\r\n style={{ marginTop: 1 }}\r\n />\r\n <Box component=\"span\">{children}</Box>\r\n </Box>\r\n );\r\n}\r\n\r\nexport default FieldError;\r\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,MAAM,mBAAmB;AAEnC,OAAOC,SAAS,MAAM,mCAAmC;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1DA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AA2EA,SAASC,UAAUA,CAAC;EAAEC,QAAQ;EAAEC,EAAE;EAAEC;AAAoB,CAAC,EAAE;EACzD,oBACEJ,KAAA,CAACL,GAAG;IACFU,IAAI,EAAC,OAAO;IACZF,EAAE,EAAEA,EAAG;IACPC,EAAE,EAAE;MACFE,OAAO,EAAE,MAAM;MACf;MACA;MACA;MACAC,UAAU,EAAE,YAAY;MACxBC,GAAG,EAAE,YAAY;MACjB;MACA;MACAC,KAAK,EAAE,kBAAkB;MACzBC,QAAQ,EAAE,gBAAgB;MAC1BC,UAAU,EAAE,kBAAkB;MAC9BC,UAAU,EAAE,kBAAkB;MAC9B;MACA;MACAC,iBAAiB,EAAE,CAAC;MACpB,GAAGT;IACL,CAAE;IAAAF,QAAA,gBAEFJ,IAAA,CAACF,SAAS;MACR,eAAY;MACZ;AACR;AACA;AACA,oDAHQ;MAIA,eAAY,iBAAiB;MAC7BQ,EAAE,EAAE;QACF;QACAM,QAAQ,EAAE,gBAAgB;QAC1BI,UAAU,EAAE,CAAC;QACb;QACA;QACAL,KAAK,EAAE;MACT;MACA;MACA;MACA;MAAA;MACAM,KAAK,EAAE;QAAEC,SAAS,EAAE;MAAE;IAAE,CACzB,CAAC,eACFlB,IAAA,CAACH,GAAG;MAACsB,SAAS,EAAC,MAAM;MAAAf,QAAA,EAAEA;IAAQ,CAAM,CAAC;EAAA,CACnC,CAAC;AAEV;AAEA,eAAeD,UAAU","ignoreList":[]}