@portnet/ui 5.0.28 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (736) hide show
  1. package/CHANGELOG.md +524 -0
  2. package/README.md +101 -38
  3. package/dist/index.d.ts +59 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +174 -203
  6. package/dist/index.js.map +1 -0
  7. package/dist/v2/__tests__/MobileRowCard.test.js +337 -0
  8. package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -0
  9. package/dist/v2/__tests__/apiError.test.js +182 -0
  10. package/dist/v2/__tests__/apiError.test.js.map +1 -0
  11. package/dist/v2/__tests__/banned-patterns.test.js +272 -0
  12. package/dist/v2/__tests__/banned-patterns.test.js.map +1 -0
  13. package/dist/v2/__tests__/contrast-palette.test.js +225 -0
  14. package/dist/v2/__tests__/contrast-palette.test.js.map +1 -0
  15. package/dist/v2/__tests__/cssVariables.test.js +158 -0
  16. package/dist/v2/__tests__/cssVariables.test.js.map +1 -0
  17. package/dist/v2/__tests__/labels-merge.test.js +153 -0
  18. package/dist/v2/__tests__/labels-merge.test.js.map +1 -0
  19. package/dist/v2/__tests__/locale-fallback.test.js +111 -0
  20. package/dist/v2/__tests__/locale-fallback.test.js.map +1 -0
  21. package/dist/v2/__tests__/useFocusTrap.test.js +517 -0
  22. package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -0
  23. package/dist/v2/components/Accordion.d.ts +56 -0
  24. package/dist/v2/components/Accordion.d.ts.map +1 -0
  25. package/dist/v2/components/Accordion.js +238 -0
  26. package/dist/v2/components/Accordion.js.map +1 -0
  27. package/dist/v2/components/ActionStrip.d.ts +67 -0
  28. package/dist/v2/components/ActionStrip.d.ts.map +1 -0
  29. package/dist/v2/components/ActionStrip.js +154 -0
  30. package/dist/v2/components/ActionStrip.js.map +1 -0
  31. package/dist/v2/components/Banner.d.ts +49 -0
  32. package/dist/v2/components/Banner.d.ts.map +1 -0
  33. package/dist/v2/components/Banner.js +183 -0
  34. package/dist/v2/components/Banner.js.map +1 -0
  35. package/dist/v2/components/Busy.d.ts +18 -0
  36. package/dist/v2/components/Busy.d.ts.map +1 -0
  37. package/dist/v2/components/Busy.js +104 -0
  38. package/dist/v2/components/Busy.js.map +1 -0
  39. package/dist/v2/components/Button.d.ts +36 -0
  40. package/dist/v2/components/Button.d.ts.map +1 -0
  41. package/dist/v2/components/Button.js +122 -0
  42. package/dist/v2/components/Button.js.map +1 -0
  43. package/dist/v2/components/CategoryTag.d.ts +45 -0
  44. package/dist/v2/components/CategoryTag.d.ts.map +1 -0
  45. package/dist/v2/components/CategoryTag.js +89 -0
  46. package/dist/v2/components/CategoryTag.js.map +1 -0
  47. package/dist/v2/components/Checkbox.d.ts +59 -0
  48. package/dist/v2/components/Checkbox.d.ts.map +1 -0
  49. package/dist/v2/components/Checkbox.js +134 -0
  50. package/dist/v2/components/Checkbox.js.map +1 -0
  51. package/dist/v2/components/Chip.d.ts +48 -0
  52. package/dist/v2/components/Chip.d.ts.map +1 -0
  53. package/dist/v2/components/Chip.js +131 -0
  54. package/dist/v2/components/Chip.js.map +1 -0
  55. package/dist/v2/components/Combobox.d.ts +134 -0
  56. package/dist/v2/components/Combobox.d.ts.map +1 -0
  57. package/dist/v2/components/Combobox.js +399 -0
  58. package/dist/v2/components/Combobox.js.map +1 -0
  59. package/dist/v2/components/CommandPalette.d.ts +36 -0
  60. package/dist/v2/components/CommandPalette.d.ts.map +1 -0
  61. package/dist/v2/components/CommandPalette.js +672 -0
  62. package/dist/v2/components/CommandPalette.js.map +1 -0
  63. package/dist/v2/components/ConfirmDialog.d.ts +23 -0
  64. package/dist/v2/components/ConfirmDialog.d.ts.map +1 -0
  65. package/dist/v2/components/ConfirmDialog.js +150 -0
  66. package/dist/v2/components/ConfirmDialog.js.map +1 -0
  67. package/dist/v2/components/DatePicker.d.ts +21 -0
  68. package/dist/v2/components/DatePicker.d.ts.map +1 -0
  69. package/dist/v2/components/DatePicker.js +207 -0
  70. package/dist/v2/components/DatePicker.js.map +1 -0
  71. package/dist/v2/components/DateRangePicker.d.ts +81 -0
  72. package/dist/v2/components/DateRangePicker.d.ts.map +1 -0
  73. package/dist/v2/components/DateRangePicker.js +295 -0
  74. package/dist/v2/components/DateRangePicker.js.map +1 -0
  75. package/dist/v2/components/DateTimePicker.d.ts +21 -0
  76. package/dist/v2/components/DateTimePicker.d.ts.map +1 -0
  77. package/dist/v2/components/DateTimePicker.js +189 -0
  78. package/dist/v2/components/DateTimePicker.js.map +1 -0
  79. package/dist/v2/components/Drawer.d.ts +34 -0
  80. package/dist/v2/components/Drawer.d.ts.map +1 -0
  81. package/dist/v2/components/Drawer.js +339 -0
  82. package/dist/v2/components/Drawer.js.map +1 -0
  83. package/dist/v2/components/Dropzone.d.ts +150 -0
  84. package/dist/v2/components/Dropzone.d.ts.map +1 -0
  85. package/dist/v2/components/Dropzone.js +539 -0
  86. package/dist/v2/components/Dropzone.js.map +1 -0
  87. package/dist/v2/components/EmptyState.d.ts +36 -0
  88. package/dist/v2/components/EmptyState.d.ts.map +1 -0
  89. package/dist/v2/components/EmptyState.js +112 -0
  90. package/dist/v2/components/EmptyState.js.map +1 -0
  91. package/dist/v2/components/FavoriteToggle.d.ts +22 -0
  92. package/dist/v2/components/FavoriteToggle.d.ts.map +1 -0
  93. package/dist/v2/components/FavoriteToggle.js +134 -0
  94. package/dist/v2/components/FavoriteToggle.js.map +1 -0
  95. package/dist/v2/components/Field.d.ts +58 -0
  96. package/dist/v2/components/Field.d.ts.map +1 -0
  97. package/dist/v2/components/Field.js +186 -0
  98. package/dist/v2/components/Field.js.map +1 -0
  99. package/dist/v2/components/FieldHelp.d.ts +54 -0
  100. package/dist/v2/components/FieldHelp.d.ts.map +1 -0
  101. package/dist/v2/components/FieldHelp.js +209 -0
  102. package/dist/v2/components/FieldHelp.js.map +1 -0
  103. package/dist/v2/components/FilterTab.d.ts +35 -0
  104. package/dist/v2/components/FilterTab.d.ts.map +1 -0
  105. package/dist/v2/components/FilterTab.js +144 -0
  106. package/dist/v2/components/FilterTab.js.map +1 -0
  107. package/dist/v2/components/ForbiddenPage.d.ts +40 -0
  108. package/dist/v2/components/ForbiddenPage.d.ts.map +1 -0
  109. package/dist/v2/components/ForbiddenPage.js +81 -0
  110. package/dist/v2/components/ForbiddenPage.js.map +1 -0
  111. package/dist/v2/components/FormGrid.d.ts +76 -0
  112. package/dist/v2/components/FormGrid.d.ts.map +1 -0
  113. package/dist/v2/components/FormGrid.js +177 -0
  114. package/dist/v2/components/FormGrid.js.map +1 -0
  115. package/dist/v2/components/FormikDisplay.d.ts +38 -0
  116. package/dist/v2/components/FormikDisplay.d.ts.map +1 -0
  117. package/dist/v2/components/FormikDisplay.js +125 -0
  118. package/dist/v2/components/FormikDisplay.js.map +1 -0
  119. package/dist/v2/components/Input.d.ts +62 -0
  120. package/dist/v2/components/Input.d.ts.map +1 -0
  121. package/dist/v2/components/Input.js +115 -0
  122. package/dist/v2/components/Input.js.map +1 -0
  123. package/dist/v2/components/KPICard.d.ts +22 -0
  124. package/dist/v2/components/KPICard.d.ts.map +1 -0
  125. package/dist/v2/components/KPICard.js +205 -0
  126. package/dist/v2/components/KPICard.js.map +1 -0
  127. package/dist/v2/components/KV.d.ts +25 -0
  128. package/dist/v2/components/KV.d.ts.map +1 -0
  129. package/dist/v2/components/KV.js +82 -0
  130. package/dist/v2/components/KV.js.map +1 -0
  131. package/dist/v2/components/KVGrid.d.ts +44 -0
  132. package/dist/v2/components/KVGrid.d.ts.map +1 -0
  133. package/dist/v2/components/KVGrid.js +73 -0
  134. package/dist/v2/components/KVGrid.js.map +1 -0
  135. package/dist/v2/components/Layout.d.ts +78 -0
  136. package/dist/v2/components/Layout.d.ts.map +1 -0
  137. package/dist/v2/components/Layout.js +284 -0
  138. package/dist/v2/components/Layout.js.map +1 -0
  139. package/dist/v2/components/MobileRowCard.d.ts +63 -0
  140. package/dist/v2/components/MobileRowCard.d.ts.map +1 -0
  141. package/dist/v2/components/MobileRowCard.js +321 -0
  142. package/dist/v2/components/MobileRowCard.js.map +1 -0
  143. package/dist/v2/components/Modal.d.ts +21 -0
  144. package/dist/v2/components/Modal.d.ts.map +1 -0
  145. package/dist/v2/components/Modal.js +281 -0
  146. package/dist/v2/components/Modal.js.map +1 -0
  147. package/dist/v2/components/NetworkErrorPage.d.ts +11 -0
  148. package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -0
  149. package/dist/v2/components/NetworkErrorPage.js +86 -0
  150. package/dist/v2/components/NetworkErrorPage.js.map +1 -0
  151. package/dist/v2/components/NotFoundPage.d.ts +9 -0
  152. package/dist/v2/components/NotFoundPage.d.ts.map +1 -0
  153. package/dist/v2/components/NotFoundPage.js +66 -0
  154. package/dist/v2/components/NotFoundPage.js.map +1 -0
  155. package/dist/v2/components/NumberInput.d.ts +83 -0
  156. package/dist/v2/components/NumberInput.d.ts.map +1 -0
  157. package/dist/v2/components/NumberInput.js +316 -0
  158. package/dist/v2/components/NumberInput.js.map +1 -0
  159. package/dist/v2/components/OverflowMenu.d.ts +55 -0
  160. package/dist/v2/components/OverflowMenu.d.ts.map +1 -0
  161. package/dist/v2/components/OverflowMenu.js +196 -0
  162. package/dist/v2/components/OverflowMenu.js.map +1 -0
  163. package/dist/v2/components/PdfViewer.d.ts +56 -0
  164. package/dist/v2/components/PdfViewer.d.ts.map +1 -0
  165. package/dist/v2/components/PdfViewer.js +132 -0
  166. package/dist/v2/components/PdfViewer.js.map +1 -0
  167. package/dist/v2/components/ProgressBar.d.ts +53 -0
  168. package/dist/v2/components/ProgressBar.d.ts.map +1 -0
  169. package/dist/v2/components/ProgressBar.js +209 -0
  170. package/dist/v2/components/ProgressBar.js.map +1 -0
  171. package/dist/v2/components/Radio.d.ts +78 -0
  172. package/dist/v2/components/Radio.d.ts.map +1 -0
  173. package/dist/v2/components/Radio.js +238 -0
  174. package/dist/v2/components/Radio.js.map +1 -0
  175. package/dist/v2/components/SectionHeader.d.ts +53 -0
  176. package/dist/v2/components/SectionHeader.d.ts.map +1 -0
  177. package/dist/v2/components/SectionHeader.js +140 -0
  178. package/dist/v2/components/SectionHeader.js.map +1 -0
  179. package/dist/v2/components/Segmented.d.ts +61 -0
  180. package/dist/v2/components/Segmented.d.ts.map +1 -0
  181. package/dist/v2/components/Segmented.js +261 -0
  182. package/dist/v2/components/Segmented.js.map +1 -0
  183. package/dist/v2/components/Select.d.ts +72 -0
  184. package/dist/v2/components/Select.d.ts.map +1 -0
  185. package/dist/v2/components/Select.js +382 -0
  186. package/dist/v2/components/Select.js.map +1 -0
  187. package/dist/v2/components/ServerErrorPage.d.ts +11 -0
  188. package/dist/v2/components/ServerErrorPage.d.ts.map +1 -0
  189. package/dist/v2/components/ServerErrorPage.js +82 -0
  190. package/dist/v2/components/ServerErrorPage.js.map +1 -0
  191. package/dist/v2/components/Skeleton.d.ts +56 -0
  192. package/dist/v2/components/Skeleton.d.ts.map +1 -0
  193. package/dist/v2/components/Skeleton.js +281 -0
  194. package/dist/v2/components/Skeleton.js.map +1 -0
  195. package/dist/v2/components/SkipLink.d.ts +30 -0
  196. package/dist/v2/components/SkipLink.d.ts.map +1 -0
  197. package/dist/v2/components/SkipLink.js +58 -0
  198. package/dist/v2/components/SkipLink.js.map +1 -0
  199. package/dist/v2/components/Spinner.d.ts +40 -0
  200. package/dist/v2/components/Spinner.d.ts.map +1 -0
  201. package/dist/v2/components/Spinner.js +76 -0
  202. package/dist/v2/components/Spinner.js.map +1 -0
  203. package/dist/v2/components/Status.d.ts +42 -0
  204. package/dist/v2/components/Status.d.ts.map +1 -0
  205. package/dist/v2/components/Status.js +71 -0
  206. package/dist/v2/components/Status.js.map +1 -0
  207. package/dist/v2/components/Stepper.d.ts +136 -0
  208. package/dist/v2/components/Stepper.d.ts.map +1 -0
  209. package/dist/v2/components/Stepper.js +415 -0
  210. package/dist/v2/components/Stepper.js.map +1 -0
  211. package/dist/v2/components/Switch.d.ts +30 -0
  212. package/dist/v2/components/Switch.d.ts.map +1 -0
  213. package/dist/v2/components/Switch.js +136 -0
  214. package/dist/v2/components/Switch.js.map +1 -0
  215. package/dist/v2/components/Tabs.d.ts +49 -0
  216. package/dist/v2/components/Tabs.d.ts.map +1 -0
  217. package/dist/v2/components/Tabs.js +160 -0
  218. package/dist/v2/components/Tabs.js.map +1 -0
  219. package/dist/v2/components/TelInput.d.ts +33 -0
  220. package/dist/v2/components/TelInput.d.ts.map +1 -0
  221. package/dist/v2/components/TelInput.js +282 -0
  222. package/dist/v2/components/TelInput.js.map +1 -0
  223. package/dist/v2/components/Textarea.d.ts +23 -0
  224. package/dist/v2/components/Textarea.d.ts.map +1 -0
  225. package/dist/v2/components/Textarea.js +80 -0
  226. package/dist/v2/components/Textarea.js.map +1 -0
  227. package/dist/v2/components/TimePicker.d.ts +21 -0
  228. package/dist/v2/components/TimePicker.d.ts.map +1 -0
  229. package/dist/v2/components/TimePicker.js +141 -0
  230. package/dist/v2/components/TimePicker.js.map +1 -0
  231. package/dist/v2/components/Toast.d.ts +32 -0
  232. package/dist/v2/components/Toast.d.ts.map +1 -0
  233. package/dist/v2/components/Toast.js +384 -0
  234. package/dist/v2/components/Toast.js.map +1 -0
  235. package/dist/v2/components/Tooltip.d.ts +9 -0
  236. package/dist/v2/components/Tooltip.d.ts.map +1 -0
  237. package/dist/v2/components/Tooltip.js +169 -0
  238. package/dist/v2/components/Tooltip.js.map +1 -0
  239. package/dist/v2/components/_ErrorPageBody.d.ts +48 -0
  240. package/dist/v2/components/_ErrorPageBody.d.ts.map +1 -0
  241. package/dist/v2/components/_ErrorPageBody.js +96 -0
  242. package/dist/v2/components/_ErrorPageBody.js.map +1 -0
  243. package/dist/v2/components/_pickerShared.d.ts +47 -0
  244. package/dist/v2/components/_pickerShared.d.ts.map +1 -0
  245. package/dist/v2/components/_pickerShared.js +68 -0
  246. package/dist/v2/components/_pickerShared.js.map +1 -0
  247. package/dist/v2/components/index.d.ts +83 -0
  248. package/dist/v2/components/index.d.ts.map +1 -0
  249. package/dist/v2/components/index.js +477 -0
  250. package/dist/v2/components/index.js.map +1 -0
  251. package/dist/v2/hooks/index.d.ts +11 -0
  252. package/dist/v2/hooks/index.d.ts.map +1 -0
  253. package/dist/v2/hooks/index.js +85 -0
  254. package/dist/v2/hooks/index.js.map +1 -0
  255. package/dist/v2/hooks/useDelayedFlag.d.ts +22 -0
  256. package/dist/v2/hooks/useDelayedFlag.d.ts.map +1 -0
  257. package/dist/v2/hooks/useDelayedFlag.js +60 -0
  258. package/dist/v2/hooks/useDelayedFlag.js.map +1 -0
  259. package/dist/v2/hooks/useDensity.d.ts +23 -0
  260. package/dist/v2/hooks/useDensity.d.ts.map +1 -0
  261. package/dist/v2/hooks/useDensity.js +124 -0
  262. package/dist/v2/hooks/useDensity.js.map +1 -0
  263. package/dist/v2/hooks/useFocusFirstError.d.ts +121 -0
  264. package/dist/v2/hooks/useFocusFirstError.d.ts.map +1 -0
  265. package/dist/v2/hooks/useFocusFirstError.js +203 -0
  266. package/dist/v2/hooks/useFocusFirstError.js.map +1 -0
  267. package/dist/v2/hooks/useFocusTrap.d.ts +3 -0
  268. package/dist/v2/hooks/useFocusTrap.d.ts.map +1 -0
  269. package/dist/v2/hooks/useFocusTrap.js +207 -0
  270. package/dist/v2/hooks/useFocusTrap.js.map +1 -0
  271. package/dist/v2/hooks/useFormAutoSave.d.ts +42 -0
  272. package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -0
  273. package/dist/v2/hooks/useFormAutoSave.js +186 -0
  274. package/dist/v2/hooks/useFormAutoSave.js.map +1 -0
  275. package/dist/v2/hooks/useFormCompletionProgress.d.ts +52 -0
  276. package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -0
  277. package/dist/v2/hooks/useFormCompletionProgress.js +136 -0
  278. package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -0
  279. package/dist/v2/hooks/useResolvedDensity.d.ts +31 -0
  280. package/dist/v2/hooks/useResolvedDensity.d.ts.map +1 -0
  281. package/dist/v2/hooks/useResolvedDensity.js +50 -0
  282. package/dist/v2/hooks/useResolvedDensity.js.map +1 -0
  283. package/dist/v2/hooks/useSortedRows.d.ts +25 -0
  284. package/dist/v2/hooks/useSortedRows.d.ts.map +1 -0
  285. package/dist/v2/hooks/useSortedRows.js +38 -0
  286. package/dist/v2/hooks/useSortedRows.js.map +1 -0
  287. package/dist/v2/hooks/useTabLoading.d.ts +39 -0
  288. package/dist/v2/hooks/useTabLoading.d.ts.map +1 -0
  289. package/dist/v2/hooks/useTabLoading.js +85 -0
  290. package/dist/v2/hooks/useTabLoading.js.map +1 -0
  291. package/dist/v2/index.d.ts +115 -0
  292. package/dist/v2/index.d.ts.map +1 -0
  293. package/dist/v2/index.js +1127 -0
  294. package/dist/v2/index.js.map +1 -0
  295. package/dist/v2/modalContext.d.ts +96 -0
  296. package/dist/v2/modalContext.d.ts.map +1 -0
  297. package/dist/v2/modalContext.js +113 -0
  298. package/dist/v2/modalContext.js.map +1 -0
  299. package/dist/v2/models/favorite.d.ts +14 -0
  300. package/dist/v2/models/favorite.d.ts.map +1 -0
  301. package/dist/v2/models/favorite.js +6 -0
  302. package/dist/v2/models/favorite.js.map +1 -0
  303. package/dist/v2/models/index.d.ts +11 -0
  304. package/dist/v2/models/index.d.ts.map +1 -0
  305. package/dist/v2/models/index.js +50 -0
  306. package/dist/v2/models/index.js.map +1 -0
  307. package/dist/v2/models/personalization.d.ts +65 -0
  308. package/dist/v2/models/personalization.d.ts.map +1 -0
  309. package/dist/v2/models/personalization.js +6 -0
  310. package/dist/v2/models/personalization.js.map +1 -0
  311. package/dist/v2/models/referentiel.d.ts +67 -0
  312. package/dist/v2/models/referentiel.d.ts.map +1 -0
  313. package/dist/v2/models/referentiel.js +6 -0
  314. package/dist/v2/models/referentiel.js.map +1 -0
  315. package/dist/v2/models/savedFilter.d.ts +22 -0
  316. package/dist/v2/models/savedFilter.d.ts.map +1 -0
  317. package/dist/v2/models/savedFilter.js +6 -0
  318. package/dist/v2/models/savedFilter.js.map +1 -0
  319. package/dist/v2/patterns/ActionBar.d.ts +137 -0
  320. package/dist/v2/patterns/ActionBar.d.ts.map +1 -0
  321. package/dist/v2/patterns/ActionBar.js +601 -0
  322. package/dist/v2/patterns/ActionBar.js.map +1 -0
  323. package/dist/v2/patterns/BulkActionBar.d.ts +63 -0
  324. package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -0
  325. package/dist/v2/patterns/BulkActionBar.js +153 -0
  326. package/dist/v2/patterns/BulkActionBar.js.map +1 -0
  327. package/dist/v2/patterns/CollapsibleDataGrid.d.ts +62 -0
  328. package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -0
  329. package/dist/v2/patterns/CollapsibleDataGrid.js +306 -0
  330. package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -0
  331. package/dist/v2/patterns/ColumnsToggle.d.ts +55 -0
  332. package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -0
  333. package/dist/v2/patterns/ColumnsToggle.js +314 -0
  334. package/dist/v2/patterns/ColumnsToggle.js.map +1 -0
  335. package/dist/v2/patterns/DataGrid.d.ts +7 -0
  336. package/dist/v2/patterns/DataGrid.d.ts.map +1 -0
  337. package/dist/v2/patterns/DataGrid.js +834 -0
  338. package/dist/v2/patterns/DataGrid.js.map +1 -0
  339. package/dist/v2/patterns/DataGridSettingsMenu.d.ts +68 -0
  340. package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -0
  341. package/dist/v2/patterns/DataGridSettingsMenu.js +381 -0
  342. package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -0
  343. package/dist/v2/patterns/DataGridToolbar.d.ts +81 -0
  344. package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -0
  345. package/dist/v2/patterns/DataGridToolbar.js +255 -0
  346. package/dist/v2/patterns/DataGridToolbar.js.map +1 -0
  347. package/dist/v2/patterns/DataGridVirtualized.d.ts +76 -0
  348. package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -0
  349. package/dist/v2/patterns/DataGridVirtualized.js +528 -0
  350. package/dist/v2/patterns/DataGridVirtualized.js.map +1 -0
  351. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +46 -0
  352. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -0
  353. package/dist/v2/patterns/DeleteResourceConfirmDialog.js +77 -0
  354. package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
  355. package/dist/v2/patterns/FavoriteColumn.d.ts +72 -0
  356. package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -0
  357. package/dist/v2/patterns/FavoriteColumn.js +171 -0
  358. package/dist/v2/patterns/FavoriteColumn.js.map +1 -0
  359. package/dist/v2/patterns/FavoritesFilter.d.ts +51 -0
  360. package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -0
  361. package/dist/v2/patterns/FavoritesFilter.js +97 -0
  362. package/dist/v2/patterns/FavoritesFilter.js.map +1 -0
  363. package/dist/v2/patterns/FormErrorSummary.d.ts +39 -0
  364. package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -0
  365. package/dist/v2/patterns/FormErrorSummary.js +111 -0
  366. package/dist/v2/patterns/FormErrorSummary.js.map +1 -0
  367. package/dist/v2/patterns/FormPageShell.d.ts +55 -0
  368. package/dist/v2/patterns/FormPageShell.d.ts.map +1 -0
  369. package/dist/v2/patterns/FormPageShell.js +133 -0
  370. package/dist/v2/patterns/FormPageShell.js.map +1 -0
  371. package/dist/v2/patterns/FormSection.d.ts +53 -0
  372. package/dist/v2/patterns/FormSection.d.ts.map +1 -0
  373. package/dist/v2/patterns/FormSection.js +162 -0
  374. package/dist/v2/patterns/FormSection.js.map +1 -0
  375. package/dist/v2/patterns/FormikCheckboxGroup.d.ts +51 -0
  376. package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -0
  377. package/dist/v2/patterns/FormikCheckboxGroup.js +117 -0
  378. package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -0
  379. package/dist/v2/patterns/FormikCombobox.d.ts +43 -0
  380. package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -0
  381. package/dist/v2/patterns/FormikCombobox.js +121 -0
  382. package/dist/v2/patterns/FormikCombobox.js.map +1 -0
  383. package/dist/v2/patterns/FormikDatePicker.d.ts +87 -0
  384. package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -0
  385. package/dist/v2/patterns/FormikDatePicker.js +177 -0
  386. package/dist/v2/patterns/FormikDatePicker.js.map +1 -0
  387. package/dist/v2/patterns/FormikErrorFocus.d.ts +59 -0
  388. package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -0
  389. package/dist/v2/patterns/FormikErrorFocus.js +83 -0
  390. package/dist/v2/patterns/FormikErrorFocus.js.map +1 -0
  391. package/dist/v2/patterns/FormikFile.d.ts +43 -0
  392. package/dist/v2/patterns/FormikFile.d.ts.map +1 -0
  393. package/dist/v2/patterns/FormikFile.js +156 -0
  394. package/dist/v2/patterns/FormikFile.js.map +1 -0
  395. package/dist/v2/patterns/FormikInput.d.ts +37 -0
  396. package/dist/v2/patterns/FormikInput.d.ts.map +1 -0
  397. package/dist/v2/patterns/FormikInput.js +87 -0
  398. package/dist/v2/patterns/FormikInput.js.map +1 -0
  399. package/dist/v2/patterns/FormikReferentielField.d.ts +33 -0
  400. package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -0
  401. package/dist/v2/patterns/FormikReferentielField.js +124 -0
  402. package/dist/v2/patterns/FormikReferentielField.js.map +1 -0
  403. package/dist/v2/patterns/FormikSelect.d.ts +40 -0
  404. package/dist/v2/patterns/FormikSelect.d.ts.map +1 -0
  405. package/dist/v2/patterns/FormikSelect.js +139 -0
  406. package/dist/v2/patterns/FormikSelect.js.map +1 -0
  407. package/dist/v2/patterns/FormikTextarea.d.ts +31 -0
  408. package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -0
  409. package/dist/v2/patterns/FormikTextarea.js +84 -0
  410. package/dist/v2/patterns/FormikTextarea.js.map +1 -0
  411. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +44 -0
  412. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -0
  413. package/dist/v2/patterns/KeyboardShortcutsHelp.js +207 -0
  414. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
  415. package/dist/v2/patterns/NetworkErrorBanner.d.ts +26 -0
  416. package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -0
  417. package/dist/v2/patterns/NetworkErrorBanner.js +82 -0
  418. package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -0
  419. package/dist/v2/patterns/PageContent.d.ts +40 -0
  420. package/dist/v2/patterns/PageContent.d.ts.map +1 -0
  421. package/dist/v2/patterns/PageContent.js +69 -0
  422. package/dist/v2/patterns/PageContent.js.map +1 -0
  423. package/dist/v2/patterns/ReferentielField.d.ts +118 -0
  424. package/dist/v2/patterns/ReferentielField.d.ts.map +1 -0
  425. package/dist/v2/patterns/ReferentielField.js +617 -0
  426. package/dist/v2/patterns/ReferentielField.js.map +1 -0
  427. package/dist/v2/patterns/SaveFilterDialog.d.ts +68 -0
  428. package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -0
  429. package/dist/v2/patterns/SaveFilterDialog.js +203 -0
  430. package/dist/v2/patterns/SaveFilterDialog.js.map +1 -0
  431. package/dist/v2/patterns/SavedFiltersMenu.d.ts +74 -0
  432. package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -0
  433. package/dist/v2/patterns/SavedFiltersMenu.js +412 -0
  434. package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -0
  435. package/dist/v2/patterns/SkeletonPageShell.d.ts +76 -0
  436. package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -0
  437. package/dist/v2/patterns/SkeletonPageShell.js +347 -0
  438. package/dist/v2/patterns/SkeletonPageShell.js.map +1 -0
  439. package/dist/v2/patterns/SortableHeader.d.ts +47 -0
  440. package/dist/v2/patterns/SortableHeader.d.ts.map +1 -0
  441. package/dist/v2/patterns/SortableHeader.js +193 -0
  442. package/dist/v2/patterns/SortableHeader.js.map +1 -0
  443. package/dist/v2/patterns/Tour.d.ts +55 -0
  444. package/dist/v2/patterns/Tour.d.ts.map +1 -0
  445. package/dist/v2/patterns/Tour.js +473 -0
  446. package/dist/v2/patterns/Tour.js.map +1 -0
  447. package/dist/v2/patterns/_dataGridShared.d.ts +125 -0
  448. package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -0
  449. package/dist/v2/patterns/_dataGridShared.js +406 -0
  450. package/dist/v2/patterns/_dataGridShared.js.map +1 -0
  451. package/dist/v2/patterns/_sort.d.ts +22 -0
  452. package/dist/v2/patterns/_sort.d.ts.map +1 -0
  453. package/dist/v2/patterns/_sort.js +118 -0
  454. package/dist/v2/patterns/_sort.js.map +1 -0
  455. package/dist/v2/patterns/_useColumnReorder.d.ts +69 -0
  456. package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -0
  457. package/dist/v2/patterns/_useColumnReorder.js +264 -0
  458. package/dist/v2/patterns/_useColumnReorder.js.map +1 -0
  459. package/dist/v2/patterns/_useColumnResize.d.ts +49 -0
  460. package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -0
  461. package/dist/v2/patterns/_useColumnResize.js +198 -0
  462. package/dist/v2/patterns/_useColumnResize.js.map +1 -0
  463. package/dist/v2/patterns/index.d.ts +62 -0
  464. package/dist/v2/patterns/index.d.ts.map +1 -0
  465. package/dist/v2/patterns/index.js +246 -0
  466. package/dist/v2/patterns/index.js.map +1 -0
  467. package/dist/v2/personalization/PersonalizationProvider.d.ts +80 -0
  468. package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -0
  469. package/dist/v2/personalization/PersonalizationProvider.js +177 -0
  470. package/dist/v2/personalization/PersonalizationProvider.js.map +1 -0
  471. package/dist/v2/personalization/adapters/_storageKey.d.ts +35 -0
  472. package/dist/v2/personalization/adapters/_storageKey.d.ts.map +1 -0
  473. package/dist/v2/personalization/adapters/_storageKey.js +69 -0
  474. package/dist/v2/personalization/adapters/_storageKey.js.map +1 -0
  475. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +31 -0
  476. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -0
  477. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +128 -0
  478. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
  479. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +25 -0
  480. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -0
  481. package/dist/v2/personalization/adapters/createMemoryAdapter.js +76 -0
  482. package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
  483. package/dist/v2/personalization/adapters/index.d.ts +10 -0
  484. package/dist/v2/personalization/adapters/index.d.ts.map +1 -0
  485. package/dist/v2/personalization/adapters/index.js +21 -0
  486. package/dist/v2/personalization/adapters/index.js.map +1 -0
  487. package/dist/v2/personalization/capabilities/favorites.d.ts +53 -0
  488. package/dist/v2/personalization/capabilities/favorites.d.ts.map +1 -0
  489. package/dist/v2/personalization/capabilities/favorites.js +223 -0
  490. package/dist/v2/personalization/capabilities/favorites.js.map +1 -0
  491. package/dist/v2/personalization/capabilities/favoritesView.d.ts +58 -0
  492. package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -0
  493. package/dist/v2/personalization/capabilities/favoritesView.js +121 -0
  494. package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -0
  495. package/dist/v2/personalization/capabilities/index.d.ts +16 -0
  496. package/dist/v2/personalization/capabilities/index.d.ts.map +1 -0
  497. package/dist/v2/personalization/capabilities/index.js +69 -0
  498. package/dist/v2/personalization/capabilities/index.js.map +1 -0
  499. package/dist/v2/personalization/capabilities/savedFilters.d.ts +61 -0
  500. package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -0
  501. package/dist/v2/personalization/capabilities/savedFilters.js +297 -0
  502. package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -0
  503. package/dist/v2/personalization/createPersonalizationStore.d.ts +76 -0
  504. package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -0
  505. package/dist/v2/personalization/createPersonalizationStore.js +475 -0
  506. package/dist/v2/personalization/createPersonalizationStore.js.map +1 -0
  507. package/dist/v2/personalization/index.d.ts +33 -0
  508. package/dist/v2/personalization/index.d.ts.map +1 -0
  509. package/dist/v2/personalization/index.js +111 -0
  510. package/dist/v2/personalization/index.js.map +1 -0
  511. package/dist/v2/personalization/personalizationContext.d.ts +78 -0
  512. package/dist/v2/personalization/personalizationContext.d.ts.map +1 -0
  513. package/dist/v2/personalization/personalizationContext.js +121 -0
  514. package/dist/v2/personalization/personalizationContext.js.map +1 -0
  515. package/dist/v2/personalization/schema.d.ts +60 -0
  516. package/dist/v2/personalization/schema.d.ts.map +1 -0
  517. package/dist/v2/personalization/schema.js +102 -0
  518. package/dist/v2/personalization/schema.js.map +1 -0
  519. package/dist/v2/personalization/types.d.ts +81 -0
  520. package/dist/v2/personalization/types.d.ts.map +1 -0
  521. package/dist/v2/personalization/types.js +6 -0
  522. package/dist/v2/personalization/types.js.map +1 -0
  523. package/dist/v2/referentiel/ReferentielProvider.d.ts +53 -0
  524. package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -0
  525. package/dist/v2/referentiel/ReferentielProvider.js +94 -0
  526. package/dist/v2/referentiel/ReferentielProvider.js.map +1 -0
  527. package/dist/v2/referentiel/index.d.ts +18 -0
  528. package/dist/v2/referentiel/index.d.ts.map +1 -0
  529. package/dist/v2/referentiel/index.js +44 -0
  530. package/dist/v2/referentiel/index.js.map +1 -0
  531. package/dist/v2/referentiel/useReferentielClient.d.ts +15 -0
  532. package/dist/v2/referentiel/useReferentielClient.d.ts.map +1 -0
  533. package/dist/v2/referentiel/useReferentielClient.js +46 -0
  534. package/dist/v2/referentiel/useReferentielClient.js.map +1 -0
  535. package/dist/v2/referentiel/useReferentielOptions.d.ts +40 -0
  536. package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -0
  537. package/dist/v2/referentiel/useReferentielOptions.js +177 -0
  538. package/dist/v2/referentiel/useReferentielOptions.js.map +1 -0
  539. package/dist/v2/referentiel/useReferentielSearch.d.ts +76 -0
  540. package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -0
  541. package/dist/v2/referentiel/useReferentielSearch.js +140 -0
  542. package/dist/v2/referentiel/useReferentielSearch.js.map +1 -0
  543. package/dist/v2/styles/base.css +425 -0
  544. package/dist/v2/styles/css.d.ts +10 -0
  545. package/dist/v2/styles/index.d.ts +12 -0
  546. package/dist/v2/styles/index.d.ts.map +1 -0
  547. package/dist/v2/styles/index.js +4 -0
  548. package/dist/v2/styles/index.js.map +1 -0
  549. package/dist/v2/theme/_brand.d.ts +29 -0
  550. package/dist/v2/theme/_brand.d.ts.map +1 -0
  551. package/dist/v2/theme/_brand.js +69 -0
  552. package/dist/v2/theme/_brand.js.map +1 -0
  553. package/dist/v2/theme/_brandSecondary.d.ts +26 -0
  554. package/dist/v2/theme/_brandSecondary.d.ts.map +1 -0
  555. package/dist/v2/theme/_brandSecondary.js +65 -0
  556. package/dist/v2/theme/_brandSecondary.js.map +1 -0
  557. package/dist/v2/theme/createPortnetTheme.d.ts +50 -0
  558. package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -0
  559. package/dist/v2/theme/createPortnetTheme.js +529 -0
  560. package/dist/v2/theme/createPortnetTheme.js.map +1 -0
  561. package/dist/v2/theme/cssVariables.d.ts +41 -0
  562. package/dist/v2/theme/cssVariables.d.ts.map +1 -0
  563. package/dist/v2/theme/cssVariables.js +205 -0
  564. package/dist/v2/theme/cssVariables.js.map +1 -0
  565. package/dist/v2/theme/index.d.ts +33 -0
  566. package/dist/v2/theme/index.d.ts.map +1 -0
  567. package/dist/v2/theme/index.js +60 -0
  568. package/dist/v2/theme/index.js.map +1 -0
  569. package/dist/v2/tokens/breakpoints.d.ts +74 -0
  570. package/dist/v2/tokens/breakpoints.d.ts.map +1 -0
  571. package/dist/v2/tokens/breakpoints.js +114 -0
  572. package/dist/v2/tokens/breakpoints.js.map +1 -0
  573. package/dist/v2/tokens/colors.d.ts +228 -0
  574. package/dist/v2/tokens/colors.d.ts.map +1 -0
  575. package/dist/v2/tokens/colors.js +225 -0
  576. package/dist/v2/tokens/colors.js.map +1 -0
  577. package/dist/v2/tokens/density.d.ts +142 -0
  578. package/dist/v2/tokens/density.d.ts.map +1 -0
  579. package/dist/v2/tokens/density.js +111 -0
  580. package/dist/v2/tokens/density.js.map +1 -0
  581. package/dist/v2/tokens/index.d.ts +556 -0
  582. package/dist/v2/tokens/index.d.ts.map +1 -0
  583. package/dist/v2/tokens/index.js +313 -0
  584. package/dist/v2/tokens/index.js.map +1 -0
  585. package/dist/v2/tokens/motion.d.ts +85 -0
  586. package/dist/v2/tokens/motion.d.ts.map +1 -0
  587. package/dist/v2/tokens/motion.js +94 -0
  588. package/dist/v2/tokens/motion.js.map +1 -0
  589. package/dist/v2/tokens/radius.d.ts +18 -0
  590. package/dist/v2/tokens/radius.d.ts.map +1 -0
  591. package/dist/v2/tokens/radius.js +28 -0
  592. package/dist/v2/tokens/radius.js.map +1 -0
  593. package/dist/v2/tokens/shadows.d.ts +25 -0
  594. package/dist/v2/tokens/shadows.d.ts.map +1 -0
  595. package/dist/v2/tokens/shadows.js +46 -0
  596. package/dist/v2/tokens/shadows.js.map +1 -0
  597. package/dist/v2/tokens/spacing.d.ts +38 -0
  598. package/dist/v2/tokens/spacing.d.ts.map +1 -0
  599. package/dist/v2/tokens/spacing.js +57 -0
  600. package/dist/v2/tokens/spacing.js.map +1 -0
  601. package/dist/v2/tokens/state.d.ts +40 -0
  602. package/dist/v2/tokens/state.d.ts.map +1 -0
  603. package/dist/v2/tokens/state.js +47 -0
  604. package/dist/v2/tokens/state.js.map +1 -0
  605. package/dist/v2/tokens/statusPalette.d.ts +54 -0
  606. package/dist/v2/tokens/statusPalette.d.ts.map +1 -0
  607. package/dist/v2/tokens/statusPalette.js +72 -0
  608. package/dist/v2/tokens/statusPalette.js.map +1 -0
  609. package/dist/v2/tokens/tokens.json +153 -0
  610. package/dist/v2/tokens/typography.d.ts +206 -0
  611. package/dist/v2/tokens/typography.d.ts.map +1 -0
  612. package/dist/v2/tokens/typography.js +155 -0
  613. package/dist/v2/tokens/typography.js.map +1 -0
  614. package/dist/v2/tokens/zIndex.d.ts +33 -0
  615. package/dist/v2/tokens/zIndex.d.ts.map +1 -0
  616. package/dist/v2/tokens/zIndex.js +50 -0
  617. package/dist/v2/tokens/zIndex.js.map +1 -0
  618. package/dist/v2/types/common.d.ts +24 -0
  619. package/dist/v2/types/common.d.ts.map +1 -0
  620. package/dist/v2/types/common.js +6 -0
  621. package/dist/v2/types/common.js.map +1 -0
  622. package/dist/v2/types/datagrid.d.ts +131 -0
  623. package/dist/v2/types/datagrid.d.ts.map +1 -0
  624. package/dist/v2/types/datagrid.js +6 -0
  625. package/dist/v2/types/datagrid.js.map +1 -0
  626. package/dist/v2/types/index.d.ts +11 -0
  627. package/dist/v2/types/index.d.ts.map +1 -0
  628. package/dist/v2/types/index.js +28 -0
  629. package/dist/v2/types/index.js.map +1 -0
  630. package/dist/v2/utils/apiError.d.ts +90 -0
  631. package/dist/v2/utils/apiError.d.ts.map +1 -0
  632. package/dist/v2/utils/apiError.js +227 -0
  633. package/dist/v2/utils/apiError.js.map +1 -0
  634. package/dist/v2/utils/contrast.d.ts +68 -0
  635. package/dist/v2/utils/contrast.d.ts.map +1 -0
  636. package/dist/v2/utils/contrast.js +167 -0
  637. package/dist/v2/utils/contrast.js.map +1 -0
  638. package/dist/v2/utils/cx.d.ts +9 -0
  639. package/dist/v2/utils/cx.d.ts.map +1 -0
  640. package/dist/v2/utils/cx.js +45 -0
  641. package/dist/v2/utils/cx.js.map +1 -0
  642. package/dist/v2/utils/fileDownload.d.ts +94 -0
  643. package/dist/v2/utils/fileDownload.d.ts.map +1 -0
  644. package/dist/v2/utils/fileDownload.js +236 -0
  645. package/dist/v2/utils/fileDownload.js.map +1 -0
  646. package/dist/v2/utils/fmtMoney.d.ts +28 -0
  647. package/dist/v2/utils/fmtMoney.d.ts.map +1 -0
  648. package/dist/v2/utils/fmtMoney.js +84 -0
  649. package/dist/v2/utils/fmtMoney.js.map +1 -0
  650. package/dist/v2/utils/index.d.ts +8 -0
  651. package/dist/v2/utils/index.d.ts.map +1 -0
  652. package/dist/v2/utils/index.js +90 -0
  653. package/dist/v2/utils/index.js.map +1 -0
  654. package/dist/v2/utils/networkStatus.d.ts +88 -0
  655. package/dist/v2/utils/networkStatus.d.ts.map +1 -0
  656. package/dist/v2/utils/networkStatus.js +121 -0
  657. package/dist/v2/utils/networkStatus.js.map +1 -0
  658. package/package.json +191 -76
  659. package/dist/api/guideApi.js +0 -12
  660. package/dist/api/guideImageService.js +0 -119
  661. package/dist/api/reclamationApi.js +0 -102
  662. package/dist/assets/guides/FAQ.json +0 -118
  663. package/dist/assets/guides/index.js +0 -11
  664. package/dist/assets/images/tijariaLogo.ico +0 -0
  665. package/dist/components/buttons/PuiButton.js +0 -217
  666. package/dist/components/buttons/PuiIconButton.js +0 -98
  667. package/dist/components/common/PuiAlertContext.js +0 -12
  668. package/dist/components/common/PuiHelpWidgetContext.js +0 -17
  669. package/dist/components/common/StyledMuiButton.js +0 -48
  670. package/dist/components/common/StyledMuiTextField.js +0 -180
  671. package/dist/components/inputs/PuiAutocomplete.js +0 -352
  672. package/dist/components/inputs/PuiCheckbox.js +0 -308
  673. package/dist/components/inputs/PuiCheckboxGroup.js +0 -215
  674. package/dist/components/inputs/PuiCheckboxItem.js +0 -162
  675. package/dist/components/inputs/PuiDateField.js +0 -280
  676. package/dist/components/inputs/PuiDateTimeField.js +0 -276
  677. package/dist/components/inputs/PuiFileField.js +0 -265
  678. package/dist/components/inputs/PuiRadioGroup.js +0 -197
  679. package/dist/components/inputs/PuiRadioItem.js +0 -100
  680. package/dist/components/inputs/PuiSelect.js +0 -427
  681. package/dist/components/inputs/PuiTextField.js +0 -263
  682. package/dist/components/others/PuiBadge.js +0 -58
  683. package/dist/components/others/PuiChip.js +0 -150
  684. package/dist/components/others/PuiDialog.js +0 -102
  685. package/dist/components/others/PuiFormikForm.js +0 -70
  686. package/dist/components/others/PuiGrid.js +0 -23
  687. package/dist/components/others/PuiIcon.js +0 -92
  688. package/dist/components/others/PuiLoadingBackdrop.js +0 -32
  689. package/dist/components/others/PuiMainContainer.js +0 -41
  690. package/dist/components/others/PuiNavigation.js +0 -68
  691. package/dist/components/others/PuiSection.js +0 -187
  692. package/dist/components/others/PuiTooltip.js +0 -86
  693. package/dist/components/providers/PuiAlertProvider.js +0 -134
  694. package/dist/components/providers/PuiHelpWidgetProvider.js +0 -91
  695. package/dist/components/providers/PuiLocalizationProvider.js +0 -34
  696. package/dist/components/referentiel/common/ReferetielContext.js +0 -12
  697. package/dist/components/referentiel/common/constants/specificReferentielsApis.js +0 -22
  698. package/dist/components/referentiel/common/constants/specificReferentielsBaseColumns.js +0 -691
  699. package/dist/components/referentiel/common/constants/specificReferentielsBaseFilters.js +0 -598
  700. package/dist/components/referentiel/common/constants/specificReferentielsInitialValues.js +0 -80
  701. package/dist/components/referentiel/common/constants/specificReferentielsKeys.js +0 -18
  702. package/dist/components/referentiel/common/constants/specificReferentielsTitles.js +0 -22
  703. package/dist/components/referentiel/common/constants/specificReferentielsValidationSchemas.js +0 -85
  704. package/dist/components/referentiel/components/PuiBasePopupReferentielField.js +0 -356
  705. package/dist/components/referentiel/components/PuiCustomPopupReferentielField.js +0 -181
  706. package/dist/components/referentiel/components/PuiSimplePopupReferentielField.js +0 -325
  707. package/dist/components/referentiel/components/PuiSimpleReferentielField.js +0 -203
  708. package/dist/components/referentiel/components/PuiSpecificReferentielField.js +0 -352
  709. package/dist/components/referentiel/providers/PuiReferentielProvider.js +0 -66
  710. package/dist/components/tab/PuiTab.js +0 -25
  711. package/dist/components/tab/PuiTabs.js +0 -148
  712. package/dist/components/table/PuiTable.js +0 -643
  713. package/dist/components/table/PuiTableAction.js +0 -75
  714. package/dist/components/typography/PuiDefinition.js +0 -42
  715. package/dist/components/typography/PuiIndication.js +0 -80
  716. package/dist/components/typography/PuiMainTitle.js +0 -144
  717. package/dist/components/ui/dialogs/PuiSearchDialog.js +0 -106
  718. package/dist/components/ui/pages/errors/PuiErrorBasePage.js +0 -73
  719. package/dist/components/ui/pages/errors/PuiForbiddenErrorPage.js +0 -36
  720. package/dist/components/ui/pages/errors/PuiNetworkErrorPage.js +0 -36
  721. package/dist/components/ui/pages/errors/PuiNotFoundErrorPage.js +0 -30
  722. package/dist/components/ui/pages/errors/PuiServerErrorPage.js +0 -37
  723. package/dist/components/ui/pages/general/PuiDefaultPage.js +0 -68
  724. package/dist/components/ui/pages/general/PuiSearchPage.js +0 -203
  725. package/dist/components/widgets/GuideImage.js +0 -251
  726. package/dist/components/widgets/PuiHelpWidget.js +0 -4167
  727. package/dist/config/apperance.js +0 -26
  728. package/dist/config/mapping.js +0 -26
  729. package/dist/config/referentiel.js +0 -10
  730. package/dist/general/yupValidationErrors.js +0 -8
  731. package/dist/hooks/useAlert.js +0 -19
  732. package/dist/hooks/useAxios.js +0 -23
  733. package/dist/hooks/useQuery.js +0 -21
  734. package/dist/hooks/useReclamation.js +0 -100
  735. package/dist/styles/ReclamationFormModal.css +0 -629
  736. package/dist/styles/help-widget.css +0 -621
@@ -0,0 +1,337 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ require("@testing-library/jest-dom");
5
+ var React = _interopRequireWildcard(require("react"));
6
+ var _react2 = require("@testing-library/react");
7
+ var _MobileRowCard = _interopRequireDefault(require("../components/MobileRowCard"));
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ /**
13
+ * MobileRowCard — slot contract tests.
14
+ *
15
+ * WHY THIS FILE EXISTS
16
+ * --------------------
17
+ * §10.3 R-G.6 MUST — "Snapshot Storybook + tests Jest/Testing-Library" — was
18
+ * unmet for THREE props added to this component across successive module
19
+ * audits: `kv` and `leading` (ms-dfd-fe Area 5), then `trailing`
20
+ * (ms-dfd-fe/ms-ti-fe A5-01). Each was shipped as "additive, backward
21
+ * compatible", which is true and is not the same thing as verified. This
22
+ * component is consumed by ten mobile-card sites across two certified modules,
23
+ * so a silent change to any slot's behaviour regresses all of them at once.
24
+ *
25
+ * The PROPAGATION ASYMMETRY (see below) is the single most important thing
26
+ * here. It is deliberate, it is counter-intuitive, and nothing but a test
27
+ * stops a future reader from "tidying" it into consistency and breaking every
28
+ * favourite-star and picker-button site in the fleet.
29
+ *
30
+ * NOT COVERED — and deliberately so: R-G.3 MUST (light + dark + compact +
31
+ * responsive at 320/375/414) is a VISUAL contract. jsdom computes no layout,
32
+ * so asserting it here would produce tests that pass while the cards are
33
+ * broken on a phone — worse than no coverage, because it would look like
34
+ * coverage. R-G.3 needs a browser (Storybook + visual regression) and remains
35
+ * open for all three props.
36
+ */describe("MobileRowCard — slot rendering", function () {
37
+ test("renders title, subtitle and meta, omitting lines with no content", function () {
38
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
39
+ title: "2025-IM-0042",
40
+ subtitle: "SOFRANE SA",
41
+ meta: ["12/05/2026", "3 pièces"]
42
+ }));
43
+ expect(_react2.screen.getByText("2025-IM-0042")).toBeInTheDocument();
44
+ expect(_react2.screen.getByText("SOFRANE SA")).toBeInTheDocument();
45
+ // meta joins with " · " into a single node
46
+ expect(_react2.screen.getByText("12/05/2026 · 3 pièces")).toBeInTheDocument();
47
+ });
48
+ test("meta drops null / empty entries rather than rendering stray separators", function () {
49
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
50
+ title: "X",
51
+ meta: ["Émise 01/01/2026", null, "", undefined]
52
+ }));
53
+ expect(_react2.screen.getByText("Émise 01/01/2026")).toBeInTheDocument();
54
+ expect(_react2.screen.queryByText(/·/)).not.toBeInTheDocument();
55
+ });
56
+ test("a string title gets a native tooltip; a node title does not stringify", function () {
57
+ var _render = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
58
+ title: "Long reference"
59
+ })),
60
+ rerender = _render.rerender;
61
+ expect(_react2.screen.getByText("Long reference")).toHaveAttribute("title", "Long reference");
62
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
63
+ title: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
64
+ children: "Node title"
65
+ })
66
+ }));
67
+ expect(_react2.screen.getByText("Node title")).toBeInTheDocument();
68
+ /* The regression guarded here: wrapping a node yielded title="[object
69
+ * Object]". Asserted with queryByTitle rather than `.closest("[title]")`
70
+ * so it stays a Testing-Library query (testing-library/no-node-access).
71
+ * `/./` = "no element carries ANY non-empty title", which is a STRONGER
72
+ * assertion than the ancestor walk it replaces: MobileRowCard sets a title
73
+ * attribute in exactly two places (the title Box and the subtitle Box) and
74
+ * only when the value is a string, so with a node title and no subtitle the
75
+ * whole tree must be title-less. */
76
+ expect(_react2.screen.queryByTitle(/./)).not.toBeInTheDocument();
77
+ });
78
+ });
79
+ describe("MobileRowCard — kv slot", function () {
80
+ test("renders each pair as a KV label/value unit", function () {
81
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
82
+ title: "ref",
83
+ kv: [{
84
+ label: "Catégorie",
85
+ value: "CONTINGENT"
86
+ }, {
87
+ label: "Importateur",
88
+ value: "SOFRANE SA"
89
+ }]
90
+ }));
91
+ expect(_react2.screen.getByText("Catégorie")).toBeInTheDocument();
92
+ expect(_react2.screen.getByText("CONTINGENT")).toBeInTheDocument();
93
+ expect(_react2.screen.getByText("Importateur")).toBeInTheDocument();
94
+ expect(_react2.screen.getByText("SOFRANE SA")).toBeInTheDocument();
95
+ });
96
+ test("an empty value KEEPS the pair and shows KV's own em-dash placeholder", function () {
97
+ // This is why every consuming site could drop its `?? \"-\"`: KV owns the
98
+ // placeholder. Losing this behaviour would silently reintroduce ten local
99
+ // fallbacks across the fleet.
100
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
101
+ title: "ref",
102
+ kv: [{
103
+ label: "Bureau douanier",
104
+ value: undefined
105
+ }, {
106
+ label: "Marchandise",
107
+ value: ""
108
+ }, {
109
+ label: "Devise",
110
+ value: null
111
+ }]
112
+ }));
113
+ expect(_react2.screen.getByText("Bureau douanier")).toBeInTheDocument();
114
+ expect(_react2.screen.getByText("Marchandise")).toBeInTheDocument();
115
+ expect(_react2.screen.getByText("Devise")).toBeInTheDocument();
116
+ expect(_react2.screen.getAllByText("—")).toHaveLength(3);
117
+ });
118
+ test("a custom fallback overrides the em dash", function () {
119
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
120
+ title: "ref",
121
+ kv: [{
122
+ label: "Banque",
123
+ fallback: "Non assignée"
124
+ }]
125
+ }));
126
+ expect(_react2.screen.getByText("Non assignée")).toBeInTheDocument();
127
+ });
128
+ test("pairs with no label are DROPPED (KV would emit a dangling aria-labelledby)", function () {
129
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
130
+ title: "ref",
131
+ kv: [{
132
+ label: "",
133
+ value: "orphan-empty"
134
+ },
135
+ // `label` is required but its type (ReactNode) admits undefined, so
136
+ // this is type-valid and exercises the runtime `!= null` guard.
137
+ {
138
+ label: undefined,
139
+ value: "orphan-missing"
140
+ }, {
141
+ label: "Kept",
142
+ value: "kept-value"
143
+ }]
144
+ }));
145
+ expect(_react2.screen.queryByText("orphan-empty")).not.toBeInTheDocument();
146
+ expect(_react2.screen.queryByText("orphan-missing")).not.toBeInTheDocument();
147
+ expect(_react2.screen.getByText("kept-value")).toBeInTheDocument();
148
+ });
149
+ });
150
+ describe("MobileRowCard — chips slot", function () {
151
+ test("renders chip nodes and filters falsy entries", function () {
152
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
153
+ title: "ref",
154
+ chips: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
155
+ children: "Approuv\xE9"
156
+ }, "a"), null, false, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
157
+ children: "CO"
158
+ }, "b")]
159
+ }));
160
+ expect(_react2.screen.getByText("Approuvé")).toBeInTheDocument();
161
+ expect(_react2.screen.getByText("CO")).toBeInTheDocument();
162
+ });
163
+ });
164
+ describe("MobileRowCard — actions (kebab)", function () {
165
+ test("kebab renders only when at least one non-divider action exists", function () {
166
+ var _render2 = (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
167
+ title: "ref",
168
+ actions: []
169
+ })),
170
+ rerender = _render2.rerender;
171
+ expect(_react2.screen.queryByRole("button")).not.toBeInTheDocument();
172
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
173
+ title: "ref",
174
+ actions: [{
175
+ divider: true
176
+ }]
177
+ }));
178
+ expect(_react2.screen.queryByRole("button")).not.toBeInTheDocument();
179
+ rerender(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
180
+ title: "ref",
181
+ actions: [{
182
+ label: "Détail",
183
+ onClick: function onClick() {}
184
+ }],
185
+ actionsAriaLabel: "Actions pour 2025-IM-0042"
186
+ }));
187
+ expect(_react2.screen.getByRole("button", {
188
+ name: "Actions pour 2025-IM-0042"
189
+ })).toBeInTheDocument();
190
+ });
191
+ });
192
+
193
+ /**
194
+ * THE PROPAGATION CONTRACT — the reason this file matters most.
195
+ *
196
+ * DataGrid's mobile-card wrapper makes the whole card the click target
197
+ * (role=button + onRowClick). Two slots therefore behave DIFFERENTLY on
198
+ * purpose:
199
+ *
200
+ * leading — does NOT stop propagation. A decorative node (icon, avatar)
201
+ * should still open the row like the rest of the card. Interactive
202
+ * leading content is responsible for stopping propagation itself,
203
+ * exactly as DataGrid's own FavoriteCell does. Get this wrong and
204
+ * a tap both toggles the favourite star AND opens the drawer.
205
+ *
206
+ * trailing — DOES stop propagation (it shares the kebab's wrapper). Its
207
+ * declared purpose is interactive actions, and a tap that both
208
+ * fires the action and opens the row is the more damaging default.
209
+ *
210
+ * Making these two consistent — in either direction — is a breaking change for
211
+ * the ten sites that depend on them.
212
+ */
213
+ describe("MobileRowCard — propagation asymmetry (deliberate)", function () {
214
+ test("leading does NOT stop click propagation to the card", function () {
215
+ var onCardClick = jest.fn();
216
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
217
+ onClick: onCardClick,
218
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
219
+ title: "ref",
220
+ leading: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
221
+ children: "star"
222
+ })
223
+ })
224
+ }));
225
+ _react2.fireEvent.click(_react2.screen.getByText("star"));
226
+ expect(onCardClick).toHaveBeenCalledTimes(1);
227
+ });
228
+ test("trailing DOES stop click propagation to the card", function () {
229
+ var onCardClick = jest.fn();
230
+ var onAction = jest.fn();
231
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
232
+ onClick: onCardClick,
233
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
234
+ title: "ref",
235
+ trailing: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
236
+ onClick: onAction,
237
+ children: "Choisir"
238
+ })
239
+ })
240
+ }));
241
+ _react2.fireEvent.click(_react2.screen.getByRole("button", {
242
+ name: "Choisir"
243
+ }));
244
+ expect(onAction).toHaveBeenCalledTimes(1);
245
+ expect(onCardClick).not.toHaveBeenCalled();
246
+ });
247
+ test("trailing stops keydown propagation too (keyboard parity)", function () {
248
+ var onCardKeyDown = jest.fn();
249
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
250
+ onKeyDown: onCardKeyDown,
251
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
252
+ title: "ref",
253
+ trailing: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
254
+ children: "Choisir"
255
+ })
256
+ })
257
+ }));
258
+ _react2.fireEvent.keyDown(_react2.screen.getByRole("button", {
259
+ name: "Choisir"
260
+ }), {
261
+ key: "Enter"
262
+ });
263
+ expect(onCardKeyDown).not.toHaveBeenCalled();
264
+ });
265
+ test("opening the kebab does not fire the card click", function () {
266
+ var onCardClick = jest.fn();
267
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
268
+ onClick: onCardClick,
269
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
270
+ title: "ref",
271
+ actions: [{
272
+ label: "Détail",
273
+ onClick: function onClick() {}
274
+ }]
275
+ })
276
+ }));
277
+ _react2.fireEvent.click(_react2.screen.getByRole("button", {
278
+ name: "Plus d'actions"
279
+ }));
280
+ expect(onCardClick).not.toHaveBeenCalled();
281
+ });
282
+ });
283
+ describe("MobileRowCard — header composition", function () {
284
+ test("trailing and the kebab coexist, trailing first", function () {
285
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
286
+ title: "ref",
287
+ trailing: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
288
+ children: "Visualiser"
289
+ }),
290
+ actions: [{
291
+ label: "Supprimer",
292
+ onClick: function onClick() {}
293
+ }],
294
+ actionsAriaLabel: "Autres actions"
295
+ }));
296
+ var visualiser = _react2.screen.getByRole("button", {
297
+ name: "Visualiser"
298
+ });
299
+ var kebab = _react2.screen.getByRole("button", {
300
+ name: "Autres actions"
301
+ });
302
+ expect(visualiser).toBeInTheDocument();
303
+ expect(kebab).toBeInTheDocument();
304
+
305
+ // Document order: trailing precedes the kebab in the header end cluster.
306
+ expect(visualiser.compareDocumentPosition(kebab) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy();
307
+ });
308
+ test("a card with ONLY trailing still renders its header", function () {
309
+ // Regression guard: hasHeader must include hasTrailing, otherwise a
310
+ // title-less picker card would drop its action entirely.
311
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
312
+ trailing: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
313
+ children: "Choisir"
314
+ })
315
+ }));
316
+ expect(_react2.screen.getByRole("button", {
317
+ name: "Choisir"
318
+ })).toBeInTheDocument();
319
+ });
320
+ test("a card with ONLY leading still renders its header", function () {
321
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {
322
+ leading: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
323
+ children: "star"
324
+ })
325
+ }));
326
+ expect(_react2.screen.getByText("star")).toBeInTheDocument();
327
+ });
328
+ test("no props renders no header and does not throw", function () {
329
+ /* `render` not throwing IS the second half of this assertion. The button
330
+ * check uses screen.queryByRole rather than container.querySelector
331
+ * (testing-library/no-container + no-node-access), matching the idiom the
332
+ * kebab test above already uses. */
333
+ (0, _react2.render)(/*#__PURE__*/(0, _jsxRuntime.jsx)(_MobileRowCard["default"], {}));
334
+ expect(_react2.screen.queryByRole("button")).not.toBeInTheDocument();
335
+ });
336
+ });
337
+ //# sourceMappingURL=MobileRowCard.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MobileRowCard.test.js","names":["require","React","_interopRequireWildcard","_react2","_MobileRowCard","_interopRequireDefault","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","describe","test","render","jsx","title","subtitle","meta","expect","screen","getByText","toBeInTheDocument","undefined","queryByText","not","_render","rerender","toHaveAttribute","children","queryByTitle","kv","label","value","getAllByText","toHaveLength","fallback","chips","_render2","actions","queryByRole","divider","onClick","actionsAriaLabel","getByRole","name","onCardClick","jest","fn","leading","fireEvent","click","toHaveBeenCalledTimes","onAction","trailing","toHaveBeenCalled","onCardKeyDown","onKeyDown","keyDown","visualiser","kebab","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","toBeTruthy"],"sources":["../../../src/lib/v2/__tests__/MobileRowCard.test.tsx"],"sourcesContent":["import \"@testing-library/jest-dom\";\r\nimport * as React from \"react\";\r\nimport { render, screen, fireEvent } from \"@testing-library/react\";\r\nimport MobileRowCard from \"../components/MobileRowCard\";\r\n\r\n/**\r\n * MobileRowCard — slot contract tests.\r\n *\r\n * WHY THIS FILE EXISTS\r\n * --------------------\r\n * §10.3 R-G.6 MUST — \"Snapshot Storybook + tests Jest/Testing-Library\" — was\r\n * unmet for THREE props added to this component across successive module\r\n * audits: `kv` and `leading` (ms-dfd-fe Area 5), then `trailing`\r\n * (ms-dfd-fe/ms-ti-fe A5-01). Each was shipped as \"additive, backward\r\n * compatible\", which is true and is not the same thing as verified. This\r\n * component is consumed by ten mobile-card sites across two certified modules,\r\n * so a silent change to any slot's behaviour regresses all of them at once.\r\n *\r\n * The PROPAGATION ASYMMETRY (see below) is the single most important thing\r\n * here. It is deliberate, it is counter-intuitive, and nothing but a test\r\n * stops a future reader from \"tidying\" it into consistency and breaking every\r\n * favourite-star and picker-button site in the fleet.\r\n *\r\n * NOT COVERED — and deliberately so: R-G.3 MUST (light + dark + compact +\r\n * responsive at 320/375/414) is a VISUAL contract. jsdom computes no layout,\r\n * so asserting it here would produce tests that pass while the cards are\r\n * broken on a phone — worse than no coverage, because it would look like\r\n * coverage. R-G.3 needs a browser (Storybook + visual regression) and remains\r\n * open for all three props.\r\n */\r\ndescribe(\"MobileRowCard — slot rendering\", () => {\r\n test(\"renders title, subtitle and meta, omitting lines with no content\", () => {\r\n render(\r\n <MobileRowCard\r\n title=\"2025-IM-0042\"\r\n subtitle=\"SOFRANE SA\"\r\n meta={[\"12/05/2026\", \"3 pièces\"]}\r\n />\r\n );\r\n\r\n expect(screen.getByText(\"2025-IM-0042\")).toBeInTheDocument();\r\n expect(screen.getByText(\"SOFRANE SA\")).toBeInTheDocument();\r\n // meta joins with \" · \" into a single node\r\n expect(screen.getByText(\"12/05/2026 · 3 pièces\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"meta drops null / empty entries rather than rendering stray separators\", () => {\r\n render(<MobileRowCard title=\"X\" meta={[\"Émise 01/01/2026\", null, \"\", undefined]} />);\r\n expect(screen.getByText(\"Émise 01/01/2026\")).toBeInTheDocument();\r\n expect(screen.queryByText(/·/)).not.toBeInTheDocument();\r\n });\r\n\r\n test(\"a string title gets a native tooltip; a node title does not stringify\", () => {\r\n const { rerender } = render(<MobileRowCard title=\"Long reference\" />);\r\n expect(screen.getByText(\"Long reference\")).toHaveAttribute(\"title\", \"Long reference\");\r\n\r\n rerender(<MobileRowCard title={<span>Node title</span>} />);\r\n expect(screen.getByText(\"Node title\")).toBeInTheDocument();\r\n /* The regression guarded here: wrapping a node yielded title=\"[object\r\n * Object]\". Asserted with queryByTitle rather than `.closest(\"[title]\")`\r\n * so it stays a Testing-Library query (testing-library/no-node-access).\r\n * `/./` = \"no element carries ANY non-empty title\", which is a STRONGER\r\n * assertion than the ancestor walk it replaces: MobileRowCard sets a title\r\n * attribute in exactly two places (the title Box and the subtitle Box) and\r\n * only when the value is a string, so with a node title and no subtitle the\r\n * whole tree must be title-less. */\r\n expect(screen.queryByTitle(/./)).not.toBeInTheDocument();\r\n });\r\n});\r\n\r\ndescribe(\"MobileRowCard — kv slot\", () => {\r\n test(\"renders each pair as a KV label/value unit\", () => {\r\n render(\r\n <MobileRowCard\r\n title=\"ref\"\r\n kv={[\r\n { label: \"Catégorie\", value: \"CONTINGENT\" },\r\n { label: \"Importateur\", value: \"SOFRANE SA\" },\r\n ]}\r\n />\r\n );\r\n\r\n expect(screen.getByText(\"Catégorie\")).toBeInTheDocument();\r\n expect(screen.getByText(\"CONTINGENT\")).toBeInTheDocument();\r\n expect(screen.getByText(\"Importateur\")).toBeInTheDocument();\r\n expect(screen.getByText(\"SOFRANE SA\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"an empty value KEEPS the pair and shows KV's own em-dash placeholder\", () => {\r\n // This is why every consuming site could drop its `?? \\\"-\\\"`: KV owns the\r\n // placeholder. Losing this behaviour would silently reintroduce ten local\r\n // fallbacks across the fleet.\r\n render(\r\n <MobileRowCard\r\n title=\"ref\"\r\n kv={[\r\n { label: \"Bureau douanier\", value: undefined },\r\n { label: \"Marchandise\", value: \"\" },\r\n { label: \"Devise\", value: null },\r\n ]}\r\n />\r\n );\r\n\r\n expect(screen.getByText(\"Bureau douanier\")).toBeInTheDocument();\r\n expect(screen.getByText(\"Marchandise\")).toBeInTheDocument();\r\n expect(screen.getByText(\"Devise\")).toBeInTheDocument();\r\n expect(screen.getAllByText(\"—\")).toHaveLength(3);\r\n });\r\n\r\n test(\"a custom fallback overrides the em dash\", () => {\r\n render(\r\n <MobileRowCard title=\"ref\" kv={[{ label: \"Banque\", fallback: \"Non assignée\" }]} />\r\n );\r\n expect(screen.getByText(\"Non assignée\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"pairs with no label are DROPPED (KV would emit a dangling aria-labelledby)\", () => {\r\n render(\r\n <MobileRowCard\r\n title=\"ref\"\r\n kv={[\r\n { label: \"\", value: \"orphan-empty\" },\r\n // `label` is required but its type (ReactNode) admits undefined, so\r\n // this is type-valid and exercises the runtime `!= null` guard.\r\n { label: undefined, value: \"orphan-missing\" },\r\n { label: \"Kept\", value: \"kept-value\" },\r\n ]}\r\n />\r\n );\r\n\r\n expect(screen.queryByText(\"orphan-empty\")).not.toBeInTheDocument();\r\n expect(screen.queryByText(\"orphan-missing\")).not.toBeInTheDocument();\r\n expect(screen.getByText(\"kept-value\")).toBeInTheDocument();\r\n });\r\n});\r\n\r\ndescribe(\"MobileRowCard — chips slot\", () => {\r\n test(\"renders chip nodes and filters falsy entries\", () => {\r\n render(\r\n <MobileRowCard\r\n title=\"ref\"\r\n chips={[<span key=\"a\">Approuvé</span>, null, false, <span key=\"b\">CO</span>]}\r\n />\r\n );\r\n expect(screen.getByText(\"Approuvé\")).toBeInTheDocument();\r\n expect(screen.getByText(\"CO\")).toBeInTheDocument();\r\n });\r\n});\r\n\r\ndescribe(\"MobileRowCard — actions (kebab)\", () => {\r\n test(\"kebab renders only when at least one non-divider action exists\", () => {\r\n const { rerender } = render(<MobileRowCard title=\"ref\" actions={[]} />);\r\n expect(screen.queryByRole(\"button\")).not.toBeInTheDocument();\r\n\r\n rerender(<MobileRowCard title=\"ref\" actions={[{ divider: true }]} />);\r\n expect(screen.queryByRole(\"button\")).not.toBeInTheDocument();\r\n\r\n rerender(\r\n <MobileRowCard\r\n title=\"ref\"\r\n actions={[{ label: \"Détail\", onClick: () => {} }]}\r\n actionsAriaLabel=\"Actions pour 2025-IM-0042\"\r\n />\r\n );\r\n expect(\r\n screen.getByRole(\"button\", { name: \"Actions pour 2025-IM-0042\" })\r\n ).toBeInTheDocument();\r\n });\r\n});\r\n\r\n/**\r\n * THE PROPAGATION CONTRACT — the reason this file matters most.\r\n *\r\n * DataGrid's mobile-card wrapper makes the whole card the click target\r\n * (role=button + onRowClick). Two slots therefore behave DIFFERENTLY on\r\n * purpose:\r\n *\r\n * leading — does NOT stop propagation. A decorative node (icon, avatar)\r\n * should still open the row like the rest of the card. Interactive\r\n * leading content is responsible for stopping propagation itself,\r\n * exactly as DataGrid's own FavoriteCell does. Get this wrong and\r\n * a tap both toggles the favourite star AND opens the drawer.\r\n *\r\n * trailing — DOES stop propagation (it shares the kebab's wrapper). Its\r\n * declared purpose is interactive actions, and a tap that both\r\n * fires the action and opens the row is the more damaging default.\r\n *\r\n * Making these two consistent — in either direction — is a breaking change for\r\n * the ten sites that depend on them.\r\n */\r\ndescribe(\"MobileRowCard — propagation asymmetry (deliberate)\", () => {\r\n test(\"leading does NOT stop click propagation to the card\", () => {\r\n const onCardClick = jest.fn();\r\n render(\r\n <div onClick={onCardClick}>\r\n <MobileRowCard title=\"ref\" leading={<span>star</span>} />\r\n </div>\r\n );\r\n\r\n fireEvent.click(screen.getByText(\"star\"));\r\n expect(onCardClick).toHaveBeenCalledTimes(1);\r\n });\r\n\r\n test(\"trailing DOES stop click propagation to the card\", () => {\r\n const onCardClick = jest.fn();\r\n const onAction = jest.fn();\r\n render(\r\n <div onClick={onCardClick}>\r\n <MobileRowCard\r\n title=\"ref\"\r\n trailing={<button onClick={onAction}>Choisir</button>}\r\n />\r\n </div>\r\n );\r\n\r\n fireEvent.click(screen.getByRole(\"button\", { name: \"Choisir\" }));\r\n expect(onAction).toHaveBeenCalledTimes(1);\r\n expect(onCardClick).not.toHaveBeenCalled();\r\n });\r\n\r\n test(\"trailing stops keydown propagation too (keyboard parity)\", () => {\r\n const onCardKeyDown = jest.fn();\r\n render(\r\n <div onKeyDown={onCardKeyDown}>\r\n <MobileRowCard title=\"ref\" trailing={<button>Choisir</button>} />\r\n </div>\r\n );\r\n\r\n fireEvent.keyDown(screen.getByRole(\"button\", { name: \"Choisir\" }), { key: \"Enter\" });\r\n expect(onCardKeyDown).not.toHaveBeenCalled();\r\n });\r\n\r\n test(\"opening the kebab does not fire the card click\", () => {\r\n const onCardClick = jest.fn();\r\n render(\r\n <div onClick={onCardClick}>\r\n <MobileRowCard title=\"ref\" actions={[{ label: \"Détail\", onClick: () => {} }]} />\r\n </div>\r\n );\r\n\r\n fireEvent.click(screen.getByRole(\"button\", { name: \"Plus d'actions\" }));\r\n expect(onCardClick).not.toHaveBeenCalled();\r\n });\r\n});\r\n\r\ndescribe(\"MobileRowCard — header composition\", () => {\r\n test(\"trailing and the kebab coexist, trailing first\", () => {\r\n render(\r\n <MobileRowCard\r\n title=\"ref\"\r\n trailing={<button>Visualiser</button>}\r\n actions={[{ label: \"Supprimer\", onClick: () => {} }]}\r\n actionsAriaLabel=\"Autres actions\"\r\n />\r\n );\r\n\r\n const visualiser = screen.getByRole(\"button\", { name: \"Visualiser\" });\r\n const kebab = screen.getByRole(\"button\", { name: \"Autres actions\" });\r\n expect(visualiser).toBeInTheDocument();\r\n expect(kebab).toBeInTheDocument();\r\n\r\n // Document order: trailing precedes the kebab in the header end cluster.\r\n expect(\r\n visualiser.compareDocumentPosition(kebab) & Node.DOCUMENT_POSITION_FOLLOWING\r\n ).toBeTruthy();\r\n });\r\n\r\n test(\"a card with ONLY trailing still renders its header\", () => {\r\n // Regression guard: hasHeader must include hasTrailing, otherwise a\r\n // title-less picker card would drop its action entirely.\r\n render(<MobileRowCard trailing={<button>Choisir</button>} />);\r\n expect(screen.getByRole(\"button\", { name: \"Choisir\" })).toBeInTheDocument();\r\n });\r\n\r\n test(\"a card with ONLY leading still renders its header\", () => {\r\n render(<MobileRowCard leading={<span>star</span>} />);\r\n expect(screen.getByText(\"star\")).toBeInTheDocument();\r\n });\r\n\r\n test(\"no props renders no header and does not throw\", () => {\r\n /* `render` not throwing IS the second half of this assertion. The button\r\n * check uses screen.queryByRole rather than container.querySelector\r\n * (testing-library/no-container + no-node-access), matching the idiom the\r\n * kebab test above already uses. */\r\n render(<MobileRowCard />);\r\n expect(screen.queryByRole(\"button\")).not.toBeInTheDocument();\r\n });\r\n});\r\n"],"mappings":";;;AAAAA,OAAA;AACA,IAAAC,KAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAwD,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAK,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,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,SAAAR,wBAAAK,GAAA,EAAAG,WAAA,SAAAA,WAAA,IAAAH,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAO,OAAA,CAAAP,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAQ,KAAA,GAAAN,wBAAA,CAAAC,WAAA,OAAAK,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAT,GAAA,YAAAQ,KAAA,CAAAE,GAAA,CAAAV,GAAA,SAAAW,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAhB,GAAA,QAAAgB,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,I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AA,WAAa,IAAE,CAAC,CAAC;IACzBgC,MAAM,CAACC,cAAM,CAACoB,WAAW,CAAC,QAAQ,CAAC,CAAC,CAACf,GAAG,CAACH,iBAAiB,CAAC,CAAC;EAC9D,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+
3
+ var _apiError = require("../utils/apiError");
4
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
5
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
+ /**
11
+ * Contract tests for apiError — the platform's `unknown`-rejection narrower.
12
+ *
13
+ * Two contracts are load-bearing here, and both were regressions waiting to
14
+ * happen:
15
+ *
16
+ * 1. G-04 — this helper exists so consuming sagas do not hand-roll
17
+ * `(error as { response?: … })` to get around `useUnknownInCatchVariables`.
18
+ * Two modules had already done exactly that before it was added.
19
+ *
20
+ * 2. G-07 — `error.message` must NOT reach a user when it is an axios
21
+ * transport artefact. Before the fix, any server error without a
22
+ * `response.data.message` rendered "Request failed with status code 500"
23
+ * into a toast (Charter §09.3 forbids raw technical detail), and every
24
+ * consumer's French fallback was effectively unreachable.
25
+ *
26
+ * The second contract is invisible to `tsc` and to the build: suppressing a
27
+ * string is a behavioural property, so without these tests the fix would
28
+ * silently rot the first time someone "simplified" the resolution chain back to
29
+ * a plain `asNonEmptyString`.
30
+ */
31
+
32
+ /** Minimal axios-shaped rejection. Duck-typed on purpose — see the file header. */
33
+ var axiosLike = function axiosLike(status, message, dataMessage) {
34
+ return {
35
+ message: message,
36
+ response: _objectSpread({
37
+ status: status
38
+ }, dataMessage === undefined ? {} : {
39
+ data: {
40
+ message: dataMessage
41
+ }
42
+ })
43
+ };
44
+ };
45
+ describe("getApiErrorMessage — resolution order", function () {
46
+ test("a non-empty string rejection is returned as-is", function () {
47
+ expect((0, _apiError.getApiErrorMessage)("Trop de tentatives.")).toBe("Trop de tentatives.");
48
+ });
49
+ test("the backend message wins over everything else", function () {
50
+ var err = axiosLike(422, "Request failed with status code 422", "Le numéro de titre est invalide.");
51
+ expect((0, _apiError.getApiErrorMessage)(err, "Échec.")).toBe("Le numéro de titre est invalide.");
52
+ });
53
+ test("falls back when nothing usable is present", function () {
54
+ expect((0, _apiError.getApiErrorMessage)({}, "Échec de l'envoi.")).toBe("Échec de l'envoi.");
55
+ });
56
+ test("uses the platform default when no fallback is supplied", function () {
57
+ expect((0, _apiError.getApiErrorMessage)({})).toBe(_apiError.DEFAULT_API_ERROR_MESSAGE);
58
+ });
59
+ test("never returns an empty string", function () {
60
+ expect((0, _apiError.getApiErrorMessage)("")).toBe(_apiError.DEFAULT_API_ERROR_MESSAGE);
61
+ expect((0, _apiError.getApiErrorMessage)({
62
+ message: ""
63
+ })).toBe(_apiError.DEFAULT_API_ERROR_MESSAGE);
64
+ });
65
+ test("never throws on hostile input", function () {
66
+ expect(function () {
67
+ return (0, _apiError.getApiErrorMessage)(null);
68
+ }).not.toThrow();
69
+ expect(function () {
70
+ return (0, _apiError.getApiErrorMessage)(undefined);
71
+ }).not.toThrow();
72
+ expect(function () {
73
+ return (0, _apiError.getApiErrorMessage)(0);
74
+ }).not.toThrow();
75
+ expect(function () {
76
+ return (0, _apiError.getApiErrorMessage)([]);
77
+ }).not.toThrow();
78
+ expect(function () {
79
+ return (0, _apiError.getApiErrorMessage)({
80
+ response: null
81
+ });
82
+ }).not.toThrow();
83
+ expect(function () {
84
+ return (0, _apiError.getApiErrorMessage)({
85
+ response: {
86
+ data: {
87
+ message: 42
88
+ }
89
+ }
90
+ });
91
+ }).not.toThrow();
92
+ });
93
+ });
94
+
95
+ /**
96
+ * G-07 — THE REGRESSION GUARD. If any of these fail, a transport string is
97
+ * reaching end users again.
98
+ */
99
+ describe("getApiErrorMessage — transport strings are suppressed (G-07)", function () {
100
+ var FALLBACK = "Le service est momentanément indisponible.";
101
+ test.each(["Request failed with status code 500", "Request failed with status code 404", "Network Error", "timeout of 15000ms exceeded", "timeout exceeded", "Request aborted", "canceled", "socket hang up", "ECONNREFUSED", "ETIMEDOUT", "ECONNRESET", "ENOTFOUND", "EPIPE", "ERR_NETWORK", "ERR_CANCELED", "ERR_BAD_RESPONSE"])("suppresses %p in favour of the caller's copy", function (message) {
102
+ expect((0, _apiError.getApiErrorMessage)({
103
+ message: message
104
+ }, FALLBACK)).toBe(FALLBACK);
105
+ });
106
+ test("matching is case-insensitive and tolerates padding", function () {
107
+ expect((0, _apiError.getApiErrorMessage)({
108
+ message: " network error "
109
+ }, FALLBACK)).toBe(FALLBACK);
110
+ });
111
+ test("a 500 with an empty body falls back rather than leaking the status line", function () {
112
+ var err = axiosLike(500, "Request failed with status code 500");
113
+ expect((0, _apiError.getApiErrorMessage)(err, FALLBACK)).toBe(FALLBACK);
114
+ });
115
+ });
116
+
117
+ /**
118
+ * The other half of the same contract: the deny-list must stay CONSERVATIVE. A
119
+ * false positive silently replaces a real business message with a generic one,
120
+ * which is more damaging than showing one ugly string.
121
+ */
122
+ describe("getApiErrorMessage — deliberate messages still pass through", function () {
123
+ test.each(["Ce titre ne peut pas être supprimé car il est en cours de validation.", "Le quota de dossiers est atteint.", "Session expirée. Reconnectez-vous.",
124
+ // Mentions a status but is human-written — must NOT be suppressed.
125
+ "Le service a répondu par une erreur (500). Réessayez.",
126
+ // Contains a transport phrase but is not one — anchored patterns only.
127
+ "Network Error détecté par la passerelle, contactez le support."])("passes %p through", function (message) {
128
+ expect((0, _apiError.getApiErrorMessage)({
129
+ message: message
130
+ }, "unused")).toBe(message);
131
+ });
132
+
133
+ /**
134
+ * Guards the CASE-SENSITIVITY of the two errno patterns.
135
+ *
136
+ * They are the only patterns in the list without `/i`, precisely so that a
137
+ * lowercase French word beginning with "e" is not mistaken for an errno
138
+ * constant. If someone "tidies" them to `/^e[a-z]+$/i` for consistency with
139
+ * their neighbours, every one of these becomes a generic fallback and a real
140
+ * business message is lost. That failure is silent in production — the user
141
+ * simply sees the wrong text — so it has to fail here instead.
142
+ */
143
+ test.each(["erreur", "expiré", "échec", "envoi", "erreurs"])("does not mistake the French word %p for an errno code", function (message) {
144
+ expect((0, _apiError.getApiErrorMessage)({
145
+ message: message
146
+ }, "unused")).toBe(message);
147
+ });
148
+ test("a module-thrown Error keeps its message", function () {
149
+ var err = new Error("Le montant FOB doit être positif.");
150
+ expect((0, _apiError.getApiErrorMessage)(err, "unused")).toBe("Le montant FOB doit être positif.");
151
+ });
152
+ });
153
+ describe("getApiErrorDetail — unfiltered, for logs", function () {
154
+ test("returns the transport string that getApiErrorMessage hides", function () {
155
+ var err = axiosLike(502, "Request failed with status code 502");
156
+ expect((0, _apiError.getApiErrorMessage)(err, "Indisponible.")).toBe("Indisponible.");
157
+ expect((0, _apiError.getApiErrorDetail)(err)).toBe("Request failed with status code 502");
158
+ });
159
+ test("returns undefined when there is nothing to log", function () {
160
+ expect((0, _apiError.getApiErrorDetail)({})).toBeUndefined();
161
+ expect((0, _apiError.getApiErrorDetail)(null)).toBeUndefined();
162
+ });
163
+ });
164
+ describe("getApiErrorStatus", function () {
165
+ test("returns the HTTP status when the server answered", function () {
166
+ expect((0, _apiError.getApiErrorStatus)(axiosLike(404, "Not Found"))).toBe(404);
167
+ });
168
+ test("returns undefined when there was no answer at all (R-4.3)", function () {
169
+ expect((0, _apiError.getApiErrorStatus)({
170
+ message: "Network Error"
171
+ })).toBeUndefined();
172
+ expect((0, _apiError.getApiErrorStatus)(null)).toBeUndefined();
173
+ });
174
+ test("ignores a non-numeric status", function () {
175
+ expect((0, _apiError.getApiErrorStatus)({
176
+ response: {
177
+ status: "500"
178
+ }
179
+ })).toBeUndefined();
180
+ });
181
+ });
182
+ //# sourceMappingURL=apiError.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiError.test.js","names":["_apiError","require","_typeof","obj","Symbol","iterator","constructor","prototype","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","call","TypeError","Number","axiosLike","status","message","dataMessage","response","data","describe","test","expect","getApiErrorMessage","toBe","err","DEFAULT_API_ERROR_MESSAGE","not","toThrow","FALLBACK","each","Error","getApiErrorDetail","toBeUndefined","getApiErrorStatus"],"sources":["../../../src/lib/v2/__tests__/apiError.test.ts"],"sourcesContent":["import {\r\n DEFAULT_API_ERROR_MESSAGE,\r\n getApiErrorDetail,\r\n getApiErrorMessage,\r\n getApiErrorStatus,\r\n} from \"../utils/apiError\";\r\n\r\n/**\r\n * Contract tests for apiError — the platform's `unknown`-rejection narrower.\r\n *\r\n * Two contracts are load-bearing here, and both were regressions waiting to\r\n * happen:\r\n *\r\n * 1. G-04 — this helper exists so consuming sagas do not hand-roll\r\n * `(error as { response?: … })` to get around `useUnknownInCatchVariables`.\r\n * Two modules had already done exactly that before it was added.\r\n *\r\n * 2. G-07 — `error.message` must NOT reach a user when it is an axios\r\n * transport artefact. Before the fix, any server error without a\r\n * `response.data.message` rendered \"Request failed with status code 500\"\r\n * into a toast (Charter §09.3 forbids raw technical detail), and every\r\n * consumer's French fallback was effectively unreachable.\r\n *\r\n * The second contract is invisible to `tsc` and to the build: suppressing a\r\n * string is a behavioural property, so without these tests the fix would\r\n * silently rot the first time someone \"simplified\" the resolution chain back to\r\n * a plain `asNonEmptyString`.\r\n */\r\n\r\n/** Minimal axios-shaped rejection. Duck-typed on purpose — see the file header. */\r\nconst axiosLike = (status: number, message: string, dataMessage?: string) => ({\r\n message,\r\n response: {\r\n status,\r\n ...(dataMessage === undefined ? {} : { data: { message: dataMessage } }),\r\n },\r\n});\r\n\r\ndescribe(\"getApiErrorMessage — resolution order\", () => {\r\n test(\"a non-empty string rejection is returned as-is\", () => {\r\n expect(getApiErrorMessage(\"Trop de tentatives.\")).toBe(\r\n \"Trop de tentatives.\"\r\n );\r\n });\r\n\r\n test(\"the backend message wins over everything else\", () => {\r\n const err = axiosLike(\r\n 422,\r\n \"Request failed with status code 422\",\r\n \"Le numéro de titre est invalide.\"\r\n );\r\n expect(getApiErrorMessage(err, \"Échec.\")).toBe(\r\n \"Le numéro de titre est invalide.\"\r\n );\r\n });\r\n\r\n test(\"falls back when nothing usable is present\", () => {\r\n expect(getApiErrorMessage({}, \"Échec de l'envoi.\")).toBe(\r\n \"Échec de l'envoi.\"\r\n );\r\n });\r\n\r\n test(\"uses the platform default when no fallback is supplied\", () => {\r\n expect(getApiErrorMessage({})).toBe(DEFAULT_API_ERROR_MESSAGE);\r\n });\r\n\r\n test(\"never returns an empty string\", () => {\r\n expect(getApiErrorMessage(\"\")).toBe(DEFAULT_API_ERROR_MESSAGE);\r\n expect(getApiErrorMessage({ message: \"\" })).toBe(DEFAULT_API_ERROR_MESSAGE);\r\n });\r\n\r\n test(\"never throws on hostile input\", () => {\r\n expect(() => getApiErrorMessage(null)).not.toThrow();\r\n expect(() => getApiErrorMessage(undefined)).not.toThrow();\r\n expect(() => getApiErrorMessage(0)).not.toThrow();\r\n expect(() => getApiErrorMessage([])).not.toThrow();\r\n expect(() => getApiErrorMessage({ response: null })).not.toThrow();\r\n expect(() =>\r\n getApiErrorMessage({ response: { data: { message: 42 } } })\r\n ).not.toThrow();\r\n });\r\n});\r\n\r\n/**\r\n * G-07 — THE REGRESSION GUARD. If any of these fail, a transport string is\r\n * reaching end users again.\r\n */\r\ndescribe(\"getApiErrorMessage — transport strings are suppressed (G-07)\", () => {\r\n const FALLBACK = \"Le service est momentanément indisponible.\";\r\n\r\n test.each([\r\n \"Request failed with status code 500\",\r\n \"Request failed with status code 404\",\r\n \"Network Error\",\r\n \"timeout of 15000ms exceeded\",\r\n \"timeout exceeded\",\r\n \"Request aborted\",\r\n \"canceled\",\r\n \"socket hang up\",\r\n \"ECONNREFUSED\",\r\n \"ETIMEDOUT\",\r\n \"ECONNRESET\",\r\n \"ENOTFOUND\",\r\n \"EPIPE\",\r\n \"ERR_NETWORK\",\r\n \"ERR_CANCELED\",\r\n \"ERR_BAD_RESPONSE\",\r\n ])(\"suppresses %p in favour of the caller's copy\", (message) => {\r\n expect(getApiErrorMessage({ message }, FALLBACK)).toBe(FALLBACK);\r\n });\r\n\r\n test(\"matching is case-insensitive and tolerates padding\", () => {\r\n expect(\r\n getApiErrorMessage({ message: \" network error \" }, FALLBACK)\r\n ).toBe(FALLBACK);\r\n });\r\n\r\n test(\"a 500 with an empty body falls back rather than leaking the status line\", () => {\r\n const err = axiosLike(500, \"Request failed with status code 500\");\r\n expect(getApiErrorMessage(err, FALLBACK)).toBe(FALLBACK);\r\n });\r\n});\r\n\r\n/**\r\n * The other half of the same contract: the deny-list must stay CONSERVATIVE. A\r\n * false positive silently replaces a real business message with a generic one,\r\n * which is more damaging than showing one ugly string.\r\n */\r\ndescribe(\"getApiErrorMessage — deliberate messages still pass through\", () => {\r\n test.each([\r\n \"Ce titre ne peut pas être supprimé car il est en cours de validation.\",\r\n \"Le quota de dossiers est atteint.\",\r\n \"Session expirée. Reconnectez-vous.\",\r\n // Mentions a status but is human-written — must NOT be suppressed.\r\n \"Le service a répondu par une erreur (500). Réessayez.\",\r\n // Contains a transport phrase but is not one — anchored patterns only.\r\n \"Network Error détecté par la passerelle, contactez le support.\",\r\n ])(\"passes %p through\", (message) => {\r\n expect(getApiErrorMessage({ message }, \"unused\")).toBe(message);\r\n });\r\n\r\n /**\r\n * Guards the CASE-SENSITIVITY of the two errno patterns.\r\n *\r\n * They are the only patterns in the list without `/i`, precisely so that a\r\n * lowercase French word beginning with \"e\" is not mistaken for an errno\r\n * constant. If someone \"tidies\" them to `/^e[a-z]+$/i` for consistency with\r\n * their neighbours, every one of these becomes a generic fallback and a real\r\n * business message is lost. That failure is silent in production — the user\r\n * simply sees the wrong text — so it has to fail here instead.\r\n */\r\n test.each([\"erreur\", \"expiré\", \"échec\", \"envoi\", \"erreurs\"])(\r\n \"does not mistake the French word %p for an errno code\",\r\n (message) => {\r\n expect(getApiErrorMessage({ message }, \"unused\")).toBe(message);\r\n }\r\n );\r\n\r\n test(\"a module-thrown Error keeps its message\", () => {\r\n const err = new Error(\"Le montant FOB doit être positif.\");\r\n expect(getApiErrorMessage(err, \"unused\")).toBe(\r\n \"Le montant FOB doit être positif.\"\r\n );\r\n });\r\n});\r\n\r\ndescribe(\"getApiErrorDetail — unfiltered, for logs\", () => {\r\n test(\"returns the transport string that getApiErrorMessage hides\", () => {\r\n const err = axiosLike(502, \"Request failed with status code 502\");\r\n expect(getApiErrorMessage(err, \"Indisponible.\")).toBe(\"Indisponible.\");\r\n expect(getApiErrorDetail(err)).toBe(\"Request failed with status code 502\");\r\n });\r\n\r\n test(\"returns undefined when there is nothing to log\", () => {\r\n expect(getApiErrorDetail({})).toBeUndefined();\r\n expect(getApiErrorDetail(null)).toBeUndefined();\r\n });\r\n});\r\n\r\ndescribe(\"getApiErrorStatus\", () => {\r\n test(\"returns the HTTP status when the server answered\", () => {\r\n expect(getApiErrorStatus(axiosLike(404, \"Not Found\"))).toBe(404);\r\n });\r\n\r\n test(\"returns undefined when there was no answer at all (R-4.3)\", () => {\r\n expect(getApiErrorStatus({ message: \"Network Error\" })).toBeUndefined();\r\n expect(getApiErrorStatus(null)).toBeUndefined();\r\n });\r\n\r\n test(\"ignores a non-numeric status\", () => {\r\n expect(\r\n getApiErrorStatus({ response: { status: \"500\" } })\r\n ).toBeUndefined();\r\n });\r\n});\r\n"],"mappings":";;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAK2B,SAAAC,QAAAC,GAAA,sCAAAD,OAAA,wBAAAE,MAAA,uBAAAA,MAAA,CAAAC,QAAA,aAAAF,GAAA,kBAAAA,GAAA,gBAAAA,GAAA,WAAAA,GAAA,yBAAAC,MAAA,IAAAD,GAAA,CAAAG,WAAA,KAAAF,MAAA,IAAAD,GAAA,KAAAC,MAAA,CAAAG,SAAA,qBAAAJ,GAAA,KAAAD,OAAA,CAAAC,GAAA;AAAA,SAAAK,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,OAAA,GAAAA,OAAA,CAAAC,MAAA,WAAAC,GAAA,WAAAJ,MAAA,CAAAK,wBAAA,CAAAR,MAAA,EAAAO,GAAA,EAAAE,UAAA,OAAAP,IAAA,CAAAQ,IAAA,CAAAC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