@portnet/ui 6.0.1 → 6.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1011) hide show
  1. package/CHANGELOG.md +737 -0
  2. package/dist/esm/index.js +90 -3
  3. package/dist/esm/index.js.map +1 -1
  4. package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
  5. package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
  6. package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
  7. package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
  8. package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
  9. package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
  10. package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
  11. package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
  12. package/dist/esm/v2/__tests__/FieldError.test.js +71 -39
  13. package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
  14. package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
  15. package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
  16. package/dist/esm/v2/__tests__/FieldWidth.test.js +146 -0
  17. package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -0
  18. package/dist/esm/v2/__tests__/FileCard.test.js +18 -18
  19. package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
  20. package/dist/esm/v2/__tests__/FormikCheckbox.test.js +173 -0
  21. package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -0
  22. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +236 -0
  23. package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
  24. package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
  25. package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
  26. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +299 -0
  27. package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
  28. package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -43
  29. package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
  30. package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
  31. package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
  32. package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
  33. package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
  34. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
  35. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  36. package/dist/esm/v2/__tests__/apiError.test.js +50 -69
  37. package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
  38. package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
  39. package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
  40. package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
  41. package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
  42. package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
  43. package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
  44. package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
  45. package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
  46. package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
  47. package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
  48. package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
  49. package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
  50. package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
  51. package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
  52. package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
  53. package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
  54. package/dist/esm/v2/__tests__/labels-merge.test.js +17 -22
  55. package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
  56. package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
  57. package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
  58. package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
  59. package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
  60. package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
  61. package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
  62. package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
  63. package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
  64. package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
  65. package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
  66. package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
  67. package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
  68. package/dist/esm/v2/components/Accordion.js +48 -70
  69. package/dist/esm/v2/components/Accordion.js.map +1 -1
  70. package/dist/esm/v2/components/ActionStrip.js +31 -43
  71. package/dist/esm/v2/components/ActionStrip.js.map +1 -1
  72. package/dist/esm/v2/components/Banner.js +25 -22
  73. package/dist/esm/v2/components/Banner.js.map +1 -1
  74. package/dist/esm/v2/components/Busy.js +14 -19
  75. package/dist/esm/v2/components/Busy.js.map +1 -1
  76. package/dist/esm/v2/components/Button.js +34 -45
  77. package/dist/esm/v2/components/Button.js.map +1 -1
  78. package/dist/esm/v2/components/CategoryTag.js +44 -27
  79. package/dist/esm/v2/components/CategoryTag.js.map +1 -1
  80. package/dist/esm/v2/components/Checkbox.js +32 -38
  81. package/dist/esm/v2/components/Checkbox.js.map +1 -1
  82. package/dist/esm/v2/components/Chip.js +23 -36
  83. package/dist/esm/v2/components/Chip.js.map +1 -1
  84. package/dist/esm/v2/components/Combobox.js +112 -136
  85. package/dist/esm/v2/components/Combobox.js.map +1 -1
  86. package/dist/esm/v2/components/CommandPalette.js +113 -198
  87. package/dist/esm/v2/components/CommandPalette.js.map +1 -1
  88. package/dist/esm/v2/components/ConfirmDialog.js +36 -45
  89. package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
  90. package/dist/esm/v2/components/DatePicker.js +78 -81
  91. package/dist/esm/v2/components/DatePicker.js.map +1 -1
  92. package/dist/esm/v2/components/DateRangePicker.js +63 -74
  93. package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
  94. package/dist/esm/v2/components/DateTimePicker.js +118 -90
  95. package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
  96. package/dist/esm/v2/components/Drawer.js +71 -65
  97. package/dist/esm/v2/components/Drawer.js.map +1 -1
  98. package/dist/esm/v2/components/Dropzone.js +130 -177
  99. package/dist/esm/v2/components/Dropzone.js.map +1 -1
  100. package/dist/esm/v2/components/EmptyState.js +9 -9
  101. package/dist/esm/v2/components/EmptyState.js.map +1 -1
  102. package/dist/esm/v2/components/FavoriteToggle.js +24 -33
  103. package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
  104. package/dist/esm/v2/components/Field.js +210 -52
  105. package/dist/esm/v2/components/Field.js.map +1 -1
  106. package/dist/esm/v2/components/FieldError.js +9 -13
  107. package/dist/esm/v2/components/FieldError.js.map +1 -1
  108. package/dist/esm/v2/components/FieldHelp.js +28 -49
  109. package/dist/esm/v2/components/FieldHelp.js.map +1 -1
  110. package/dist/esm/v2/components/FileCard.js +14 -19
  111. package/dist/esm/v2/components/FileCard.js.map +1 -1
  112. package/dist/esm/v2/components/FilterTab.js +22 -31
  113. package/dist/esm/v2/components/FilterTab.js.map +1 -1
  114. package/dist/esm/v2/components/ForbiddenPage.js +28 -8
  115. package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
  116. package/dist/esm/v2/components/FormGrid.js +48 -54
  117. package/dist/esm/v2/components/FormGrid.js.map +1 -1
  118. package/dist/esm/v2/components/FormikDisplay.js +98 -24
  119. package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
  120. package/dist/esm/v2/components/Input.js +75 -34
  121. package/dist/esm/v2/components/Input.js.map +1 -1
  122. package/dist/esm/v2/components/KPICard.js +42 -51
  123. package/dist/esm/v2/components/KPICard.js.map +1 -1
  124. package/dist/esm/v2/components/KPIStrip.js +9 -15
  125. package/dist/esm/v2/components/KPIStrip.js.map +1 -1
  126. package/dist/esm/v2/components/KV.js +16 -23
  127. package/dist/esm/v2/components/KV.js.map +1 -1
  128. package/dist/esm/v2/components/KVGrid.js +15 -23
  129. package/dist/esm/v2/components/KVGrid.js.map +1 -1
  130. package/dist/esm/v2/components/Layout.js +81 -117
  131. package/dist/esm/v2/components/Layout.js.map +1 -1
  132. package/dist/esm/v2/components/MobileRowCard.js +64 -75
  133. package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
  134. package/dist/esm/v2/components/Modal.js +44 -53
  135. package/dist/esm/v2/components/Modal.js.map +1 -1
  136. package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
  137. package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
  138. package/dist/esm/v2/components/NotFoundPage.js +28 -9
  139. package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
  140. package/dist/esm/v2/components/NumberInput.js +77 -107
  141. package/dist/esm/v2/components/NumberInput.js.map +1 -1
  142. package/dist/esm/v2/components/OverflowMenu.js +24 -42
  143. package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
  144. package/dist/esm/v2/components/PdfViewer.js +24 -33
  145. package/dist/esm/v2/components/PdfViewer.js.map +1 -1
  146. package/dist/esm/v2/components/ProgressBar.js +28 -36
  147. package/dist/esm/v2/components/ProgressBar.js.map +1 -1
  148. package/dist/esm/v2/components/Radio.js +49 -57
  149. package/dist/esm/v2/components/Radio.js.map +1 -1
  150. package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
  151. package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
  152. package/dist/esm/v2/components/SectionHeader.js +24 -31
  153. package/dist/esm/v2/components/SectionHeader.js.map +1 -1
  154. package/dist/esm/v2/components/Segmented.js +59 -84
  155. package/dist/esm/v2/components/Segmented.js.map +1 -1
  156. package/dist/esm/v2/components/Select.js +100 -138
  157. package/dist/esm/v2/components/Select.js.map +1 -1
  158. package/dist/esm/v2/components/ServerErrorPage.js +27 -10
  159. package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
  160. package/dist/esm/v2/components/Skeleton.js +81 -96
  161. package/dist/esm/v2/components/Skeleton.js.map +1 -1
  162. package/dist/esm/v2/components/SkipLink.js +6 -7
  163. package/dist/esm/v2/components/SkipLink.js.map +1 -1
  164. package/dist/esm/v2/components/Spinner.js +13 -22
  165. package/dist/esm/v2/components/Spinner.js.map +1 -1
  166. package/dist/esm/v2/components/Status.js +14 -25
  167. package/dist/esm/v2/components/Status.js.map +1 -1
  168. package/dist/esm/v2/components/Stepper.js +68 -71
  169. package/dist/esm/v2/components/Stepper.js.map +1 -1
  170. package/dist/esm/v2/components/Surface.js +25 -44
  171. package/dist/esm/v2/components/Surface.js.map +1 -1
  172. package/dist/esm/v2/components/Switch.js +21 -29
  173. package/dist/esm/v2/components/Switch.js.map +1 -1
  174. package/dist/esm/v2/components/TabPanel.js +84 -0
  175. package/dist/esm/v2/components/TabPanel.js.map +1 -0
  176. package/dist/esm/v2/components/Tabs.js +43 -19
  177. package/dist/esm/v2/components/Tabs.js.map +1 -1
  178. package/dist/esm/v2/components/TelInput.js +75 -108
  179. package/dist/esm/v2/components/TelInput.js.map +1 -1
  180. package/dist/esm/v2/components/Textarea.js +21 -30
  181. package/dist/esm/v2/components/Textarea.js.map +1 -1
  182. package/dist/esm/v2/components/TimePicker.js +59 -69
  183. package/dist/esm/v2/components/TimePicker.js.map +1 -1
  184. package/dist/esm/v2/components/Toast.js +109 -163
  185. package/dist/esm/v2/components/Toast.js.map +1 -1
  186. package/dist/esm/v2/components/Tooltip.js +18 -31
  187. package/dist/esm/v2/components/Tooltip.js.map +1 -1
  188. package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
  189. package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
  190. package/dist/esm/v2/components/_pickerShared.js +2 -2
  191. package/dist/esm/v2/components/_pickerShared.js.map +1 -1
  192. package/dist/esm/v2/components/index.js +64 -0
  193. package/dist/esm/v2/components/index.js.map +1 -1
  194. package/dist/esm/v2/hooks/index.js +62 -0
  195. package/dist/esm/v2/hooks/index.js.map +1 -1
  196. package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
  197. package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
  198. package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
  199. package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
  200. package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
  201. package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
  202. package/dist/esm/v2/hooks/useDensity.js +13 -17
  203. package/dist/esm/v2/hooks/useDensity.js.map +1 -1
  204. package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
  205. package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
  206. package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
  207. package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
  208. package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
  209. package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
  210. package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
  211. package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
  212. package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
  213. package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
  214. package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
  215. package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
  216. package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
  217. package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
  218. package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
  219. package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
  220. package/dist/esm/v2/hooks/useSortedRows.js +3 -5
  221. package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
  222. package/dist/esm/v2/hooks/useTabLoading.js +6 -21
  223. package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
  224. package/dist/esm/v2/index.js +14 -4
  225. package/dist/esm/v2/index.js.map +1 -1
  226. package/dist/esm/v2/modalContext.js +2 -2
  227. package/dist/esm/v2/modalContext.js.map +1 -1
  228. package/dist/esm/v2/models/favorite.js.map +1 -1
  229. package/dist/esm/v2/models/personalization.js.map +1 -1
  230. package/dist/esm/v2/models/referentiel.js.map +1 -1
  231. package/dist/esm/v2/models/savedFilter.js.map +1 -1
  232. package/dist/esm/v2/patterns/ActionBar.js +115 -159
  233. package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
  234. package/dist/esm/v2/patterns/AppMain.js +108 -0
  235. package/dist/esm/v2/patterns/AppMain.js.map +1 -0
  236. package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
  237. package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
  238. package/dist/esm/v2/patterns/ChartFigure.js +151 -0
  239. package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
  240. package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
  241. package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  242. package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
  243. package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
  244. package/dist/esm/v2/patterns/DataGrid.js +221 -255
  245. package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
  246. package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
  247. package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  248. package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
  249. package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
  250. package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
  251. package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
  252. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
  253. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  254. package/dist/esm/v2/patterns/DetailSplit.js +108 -0
  255. package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
  256. package/dist/esm/v2/patterns/FavoriteColumn.js +26 -75
  257. package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
  258. package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
  259. package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
  260. package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
  261. package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
  262. package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
  263. package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
  264. package/dist/esm/v2/patterns/FormPageShell.js +43 -41
  265. package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
  266. package/dist/esm/v2/patterns/FormSection.js +30 -38
  267. package/dist/esm/v2/patterns/FormSection.js.map +1 -1
  268. package/dist/esm/v2/patterns/FormikCheckbox.js +130 -0
  269. package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -0
  270. package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
  271. package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  272. package/dist/esm/v2/patterns/FormikCombobox.js +51 -66
  273. package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
  274. package/dist/esm/v2/patterns/FormikDatePicker.js +51 -99
  275. package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
  276. package/dist/esm/v2/patterns/FormikDateTimePicker.js +136 -0
  277. package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -0
  278. package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
  279. package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
  280. package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
  281. package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
  282. package/dist/esm/v2/patterns/FormikFile.js +94 -78
  283. package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
  284. package/dist/esm/v2/patterns/FormikInput.js +40 -50
  285. package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
  286. package/dist/esm/v2/patterns/FormikRadioGroup.js +129 -0
  287. package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -0
  288. package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
  289. package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
  290. package/dist/esm/v2/patterns/FormikSelect.js +64 -84
  291. package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
  292. package/dist/esm/v2/patterns/FormikTextarea.js +30 -43
  293. package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
  294. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +64 -65
  295. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  296. package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
  297. package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
  298. package/dist/esm/v2/patterns/PageContent.js +10 -14
  299. package/dist/esm/v2/patterns/PageContent.js.map +1 -1
  300. package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
  301. package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
  302. package/dist/esm/v2/patterns/ReferentielField.js +327 -312
  303. package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
  304. package/dist/esm/v2/patterns/RowFavoriteToggle.js +127 -0
  305. package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -0
  306. package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
  307. package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
  308. package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
  309. package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
  310. package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
  311. package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
  312. package/dist/esm/v2/patterns/SortableHeader.js +22 -45
  313. package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
  314. package/dist/esm/v2/patterns/Tour.js +94 -120
  315. package/dist/esm/v2/patterns/Tour.js.map +1 -1
  316. package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
  317. package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
  318. package/dist/esm/v2/patterns/_pickerSerialisation.js +72 -0
  319. package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -0
  320. package/dist/esm/v2/patterns/_sort.js +17 -33
  321. package/dist/esm/v2/patterns/_sort.js.map +1 -1
  322. package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
  323. package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
  324. package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
  325. package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
  326. package/dist/esm/v2/patterns/filterCriteria.js +102 -0
  327. package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
  328. package/dist/esm/v2/patterns/index.js +235 -0
  329. package/dist/esm/v2/patterns/index.js.map +1 -1
  330. package/dist/esm/v2/patterns/rowActions.js +223 -0
  331. package/dist/esm/v2/patterns/rowActions.js.map +1 -0
  332. package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
  333. package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
  334. package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
  335. package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
  336. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
  337. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  338. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
  339. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  340. package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
  341. package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
  342. package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
  343. package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
  344. package/dist/esm/v2/personalization/capabilities/gridPreferences.js +203 -0
  345. package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -0
  346. package/dist/esm/v2/personalization/capabilities/index.js +5 -0
  347. package/dist/esm/v2/personalization/capabilities/index.js.map +1 -1
  348. package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
  349. package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
  350. package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
  351. package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
  352. package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
  353. package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
  354. package/dist/esm/v2/personalization/index.js +35 -0
  355. package/dist/esm/v2/personalization/index.js.map +1 -1
  356. package/dist/esm/v2/personalization/personalizationContext.js +9 -9
  357. package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
  358. package/dist/esm/v2/personalization/schema.js +8 -9
  359. package/dist/esm/v2/personalization/schema.js.map +1 -1
  360. package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
  361. package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
  362. package/dist/esm/v2/referentiel/types.js +2 -0
  363. package/dist/esm/v2/referentiel/types.js.map +1 -0
  364. package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
  365. package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
  366. package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
  367. package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
  368. package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
  369. package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
  370. package/dist/esm/v2/theme/_brand.js +8 -24
  371. package/dist/esm/v2/theme/_brand.js.map +1 -1
  372. package/dist/esm/v2/theme/_brandSecondary.js +8 -24
  373. package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
  374. package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
  375. package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
  376. package/dist/esm/v2/theme/cssVariables.js +62 -69
  377. package/dist/esm/v2/theme/cssVariables.js.map +1 -1
  378. package/dist/esm/v2/theme/index.js +5 -5
  379. package/dist/esm/v2/theme/index.js.map +1 -1
  380. package/dist/esm/v2/tokens/breakpoints.js +14 -14
  381. package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
  382. package/dist/esm/v2/tokens/chart.js +261 -0
  383. package/dist/esm/v2/tokens/chart.js.map +1 -0
  384. package/dist/esm/v2/tokens/colors.js +22 -22
  385. package/dist/esm/v2/tokens/colors.js.map +1 -1
  386. package/dist/esm/v2/tokens/density.js +62 -7
  387. package/dist/esm/v2/tokens/density.js.map +1 -1
  388. package/dist/esm/v2/tokens/index.js +49 -34
  389. package/dist/esm/v2/tokens/index.js.map +1 -1
  390. package/dist/esm/v2/tokens/motion.js +12 -20
  391. package/dist/esm/v2/tokens/motion.js.map +1 -1
  392. package/dist/esm/v2/tokens/radius.js +1 -1
  393. package/dist/esm/v2/tokens/radius.js.map +1 -1
  394. package/dist/esm/v2/tokens/shadows.js +6 -6
  395. package/dist/esm/v2/tokens/shadows.js.map +1 -1
  396. package/dist/esm/v2/tokens/spacing.js +2 -2
  397. package/dist/esm/v2/tokens/spacing.js.map +1 -1
  398. package/dist/esm/v2/tokens/state.js +1 -1
  399. package/dist/esm/v2/tokens/state.js.map +1 -1
  400. package/dist/esm/v2/tokens/statusPalette.js +17 -21
  401. package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
  402. package/dist/esm/v2/tokens/tokens.json +6 -1
  403. package/dist/esm/v2/tokens/typography.js +13 -13
  404. package/dist/esm/v2/tokens/typography.js.map +1 -1
  405. package/dist/esm/v2/tokens/zIndex.js +1 -1
  406. package/dist/esm/v2/tokens/zIndex.js.map +1 -1
  407. package/dist/esm/v2/types/datagrid.js.map +1 -1
  408. package/dist/esm/v2/utils/apiError.js +16 -37
  409. package/dist/esm/v2/utils/apiError.js.map +1 -1
  410. package/dist/esm/v2/utils/contrast.js +31 -32
  411. package/dist/esm/v2/utils/contrast.js.map +1 -1
  412. package/dist/esm/v2/utils/cx.js +5 -25
  413. package/dist/esm/v2/utils/cx.js.map +1 -1
  414. package/dist/esm/v2/utils/fileDownload.js +23 -26
  415. package/dist/esm/v2/utils/fileDownload.js.map +1 -1
  416. package/dist/esm/v2/utils/fileValidation.js +209 -0
  417. package/dist/esm/v2/utils/fileValidation.js.map +1 -0
  418. package/dist/esm/v2/utils/fmtDate.js +111 -0
  419. package/dist/esm/v2/utils/fmtDate.js.map +1 -0
  420. package/dist/esm/v2/utils/fmtMoney.js +8 -10
  421. package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
  422. package/dist/esm/v2/utils/formikErrors.js +78 -0
  423. package/dist/esm/v2/utils/formikErrors.js.map +1 -0
  424. package/dist/esm/v2/utils/index.js +35 -2
  425. package/dist/esm/v2/utils/index.js.map +1 -1
  426. package/dist/esm/v2/utils/mergeLabels.js +7 -12
  427. package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
  428. package/dist/esm/v2/utils/networkStatus.js +12 -12
  429. package/dist/esm/v2/utils/networkStatus.js.map +1 -1
  430. package/dist/index.d.ts +9 -1
  431. package/dist/index.d.ts.map +1 -1
  432. package/dist/index.js +122 -47
  433. package/dist/index.js.map +1 -1
  434. package/dist/v2/__tests__/AppMain.test.js +133 -0
  435. package/dist/v2/__tests__/AppMain.test.js.map +1 -0
  436. package/dist/v2/__tests__/ChartFigure.test.js +183 -0
  437. package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
  438. package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
  439. package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
  440. package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
  441. package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
  442. package/dist/v2/__tests__/FieldError.test.js +98 -69
  443. package/dist/v2/__tests__/FieldError.test.js.map +1 -1
  444. package/dist/v2/__tests__/FieldNaming.test.js +161 -0
  445. package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
  446. package/dist/v2/__tests__/FieldWidth.test.js +148 -0
  447. package/dist/v2/__tests__/FieldWidth.test.js.map +1 -0
  448. package/dist/v2/__tests__/FileCard.test.js +45 -48
  449. package/dist/v2/__tests__/FileCard.test.js.map +1 -1
  450. package/dist/v2/__tests__/FormikCheckbox.test.js +175 -0
  451. package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -0
  452. package/dist/v2/__tests__/FormikDateTimePicker.test.js +237 -0
  453. package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
  454. package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
  455. package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
  456. package/dist/v2/__tests__/FormikRadioGroup.test.js +300 -0
  457. package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
  458. package/dist/v2/__tests__/MobileRowCard.test.js +100 -102
  459. package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
  460. package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
  461. package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
  462. package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
  463. package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
  464. package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
  465. package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
  466. package/dist/v2/__tests__/apiError.test.js +50 -69
  467. package/dist/v2/__tests__/apiError.test.js.map +1 -1
  468. package/dist/v2/__tests__/banned-patterns.test.js +42 -123
  469. package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
  470. package/dist/v2/__tests__/chart-palette.test.js +205 -0
  471. package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
  472. package/dist/v2/__tests__/contrast-palette.test.js +42 -74
  473. package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
  474. package/dist/v2/__tests__/cssVariables.test.js +44 -51
  475. package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
  476. package/dist/v2/__tests__/fileValidation.test.js +136 -0
  477. package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
  478. package/dist/v2/__tests__/filterCriteria.test.js +324 -0
  479. package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
  480. package/dist/v2/__tests__/fmtDate.test.js +69 -0
  481. package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
  482. package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
  483. package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
  484. package/dist/v2/__tests__/labels-merge.test.js +38 -46
  485. package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
  486. package/dist/v2/__tests__/locale-fallback.test.js +47 -52
  487. package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
  488. package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
  489. package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
  490. package/dist/v2/__tests__/rowActions.test.js +186 -0
  491. package/dist/v2/__tests__/rowActions.test.js.map +1 -0
  492. package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
  493. package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
  494. package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
  495. package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
  496. package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
  497. package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
  498. package/dist/v2/components/Accordion.js +60 -82
  499. package/dist/v2/components/Accordion.js.map +1 -1
  500. package/dist/v2/components/ActionStrip.js +40 -52
  501. package/dist/v2/components/ActionStrip.js.map +1 -1
  502. package/dist/v2/components/Banner.js +42 -41
  503. package/dist/v2/components/Banner.js.map +1 -1
  504. package/dist/v2/components/Busy.js +22 -27
  505. package/dist/v2/components/Busy.js.map +1 -1
  506. package/dist/v2/components/Button.js +39 -50
  507. package/dist/v2/components/Button.js.map +1 -1
  508. package/dist/v2/components/CategoryTag.d.ts.map +1 -1
  509. package/dist/v2/components/CategoryTag.js +49 -32
  510. package/dist/v2/components/CategoryTag.js.map +1 -1
  511. package/dist/v2/components/Checkbox.js +39 -45
  512. package/dist/v2/components/Checkbox.js.map +1 -1
  513. package/dist/v2/components/Chip.js +29 -42
  514. package/dist/v2/components/Chip.js.map +1 -1
  515. package/dist/v2/components/Combobox.js +122 -144
  516. package/dist/v2/components/Combobox.js.map +1 -1
  517. package/dist/v2/components/CommandPalette.js +138 -225
  518. package/dist/v2/components/CommandPalette.js.map +1 -1
  519. package/dist/v2/components/ConfirmDialog.js +46 -56
  520. package/dist/v2/components/ConfirmDialog.js.map +1 -1
  521. package/dist/v2/components/DatePicker.js +81 -86
  522. package/dist/v2/components/DatePicker.js.map +1 -1
  523. package/dist/v2/components/DateRangePicker.js +77 -87
  524. package/dist/v2/components/DateRangePicker.js.map +1 -1
  525. package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
  526. package/dist/v2/components/DateTimePicker.js +121 -95
  527. package/dist/v2/components/DateTimePicker.js.map +1 -1
  528. package/dist/v2/components/Drawer.d.ts.map +1 -1
  529. package/dist/v2/components/Drawer.js +93 -88
  530. package/dist/v2/components/Drawer.js.map +1 -1
  531. package/dist/v2/components/Dropzone.js +150 -196
  532. package/dist/v2/components/Dropzone.js.map +1 -1
  533. package/dist/v2/components/EmptyState.js +18 -20
  534. package/dist/v2/components/EmptyState.js.map +1 -1
  535. package/dist/v2/components/FavoriteToggle.js +28 -39
  536. package/dist/v2/components/FavoriteToggle.js.map +1 -1
  537. package/dist/v2/components/Field.d.ts +121 -5
  538. package/dist/v2/components/Field.d.ts.map +1 -1
  539. package/dist/v2/components/Field.js +221 -62
  540. package/dist/v2/components/Field.js.map +1 -1
  541. package/dist/v2/components/FieldError.js +18 -21
  542. package/dist/v2/components/FieldError.js.map +1 -1
  543. package/dist/v2/components/FieldHelp.js +40 -60
  544. package/dist/v2/components/FieldHelp.js.map +1 -1
  545. package/dist/v2/components/FileCard.js +27 -31
  546. package/dist/v2/components/FileCard.js.map +1 -1
  547. package/dist/v2/components/FilterTab.js +30 -38
  548. package/dist/v2/components/FilterTab.js.map +1 -1
  549. package/dist/v2/components/ForbiddenPage.d.ts +25 -1
  550. package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
  551. package/dist/v2/components/ForbiddenPage.js +37 -17
  552. package/dist/v2/components/ForbiddenPage.js.map +1 -1
  553. package/dist/v2/components/FormGrid.js +53 -59
  554. package/dist/v2/components/FormGrid.js.map +1 -1
  555. package/dist/v2/components/FormikDisplay.d.ts +50 -1
  556. package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
  557. package/dist/v2/components/FormikDisplay.js +108 -33
  558. package/dist/v2/components/FormikDisplay.js.map +1 -1
  559. package/dist/v2/components/Input.d.ts +40 -0
  560. package/dist/v2/components/Input.d.ts.map +1 -1
  561. package/dist/v2/components/Input.js +81 -41
  562. package/dist/v2/components/Input.js.map +1 -1
  563. package/dist/v2/components/KPICard.js +57 -67
  564. package/dist/v2/components/KPICard.js.map +1 -1
  565. package/dist/v2/components/KPIStrip.js +16 -22
  566. package/dist/v2/components/KPIStrip.js.map +1 -1
  567. package/dist/v2/components/KV.js +25 -31
  568. package/dist/v2/components/KV.js.map +1 -1
  569. package/dist/v2/components/KVGrid.js +19 -26
  570. package/dist/v2/components/KVGrid.js.map +1 -1
  571. package/dist/v2/components/Layout.js +91 -120
  572. package/dist/v2/components/Layout.js.map +1 -1
  573. package/dist/v2/components/MobileRowCard.js +79 -91
  574. package/dist/v2/components/MobileRowCard.js.map +1 -1
  575. package/dist/v2/components/Modal.js +61 -69
  576. package/dist/v2/components/Modal.js.map +1 -1
  577. package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
  578. package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
  579. package/dist/v2/components/NetworkErrorPage.js +38 -21
  580. package/dist/v2/components/NetworkErrorPage.js.map +1 -1
  581. package/dist/v2/components/NotFoundPage.d.ts +17 -1
  582. package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
  583. package/dist/v2/components/NotFoundPage.js +37 -18
  584. package/dist/v2/components/NotFoundPage.js.map +1 -1
  585. package/dist/v2/components/NumberInput.js +88 -118
  586. package/dist/v2/components/NumberInput.js.map +1 -1
  587. package/dist/v2/components/OverflowMenu.js +38 -56
  588. package/dist/v2/components/OverflowMenu.js.map +1 -1
  589. package/dist/v2/components/PdfViewer.js +34 -45
  590. package/dist/v2/components/PdfViewer.js.map +1 -1
  591. package/dist/v2/components/ProgressBar.js +42 -49
  592. package/dist/v2/components/ProgressBar.js.map +1 -1
  593. package/dist/v2/components/Radio.js +59 -67
  594. package/dist/v2/components/Radio.js.map +1 -1
  595. package/dist/v2/components/SectionErrorBoundary.js +90 -135
  596. package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
  597. package/dist/v2/components/SectionHeader.js +34 -41
  598. package/dist/v2/components/SectionHeader.js.map +1 -1
  599. package/dist/v2/components/Segmented.js +69 -93
  600. package/dist/v2/components/Segmented.js.map +1 -1
  601. package/dist/v2/components/Select.d.ts +26 -2
  602. package/dist/v2/components/Select.d.ts.map +1 -1
  603. package/dist/v2/components/Select.js +120 -155
  604. package/dist/v2/components/Select.js.map +1 -1
  605. package/dist/v2/components/ServerErrorPage.d.ts +27 -1
  606. package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
  607. package/dist/v2/components/ServerErrorPage.js +37 -20
  608. package/dist/v2/components/ServerErrorPage.js.map +1 -1
  609. package/dist/v2/components/Skeleton.js +86 -100
  610. package/dist/v2/components/Skeleton.js.map +1 -1
  611. package/dist/v2/components/SkipLink.js +9 -12
  612. package/dist/v2/components/SkipLink.js.map +1 -1
  613. package/dist/v2/components/Spinner.js +16 -25
  614. package/dist/v2/components/Spinner.js.map +1 -1
  615. package/dist/v2/components/Status.js +18 -29
  616. package/dist/v2/components/Status.js.map +1 -1
  617. package/dist/v2/components/Stepper.js +80 -82
  618. package/dist/v2/components/Stepper.js.map +1 -1
  619. package/dist/v2/components/Surface.js +34 -49
  620. package/dist/v2/components/Surface.js.map +1 -1
  621. package/dist/v2/components/Switch.js +29 -37
  622. package/dist/v2/components/Switch.js.map +1 -1
  623. package/dist/v2/components/TabPanel.d.ts +17 -0
  624. package/dist/v2/components/TabPanel.d.ts.map +1 -0
  625. package/dist/v2/components/TabPanel.js +90 -0
  626. package/dist/v2/components/TabPanel.js.map +1 -0
  627. package/dist/v2/components/Tabs.d.ts +25 -0
  628. package/dist/v2/components/Tabs.d.ts.map +1 -1
  629. package/dist/v2/components/Tabs.js +53 -29
  630. package/dist/v2/components/Tabs.js.map +1 -1
  631. package/dist/v2/components/TelInput.js +80 -115
  632. package/dist/v2/components/TelInput.js.map +1 -1
  633. package/dist/v2/components/Textarea.js +26 -35
  634. package/dist/v2/components/Textarea.js.map +1 -1
  635. package/dist/v2/components/TimePicker.js +62 -74
  636. package/dist/v2/components/TimePicker.js.map +1 -1
  637. package/dist/v2/components/Toast.js +119 -174
  638. package/dist/v2/components/Toast.js.map +1 -1
  639. package/dist/v2/components/Tooltip.js +23 -38
  640. package/dist/v2/components/Tooltip.js.map +1 -1
  641. package/dist/v2/components/_ErrorPageBody.js +15 -16
  642. package/dist/v2/components/_ErrorPageBody.js.map +1 -1
  643. package/dist/v2/components/_pickerShared.js +5 -5
  644. package/dist/v2/components/_pickerShared.js.map +1 -1
  645. package/dist/v2/components/index.d.ts +67 -1
  646. package/dist/v2/components/index.d.ts.map +1 -1
  647. package/dist/v2/components/index.js +153 -136
  648. package/dist/v2/components/index.js.map +1 -1
  649. package/dist/v2/hooks/index.d.ts +65 -0
  650. package/dist/v2/hooks/index.d.ts.map +1 -1
  651. package/dist/v2/hooks/index.js +63 -24
  652. package/dist/v2/hooks/index.js.map +1 -1
  653. package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
  654. package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
  655. package/dist/v2/hooks/useAppliedFilters.js +117 -0
  656. package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
  657. package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
  658. package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
  659. package/dist/v2/hooks/useDebouncedCallback.js +87 -0
  660. package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
  661. package/dist/v2/hooks/useDelayedFlag.js +6 -20
  662. package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
  663. package/dist/v2/hooks/useDensity.d.ts.map +1 -1
  664. package/dist/v2/hooks/useDensity.js +14 -18
  665. package/dist/v2/hooks/useDensity.js.map +1 -1
  666. package/dist/v2/hooks/useFocusFirstError.js +26 -34
  667. package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
  668. package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
  669. package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
  670. package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
  671. package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
  672. package/dist/v2/hooks/useFocusTrap.js +20 -24
  673. package/dist/v2/hooks/useFocusTrap.js.map +1 -1
  674. package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
  675. package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
  676. package/dist/v2/hooks/useFormAutoSave.js +39 -54
  677. package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
  678. package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
  679. package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
  680. package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
  681. package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
  682. package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
  683. package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  684. package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
  685. package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
  686. package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
  687. package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
  688. package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
  689. package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
  690. package/dist/v2/hooks/useResolvedDensity.js +5 -13
  691. package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
  692. package/dist/v2/hooks/useSortedRows.js +4 -6
  693. package/dist/v2/hooks/useSortedRows.js.map +1 -1
  694. package/dist/v2/hooks/useTabLoading.js +7 -22
  695. package/dist/v2/hooks/useTabLoading.js.map +1 -1
  696. package/dist/v2/index.d.ts.map +1 -1
  697. package/dist/v2/index.js +143 -145
  698. package/dist/v2/index.js.map +1 -1
  699. package/dist/v2/modalContext.js +2 -2
  700. package/dist/v2/modalContext.js.map +1 -1
  701. package/dist/v2/models/favorite.d.ts +8 -9
  702. package/dist/v2/models/favorite.d.ts.map +1 -1
  703. package/dist/v2/models/favorite.js.map +1 -1
  704. package/dist/v2/models/index.js +4 -4
  705. package/dist/v2/models/index.js.map +1 -1
  706. package/dist/v2/models/personalization.d.ts +44 -48
  707. package/dist/v2/models/personalization.d.ts.map +1 -1
  708. package/dist/v2/models/personalization.js.map +1 -1
  709. package/dist/v2/models/referentiel.d.ts +32 -50
  710. package/dist/v2/models/referentiel.d.ts.map +1 -1
  711. package/dist/v2/models/referentiel.js.map +1 -1
  712. package/dist/v2/models/savedFilter.d.ts +8 -17
  713. package/dist/v2/models/savedFilter.d.ts.map +1 -1
  714. package/dist/v2/models/savedFilter.js.map +1 -1
  715. package/dist/v2/patterns/ActionBar.js +152 -187
  716. package/dist/v2/patterns/ActionBar.js.map +1 -1
  717. package/dist/v2/patterns/AppMain.d.ts +109 -0
  718. package/dist/v2/patterns/AppMain.d.ts.map +1 -0
  719. package/dist/v2/patterns/AppMain.js +115 -0
  720. package/dist/v2/patterns/AppMain.js.map +1 -0
  721. package/dist/v2/patterns/BulkActionBar.js +40 -42
  722. package/dist/v2/patterns/BulkActionBar.js.map +1 -1
  723. package/dist/v2/patterns/ChartFigure.d.ts +124 -0
  724. package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
  725. package/dist/v2/patterns/ChartFigure.js +159 -0
  726. package/dist/v2/patterns/ChartFigure.js.map +1 -0
  727. package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
  728. package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  729. package/dist/v2/patterns/ColumnsToggle.js +60 -94
  730. package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
  731. package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
  732. package/dist/v2/patterns/DataGrid.js +262 -297
  733. package/dist/v2/patterns/DataGrid.js.map +1 -1
  734. package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
  735. package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
  736. package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
  737. package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  738. package/dist/v2/patterns/DataGridToolbar.js +103 -106
  739. package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
  740. package/dist/v2/patterns/DataGridVirtualized.js +179 -217
  741. package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
  742. package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
  743. package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  744. package/dist/v2/patterns/DetailSplit.d.ts +87 -0
  745. package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
  746. package/dist/v2/patterns/DetailSplit.js +116 -0
  747. package/dist/v2/patterns/DetailSplit.js.map +1 -0
  748. package/dist/v2/patterns/FavoriteColumn.d.ts +9 -9
  749. package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
  750. package/dist/v2/patterns/FavoriteColumn.js +32 -80
  751. package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
  752. package/dist/v2/patterns/FavoritesFilter.js +36 -44
  753. package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
  754. package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
  755. package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
  756. package/dist/v2/patterns/FilterTabBar.js +120 -0
  757. package/dist/v2/patterns/FilterTabBar.js.map +1 -0
  758. package/dist/v2/patterns/FormErrorSummary.js +20 -23
  759. package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
  760. package/dist/v2/patterns/FormPageShell.js +53 -50
  761. package/dist/v2/patterns/FormPageShell.js.map +1 -1
  762. package/dist/v2/patterns/FormSection.d.ts +8 -3
  763. package/dist/v2/patterns/FormSection.d.ts.map +1 -1
  764. package/dist/v2/patterns/FormSection.js +44 -51
  765. package/dist/v2/patterns/FormSection.js.map +1 -1
  766. package/dist/v2/patterns/FormikCheckbox.d.ts +77 -0
  767. package/dist/v2/patterns/FormikCheckbox.d.ts.map +1 -0
  768. package/dist/v2/patterns/FormikCheckbox.js +138 -0
  769. package/dist/v2/patterns/FormikCheckbox.js.map +1 -0
  770. package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
  771. package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
  772. package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
  773. package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  774. package/dist/v2/patterns/FormikCombobox.d.ts +7 -1
  775. package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
  776. package/dist/v2/patterns/FormikCombobox.js +55 -69
  777. package/dist/v2/patterns/FormikCombobox.js.map +1 -1
  778. package/dist/v2/patterns/FormikDatePicker.d.ts +13 -1
  779. package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
  780. package/dist/v2/patterns/FormikDatePicker.js +59 -106
  781. package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
  782. package/dist/v2/patterns/FormikDateTimePicker.d.ts +111 -0
  783. package/dist/v2/patterns/FormikDateTimePicker.d.ts.map +1 -0
  784. package/dist/v2/patterns/FormikDateTimePicker.js +144 -0
  785. package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -0
  786. package/dist/v2/patterns/FormikErrorFocus.js +25 -26
  787. package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
  788. package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
  789. package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
  790. package/dist/v2/patterns/FormikErrorSummary.js +97 -0
  791. package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
  792. package/dist/v2/patterns/FormikFile.d.ts +14 -1
  793. package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
  794. package/dist/v2/patterns/FormikFile.js +99 -83
  795. package/dist/v2/patterns/FormikFile.js.map +1 -1
  796. package/dist/v2/patterns/FormikInput.d.ts +11 -1
  797. package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
  798. package/dist/v2/patterns/FormikInput.js +45 -55
  799. package/dist/v2/patterns/FormikInput.js.map +1 -1
  800. package/dist/v2/patterns/FormikRadioGroup.d.ts +80 -0
  801. package/dist/v2/patterns/FormikRadioGroup.d.ts.map +1 -0
  802. package/dist/v2/patterns/FormikRadioGroup.js +137 -0
  803. package/dist/v2/patterns/FormikRadioGroup.js.map +1 -0
  804. package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
  805. package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
  806. package/dist/v2/patterns/FormikReferentielField.js +54 -64
  807. package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
  808. package/dist/v2/patterns/FormikSelect.d.ts +9 -1
  809. package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
  810. package/dist/v2/patterns/FormikSelect.js +70 -89
  811. package/dist/v2/patterns/FormikSelect.js.map +1 -1
  812. package/dist/v2/patterns/FormikTextarea.d.ts +9 -1
  813. package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
  814. package/dist/v2/patterns/FormikTextarea.js +35 -48
  815. package/dist/v2/patterns/FormikTextarea.js.map +1 -1
  816. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +14 -1
  817. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
  818. package/dist/v2/patterns/KeyboardShortcutsHelp.js +71 -74
  819. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  820. package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
  821. package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
  822. package/dist/v2/patterns/PageContent.js +17 -20
  823. package/dist/v2/patterns/PageContent.js.map +1 -1
  824. package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
  825. package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
  826. package/dist/v2/patterns/PreviewDrawer.js +159 -0
  827. package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
  828. package/dist/v2/patterns/ReferentielField.d.ts +86 -2
  829. package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
  830. package/dist/v2/patterns/ReferentielField.js +347 -327
  831. package/dist/v2/patterns/ReferentielField.js.map +1 -1
  832. package/dist/v2/patterns/RowFavoriteToggle.d.ts +98 -0
  833. package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -0
  834. package/dist/v2/patterns/RowFavoriteToggle.js +135 -0
  835. package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -0
  836. package/dist/v2/patterns/SaveFilterDialog.js +50 -77
  837. package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
  838. package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
  839. package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
  840. package/dist/v2/patterns/SkeletonPageShell.js +122 -143
  841. package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
  842. package/dist/v2/patterns/SortableHeader.js +35 -57
  843. package/dist/v2/patterns/SortableHeader.js.map +1 -1
  844. package/dist/v2/patterns/Tour.js +121 -142
  845. package/dist/v2/patterns/Tour.js.map +1 -1
  846. package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
  847. package/dist/v2/patterns/_dataGridShared.js +131 -147
  848. package/dist/v2/patterns/_dataGridShared.js.map +1 -1
  849. package/dist/v2/patterns/_pickerSerialisation.d.ts +44 -0
  850. package/dist/v2/patterns/_pickerSerialisation.d.ts.map +1 -0
  851. package/dist/v2/patterns/_pickerSerialisation.js +80 -0
  852. package/dist/v2/patterns/_pickerSerialisation.js.map +1 -0
  853. package/dist/v2/patterns/_sort.js +17 -33
  854. package/dist/v2/patterns/_sort.js.map +1 -1
  855. package/dist/v2/patterns/_useColumnReorder.js +124 -163
  856. package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
  857. package/dist/v2/patterns/_useColumnResize.js +80 -99
  858. package/dist/v2/patterns/_useColumnResize.js.map +1 -1
  859. package/dist/v2/patterns/filterCriteria.d.ts +78 -0
  860. package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
  861. package/dist/v2/patterns/filterCriteria.js +110 -0
  862. package/dist/v2/patterns/filterCriteria.js.map +1 -0
  863. package/dist/v2/patterns/index.d.ts +247 -0
  864. package/dist/v2/patterns/index.d.ts.map +1 -1
  865. package/dist/v2/patterns/index.js +182 -70
  866. package/dist/v2/patterns/index.js.map +1 -1
  867. package/dist/v2/patterns/rowActions.d.ts +150 -0
  868. package/dist/v2/patterns/rowActions.d.ts.map +1 -0
  869. package/dist/v2/patterns/rowActions.js +232 -0
  870. package/dist/v2/patterns/rowActions.js.map +1 -0
  871. package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
  872. package/dist/v2/personalization/PersonalizationProvider.js +57 -53
  873. package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
  874. package/dist/v2/personalization/adapters/_storageKey.js +5 -5
  875. package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
  876. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
  877. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  878. package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
  879. package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  880. package/dist/v2/personalization/adapters/index.js +5 -5
  881. package/dist/v2/personalization/adapters/index.js.map +1 -1
  882. package/dist/v2/personalization/capabilities/favorites.js +39 -62
  883. package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
  884. package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
  885. package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
  886. package/dist/v2/personalization/capabilities/gridPreferences.d.ts +100 -0
  887. package/dist/v2/personalization/capabilities/gridPreferences.d.ts.map +1 -0
  888. package/dist/v2/personalization/capabilities/gridPreferences.js +210 -0
  889. package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -0
  890. package/dist/v2/personalization/capabilities/index.d.ts +6 -0
  891. package/dist/v2/personalization/capabilities/index.d.ts.map +1 -1
  892. package/dist/v2/personalization/capabilities/index.js +23 -10
  893. package/dist/v2/personalization/capabilities/index.js.map +1 -1
  894. package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
  895. package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
  896. package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
  897. package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
  898. package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
  899. package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
  900. package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
  901. package/dist/v2/personalization/createPersonalizationStore.js +81 -182
  902. package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
  903. package/dist/v2/personalization/index.d.ts +34 -0
  904. package/dist/v2/personalization/index.d.ts.map +1 -1
  905. package/dist/v2/personalization/index.js +41 -21
  906. package/dist/v2/personalization/index.js.map +1 -1
  907. package/dist/v2/personalization/personalizationContext.js +10 -12
  908. package/dist/v2/personalization/personalizationContext.js.map +1 -1
  909. package/dist/v2/personalization/schema.js +8 -9
  910. package/dist/v2/personalization/schema.js.map +1 -1
  911. package/dist/v2/referentiel/ReferentielProvider.js +31 -45
  912. package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
  913. package/dist/v2/referentiel/index.js +11 -13
  914. package/dist/v2/referentiel/index.js.map +1 -1
  915. package/dist/v2/referentiel/types.d.ts +105 -0
  916. package/dist/v2/referentiel/types.d.ts.map +1 -0
  917. package/dist/v2/referentiel/types.js +6 -0
  918. package/dist/v2/referentiel/types.js.map +1 -0
  919. package/dist/v2/referentiel/useReferentielClient.js +13 -16
  920. package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
  921. package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
  922. package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
  923. package/dist/v2/referentiel/useReferentielOptions.js +63 -120
  924. package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
  925. package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
  926. package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
  927. package/dist/v2/referentiel/useReferentielSearch.js +40 -95
  928. package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
  929. package/dist/v2/theme/_brand.js +12 -26
  930. package/dist/v2/theme/_brand.js.map +1 -1
  931. package/dist/v2/theme/_brandSecondary.js +12 -26
  932. package/dist/v2/theme/_brandSecondary.js.map +1 -1
  933. package/dist/v2/theme/createPortnetTheme.js +41 -49
  934. package/dist/v2/theme/createPortnetTheme.js.map +1 -1
  935. package/dist/v2/theme/cssVariables.d.ts +3 -3
  936. package/dist/v2/theme/cssVariables.d.ts.map +1 -1
  937. package/dist/v2/theme/cssVariables.js +65 -70
  938. package/dist/v2/theme/cssVariables.js.map +1 -1
  939. package/dist/v2/theme/index.js +10 -10
  940. package/dist/v2/theme/index.js.map +1 -1
  941. package/dist/v2/tokens/breakpoints.js +16 -16
  942. package/dist/v2/tokens/breakpoints.js.map +1 -1
  943. package/dist/v2/tokens/chart.d.ts +103 -0
  944. package/dist/v2/tokens/chart.d.ts.map +1 -0
  945. package/dist/v2/tokens/chart.js +270 -0
  946. package/dist/v2/tokens/chart.js.map +1 -0
  947. package/dist/v2/tokens/colors.js +24 -24
  948. package/dist/v2/tokens/colors.js.map +1 -1
  949. package/dist/v2/tokens/density.d.ts +104 -0
  950. package/dist/v2/tokens/density.d.ts.map +1 -1
  951. package/dist/v2/tokens/density.js +67 -12
  952. package/dist/v2/tokens/density.js.map +1 -1
  953. package/dist/v2/tokens/index.d.ts +50 -1
  954. package/dist/v2/tokens/index.d.ts.map +1 -1
  955. package/dist/v2/tokens/index.js +116 -68
  956. package/dist/v2/tokens/index.js.map +1 -1
  957. package/dist/v2/tokens/motion.js +16 -22
  958. package/dist/v2/tokens/motion.js.map +1 -1
  959. package/dist/v2/tokens/radius.js +3 -3
  960. package/dist/v2/tokens/radius.js.map +1 -1
  961. package/dist/v2/tokens/shadows.js +8 -8
  962. package/dist/v2/tokens/shadows.js.map +1 -1
  963. package/dist/v2/tokens/spacing.js +4 -4
  964. package/dist/v2/tokens/spacing.js.map +1 -1
  965. package/dist/v2/tokens/state.js +3 -3
  966. package/dist/v2/tokens/state.js.map +1 -1
  967. package/dist/v2/tokens/statusPalette.js +21 -23
  968. package/dist/v2/tokens/statusPalette.js.map +1 -1
  969. package/dist/v2/tokens/tokens.json +6 -1
  970. package/dist/v2/tokens/typography.js +15 -15
  971. package/dist/v2/tokens/typography.js.map +1 -1
  972. package/dist/v2/tokens/zIndex.js +3 -3
  973. package/dist/v2/tokens/zIndex.js.map +1 -1
  974. package/dist/v2/types/datagrid.d.ts +9 -1
  975. package/dist/v2/types/datagrid.d.ts.map +1 -1
  976. package/dist/v2/types/datagrid.js.map +1 -1
  977. package/dist/v2/types/index.js +2 -2
  978. package/dist/v2/types/index.js.map +1 -1
  979. package/dist/v2/utils/apiError.js +16 -37
  980. package/dist/v2/utils/apiError.js.map +1 -1
  981. package/dist/v2/utils/contrast.js +31 -32
  982. package/dist/v2/utils/contrast.js.map +1 -1
  983. package/dist/v2/utils/cx.js +7 -27
  984. package/dist/v2/utils/cx.js.map +1 -1
  985. package/dist/v2/utils/fileDownload.js +25 -28
  986. package/dist/v2/utils/fileDownload.js.map +1 -1
  987. package/dist/v2/utils/fileValidation.d.ts +116 -0
  988. package/dist/v2/utils/fileValidation.d.ts.map +1 -0
  989. package/dist/v2/utils/fileValidation.js +220 -0
  990. package/dist/v2/utils/fileValidation.js.map +1 -0
  991. package/dist/v2/utils/fmtDate.d.ts +103 -0
  992. package/dist/v2/utils/fmtDate.d.ts.map +1 -0
  993. package/dist/v2/utils/fmtDate.js +119 -0
  994. package/dist/v2/utils/fmtDate.js.map +1 -0
  995. package/dist/v2/utils/fmtMoney.d.ts +3 -3
  996. package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
  997. package/dist/v2/utils/fmtMoney.js +9 -11
  998. package/dist/v2/utils/fmtMoney.js.map +1 -1
  999. package/dist/v2/utils/formikErrors.d.ts +67 -0
  1000. package/dist/v2/utils/formikErrors.d.ts.map +1 -0
  1001. package/dist/v2/utils/formikErrors.js +85 -0
  1002. package/dist/v2/utils/formikErrors.js.map +1 -0
  1003. package/dist/v2/utils/index.d.ts +5 -0
  1004. package/dist/v2/utils/index.d.ts.map +1 -1
  1005. package/dist/v2/utils/index.js +67 -18
  1006. package/dist/v2/utils/index.js.map +1 -1
  1007. package/dist/v2/utils/mergeLabels.js +9 -14
  1008. package/dist/v2/utils/mergeLabels.js.map +1 -1
  1009. package/dist/v2/utils/networkStatus.js +14 -14
  1010. package/dist/v2/utils/networkStatus.js.map +1 -1
  1011. package/package.json +26 -9
@@ -1,10 +1,72 @@
1
1
  export { default as useFocusTrap } from "./useFocusTrap";
2
+ /**
3
+ * Raccourcis clavier de page — l'autre moitié de `KeyboardShortcutsHelp`
4
+ * (gap G-48).
5
+ *
6
+ * La library possédait les DEUX BOUTS et pas l'écouteur entre eux : le
7
+ * dialogue « ? » qui LISTE les raccourcis, et l'attribut
8
+ * `data-v2-overlay-open` qu'elle POSE sur le `body` et que les raccourcis
9
+ * doivent respecter.
10
+ *
11
+ * Un hôte qui les câblait devait donc lire cet attribut lui-même — un module
12
+ * dépendant d'un détail d'implémentation du composant qu'il rend, et qui
13
+ * casserait EN SILENCE s'il était renommé : les raccourcis se mettraient à
14
+ * tirer derrière les modales ouvertes, ce que rien ne teste.
15
+ *
16
+ * Relevé depuis `addm-fe` (Area 14), dont les listings portaient un
17
+ * `searchInputRef` déclaré et transmis POUR le raccourci « / » — un câblage
18
+ * qui attendait un écouteur jamais écrit.
19
+ */
20
+ export { default as useKeyboardShortcuts } from "./useKeyboardShortcuts";
2
21
  export { default as useTabLoading, PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
3
22
  export { default as useDelayedFlag } from "./useDelayedFlag";
23
+ /**
24
+ * Defers a CALL until the input settles — the companion `useDelayedFlag` is
25
+ * not: that one flips a boolean after a delay. Gap G-39; see the file header
26
+ * for the three defects the `lodash.debounce` era produced in every host.
27
+ */
28
+ export { default as useDebouncedCallback } from "./useDebouncedCallback";
29
+ /**
30
+ * Tracks the criteria ACTUALLY applied to a listing (gap G-43), so chips
31
+ * cannot announce a filter that is only being typed. Companion to
32
+ * `buildFilterChips`. Promoted from `refonte-frontend` (Area 5).
33
+ */
34
+ export { default as useAppliedFilters } from "./useAppliedFilters";
35
+ /**
36
+ * Runtime read of `prefers-reduced-motion` (gap G-49), for animation the
37
+ * library does not own — charts, canvases, imperative scroll, third-party
38
+ * widgets configured in JS. CSS cannot answer those, so every host wrote the
39
+ * same one-line snapshot helper, which never subscribed: turning the
40
+ * preference on left the animations running. See the file header.
41
+ */
42
+ export { default as usePrefersReducedMotion } from "./usePrefersReducedMotion";
43
+ export { PREFERS_REDUCED_MOTION_QUERY } from "./usePrefersReducedMotion";
4
44
  export { default as useDensity } from "./useDensity";
5
45
  export { default as useResolvedDensity } from "./useResolvedDensity";
6
46
  export { default as useSortedRows } from "./useSortedRows";
7
47
  export { default as useFormAutoSave } from "./useFormAutoSave";
8
48
  export { default as useFormCompletionProgress } from "./useFormCompletionProgress";
9
49
  export { default as useFocusFirstError, focusFieldByName } from "./useFocusFirstError";
50
+ /**
51
+ * Déplace le focus sur le landmark principal à chaque changement de PAGE
52
+ * (gap G-60).
53
+ *
54
+ * Dans une application à page unique, naviguer ne déplace PAS le focus — le
55
+ * navigateur ne le fait qu'au chargement d'un vrai document. Le focus reste
56
+ * donc sur ce qui a été cliqué, ou tombe sur `document.body` quand cet élément
57
+ * est démonté par la navigation qu'il vient de déclencher. Depuis `body`, le
58
+ * Tab suivant repart du haut du NAVIGATEUR : l'utilisateur au clavier retraverse
59
+ * la barre d'adresse à chaque écran, et le lecteur d'écran n'annonce rien.
60
+ *
61
+ * Agnostique du routeur : l'hôte passe la clé qu'il veut surveiller — et doit
62
+ * passer le CHEMIN, pas `location.key`, sinon un changement de filtre dans la
63
+ * query string vole le focus au champ en cours de saisie.
64
+ *
65
+ * La library est le bon endroit même sans connaître de routeur : `AppMain` est
66
+ * la cible, et c'est lui qui porte le `tabIndex={-1}` qui rend la région
67
+ * focalisable. Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 10),
68
+ * où archiver un dossier ferme un dialogue et navigue en arrière — le piège de
69
+ * focus restituant alors le focus à un bouton qui n'existe plus.
70
+ */
71
+ export { default as useFocusOnRouteChange } from "./useFocusOnRouteChange";
10
72
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","useFocusTrap","useTabLoading","PERCEPTION_THRESHOLD_MS","useDelayedFlag","useDensity","useResolvedDensity","useSortedRows","useFormAutoSave","useFormCompletionProgress","useFocusFirstError","focusFieldByName"],"sources":["../../../../src/lib/v2/hooks/index.ts"],"sourcesContent":["export { default as useFocusTrap } from \"./useFocusTrap\";\r\nexport {\r\n default as useTabLoading,\r\n PERCEPTION_THRESHOLD_MS,\r\n} from \"./useTabLoading\";\r\nexport { default as useDelayedFlag } from \"./useDelayedFlag\";\r\nexport { default as useDensity } from \"./useDensity\";\r\nexport { default as useResolvedDensity } from \"./useResolvedDensity\";\r\nexport { default as useSortedRows } from \"./useSortedRows\";\r\nexport { default as useFormAutoSave } from \"./useFormAutoSave\";\r\nexport { default as useFormCompletionProgress } from \"./useFormCompletionProgress\";\r\nexport {\r\n default as useFocusFirstError,\r\n focusFieldByName,\r\n} from \"./useFocusFirstError\";\r\nexport type {\r\n FocusFieldOptions,\r\n UseFocusFirstErrorOptions,\r\n} from \"./useFocusFirstError\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,YAAY,QAAQ,gBAAgB;AACxD,SACED,OAAO,IAAIE,aAAa,EACxBC,uBAAuB,QAClB,iBAAiB;AACxB,SAASH,OAAO,IAAII,cAAc,QAAQ,kBAAkB;AAC5D,SAASJ,OAAO,IAAIK,UAAU,QAAQ,cAAc;AACpD,SAASL,OAAO,IAAIM,kBAAkB,QAAQ,sBAAsB;AACpE,SAASN,OAAO,IAAIO,aAAa,QAAQ,iBAAiB;AAC1D,SAASP,OAAO,IAAIQ,eAAe,QAAQ,mBAAmB;AAC9D,SAASR,OAAO,IAAIS,yBAAyB,QAAQ,6BAA6B;AAClF,SACET,OAAO,IAAIU,kBAAkB,EAC7BC,gBAAgB,QACX,sBAAsB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","useFocusTrap","useKeyboardShortcuts","useTabLoading","PERCEPTION_THRESHOLD_MS","useDelayedFlag","useDebouncedCallback","useAppliedFilters","usePrefersReducedMotion","PREFERS_REDUCED_MOTION_QUERY","useDensity","useResolvedDensity","useSortedRows","useFormAutoSave","useFormCompletionProgress","useFocusFirstError","focusFieldByName","useFocusOnRouteChange"],"sources":["../../../../src/lib/v2/hooks/index.ts"],"sourcesContent":["export { default as useFocusTrap } from \"./useFocusTrap\";\r\n/**\r\n * Raccourcis clavier de page — l'autre moitié de `KeyboardShortcutsHelp`\r\n * (gap G-48).\r\n *\r\n * La library possédait les DEUX BOUTS et pas l'écouteur entre eux : le\r\n * dialogue « ? » qui LISTE les raccourcis, et l'attribut\r\n * `data-v2-overlay-open` qu'elle POSE sur le `body` et que les raccourcis\r\n * doivent respecter.\r\n *\r\n * Un hôte qui les câblait devait donc lire cet attribut lui-même — un module\r\n * dépendant d'un détail d'implémentation du composant qu'il rend, et qui\r\n * casserait EN SILENCE s'il était renommé : les raccourcis se mettraient à\r\n * tirer derrière les modales ouvertes, ce que rien ne teste.\r\n *\r\n * Relevé depuis `addm-fe` (Area 14), dont les listings portaient un\r\n * `searchInputRef` déclaré et transmis POUR le raccourci « / » — un câblage\r\n * qui attendait un écouteur jamais écrit.\r\n */\r\nexport { default as useKeyboardShortcuts } from \"./useKeyboardShortcuts\";\r\nexport type {\r\n KeyboardShortcut,\r\n UseKeyboardShortcutsOptions,\r\n} from \"./useKeyboardShortcuts\";\r\nexport {\r\n default as useTabLoading,\r\n PERCEPTION_THRESHOLD_MS,\r\n} from \"./useTabLoading\";\r\nexport { default as useDelayedFlag } from \"./useDelayedFlag\";\r\n/**\r\n * Defers a CALL until the input settles — the companion `useDelayedFlag` is\r\n * not: that one flips a boolean after a delay. Gap G-39; see the file header\r\n * for the three defects the `lodash.debounce` era produced in every host.\r\n */\r\nexport { default as useDebouncedCallback } from \"./useDebouncedCallback\";\r\n/**\r\n * Tracks the criteria ACTUALLY applied to a listing (gap G-43), so chips\r\n * cannot announce a filter that is only being typed. Companion to\r\n * `buildFilterChips`. Promoted from `refonte-frontend` (Area 5).\r\n */\r\nexport {\r\n default as useAppliedFilters,\r\n} from \"./useAppliedFilters\";\r\nexport type {\r\n AppliedFiltersForm,\r\n UseAppliedFiltersOptions,\r\n UseAppliedFiltersResult,\r\n} from \"./useAppliedFilters\";\r\n/**\r\n * Runtime read of `prefers-reduced-motion` (gap G-49), for animation the\r\n * library does not own — charts, canvases, imperative scroll, third-party\r\n * widgets configured in JS. CSS cannot answer those, so every host wrote the\r\n * same one-line snapshot helper, which never subscribed: turning the\r\n * preference on left the animations running. See the file header.\r\n */\r\nexport { default as usePrefersReducedMotion } from \"./usePrefersReducedMotion\";\r\nexport { PREFERS_REDUCED_MOTION_QUERY } from \"./usePrefersReducedMotion\";\r\nexport { default as useDensity } from \"./useDensity\";\r\nexport { default as useResolvedDensity } from \"./useResolvedDensity\";\r\nexport { default as useSortedRows } from \"./useSortedRows\";\r\nexport { default as useFormAutoSave } from \"./useFormAutoSave\";\r\nexport { default as useFormCompletionProgress } from \"./useFormCompletionProgress\";\r\nexport {\r\n default as useFocusFirstError,\r\n focusFieldByName,\r\n} from \"./useFocusFirstError\";\r\nexport type {\r\n FocusFieldOptions,\r\n UseFocusFirstErrorOptions,\r\n} from \"./useFocusFirstError\";\r\n/**\r\n * Déplace le focus sur le landmark principal à chaque changement de PAGE\r\n * (gap G-60).\r\n *\r\n * Dans une application à page unique, naviguer ne déplace PAS le focus — le\r\n * navigateur ne le fait qu'au chargement d'un vrai document. Le focus reste\r\n * donc sur ce qui a été cliqué, ou tombe sur `document.body` quand cet élément\r\n * est démonté par la navigation qu'il vient de déclencher. Depuis `body`, le\r\n * Tab suivant repart du haut du NAVIGATEUR : l'utilisateur au clavier retraverse\r\n * la barre d'adresse à chaque écran, et le lecteur d'écran n'annonce rien.\r\n *\r\n * Agnostique du routeur : l'hôte passe la clé qu'il veut surveiller — et doit\r\n * passer le CHEMIN, pas `location.key`, sinon un changement de filtre dans la\r\n * query string vole le focus au champ en cours de saisie.\r\n *\r\n * La library est le bon endroit même sans connaître de routeur : `AppMain` est\r\n * la cible, et c'est lui qui porte le `tabIndex={-1}` qui rend la région\r\n * focalisable. Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 10),\r\n * où archiver un dossier ferme un dialogue et navigue en arrière — le piège de\r\n * focus restituant alors le focus à un bouton qui n'existe plus.\r\n */\r\nexport { default as useFocusOnRouteChange } from \"./useFocusOnRouteChange\";\r\nexport type { UseFocusOnRouteChangeOptions } from \"./useFocusOnRouteChange\";\r\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,YAAY,QAAQ,gBAAgB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASD,OAAO,IAAIE,oBAAoB,QAAQ,wBAAwB;AAKxE,SACEF,OAAO,IAAIG,aAAa,EACxBC,uBAAuB,QAClB,iBAAiB;AACxB,SAASJ,OAAO,IAAIK,cAAc,QAAQ,kBAAkB;AAC5D;AACA;AACA;AACA;AACA;AACA,SAASL,OAAO,IAAIM,oBAAoB,QAAQ,wBAAwB;AACxE;AACA;AACA;AACA;AACA;AACA,SACEN,OAAO,IAAIO,iBAAiB,QACvB,qBAAqB;AAM5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASP,OAAO,IAAIQ,uBAAuB,QAAQ,2BAA2B;AAC9E,SAASC,4BAA4B,QAAQ,2BAA2B;AACxE,SAAST,OAAO,IAAIU,UAAU,QAAQ,cAAc;AACpD,SAASV,OAAO,IAAIW,kBAAkB,QAAQ,sBAAsB;AACpE,SAASX,OAAO,IAAIY,aAAa,QAAQ,iBAAiB;AAC1D,SAASZ,OAAO,IAAIa,eAAe,QAAQ,mBAAmB;AAC9D,SAASb,OAAO,IAAIc,yBAAyB,QAAQ,6BAA6B;AAClF,SACEd,OAAO,IAAIe,kBAAkB,EAC7BC,gBAAgB,QACX,sBAAsB;AAK7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAShB,OAAO,IAAIiB,qBAAqB,QAAQ,yBAAyB","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ import { useState } from "react";
2
+
3
+ /**
4
+ * useAppliedFilters — tracks the criteria ACTUALLY applied to a listing
5
+ * (capability gap G-43).
6
+ *
7
+ * Companion to `buildFilterChips`: that one builds the chips, this one decides
8
+ * what they are allowed to show.
9
+ *
10
+ * ─────────────────────────────────────────────────────────────────────────────
11
+ * THE DEFECT IT PREVENTS — AND IT WAS SHIPPED TWICE BEFORE BEING UNDERSTOOD
12
+ *
13
+ * Chips CANNOT be built from live form values. `DataGridToolbar`'s search input
14
+ * writes into them ON EVERY KEYSTROKE, so a chip "Référence : ABC" appears
15
+ * while the user is still typing — announcing an active criterion that filters
16
+ * nothing. Active criteria are the ones filtering the DISPLAYED list.
17
+ *
18
+ * Two distinct states are therefore required, and the split is counter-intuitive
19
+ * enough that it was got wrong twice: form values track TYPING, this snapshot
20
+ * tracks APPLICATION.
21
+ *
22
+ * The mirror-image defect is just as real: a snapshot left full after a "clear
23
+ * criteria" shows chips for criteria that no longer filter anything. Both
24
+ * failures are one forgotten line away, in opposite directions — which is the
25
+ * argument for one hook rather than three lines per screen.
26
+ * ─────────────────────────────────────────────────────────────────────────────
27
+ *
28
+ * IT BUILDS NO PAYLOAD. Every screen has its own — key names, scope flags, page
29
+ * value — and `onRemove` hands the turn back with the REMAINING criteria. This
30
+ * hook knows only the cycle typing → application → removal.
31
+ *
32
+ * `setApplied`: THE THREE PATHS THAT BYPASS `apply()`. The snapshot is not only
33
+ * filled by a click on "Search". Three other gestures change what actually
34
+ * filters the list, and each one used to leave the chips lying:
35
+ *
36
+ * 1. RESTORING A SAVED FILTER. `SavedFiltersMenu` re-injects values and
37
+ * payload: the list is filtered, the snapshot stays empty, so NO chip
38
+ * appears. Observed on a real screen before this existed.
39
+ * 2. CLICKING A STATUS CHIP. Screens with `FilterTab` write the payload
40
+ * directly — on purpose, to avoid the async `setFieldValue` followed by a
41
+ * submit that reads the previous render's values. Without updating the
42
+ * snapshot, a later chip removal rebuilds the payload from a stale
43
+ * snapshot and LOSES the active status.
44
+ * 3. Any other direct payload write by the screen.
45
+ *
46
+ * Hence a function that SETS the snapshot, distinct from the one that freezes it
47
+ * from the form. The screen alone knows when what-filters has changed; the hook
48
+ * cannot guess it.
49
+ *
50
+ * Promoted from `refonte-frontend` (Area 5), where three listings consumed it.
51
+ *
52
+ * WHAT WAS NOT PROMOTED WITH IT. The original exported a ready-made
53
+ * `videAvecMiroirsNumeriques` helper — "id mirrors clear to `0`, everything
54
+ * else to `""`" — and a measurement of its call sites found NONE: the three
55
+ * hosts each passed their own inline strategy, and they disagree (`0` / `null`
56
+ * / `""`, per field). Codifying one of the three as the library's convention
57
+ * would have blessed a rule no host follows, and the disagreement is exactly
58
+ * why `emptyValueFor` is a parameter rather than a constant.
59
+ */
60
+
61
+ /** What a search form must expose to this hook — Formik satisfies it. */
62
+
63
+ /**
64
+ * Explicit return type: §Hooks requires it ("Every hook must expose explicit
65
+ * return types"), and inference left this surface implicit while four screens
66
+ * consumed it.
67
+ */
68
+
69
+ export default function useAppliedFilters(form, options) {
70
+ const [appliedFilters, setAppliedFilters] = useState({});
71
+ const empty = options.emptyValueFor ?? (() => null);
72
+ return {
73
+ appliedFilters,
74
+ apply: () => {
75
+ setAppliedFilters({
76
+ ...form.values
77
+ });
78
+ options.onApply();
79
+ },
80
+ resetAll: () => {
81
+ setAppliedFilters({});
82
+ options.onReset();
83
+ },
84
+ /**
85
+ * Clears the fields and the snapshot, then hands the turn back so the
86
+ * screen can rebuild its payload.
87
+ *
88
+ * The payload is rebuilt from the AMPUTATED SNAPSHOT, never re-read from
89
+ * the form afterwards: `setFieldValue` is asynchronous, so reading values
90
+ * back would give the criteria as they were BEFORE the removal.
91
+ */
92
+ removeCriteria: keys => {
93
+ keys.forEach(key => {
94
+ void form.setFieldValue(key, empty(key));
95
+ });
96
+ const remaining = {
97
+ ...appliedFilters
98
+ };
99
+ keys.forEach(key => {
100
+ remaining[key] = empty(key);
101
+ });
102
+ setAppliedFilters(remaining);
103
+ options.onRemove(remaining);
104
+ },
105
+ setApplied: values => {
106
+ setAppliedFilters({
107
+ ...values
108
+ });
109
+ }
110
+ };
111
+ }
112
+ //# sourceMappingURL=useAppliedFilters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppliedFilters.js","names":["useState","useAppliedFilters","form","options","appliedFilters","setAppliedFilters","empty","emptyValueFor","apply","values","onApply","resetAll","onReset","removeCriteria","keys","forEach","key","setFieldValue","remaining","onRemove","setApplied"],"sources":["../../../../src/lib/v2/hooks/useAppliedFilters.ts"],"sourcesContent":["import { useState } from \"react\";\r\n\r\n/**\r\n * useAppliedFilters — tracks the criteria ACTUALLY applied to a listing\r\n * (capability gap G-43).\r\n *\r\n * Companion to `buildFilterChips`: that one builds the chips, this one decides\r\n * what they are allowed to show.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * THE DEFECT IT PREVENTS — AND IT WAS SHIPPED TWICE BEFORE BEING UNDERSTOOD\r\n *\r\n * Chips CANNOT be built from live form values. `DataGridToolbar`'s search input\r\n * writes into them ON EVERY KEYSTROKE, so a chip \"Référence : ABC\" appears\r\n * while the user is still typing — announcing an active criterion that filters\r\n * nothing. Active criteria are the ones filtering the DISPLAYED list.\r\n *\r\n * Two distinct states are therefore required, and the split is counter-intuitive\r\n * enough that it was got wrong twice: form values track TYPING, this snapshot\r\n * tracks APPLICATION.\r\n *\r\n * The mirror-image defect is just as real: a snapshot left full after a \"clear\r\n * criteria\" shows chips for criteria that no longer filter anything. Both\r\n * failures are one forgotten line away, in opposite directions — which is the\r\n * argument for one hook rather than three lines per screen.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * IT BUILDS NO PAYLOAD. Every screen has its own — key names, scope flags, page\r\n * value — and `onRemove` hands the turn back with the REMAINING criteria. This\r\n * hook knows only the cycle typing → application → removal.\r\n *\r\n * `setApplied`: THE THREE PATHS THAT BYPASS `apply()`. The snapshot is not only\r\n * filled by a click on \"Search\". Three other gestures change what actually\r\n * filters the list, and each one used to leave the chips lying:\r\n *\r\n * 1. RESTORING A SAVED FILTER. `SavedFiltersMenu` re-injects values and\r\n * payload: the list is filtered, the snapshot stays empty, so NO chip\r\n * appears. Observed on a real screen before this existed.\r\n * 2. CLICKING A STATUS CHIP. Screens with `FilterTab` write the payload\r\n * directly — on purpose, to avoid the async `setFieldValue` followed by a\r\n * submit that reads the previous render's values. Without updating the\r\n * snapshot, a later chip removal rebuilds the payload from a stale\r\n * snapshot and LOSES the active status.\r\n * 3. Any other direct payload write by the screen.\r\n *\r\n * Hence a function that SETS the snapshot, distinct from the one that freezes it\r\n * from the form. The screen alone knows when what-filters has changed; the hook\r\n * cannot guess it.\r\n *\r\n * Promoted from `refonte-frontend` (Area 5), where three listings consumed it.\r\n *\r\n * WHAT WAS NOT PROMOTED WITH IT. The original exported a ready-made\r\n * `videAvecMiroirsNumeriques` helper — \"id mirrors clear to `0`, everything\r\n * else to `\"\"`\" — and a measurement of its call sites found NONE: the three\r\n * hosts each passed their own inline strategy, and they disagree (`0` / `null`\r\n * / `\"\"`, per field). Codifying one of the three as the library's convention\r\n * would have blessed a rule no host follows, and the disagreement is exactly\r\n * why `emptyValueFor` is a parameter rather than a constant.\r\n */\r\n\r\n/** What a search form must expose to this hook — Formik satisfies it. */\r\nexport interface AppliedFiltersForm {\r\n values: Record<string, unknown>;\r\n setFieldValue: (\r\n field: string,\r\n value: unknown,\r\n shouldValidate?: boolean\r\n ) => unknown;\r\n}\r\n\r\nexport interface UseAppliedFiltersOptions {\r\n /** Applies the current search (the screen's existing function). */\r\n onApply: () => void;\r\n /** Resets the search (the screen's existing function). */\r\n onReset: () => void;\r\n /**\r\n * Rebuilds and re-runs the payload after a removal, from the REMAINING\r\n * criteria. Only the screen knows the shape of its payload.\r\n */\r\n onRemove: (remaining: Record<string, unknown>) => void;\r\n /**\r\n * The value that means \"empty\" for a given field. Hosts disagree, and the\r\n * disagreement is legitimate: some clear to `null`, others to `\"\"`, and\r\n * reference-id mirrors to `0`. A convention imposed here would have broken\r\n * half the payloads. @default `null`\r\n */\r\n emptyValueFor?: ((key: string) => unknown) | undefined;\r\n}\r\n\r\n/**\r\n * Explicit return type: §Hooks requires it (\"Every hook must expose explicit\r\n * return types\"), and inference left this surface implicit while four screens\r\n * consumed it.\r\n */\r\nexport interface UseAppliedFiltersResult {\r\n /** Criteria ACTUALLY applied to the displayed list. */\r\n appliedFilters: Record<string, unknown>;\r\n /** Freezes the snapshot from the form, then runs the screen's search. */\r\n apply: () => void;\r\n /** Clears the snapshot, then resets the screen. */\r\n resetAll: () => void;\r\n /** Removes one or more criteria and hands the turn back to `onRemove`. */\r\n removeCriteria: (keys: string[]) => void;\r\n /**\r\n * Sets the snapshot from values SUPPLIED by the screen, for the three paths\r\n * that bypass `apply` — see the note above.\r\n */\r\n setApplied: (values: Record<string, unknown>) => void;\r\n}\r\n\r\nexport default function useAppliedFilters(\r\n form: AppliedFiltersForm,\r\n options: UseAppliedFiltersOptions\r\n): UseAppliedFiltersResult {\r\n const [appliedFilters, setAppliedFilters] = useState<Record<string, unknown>>(\r\n {}\r\n );\r\n\r\n const empty = options.emptyValueFor ?? (() => null);\r\n\r\n return {\r\n appliedFilters,\r\n\r\n apply: () => {\r\n setAppliedFilters({ ...form.values });\r\n options.onApply();\r\n },\r\n\r\n resetAll: () => {\r\n setAppliedFilters({});\r\n options.onReset();\r\n },\r\n\r\n /**\r\n * Clears the fields and the snapshot, then hands the turn back so the\r\n * screen can rebuild its payload.\r\n *\r\n * The payload is rebuilt from the AMPUTATED SNAPSHOT, never re-read from\r\n * the form afterwards: `setFieldValue` is asynchronous, so reading values\r\n * back would give the criteria as they were BEFORE the removal.\r\n */\r\n removeCriteria: (keys: string[]) => {\r\n keys.forEach((key) => {\r\n void form.setFieldValue(key, empty(key));\r\n });\r\n const remaining: Record<string, unknown> = { ...appliedFilters };\r\n keys.forEach((key) => {\r\n remaining[key] = empty(key);\r\n });\r\n setAppliedFilters(remaining);\r\n options.onRemove(remaining);\r\n },\r\n\r\n setApplied: (values: Record<string, unknown>) => {\r\n setAppliedFilters({ ...values });\r\n },\r\n };\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,OAAO;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AA6BA;AACA;AACA;AACA;AACA;;AAiBA,eAAe,SAASC,iBAAiBA,CACvCC,IAAwB,EACxBC,OAAiC,EACR;EACzB,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGL,QAAQ,CAClD,CAAC,CACH,CAAC;EAED,MAAMM,KAAK,GAAGH,OAAO,CAACI,aAAa,KAAK,MAAM,IAAI,CAAC;EAEnD,OAAO;IACLH,cAAc;IAEdI,KAAK,EAAEA,CAAA,KAAM;MACXH,iBAAiB,CAAC;QAAE,GAAGH,IAAI,CAACO;MAAO,CAAC,CAAC;MACrCN,OAAO,CAACO,OAAO,CAAC,CAAC;IACnB,CAAC;IAEDC,QAAQ,EAAEA,CAAA,KAAM;MACdN,iBAAiB,CAAC,CAAC,CAAC,CAAC;MACrBF,OAAO,CAACS,OAAO,CAAC,CAAC;IACnB,CAAC;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;IACIC,cAAc,EAAGC,IAAc,IAAK;MAClCA,IAAI,CAACC,OAAO,CAAEC,GAAG,IAAK;QACpB,KAAKd,IAAI,CAACe,aAAa,CAACD,GAAG,EAAEV,KAAK,CAACU,GAAG,CAAC,CAAC;MAC1C,CAAC,CAAC;MACF,MAAME,SAAkC,GAAG;QAAE,GAAGd;MAAe,CAAC;MAChEU,IAAI,CAACC,OAAO,CAAEC,GAAG,IAAK;QACpBE,SAAS,CAACF,GAAG,CAAC,GAAGV,KAAK,CAACU,GAAG,CAAC;MAC7B,CAAC,CAAC;MACFX,iBAAiB,CAACa,SAAS,CAAC;MAC5Bf,OAAO,CAACgB,QAAQ,CAACD,SAAS,CAAC;IAC7B,CAAC;IAEDE,UAAU,EAAGX,MAA+B,IAAK;MAC/CJ,iBAAiB,CAAC;QAAE,GAAGI;MAAO,CAAC,CAAC;IAClC;EACF,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,82 @@
1
+ import { useCallback, useEffect, useRef } from "react";
2
+
3
+ /**
4
+ * useDebouncedCallback — defer a call until the input settles
5
+ * (capability gap G-39).
6
+ *
7
+ * ─────────────────────────────────────────────────────────────────────────────
8
+ * WHY THIS BELONGS IN THE LIBRARY
9
+ *
10
+ * §Search of the Platform Mandatory UX Patterns makes "instant filtering" a
11
+ * MUST on every listing, and R-Pp/§Performance forbid paying for it with a
12
+ * request per keystroke. Between those two rules sits a debounce — needed by
13
+ * every search field, every referential lookup, every quick-filter in the
14
+ * fleet — and the library shipped `useDelayedFlag` (a boolean that turns on
15
+ * after a delay) and `useTabLoading`, neither of which defers a CALL.
16
+ *
17
+ * So each host reached for `lodash.debounce`, and the three defects that
18
+ * followed were the same everywhere. Promoted from `refonte-frontend` (Area 5),
19
+ * where its own header recorded them:
20
+ *
21
+ * 1. NO TYPES on the package (TS7016), whose two usual workarounds are both
22
+ * forbidden here — an extra dependency for ten lines, or a
23
+ * `declare module` that makes the import `any`.
24
+ * 2. THE DEBOUNCE DID NOT DEBOUNCE. `debounce(...)` was called in the render
25
+ * body, so every keystroke built a NEW instance with its own timer; the
26
+ * previous one was orphaned but still fired. The result was not
27
+ * coalescing — it was a delay applied to every character, i.e. one
28
+ * request per keystroke, arriving late.
29
+ * 3. NOTHING CANCELLED THE TIMER ON UNMOUNT, so switching tab produced a
30
+ * `setState` on an unmounted component.
31
+ *
32
+ * >>> DEFECT 2 IS WHY THIS IS A LIBRARY CONCERN AND NOT A SNIPPET. It is
33
+ * >>> invisible in review — the call site reads exactly like a correct one —
34
+ * >>> and invisible in use, because the feature still works. Only the network
35
+ * >>> panel shows it. A hook cannot be misused that way: the identity below is
36
+ * >>> stable by construction, so there is no per-render instance to orphan. <<<
37
+ * ─────────────────────────────────────────────────────────────────────────────
38
+ *
39
+ * WHY `action` GOES THROUGH A REF. Callers naturally pass an inline arrow
40
+ * (`(v) => { setPage(0); setSearch(v); }`), so its identity is new on every
41
+ * render. Holding it in a ref keeps the returned trigger STABLE — without
42
+ * which the trigger would change every render and defect 2 would be back, one
43
+ * level up — while still invoking the LATEST action rather than a stale
44
+ * closure.
45
+ *
46
+ * Only `delay` is a dependency of the returned callback. Changing it mid-flight
47
+ * does not reschedule a pending call; the next trigger uses the new delay.
48
+ *
49
+ * Usage:
50
+ *
51
+ * const onSearchChange = useDebouncedCallback<string>((value) => {
52
+ * setPage(0);
53
+ * dispatch(search(value));
54
+ * });
55
+ * <Input onChange={(e) => onSearchChange(e.target.value)} />
56
+ *
57
+ * @param action what to do once the input has settled
58
+ * @param delay milliseconds. Defaults to 500 — the value the promoted
59
+ * implementation already shipped, kept deliberately: every
60
+ * existing call site relies on the default, and lowering it here
61
+ * would silently increase the request rate of nine listings
62
+ * while looking like a tidy-up. R-1.1's 100 ms feedback promise
63
+ * is met by the field's own visual state, not by this call.
64
+ */
65
+ export default function useDebouncedCallback(action, delay = 500) {
66
+ const actionRef = useRef(action);
67
+ const timer = useRef(null);
68
+ useEffect(() => {
69
+ actionRef.current = action;
70
+ }, [action]);
71
+ useEffect(() => () => {
72
+ if (timer.current !== null) clearTimeout(timer.current);
73
+ }, []);
74
+ return useCallback(value => {
75
+ if (timer.current !== null) clearTimeout(timer.current);
76
+ timer.current = setTimeout(() => {
77
+ timer.current = null;
78
+ actionRef.current(value);
79
+ }, delay);
80
+ }, [delay]);
81
+ }
82
+ //# sourceMappingURL=useDebouncedCallback.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDebouncedCallback.js","names":["useCallback","useEffect","useRef","useDebouncedCallback","action","delay","actionRef","timer","current","clearTimeout","value","setTimeout"],"sources":["../../../../src/lib/v2/hooks/useDebouncedCallback.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * useDebouncedCallback — defer a call until the input settles\r\n * (capability gap G-39).\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY\r\n *\r\n * §Search of the Platform Mandatory UX Patterns makes \"instant filtering\" a\r\n * MUST on every listing, and R-Pp/§Performance forbid paying for it with a\r\n * request per keystroke. Between those two rules sits a debounce — needed by\r\n * every search field, every referential lookup, every quick-filter in the\r\n * fleet — and the library shipped `useDelayedFlag` (a boolean that turns on\r\n * after a delay) and `useTabLoading`, neither of which defers a CALL.\r\n *\r\n * So each host reached for `lodash.debounce`, and the three defects that\r\n * followed were the same everywhere. Promoted from `refonte-frontend` (Area 5),\r\n * where its own header recorded them:\r\n *\r\n * 1. NO TYPES on the package (TS7016), whose two usual workarounds are both\r\n * forbidden here — an extra dependency for ten lines, or a\r\n * `declare module` that makes the import `any`.\r\n * 2. THE DEBOUNCE DID NOT DEBOUNCE. `debounce(...)` was called in the render\r\n * body, so every keystroke built a NEW instance with its own timer; the\r\n * previous one was orphaned but still fired. The result was not\r\n * coalescing — it was a delay applied to every character, i.e. one\r\n * request per keystroke, arriving late.\r\n * 3. NOTHING CANCELLED THE TIMER ON UNMOUNT, so switching tab produced a\r\n * `setState` on an unmounted component.\r\n *\r\n * >>> DEFECT 2 IS WHY THIS IS A LIBRARY CONCERN AND NOT A SNIPPET. It is\r\n * >>> invisible in review — the call site reads exactly like a correct one —\r\n * >>> and invisible in use, because the feature still works. Only the network\r\n * >>> panel shows it. A hook cannot be misused that way: the identity below is\r\n * >>> stable by construction, so there is no per-render instance to orphan. <<<\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * WHY `action` GOES THROUGH A REF. Callers naturally pass an inline arrow\r\n * (`(v) => { setPage(0); setSearch(v); }`), so its identity is new on every\r\n * render. Holding it in a ref keeps the returned trigger STABLE — without\r\n * which the trigger would change every render and defect 2 would be back, one\r\n * level up — while still invoking the LATEST action rather than a stale\r\n * closure.\r\n *\r\n * Only `delay` is a dependency of the returned callback. Changing it mid-flight\r\n * does not reschedule a pending call; the next trigger uses the new delay.\r\n *\r\n * Usage:\r\n *\r\n * const onSearchChange = useDebouncedCallback<string>((value) => {\r\n * setPage(0);\r\n * dispatch(search(value));\r\n * });\r\n * <Input onChange={(e) => onSearchChange(e.target.value)} />\r\n *\r\n * @param action what to do once the input has settled\r\n * @param delay milliseconds. Defaults to 500 — the value the promoted\r\n * implementation already shipped, kept deliberately: every\r\n * existing call site relies on the default, and lowering it here\r\n * would silently increase the request rate of nine listings\r\n * while looking like a tidy-up. R-1.1's 100 ms feedback promise\r\n * is met by the field's own visual state, not by this call.\r\n */\r\nexport default function useDebouncedCallback<T>(\r\n action: (value: T) => void,\r\n delay = 500\r\n): (value: T) => void {\r\n const actionRef = useRef(action);\r\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\r\n\r\n useEffect(() => {\r\n actionRef.current = action;\r\n }, [action]);\r\n\r\n useEffect(\r\n () => () => {\r\n if (timer.current !== null) clearTimeout(timer.current);\r\n },\r\n []\r\n );\r\n\r\n return useCallback(\r\n (value: T) => {\r\n if (timer.current !== null) clearTimeout(timer.current);\r\n timer.current = setTimeout(() => {\r\n timer.current = null;\r\n actionRef.current(value);\r\n }, delay);\r\n },\r\n [delay]\r\n );\r\n}\r\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,oBAAoBA,CAC1CC,MAA0B,EAC1BC,KAAK,GAAG,GAAG,EACS;EACpB,MAAMC,SAAS,GAAGJ,MAAM,CAACE,MAAM,CAAC;EAChC,MAAMG,KAAK,GAAGL,MAAM,CAAuC,IAAI,CAAC;EAEhED,SAAS,CAAC,MAAM;IACdK,SAAS,CAACE,OAAO,GAAGJ,MAAM;EAC5B,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EAEZH,SAAS,CACP,MAAM,MAAM;IACV,IAAIM,KAAK,CAACC,OAAO,KAAK,IAAI,EAAEC,YAAY,CAACF,KAAK,CAACC,OAAO,CAAC;EACzD,CAAC,EACD,EACF,CAAC;EAED,OAAOR,WAAW,CACfU,KAAQ,IAAK;IACZ,IAAIH,KAAK,CAACC,OAAO,KAAK,IAAI,EAAEC,YAAY,CAACF,KAAK,CAACC,OAAO,CAAC;IACvDD,KAAK,CAACC,OAAO,GAAGG,UAAU,CAAC,MAAM;MAC/BJ,KAAK,CAACC,OAAO,GAAG,IAAI;MACpBF,SAAS,CAACE,OAAO,CAACE,KAAK,CAAC;IAC1B,CAAC,EAAEL,KAAK,CAAC;EACX,CAAC,EACD,CAACA,KAAK,CACR,CAAC;AACH","ignoreList":[]}
@@ -1,9 +1,3 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
1
  import { useState, useEffect } from "react";
8
2
  import { PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
9
3
 
@@ -27,13 +21,9 @@ import { PERCEPTION_THRESHOLD_MS } from "./useTabLoading";
27
21
  * (preserves across tab swap to avoid flicker between two
28
22
  * consecutive skeletons), use `useTabLoading`.
29
23
  */
30
- export default function useDelayedFlag(active) {
31
- var delayMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : PERCEPTION_THRESHOLD_MS;
32
- var _useState = useState(false),
33
- _useState2 = _slicedToArray(_useState, 2),
34
- delayed = _useState2[0],
35
- setDelayed = _useState2[1];
36
- useEffect(function () {
24
+ export default function useDelayedFlag(active, delayMs = PERCEPTION_THRESHOLD_MS) {
25
+ const [delayed, setDelayed] = useState(false);
26
+ useEffect(() => {
37
27
  if (!active) {
38
28
  // Inactive — drop any in-flight delayed flag immediately so
39
29
  // the consumer can render the success path without waiting.
@@ -43,12 +33,8 @@ export default function useDelayedFlag(active) {
43
33
  // Schedule the flag flip. If `active` resolves false before the
44
34
  // timer fires, cleanup clears the timer and the flag never goes
45
35
  // true (the perception-threshold contract).
46
- var t = setTimeout(function () {
47
- return setDelayed(true);
48
- }, delayMs);
49
- return function () {
50
- return clearTimeout(t);
51
- };
36
+ const t = setTimeout(() => setDelayed(true), delayMs);
37
+ return () => clearTimeout(t);
52
38
  }, [active, delayMs]);
53
39
  return delayed;
54
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useDelayedFlag.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useDelayedFlag","active","delayMs","arguments","length","undefined","_useState","_useState2","_slicedToArray","delayed","setDelayed","t","setTimeout","clearTimeout"],"sources":["../../../../src/lib/v2/hooks/useDelayedFlag.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport { PERCEPTION_THRESHOLD_MS } from \"./useTabLoading\";\r\n\r\n/**\r\n * useDelayedFlag — Portnet UI v2\r\n *\r\n * Returns `true` only when `active` has been continuously true for\r\n * at least `delayMs` ms. Resets to `false` the moment `active` flips\r\n * back to false. Charter R-Sk.1 — perception threshold.\r\n *\r\n * const showSkeleton = useDelayedFlag(loading);\r\n * if (showSkeleton) return <Skeleton />;\r\n * if (loading) return null; // sub-threshold, render nothing\r\n * return <Data rows={rows} />;\r\n *\r\n * Use when:\r\n * - You want to delay showing a loading affordance (skeleton,\r\n * spinner overlay, \"Loading…\" text) until the user actually\r\n * perceives the wait.\r\n * - The flag has no tab/key semantics. For tab-aware loading\r\n * (preserves across tab swap to avoid flicker between two\r\n * consecutive skeletons), use `useTabLoading`.\r\n */\r\nexport default function useDelayedFlag(\r\n active: boolean,\r\n delayMs: number = PERCEPTION_THRESHOLD_MS\r\n): boolean {\r\n const [delayed, setDelayed] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!active) {\r\n // Inactive — drop any in-flight delayed flag immediately so\r\n // the consumer can render the success path without waiting.\r\n setDelayed(false);\r\n return undefined;\r\n }\r\n // Schedule the flag flip. If `active` resolves false before the\r\n // timer fires, cleanup clears the timer and the flag never goes\r\n // true (the perception-threshold contract).\r\n const t = setTimeout(() => setDelayed(true), delayMs);\r\n return () => clearTimeout(t);\r\n }, [active, delayMs]);\r\n\r\n return delayed;\r\n}\r\n"],"mappings":";;;;;;AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,uBAAuB,QAAQ,iBAAiB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAcA,CACpCC,MAAe,EAEN;EAAA,IADTC,OAAe,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,uBAAuB;EAEzC,IAAAO,SAAA,GAA8BT,QAAQ,CAAC,KAAK,CAAC;IAAAU,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAAtCG,OAAO,GAAAF,UAAA;IAAEG,UAAU,GAAAH,UAAA;EAE1BT,SAAS,CAAC,YAAM;IACd,IAAI,CAACG,MAAM,EAAE;MACX;MACA;MACAS,UAAU,CAAC,KAAK,CAAC;MACjB,OAAOL,SAAS;IAClB;IACA;IACA;IACA;IACA,IAAMM,CAAC,GAAGC,UAAU,CAAC;MAAA,OAAMF,UAAU,CAAC,IAAI,CAAC;IAAA,GAAER,OAAO,CAAC;IACrD,OAAO;MAAA,OAAMW,YAAY,CAACF,CAAC,CAAC;IAAA;EAC9B,CAAC,EAAE,CAACV,MAAM,EAAEC,OAAO,CAAC,CAAC;EAErB,OAAOO,OAAO;AAChB","ignoreList":[]}
1
+ {"version":3,"file":"useDelayedFlag.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useDelayedFlag","active","delayMs","delayed","setDelayed","undefined","t","setTimeout","clearTimeout"],"sources":["../../../../src/lib/v2/hooks/useDelayedFlag.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport { PERCEPTION_THRESHOLD_MS } from \"./useTabLoading\";\r\n\r\n/**\r\n * useDelayedFlag — Portnet UI v2\r\n *\r\n * Returns `true` only when `active` has been continuously true for\r\n * at least `delayMs` ms. Resets to `false` the moment `active` flips\r\n * back to false. Charter R-Sk.1 — perception threshold.\r\n *\r\n * const showSkeleton = useDelayedFlag(loading);\r\n * if (showSkeleton) return <Skeleton />;\r\n * if (loading) return null; // sub-threshold, render nothing\r\n * return <Data rows={rows} />;\r\n *\r\n * Use when:\r\n * - You want to delay showing a loading affordance (skeleton,\r\n * spinner overlay, \"Loading…\" text) until the user actually\r\n * perceives the wait.\r\n * - The flag has no tab/key semantics. For tab-aware loading\r\n * (preserves across tab swap to avoid flicker between two\r\n * consecutive skeletons), use `useTabLoading`.\r\n */\r\nexport default function useDelayedFlag(\r\n active: boolean,\r\n delayMs: number = PERCEPTION_THRESHOLD_MS\r\n): boolean {\r\n const [delayed, setDelayed] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!active) {\r\n // Inactive — drop any in-flight delayed flag immediately so\r\n // the consumer can render the success path without waiting.\r\n setDelayed(false);\r\n return undefined;\r\n }\r\n // Schedule the flag flip. If `active` resolves false before the\r\n // timer fires, cleanup clears the timer and the flag never goes\r\n // true (the perception-threshold contract).\r\n const t = setTimeout(() => setDelayed(true), delayMs);\r\n return () => clearTimeout(t);\r\n }, [active, delayMs]);\r\n\r\n return delayed;\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;AAC3C,SAASC,uBAAuB,QAAQ,iBAAiB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,cAAcA,CACpCC,MAAe,EACfC,OAAe,GAAGH,uBAAuB,EAChC;EACT,MAAM,CAACI,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAAC,KAAK,CAAC;EAE7CC,SAAS,CAAC,MAAM;IACd,IAAI,CAACG,MAAM,EAAE;MACX;MACA;MACAG,UAAU,CAAC,KAAK,CAAC;MACjB,OAAOC,SAAS;IAClB;IACA;IACA;IACA;IACA,MAAMC,CAAC,GAAGC,UAAU,CAAC,MAAMH,UAAU,CAAC,IAAI,CAAC,EAAEF,OAAO,CAAC;IACrD,OAAO,MAAMM,YAAY,CAACF,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACL,MAAM,EAAEC,OAAO,CAAC,CAAC;EAErB,OAAOC,OAAO;AAChB","ignoreList":[]}
@@ -20,10 +20,10 @@ import { useSyncExternalStore } from "react";
20
20
  * storage interactions are guarded.
21
21
  */
22
22
 
23
- var STORAGE_KEY = "portnet-ui-density";
24
- var DEFAULT = "comfortable";
25
- var VALID = Object.freeze(["comfortable", "compact"]);
26
- var VALID_SET = new Set(VALID);
23
+ const STORAGE_KEY = "portnet-ui-density";
24
+ const DEFAULT = "comfortable";
25
+ const VALID = Object.freeze(["comfortable", "compact"]);
26
+ const VALID_SET = new Set(VALID);
27
27
  function isDensityPref(v) {
28
28
  return typeof v === "string" && VALID_SET.has(v);
29
29
  }
@@ -31,16 +31,16 @@ function isDensityPref(v) {
31
31
  /* ── Module-level store ───────────────────────────────── */
32
32
 
33
33
  /** Source of truth. Lazy-read from storage at module load on the client. */
34
- var memoryValue = readInitialValue();
34
+ let memoryValue = readInitialValue();
35
35
 
36
36
  /** Active hook subscribers — notified on every value change. */
37
- var subscribers = new Set();
37
+ const subscribers = new Set();
38
38
  function readInitialValue() {
39
39
  if (typeof window === "undefined") return DEFAULT;
40
40
  try {
41
- var raw = window.localStorage.getItem(STORAGE_KEY);
41
+ const raw = window.localStorage.getItem(STORAGE_KEY);
42
42
  return isDensityPref(raw) ? raw : DEFAULT;
43
- } catch (_unused) {
43
+ } catch {
44
44
  return DEFAULT;
45
45
  }
46
46
  }
@@ -55,7 +55,7 @@ applyToDom(memoryValue);
55
55
  /* Cross-tab sync. The `storage` event fires in OTHER tabs only —
56
56
  * the writing tab is informed via the in-memory subscribers path. */
57
57
  if (typeof window !== "undefined") {
58
- window.addEventListener("storage", function (e) {
58
+ window.addEventListener("storage", e => {
59
59
  if (e.key !== STORAGE_KEY) return;
60
60
  if (!isDensityPref(e.newValue)) return;
61
61
  if (e.newValue === memoryValue) return;
@@ -68,16 +68,11 @@ if (typeof window !== "undefined") {
68
68
  function notify() {
69
69
  // Iterate a snapshot — a subscriber that unmounts during notify
70
70
  // would otherwise mutate the Set under iteration.
71
- for (var _i = 0, _Array$from = Array.from(subscribers); _i < _Array$from.length; _i++) {
72
- var cb = _Array$from[_i];
73
- cb();
74
- }
71
+ for (const cb of Array.from(subscribers)) cb();
75
72
  }
76
73
  function subscribe(callback) {
77
74
  subscribers.add(callback);
78
- return function () {
79
- return subscribers["delete"](callback);
80
- };
75
+ return () => subscribers.delete(callback);
81
76
  }
82
77
  function getSnapshot() {
83
78
  return memoryValue;
@@ -104,6 +99,7 @@ function setDensityValue(value) {
104
99
  } catch (err) {
105
100
  // Quota, private mode, or sandboxed iframe — preference is
106
101
  // applied for this session but won't persist. Surface in dev.
102
+ // eslint-disable-next-line no-console
107
103
  if (typeof console !== "undefined" && console.warn) {
108
104
  // eslint-disable-next-line no-console
109
105
  console.warn("[@portnet/ui v2] useDensity: localStorage write failed", err);
@@ -113,7 +109,7 @@ function setDensityValue(value) {
113
109
  notify();
114
110
  }
115
111
  export default function useDensity() {
116
- var density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
112
+ const density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
117
113
  return [density, setDensityValue];
118
114
  }
119
115
  //# sourceMappingURL=useDensity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDensity.js","names":["useSyncExternalStore","STORAGE_KEY","DEFAULT","VALID","Object","freeze","VALID_SET","Set","isDensityPref","v","has","memoryValue","readInitialValue","subscribers","window","raw","localStorage","getItem","_unused","applyToDom","value","document","documentElement","dataset","addEventListener","e","key","newValue","notify","_i","_Array$from","Array","from","length","cb","subscribe","callback","add","getSnapshot","getServerSnapshot","setDensityValue","setItem","err","console","warn","useDensity","density"],"sources":["../../../../src/lib/v2/hooks/useDensity.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\r\n\r\n/**\r\n * useDensity — Portnet UI v2\r\n *\r\n * Reads / writes the user's density preference (charter R-DG.11).\r\n * Applies it as `data-density` on <html> so all density-aware\r\n * tokens cascade.\r\n *\r\n * const [density, setDensity] = useDensity();\r\n * <button onClick={() => setDensity(density === \"compact\" ? \"comfortable\" : \"compact\")} />\r\n *\r\n * Synchronisation guarantees\r\n * - Multi-instance same-tab: every useDensity() consumer sees\r\n * the same value at all times. Implemented via a module-level\r\n * subscriber set fed by useSyncExternalStore.\r\n * - Cross-tab: a `storage` event listener at module load\r\n * propagates updates from sibling tabs sharing the origin.\r\n * - SSR-safe: server snapshot returns the DEFAULT; all DOM and\r\n * storage interactions are guarded.\r\n */\r\n\r\ntype DensityPref = \"comfortable\" | \"compact\";\r\n\r\nconst STORAGE_KEY = \"portnet-ui-density\";\r\nconst DEFAULT: DensityPref = \"comfortable\";\r\nconst VALID = Object.freeze([\"comfortable\", \"compact\"]);\r\nconst VALID_SET = new Set<string>(VALID);\r\n\r\nfunction isDensityPref(v: unknown): v is DensityPref {\r\n return typeof v === \"string\" && VALID_SET.has(v);\r\n}\r\n\r\n/* ── Module-level store ───────────────────────────────── */\r\n\r\n/** Source of truth. Lazy-read from storage at module load on the client. */\r\nlet memoryValue: DensityPref = readInitialValue();\r\n\r\n/** Active hook subscribers — notified on every value change. */\r\nconst subscribers = new Set<() => void>();\r\n\r\nfunction readInitialValue(): DensityPref {\r\n if (typeof window === \"undefined\") return DEFAULT;\r\n try {\r\n const raw = window.localStorage.getItem(STORAGE_KEY);\r\n return isDensityPref(raw) ? raw : DEFAULT;\r\n } catch {\r\n return DEFAULT;\r\n }\r\n}\r\n\r\nfunction applyToDom(value: DensityPref): void {\r\n if (typeof document === \"undefined\") return;\r\n document.documentElement.dataset[\"density\"] = value;\r\n}\r\n\r\n/** Apply the initial value to the DOM at module load (client-side). */\r\napplyToDom(memoryValue);\r\n\r\n/* Cross-tab sync. The `storage` event fires in OTHER tabs only —\r\n * the writing tab is informed via the in-memory subscribers path. */\r\nif (typeof window !== \"undefined\") {\r\n window.addEventListener(\"storage\", (e) => {\r\n if (e.key !== STORAGE_KEY) return;\r\n if (!isDensityPref(e.newValue)) return;\r\n if (e.newValue === memoryValue) return;\r\n memoryValue = e.newValue;\r\n applyToDom(memoryValue);\r\n // No storage write here — the originating tab already wrote.\r\n notify();\r\n });\r\n}\r\n\r\nfunction notify(): void {\r\n // Iterate a snapshot — a subscriber that unmounts during notify\r\n // would otherwise mutate the Set under iteration.\r\n for (const cb of Array.from(subscribers)) cb();\r\n}\r\n\r\nfunction subscribe(callback: () => void): () => void {\r\n subscribers.add(callback);\r\n return () => subscribers.delete(callback);\r\n}\r\n\r\nfunction getSnapshot(): DensityPref {\r\n return memoryValue;\r\n}\r\n\r\nfunction getServerSnapshot(): DensityPref {\r\n return DEFAULT;\r\n}\r\n\r\n/* ── Setter (module-level so identity is stable across renders) ── */\r\n\r\n/**\r\n * Set the density preference. Ignores invalid values silently\r\n * (consumer-supplied data sanitation is not this hook's job) and\r\n * short-circuits when the value is unchanged.\r\n */\r\nfunction setDensityValue(value: DensityPref): void {\r\n if (!VALID_SET.has(value)) return;\r\n if (value === memoryValue) return;\r\n memoryValue = value;\r\n applyToDom(value);\r\n if (typeof window !== \"undefined\") {\r\n try {\r\n window.localStorage.setItem(STORAGE_KEY, value);\r\n } catch (err) {\r\n // Quota, private mode, or sandboxed iframe — preference is\r\n // applied for this session but won't persist. Surface in dev.\r\n if (typeof console !== \"undefined\" && console.warn) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\"[@portnet/ui v2] useDensity: localStorage write failed\", err);\r\n }\r\n }\r\n }\r\n notify();\r\n}\r\n\r\nexport default function useDensity(): [DensityPref, (value: DensityPref) => void] {\r\n const density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\r\n return [density, setDensityValue];\r\n}\r\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,OAAO;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,IAAMC,WAAW,GAAG,oBAAoB;AACxC,IAAMC,OAAoB,GAAG,aAAa;AAC1C,IAAMC,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACvD,IAAMC,SAAS,GAAG,IAAIC,GAAG,CAASJ,KAAK,CAAC;AAExC,SAASK,aAAaA,CAACC,CAAU,EAAoB;EACnD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIH,SAAS,CAACI,GAAG,CAACD,CAAC,CAAC;AAClD;;AAEA;;AAEA;AACA,IAAIE,WAAwB,GAAGC,gBAAgB,CAAC,CAAC;;AAEjD;AACA,IAAMC,WAAW,GAAG,IAAIN,GAAG,CAAa,CAAC;AAEzC,SAASK,gBAAgBA,CAAA,EAAgB;EACvC,IAAI,OAAOE,MAAM,KAAK,WAAW,EAAE,OAAOZ,OAAO;EACjD,IAAI;IACF,IAAMa,GAAG,GAAGD,MAAM,CAACE,YAAY,CAACC,OAAO,CAAChB,WAAW,CAAC;IACpD,OAAOO,aAAa,CAACO,GAAG,CAAC,GAAGA,GAAG,GAAGb,OAAO;EAC3C,CAAC,CAAC,OAAAgB,OAAA,EAAM;IACN,OAAOhB,OAAO;EAChB;AACF;AAEA,SAASiB,UAAUA,CAACC,KAAkB,EAAQ;EAC5C,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EACrCA,QAAQ,CAACC,eAAe,CAACC,OAAO,CAAC,SAAS,CAAC,GAAGH,KAAK;AACrD;;AAEA;AACAD,UAAU,CAACR,WAAW,CAAC;;AAEvB;AACA;AACA,IAAI,OAAOG,MAAM,KAAK,WAAW,EAAE;EACjCA,MAAM,CAACU,gBAAgB,CAAC,SAAS,EAAE,UAACC,CAAC,EAAK;IACxC,IAAIA,CAAC,CAACC,GAAG,KAAKzB,WAAW,EAAE;IAC3B,IAAI,CAACO,aAAa,CAACiB,CAAC,CAACE,QAAQ,CAAC,EAAE;IAChC,IAAIF,CAAC,CAACE,QAAQ,KAAKhB,WAAW,EAAE;IAChCA,WAAW,GAAGc,CAAC,CAACE,QAAQ;IACxBR,UAAU,CAACR,WAAW,CAAC;IACvB;IACAiB,MAAM,CAAC,CAAC;EACV,CAAC,CAAC;AACJ;AAEA,SAASA,MAAMA,CAAA,EAAS;EACtB;EACA;EACA,SAAAC,EAAA,MAAAC,WAAA,GAAiBC,KAAK,CAACC,IAAI,CAACnB,WAAW,CAAC,EAAAgB,EAAA,GAAAC,WAAA,CAAAG,MAAA,EAAAJ,EAAA;IAAnC,IAAMK,EAAE,GAAAJ,WAAA,CAAAD,EAAA;IAA6BK,EAAE,CAAC,CAAC;EAAC;AACjD;AAEA,SAASC,SAASA,CAACC,QAAoB,EAAc;EACnDvB,WAAW,CAACwB,GAAG,CAACD,QAAQ,CAAC;EACzB,OAAO;IAAA,OAAMvB,WAAW,UAAO,CAACuB,QAAQ,CAAC;EAAA;AAC3C;AAEA,SAASE,WAAWA,CAAA,EAAgB;EAClC,OAAO3B,WAAW;AACpB;AAEA,SAAS4B,iBAAiBA,CAAA,EAAgB;EACxC,OAAOrC,OAAO;AAChB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASsC,eAAeA,CAACpB,KAAkB,EAAQ;EACjD,IAAI,CAACd,SAAS,CAACI,GAAG,CAACU,KAAK,CAAC,EAAE;EAC3B,IAAIA,KAAK,KAAKT,WAAW,EAAE;EAC3BA,WAAW,GAAGS,KAAK;EACnBD,UAAU,CAACC,KAAK,CAAC;EACjB,IAAI,OAAON,MAAM,KAAK,WAAW,EAAE;IACjC,IAAI;MACFA,MAAM,CAACE,YAAY,CAACyB,OAAO,CAACxC,WAAW,EAAEmB,KAAK,CAAC;IACjD,CAAC,CAAC,OAAOsB,GAAG,EAAE;MACZ;MACA;MACA,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,IAAI,EAAE;QAClD;QACAD,OAAO,CAACC,IAAI,CAAC,wDAAwD,EAAEF,GAAG,CAAC;MAC7E;IACF;EACF;EACAd,MAAM,CAAC,CAAC;AACV;AAEA,eAAe,SAASiB,UAAUA,CAAA,EAAgD;EAChF,IAAMC,OAAO,GAAG9C,oBAAoB,CAACmC,SAAS,EAAEG,WAAW,EAAEC,iBAAiB,CAAC;EAC/E,OAAO,CAACO,OAAO,EAAEN,eAAe,CAAC;AACnC","ignoreList":[]}
1
+ {"version":3,"file":"useDensity.js","names":["useSyncExternalStore","STORAGE_KEY","DEFAULT","VALID","Object","freeze","VALID_SET","Set","isDensityPref","v","has","memoryValue","readInitialValue","subscribers","window","raw","localStorage","getItem","applyToDom","value","document","documentElement","dataset","addEventListener","e","key","newValue","notify","cb","Array","from","subscribe","callback","add","delete","getSnapshot","getServerSnapshot","setDensityValue","setItem","err","console","warn","useDensity","density"],"sources":["../../../../src/lib/v2/hooks/useDensity.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\r\n\r\n/**\r\n * useDensity — Portnet UI v2\r\n *\r\n * Reads / writes the user's density preference (charter R-DG.11).\r\n * Applies it as `data-density` on <html> so all density-aware\r\n * tokens cascade.\r\n *\r\n * const [density, setDensity] = useDensity();\r\n * <button onClick={() => setDensity(density === \"compact\" ? \"comfortable\" : \"compact\")} />\r\n *\r\n * Synchronisation guarantees\r\n * - Multi-instance same-tab: every useDensity() consumer sees\r\n * the same value at all times. Implemented via a module-level\r\n * subscriber set fed by useSyncExternalStore.\r\n * - Cross-tab: a `storage` event listener at module load\r\n * propagates updates from sibling tabs sharing the origin.\r\n * - SSR-safe: server snapshot returns the DEFAULT; all DOM and\r\n * storage interactions are guarded.\r\n */\r\n\r\ntype DensityPref = \"comfortable\" | \"compact\";\r\n\r\nconst STORAGE_KEY = \"portnet-ui-density\";\r\nconst DEFAULT: DensityPref = \"comfortable\";\r\nconst VALID = Object.freeze([\"comfortable\", \"compact\"]);\r\nconst VALID_SET = new Set<string>(VALID);\r\n\r\nfunction isDensityPref(v: unknown): v is DensityPref {\r\n return typeof v === \"string\" && VALID_SET.has(v);\r\n}\r\n\r\n/* ── Module-level store ───────────────────────────────── */\r\n\r\n/** Source of truth. Lazy-read from storage at module load on the client. */\r\nlet memoryValue: DensityPref = readInitialValue();\r\n\r\n/** Active hook subscribers — notified on every value change. */\r\nconst subscribers = new Set<() => void>();\r\n\r\nfunction readInitialValue(): DensityPref {\r\n if (typeof window === \"undefined\") return DEFAULT;\r\n try {\r\n const raw = window.localStorage.getItem(STORAGE_KEY);\r\n return isDensityPref(raw) ? raw : DEFAULT;\r\n } catch {\r\n return DEFAULT;\r\n }\r\n}\r\n\r\nfunction applyToDom(value: DensityPref): void {\r\n if (typeof document === \"undefined\") return;\r\n document.documentElement.dataset[\"density\"] = value;\r\n}\r\n\r\n/** Apply the initial value to the DOM at module load (client-side). */\r\napplyToDom(memoryValue);\r\n\r\n/* Cross-tab sync. The `storage` event fires in OTHER tabs only —\r\n * the writing tab is informed via the in-memory subscribers path. */\r\nif (typeof window !== \"undefined\") {\r\n window.addEventListener(\"storage\", (e) => {\r\n if (e.key !== STORAGE_KEY) return;\r\n if (!isDensityPref(e.newValue)) return;\r\n if (e.newValue === memoryValue) return;\r\n memoryValue = e.newValue;\r\n applyToDom(memoryValue);\r\n // No storage write here — the originating tab already wrote.\r\n notify();\r\n });\r\n}\r\n\r\nfunction notify(): void {\r\n // Iterate a snapshot — a subscriber that unmounts during notify\r\n // would otherwise mutate the Set under iteration.\r\n for (const cb of Array.from(subscribers)) cb();\r\n}\r\n\r\nfunction subscribe(callback: () => void): () => void {\r\n subscribers.add(callback);\r\n return () => subscribers.delete(callback);\r\n}\r\n\r\nfunction getSnapshot(): DensityPref {\r\n return memoryValue;\r\n}\r\n\r\nfunction getServerSnapshot(): DensityPref {\r\n return DEFAULT;\r\n}\r\n\r\n/* ── Setter (module-level so identity is stable across renders) ── */\r\n\r\n/**\r\n * Set the density preference. Ignores invalid values silently\r\n * (consumer-supplied data sanitation is not this hook's job) and\r\n * short-circuits when the value is unchanged.\r\n */\r\nfunction setDensityValue(value: DensityPref): void {\r\n if (!VALID_SET.has(value)) return;\r\n if (value === memoryValue) return;\r\n memoryValue = value;\r\n applyToDom(value);\r\n if (typeof window !== \"undefined\") {\r\n try {\r\n window.localStorage.setItem(STORAGE_KEY, value);\r\n } catch (err) {\r\n // Quota, private mode, or sandboxed iframe — preference is\r\n // applied for this session but won't persist. Surface in dev.\r\n // eslint-disable-next-line no-console\r\n if (typeof console !== \"undefined\" && console.warn) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\"[@portnet/ui v2] useDensity: localStorage write failed\", err);\r\n }\r\n }\r\n }\r\n notify();\r\n}\r\n\r\nexport default function useDensity(): [DensityPref, (value: DensityPref) => void] {\r\n const density = useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\r\n return [density, setDensityValue];\r\n}\r\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,OAAO;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,WAAW,GAAG,oBAAoB;AACxC,MAAMC,OAAoB,GAAG,aAAa;AAC1C,MAAMC,KAAK,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AACvD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAASJ,KAAK,CAAC;AAExC,SAASK,aAAaA,CAACC,CAAU,EAAoB;EACnD,OAAO,OAAOA,CAAC,KAAK,QAAQ,IAAIH,SAAS,CAACI,GAAG,CAACD,CAAC,CAAC;AAClD;;AAEA;;AAEA;AACA,IAAIE,WAAwB,GAAGC,gBAAgB,CAAC,CAAC;;AAEjD;AACA,MAAMC,WAAW,GAAG,IAAIN,GAAG,CAAa,CAAC;AAEzC,SAASK,gBAAgBA,CAAA,EAAgB;EACvC,IAAI,OAAOE,MAAM,KAAK,WAAW,EAAE,OAAOZ,OAAO;EACjD,IAAI;IACF,MAAMa,GAAG,GAAGD,MAAM,CAACE,YAAY,CAACC,OAAO,CAAChB,WAAW,CAAC;IACpD,OAAOO,aAAa,CAACO,GAAG,CAAC,GAAGA,GAAG,GAAGb,OAAO;EAC3C,CAAC,CAAC,MAAM;IACN,OAAOA,OAAO;EAChB;AACF;AAEA,SAASgB,UAAUA,CAACC,KAAkB,EAAQ;EAC5C,IAAI,OAAOC,QAAQ,KAAK,WAAW,EAAE;EACrCA,QAAQ,CAACC,eAAe,CAACC,OAAO,CAAC,SAAS,CAAC,GAAGH,KAAK;AACrD;;AAEA;AACAD,UAAU,CAACP,WAAW,CAAC;;AAEvB;AACA;AACA,IAAI,OAAOG,MAAM,KAAK,WAAW,EAAE;EACjCA,MAAM,CAACS,gBAAgB,CAAC,SAAS,EAAGC,CAAC,IAAK;IACxC,IAAIA,CAAC,CAACC,GAAG,KAAKxB,WAAW,EAAE;IAC3B,IAAI,CAACO,aAAa,CAACgB,CAAC,CAACE,QAAQ,CAAC,EAAE;IAChC,IAAIF,CAAC,CAACE,QAAQ,KAAKf,WAAW,EAAE;IAChCA,WAAW,GAAGa,CAAC,CAACE,QAAQ;IACxBR,UAAU,CAACP,WAAW,CAAC;IACvB;IACAgB,MAAM,CAAC,CAAC;EACV,CAAC,CAAC;AACJ;AAEA,SAASA,MAAMA,CAAA,EAAS;EACtB;EACA;EACA,KAAK,MAAMC,EAAE,IAAIC,KAAK,CAACC,IAAI,CAACjB,WAAW,CAAC,EAAEe,EAAE,CAAC,CAAC;AAChD;AAEA,SAASG,SAASA,CAACC,QAAoB,EAAc;EACnDnB,WAAW,CAACoB,GAAG,CAACD,QAAQ,CAAC;EACzB,OAAO,MAAMnB,WAAW,CAACqB,MAAM,CAACF,QAAQ,CAAC;AAC3C;AAEA,SAASG,WAAWA,CAAA,EAAgB;EAClC,OAAOxB,WAAW;AACpB;AAEA,SAASyB,iBAAiBA,CAAA,EAAgB;EACxC,OAAOlC,OAAO;AAChB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASmC,eAAeA,CAAClB,KAAkB,EAAQ;EACjD,IAAI,CAACb,SAAS,CAACI,GAAG,CAACS,KAAK,CAAC,EAAE;EAC3B,IAAIA,KAAK,KAAKR,WAAW,EAAE;EAC3BA,WAAW,GAAGQ,KAAK;EACnBD,UAAU,CAACC,KAAK,CAAC;EACjB,IAAI,OAAOL,MAAM,KAAK,WAAW,EAAE;IACjC,IAAI;MACFA,MAAM,CAACE,YAAY,CAACsB,OAAO,CAACrC,WAAW,EAAEkB,KAAK,CAAC;IACjD,CAAC,CAAC,OAAOoB,GAAG,EAAE;MACZ;MACA;MACA;MACA,IAAI,OAAOC,OAAO,KAAK,WAAW,IAAIA,OAAO,CAACC,IAAI,EAAE;QAClD;QACAD,OAAO,CAACC,IAAI,CAAC,wDAAwD,EAAEF,GAAG,CAAC;MAC7E;IACF;EACF;EACAZ,MAAM,CAAC,CAAC;AACV;AAEA,eAAe,SAASe,UAAUA,CAAA,EAAgD;EAChF,MAAMC,OAAO,GAAG3C,oBAAoB,CAAC+B,SAAS,EAAEI,WAAW,EAAEC,iBAAiB,CAAC;EAC/E,OAAO,CAACO,OAAO,EAAEN,eAAe,CAAC;AACnC","ignoreList":[]}
@@ -63,7 +63,7 @@ import { useEffect, useRef } from "react";
63
63
  * programmatically focusable but deliberately out of the tab order — landing
64
64
  * there would put the user somewhere Tab cannot return to.
65
65
  */
66
- var FOCUSABLE_WITHIN = 'input,select,textarea,button,[href],[tabindex]:not([tabindex="-1"])';
66
+ const FOCUSABLE_WITHIN = 'input,select,textarea,button,[href],[tabindex]:not([tabindex="-1"])';
67
67
 
68
68
  /**
69
69
  * Escape a value for use inside an attribute selector.
@@ -104,26 +104,24 @@ function isFocusableNow(el) {
104
104
  * caller should keep its inline error and, ideally, render
105
105
  * FormErrorSummary so the field is still reachable.
106
106
  */
107
- export function focusFieldByName(name) {
108
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
107
+ export function focusFieldByName(name, options = {}) {
109
108
  if (typeof document === "undefined") return false;
110
109
  if (!name) return false;
111
- var escaped = escapeAttributeValue(name);
110
+ const escaped = escapeAttributeValue(name);
112
111
 
113
112
  /* Order matters — see the `[id=]` note in the module docstring. */
114
- var selectors = ["[id=\"".concat(escaped, "\"]"), "[name=\"".concat(escaped, "\"]"), "[data-field=\"".concat(escaped, "\"]")];
115
- for (var _i = 0, _selectors = selectors; _i < _selectors.length; _i++) {
116
- var selector = _selectors[_i];
117
- var host = null;
113
+ const selectors = [`[id="${escaped}"]`, `[name="${escaped}"]`, `[data-field="${escaped}"]`];
114
+ for (const selector of selectors) {
115
+ let host = null;
118
116
  try {
119
117
  host = document.querySelector(selector);
120
- } catch (_unused) {
118
+ } catch {
121
119
  /* Malformed selector — try the next shape rather than throwing into
122
120
  the caller's validation branch. */
123
121
  host = null;
124
122
  }
125
123
  if (host === null) continue;
126
- var target = isFocusableNow(host) ? host : host.querySelector(FOCUSABLE_WITHIN);
124
+ const target = isFocusableNow(host) ? host : host.querySelector(FOCUSABLE_WITHIN);
127
125
  if (!isFocusableNow(target)) continue;
128
126
  if (options.scroll !== false) {
129
127
  try {
@@ -131,7 +129,7 @@ export function focusFieldByName(name) {
131
129
  block: "center",
132
130
  behavior: "auto"
133
131
  });
134
- } catch (_unused2) {
132
+ } catch {
135
133
  /* jsdom and older Safari lack the options overload. Focus below
136
134
  still scrolls the control into view natively. */
137
135
  }
@@ -152,25 +150,21 @@ export function focusFieldByName(name) {
152
150
  * error is actually found lets the effect re-run when the errors land,
153
151
  * without re-firing for the same attempt afterwards.
154
152
  */
155
- export default function useFocusFirstError(_ref) {
156
- var errors = _ref.errors,
157
- order = _ref.order,
158
- _ref$submitCount = _ref.submitCount,
159
- submitCount = _ref$submitCount === void 0 ? 0 : _ref$submitCount,
160
- _ref$enabled = _ref.enabled,
161
- enabled = _ref$enabled === void 0 ? true : _ref$enabled,
162
- _ref$scroll = _ref.scroll,
163
- scroll = _ref$scroll === void 0 ? true : _ref$scroll;
153
+ export default function useFocusFirstError({
154
+ errors,
155
+ order,
156
+ submitCount = 0,
157
+ enabled = true,
158
+ scroll = true
159
+ }) {
164
160
  /** Highest submitCount already acted on. */
165
- var handledRef = useRef(0);
166
- useEffect(function () {
161
+ const handledRef = useRef(0);
162
+ useEffect(() => {
167
163
  if (!enabled) return undefined;
168
164
  if (submitCount <= handledRef.current) return undefined;
169
165
  if (!errors) return undefined;
170
- var names = order !== undefined && order.length > 0 ? order : Object.keys(errors);
171
- var first = names.find(function (name) {
172
- return Boolean(errors[name]);
173
- });
166
+ const names = order !== undefined && order.length > 0 ? order : Object.keys(errors);
167
+ const first = names.find(name => Boolean(errors[name]));
174
168
 
175
169
  /* No error yet: either validation is still in flight for this attempt,
176
170
  or it passed. Leave handledRef alone so a later errors update for the
@@ -180,18 +174,16 @@ export default function useFocusFirstError(_ref) {
180
174
 
181
175
  /* One frame, so the inline errors have rendered and the target exists
182
176
  and is measurable before it is focused and scrolled to. */
183
- var frame = requestAnimationFrame(function () {
184
- var focused = focusFieldByName(first, {
185
- scroll: scroll
177
+ const frame = requestAnimationFrame(() => {
178
+ const focused = focusFieldByName(first, {
179
+ scroll
186
180
  });
187
181
  if (!focused && process.env["NODE_ENV"] !== "production") {
188
182
  // eslint-disable-next-line no-console
189
- console.warn("[v2.useFocusFirstError] Could not focus \"".concat(first, "\" \u2014 no visible, ") + "enabled control matched [id], [name] or [data-field]. Either the " + "field is in a collapsed section, or its control does not publish " + "the field name (a hand-rolled control that skips Field). R-F.3 is " + "NOT satisfied for this field; render FormErrorSummary (R-FV.2) so " + "it stays reachable.");
183
+ console.warn(`[v2.useFocusFirstError] Could not focus "${first}" no visible, ` + "enabled control matched [id], [name] or [data-field]. Either the " + "field is in a collapsed section, or its control does not publish " + "the field name (a hand-rolled control that skips Field). R-F.3 is " + "NOT satisfied for this field; render FormErrorSummary (R-FV.2) so " + "it stays reachable.");
190
184
  }
191
185
  });
192
- return function () {
193
- return cancelAnimationFrame(frame);
194
- };
186
+ return () => cancelAnimationFrame(frame);
195
187
  }, [errors, order, submitCount, enabled, scroll]);
196
188
  }
197
189
  //# sourceMappingURL=useFocusFirstError.js.map