@portnet/ui 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (748) hide show
  1. package/dist/esm/index.js +196 -0
  2. package/dist/esm/index.js.map +1 -0
  3. package/dist/esm/v2/__tests__/FieldError.test.js +160 -0
  4. package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -0
  5. package/dist/esm/v2/__tests__/FileCard.test.js +144 -0
  6. package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -0
  7. package/dist/esm/v2/__tests__/MobileRowCard.test.js +333 -0
  8. package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -0
  9. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +235 -0
  10. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
  11. package/dist/esm/v2/__tests__/apiError.test.js +181 -0
  12. package/dist/esm/v2/__tests__/apiError.test.js.map +1 -0
  13. package/dist/esm/v2/__tests__/banned-patterns.test.js +270 -0
  14. package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -0
  15. package/dist/esm/v2/__tests__/contrast-palette.test.js +224 -0
  16. package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -0
  17. package/dist/esm/v2/__tests__/cssVariables.test.js +157 -0
  18. package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -0
  19. package/dist/esm/v2/__tests__/labels-merge.test.js +147 -0
  20. package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -0
  21. package/dist/esm/v2/__tests__/locale-fallback.test.js +109 -0
  22. package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -0
  23. package/dist/esm/v2/__tests__/useFocusTrap.test.js +514 -0
  24. package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -0
  25. package/dist/esm/v2/components/Accordion.js +230 -0
  26. package/dist/esm/v2/components/Accordion.js.map +1 -0
  27. package/dist/esm/v2/components/ActionStrip.js +146 -0
  28. package/dist/esm/v2/components/ActionStrip.js.map +1 -0
  29. package/dist/esm/v2/components/Banner.js +254 -0
  30. package/dist/esm/v2/components/Banner.js.map +1 -0
  31. package/dist/esm/v2/components/Busy.js +97 -0
  32. package/dist/esm/v2/components/Busy.js.map +1 -0
  33. package/dist/esm/v2/components/Button.js +114 -0
  34. package/dist/esm/v2/components/Button.js.map +1 -0
  35. package/dist/esm/v2/components/CategoryTag.js +81 -0
  36. package/dist/esm/v2/components/CategoryTag.js.map +1 -0
  37. package/dist/esm/v2/components/Checkbox.js +124 -0
  38. package/dist/esm/v2/components/Checkbox.js.map +1 -0
  39. package/dist/esm/v2/components/Chip.js +124 -0
  40. package/dist/esm/v2/components/Chip.js.map +1 -0
  41. package/dist/esm/v2/components/Combobox.js +394 -0
  42. package/dist/esm/v2/components/Combobox.js.map +1 -0
  43. package/dist/esm/v2/components/CommandPalette.js +660 -0
  44. package/dist/esm/v2/components/CommandPalette.js.map +1 -0
  45. package/dist/esm/v2/components/ConfirmDialog.js +144 -0
  46. package/dist/esm/v2/components/ConfirmDialog.js.map +1 -0
  47. package/dist/esm/v2/components/DatePicker.js +200 -0
  48. package/dist/esm/v2/components/DatePicker.js.map +1 -0
  49. package/dist/esm/v2/components/DateRangePicker.js +289 -0
  50. package/dist/esm/v2/components/DateRangePicker.js.map +1 -0
  51. package/dist/esm/v2/components/DateTimePicker.js +182 -0
  52. package/dist/esm/v2/components/DateTimePicker.js.map +1 -0
  53. package/dist/esm/v2/components/Drawer.js +333 -0
  54. package/dist/esm/v2/components/Drawer.js.map +1 -0
  55. package/dist/esm/v2/components/Dropzone.js +540 -0
  56. package/dist/esm/v2/components/Dropzone.js.map +1 -0
  57. package/dist/esm/v2/components/EmptyState.js +102 -0
  58. package/dist/esm/v2/components/EmptyState.js.map +1 -0
  59. package/dist/esm/v2/components/FavoriteToggle.js +127 -0
  60. package/dist/esm/v2/components/FavoriteToggle.js.map +1 -0
  61. package/dist/esm/v2/components/Field.js +197 -0
  62. package/dist/esm/v2/components/Field.js.map +1 -0
  63. package/dist/esm/v2/components/FieldError.js +124 -0
  64. package/dist/esm/v2/components/FieldError.js.map +1 -0
  65. package/dist/esm/v2/components/FieldHelp.js +202 -0
  66. package/dist/esm/v2/components/FieldHelp.js.map +1 -0
  67. package/dist/esm/v2/components/FileCard.js +162 -0
  68. package/dist/esm/v2/components/FileCard.js.map +1 -0
  69. package/dist/esm/v2/components/FilterTab.js +138 -0
  70. package/dist/esm/v2/components/FilterTab.js.map +1 -0
  71. package/dist/esm/v2/components/ForbiddenPage.js +74 -0
  72. package/dist/esm/v2/components/ForbiddenPage.js.map +1 -0
  73. package/dist/esm/v2/components/FormGrid.js +179 -0
  74. package/dist/esm/v2/components/FormGrid.js.map +1 -0
  75. package/dist/esm/v2/components/FormikDisplay.js +118 -0
  76. package/dist/esm/v2/components/FormikDisplay.js.map +1 -0
  77. package/dist/esm/v2/components/Input.js +107 -0
  78. package/dist/esm/v2/components/Input.js.map +1 -0
  79. package/dist/esm/v2/components/KPICard.js +237 -0
  80. package/dist/esm/v2/components/KPICard.js.map +1 -0
  81. package/dist/esm/v2/components/KPIStrip.js +84 -0
  82. package/dist/esm/v2/components/KPIStrip.js.map +1 -0
  83. package/dist/esm/v2/components/KV.js +75 -0
  84. package/dist/esm/v2/components/KV.js.map +1 -0
  85. package/dist/esm/v2/components/KVGrid.js +74 -0
  86. package/dist/esm/v2/components/KVGrid.js.map +1 -0
  87. package/dist/esm/v2/components/Layout.js +284 -0
  88. package/dist/esm/v2/components/Layout.js.map +1 -0
  89. package/dist/esm/v2/components/MobileRowCard.js +314 -0
  90. package/dist/esm/v2/components/MobileRowCard.js.map +1 -0
  91. package/dist/esm/v2/components/Modal.js +276 -0
  92. package/dist/esm/v2/components/Modal.js.map +1 -0
  93. package/dist/esm/v2/components/NetworkErrorPage.js +78 -0
  94. package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -0
  95. package/dist/esm/v2/components/NotFoundPage.js +58 -0
  96. package/dist/esm/v2/components/NotFoundPage.js.map +1 -0
  97. package/dist/esm/v2/components/NumberInput.js +309 -0
  98. package/dist/esm/v2/components/NumberInput.js.map +1 -0
  99. package/dist/esm/v2/components/OverflowMenu.js +184 -0
  100. package/dist/esm/v2/components/OverflowMenu.js.map +1 -0
  101. package/dist/esm/v2/components/PdfViewer.js +122 -0
  102. package/dist/esm/v2/components/PdfViewer.js.map +1 -0
  103. package/dist/esm/v2/components/ProgressBar.js +202 -0
  104. package/dist/esm/v2/components/ProgressBar.js.map +1 -0
  105. package/dist/esm/v2/components/Radio.js +228 -0
  106. package/dist/esm/v2/components/Radio.js.map +1 -0
  107. package/dist/esm/v2/components/SectionErrorBoundary.js +214 -0
  108. package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -0
  109. package/dist/esm/v2/components/SectionHeader.js +132 -0
  110. package/dist/esm/v2/components/SectionHeader.js.map +1 -0
  111. package/dist/esm/v2/components/Segmented.js +254 -0
  112. package/dist/esm/v2/components/Segmented.js.map +1 -0
  113. package/dist/esm/v2/components/Select.js +490 -0
  114. package/dist/esm/v2/components/Select.js.map +1 -0
  115. package/dist/esm/v2/components/ServerErrorPage.js +74 -0
  116. package/dist/esm/v2/components/ServerErrorPage.js.map +1 -0
  117. package/dist/esm/v2/components/Skeleton.js +269 -0
  118. package/dist/esm/v2/components/Skeleton.js.map +1 -0
  119. package/dist/esm/v2/components/SkipLink.js +49 -0
  120. package/dist/esm/v2/components/SkipLink.js.map +1 -0
  121. package/dist/esm/v2/components/Spinner.js +69 -0
  122. package/dist/esm/v2/components/Spinner.js.map +1 -0
  123. package/dist/esm/v2/components/Status.js +64 -0
  124. package/dist/esm/v2/components/Status.js.map +1 -0
  125. package/dist/esm/v2/components/Stepper.js +432 -0
  126. package/dist/esm/v2/components/Stepper.js.map +1 -0
  127. package/dist/esm/v2/components/Surface.js +159 -0
  128. package/dist/esm/v2/components/Surface.js.map +1 -0
  129. package/dist/esm/v2/components/Switch.js +128 -0
  130. package/dist/esm/v2/components/Switch.js.map +1 -0
  131. package/dist/esm/v2/components/Tabs.js +150 -0
  132. package/dist/esm/v2/components/Tabs.js.map +1 -0
  133. package/dist/esm/v2/components/TelInput.js +274 -0
  134. package/dist/esm/v2/components/TelInput.js.map +1 -0
  135. package/dist/esm/v2/components/Textarea.js +72 -0
  136. package/dist/esm/v2/components/Textarea.js.map +1 -0
  137. package/dist/esm/v2/components/TimePicker.js +134 -0
  138. package/dist/esm/v2/components/TimePicker.js.map +1 -0
  139. package/dist/esm/v2/components/Toast.js +376 -0
  140. package/dist/esm/v2/components/Toast.js.map +1 -0
  141. package/dist/esm/v2/components/Tooltip.js +161 -0
  142. package/dist/esm/v2/components/Tooltip.js.map +1 -0
  143. package/dist/esm/v2/components/_ErrorPageBody.js +85 -0
  144. package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -0
  145. package/dist/esm/v2/components/_pickerShared.js +60 -0
  146. package/dist/esm/v2/components/_pickerShared.js.map +1 -0
  147. package/dist/esm/v2/components/index.js +244 -0
  148. package/dist/esm/v2/components/index.js.map +1 -0
  149. package/dist/esm/v2/hooks/index.js +10 -0
  150. package/dist/esm/v2/hooks/index.js.map +1 -0
  151. package/dist/esm/v2/hooks/useDelayedFlag.js +55 -0
  152. package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -0
  153. package/dist/esm/v2/hooks/useDensity.js +119 -0
  154. package/dist/esm/v2/hooks/useDensity.js.map +1 -0
  155. package/dist/esm/v2/hooks/useFocusFirstError.js +197 -0
  156. package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -0
  157. package/dist/esm/v2/hooks/useFocusTrap.js +202 -0
  158. package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -0
  159. package/dist/esm/v2/hooks/useFormAutoSave.js +181 -0
  160. package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -0
  161. package/dist/esm/v2/hooks/useFormCompletionProgress.js +131 -0
  162. package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -0
  163. package/dist/esm/v2/hooks/useResolvedDensity.js +44 -0
  164. package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -0
  165. package/dist/esm/v2/hooks/useSortedRows.js +32 -0
  166. package/dist/esm/v2/hooks/useSortedRows.js.map +1 -0
  167. package/dist/esm/v2/hooks/useTabLoading.js +79 -0
  168. package/dist/esm/v2/hooks/useTabLoading.js.map +1 -0
  169. package/dist/esm/v2/index.js +121 -0
  170. package/dist/esm/v2/index.js.map +1 -0
  171. package/dist/esm/v2/modalContext.js +108 -0
  172. package/dist/esm/v2/modalContext.js.map +1 -0
  173. package/dist/esm/v2/models/favorite.js +2 -0
  174. package/dist/esm/v2/models/favorite.js.map +1 -0
  175. package/dist/esm/v2/models/index.js +12 -0
  176. package/dist/esm/v2/models/index.js.map +1 -0
  177. package/dist/esm/v2/models/personalization.js +2 -0
  178. package/dist/esm/v2/models/personalization.js.map +1 -0
  179. package/dist/esm/v2/models/referentiel.js +2 -0
  180. package/dist/esm/v2/models/referentiel.js.map +1 -0
  181. package/dist/esm/v2/models/savedFilter.js +2 -0
  182. package/dist/esm/v2/models/savedFilter.js.map +1 -0
  183. package/dist/esm/v2/patterns/ActionBar.js +603 -0
  184. package/dist/esm/v2/patterns/ActionBar.js.map +1 -0
  185. package/dist/esm/v2/patterns/BulkActionBar.js +147 -0
  186. package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -0
  187. package/dist/esm/v2/patterns/CollapsibleDataGrid.js +303 -0
  188. package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -0
  189. package/dist/esm/v2/patterns/ColumnsToggle.js +301 -0
  190. package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -0
  191. package/dist/esm/v2/patterns/DataGrid.js +820 -0
  192. package/dist/esm/v2/patterns/DataGrid.js.map +1 -0
  193. package/dist/esm/v2/patterns/DataGridSettingsMenu.js +375 -0
  194. package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -0
  195. package/dist/esm/v2/patterns/DataGridToolbar.js +249 -0
  196. package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -0
  197. package/dist/esm/v2/patterns/DataGridVirtualized.js +523 -0
  198. package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -0
  199. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +70 -0
  200. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
  201. package/dist/esm/v2/patterns/FavoriteColumn.js +164 -0
  202. package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -0
  203. package/dist/esm/v2/patterns/FavoritesFilter.js +91 -0
  204. package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -0
  205. package/dist/esm/v2/patterns/FormErrorSummary.js +101 -0
  206. package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -0
  207. package/dist/esm/v2/patterns/FormPageShell.js +126 -0
  208. package/dist/esm/v2/patterns/FormPageShell.js.map +1 -0
  209. package/dist/esm/v2/patterns/FormSection.js +190 -0
  210. package/dist/esm/v2/patterns/FormSection.js.map +1 -0
  211. package/dist/esm/v2/patterns/FormikCheckboxGroup.js +110 -0
  212. package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -0
  213. package/dist/esm/v2/patterns/FormikCombobox.js +115 -0
  214. package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -0
  215. package/dist/esm/v2/patterns/FormikDatePicker.js +196 -0
  216. package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -0
  217. package/dist/esm/v2/patterns/FormikErrorFocus.js +77 -0
  218. package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -0
  219. package/dist/esm/v2/patterns/FormikFile.js +148 -0
  220. package/dist/esm/v2/patterns/FormikFile.js.map +1 -0
  221. package/dist/esm/v2/patterns/FormikInput.js +127 -0
  222. package/dist/esm/v2/patterns/FormikInput.js.map +1 -0
  223. package/dist/esm/v2/patterns/FormikReferentielField.js +116 -0
  224. package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -0
  225. package/dist/esm/v2/patterns/FormikSelect.js +159 -0
  226. package/dist/esm/v2/patterns/FormikSelect.js.map +1 -0
  227. package/dist/esm/v2/patterns/FormikTextarea.js +76 -0
  228. package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -0
  229. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +195 -0
  230. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
  231. package/dist/esm/v2/patterns/NetworkErrorBanner.js +72 -0
  232. package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -0
  233. package/dist/esm/v2/patterns/PageContent.js +62 -0
  234. package/dist/esm/v2/patterns/PageContent.js.map +1 -0
  235. package/dist/esm/v2/patterns/ReferentielField.js +615 -0
  236. package/dist/esm/v2/patterns/ReferentielField.js.map +1 -0
  237. package/dist/esm/v2/patterns/SaveFilterDialog.js +197 -0
  238. package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -0
  239. package/dist/esm/v2/patterns/SavedFiltersMenu.js +406 -0
  240. package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -0
  241. package/dist/esm/v2/patterns/SkeletonPageShell.js +342 -0
  242. package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -0
  243. package/dist/esm/v2/patterns/SortableHeader.js +179 -0
  244. package/dist/esm/v2/patterns/SortableHeader.js.map +1 -0
  245. package/dist/esm/v2/patterns/Tour.js +471 -0
  246. package/dist/esm/v2/patterns/Tour.js.map +1 -0
  247. package/dist/esm/v2/patterns/_dataGridShared.js +431 -0
  248. package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -0
  249. package/dist/esm/v2/patterns/_sort.js +112 -0
  250. package/dist/esm/v2/patterns/_sort.js.map +1 -0
  251. package/dist/esm/v2/patterns/_useColumnReorder.js +257 -0
  252. package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -0
  253. package/dist/esm/v2/patterns/_useColumnResize.js +191 -0
  254. package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -0
  255. package/dist/esm/v2/patterns/index.js +95 -0
  256. package/dist/esm/v2/patterns/index.js.map +1 -0
  257. package/dist/esm/v2/personalization/PersonalizationProvider.js +168 -0
  258. package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -0
  259. package/dist/esm/v2/personalization/adapters/_storageKey.js +60 -0
  260. package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -0
  261. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +124 -0
  262. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
  263. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +70 -0
  264. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
  265. package/dist/esm/v2/personalization/adapters/index.js +11 -0
  266. package/dist/esm/v2/personalization/adapters/index.js.map +1 -0
  267. package/dist/esm/v2/personalization/capabilities/favorites.js +216 -0
  268. package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -0
  269. package/dist/esm/v2/personalization/capabilities/favoritesView.js +111 -0
  270. package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -0
  271. package/dist/esm/v2/personalization/capabilities/index.js +17 -0
  272. package/dist/esm/v2/personalization/capabilities/index.js.map +1 -0
  273. package/dist/esm/v2/personalization/capabilities/savedFilters.js +291 -0
  274. package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -0
  275. package/dist/esm/v2/personalization/createPersonalizationStore.js +472 -0
  276. package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -0
  277. package/dist/esm/v2/personalization/index.js +46 -0
  278. package/dist/esm/v2/personalization/index.js.map +1 -0
  279. package/dist/esm/v2/personalization/personalizationContext.js +108 -0
  280. package/dist/esm/v2/personalization/personalizationContext.js.map +1 -0
  281. package/dist/esm/v2/personalization/schema.js +92 -0
  282. package/dist/esm/v2/personalization/schema.js.map +1 -0
  283. package/dist/esm/v2/personalization/types.js +2 -0
  284. package/dist/esm/v2/personalization/types.js.map +1 -0
  285. package/dist/esm/v2/referentiel/ReferentielProvider.js +87 -0
  286. package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -0
  287. package/dist/esm/v2/referentiel/index.js +15 -0
  288. package/dist/esm/v2/referentiel/index.js.map +1 -0
  289. package/dist/esm/v2/referentiel/useReferentielClient.js +37 -0
  290. package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -0
  291. package/dist/esm/v2/referentiel/useReferentielOptions.js +169 -0
  292. package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -0
  293. package/dist/esm/v2/referentiel/useReferentielSearch.js +132 -0
  294. package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -0
  295. package/dist/esm/v2/styles/base.css +425 -0
  296. package/dist/esm/v2/styles/css.d.ts +10 -0
  297. package/dist/esm/v2/styles/index.js +12 -0
  298. package/dist/esm/v2/styles/index.js.map +1 -0
  299. package/dist/esm/v2/theme/_brand.js +64 -0
  300. package/dist/esm/v2/theme/_brand.js.map +1 -0
  301. package/dist/esm/v2/theme/_brandSecondary.js +60 -0
  302. package/dist/esm/v2/theme/_brandSecondary.js.map +1 -0
  303. package/dist/esm/v2/theme/createPortnetTheme.js +548 -0
  304. package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -0
  305. package/dist/esm/v2/theme/cssVariables.js +198 -0
  306. package/dist/esm/v2/theme/cssVariables.js.map +1 -0
  307. package/dist/esm/v2/theme/index.js +32 -0
  308. package/dist/esm/v2/theme/index.js.map +1 -0
  309. package/dist/esm/v2/tokens/breakpoints.js +106 -0
  310. package/dist/esm/v2/tokens/breakpoints.js.map +1 -0
  311. package/dist/esm/v2/tokens/colors.js +219 -0
  312. package/dist/esm/v2/tokens/colors.js.map +1 -0
  313. package/dist/esm/v2/tokens/density.js +98 -0
  314. package/dist/esm/v2/tokens/density.js.map +1 -0
  315. package/dist/esm/v2/tokens/index.js +80 -0
  316. package/dist/esm/v2/tokens/index.js.map +1 -0
  317. package/dist/esm/v2/tokens/motion.js +88 -0
  318. package/dist/esm/v2/tokens/motion.js.map +1 -0
  319. package/dist/esm/v2/tokens/radius.js +22 -0
  320. package/dist/esm/v2/tokens/radius.js.map +1 -0
  321. package/dist/esm/v2/tokens/shadows.js +40 -0
  322. package/dist/esm/v2/tokens/shadows.js.map +1 -0
  323. package/dist/esm/v2/tokens/spacing.js +51 -0
  324. package/dist/esm/v2/tokens/spacing.js.map +1 -0
  325. package/dist/esm/v2/tokens/state.js +41 -0
  326. package/dist/esm/v2/tokens/state.js.map +1 -0
  327. package/dist/esm/v2/tokens/statusPalette.js +66 -0
  328. package/dist/esm/v2/tokens/statusPalette.js.map +1 -0
  329. package/dist/esm/v2/tokens/tokens.json +153 -0
  330. package/dist/esm/v2/tokens/typography.js +149 -0
  331. package/dist/esm/v2/tokens/typography.js.map +1 -0
  332. package/dist/esm/v2/tokens/zIndex.js +44 -0
  333. package/dist/esm/v2/tokens/zIndex.js.map +1 -0
  334. package/dist/esm/v2/types/common.js +2 -0
  335. package/dist/esm/v2/types/common.js.map +1 -0
  336. package/dist/esm/v2/types/datagrid.js +2 -0
  337. package/dist/esm/v2/types/datagrid.js.map +1 -0
  338. package/dist/esm/v2/types/index.js +12 -0
  339. package/dist/esm/v2/types/index.js.map +1 -0
  340. package/dist/esm/v2/utils/apiError.js +281 -0
  341. package/dist/esm/v2/utils/apiError.js.map +1 -0
  342. package/dist/esm/v2/utils/contrast.js +157 -0
  343. package/dist/esm/v2/utils/contrast.js.map +1 -0
  344. package/dist/esm/v2/utils/cx.js +38 -0
  345. package/dist/esm/v2/utils/cx.js.map +1 -0
  346. package/dist/esm/v2/utils/fileDownload.js +226 -0
  347. package/dist/esm/v2/utils/fileDownload.js.map +1 -0
  348. package/dist/esm/v2/utils/fmtMoney.js +78 -0
  349. package/dist/esm/v2/utils/fmtMoney.js.map +1 -0
  350. package/dist/esm/v2/utils/index.js +43 -0
  351. package/dist/esm/v2/utils/index.js.map +1 -0
  352. package/dist/esm/v2/utils/mergeLabels.js +86 -0
  353. package/dist/esm/v2/utils/mergeLabels.js.map +1 -0
  354. package/dist/esm/v2/utils/networkStatus.js +114 -0
  355. package/dist/esm/v2/utils/networkStatus.js.map +1 -0
  356. package/dist/index.d.ts +3 -2
  357. package/dist/index.d.ts.map +1 -1
  358. package/dist/index.js +21 -0
  359. package/dist/index.js.map +1 -1
  360. package/dist/v2/__tests__/FieldError.test.js +164 -0
  361. package/dist/v2/__tests__/FieldError.test.js.map +1 -0
  362. package/dist/v2/__tests__/FileCard.test.js +148 -0
  363. package/dist/v2/__tests__/FileCard.test.js.map +1 -0
  364. package/dist/v2/__tests__/SectionErrorBoundary.test.js +237 -0
  365. package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
  366. package/dist/v2/components/Accordion.d.ts +6 -6
  367. package/dist/v2/components/Accordion.d.ts.map +1 -1
  368. package/dist/v2/components/Accordion.js.map +1 -1
  369. package/dist/v2/components/ActionStrip.d.ts +12 -12
  370. package/dist/v2/components/ActionStrip.d.ts.map +1 -1
  371. package/dist/v2/components/ActionStrip.js.map +1 -1
  372. package/dist/v2/components/Banner.d.ts +48 -9
  373. package/dist/v2/components/Banner.d.ts.map +1 -1
  374. package/dist/v2/components/Banner.js +116 -35
  375. package/dist/v2/components/Banner.js.map +1 -1
  376. package/dist/v2/components/Busy.d.ts +3 -3
  377. package/dist/v2/components/Busy.d.ts.map +1 -1
  378. package/dist/v2/components/Busy.js.map +1 -1
  379. package/dist/v2/components/Button.d.ts +6 -6
  380. package/dist/v2/components/Button.d.ts.map +1 -1
  381. package/dist/v2/components/Button.js.map +1 -1
  382. package/dist/v2/components/CategoryTag.d.ts +3 -3
  383. package/dist/v2/components/CategoryTag.d.ts.map +1 -1
  384. package/dist/v2/components/CategoryTag.js.map +1 -1
  385. package/dist/v2/components/Checkbox.d.ts +11 -11
  386. package/dist/v2/components/Checkbox.d.ts.map +1 -1
  387. package/dist/v2/components/Checkbox.js.map +1 -1
  388. package/dist/v2/components/Chip.d.ts +8 -8
  389. package/dist/v2/components/Chip.d.ts.map +1 -1
  390. package/dist/v2/components/Chip.js +2 -1
  391. package/dist/v2/components/Chip.js.map +1 -1
  392. package/dist/v2/components/Combobox.d.ts +27 -27
  393. package/dist/v2/components/Combobox.d.ts.map +1 -1
  394. package/dist/v2/components/Combobox.js +3 -2
  395. package/dist/v2/components/Combobox.js.map +1 -1
  396. package/dist/v2/components/CommandPalette.d.ts +20 -20
  397. package/dist/v2/components/CommandPalette.d.ts.map +1 -1
  398. package/dist/v2/components/CommandPalette.js +2 -6
  399. package/dist/v2/components/CommandPalette.js.map +1 -1
  400. package/dist/v2/components/ConfirmDialog.d.ts +13 -13
  401. package/dist/v2/components/ConfirmDialog.d.ts.map +1 -1
  402. package/dist/v2/components/ConfirmDialog.js +2 -1
  403. package/dist/v2/components/ConfirmDialog.js.map +1 -1
  404. package/dist/v2/components/DatePicker.d.ts +11 -11
  405. package/dist/v2/components/DatePicker.d.ts.map +1 -1
  406. package/dist/v2/components/DatePicker.js.map +1 -1
  407. package/dist/v2/components/DateRangePicker.d.ts +16 -16
  408. package/dist/v2/components/DateRangePicker.d.ts.map +1 -1
  409. package/dist/v2/components/DateRangePicker.js +2 -1
  410. package/dist/v2/components/DateRangePicker.js.map +1 -1
  411. package/dist/v2/components/DateTimePicker.d.ts +11 -11
  412. package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
  413. package/dist/v2/components/DateTimePicker.js.map +1 -1
  414. package/dist/v2/components/Drawer.d.ts +18 -18
  415. package/dist/v2/components/Drawer.d.ts.map +1 -1
  416. package/dist/v2/components/Drawer.js +2 -1
  417. package/dist/v2/components/Drawer.js.map +1 -1
  418. package/dist/v2/components/Dropzone.d.ts +34 -34
  419. package/dist/v2/components/Dropzone.d.ts.map +1 -1
  420. package/dist/v2/components/Dropzone.js +11 -3
  421. package/dist/v2/components/Dropzone.js.map +1 -1
  422. package/dist/v2/components/EmptyState.d.ts +7 -7
  423. package/dist/v2/components/EmptyState.d.ts.map +1 -1
  424. package/dist/v2/components/EmptyState.js.map +1 -1
  425. package/dist/v2/components/FavoriteToggle.d.ts +7 -7
  426. package/dist/v2/components/FavoriteToggle.d.ts.map +1 -1
  427. package/dist/v2/components/FavoriteToggle.js +2 -1
  428. package/dist/v2/components/FavoriteToggle.js.map +1 -1
  429. package/dist/v2/components/Field.d.ts +17 -12
  430. package/dist/v2/components/Field.d.ts.map +1 -1
  431. package/dist/v2/components/Field.js +25 -7
  432. package/dist/v2/components/Field.js.map +1 -1
  433. package/dist/v2/components/FieldError.d.ts +78 -0
  434. package/dist/v2/components/FieldError.d.ts.map +1 -0
  435. package/dist/v2/components/FieldError.js +131 -0
  436. package/dist/v2/components/FieldError.js.map +1 -0
  437. package/dist/v2/components/FieldHelp.d.ts +7 -7
  438. package/dist/v2/components/FieldHelp.d.ts.map +1 -1
  439. package/dist/v2/components/FieldHelp.js.map +1 -1
  440. package/dist/v2/components/FileCard.d.ts +75 -0
  441. package/dist/v2/components/FileCard.d.ts.map +1 -0
  442. package/dist/v2/components/FileCard.js +169 -0
  443. package/dist/v2/components/FileCard.js.map +1 -0
  444. package/dist/v2/components/FilterTab.d.ts +9 -9
  445. package/dist/v2/components/FilterTab.d.ts.map +1 -1
  446. package/dist/v2/components/FilterTab.js +2 -1
  447. package/dist/v2/components/FilterTab.js.map +1 -1
  448. package/dist/v2/components/FormGrid.d.ts +9 -4
  449. package/dist/v2/components/FormGrid.d.ts.map +1 -1
  450. package/dist/v2/components/FormGrid.js +11 -1
  451. package/dist/v2/components/FormGrid.js.map +1 -1
  452. package/dist/v2/components/FormikDisplay.d.ts +6 -6
  453. package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
  454. package/dist/v2/components/FormikDisplay.js.map +1 -1
  455. package/dist/v2/components/Input.d.ts +6 -6
  456. package/dist/v2/components/Input.d.ts.map +1 -1
  457. package/dist/v2/components/Input.js.map +1 -1
  458. package/dist/v2/components/KPICard.d.ts +43 -13
  459. package/dist/v2/components/KPICard.d.ts.map +1 -1
  460. package/dist/v2/components/KPICard.js +53 -14
  461. package/dist/v2/components/KPICard.js.map +1 -1
  462. package/dist/v2/components/KPIStrip.d.ts +68 -0
  463. package/dist/v2/components/KPIStrip.d.ts.map +1 -0
  464. package/dist/v2/components/KPIStrip.js +92 -0
  465. package/dist/v2/components/KPIStrip.js.map +1 -0
  466. package/dist/v2/components/KV.d.ts +3 -3
  467. package/dist/v2/components/KV.d.ts.map +1 -1
  468. package/dist/v2/components/KV.js.map +1 -1
  469. package/dist/v2/components/KVGrid.d.ts +2 -2
  470. package/dist/v2/components/KVGrid.d.ts.map +1 -1
  471. package/dist/v2/components/KVGrid.js +8 -1
  472. package/dist/v2/components/KVGrid.js.map +1 -1
  473. package/dist/v2/components/Layout.d.ts +7 -7
  474. package/dist/v2/components/Layout.d.ts.map +1 -1
  475. package/dist/v2/components/Layout.js.map +1 -1
  476. package/dist/v2/components/MobileRowCard.d.ts +13 -13
  477. package/dist/v2/components/MobileRowCard.d.ts.map +1 -1
  478. package/dist/v2/components/MobileRowCard.js.map +1 -1
  479. package/dist/v2/components/Modal.d.ts +12 -12
  480. package/dist/v2/components/Modal.d.ts.map +1 -1
  481. package/dist/v2/components/Modal.js.map +1 -1
  482. package/dist/v2/components/NetworkErrorPage.d.ts +1 -1
  483. package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
  484. package/dist/v2/components/NetworkErrorPage.js.map +1 -1
  485. package/dist/v2/components/NumberInput.d.ts +14 -14
  486. package/dist/v2/components/NumberInput.d.ts.map +1 -1
  487. package/dist/v2/components/NumberInput.js +7 -6
  488. package/dist/v2/components/NumberInput.js.map +1 -1
  489. package/dist/v2/components/OverflowMenu.d.ts +14 -14
  490. package/dist/v2/components/OverflowMenu.d.ts.map +1 -1
  491. package/dist/v2/components/OverflowMenu.js +4 -8
  492. package/dist/v2/components/OverflowMenu.js.map +1 -1
  493. package/dist/v2/components/PdfViewer.d.ts +9 -9
  494. package/dist/v2/components/PdfViewer.d.ts.map +1 -1
  495. package/dist/v2/components/PdfViewer.js.map +1 -1
  496. package/dist/v2/components/ProgressBar.d.ts +10 -10
  497. package/dist/v2/components/ProgressBar.d.ts.map +1 -1
  498. package/dist/v2/components/ProgressBar.js.map +1 -1
  499. package/dist/v2/components/Radio.d.ts +7 -7
  500. package/dist/v2/components/Radio.d.ts.map +1 -1
  501. package/dist/v2/components/Radio.js.map +1 -1
  502. package/dist/v2/components/SectionErrorBoundary.d.ts +89 -0
  503. package/dist/v2/components/SectionErrorBoundary.d.ts.map +1 -0
  504. package/dist/v2/components/SectionErrorBoundary.js +221 -0
  505. package/dist/v2/components/SectionErrorBoundary.js.map +1 -0
  506. package/dist/v2/components/SectionHeader.d.ts +5 -5
  507. package/dist/v2/components/SectionHeader.d.ts.map +1 -1
  508. package/dist/v2/components/SectionHeader.js.map +1 -1
  509. package/dist/v2/components/Segmented.d.ts +11 -11
  510. package/dist/v2/components/Segmented.d.ts.map +1 -1
  511. package/dist/v2/components/Segmented.js.map +1 -1
  512. package/dist/v2/components/Select.d.ts +33 -15
  513. package/dist/v2/components/Select.d.ts.map +1 -1
  514. package/dist/v2/components/Select.js +147 -30
  515. package/dist/v2/components/Select.js.map +1 -1
  516. package/dist/v2/components/ServerErrorPage.d.ts +1 -1
  517. package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
  518. package/dist/v2/components/ServerErrorPage.js.map +1 -1
  519. package/dist/v2/components/Skeleton.d.ts +15 -15
  520. package/dist/v2/components/Skeleton.d.ts.map +1 -1
  521. package/dist/v2/components/Skeleton.js.map +1 -1
  522. package/dist/v2/components/SkipLink.d.ts +2 -2
  523. package/dist/v2/components/SkipLink.d.ts.map +1 -1
  524. package/dist/v2/components/SkipLink.js.map +1 -1
  525. package/dist/v2/components/Status.d.ts +3 -3
  526. package/dist/v2/components/Status.d.ts.map +1 -1
  527. package/dist/v2/components/Status.js.map +1 -1
  528. package/dist/v2/components/Stepper.d.ts +28 -22
  529. package/dist/v2/components/Stepper.d.ts.map +1 -1
  530. package/dist/v2/components/Stepper.js +31 -5
  531. package/dist/v2/components/Stepper.js.map +1 -1
  532. package/dist/v2/components/Surface.d.ts +94 -0
  533. package/dist/v2/components/Surface.d.ts.map +1 -0
  534. package/dist/v2/components/Surface.js +163 -0
  535. package/dist/v2/components/Surface.js.map +1 -0
  536. package/dist/v2/components/Switch.d.ts +4 -4
  537. package/dist/v2/components/Switch.d.ts.map +1 -1
  538. package/dist/v2/components/Switch.js.map +1 -1
  539. package/dist/v2/components/Tabs.d.ts +6 -6
  540. package/dist/v2/components/Tabs.d.ts.map +1 -1
  541. package/dist/v2/components/Tabs.js.map +1 -1
  542. package/dist/v2/components/TelInput.d.ts +8 -8
  543. package/dist/v2/components/TelInput.d.ts.map +1 -1
  544. package/dist/v2/components/TelInput.js +18 -18
  545. package/dist/v2/components/TelInput.js.map +1 -1
  546. package/dist/v2/components/Textarea.d.ts +1 -1
  547. package/dist/v2/components/Textarea.d.ts.map +1 -1
  548. package/dist/v2/components/Textarea.js.map +1 -1
  549. package/dist/v2/components/TimePicker.d.ts +11 -11
  550. package/dist/v2/components/TimePicker.d.ts.map +1 -1
  551. package/dist/v2/components/TimePicker.js.map +1 -1
  552. package/dist/v2/components/Toast.d.ts +6 -6
  553. package/dist/v2/components/Toast.d.ts.map +1 -1
  554. package/dist/v2/components/Toast.js +9 -8
  555. package/dist/v2/components/Toast.js.map +1 -1
  556. package/dist/v2/components/Tooltip.d.ts +1 -1
  557. package/dist/v2/components/Tooltip.d.ts.map +1 -1
  558. package/dist/v2/components/Tooltip.js.map +1 -1
  559. package/dist/v2/components/index.d.ts +143 -0
  560. package/dist/v2/components/index.d.ts.map +1 -1
  561. package/dist/v2/components/index.js +35 -0
  562. package/dist/v2/components/index.js.map +1 -1
  563. package/dist/v2/models/favorite.d.ts +1 -1
  564. package/dist/v2/models/favorite.d.ts.map +1 -1
  565. package/dist/v2/models/favorite.js.map +1 -1
  566. package/dist/v2/models/personalization.d.ts +13 -13
  567. package/dist/v2/models/personalization.d.ts.map +1 -1
  568. package/dist/v2/models/personalization.js.map +1 -1
  569. package/dist/v2/models/referentiel.d.ts +11 -11
  570. package/dist/v2/models/referentiel.d.ts.map +1 -1
  571. package/dist/v2/models/referentiel.js.map +1 -1
  572. package/dist/v2/models/savedFilter.d.ts +8 -8
  573. package/dist/v2/models/savedFilter.d.ts.map +1 -1
  574. package/dist/v2/models/savedFilter.js.map +1 -1
  575. package/dist/v2/patterns/ActionBar.d.ts +33 -33
  576. package/dist/v2/patterns/ActionBar.d.ts.map +1 -1
  577. package/dist/v2/patterns/ActionBar.js +2 -1
  578. package/dist/v2/patterns/ActionBar.js.map +1 -1
  579. package/dist/v2/patterns/BulkActionBar.d.ts +12 -12
  580. package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -1
  581. package/dist/v2/patterns/BulkActionBar.js +2 -1
  582. package/dist/v2/patterns/BulkActionBar.js.map +1 -1
  583. package/dist/v2/patterns/CollapsibleDataGrid.d.ts +15 -15
  584. package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -1
  585. package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  586. package/dist/v2/patterns/ColumnsToggle.d.ts +7 -7
  587. package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -1
  588. package/dist/v2/patterns/ColumnsToggle.js +4 -8
  589. package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
  590. package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -12
  591. package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
  592. package/dist/v2/patterns/DataGridSettingsMenu.js +9 -8
  593. package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  594. package/dist/v2/patterns/DataGridToolbar.d.ts +40 -40
  595. package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -1
  596. package/dist/v2/patterns/DataGridToolbar.js +2 -1
  597. package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
  598. package/dist/v2/patterns/DataGridVirtualized.d.ts +27 -27
  599. package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -1
  600. package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
  601. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +5 -5
  602. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -1
  603. package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  604. package/dist/v2/patterns/FavoriteColumn.d.ts +6 -6
  605. package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
  606. package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
  607. package/dist/v2/patterns/FavoritesFilter.d.ts +10 -10
  608. package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -1
  609. package/dist/v2/patterns/FavoritesFilter.js +2 -1
  610. package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
  611. package/dist/v2/patterns/FormErrorSummary.d.ts +4 -4
  612. package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -1
  613. package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
  614. package/dist/v2/patterns/FormPageShell.d.ts +4 -4
  615. package/dist/v2/patterns/FormPageShell.d.ts.map +1 -1
  616. package/dist/v2/patterns/FormPageShell.js.map +1 -1
  617. package/dist/v2/patterns/FormSection.d.ts +19 -8
  618. package/dist/v2/patterns/FormSection.d.ts.map +1 -1
  619. package/dist/v2/patterns/FormSection.js +106 -71
  620. package/dist/v2/patterns/FormSection.js.map +1 -1
  621. package/dist/v2/patterns/FormikCheckboxGroup.d.ts +6 -6
  622. package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
  623. package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  624. package/dist/v2/patterns/FormikCombobox.d.ts +11 -11
  625. package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
  626. package/dist/v2/patterns/FormikCombobox.js.map +1 -1
  627. package/dist/v2/patterns/FormikDatePicker.d.ts +36 -8
  628. package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
  629. package/dist/v2/patterns/FormikDatePicker.js +27 -1
  630. package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
  631. package/dist/v2/patterns/FormikErrorFocus.d.ts +3 -3
  632. package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -1
  633. package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
  634. package/dist/v2/patterns/FormikFile.d.ts +8 -8
  635. package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
  636. package/dist/v2/patterns/FormikFile.js.map +1 -1
  637. package/dist/v2/patterns/FormikInput.d.ts +41 -6
  638. package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
  639. package/dist/v2/patterns/FormikInput.js +49 -1
  640. package/dist/v2/patterns/FormikInput.js.map +1 -1
  641. package/dist/v2/patterns/FormikReferentielField.d.ts +8 -8
  642. package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
  643. package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
  644. package/dist/v2/patterns/FormikSelect.d.ts +33 -12
  645. package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
  646. package/dist/v2/patterns/FormikSelect.js +28 -2
  647. package/dist/v2/patterns/FormikSelect.js.map +1 -1
  648. package/dist/v2/patterns/FormikTextarea.d.ts +5 -5
  649. package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
  650. package/dist/v2/patterns/FormikTextarea.js.map +1 -1
  651. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +7 -7
  652. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
  653. package/dist/v2/patterns/KeyboardShortcutsHelp.js +2 -6
  654. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  655. package/dist/v2/patterns/NetworkErrorBanner.d.ts +4 -4
  656. package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -1
  657. package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
  658. package/dist/v2/patterns/PageContent.d.ts +3 -3
  659. package/dist/v2/patterns/PageContent.d.ts.map +1 -1
  660. package/dist/v2/patterns/PageContent.js.map +1 -1
  661. package/dist/v2/patterns/ReferentielField.d.ts +49 -49
  662. package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
  663. package/dist/v2/patterns/ReferentielField.js +2 -1
  664. package/dist/v2/patterns/ReferentielField.js.map +1 -1
  665. package/dist/v2/patterns/SaveFilterDialog.d.ts +10 -10
  666. package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -1
  667. package/dist/v2/patterns/SaveFilterDialog.js +9 -8
  668. package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
  669. package/dist/v2/patterns/SavedFiltersMenu.d.ts +7 -7
  670. package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -1
  671. package/dist/v2/patterns/SavedFiltersMenu.js +9 -8
  672. package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
  673. package/dist/v2/patterns/SkeletonPageShell.d.ts +7 -7
  674. package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -1
  675. package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
  676. package/dist/v2/patterns/SortableHeader.d.ts +1 -1
  677. package/dist/v2/patterns/SortableHeader.d.ts.map +1 -1
  678. package/dist/v2/patterns/SortableHeader.js.map +1 -1
  679. package/dist/v2/patterns/Tour.d.ts +12 -12
  680. package/dist/v2/patterns/Tour.d.ts.map +1 -1
  681. package/dist/v2/patterns/Tour.js +9 -8
  682. package/dist/v2/patterns/Tour.js.map +1 -1
  683. package/dist/v2/patterns/_dataGridShared.d.ts +25 -6
  684. package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
  685. package/dist/v2/patterns/_dataGridShared.js +37 -3
  686. package/dist/v2/patterns/_dataGridShared.js.map +1 -1
  687. package/dist/v2/patterns/_useColumnReorder.d.ts +1 -1
  688. package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -1
  689. package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
  690. package/dist/v2/patterns/_useColumnResize.d.ts +1 -1
  691. package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -1
  692. package/dist/v2/patterns/_useColumnResize.js.map +1 -1
  693. package/dist/v2/patterns/index.d.ts +27 -0
  694. package/dist/v2/patterns/index.d.ts.map +1 -1
  695. package/dist/v2/patterns/index.js.map +1 -1
  696. package/dist/v2/personalization/PersonalizationProvider.d.ts +9 -9
  697. package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
  698. package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
  699. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +1 -1
  700. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -1
  701. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  702. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +1 -1
  703. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -1
  704. package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  705. package/dist/v2/personalization/capabilities/favoritesView.d.ts +3 -3
  706. package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -1
  707. package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
  708. package/dist/v2/personalization/capabilities/savedFilters.d.ts +3 -3
  709. package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -1
  710. package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
  711. package/dist/v2/personalization/createPersonalizationStore.d.ts +8 -8
  712. package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
  713. package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
  714. package/dist/v2/personalization/schema.d.ts +2 -2
  715. package/dist/v2/personalization/schema.d.ts.map +1 -1
  716. package/dist/v2/personalization/schema.js.map +1 -1
  717. package/dist/v2/personalization/types.d.ts +19 -19
  718. package/dist/v2/personalization/types.d.ts.map +1 -1
  719. package/dist/v2/personalization/types.js.map +1 -1
  720. package/dist/v2/referentiel/ReferentielProvider.d.ts +4 -4
  721. package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -1
  722. package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
  723. package/dist/v2/referentiel/useReferentielOptions.d.ts +4 -4
  724. package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
  725. package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
  726. package/dist/v2/referentiel/useReferentielSearch.d.ts +3 -3
  727. package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
  728. package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
  729. package/dist/v2/theme/createPortnetTheme.d.ts +32 -7
  730. package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -1
  731. package/dist/v2/theme/createPortnetTheme.js +25 -1
  732. package/dist/v2/theme/createPortnetTheme.js.map +1 -1
  733. package/dist/v2/types/datagrid.d.ts +59 -59
  734. package/dist/v2/types/datagrid.d.ts.map +1 -1
  735. package/dist/v2/types/datagrid.js.map +1 -1
  736. package/dist/v2/utils/apiError.d.ts +65 -4
  737. package/dist/v2/utils/apiError.d.ts.map +1 -1
  738. package/dist/v2/utils/apiError.js +69 -6
  739. package/dist/v2/utils/apiError.js.map +1 -1
  740. package/dist/v2/utils/index.d.ts +1 -0
  741. package/dist/v2/utils/index.d.ts.map +1 -1
  742. package/dist/v2/utils/index.js +7 -0
  743. package/dist/v2/utils/index.js.map +1 -1
  744. package/dist/v2/utils/mergeLabels.d.ts +59 -0
  745. package/dist/v2/utils/mergeLabels.d.ts.map +1 -0
  746. package/dist/v2/utils/mergeLabels.js +93 -0
  747. package/dist/v2/utils/mergeLabels.js.map +1 -0
  748. package/package.json +23 -15
@@ -14,31 +14,31 @@ export interface DataGridColumn<T> {
14
14
  key: string;
15
15
  /** Header content. */
16
16
  header: ReactNode;
17
- align?: Alignment;
17
+ align?: Alignment | undefined;
18
18
  /** Right-align + tabular numerals. */
19
- numeric?: boolean;
19
+ numeric?: boolean | undefined;
20
20
  /** Monospaced cell font + tabular numerals. */
21
- mono?: boolean;
21
+ mono?: boolean | undefined;
22
22
  /** Default true when `onSortChange` is set; `false` opts the column out of sorting. */
23
- sortable?: boolean;
23
+ sortable?: boolean | undefined;
24
24
  /** Default true when the grid is `resizable`; `false` opts the column out. */
25
- resizable?: boolean;
25
+ resizable?: boolean | undefined;
26
26
  /** Default true when the grid is `reorderable`; `false` opts the column out. */
27
- reorderable?: boolean;
27
+ reorderable?: boolean | undefined;
28
28
  /** Reveal the cell only on row hover / focus-within / coarse pointer. */
29
- hoverOnly?: boolean;
29
+ hoverOnly?: boolean | undefined;
30
30
  /** Column may be toggled by a column-visibility UI. */
31
- toggleable?: boolean;
31
+ toggleable?: boolean | undefined;
32
32
  /** Preferred width (px number or CSS length). */
33
- width?: number | string;
33
+ width?: number | string | undefined;
34
34
  /** Hard max width (px number or CSS length). */
35
- maxWidth?: number | string;
35
+ maxWidth?: number | string | undefined;
36
36
  /** Wrap long content instead of truncating with an ellipsis. */
37
- wrap?: boolean;
37
+ wrap?: boolean | undefined;
38
38
  /** Custom cell renderer; overrides `getValue` / `row[key]`. */
39
- render?: (row: T) => ReactNode;
39
+ render?: ((row: T) => ReactNode) | undefined;
40
40
  /** Custom value accessor used when `render` is absent (default `row[key]`). */
41
- getValue?: (row: T) => unknown;
41
+ getValue?: ((row: T) => unknown) | undefined;
42
42
  }
43
43
  /** Pagination model for DataGrid (`page` is 1-based). */
44
44
  export interface DataGridPagination {
@@ -46,29 +46,29 @@ export interface DataGridPagination {
46
46
  pageSize: number;
47
47
  total: number;
48
48
  onPageChange: (page: number) => void;
49
- onPageSizeChange?: (pageSize: number) => void;
50
- pageSizes?: number[];
49
+ onPageSizeChange?: ((pageSize: number) => void) | undefined;
50
+ pageSizes?: number[] | undefined;
51
51
  }
52
52
  /** i18n labels for the DataGrid pagination bar. */
53
53
  export interface DataGridPaginationLabels {
54
- loading?: ReactNode;
55
- rowsPerPage?: ReactNode;
56
- firstPage?: string;
57
- previousPage?: string;
58
- nextPage?: string;
59
- lastPage?: string;
54
+ loading?: ReactNode | undefined;
55
+ rowsPerPage?: ReactNode | undefined;
56
+ firstPage?: string | undefined;
57
+ previousPage?: string | undefined;
58
+ nextPage?: string | undefined;
59
+ lastPage?: string | undefined;
60
60
  /** Accessible name for the pagination navigation landmark (WCAG landmark / 2.4.1). */
61
- navLabel?: string;
61
+ navLabel?: string | undefined;
62
62
  /** Range summary; `fmt` is the resolved locale number formatter. */
63
- rangeOf?: (from: number, to: number, total: number, fmt: (n: number) => string) => ReactNode;
63
+ rangeOf?: ((from: number, to: number, total: number, fmt: (n: number) => string) => ReactNode) | undefined;
64
64
  }
65
65
  /** i18n labels for DataGrid. */
66
66
  export interface DataGridLabels {
67
- tableAria?: string;
68
- selectAll?: string;
69
- selectRow?: (id: RowId) => string;
70
- actionsHeader?: string;
71
- pagination?: DataGridPaginationLabels;
67
+ tableAria?: string | undefined;
68
+ selectAll?: string | undefined;
69
+ selectRow?: ((id: RowId) => string) | undefined;
70
+ actionsHeader?: string | undefined;
71
+ pagination?: DataGridPaginationLabels | undefined;
72
72
  }
73
73
  /** Context object passed to `renderMobileCard`. */
74
74
  export interface DataGridMobileCardContext {
@@ -78,54 +78,54 @@ export interface DataGridMobileCardContext {
78
78
  /** Options accepted by the exported `applySort` helper. */
79
79
  export interface ApplySortOptions {
80
80
  /** BCP-47 locale for collation (default "fr-FR"). */
81
- locale?: string;
81
+ locale?: string | undefined;
82
82
  }
83
83
  /** Props for the DataGrid pattern over row type `T`. */
84
84
  export interface DataGridProps<T> {
85
- rows?: T[];
85
+ rows?: T[] | undefined;
86
86
  columns: DataGridColumn<T>[];
87
- loading?: boolean;
87
+ loading?: boolean | undefined;
88
88
  /** Any truthy value switches the grid to its error branch (renders `errorState`). */
89
89
  error?: unknown;
90
- sort?: SortDescriptor[];
90
+ sort?: SortDescriptor[] | undefined;
91
91
  /**
92
92
  * Sort-state setter. DataGrid forwards this straight to SortableHeader,
93
93
  * which invokes it with an UPDATER function — so it must behave like a
94
94
  * `useState` dispatcher (accepts a value OR a `(prev) => next` updater).
95
95
  */
96
- onSortChange?: Dispatch<SetStateAction<SortDescriptor[]>>;
97
- selection?: Set<RowId> | RowId[];
96
+ onSortChange?: Dispatch<SetStateAction<SortDescriptor[]>> | undefined;
97
+ selection?: Set<RowId> | RowId[] | undefined;
98
98
  /** Receives the next selection as a `Set`. Presence enables the checkbox column. */
99
- onSelectionChange?: (selection: Set<RowId>) => void;
100
- pagination?: DataGridPagination;
101
- emptyState?: ReactNode;
102
- filteredEmptyState?: ReactNode;
103
- errorState?: ReactNode;
99
+ onSelectionChange?: ((selection: Set<RowId>) => void) | undefined;
100
+ pagination?: DataGridPagination | undefined;
101
+ emptyState?: ReactNode | undefined;
102
+ filteredEmptyState?: ReactNode | undefined;
103
+ errorState?: ReactNode | undefined;
104
104
  /** Row identity (default `(row) => row.id`). */
105
- getRowId?: (row: T) => RowId;
106
- onRowClick?: (row: T) => void;
107
- rowFlashId?: RowId;
108
- activeRowId?: RowId;
105
+ getRowId?: ((row: T) => RowId) | undefined;
106
+ onRowClick?: ((row: T) => void) | undefined;
107
+ rowFlashId?: RowId | undefined;
108
+ activeRowId?: RowId | undefined;
109
109
  /** Renders the per-row actions overlay. Presence enables the actions column. */
110
- rowActions?: (row: T) => ReactNode;
111
- hiddenColumns?: Set<string> | string[];
110
+ rowActions?: ((row: T) => ReactNode) | undefined;
111
+ hiddenColumns?: Set<string> | string[] | undefined;
112
112
  /** Marks an empty result as filter-induced (renders `filteredEmptyState`). */
113
- filtered?: boolean;
114
- density?: Density;
113
+ filtered?: boolean | undefined;
114
+ density?: Density | undefined;
115
115
  /** Contextual accessible table name (WCAG 1.3.1 / Charter R-DG). */
116
- ariaLabel?: string;
116
+ ariaLabel?: string | undefined;
117
117
  /** BCP-47 locale for number formatting (default "fr-FR"). */
118
- locale?: string;
119
- labels?: DataGridLabels;
120
- maxBodyHeight?: number | string;
121
- resizable?: boolean;
122
- columnWidths?: Record<string, number>;
123
- onColumnWidthsChange?: (widths: Record<string, number>) => void;
124
- reorderable?: boolean;
125
- columnOrder?: string[];
126
- onColumnOrderChange?: (order: string[]) => void;
118
+ locale?: string | undefined;
119
+ labels?: DataGridLabels | undefined;
120
+ maxBodyHeight?: number | string | undefined;
121
+ resizable?: boolean | undefined;
122
+ columnWidths?: Record<string, number> | undefined;
123
+ onColumnWidthsChange?: ((widths: Record<string, number>) => void) | undefined;
124
+ reorderable?: boolean | undefined;
125
+ columnOrder?: string[] | undefined;
126
+ onColumnOrderChange?: ((order: string[]) => void) | undefined;
127
127
  /** Opt-in mobile card renderer; below `mobileBreakpoint` the grid renders cards. */
128
- renderMobileCard?: (row: T, ctx: DataGridMobileCardContext) => ReactNode;
129
- mobileBreakpoint?: Breakpoint;
128
+ renderMobileCard?: ((row: T, ctx: DataGridMobileCardContext) => ReactNode) | undefined;
129
+ mobileBreakpoint?: Breakpoint | undefined;
130
130
  }
131
131
  //# sourceMappingURL=datagrid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"datagrid.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/types/datagrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEtF,sDAAsD;AACtD,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,uEAAuE;IACvE,GAAG,EAAE,MAAM,CAAC;IACZ,sBAAsB;IACtB,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,sCAAsC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,+CAA+C;IAC/C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uFAAuF;IACvF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8EAA8E;IAC9E,SAA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AAG,SAAS,CAAC;IAC9D,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,yBAAyB,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;IACvF,gBAAgB,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;CAC3C"}
@@ -1 +1 @@
1
- {"version":3,"file":"datagrid.js","names":[],"sources":["../../../src/lib/v2/types/datagrid.ts"],"sourcesContent":["/**\r\n * @portnet/ui v2 — DataGrid generic contract.\r\n *\r\n * Derived verbatim from the DataGrid / SortableHeader / _dataGridShared\r\n * PropTypes + implementation (the executable contract). MUI-independent:\r\n * component-level composition with MUI prop types happens in the component\r\n * itself (Part 2), not here.\r\n */\r\n\r\nimport type { Dispatch, ReactNode, SetStateAction } from \"react\";\r\nimport type { Alignment, Breakpoint, Density, RowId, SortDescriptor } from \"./common\";\r\n\r\n/** A DataGrid column definition over row type `T`. */\r\nexport interface DataGridColumn<T> {\r\n /** Unique column key; also the default value accessor (`row[key]`). */\r\n key: string;\r\n /** Header content. */\r\n header: ReactNode;\r\n align?: Alignment;\r\n /** Right-align + tabular numerals. */\r\n numeric?: boolean;\r\n /** Monospaced cell font + tabular numerals. */\r\n mono?: boolean;\r\n /** Default true when `onSortChange` is set; `false` opts the column out of sorting. */\r\n sortable?: boolean;\r\n /** Default true when the grid is `resizable`; `false` opts the column out. */\r\n resizable?: boolean;\r\n /** Default true when the grid is `reorderable`; `false` opts the column out. */\r\n reorderable?: boolean;\r\n /** Reveal the cell only on row hover / focus-within / coarse pointer. */\r\n hoverOnly?: boolean;\r\n /** Column may be toggled by a column-visibility UI. */\r\n toggleable?: boolean;\r\n /** Preferred width (px number or CSS length). */\r\n width?: number | string;\r\n /** Hard max width (px number or CSS length). */\r\n maxWidth?: number | string;\r\n /** Wrap long content instead of truncating with an ellipsis. */\r\n wrap?: boolean;\r\n /** Custom cell renderer; overrides `getValue` / `row[key]`. */\r\n render?: (row: T) => ReactNode;\r\n /** Custom value accessor used when `render` is absent (default `row[key]`). */\r\n getValue?: (row: T) => unknown;\r\n}\r\n\r\n/** Pagination model for DataGrid (`page` is 1-based). */\r\nexport interface DataGridPagination {\r\n page: number;\r\n pageSize: number;\r\n total: number;\r\n onPageChange: (page: number) => void;\r\n onPageSizeChange?: (pageSize: number) => void;\r\n pageSizes?: number[];\r\n}\r\n\r\n/** i18n labels for the DataGrid pagination bar. */\r\nexport interface DataGridPaginationLabels {\r\n loading?: ReactNode;\r\n rowsPerPage?: ReactNode;\r\n firstPage?: string;\r\n previousPage?: string;\r\n nextPage?: string;\r\n lastPage?: string;\r\n /** Accessible name for the pagination navigation landmark (WCAG landmark / 2.4.1). */\r\n navLabel?: string;\r\n /** Range summary; `fmt` is the resolved locale number formatter. */\r\n rangeOf?: (from: number, to: number, total: number, fmt: (n: number) => string) => ReactNode;\r\n}\r\n\r\n/** i18n labels for DataGrid. */\r\nexport interface DataGridLabels {\r\n tableAria?: string;\r\n selectAll?: string;\r\n selectRow?: (id: RowId) => string;\r\n actionsHeader?: string;\r\n pagination?: DataGridPaginationLabels;\r\n}\r\n\r\n/** Context object passed to `renderMobileCard`. */\r\nexport interface DataGridMobileCardContext {\r\n isActive: boolean;\r\n isSelected: boolean;\r\n}\r\n\r\n/** Options accepted by the exported `applySort` helper. */\r\nexport interface ApplySortOptions {\r\n /** BCP-47 locale for collation (default \"fr-FR\"). */\r\n locale?: string;\r\n}\r\n\r\n/** Props for the DataGrid pattern over row type `T`. */\r\nexport interface DataGridProps<T> {\r\n rows?: T[];\r\n columns: DataGridColumn<T>[];\r\n loading?: boolean;\r\n /** Any truthy value switches the grid to its error branch (renders `errorState`). */\r\n error?: unknown;\r\n sort?: SortDescriptor[];\r\n /**\r\n * Sort-state setter. DataGrid forwards this straight to SortableHeader,\r\n * which invokes it with an UPDATER function — so it must behave like a\r\n * `useState` dispatcher (accepts a value OR a `(prev) => next` updater).\r\n */\r\n onSortChange?: Dispatch<SetStateAction<SortDescriptor[]>>;\r\n selection?: Set<RowId> | RowId[];\r\n /** Receives the next selection as a `Set`. Presence enables the checkbox column. */\r\n onSelectionChange?: (selection: Set<RowId>) => void;\r\n pagination?: DataGridPagination;\r\n emptyState?: ReactNode;\r\n filteredEmptyState?: ReactNode;\r\n errorState?: ReactNode;\r\n /** Row identity (default `(row) => row.id`). */\r\n getRowId?: (row: T) => RowId;\r\n onRowClick?: (row: T) => void;\r\n rowFlashId?: RowId;\r\n activeRowId?: RowId;\r\n /** Renders the per-row actions overlay. Presence enables the actions column. */\r\n rowActions?: (row: T) => ReactNode;\r\n hiddenColumns?: Set<string> | string[];\r\n /** Marks an empty result as filter-induced (renders `filteredEmptyState`). */\r\n filtered?: boolean;\r\n density?: Density;\r\n /** Contextual accessible table name (WCAG 1.3.1 / Charter R-DG). */\r\n ariaLabel?: string;\r\n /** BCP-47 locale for number formatting (default \"fr-FR\"). */\r\n locale?: string;\r\n labels?: DataGridLabels;\r\n maxBodyHeight?: number | string;\r\n resizable?: boolean;\r\n columnWidths?: Record<string, number>;\r\n onColumnWidthsChange?: (widths: Record<string, number>) => void;\r\n reorderable?: boolean;\r\n columnOrder?: string[];\r\n onColumnOrderChange?: (order: string[]) => void;\r\n /** Opt-in mobile card renderer; below `mobileBreakpoint` the grid renders cards. */\r\n renderMobileCard?: (row: T, ctx: DataGridMobileCardContext) => ReactNode;\r\n mobileBreakpoint?: Breakpoint;\r\n}\r\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"datagrid.js","names":[],"sources":["../../../src/lib/v2/types/datagrid.ts"],"sourcesContent":["/**\r\n * @portnet/ui v2 — DataGrid generic contract.\r\n *\r\n * Derived verbatim from the DataGrid / SortableHeader / _dataGridShared\r\n * PropTypes + implementation (the executable contract). MUI-independent:\r\n * component-level composition with MUI prop types happens in the component\r\n * itself (Part 2), not here.\r\n */\r\n\r\nimport type { Dispatch, ReactNode, SetStateAction } from \"react\";\r\nimport type { Alignment, Breakpoint, Density, RowId, SortDescriptor } from \"./common\";\r\n\r\n/** A DataGrid column definition over row type `T`. */\r\nexport interface DataGridColumn<T> {\r\n /** Unique column key; also the default value accessor (`row[key]`). */\r\n key: string;\r\n /** Header content. */\r\n header: ReactNode;\r\n align?: Alignment | undefined;\r\n /** Right-align + tabular numerals. */\r\n numeric?: boolean | undefined;\r\n /** Monospaced cell font + tabular numerals. */\r\n mono?: boolean | undefined;\r\n /** Default true when `onSortChange` is set; `false` opts the column out of sorting. */\r\n sortable?: boolean | undefined;\r\n /** Default true when the grid is `resizable`; `false` opts the column out. */\r\n resizable?: boolean | undefined;\r\n /** Default true when the grid is `reorderable`; `false` opts the column out. */\r\n reorderable?: boolean | undefined;\r\n /** Reveal the cell only on row hover / focus-within / coarse pointer. */\r\n hoverOnly?: boolean | undefined;\r\n /** Column may be toggled by a column-visibility UI. */\r\n toggleable?: boolean | undefined;\r\n /** Preferred width (px number or CSS length). */\r\n width?: number | string | undefined;\r\n /** Hard max width (px number or CSS length). */\r\n maxWidth?: number | string | undefined;\r\n /** Wrap long content instead of truncating with an ellipsis. */\r\n wrap?: boolean | undefined;\r\n /** Custom cell renderer; overrides `getValue` / `row[key]`. */\r\n render?: ((row: T) => ReactNode) | undefined;\r\n /** Custom value accessor used when `render` is absent (default `row[key]`). */\r\n getValue?: ((row: T) => unknown) | undefined;\r\n}\r\n\r\n/** Pagination model for DataGrid (`page` is 1-based). */\r\nexport interface DataGridPagination {\r\n page: number;\r\n pageSize: number;\r\n total: number;\r\n onPageChange: (page: number) => void;\r\n onPageSizeChange?: ((pageSize: number) => void) | undefined;\r\n pageSizes?: number[] | undefined;\r\n}\r\n\r\n/** i18n labels for the DataGrid pagination bar. */\r\nexport interface DataGridPaginationLabels {\r\n loading?: ReactNode | undefined;\r\n rowsPerPage?: ReactNode | undefined;\r\n firstPage?: string | undefined;\r\n previousPage?: string | undefined;\r\n nextPage?: string | undefined;\r\n lastPage?: string | undefined;\r\n /** Accessible name for the pagination navigation landmark (WCAG landmark / 2.4.1). */\r\n navLabel?: string | undefined;\r\n /** Range summary; `fmt` is the resolved locale number formatter. */\r\n rangeOf?: ((from: number, to: number, total: number, fmt: (n: number) => string) => ReactNode) | undefined;\r\n}\r\n\r\n/** i18n labels for DataGrid. */\r\nexport interface DataGridLabels {\r\n tableAria?: string | undefined;\r\n selectAll?: string | undefined;\r\n selectRow?: ((id: RowId) => string) | undefined;\r\n actionsHeader?: string | undefined;\r\n pagination?: DataGridPaginationLabels | undefined;\r\n}\r\n\r\n/** Context object passed to `renderMobileCard`. */\r\nexport interface DataGridMobileCardContext {\r\n isActive: boolean;\r\n isSelected: boolean;\r\n}\r\n\r\n/** Options accepted by the exported `applySort` helper. */\r\nexport interface ApplySortOptions {\r\n /** BCP-47 locale for collation (default \"fr-FR\"). */\r\n locale?: string | undefined;\r\n}\r\n\r\n/** Props for the DataGrid pattern over row type `T`. */\r\nexport interface DataGridProps<T> {\r\n rows?: T[] | undefined;\r\n columns: DataGridColumn<T>[];\r\n loading?: boolean | undefined;\r\n /** Any truthy value switches the grid to its error branch (renders `errorState`). */\r\n error?: unknown;\r\n sort?: SortDescriptor[] | undefined;\r\n /**\r\n * Sort-state setter. DataGrid forwards this straight to SortableHeader,\r\n * which invokes it with an UPDATER function — so it must behave like a\r\n * `useState` dispatcher (accepts a value OR a `(prev) => next` updater).\r\n */\r\n onSortChange?: Dispatch<SetStateAction<SortDescriptor[]>> | undefined;\r\n selection?: Set<RowId> | RowId[] | undefined;\r\n /** Receives the next selection as a `Set`. Presence enables the checkbox column. */\r\n onSelectionChange?: ((selection: Set<RowId>) => void) | undefined;\r\n pagination?: DataGridPagination | undefined;\r\n emptyState?: ReactNode | undefined;\r\n filteredEmptyState?: ReactNode | undefined;\r\n errorState?: ReactNode | undefined;\r\n /** Row identity (default `(row) => row.id`). */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n onRowClick?: ((row: T) => void) | undefined;\r\n rowFlashId?: RowId | undefined;\r\n activeRowId?: RowId | undefined;\r\n /** Renders the per-row actions overlay. Presence enables the actions column. */\r\n rowActions?: ((row: T) => ReactNode) | undefined;\r\n hiddenColumns?: Set<string> | string[] | undefined;\r\n /** Marks an empty result as filter-induced (renders `filteredEmptyState`). */\r\n filtered?: boolean | undefined;\r\n density?: Density | undefined;\r\n /** Contextual accessible table name (WCAG 1.3.1 / Charter R-DG). */\r\n ariaLabel?: string | undefined;\r\n /** BCP-47 locale for number formatting (default \"fr-FR\"). */\r\n locale?: string | undefined;\r\n labels?: DataGridLabels | undefined;\r\n maxBodyHeight?: number | string | undefined;\r\n resizable?: boolean | undefined;\r\n columnWidths?: Record<string, number> | undefined;\r\n onColumnWidthsChange?: ((widths: Record<string, number>) => void) | undefined;\r\n reorderable?: boolean | undefined;\r\n columnOrder?: string[] | undefined;\r\n onColumnOrderChange?: ((order: string[]) => void) | undefined;\r\n /** Opt-in mobile card renderer; below `mobileBreakpoint` the grid renders cards. */\r\n renderMobileCard?: ((row: T, ctx: DataGridMobileCardContext) => ReactNode) | undefined;\r\n mobileBreakpoint?: Breakpoint | undefined;\r\n}\r\n"],"mappings":"","ignoreList":[]}
@@ -34,6 +34,10 @@
34
34
  * getApiErrorMessage(err) → backend message, or the default
35
35
  * getApiErrorMessage(err, "Échec de l'envoi.") → custom fallback
36
36
  * getApiErrorStatus(err) → 404 | undefined
37
+ *
38
+ * Envelope keys read, in order: `data.body`, `data.message`, `data.error`.
39
+ * Three keys because three PORTNET back-ends chose differently; see the
40
+ * resolution-order note on `getApiErrorMessage` before adding a fourth.
37
41
  */
38
42
  /**
39
43
  * Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and
@@ -46,11 +50,41 @@ export declare const DEFAULT_API_ERROR_MESSAGE = "Une erreur est survenue. Veuil
46
50
  *
47
51
  * Resolution order, first match wins:
48
52
  * 1. the rejection itself, when it is a non-empty string;
49
- * 2. `error.response.data.message` — the backend's own message;
50
- * 3. `error.message` — **only when it is not a transport artefact** (G-07);
51
- * 4. `fallback`.
53
+ * 2. `error.response.data.body` — the SAME envelope's third key;
54
+ * 3. `error.response.data.message` — the backend's own message;
55
+ * 4. `error.response.data.error` — the SAME envelope's alternate key;
56
+ * 5. `error.message` — **only when it is not a transport artefact** (G-07);
57
+ * 6. `fallback`.
58
+ *
59
+ * Step 4 closes capability gap G-08. Several PORTNET back-ends populate
60
+ * `data.error` rather than `data.message` (addpe-fe declares BOTH on its
61
+ * `ApiErrorBody` and read both at seven call sites), so a helper that stopped at
62
+ * `data.message` skipped a real business message and fell through to the generic
63
+ * fallback — which made it non-substitutable for the module-local extractors it
64
+ * exists to replace. Strictly additive: what step 4 now catches previously
65
+ * reached step 5 or 6.
66
+ *
67
+ * Step 2 closes G-08bis — the same defect, a third key. `caution-ui`'s axios
68
+ * interceptor reads `error.response.data.body ?? error.response.data.message`,
69
+ * so on that back-end a helper stopping at `message` again skipped a real
70
+ * business message. Without step 2 the helper was non-substitutable there and
71
+ * the module would have had to keep its own assertion-based extractor.
72
+ *
73
+ * WHY STEP 2 SITS BEFORE `message` AND NOT AFTER `error`.
74
+ * `caution-ui` uses `??`, which is direct evidence that a single response can
75
+ * carry both keys and that `body` is the one that back-end means. Appending
76
+ * `body` at the end of the envelope hops would therefore have SILENTLY FLIPPED
77
+ * which message its users see. Placing it first preserves that precedence, and
78
+ * is provably a no-op for every module that does not populate `body`: `readPath`
79
+ * returns `undefined` and resolution falls straight through to `message`.
80
+ *
81
+ * The one case this perturbs is a back-end that populates BOTH `body` and
82
+ * `message` while intending `message` to win. No such module exists in the
83
+ * portfolio — addpe-fe's `ApiErrorBody` declares `message` and `error`, not
84
+ * `body` — and a module in that position should say so here rather than have the
85
+ * order guessed for it.
52
86
  *
53
- * Step 3 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
87
+ * Step 5 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
54
88
  * timeouts and errno codes are SUPPRESSED so the caller's own French copy is
55
89
  * used instead (Charter §09.3 — no raw technical detail). A message a module
56
90
  * threw deliberately still passes through. Use `getApiErrorDetail` when you want
@@ -81,10 +115,37 @@ export declare function getApiErrorDetail(error: unknown): string | undefined;
81
115
  /**
82
116
  * HTTP status carried by a rejection, when there is one.
83
117
  *
118
+ * Resolution order, first numeric match wins:
119
+ * 1. `error.response.data.status` — a BODY-level status;
120
+ * 2. `error.response.status` — the transport status.
121
+ *
84
122
  * Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —
85
123
  * which is the signal callers use to distinguish "the server answered with an
86
124
  * error" from "there was no answer at all" (Charter R-4.3: a status-less failure
87
125
  * is a network banner, not a toast).
126
+ *
127
+ * Step 1 closes G-08ter, the status-side counterpart of the envelope-key gaps
128
+ * G-08 / G-08bis. Several PORTNET back-ends put the meaningful status in the
129
+ * BODY: caution-ui's axios interceptor reads
130
+ * `error.response.data.status ?? error.response.status` and routes on the
131
+ * result (404 -> not-found page, 500 -> server-error page, 401 -> re-login), and
132
+ * its RESPONSE interceptor does the same for success handling. A helper reading
133
+ * only the transport status was therefore not substitutable there — the module
134
+ * had to keep a hand-written `HttpErrorLike` interface and assert onto it, which
135
+ * is exactly the anti-pattern G-04 exists to end. Closing the message side
136
+ * (G-08bis) without the status side would have left that assertion in place for
137
+ * the sake of one field.
138
+ *
139
+ * Body-first ordering mirrors the module's own `??` and is provably a no-op for
140
+ * every back-end that does not populate `data.status`: `readPath` returns
141
+ * `undefined` and resolution falls through to the transport status.
142
+ *
143
+ * BOTH hops are numeric-guarded, which is a deliberate tightening over the
144
+ * module code being replaced. That code did `String(status)` on whatever it
145
+ * found, so a body carrying `status: "ERROR"` produced a `String` switch miss
146
+ * and fell to the default toast branch; here a non-numeric `data.status` is
147
+ * ignored and the real transport status is used instead. That is the more useful
148
+ * answer, and it keeps the return type honest — the signature promises a number.
88
149
  */
89
150
  export declare function getApiErrorStatus(error: unknown): number | undefined;
90
151
  //# sourceMappingURL=apiError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiError.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/apiError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,sDACU,CAAC;AA6GjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAkC,GAC3C,MAAM,CAQR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE"}
1
+ {"version":3,"file":"apiError.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/apiError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,sDACU,CAAC;AA6GjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAkC,GAC3C,MAAM,CAUR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMpE"}
@@ -47,6 +47,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
47
47
  * getApiErrorMessage(err) → backend message, or the default
48
48
  * getApiErrorMessage(err, "Échec de l'envoi.") → custom fallback
49
49
  * getApiErrorStatus(err) → 404 | undefined
50
+ *
51
+ * Envelope keys read, in order: `data.body`, `data.message`, `data.error`.
52
+ * Three keys because three PORTNET back-ends chose differently; see the
53
+ * resolution-order note on `getApiErrorMessage` before adding a fourth.
50
54
  */
51
55
 
52
56
  /**
@@ -170,11 +174,41 @@ var asUserFacingMessage = function asUserFacingMessage(value) {
170
174
  *
171
175
  * Resolution order, first match wins:
172
176
  * 1. the rejection itself, when it is a non-empty string;
173
- * 2. `error.response.data.message` — the backend's own message;
174
- * 3. `error.message` — **only when it is not a transport artefact** (G-07);
175
- * 4. `fallback`.
177
+ * 2. `error.response.data.body` — the SAME envelope's third key;
178
+ * 3. `error.response.data.message` — the backend's own message;
179
+ * 4. `error.response.data.error` — the SAME envelope's alternate key;
180
+ * 5. `error.message` — **only when it is not a transport artefact** (G-07);
181
+ * 6. `fallback`.
182
+ *
183
+ * Step 4 closes capability gap G-08. Several PORTNET back-ends populate
184
+ * `data.error` rather than `data.message` (addpe-fe declares BOTH on its
185
+ * `ApiErrorBody` and read both at seven call sites), so a helper that stopped at
186
+ * `data.message` skipped a real business message and fell through to the generic
187
+ * fallback — which made it non-substitutable for the module-local extractors it
188
+ * exists to replace. Strictly additive: what step 4 now catches previously
189
+ * reached step 5 or 6.
190
+ *
191
+ * Step 2 closes G-08bis — the same defect, a third key. `caution-ui`'s axios
192
+ * interceptor reads `error.response.data.body ?? error.response.data.message`,
193
+ * so on that back-end a helper stopping at `message` again skipped a real
194
+ * business message. Without step 2 the helper was non-substitutable there and
195
+ * the module would have had to keep its own assertion-based extractor.
196
+ *
197
+ * WHY STEP 2 SITS BEFORE `message` AND NOT AFTER `error`.
198
+ * `caution-ui` uses `??`, which is direct evidence that a single response can
199
+ * carry both keys and that `body` is the one that back-end means. Appending
200
+ * `body` at the end of the envelope hops would therefore have SILENTLY FLIPPED
201
+ * which message its users see. Placing it first preserves that precedence, and
202
+ * is provably a no-op for every module that does not populate `body`: `readPath`
203
+ * returns `undefined` and resolution falls straight through to `message`.
204
+ *
205
+ * The one case this perturbs is a back-end that populates BOTH `body` and
206
+ * `message` while intending `message` to win. No such module exists in the
207
+ * portfolio — addpe-fe's `ApiErrorBody` declares `message` and `error`, not
208
+ * `body` — and a module in that position should say so here rather than have the
209
+ * order guessed for it.
176
210
  *
177
- * Step 3 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
211
+ * Step 5 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
178
212
  * timeouts and errno codes are SUPPRESSED so the caller's own French copy is
179
213
  * used instead (Charter §09.3 — no raw technical detail). A message a module
180
214
  * threw deliberately still passes through. Use `getApiErrorDetail` when you want
@@ -187,10 +221,10 @@ var asUserFacingMessage = function asUserFacingMessage(value) {
187
221
  * @param fallback Message when nothing usable is found.
188
222
  */
189
223
  function getApiErrorMessage(error) {
190
- var _ref, _asNonEmptyString;
224
+ var _ref, _ref2, _ref3, _asNonEmptyString;
191
225
  var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_API_ERROR_MESSAGE;
192
226
  if (typeof error === "string" && error.length > 0) return error;
193
- return (_ref = (_asNonEmptyString = asNonEmptyString(readPath(error, ["response", "data", "message"]))) !== null && _asNonEmptyString !== void 0 ? _asNonEmptyString : asUserFacingMessage(readPath(error, ["message"]))) !== null && _ref !== void 0 ? _ref : fallback;
227
+ return (_ref = (_ref2 = (_ref3 = (_asNonEmptyString = asNonEmptyString(readPath(error, ["response", "data", "body"]))) !== null && _asNonEmptyString !== void 0 ? _asNonEmptyString : asNonEmptyString(readPath(error, ["response", "data", "message"]))) !== null && _ref3 !== void 0 ? _ref3 : asNonEmptyString(readPath(error, ["response", "data", "error"]))) !== null && _ref2 !== void 0 ? _ref2 : asUserFacingMessage(readPath(error, ["message"]))) !== null && _ref !== void 0 ? _ref : fallback;
194
228
  }
195
229
 
196
230
  /**
@@ -215,12 +249,41 @@ function getApiErrorDetail(error) {
215
249
  /**
216
250
  * HTTP status carried by a rejection, when there is one.
217
251
  *
252
+ * Resolution order, first numeric match wins:
253
+ * 1. `error.response.data.status` — a BODY-level status;
254
+ * 2. `error.response.status` — the transport status.
255
+ *
218
256
  * Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —
219
257
  * which is the signal callers use to distinguish "the server answered with an
220
258
  * error" from "there was no answer at all" (Charter R-4.3: a status-less failure
221
259
  * is a network banner, not a toast).
260
+ *
261
+ * Step 1 closes G-08ter, the status-side counterpart of the envelope-key gaps
262
+ * G-08 / G-08bis. Several PORTNET back-ends put the meaningful status in the
263
+ * BODY: caution-ui's axios interceptor reads
264
+ * `error.response.data.status ?? error.response.status` and routes on the
265
+ * result (404 -> not-found page, 500 -> server-error page, 401 -> re-login), and
266
+ * its RESPONSE interceptor does the same for success handling. A helper reading
267
+ * only the transport status was therefore not substitutable there — the module
268
+ * had to keep a hand-written `HttpErrorLike` interface and assert onto it, which
269
+ * is exactly the anti-pattern G-04 exists to end. Closing the message side
270
+ * (G-08bis) without the status side would have left that assertion in place for
271
+ * the sake of one field.
272
+ *
273
+ * Body-first ordering mirrors the module's own `??` and is provably a no-op for
274
+ * every back-end that does not populate `data.status`: `readPath` returns
275
+ * `undefined` and resolution falls through to the transport status.
276
+ *
277
+ * BOTH hops are numeric-guarded, which is a deliberate tightening over the
278
+ * module code being replaced. That code did `String(status)` on whatever it
279
+ * found, so a body carrying `status: "ERROR"` produced a `String` switch miss
280
+ * and fell to the default toast branch; here a non-numeric `data.status` is
281
+ * ignored and the real transport status is used instead. That is the more useful
282
+ * answer, and it keeps the return type honest — the signature promises a number.
222
283
  */
223
284
  function getApiErrorStatus(error) {
285
+ var bodyStatus = readPath(error, ["response", "data", "status"]);
286
+ if (typeof bodyStatus === "number") return bodyStatus;
224
287
  var status = readPath(error, ["response", "status"]);
225
288
  return typeof status === "number" ? status : undefined;
226
289
  }
@@ -1 +1 @@
1
- {"version":3,"file":"apiError.js","names":["DEFAULT_API_ERROR_MESSAGE","exports","readPath","source","path","current","_iterator","_createForOfIteratorHelper","_step","s","n","done","key","value","_typeof","undefined","Reflect","get","err","e","f","asNonEmptyString","length","TRANSPORT_MESSAGE_PATTERNS","isTransportMessage","some","pattern","test","trim","asUserFacingMessage","text","getApiErrorMessage","error","_ref","_asNonEmptyString","fallback","arguments","getApiErrorDetail","getApiErrorStatus","status"],"sources":["../../../src/lib/v2/utils/apiError.ts"],"sourcesContent":["/**\r\n * apiError — narrow an `unknown` rejection into something displayable.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-04)\r\n *\r\n * The Platform TypeScript Guidelines mandate `useUnknownInCatchVariables`, so\r\n * `catch (e)` binds `unknown` in EVERY saga of EVERY consuming module. The same\r\n * guidelines forbid `any` and unsafe assertions. Between those two rules sits a\r\n * narrowing helper that the library did not provide — so each module wrote its\r\n * own, and the observed outcome was that they wrote it the forbidden way:\r\n *\r\n * (error as { response?: { data?: { message?: unknown } } }).response\r\n *\r\n * i.e. an unchecked assertion on an `unknown`, used to work around a flag the\r\n * platform imposes. Two modules audited (`procuration-portnet-fe`,\r\n * `procuration-fe`) had independently reached for exactly that construct.\r\n * A mandated strict-mode flag with no sanctioned escape hatch produces\r\n * unsanctioned ones.\r\n *\r\n * Implementation notes\r\n * --------------------\r\n * `readPath` walks nested objects using the `in` operator, which narrows without\r\n * an assertion, and `Reflect.get`, which returns the value as `unknown` rather\r\n * than widening anything to `any`. No assertion appears anywhere in this file.\r\n *\r\n * Deliberately DUCK-TYPED rather than built on `axios.isAxiosError`. Three\r\n * reasons: this library must not take a hard axios dependency for a string\r\n * helper; a plain object shaped like an axios error (a hand-rolled reject, a\r\n * test double, a non-axios transport) still resolves correctly; and the check\r\n * stays valid across axios majors.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * getApiErrorMessage(err) → backend message, or the default\r\n * getApiErrorMessage(err, \"Échec de l'envoi.\") → custom fallback\r\n * getApiErrorStatus(err) → 404 | undefined\r\n */\r\n\r\n/**\r\n * Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and\r\n * §09.3 (no raw technical detail — never \"Erreur 422 Unprocessable Entity\").\r\n * Override per call site when a screen can say something more useful.\r\n */\r\nexport const DEFAULT_API_ERROR_MESSAGE =\r\n \"Une erreur est survenue. Veuillez réessayer.\";\r\n\r\n/**\r\n * Walk `path` through nested non-null objects, returning the value at the end,\r\n * or `undefined` if any hop is missing. Assertion-free.\r\n */\r\nconst readPath = (source: unknown, path: readonly string[]): unknown => {\r\n let current: unknown = source;\r\n\r\n for (const key of path) {\r\n if (typeof current !== \"object\" || current === null || !(key in current)) {\r\n return undefined;\r\n }\r\n current = Reflect.get(current, key);\r\n }\r\n\r\n return current;\r\n};\r\n\r\nconst asNonEmptyString = (value: unknown): string | undefined =>\r\n typeof value === \"string\" && value.length > 0 ? value : undefined;\r\n\r\n/**\r\n * Transport-layer phrasings that must NEVER reach a user — capability gap G-07.\r\n *\r\n * ──────────────────────────────────────────────────────────────────────\r\n * THE DEFECT THIS FIXES\r\n *\r\n * `getApiErrorMessage` resolved `error.message` BEFORE its fallback. An\r\n * `AxiosError` always has `.message`, so on any server error carrying no\r\n * `response.data.message` — a 500 with an empty body, a gateway error, a\r\n * timeout — step 3 won and the user was shown:\r\n *\r\n * \"Request failed with status code 500\"\r\n *\r\n * English, technical, and precisely the shape Charter §09.3 names as forbidden\r\n * (\"✗ « Erreur 422 — Unprocessable Entity »\"). Worse, it made every consuming\r\n * module's carefully-written French fallback effectively UNREACHABLE — the\r\n * argument was accepted and then almost never used. Found during the\r\n * `procuration-portnet-fe` Area 10 audit, where 12 call sites pass a considered\r\n * fallback that could essentially never render.\r\n *\r\n * WHY A DENY-LIST AND NOT SIMPLY DROPPING STEP 3\r\n *\r\n * Step 3 also carries LEGITIMATE messages: any `throw new Error(\"Ce titre ne\r\n * peut pas être supprimé car il est en cours de validation.\")` in module code\r\n * arrives through exactly the same path. Removing the hop would trade a leak of\r\n * technical strings for the loss of real business messages across the whole\r\n * platform — a worse outcome. So the hop stays and only transport phrasings are\r\n * suppressed.\r\n *\r\n * The list is deliberately CONSERVATIVE: anything not recognised passes through,\r\n * on the assumption a human wrote it. A false negative shows one ugly string; a\r\n * false positive silently replaces a real business message with a generic\r\n * fallback, which is the more damaging error.\r\n *\r\n * Sourced from axios's own message construction (`settle`, `AxiosError` codes\r\n * ECONNABORTED / ETIMEDOUT / ERR_NETWORK / ERR_CANCELED) plus the Node socket\r\n * phrasing that surfaces through SSR and test doubles.\r\n * ──────────────────────────────────────────────────────────────────────\r\n */\r\nconst TRANSPORT_MESSAGE_PATTERNS: readonly RegExp[] = [\r\n /^request failed with status code \\d+$/i,\r\n /^network error$/i,\r\n /^timeout of \\d+ms exceeded$/i,\r\n /^timeout exceeded$/i,\r\n /^request aborted$/i,\r\n /^canceled$/i,\r\n /^unsupported protocol/i,\r\n /^maximum content size exceeded$/i,\r\n /^socket hang up$/i,\r\n /* ── errno codes and axios error codes ── CASE-SENSITIVE, DELIBERATELY ─────\r\n *\r\n * These two are the only patterns here NOT marked `/i`, and the asymmetry is\r\n * load-bearing. errno constants are uppercase by universal convention\r\n * (`ETIMEDOUT`, `ECONNREFUSED`, `ENOTFOUND`, `EPIPE`), so an uppercase-only\r\n * match identifies them precisely. Matching case-insensitively would make\r\n * `/^e[a-z]+$/i` swallow ordinary French words beginning with \"e\" — \"erreur\",\r\n * \"expiré\", \"échec\" — turning a real business message into a generic fallback,\r\n * which is the more damaging failure this list is tuned against.\r\n *\r\n * ⚠ An earlier version of the first pattern was `/^ec[a-z]+$/i`, which matched\r\n * `ECONNREFUSED` (it begins \"EC\") but silently MISSED `ETIMEDOUT` (\"ET\"),\r\n * despite the comment claiming otherwise. The unit test caught it. Do not\r\n * narrow the prefix again: the family is \"E + uppercase word\", not \"EC...\".\r\n *\r\n * Residual, accepted: an all-caps single word like \"ERREUR\" is treated as an\r\n * errno code. A module should not be throwing all-caps single-word messages at\r\n * users, and replacing one with a proper French fallback is an improvement. */\r\n /^E[A-Z]{3,}$/, // errno: ETIMEDOUT, ECONNREFUSED, ECONNRESET, ENOTFOUND, EPIPE\r\n /^ERR_[A-Z_]+$/, // axios: ERR_NETWORK, ERR_CANCELED, ERR_BAD_RESPONSE\r\n];\r\n\r\n/** Is this string an axios/transport artefact rather than something for a user? */\r\nconst isTransportMessage = (value: string): boolean =>\r\n TRANSPORT_MESSAGE_PATTERNS.some((pattern) => pattern.test(value.trim()));\r\n\r\n/**\r\n * `error.message`, but only when it is fit to show a user.\r\n *\r\n * Suppresses transport phrasings (G-07) so the caller's French fallback is\r\n * reached instead. Module-thrown `Error` messages pass through untouched.\r\n */\r\nconst asUserFacingMessage = (value: unknown): string | undefined => {\r\n const text = asNonEmptyString(value);\r\n if (text === undefined) return undefined;\r\n return isTransportMessage(text) ? undefined : text;\r\n};\r\n\r\n/**\r\n * Best available human-readable message for a rejection of unknown shape.\r\n *\r\n * Resolution order, first match wins:\r\n * 1. the rejection itself, when it is a non-empty string;\r\n * 2. `error.response.data.message` — the backend's own message;\r\n * 3. `error.message` — **only when it is not a transport artefact** (G-07);\r\n * 4. `fallback`.\r\n *\r\n * Step 3 is filtered: `\"Request failed with status code 500\"`, `\"Network Error\"`,\r\n * timeouts and errno codes are SUPPRESSED so the caller's own French copy is\r\n * used instead (Charter §09.3 — no raw technical detail). A message a module\r\n * threw deliberately still passes through. Use `getApiErrorDetail` when you want\r\n * the unfiltered string for a log.\r\n *\r\n * Never throws and never returns an empty string, so it is safe to render\r\n * directly into a toast or a `Banner`.\r\n *\r\n * @param error The caught value. `unknown` by design.\r\n * @param fallback Message when nothing usable is found.\r\n */\r\nexport function getApiErrorMessage(\r\n error: unknown,\r\n fallback: string = DEFAULT_API_ERROR_MESSAGE\r\n): string {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n\r\n return (\r\n asNonEmptyString(readPath(error, [\"response\", \"data\", \"message\"])) ??\r\n asUserFacingMessage(readPath(error, [\"message\"])) ??\r\n fallback\r\n );\r\n}\r\n\r\n/**\r\n * Unfiltered technical detail for LOGGING — never for display.\r\n *\r\n * `getApiErrorMessage` deliberately suppresses transport phrasings (G-07), which\r\n * is right for a toast and wrong for a console or an APM breadcrumb, where\r\n * `\"Request failed with status code 502\"` is exactly what an operator needs. This\r\n * is the escape hatch: it returns the raw `error.message` when there is one,\r\n * whatever its shape.\r\n *\r\n * Pair them:\r\n *\r\n * toast(getApiErrorMessage(err, \"Échec de l'envoi.\"), \"error\");\r\n * console.error(\"[submit]\", getApiErrorStatus(err), getApiErrorDetail(err));\r\n */\r\nexport function getApiErrorDetail(error: unknown): string | undefined {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n return asNonEmptyString(readPath(error, [\"message\"]));\r\n}\r\n\r\n/**\r\n * HTTP status carried by a rejection, when there is one.\r\n *\r\n * Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —\r\n * which is the signal callers use to distinguish \"the server answered with an\r\n * error\" from \"there was no answer at all\" (Charter R-4.3: a status-less failure\r\n * is a network banner, not a toast).\r\n */\r\nexport function getApiErrorStatus(error: unknown): number | undefined {\r\n const status = readPath(error, [\"response\", \"status\"]);\r\n return typeof status === \"number\" ? status : undefined;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA;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;AACO,IAAMA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GACpC,8CAA8C;;AAEhD;AACA;AACA;AACA;AACA,IAAME,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,MAAe,EAAEC,IAAuB,EAAc;EACtE,IAAIC,OAAgB,GAAGF,MAAM;EAAC,IAAAG,SAAA,GAAAC,0BAAA,CAEZH,IAAI;IAAAI,KAAA;EAAA;IAAtB,KAAAF,SAAA,CAAAG,CAAA,MAAAD,KAAA,GAAAF,SAAA,CA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CAACnB,QAAQ,CAAC8B,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,iBAAiBA,CAACN,KAAc,EAAsB;EACpE,IAAMO,MAAM,GAAGrC,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;EACtD,OAAO,OAAOO,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGxB,SAAS;AACxD","ignoreList":[]}
1
+ {"version":3,"file":"apiError.js","names":["DEFAULT_API_ERROR_MESSAGE","exports","readPath","source","path","current","_iterator","_createForOfIteratorHelper","_step","s","n","done","key","value","_typeof","undefined","Reflect","get","err","e","f","asNonEmptyString","length","TRANSPORT_MESSAGE_PATTERNS","isTransportMessage","some","pattern","test","trim","asUserFacingMessage","text","getApiErrorMessage","error","_ref","_ref2","_ref3","_asNonEmptyString","fallback","arguments","getApiErrorDetail","getApiErrorStatus","bodyStatus","status"],"sources":["../../../src/lib/v2/utils/apiError.ts"],"sourcesContent":["/**\r\n * apiError — narrow an `unknown` rejection into something displayable.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-04)\r\n *\r\n * The Platform TypeScript Guidelines mandate `useUnknownInCatchVariables`, so\r\n * `catch (e)` binds `unknown` in EVERY saga of EVERY consuming module. The same\r\n * guidelines forbid `any` and unsafe assertions. Between those two rules sits a\r\n * narrowing helper that the library did not provide — so each module wrote its\r\n * own, and the observed outcome was that they wrote it the forbidden way:\r\n *\r\n * (error as { response?: { data?: { message?: unknown } } }).response\r\n *\r\n * i.e. an unchecked assertion on an `unknown`, used to work around a flag the\r\n * platform imposes. Two modules audited (`procuration-portnet-fe`,\r\n * `procuration-fe`) had independently reached for exactly that construct.\r\n * A mandated strict-mode flag with no sanctioned escape hatch produces\r\n * unsanctioned ones.\r\n *\r\n * Implementation notes\r\n * --------------------\r\n * `readPath` walks nested objects using the `in` operator, which narrows without\r\n * an assertion, and `Reflect.get`, which returns the value as `unknown` rather\r\n * than widening anything to `any`. No assertion appears anywhere in this file.\r\n *\r\n * Deliberately DUCK-TYPED rather than built on `axios.isAxiosError`. Three\r\n * reasons: this library must not take a hard axios dependency for a string\r\n * helper; a plain object shaped like an axios error (a hand-rolled reject, a\r\n * test double, a non-axios transport) still resolves correctly; and the check\r\n * stays valid across axios majors.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * getApiErrorMessage(err) → backend message, or the default\r\n * getApiErrorMessage(err, \"Échec de l'envoi.\") → custom fallback\r\n * getApiErrorStatus(err) → 404 | undefined\r\n *\r\n * Envelope keys read, in order: `data.body`, `data.message`, `data.error`.\r\n * Three keys because three PORTNET back-ends chose differently; see the\r\n * resolution-order note on `getApiErrorMessage` before adding a fourth.\r\n */\r\n\r\n/**\r\n * Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and\r\n * §09.3 (no raw technical detail — never \"Erreur 422 Unprocessable Entity\").\r\n * Override per call site when a screen can say something more useful.\r\n */\r\nexport const DEFAULT_API_ERROR_MESSAGE =\r\n \"Une erreur est survenue. Veuillez réessayer.\";\r\n\r\n/**\r\n * Walk `path` through nested non-null objects, returning the value at the end,\r\n * or `undefined` if any hop is missing. Assertion-free.\r\n */\r\nconst readPath = (source: unknown, path: readonly string[]): unknown => {\r\n let current: unknown = source;\r\n\r\n for (const key of path) {\r\n if (typeof current !== \"object\" || current === null || !(key in current)) {\r\n return undefined;\r\n }\r\n current = Reflect.get(current, key);\r\n }\r\n\r\n return current;\r\n};\r\n\r\nconst asNonEmptyString = (value: unknown): string | undefined =>\r\n typeof value === \"string\" && value.length > 0 ? value : undefined;\r\n\r\n/**\r\n * Transport-layer phrasings that must NEVER reach a user — capability gap G-07.\r\n *\r\n * ──────────────────────────────────────────────────────────────────────\r\n * THE DEFECT THIS FIXES\r\n *\r\n * `getApiErrorMessage` resolved `error.message` BEFORE its fallback. An\r\n * `AxiosError` always has `.message`, so on any server error carrying no\r\n * `response.data.message` — a 500 with an empty body, a gateway error, a\r\n * timeout — step 3 won and the user was shown:\r\n *\r\n * \"Request failed with status code 500\"\r\n *\r\n * English, technical, and precisely the shape Charter §09.3 names as forbidden\r\n * (\"✗ « Erreur 422 — Unprocessable Entity »\"). Worse, it made every consuming\r\n * module's carefully-written French fallback effectively UNREACHABLE — the\r\n * argument was accepted and then almost never used. Found during the\r\n * `procuration-portnet-fe` Area 10 audit, where 12 call sites pass a considered\r\n * fallback that could essentially never render.\r\n *\r\n * WHY A DENY-LIST AND NOT SIMPLY DROPPING STEP 3\r\n *\r\n * Step 3 also carries LEGITIMATE messages: any `throw new Error(\"Ce titre ne\r\n * peut pas être supprimé car il est en cours de validation.\")` in module code\r\n * arrives through exactly the same path. Removing the hop would trade a leak of\r\n * technical strings for the loss of real business messages across the whole\r\n * platform — a worse outcome. So the hop stays and only transport phrasings are\r\n * suppressed.\r\n *\r\n * The list is deliberately CONSERVATIVE: anything not recognised passes through,\r\n * on the assumption a human wrote it. A false negative shows one ugly string; a\r\n * false positive silently replaces a real business message with a generic\r\n * fallback, which is the more damaging error.\r\n *\r\n * Sourced from axios's own message construction (`settle`, `AxiosError` codes\r\n * ECONNABORTED / ETIMEDOUT / ERR_NETWORK / ERR_CANCELED) plus the Node socket\r\n * phrasing that surfaces through SSR and test doubles.\r\n * ──────────────────────────────────────────────────────────────────────\r\n */\r\nconst TRANSPORT_MESSAGE_PATTERNS: readonly RegExp[] = [\r\n /^request failed with status code \\d+$/i,\r\n /^network error$/i,\r\n /^timeout of \\d+ms exceeded$/i,\r\n /^timeout exceeded$/i,\r\n /^request aborted$/i,\r\n /^canceled$/i,\r\n /^unsupported protocol/i,\r\n /^maximum content size exceeded$/i,\r\n /^socket hang up$/i,\r\n /* ── errno codes and axios error codes ── CASE-SENSITIVE, DELIBERATELY ─────\r\n *\r\n * These two are the only patterns here NOT marked `/i`, and the asymmetry is\r\n * load-bearing. errno constants are uppercase by universal convention\r\n * (`ETIMEDOUT`, `ECONNREFUSED`, `ENOTFOUND`, `EPIPE`), so an uppercase-only\r\n * match identifies them precisely. Matching case-insensitively would make\r\n * `/^e[a-z]+$/i` swallow ordinary French words beginning with \"e\" — \"erreur\",\r\n * \"expiré\", \"échec\" — turning a real business message into a generic fallback,\r\n * which is the more damaging failure this list is tuned against.\r\n *\r\n * ⚠ An earlier version of the first pattern was `/^ec[a-z]+$/i`, which matched\r\n * `ECONNREFUSED` (it begins \"EC\") but silently MISSED `ETIMEDOUT` (\"ET\"),\r\n * despite the comment claiming otherwise. The unit test caught it. Do not\r\n * narrow the prefix again: the family is \"E + uppercase word\", not \"EC...\".\r\n *\r\n * Residual, accepted: an all-caps single word like \"ERREUR\" is treated as an\r\n * errno code. A module should not be throwing all-caps single-word messages at\r\n * users, and replacing one with a proper French fallback is an improvement. */\r\n /^E[A-Z]{3,}$/, // errno: ETIMEDOUT, ECONNREFUSED, ECONNRESET, ENOTFOUND, EPIPE\r\n /^ERR_[A-Z_]+$/, // axios: ERR_NETWORK, ERR_CANCELED, ERR_BAD_RESPONSE\r\n];\r\n\r\n/** Is this string an axios/transport artefact rather than something for a user? */\r\nconst isTransportMessage = (value: string): boolean =>\r\n TRANSPORT_MESSAGE_PATTERNS.some((pattern) => pattern.test(value.trim()));\r\n\r\n/**\r\n * `error.message`, but only when it is fit to show a user.\r\n *\r\n * Suppresses transport phrasings (G-07) so the caller's French fallback is\r\n * reached instead. Module-thrown `Error` messages pass through untouched.\r\n */\r\nconst asUserFacingMessage = (value: unknown): string | undefined => {\r\n const text = asNonEmptyString(value);\r\n if (text === undefined) return undefined;\r\n return isTransportMessage(text) ? undefined : text;\r\n};\r\n\r\n/**\r\n * Best available human-readable message for a rejection of unknown shape.\r\n *\r\n * Resolution order, first match wins:\r\n * 1. the rejection itself, when it is a non-empty string;\r\n * 2. `error.response.data.body` — the SAME envelope's third key;\r\n * 3. `error.response.data.message` — the backend's own message;\r\n * 4. `error.response.data.error` — the SAME envelope's alternate key;\r\n * 5. `error.message` — **only when it is not a transport artefact** (G-07);\r\n * 6. `fallback`.\r\n *\r\n * Step 4 closes capability gap G-08. Several PORTNET back-ends populate\r\n * `data.error` rather than `data.message` (addpe-fe declares BOTH on its\r\n * `ApiErrorBody` and read both at seven call sites), so a helper that stopped at\r\n * `data.message` skipped a real business message and fell through to the generic\r\n * fallback — which made it non-substitutable for the module-local extractors it\r\n * exists to replace. Strictly additive: what step 4 now catches previously\r\n * reached step 5 or 6.\r\n *\r\n * Step 2 closes G-08bis — the same defect, a third key. `caution-ui`'s axios\r\n * interceptor reads `error.response.data.body ?? error.response.data.message`,\r\n * so on that back-end a helper stopping at `message` again skipped a real\r\n * business message. Without step 2 the helper was non-substitutable there and\r\n * the module would have had to keep its own assertion-based extractor.\r\n *\r\n * WHY STEP 2 SITS BEFORE `message` AND NOT AFTER `error`.\r\n * `caution-ui` uses `??`, which is direct evidence that a single response can\r\n * carry both keys and that `body` is the one that back-end means. Appending\r\n * `body` at the end of the envelope hops would therefore have SILENTLY FLIPPED\r\n * which message its users see. Placing it first preserves that precedence, and\r\n * is provably a no-op for every module that does not populate `body`: `readPath`\r\n * returns `undefined` and resolution falls straight through to `message`.\r\n *\r\n * The one case this perturbs is a back-end that populates BOTH `body` and\r\n * `message` while intending `message` to win. No such module exists in the\r\n * portfolio — addpe-fe's `ApiErrorBody` declares `message` and `error`, not\r\n * `body` — and a module in that position should say so here rather than have the\r\n * order guessed for it.\r\n *\r\n * Step 5 is filtered: `\"Request failed with status code 500\"`, `\"Network Error\"`,\r\n * timeouts and errno codes are SUPPRESSED so the caller's own French copy is\r\n * used instead (Charter §09.3 — no raw technical detail). A message a module\r\n * threw deliberately still passes through. Use `getApiErrorDetail` when you want\r\n * the unfiltered string for a log.\r\n *\r\n * Never throws and never returns an empty string, so it is safe to render\r\n * directly into a toast or a `Banner`.\r\n *\r\n * @param error The caught value. `unknown` by design.\r\n * @param fallback Message when nothing usable is found.\r\n */\r\nexport function getApiErrorMessage(\r\n error: unknown,\r\n fallback: string = DEFAULT_API_ERROR_MESSAGE\r\n): string {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n\r\n return (\r\n asNonEmptyString(readPath(error, [\"response\", \"data\", \"body\"])) ??\r\n asNonEmptyString(readPath(error, [\"response\", \"data\", \"message\"])) ??\r\n asNonEmptyString(readPath(error, [\"response\", \"data\", \"error\"])) ??\r\n asUserFacingMessage(readPath(error, [\"message\"])) ??\r\n fallback\r\n );\r\n}\r\n\r\n/**\r\n * Unfiltered technical detail for LOGGING — never for display.\r\n *\r\n * `getApiErrorMessage` deliberately suppresses transport phrasings (G-07), which\r\n * is right for a toast and wrong for a console or an APM breadcrumb, where\r\n * `\"Request failed with status code 502\"` is exactly what an operator needs. This\r\n * is the escape hatch: it returns the raw `error.message` when there is one,\r\n * whatever its shape.\r\n *\r\n * Pair them:\r\n *\r\n * toast(getApiErrorMessage(err, \"Échec de l'envoi.\"), \"error\");\r\n * console.error(\"[submit]\", getApiErrorStatus(err), getApiErrorDetail(err));\r\n */\r\nexport function getApiErrorDetail(error: unknown): string | undefined {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n return asNonEmptyString(readPath(error, [\"message\"]));\r\n}\r\n\r\n/**\r\n * HTTP status carried by a rejection, when there is one.\r\n *\r\n * Resolution order, first numeric match wins:\r\n * 1. `error.response.data.status` — a BODY-level status;\r\n * 2. `error.response.status` — the transport status.\r\n *\r\n * Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —\r\n * which is the signal callers use to distinguish \"the server answered with an\r\n * error\" from \"there was no answer at all\" (Charter R-4.3: a status-less failure\r\n * is a network banner, not a toast).\r\n *\r\n * Step 1 closes G-08ter, the status-side counterpart of the envelope-key gaps\r\n * G-08 / G-08bis. Several PORTNET back-ends put the meaningful status in the\r\n * BODY: caution-ui's axios interceptor reads\r\n * `error.response.data.status ?? error.response.status` and routes on the\r\n * result (404 -> not-found page, 500 -> server-error page, 401 -> re-login), and\r\n * its RESPONSE interceptor does the same for success handling. A helper reading\r\n * only the transport status was therefore not substitutable there — the module\r\n * had to keep a hand-written `HttpErrorLike` interface and assert onto it, which\r\n * is exactly the anti-pattern G-04 exists to end. Closing the message side\r\n * (G-08bis) without the status side would have left that assertion in place for\r\n * the sake of one field.\r\n *\r\n * Body-first ordering mirrors the module's own `??` and is provably a no-op for\r\n * every back-end that does not populate `data.status`: `readPath` returns\r\n * `undefined` and resolution falls through to the transport status.\r\n *\r\n * BOTH hops are numeric-guarded, which is a deliberate tightening over the\r\n * module code being replaced. That code did `String(status)` on whatever it\r\n * found, so a body carrying `status: \"ERROR\"` produced a `String` switch miss\r\n * and fell to the default toast branch; here a non-numeric `data.status` is\r\n * ignored and the real transport status is used instead. That is the more useful\r\n * answer, and it keeps the return type honest — the signature promises a number.\r\n */\r\nexport function getApiErrorStatus(error: unknown): number | undefined {\r\n const bodyStatus = readPath(error, [\"response\", \"data\", \"status\"]);\r\n if (typeof bodyStatus === \"number\") return bodyStatus;\r\n\r\n const status = readPath(error, [\"response\", \"status\"]);\r\n return typeof status === \"number\" ? status : undefined;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA;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;AACO,IAAMA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GACpC,8CAA8C;;AAEhD;AACA;AACA;AACA;AACA,IAAME,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,MAAe,EAAEC,IAAuB,EAAc;EACtE,IAAIC,OAAgB,GAAGF,MAAM;EAAC,IAAAG,SAAA,GAAAC,0BAAA,CAEZH,IAAI;IAAAI,KAAA;EAAA;IAAtB,KAAAF,SAAA,CAAAG,CA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A,KAAA,GAClEd,gBAAgB,CAACnB,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAAE,KAAA,cAAAA,KAAA,GAChEL,mBAAmB,CAAC3B,QAAQ,CAAC8B,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,cAAAC,IAAA,cAAAA,IAAA,GACjDI,QAAQ;AAEZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAACP,KAAc,EAAsB;EACpE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACV,MAAM,GAAG,CAAC,EAAE,OAAOU,KAAK;EAC/D,OAAOX,gBAAgB,CAACnB,QAAQ,CAAC8B,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACvD;;AAEA;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;AACO,SAASQ,iBAAiBA,CAACR,KAAc,EAAsB;EACpE,IAAMS,UAAU,GAAGvC,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;EAClE,IAAI,OAAOS,UAAU,KAAK,QAAQ,EAAE,OAAOA,UAAU;EAErD,IAAMC,MAAM,GAAGxC,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;EACtD,OAAO,OAAOU,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAG3B,SAAS;AACxD","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  export { cx } from "./cx";
2
2
  export { default as fmtMoney } from "./fmtMoney";
3
+ export { mergeLabels } from "./mergeLabels";
3
4
  export { downloadBase64File, getMimeType, openBase64FileInTab, downloadBlobFile, } from "./fileDownload";
4
5
  export * as contrast from "./contrast";
5
6
  export { getApiErrorMessage, getApiErrorDetail, getApiErrorStatus, DEFAULT_API_ERROR_MESSAGE, } from "./apiError";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAuB,MAAM,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMjD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAavC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAuB,MAAM,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AASjD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAavC,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -65,6 +65,12 @@ Object.defineProperty(exports, "getMimeType", {
65
65
  return _fileDownload.getMimeType;
66
66
  }
67
67
  });
68
+ Object.defineProperty(exports, "mergeLabels", {
69
+ enumerable: true,
70
+ get: function get() {
71
+ return _mergeLabels.mergeLabels;
72
+ }
73
+ });
68
74
  Object.defineProperty(exports, "networkStatus", {
69
75
  enumerable: true,
70
76
  get: function get() {
@@ -79,6 +85,7 @@ Object.defineProperty(exports, "openBase64FileInTab", {
79
85
  });
80
86
  var _cx = require("./cx");
81
87
  var _fmtMoney = _interopRequireDefault(require("./fmtMoney"));
88
+ var _mergeLabels = require("./mergeLabels");
82
89
  var _fileDownload = require("./fileDownload");
83
90
  var _contrast = _interopRequireWildcard(require("./contrast"));
84
91
  exports.contrast = _contrast;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_cx","require","_fmtMoney","_interopRequireDefault","_fileDownload","_contrast","_interopRequireWildcard","exports","contrast","_apiError","_networkStatus","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["../../../src/lib/v2/utils/index.ts"],"sourcesContent":["export { cx } from \"./cx\";\r\nexport { default as fmtMoney } from \"./fmtMoney\";\r\n\r\n// Base64 → browser download, plus the extension→MIME map it uses.\r\n// Flat named exports (not a namespace like contrast below): two\r\n// independent functions with no shared state, and downloadBase64File\r\n// is the common call site — qualifying it would only add noise.\r\nexport {\r\n downloadBase64File,\r\n getMimeType,\r\n openBase64FileInTab,\r\n downloadBlobFile,\r\n} from \"./fileDownload\";\r\n\r\n// WCAG 2.1 contrast utilities. Re-exported under a namespace at\r\n// the public barrel (v2.contrast.*) so the named API is grouped\r\n// and self-describing for callers — used to validate runtime\r\n// brand overrides against WCAG 1.4.3 and to audit dark-mode\r\n// token pairs (F29).\r\nexport * as contrast from \"./contrast\";\r\n\r\n// `unknown`-rejection narrowing. Mandated by the platform's own\r\n// `useUnknownInCatchVariables` flag, which makes `catch (e)` bind `unknown` in\r\n// every consuming saga while `any` and unsafe assertions stay forbidden — the\r\n// library previously left no sanctioned route between those two rules, and the\r\n// modules that filled the gap filled it with the forbidden construct.\r\n// Raised as capability gap G-04 (procuration-portnet-fe Area 5).\r\n//\r\n// `getApiErrorDetail` is the LOGGING counterpart added with G-07: since\r\n// `getApiErrorMessage` now suppresses axios transport phrasings so they cannot\r\n// reach a user (Charter §09.3), operators still need the unfiltered string for a\r\n// console or an APM breadcrumb. Display one, log the other.\r\nexport {\r\n getApiErrorMessage,\r\n getApiErrorDetail,\r\n getApiErrorStatus,\r\n DEFAULT_API_ERROR_MESSAGE,\r\n} from \"./apiError\";\r\n\r\n// The feed behind NetworkErrorBanner. The banner was exported without the\r\n// plumbing that decides when it shows, so every module rebuilt the same\r\n// subscribe/report/clear channel. Raised as capability gap G-03\r\n// (procuration-portnet-fe Area 5).\r\nexport { networkStatus, createNetworkStatus } from \"./networkStatus\";\r\nexport type { NetworkStatus, NetworkStatusListener } from \"./networkStatus\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAMA,IAAAG,aAAA,GAAAH,OAAA;AAKwB,IAAAI,SAAA,GAAAC,uBAAA,CAAAL,OAAA;AAAAM,OAAA,CAAAC,QAAA,GAAAH,SAAA;AAoBxB,IAAAI,SAAA,GAAAR,OAAA;AAWA,IAAAS,cAAA,GAAAT,OAAA;AAAqE,SAAAU,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,cAAAN,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAAA,SAAAnB,uBAAAa,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_cx","require","_fmtMoney","_interopRequireDefault","_mergeLabels","_fileDownload","_contrast","_interopRequireWildcard","exports","contrast","_apiError","_networkStatus","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sources":["../../../src/lib/v2/utils/index.ts"],"sourcesContent":["export { cx } from \"./cx\";\r\nexport { default as fmtMoney } from \"./fmtMoney\";\r\n\r\n// Undefined-safe label merge. Every localisable component used to write\r\n// `labels ? { ...DEFAULTS, ...labels } : DEFAULTS`, and a spread does NOT skip\r\n// explicit `undefined` — so an override of `undefined` DELETED the default and\r\n// the component threw `L.x is not a function` at render. Eleven components\r\n// shipped that hazard; the `?: T` declarations hid it from the compiler by\r\n// asserting the merged value could never be undefined, which was false at\r\n// runtime. Surfaced by the G-14 widening. Latent runtime defect, not cosmetics.\r\nexport { mergeLabels } from \"./mergeLabels\";\r\n\r\n// Base64 → browser download, plus the extension→MIME map it uses.\r\n// Flat named exports (not a namespace like contrast below): two\r\n// independent functions with no shared state, and downloadBase64File\r\n// is the common call site — qualifying it would only add noise.\r\nexport {\r\n downloadBase64File,\r\n getMimeType,\r\n openBase64FileInTab,\r\n downloadBlobFile,\r\n} from \"./fileDownload\";\r\n\r\n// WCAG 2.1 contrast utilities. Re-exported under a namespace at\r\n// the public barrel (v2.contrast.*) so the named API is grouped\r\n// and self-describing for callers — used to validate runtime\r\n// brand overrides against WCAG 1.4.3 and to audit dark-mode\r\n// token pairs (F29).\r\nexport * as contrast from \"./contrast\";\r\n\r\n// `unknown`-rejection narrowing. Mandated by the platform's own\r\n// `useUnknownInCatchVariables` flag, which makes `catch (e)` bind `unknown` in\r\n// every consuming saga while `any` and unsafe assertions stay forbidden — the\r\n// library previously left no sanctioned route between those two rules, and the\r\n// modules that filled the gap filled it with the forbidden construct.\r\n// Raised as capability gap G-04 (procuration-portnet-fe Area 5).\r\n//\r\n// `getApiErrorDetail` is the LOGGING counterpart added with G-07: since\r\n// `getApiErrorMessage` now suppresses axios transport phrasings so they cannot\r\n// reach a user (Charter §09.3), operators still need the unfiltered string for a\r\n// console or an APM breadcrumb. Display one, log the other.\r\nexport {\r\n getApiErrorMessage,\r\n getApiErrorDetail,\r\n getApiErrorStatus,\r\n DEFAULT_API_ERROR_MESSAGE,\r\n} from \"./apiError\";\r\n\r\n// The feed behind NetworkErrorBanner. The banner was exported without the\r\n// plumbing that decides when it shows, so every module rebuilt the same\r\n// subscribe/report/clear channel. Raised as capability gap G-03\r\n// (procuration-portnet-fe Area 5).\r\nexport { networkStatus, createNetworkStatus } from \"./networkStatus\";\r\nexport type { NetworkStatus, NetworkStatusListener } from \"./networkStatus\";\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AASA,IAAAG,YAAA,GAAAH,OAAA;AAMA,IAAAI,aAAA,GAAAJ,OAAA;AAKwB,IAAAK,SAAA,GAAAC,uBAAA,CAAAN,OAAA;AAAAO,OAAA,CAAAC,QAAA,GAAAH,SAAA;AAoBxB,IAAAI,SAAA,GAAAT,OAAA;AAWA,IAAAU,cAAA,GAAAV,OAAA;AAAqE,SAAAW,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAN,wBAAAU,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KA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