@portnet/ui 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (748) hide show
  1. package/dist/esm/index.js +196 -0
  2. package/dist/esm/index.js.map +1 -0
  3. package/dist/esm/v2/__tests__/FieldError.test.js +160 -0
  4. package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -0
  5. package/dist/esm/v2/__tests__/FileCard.test.js +144 -0
  6. package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -0
  7. package/dist/esm/v2/__tests__/MobileRowCard.test.js +333 -0
  8. package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -0
  9. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +235 -0
  10. package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
  11. package/dist/esm/v2/__tests__/apiError.test.js +181 -0
  12. package/dist/esm/v2/__tests__/apiError.test.js.map +1 -0
  13. package/dist/esm/v2/__tests__/banned-patterns.test.js +270 -0
  14. package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -0
  15. package/dist/esm/v2/__tests__/contrast-palette.test.js +224 -0
  16. package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -0
  17. package/dist/esm/v2/__tests__/cssVariables.test.js +157 -0
  18. package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -0
  19. package/dist/esm/v2/__tests__/labels-merge.test.js +147 -0
  20. package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -0
  21. package/dist/esm/v2/__tests__/locale-fallback.test.js +109 -0
  22. package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -0
  23. package/dist/esm/v2/__tests__/useFocusTrap.test.js +514 -0
  24. package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -0
  25. package/dist/esm/v2/components/Accordion.js +230 -0
  26. package/dist/esm/v2/components/Accordion.js.map +1 -0
  27. package/dist/esm/v2/components/ActionStrip.js +146 -0
  28. package/dist/esm/v2/components/ActionStrip.js.map +1 -0
  29. package/dist/esm/v2/components/Banner.js +254 -0
  30. package/dist/esm/v2/components/Banner.js.map +1 -0
  31. package/dist/esm/v2/components/Busy.js +97 -0
  32. package/dist/esm/v2/components/Busy.js.map +1 -0
  33. package/dist/esm/v2/components/Button.js +114 -0
  34. package/dist/esm/v2/components/Button.js.map +1 -0
  35. package/dist/esm/v2/components/CategoryTag.js +81 -0
  36. package/dist/esm/v2/components/CategoryTag.js.map +1 -0
  37. package/dist/esm/v2/components/Checkbox.js +124 -0
  38. package/dist/esm/v2/components/Checkbox.js.map +1 -0
  39. package/dist/esm/v2/components/Chip.js +124 -0
  40. package/dist/esm/v2/components/Chip.js.map +1 -0
  41. package/dist/esm/v2/components/Combobox.js +394 -0
  42. package/dist/esm/v2/components/Combobox.js.map +1 -0
  43. package/dist/esm/v2/components/CommandPalette.js +660 -0
  44. package/dist/esm/v2/components/CommandPalette.js.map +1 -0
  45. package/dist/esm/v2/components/ConfirmDialog.js +144 -0
  46. package/dist/esm/v2/components/ConfirmDialog.js.map +1 -0
  47. package/dist/esm/v2/components/DatePicker.js +200 -0
  48. package/dist/esm/v2/components/DatePicker.js.map +1 -0
  49. package/dist/esm/v2/components/DateRangePicker.js +289 -0
  50. package/dist/esm/v2/components/DateRangePicker.js.map +1 -0
  51. package/dist/esm/v2/components/DateTimePicker.js +182 -0
  52. package/dist/esm/v2/components/DateTimePicker.js.map +1 -0
  53. package/dist/esm/v2/components/Drawer.js +333 -0
  54. package/dist/esm/v2/components/Drawer.js.map +1 -0
  55. package/dist/esm/v2/components/Dropzone.js +540 -0
  56. package/dist/esm/v2/components/Dropzone.js.map +1 -0
  57. package/dist/esm/v2/components/EmptyState.js +102 -0
  58. package/dist/esm/v2/components/EmptyState.js.map +1 -0
  59. package/dist/esm/v2/components/FavoriteToggle.js +127 -0
  60. package/dist/esm/v2/components/FavoriteToggle.js.map +1 -0
  61. package/dist/esm/v2/components/Field.js +197 -0
  62. package/dist/esm/v2/components/Field.js.map +1 -0
  63. package/dist/esm/v2/components/FieldError.js +124 -0
  64. package/dist/esm/v2/components/FieldError.js.map +1 -0
  65. package/dist/esm/v2/components/FieldHelp.js +202 -0
  66. package/dist/esm/v2/components/FieldHelp.js.map +1 -0
  67. package/dist/esm/v2/components/FileCard.js +162 -0
  68. package/dist/esm/v2/components/FileCard.js.map +1 -0
  69. package/dist/esm/v2/components/FilterTab.js +138 -0
  70. package/dist/esm/v2/components/FilterTab.js.map +1 -0
  71. package/dist/esm/v2/components/ForbiddenPage.js +74 -0
  72. package/dist/esm/v2/components/ForbiddenPage.js.map +1 -0
  73. package/dist/esm/v2/components/FormGrid.js +179 -0
  74. package/dist/esm/v2/components/FormGrid.js.map +1 -0
  75. package/dist/esm/v2/components/FormikDisplay.js +118 -0
  76. package/dist/esm/v2/components/FormikDisplay.js.map +1 -0
  77. package/dist/esm/v2/components/Input.js +107 -0
  78. package/dist/esm/v2/components/Input.js.map +1 -0
  79. package/dist/esm/v2/components/KPICard.js +237 -0
  80. package/dist/esm/v2/components/KPICard.js.map +1 -0
  81. package/dist/esm/v2/components/KPIStrip.js +84 -0
  82. package/dist/esm/v2/components/KPIStrip.js.map +1 -0
  83. package/dist/esm/v2/components/KV.js +75 -0
  84. package/dist/esm/v2/components/KV.js.map +1 -0
  85. package/dist/esm/v2/components/KVGrid.js +74 -0
  86. package/dist/esm/v2/components/KVGrid.js.map +1 -0
  87. package/dist/esm/v2/components/Layout.js +284 -0
  88. package/dist/esm/v2/components/Layout.js.map +1 -0
  89. package/dist/esm/v2/components/MobileRowCard.js +314 -0
  90. package/dist/esm/v2/components/MobileRowCard.js.map +1 -0
  91. package/dist/esm/v2/components/Modal.js +276 -0
  92. package/dist/esm/v2/components/Modal.js.map +1 -0
  93. package/dist/esm/v2/components/NetworkErrorPage.js +78 -0
  94. package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -0
  95. package/dist/esm/v2/components/NotFoundPage.js +58 -0
  96. package/dist/esm/v2/components/NotFoundPage.js.map +1 -0
  97. package/dist/esm/v2/components/NumberInput.js +309 -0
  98. package/dist/esm/v2/components/NumberInput.js.map +1 -0
  99. package/dist/esm/v2/components/OverflowMenu.js +184 -0
  100. package/dist/esm/v2/components/OverflowMenu.js.map +1 -0
  101. package/dist/esm/v2/components/PdfViewer.js +122 -0
  102. package/dist/esm/v2/components/PdfViewer.js.map +1 -0
  103. package/dist/esm/v2/components/ProgressBar.js +202 -0
  104. package/dist/esm/v2/components/ProgressBar.js.map +1 -0
  105. package/dist/esm/v2/components/Radio.js +228 -0
  106. package/dist/esm/v2/components/Radio.js.map +1 -0
  107. package/dist/esm/v2/components/SectionErrorBoundary.js +214 -0
  108. package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -0
  109. package/dist/esm/v2/components/SectionHeader.js +132 -0
  110. package/dist/esm/v2/components/SectionHeader.js.map +1 -0
  111. package/dist/esm/v2/components/Segmented.js +254 -0
  112. package/dist/esm/v2/components/Segmented.js.map +1 -0
  113. package/dist/esm/v2/components/Select.js +490 -0
  114. package/dist/esm/v2/components/Select.js.map +1 -0
  115. package/dist/esm/v2/components/ServerErrorPage.js +74 -0
  116. package/dist/esm/v2/components/ServerErrorPage.js.map +1 -0
  117. package/dist/esm/v2/components/Skeleton.js +269 -0
  118. package/dist/esm/v2/components/Skeleton.js.map +1 -0
  119. package/dist/esm/v2/components/SkipLink.js +49 -0
  120. package/dist/esm/v2/components/SkipLink.js.map +1 -0
  121. package/dist/esm/v2/components/Spinner.js +69 -0
  122. package/dist/esm/v2/components/Spinner.js.map +1 -0
  123. package/dist/esm/v2/components/Status.js +64 -0
  124. package/dist/esm/v2/components/Status.js.map +1 -0
  125. package/dist/esm/v2/components/Stepper.js +432 -0
  126. package/dist/esm/v2/components/Stepper.js.map +1 -0
  127. package/dist/esm/v2/components/Surface.js +159 -0
  128. package/dist/esm/v2/components/Surface.js.map +1 -0
  129. package/dist/esm/v2/components/Switch.js +128 -0
  130. package/dist/esm/v2/components/Switch.js.map +1 -0
  131. package/dist/esm/v2/components/Tabs.js +150 -0
  132. package/dist/esm/v2/components/Tabs.js.map +1 -0
  133. package/dist/esm/v2/components/TelInput.js +274 -0
  134. package/dist/esm/v2/components/TelInput.js.map +1 -0
  135. package/dist/esm/v2/components/Textarea.js +72 -0
  136. package/dist/esm/v2/components/Textarea.js.map +1 -0
  137. package/dist/esm/v2/components/TimePicker.js +134 -0
  138. package/dist/esm/v2/components/TimePicker.js.map +1 -0
  139. package/dist/esm/v2/components/Toast.js +376 -0
  140. package/dist/esm/v2/components/Toast.js.map +1 -0
  141. package/dist/esm/v2/components/Tooltip.js +161 -0
  142. package/dist/esm/v2/components/Tooltip.js.map +1 -0
  143. package/dist/esm/v2/components/_ErrorPageBody.js +85 -0
  144. package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -0
  145. package/dist/esm/v2/components/_pickerShared.js +60 -0
  146. package/dist/esm/v2/components/_pickerShared.js.map +1 -0
  147. package/dist/esm/v2/components/index.js +244 -0
  148. package/dist/esm/v2/components/index.js.map +1 -0
  149. package/dist/esm/v2/hooks/index.js +10 -0
  150. package/dist/esm/v2/hooks/index.js.map +1 -0
  151. package/dist/esm/v2/hooks/useDelayedFlag.js +55 -0
  152. package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -0
  153. package/dist/esm/v2/hooks/useDensity.js +119 -0
  154. package/dist/esm/v2/hooks/useDensity.js.map +1 -0
  155. package/dist/esm/v2/hooks/useFocusFirstError.js +197 -0
  156. package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -0
  157. package/dist/esm/v2/hooks/useFocusTrap.js +202 -0
  158. package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -0
  159. package/dist/esm/v2/hooks/useFormAutoSave.js +181 -0
  160. package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -0
  161. package/dist/esm/v2/hooks/useFormCompletionProgress.js +131 -0
  162. package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -0
  163. package/dist/esm/v2/hooks/useResolvedDensity.js +44 -0
  164. package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -0
  165. package/dist/esm/v2/hooks/useSortedRows.js +32 -0
  166. package/dist/esm/v2/hooks/useSortedRows.js.map +1 -0
  167. package/dist/esm/v2/hooks/useTabLoading.js +79 -0
  168. package/dist/esm/v2/hooks/useTabLoading.js.map +1 -0
  169. package/dist/esm/v2/index.js +121 -0
  170. package/dist/esm/v2/index.js.map +1 -0
  171. package/dist/esm/v2/modalContext.js +108 -0
  172. package/dist/esm/v2/modalContext.js.map +1 -0
  173. package/dist/esm/v2/models/favorite.js +2 -0
  174. package/dist/esm/v2/models/favorite.js.map +1 -0
  175. package/dist/esm/v2/models/index.js +12 -0
  176. package/dist/esm/v2/models/index.js.map +1 -0
  177. package/dist/esm/v2/models/personalization.js +2 -0
  178. package/dist/esm/v2/models/personalization.js.map +1 -0
  179. package/dist/esm/v2/models/referentiel.js +2 -0
  180. package/dist/esm/v2/models/referentiel.js.map +1 -0
  181. package/dist/esm/v2/models/savedFilter.js +2 -0
  182. package/dist/esm/v2/models/savedFilter.js.map +1 -0
  183. package/dist/esm/v2/patterns/ActionBar.js +603 -0
  184. package/dist/esm/v2/patterns/ActionBar.js.map +1 -0
  185. package/dist/esm/v2/patterns/BulkActionBar.js +147 -0
  186. package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -0
  187. package/dist/esm/v2/patterns/CollapsibleDataGrid.js +303 -0
  188. package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -0
  189. package/dist/esm/v2/patterns/ColumnsToggle.js +301 -0
  190. package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -0
  191. package/dist/esm/v2/patterns/DataGrid.js +820 -0
  192. package/dist/esm/v2/patterns/DataGrid.js.map +1 -0
  193. package/dist/esm/v2/patterns/DataGridSettingsMenu.js +375 -0
  194. package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -0
  195. package/dist/esm/v2/patterns/DataGridToolbar.js +249 -0
  196. package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -0
  197. package/dist/esm/v2/patterns/DataGridVirtualized.js +523 -0
  198. package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -0
  199. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +70 -0
  200. package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
  201. package/dist/esm/v2/patterns/FavoriteColumn.js +164 -0
  202. package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -0
  203. package/dist/esm/v2/patterns/FavoritesFilter.js +91 -0
  204. package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -0
  205. package/dist/esm/v2/patterns/FormErrorSummary.js +101 -0
  206. package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -0
  207. package/dist/esm/v2/patterns/FormPageShell.js +126 -0
  208. package/dist/esm/v2/patterns/FormPageShell.js.map +1 -0
  209. package/dist/esm/v2/patterns/FormSection.js +190 -0
  210. package/dist/esm/v2/patterns/FormSection.js.map +1 -0
  211. package/dist/esm/v2/patterns/FormikCheckboxGroup.js +110 -0
  212. package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -0
  213. package/dist/esm/v2/patterns/FormikCombobox.js +115 -0
  214. package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -0
  215. package/dist/esm/v2/patterns/FormikDatePicker.js +196 -0
  216. package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -0
  217. package/dist/esm/v2/patterns/FormikErrorFocus.js +77 -0
  218. package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -0
  219. package/dist/esm/v2/patterns/FormikFile.js +148 -0
  220. package/dist/esm/v2/patterns/FormikFile.js.map +1 -0
  221. package/dist/esm/v2/patterns/FormikInput.js +127 -0
  222. package/dist/esm/v2/patterns/FormikInput.js.map +1 -0
  223. package/dist/esm/v2/patterns/FormikReferentielField.js +116 -0
  224. package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -0
  225. package/dist/esm/v2/patterns/FormikSelect.js +159 -0
  226. package/dist/esm/v2/patterns/FormikSelect.js.map +1 -0
  227. package/dist/esm/v2/patterns/FormikTextarea.js +76 -0
  228. package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -0
  229. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +195 -0
  230. package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
  231. package/dist/esm/v2/patterns/NetworkErrorBanner.js +72 -0
  232. package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -0
  233. package/dist/esm/v2/patterns/PageContent.js +62 -0
  234. package/dist/esm/v2/patterns/PageContent.js.map +1 -0
  235. package/dist/esm/v2/patterns/ReferentielField.js +615 -0
  236. package/dist/esm/v2/patterns/ReferentielField.js.map +1 -0
  237. package/dist/esm/v2/patterns/SaveFilterDialog.js +197 -0
  238. package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -0
  239. package/dist/esm/v2/patterns/SavedFiltersMenu.js +406 -0
  240. package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -0
  241. package/dist/esm/v2/patterns/SkeletonPageShell.js +342 -0
  242. package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -0
  243. package/dist/esm/v2/patterns/SortableHeader.js +179 -0
  244. package/dist/esm/v2/patterns/SortableHeader.js.map +1 -0
  245. package/dist/esm/v2/patterns/Tour.js +471 -0
  246. package/dist/esm/v2/patterns/Tour.js.map +1 -0
  247. package/dist/esm/v2/patterns/_dataGridShared.js +431 -0
  248. package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -0
  249. package/dist/esm/v2/patterns/_sort.js +112 -0
  250. package/dist/esm/v2/patterns/_sort.js.map +1 -0
  251. package/dist/esm/v2/patterns/_useColumnReorder.js +257 -0
  252. package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -0
  253. package/dist/esm/v2/patterns/_useColumnResize.js +191 -0
  254. package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -0
  255. package/dist/esm/v2/patterns/index.js +95 -0
  256. package/dist/esm/v2/patterns/index.js.map +1 -0
  257. package/dist/esm/v2/personalization/PersonalizationProvider.js +168 -0
  258. package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -0
  259. package/dist/esm/v2/personalization/adapters/_storageKey.js +60 -0
  260. package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -0
  261. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +124 -0
  262. package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
  263. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +70 -0
  264. package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
  265. package/dist/esm/v2/personalization/adapters/index.js +11 -0
  266. package/dist/esm/v2/personalization/adapters/index.js.map +1 -0
  267. package/dist/esm/v2/personalization/capabilities/favorites.js +216 -0
  268. package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -0
  269. package/dist/esm/v2/personalization/capabilities/favoritesView.js +111 -0
  270. package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -0
  271. package/dist/esm/v2/personalization/capabilities/index.js +17 -0
  272. package/dist/esm/v2/personalization/capabilities/index.js.map +1 -0
  273. package/dist/esm/v2/personalization/capabilities/savedFilters.js +291 -0
  274. package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -0
  275. package/dist/esm/v2/personalization/createPersonalizationStore.js +472 -0
  276. package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -0
  277. package/dist/esm/v2/personalization/index.js +46 -0
  278. package/dist/esm/v2/personalization/index.js.map +1 -0
  279. package/dist/esm/v2/personalization/personalizationContext.js +108 -0
  280. package/dist/esm/v2/personalization/personalizationContext.js.map +1 -0
  281. package/dist/esm/v2/personalization/schema.js +92 -0
  282. package/dist/esm/v2/personalization/schema.js.map +1 -0
  283. package/dist/esm/v2/personalization/types.js +2 -0
  284. package/dist/esm/v2/personalization/types.js.map +1 -0
  285. package/dist/esm/v2/referentiel/ReferentielProvider.js +87 -0
  286. package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -0
  287. package/dist/esm/v2/referentiel/index.js +15 -0
  288. package/dist/esm/v2/referentiel/index.js.map +1 -0
  289. package/dist/esm/v2/referentiel/useReferentielClient.js +37 -0
  290. package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -0
  291. package/dist/esm/v2/referentiel/useReferentielOptions.js +169 -0
  292. package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -0
  293. package/dist/esm/v2/referentiel/useReferentielSearch.js +132 -0
  294. package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -0
  295. package/dist/esm/v2/styles/base.css +425 -0
  296. package/dist/esm/v2/styles/css.d.ts +10 -0
  297. package/dist/esm/v2/styles/index.js +12 -0
  298. package/dist/esm/v2/styles/index.js.map +1 -0
  299. package/dist/esm/v2/theme/_brand.js +64 -0
  300. package/dist/esm/v2/theme/_brand.js.map +1 -0
  301. package/dist/esm/v2/theme/_brandSecondary.js +60 -0
  302. package/dist/esm/v2/theme/_brandSecondary.js.map +1 -0
  303. package/dist/esm/v2/theme/createPortnetTheme.js +548 -0
  304. package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -0
  305. package/dist/esm/v2/theme/cssVariables.js +198 -0
  306. package/dist/esm/v2/theme/cssVariables.js.map +1 -0
  307. package/dist/esm/v2/theme/index.js +32 -0
  308. package/dist/esm/v2/theme/index.js.map +1 -0
  309. package/dist/esm/v2/tokens/breakpoints.js +106 -0
  310. package/dist/esm/v2/tokens/breakpoints.js.map +1 -0
  311. package/dist/esm/v2/tokens/colors.js +219 -0
  312. package/dist/esm/v2/tokens/colors.js.map +1 -0
  313. package/dist/esm/v2/tokens/density.js +98 -0
  314. package/dist/esm/v2/tokens/density.js.map +1 -0
  315. package/dist/esm/v2/tokens/index.js +80 -0
  316. package/dist/esm/v2/tokens/index.js.map +1 -0
  317. package/dist/esm/v2/tokens/motion.js +88 -0
  318. package/dist/esm/v2/tokens/motion.js.map +1 -0
  319. package/dist/esm/v2/tokens/radius.js +22 -0
  320. package/dist/esm/v2/tokens/radius.js.map +1 -0
  321. package/dist/esm/v2/tokens/shadows.js +40 -0
  322. package/dist/esm/v2/tokens/shadows.js.map +1 -0
  323. package/dist/esm/v2/tokens/spacing.js +51 -0
  324. package/dist/esm/v2/tokens/spacing.js.map +1 -0
  325. package/dist/esm/v2/tokens/state.js +41 -0
  326. package/dist/esm/v2/tokens/state.js.map +1 -0
  327. package/dist/esm/v2/tokens/statusPalette.js +66 -0
  328. package/dist/esm/v2/tokens/statusPalette.js.map +1 -0
  329. package/dist/esm/v2/tokens/tokens.json +153 -0
  330. package/dist/esm/v2/tokens/typography.js +149 -0
  331. package/dist/esm/v2/tokens/typography.js.map +1 -0
  332. package/dist/esm/v2/tokens/zIndex.js +44 -0
  333. package/dist/esm/v2/tokens/zIndex.js.map +1 -0
  334. package/dist/esm/v2/types/common.js +2 -0
  335. package/dist/esm/v2/types/common.js.map +1 -0
  336. package/dist/esm/v2/types/datagrid.js +2 -0
  337. package/dist/esm/v2/types/datagrid.js.map +1 -0
  338. package/dist/esm/v2/types/index.js +12 -0
  339. package/dist/esm/v2/types/index.js.map +1 -0
  340. package/dist/esm/v2/utils/apiError.js +281 -0
  341. package/dist/esm/v2/utils/apiError.js.map +1 -0
  342. package/dist/esm/v2/utils/contrast.js +157 -0
  343. package/dist/esm/v2/utils/contrast.js.map +1 -0
  344. package/dist/esm/v2/utils/cx.js +38 -0
  345. package/dist/esm/v2/utils/cx.js.map +1 -0
  346. package/dist/esm/v2/utils/fileDownload.js +226 -0
  347. package/dist/esm/v2/utils/fileDownload.js.map +1 -0
  348. package/dist/esm/v2/utils/fmtMoney.js +78 -0
  349. package/dist/esm/v2/utils/fmtMoney.js.map +1 -0
  350. package/dist/esm/v2/utils/index.js +43 -0
  351. package/dist/esm/v2/utils/index.js.map +1 -0
  352. package/dist/esm/v2/utils/mergeLabels.js +86 -0
  353. package/dist/esm/v2/utils/mergeLabels.js.map +1 -0
  354. package/dist/esm/v2/utils/networkStatus.js +114 -0
  355. package/dist/esm/v2/utils/networkStatus.js.map +1 -0
  356. package/dist/index.d.ts +3 -2
  357. package/dist/index.d.ts.map +1 -1
  358. package/dist/index.js +21 -0
  359. package/dist/index.js.map +1 -1
  360. package/dist/v2/__tests__/FieldError.test.js +164 -0
  361. package/dist/v2/__tests__/FieldError.test.js.map +1 -0
  362. package/dist/v2/__tests__/FileCard.test.js +148 -0
  363. package/dist/v2/__tests__/FileCard.test.js.map +1 -0
  364. package/dist/v2/__tests__/SectionErrorBoundary.test.js +237 -0
  365. package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
  366. package/dist/v2/components/Accordion.d.ts +6 -6
  367. package/dist/v2/components/Accordion.d.ts.map +1 -1
  368. package/dist/v2/components/Accordion.js.map +1 -1
  369. package/dist/v2/components/ActionStrip.d.ts +12 -12
  370. package/dist/v2/components/ActionStrip.d.ts.map +1 -1
  371. package/dist/v2/components/ActionStrip.js.map +1 -1
  372. package/dist/v2/components/Banner.d.ts +48 -9
  373. package/dist/v2/components/Banner.d.ts.map +1 -1
  374. package/dist/v2/components/Banner.js +116 -35
  375. package/dist/v2/components/Banner.js.map +1 -1
  376. package/dist/v2/components/Busy.d.ts +3 -3
  377. package/dist/v2/components/Busy.d.ts.map +1 -1
  378. package/dist/v2/components/Busy.js.map +1 -1
  379. package/dist/v2/components/Button.d.ts +6 -6
  380. package/dist/v2/components/Button.d.ts.map +1 -1
  381. package/dist/v2/components/Button.js.map +1 -1
  382. package/dist/v2/components/CategoryTag.d.ts +3 -3
  383. package/dist/v2/components/CategoryTag.d.ts.map +1 -1
  384. package/dist/v2/components/CategoryTag.js.map +1 -1
  385. package/dist/v2/components/Checkbox.d.ts +11 -11
  386. package/dist/v2/components/Checkbox.d.ts.map +1 -1
  387. package/dist/v2/components/Checkbox.js.map +1 -1
  388. package/dist/v2/components/Chip.d.ts +8 -8
  389. package/dist/v2/components/Chip.d.ts.map +1 -1
  390. package/dist/v2/components/Chip.js +2 -1
  391. package/dist/v2/components/Chip.js.map +1 -1
  392. package/dist/v2/components/Combobox.d.ts +27 -27
  393. package/dist/v2/components/Combobox.d.ts.map +1 -1
  394. package/dist/v2/components/Combobox.js +3 -2
  395. package/dist/v2/components/Combobox.js.map +1 -1
  396. package/dist/v2/components/CommandPalette.d.ts +20 -20
  397. package/dist/v2/components/CommandPalette.d.ts.map +1 -1
  398. package/dist/v2/components/CommandPalette.js +2 -6
  399. package/dist/v2/components/CommandPalette.js.map +1 -1
  400. package/dist/v2/components/ConfirmDialog.d.ts +13 -13
  401. package/dist/v2/components/ConfirmDialog.d.ts.map +1 -1
  402. package/dist/v2/components/ConfirmDialog.js +2 -1
  403. package/dist/v2/components/ConfirmDialog.js.map +1 -1
  404. package/dist/v2/components/DatePicker.d.ts +11 -11
  405. package/dist/v2/components/DatePicker.d.ts.map +1 -1
  406. package/dist/v2/components/DatePicker.js.map +1 -1
  407. package/dist/v2/components/DateRangePicker.d.ts +16 -16
  408. package/dist/v2/components/DateRangePicker.d.ts.map +1 -1
  409. package/dist/v2/components/DateRangePicker.js +2 -1
  410. package/dist/v2/components/DateRangePicker.js.map +1 -1
  411. package/dist/v2/components/DateTimePicker.d.ts +11 -11
  412. package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
  413. package/dist/v2/components/DateTimePicker.js.map +1 -1
  414. package/dist/v2/components/Drawer.d.ts +18 -18
  415. package/dist/v2/components/Drawer.d.ts.map +1 -1
  416. package/dist/v2/components/Drawer.js +2 -1
  417. package/dist/v2/components/Drawer.js.map +1 -1
  418. package/dist/v2/components/Dropzone.d.ts +34 -34
  419. package/dist/v2/components/Dropzone.d.ts.map +1 -1
  420. package/dist/v2/components/Dropzone.js +11 -3
  421. package/dist/v2/components/Dropzone.js.map +1 -1
  422. package/dist/v2/components/EmptyState.d.ts +7 -7
  423. package/dist/v2/components/EmptyState.d.ts.map +1 -1
  424. package/dist/v2/components/EmptyState.js.map +1 -1
  425. package/dist/v2/components/FavoriteToggle.d.ts +7 -7
  426. package/dist/v2/components/FavoriteToggle.d.ts.map +1 -1
  427. package/dist/v2/components/FavoriteToggle.js +2 -1
  428. package/dist/v2/components/FavoriteToggle.js.map +1 -1
  429. package/dist/v2/components/Field.d.ts +17 -12
  430. package/dist/v2/components/Field.d.ts.map +1 -1
  431. package/dist/v2/components/Field.js +25 -7
  432. package/dist/v2/components/Field.js.map +1 -1
  433. package/dist/v2/components/FieldError.d.ts +78 -0
  434. package/dist/v2/components/FieldError.d.ts.map +1 -0
  435. package/dist/v2/components/FieldError.js +131 -0
  436. package/dist/v2/components/FieldError.js.map +1 -0
  437. package/dist/v2/components/FieldHelp.d.ts +7 -7
  438. package/dist/v2/components/FieldHelp.d.ts.map +1 -1
  439. package/dist/v2/components/FieldHelp.js.map +1 -1
  440. package/dist/v2/components/FileCard.d.ts +75 -0
  441. package/dist/v2/components/FileCard.d.ts.map +1 -0
  442. package/dist/v2/components/FileCard.js +169 -0
  443. package/dist/v2/components/FileCard.js.map +1 -0
  444. package/dist/v2/components/FilterTab.d.ts +9 -9
  445. package/dist/v2/components/FilterTab.d.ts.map +1 -1
  446. package/dist/v2/components/FilterTab.js +2 -1
  447. package/dist/v2/components/FilterTab.js.map +1 -1
  448. package/dist/v2/components/FormGrid.d.ts +9 -4
  449. package/dist/v2/components/FormGrid.d.ts.map +1 -1
  450. package/dist/v2/components/FormGrid.js +11 -1
  451. package/dist/v2/components/FormGrid.js.map +1 -1
  452. package/dist/v2/components/FormikDisplay.d.ts +6 -6
  453. package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
  454. package/dist/v2/components/FormikDisplay.js.map +1 -1
  455. package/dist/v2/components/Input.d.ts +6 -6
  456. package/dist/v2/components/Input.d.ts.map +1 -1
  457. package/dist/v2/components/Input.js.map +1 -1
  458. package/dist/v2/components/KPICard.d.ts +43 -13
  459. package/dist/v2/components/KPICard.d.ts.map +1 -1
  460. package/dist/v2/components/KPICard.js +53 -14
  461. package/dist/v2/components/KPICard.js.map +1 -1
  462. package/dist/v2/components/KPIStrip.d.ts +68 -0
  463. package/dist/v2/components/KPIStrip.d.ts.map +1 -0
  464. package/dist/v2/components/KPIStrip.js +92 -0
  465. package/dist/v2/components/KPIStrip.js.map +1 -0
  466. package/dist/v2/components/KV.d.ts +3 -3
  467. package/dist/v2/components/KV.d.ts.map +1 -1
  468. package/dist/v2/components/KV.js.map +1 -1
  469. package/dist/v2/components/KVGrid.d.ts +2 -2
  470. package/dist/v2/components/KVGrid.d.ts.map +1 -1
  471. package/dist/v2/components/KVGrid.js +8 -1
  472. package/dist/v2/components/KVGrid.js.map +1 -1
  473. package/dist/v2/components/Layout.d.ts +7 -7
  474. package/dist/v2/components/Layout.d.ts.map +1 -1
  475. package/dist/v2/components/Layout.js.map +1 -1
  476. package/dist/v2/components/MobileRowCard.d.ts +13 -13
  477. package/dist/v2/components/MobileRowCard.d.ts.map +1 -1
  478. package/dist/v2/components/MobileRowCard.js.map +1 -1
  479. package/dist/v2/components/Modal.d.ts +12 -12
  480. package/dist/v2/components/Modal.d.ts.map +1 -1
  481. package/dist/v2/components/Modal.js.map +1 -1
  482. package/dist/v2/components/NetworkErrorPage.d.ts +1 -1
  483. package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
  484. package/dist/v2/components/NetworkErrorPage.js.map +1 -1
  485. package/dist/v2/components/NumberInput.d.ts +14 -14
  486. package/dist/v2/components/NumberInput.d.ts.map +1 -1
  487. package/dist/v2/components/NumberInput.js +7 -6
  488. package/dist/v2/components/NumberInput.js.map +1 -1
  489. package/dist/v2/components/OverflowMenu.d.ts +14 -14
  490. package/dist/v2/components/OverflowMenu.d.ts.map +1 -1
  491. package/dist/v2/components/OverflowMenu.js +4 -8
  492. package/dist/v2/components/OverflowMenu.js.map +1 -1
  493. package/dist/v2/components/PdfViewer.d.ts +9 -9
  494. package/dist/v2/components/PdfViewer.d.ts.map +1 -1
  495. package/dist/v2/components/PdfViewer.js.map +1 -1
  496. package/dist/v2/components/ProgressBar.d.ts +10 -10
  497. package/dist/v2/components/ProgressBar.d.ts.map +1 -1
  498. package/dist/v2/components/ProgressBar.js.map +1 -1
  499. package/dist/v2/components/Radio.d.ts +7 -7
  500. package/dist/v2/components/Radio.d.ts.map +1 -1
  501. package/dist/v2/components/Radio.js.map +1 -1
  502. package/dist/v2/components/SectionErrorBoundary.d.ts +89 -0
  503. package/dist/v2/components/SectionErrorBoundary.d.ts.map +1 -0
  504. package/dist/v2/components/SectionErrorBoundary.js +221 -0
  505. package/dist/v2/components/SectionErrorBoundary.js.map +1 -0
  506. package/dist/v2/components/SectionHeader.d.ts +5 -5
  507. package/dist/v2/components/SectionHeader.d.ts.map +1 -1
  508. package/dist/v2/components/SectionHeader.js.map +1 -1
  509. package/dist/v2/components/Segmented.d.ts +11 -11
  510. package/dist/v2/components/Segmented.d.ts.map +1 -1
  511. package/dist/v2/components/Segmented.js.map +1 -1
  512. package/dist/v2/components/Select.d.ts +33 -15
  513. package/dist/v2/components/Select.d.ts.map +1 -1
  514. package/dist/v2/components/Select.js +147 -30
  515. package/dist/v2/components/Select.js.map +1 -1
  516. package/dist/v2/components/ServerErrorPage.d.ts +1 -1
  517. package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
  518. package/dist/v2/components/ServerErrorPage.js.map +1 -1
  519. package/dist/v2/components/Skeleton.d.ts +15 -15
  520. package/dist/v2/components/Skeleton.d.ts.map +1 -1
  521. package/dist/v2/components/Skeleton.js.map +1 -1
  522. package/dist/v2/components/SkipLink.d.ts +2 -2
  523. package/dist/v2/components/SkipLink.d.ts.map +1 -1
  524. package/dist/v2/components/SkipLink.js.map +1 -1
  525. package/dist/v2/components/Status.d.ts +3 -3
  526. package/dist/v2/components/Status.d.ts.map +1 -1
  527. package/dist/v2/components/Status.js.map +1 -1
  528. package/dist/v2/components/Stepper.d.ts +28 -22
  529. package/dist/v2/components/Stepper.d.ts.map +1 -1
  530. package/dist/v2/components/Stepper.js +31 -5
  531. package/dist/v2/components/Stepper.js.map +1 -1
  532. package/dist/v2/components/Surface.d.ts +94 -0
  533. package/dist/v2/components/Surface.d.ts.map +1 -0
  534. package/dist/v2/components/Surface.js +163 -0
  535. package/dist/v2/components/Surface.js.map +1 -0
  536. package/dist/v2/components/Switch.d.ts +4 -4
  537. package/dist/v2/components/Switch.d.ts.map +1 -1
  538. package/dist/v2/components/Switch.js.map +1 -1
  539. package/dist/v2/components/Tabs.d.ts +6 -6
  540. package/dist/v2/components/Tabs.d.ts.map +1 -1
  541. package/dist/v2/components/Tabs.js.map +1 -1
  542. package/dist/v2/components/TelInput.d.ts +8 -8
  543. package/dist/v2/components/TelInput.d.ts.map +1 -1
  544. package/dist/v2/components/TelInput.js +18 -18
  545. package/dist/v2/components/TelInput.js.map +1 -1
  546. package/dist/v2/components/Textarea.d.ts +1 -1
  547. package/dist/v2/components/Textarea.d.ts.map +1 -1
  548. package/dist/v2/components/Textarea.js.map +1 -1
  549. package/dist/v2/components/TimePicker.d.ts +11 -11
  550. package/dist/v2/components/TimePicker.d.ts.map +1 -1
  551. package/dist/v2/components/TimePicker.js.map +1 -1
  552. package/dist/v2/components/Toast.d.ts +6 -6
  553. package/dist/v2/components/Toast.d.ts.map +1 -1
  554. package/dist/v2/components/Toast.js +9 -8
  555. package/dist/v2/components/Toast.js.map +1 -1
  556. package/dist/v2/components/Tooltip.d.ts +1 -1
  557. package/dist/v2/components/Tooltip.d.ts.map +1 -1
  558. package/dist/v2/components/Tooltip.js.map +1 -1
  559. package/dist/v2/components/index.d.ts +143 -0
  560. package/dist/v2/components/index.d.ts.map +1 -1
  561. package/dist/v2/components/index.js +35 -0
  562. package/dist/v2/components/index.js.map +1 -1
  563. package/dist/v2/models/favorite.d.ts +1 -1
  564. package/dist/v2/models/favorite.d.ts.map +1 -1
  565. package/dist/v2/models/favorite.js.map +1 -1
  566. package/dist/v2/models/personalization.d.ts +13 -13
  567. package/dist/v2/models/personalization.d.ts.map +1 -1
  568. package/dist/v2/models/personalization.js.map +1 -1
  569. package/dist/v2/models/referentiel.d.ts +11 -11
  570. package/dist/v2/models/referentiel.d.ts.map +1 -1
  571. package/dist/v2/models/referentiel.js.map +1 -1
  572. package/dist/v2/models/savedFilter.d.ts +8 -8
  573. package/dist/v2/models/savedFilter.d.ts.map +1 -1
  574. package/dist/v2/models/savedFilter.js.map +1 -1
  575. package/dist/v2/patterns/ActionBar.d.ts +33 -33
  576. package/dist/v2/patterns/ActionBar.d.ts.map +1 -1
  577. package/dist/v2/patterns/ActionBar.js +2 -1
  578. package/dist/v2/patterns/ActionBar.js.map +1 -1
  579. package/dist/v2/patterns/BulkActionBar.d.ts +12 -12
  580. package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -1
  581. package/dist/v2/patterns/BulkActionBar.js +2 -1
  582. package/dist/v2/patterns/BulkActionBar.js.map +1 -1
  583. package/dist/v2/patterns/CollapsibleDataGrid.d.ts +15 -15
  584. package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -1
  585. package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
  586. package/dist/v2/patterns/ColumnsToggle.d.ts +7 -7
  587. package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -1
  588. package/dist/v2/patterns/ColumnsToggle.js +4 -8
  589. package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
  590. package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -12
  591. package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
  592. package/dist/v2/patterns/DataGridSettingsMenu.js +9 -8
  593. package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
  594. package/dist/v2/patterns/DataGridToolbar.d.ts +40 -40
  595. package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -1
  596. package/dist/v2/patterns/DataGridToolbar.js +2 -1
  597. package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
  598. package/dist/v2/patterns/DataGridVirtualized.d.ts +27 -27
  599. package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -1
  600. package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
  601. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +5 -5
  602. package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -1
  603. package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
  604. package/dist/v2/patterns/FavoriteColumn.d.ts +6 -6
  605. package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
  606. package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
  607. package/dist/v2/patterns/FavoritesFilter.d.ts +10 -10
  608. package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -1
  609. package/dist/v2/patterns/FavoritesFilter.js +2 -1
  610. package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
  611. package/dist/v2/patterns/FormErrorSummary.d.ts +4 -4
  612. package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -1
  613. package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
  614. package/dist/v2/patterns/FormPageShell.d.ts +4 -4
  615. package/dist/v2/patterns/FormPageShell.d.ts.map +1 -1
  616. package/dist/v2/patterns/FormPageShell.js.map +1 -1
  617. package/dist/v2/patterns/FormSection.d.ts +19 -8
  618. package/dist/v2/patterns/FormSection.d.ts.map +1 -1
  619. package/dist/v2/patterns/FormSection.js +106 -71
  620. package/dist/v2/patterns/FormSection.js.map +1 -1
  621. package/dist/v2/patterns/FormikCheckboxGroup.d.ts +6 -6
  622. package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
  623. package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
  624. package/dist/v2/patterns/FormikCombobox.d.ts +11 -11
  625. package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
  626. package/dist/v2/patterns/FormikCombobox.js.map +1 -1
  627. package/dist/v2/patterns/FormikDatePicker.d.ts +36 -8
  628. package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
  629. package/dist/v2/patterns/FormikDatePicker.js +27 -1
  630. package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
  631. package/dist/v2/patterns/FormikErrorFocus.d.ts +3 -3
  632. package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -1
  633. package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
  634. package/dist/v2/patterns/FormikFile.d.ts +8 -8
  635. package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
  636. package/dist/v2/patterns/FormikFile.js.map +1 -1
  637. package/dist/v2/patterns/FormikInput.d.ts +41 -6
  638. package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
  639. package/dist/v2/patterns/FormikInput.js +49 -1
  640. package/dist/v2/patterns/FormikInput.js.map +1 -1
  641. package/dist/v2/patterns/FormikReferentielField.d.ts +8 -8
  642. package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
  643. package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
  644. package/dist/v2/patterns/FormikSelect.d.ts +33 -12
  645. package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
  646. package/dist/v2/patterns/FormikSelect.js +28 -2
  647. package/dist/v2/patterns/FormikSelect.js.map +1 -1
  648. package/dist/v2/patterns/FormikTextarea.d.ts +5 -5
  649. package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
  650. package/dist/v2/patterns/FormikTextarea.js.map +1 -1
  651. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +7 -7
  652. package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
  653. package/dist/v2/patterns/KeyboardShortcutsHelp.js +2 -6
  654. package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
  655. package/dist/v2/patterns/NetworkErrorBanner.d.ts +4 -4
  656. package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -1
  657. package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
  658. package/dist/v2/patterns/PageContent.d.ts +3 -3
  659. package/dist/v2/patterns/PageContent.d.ts.map +1 -1
  660. package/dist/v2/patterns/PageContent.js.map +1 -1
  661. package/dist/v2/patterns/ReferentielField.d.ts +49 -49
  662. package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
  663. package/dist/v2/patterns/ReferentielField.js +2 -1
  664. package/dist/v2/patterns/ReferentielField.js.map +1 -1
  665. package/dist/v2/patterns/SaveFilterDialog.d.ts +10 -10
  666. package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -1
  667. package/dist/v2/patterns/SaveFilterDialog.js +9 -8
  668. package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
  669. package/dist/v2/patterns/SavedFiltersMenu.d.ts +7 -7
  670. package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -1
  671. package/dist/v2/patterns/SavedFiltersMenu.js +9 -8
  672. package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
  673. package/dist/v2/patterns/SkeletonPageShell.d.ts +7 -7
  674. package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -1
  675. package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
  676. package/dist/v2/patterns/SortableHeader.d.ts +1 -1
  677. package/dist/v2/patterns/SortableHeader.d.ts.map +1 -1
  678. package/dist/v2/patterns/SortableHeader.js.map +1 -1
  679. package/dist/v2/patterns/Tour.d.ts +12 -12
  680. package/dist/v2/patterns/Tour.d.ts.map +1 -1
  681. package/dist/v2/patterns/Tour.js +9 -8
  682. package/dist/v2/patterns/Tour.js.map +1 -1
  683. package/dist/v2/patterns/_dataGridShared.d.ts +25 -6
  684. package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
  685. package/dist/v2/patterns/_dataGridShared.js +37 -3
  686. package/dist/v2/patterns/_dataGridShared.js.map +1 -1
  687. package/dist/v2/patterns/_useColumnReorder.d.ts +1 -1
  688. package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -1
  689. package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
  690. package/dist/v2/patterns/_useColumnResize.d.ts +1 -1
  691. package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -1
  692. package/dist/v2/patterns/_useColumnResize.js.map +1 -1
  693. package/dist/v2/patterns/index.d.ts +27 -0
  694. package/dist/v2/patterns/index.d.ts.map +1 -1
  695. package/dist/v2/patterns/index.js.map +1 -1
  696. package/dist/v2/personalization/PersonalizationProvider.d.ts +9 -9
  697. package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
  698. package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
  699. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +1 -1
  700. package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -1
  701. package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
  702. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +1 -1
  703. package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -1
  704. package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
  705. package/dist/v2/personalization/capabilities/favoritesView.d.ts +3 -3
  706. package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -1
  707. package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
  708. package/dist/v2/personalization/capabilities/savedFilters.d.ts +3 -3
  709. package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -1
  710. package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
  711. package/dist/v2/personalization/createPersonalizationStore.d.ts +8 -8
  712. package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
  713. package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
  714. package/dist/v2/personalization/schema.d.ts +2 -2
  715. package/dist/v2/personalization/schema.d.ts.map +1 -1
  716. package/dist/v2/personalization/schema.js.map +1 -1
  717. package/dist/v2/personalization/types.d.ts +19 -19
  718. package/dist/v2/personalization/types.d.ts.map +1 -1
  719. package/dist/v2/personalization/types.js.map +1 -1
  720. package/dist/v2/referentiel/ReferentielProvider.d.ts +4 -4
  721. package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -1
  722. package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
  723. package/dist/v2/referentiel/useReferentielOptions.d.ts +4 -4
  724. package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
  725. package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
  726. package/dist/v2/referentiel/useReferentielSearch.d.ts +3 -3
  727. package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
  728. package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
  729. package/dist/v2/theme/createPortnetTheme.d.ts +32 -7
  730. package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -1
  731. package/dist/v2/theme/createPortnetTheme.js +25 -1
  732. package/dist/v2/theme/createPortnetTheme.js.map +1 -1
  733. package/dist/v2/types/datagrid.d.ts +59 -59
  734. package/dist/v2/types/datagrid.d.ts.map +1 -1
  735. package/dist/v2/types/datagrid.js.map +1 -1
  736. package/dist/v2/utils/apiError.d.ts +65 -4
  737. package/dist/v2/utils/apiError.d.ts.map +1 -1
  738. package/dist/v2/utils/apiError.js +69 -6
  739. package/dist/v2/utils/apiError.js.map +1 -1
  740. package/dist/v2/utils/index.d.ts +1 -0
  741. package/dist/v2/utils/index.d.ts.map +1 -1
  742. package/dist/v2/utils/index.js +7 -0
  743. package/dist/v2/utils/index.js.map +1 -1
  744. package/dist/v2/utils/mergeLabels.d.ts +59 -0
  745. package/dist/v2/utils/mergeLabels.d.ts.map +1 -0
  746. package/dist/v2/utils/mergeLabels.js +93 -0
  747. package/dist/v2/utils/mergeLabels.js.map +1 -0
  748. package/package.json +23 -15
@@ -0,0 +1,70 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import * as React from "react";
8
+ import ConfirmDialog from "../components/ConfirmDialog";
9
+
10
+ /**
11
+ * DeleteResourceConfirmDialog — Portnet UI v2
12
+ *
13
+ * Opinionated wrapper over v2.ConfirmDialog for irreversible delete actions
14
+ * across the design system. Hard-wires the "danger" variant (Charter §09.3 —
15
+ * the only correct choice for a destructive irreversible action) and sensible
16
+ * FR defaults for the button labels.
17
+ *
18
+ * The prop names `isOpen` / `onDelete` are deliberately chosen over
19
+ * v2.ConfirmDialog's `open` / `onConfirm` because call sites read more
20
+ * naturally with action-specific verbs — every host-module audit converged on
21
+ * this naming and the wrapper formalises it as the destructive-action
22
+ * convention.
23
+ *
24
+ * <DeleteResourceConfirmDialog
25
+ * isOpen // bool, REQUIRED
26
+ * onClose // () => void, REQUIRED
27
+ * onDelete // () => void, REQUIRED — fires on confirm
28
+ * title // node, REQUIRED — surfaces the resource type
29
+ * description? // node — single-sentence consequence
30
+ * impact? // node[] — bullet-list of side effects (Charter R-5.1)
31
+ * confirmLabel? // node, default "Confirmer"
32
+ * cancelLabel? // node, default "Annuler"
33
+ * loading? // bool — disables both buttons + spinner on confirm
34
+ * />
35
+ *
36
+ * Charter R-5.1 + §09.3 + R-M.*. WCAG 2.4.7 (focus visible — inherited from Modal).
37
+ */
38
+ import { jsx as _jsx } from "react/jsx-runtime";
39
+ function DeleteResourceConfirmDialog(_ref) {
40
+ var isOpen = _ref.isOpen,
41
+ onClose = _ref.onClose,
42
+ onDelete = _ref.onDelete,
43
+ title = _ref.title,
44
+ description = _ref.description,
45
+ impact = _ref.impact,
46
+ _ref$confirmLabel = _ref.confirmLabel,
47
+ confirmLabel = _ref$confirmLabel === void 0 ? "Confirmer" : _ref$confirmLabel,
48
+ _ref$cancelLabel = _ref.cancelLabel,
49
+ cancelLabel = _ref$cancelLabel === void 0 ? "Annuler" : _ref$cancelLabel,
50
+ _ref$loading = _ref.loading,
51
+ loading = _ref$loading === void 0 ? false : _ref$loading;
52
+ return /*#__PURE__*/_jsx(ConfirmDialog, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
53
+ title: title,
54
+ description: description,
55
+ cancelLabel: cancelLabel,
56
+ confirmLabel: confirmLabel,
57
+ confirmVariant: "danger",
58
+ loading: loading
59
+ }, isOpen !== undefined ? {
60
+ open: isOpen
61
+ } : {}), onClose !== undefined ? {
62
+ onClose: onClose
63
+ } : {}), onDelete !== undefined ? {
64
+ onConfirm: onDelete
65
+ } : {}), impact !== undefined ? {
66
+ impact: impact
67
+ } : {}));
68
+ }
69
+ export default DeleteResourceConfirmDialog;
70
+ //# sourceMappingURL=DeleteResourceConfirmDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeleteResourceConfirmDialog.js","names":["React","ConfirmDialog","jsx","_jsx","DeleteResourceConfirmDialog","_ref","isOpen","onClose","onDelete","title","description","impact","_ref$confirmLabel","confirmLabel","_ref$cancelLabel","cancelLabel","_ref$loading","loading","_objectSpread","confirmVariant","undefined","open","onConfirm"],"sources":["../../../../src/lib/v2/patterns/DeleteResourceConfirmDialog.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport ConfirmDialog from \"../components/ConfirmDialog\";\r\n\r\n/**\r\n * DeleteResourceConfirmDialog — Portnet UI v2\r\n *\r\n * Opinionated wrapper over v2.ConfirmDialog for irreversible delete actions\r\n * across the design system. Hard-wires the \"danger\" variant (Charter §09.3 —\r\n * the only correct choice for a destructive irreversible action) and sensible\r\n * FR defaults for the button labels.\r\n *\r\n * The prop names `isOpen` / `onDelete` are deliberately chosen over\r\n * v2.ConfirmDialog's `open` / `onConfirm` because call sites read more\r\n * naturally with action-specific verbs — every host-module audit converged on\r\n * this naming and the wrapper formalises it as the destructive-action\r\n * convention.\r\n *\r\n * <DeleteResourceConfirmDialog\r\n * isOpen // bool, REQUIRED\r\n * onClose // () => void, REQUIRED\r\n * onDelete // () => void, REQUIRED — fires on confirm\r\n * title // node, REQUIRED — surfaces the resource type\r\n * description? // node — single-sentence consequence\r\n * impact? // node[] — bullet-list of side effects (Charter R-5.1)\r\n * confirmLabel? // node, default \"Confirmer\"\r\n * cancelLabel? // node, default \"Annuler\"\r\n * loading? // bool — disables both buttons + spinner on confirm\r\n * />\r\n *\r\n * Charter R-5.1 + §09.3 + R-M.*. WCAG 2.4.7 (focus visible — inherited from Modal).\r\n */\r\n\r\ntype ConfirmDialogProps = React.ComponentProps<typeof ConfirmDialog>;\r\n\r\nexport interface DeleteResourceConfirmDialogProps {\r\n isOpen: ConfirmDialogProps[\"open\"];\r\n onClose: ConfirmDialogProps[\"onClose\"];\r\n /** Fires on confirm (maps to ConfirmDialog's onConfirm). */\r\n onDelete: ConfirmDialogProps[\"onConfirm\"];\r\n title: ConfirmDialogProps[\"title\"];\r\n description?: ConfirmDialogProps[\"description\"] | undefined;\r\n impact?: ConfirmDialogProps[\"impact\"] | undefined;\r\n confirmLabel?: ConfirmDialogProps[\"confirmLabel\"] | undefined;\r\n cancelLabel?: ConfirmDialogProps[\"cancelLabel\"] | undefined;\r\n loading?: ConfirmDialogProps[\"loading\"] | undefined;\r\n}\r\n\r\nfunction DeleteResourceConfirmDialog({\r\n isOpen,\r\n onClose,\r\n onDelete,\r\n title,\r\n description,\r\n impact,\r\n confirmLabel = \"Confirmer\",\r\n cancelLabel = \"Annuler\",\r\n loading = false,\r\n}: DeleteResourceConfirmDialogProps) {\r\n return (\r\n <ConfirmDialog\r\n title={title}\r\n description={description}\r\n cancelLabel={cancelLabel}\r\n confirmLabel={confirmLabel}\r\n confirmVariant=\"danger\"\r\n loading={loading}\r\n {...(isOpen !== undefined ? { open: isOpen } : {})}\r\n {...(onClose !== undefined ? { onClose } : {})}\r\n {...(onDelete !== undefined ? { onConfirm: onDelete } : {})}\r\n {...(impact !== undefined ? { impact } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default DeleteResourceConfirmDialog;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,6BAA6B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3BA,SAAAC,GAAA,IAAAC,IAAA;AA4CA,SAASC,2BAA2BA,CAAAC,IAAA,EAUC;EAAA,IATnCC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,MAAM,GAAAN,IAAA,CAANM,MAAM;IAAAC,iBAAA,GAAAP,IAAA,CACNQ,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,WAAW,GAAAA,iBAAA;IAAAE,gBAAA,GAAAT,IAAA,CAC1BU,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,SAAS,GAAAA,gBAAA;IAAAE,YAAA,GAAAX,IAAA,CACvBY,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,KAAK,GAAAA,YAAA;EAEf,oBACEb,IAAA,CAACF,aAAa,EAAAiB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA;IACZT,KAAK,EAAEA,KAAM;IACbC,WAAW,EAAEA,WAAY;IACzBK,WAAW,EAAEA,WAAY;IACzBF,YAAY,EAAEA,YAAa;IAC3BM,cAAc,EAAC,QAAQ;IACvBF,OAAO,EAAEA;EAAQ,GACZX,MAAM,KAAKc,SAAS,GAAG;IAAEC,IAAI,EAAEf;EAAO,CAAC,GAAG,CAAC,CAAC,GAC5CC,OAAO,KAAKa,SAAS,GAAG;IAAEb,OAAO,EAAPA;EAAQ,CAAC,GAAG,CAAC,CAAC,GACxCC,QAAQ,KAAKY,SAAS,GAAG;IAAEE,SAAS,EAAEd;EAAS,CAAC,GAAG,CAAC,CAAC,GACrDG,MAAM,KAAKS,SAAS,GAAG;IAAET,MAAM,EAANA;EAAO,CAAC,GAAG,CAAC,CAAC,CAC5C,CAAC;AAEN;AAEA,eAAeP,2BAA2B","ignoreList":[]}
@@ -0,0 +1,164 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import * as React from "react";
8
+ import Box from "@mui/material/Box";
9
+ import FavoriteToggle from "../components/FavoriteToggle";
10
+ import Tooltip from "../components/Tooltip";
11
+ import { useIsFavorite } from "../personalization/capabilities/favorites";
12
+
13
+ /**
14
+ * FavoriteColumn - Portnet UI v2 (pattern)
15
+ *
16
+ * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for
17
+ * a compact "follow" (suivi) star column. Spread it into the grid's
18
+ * `columns` first so it sits at the LEFT of each row:
19
+ *
20
+ * const columns = [
21
+ * makeFavoriteColumn({ resourceKey: "ti:list", getRowId: (r) => r.reference }),
22
+ * { key: "reference", header: "Référence", ... },
23
+ * ...
24
+ * ];
25
+ * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />
26
+ *
27
+ * Behaviour:
28
+ * - ALWAYS VISIBLE: the star is rendered on every row in both states
29
+ * (filled ★ when followed, outline ☆ when not) — it is NOT
30
+ * hover-revealed. It sits at the left of the row.
31
+ * - COMPACT: no visible column header (the header carries only a
32
+ * visually hidden accessible name "Suivis"), and a narrow 44px width,
33
+ * so the column takes minimal space.
34
+ * - STATUS TOOLTIP: hovering or focusing the star shows its current
35
+ * status — "Suivi" when followed, "Non suivi" otherwise. The button's
36
+ * accessible name stays action-oriented ("Suivre" / "Ne plus suivre",
37
+ * optionally enriched with the row label) and aria-pressed conveys the
38
+ * state, so screen-reader semantics are unaffected.
39
+ * - `toggleable: false` keeps the column out of ColumnsToggle (the user
40
+ * can't hide it); not sortable / resizable / reorderable (sorting BY
41
+ * follow status is a separate concern — see useFavoritesView /
42
+ * sortRowsByFavorites).
43
+ * - Each cell reads useIsFavorite (a boolean selector), so toggling one
44
+ * row re-renders only that row's star.
45
+ * - Toggling never triggers the row's onRowClick (click + keydown
46
+ * propagation stopped, mirroring the DataGrid selection checkbox).
47
+ *
48
+ * `getRowId` MUST match the one passed to <DataGrid> so the follow id and
49
+ * the grid row id agree. Requires a <UserPersonalizationProvider>
50
+ * ancestor (useIsFavorite throws otherwise).
51
+ */
52
+ import { jsx as _jsx } from "react/jsx-runtime";
53
+ var DEFAULT_LABELS = Object.freeze({
54
+ columnHeader: "Suivis",
55
+ addFavorite: "Suivre",
56
+ removeFavorite: "Ne plus suivre",
57
+ statusFollowed: "Suivi",
58
+ statusNotFollowed: "Non suivi"
59
+ });
60
+
61
+ /** Visually hidden, but exposed to assistive tech (the column's accessible name). */
62
+ var SR_ONLY_SX = Object.freeze({
63
+ position: "absolute",
64
+ width: "1px",
65
+ height: "1px",
66
+ padding: 0,
67
+ margin: "-1px",
68
+ overflow: "hidden",
69
+ clip: "rect(0 0 0 0)",
70
+ whiteSpace: "nowrap",
71
+ border: 0
72
+ });
73
+ function FavoriteCell(props) {
74
+ var resourceKey = props.resourceKey,
75
+ id = props.id,
76
+ size = props.size,
77
+ addLabel = props.addLabel,
78
+ removeLabel = props.removeLabel,
79
+ followedLabel = props.followedLabel,
80
+ notFollowedLabel = props.notFollowedLabel,
81
+ rowLabel = props.rowLabel;
82
+ var _useIsFavorite = useIsFavorite(resourceKey, id),
83
+ isFavorite = _useIsFavorite.isFavorite,
84
+ toggle = _useIsFavorite.toggle;
85
+
86
+ // Action-oriented accessible name (toggle convention); aria-pressed (set
87
+ // by FavoriteToggle) carries the state. Always provided, so the Tooltip
88
+ // never mirrors its title onto the trigger.
89
+ var action = isFavorite ? removeLabel : addLabel;
90
+ var ariaLabel = rowLabel ? action + " : " + rowLabel : action;
91
+ // Visible status shown on hover/focus.
92
+ var statusLabel = isFavorite ? followedLabel : notFollowedLabel;
93
+ var handleChange = function handleChange(_next, e) {
94
+ // Don't let the toggle's click bubble to the row's onRowClick.
95
+ if (e && typeof e.stopPropagation === "function") e.stopPropagation();
96
+ toggle();
97
+ };
98
+ var handleKeyDown = function handleKeyDown(e) {
99
+ // Prevent row-level Enter/Space (onRowClick) from also firing; the
100
+ // button's own native activation is unaffected.
101
+ e.stopPropagation();
102
+ };
103
+ return /*#__PURE__*/_jsx(Tooltip, {
104
+ title: statusLabel,
105
+ children: /*#__PURE__*/_jsx(FavoriteToggle, {
106
+ pressed: isFavorite,
107
+ onChange: handleChange,
108
+ onKeyDown: handleKeyDown,
109
+ size: size,
110
+ labels: {
111
+ addFavorite: addLabel,
112
+ removeFavorite: removeLabel
113
+ },
114
+ "aria-label": ariaLabel
115
+ })
116
+ });
117
+ }
118
+ /**
119
+ * Builds a v2 DataGrid column definition for the compact follow-star column.
120
+ */
121
+ export default function makeFavoriteColumn(options) {
122
+ var opts = options;
123
+ var resourceKey = opts.resourceKey;
124
+ var getRowId = typeof opts.getRowId === "function" ? opts.getRowId : function defaultGetRowId(r) {
125
+ return r.id;
126
+ };
127
+ var key = opts.key || "__favorite__";
128
+ var size = opts.size || "sm";
129
+ var width = opts.width != null ? opts.width : 44;
130
+ var getRowLabel = typeof opts.getRowLabel === "function" ? opts.getRowLabel : null;
131
+ var L = opts.labels ? _objectSpread(_objectSpread({}, DEFAULT_LABELS), opts.labels) : DEFAULT_LABELS;
132
+ if (process.env["NODE_ENV"] !== "production" && !resourceKey) {
133
+ // eslint-disable-next-line no-console
134
+ console.warn("[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.");
135
+ }
136
+ return {
137
+ key: key,
138
+ header: /*#__PURE__*/_jsx(Box, {
139
+ component: "span",
140
+ sx: SR_ONLY_SX,
141
+ children: L.columnHeader
142
+ }),
143
+ align: "center",
144
+ sortable: false,
145
+ toggleable: false,
146
+ // kept out of ColumnsToggle (cannot be hidden)
147
+ resizable: false,
148
+ reorderable: false,
149
+ width: width,
150
+ render: function renderFavorite(row) {
151
+ return /*#__PURE__*/_jsx(FavoriteCell, {
152
+ resourceKey: resourceKey,
153
+ id: getRowId(row),
154
+ size: size,
155
+ addLabel: L.addFavorite,
156
+ removeLabel: L.removeFavorite,
157
+ followedLabel: L.statusFollowed,
158
+ notFollowedLabel: L.statusNotFollowed,
159
+ rowLabel: getRowLabel ? getRowLabel(row) : undefined
160
+ });
161
+ }
162
+ };
163
+ }
164
+ //# sourceMappingURL=FavoriteColumn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FavoriteColumn.js","names":["React","Box","FavoriteToggle","Tooltip","useIsFavorite","jsx","_jsx","DEFAULT_LABELS","Object","freeze","columnHeader","addFavorite","removeFavorite","statusFollowed","statusNotFollowed","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","FavoriteCell","props","resourceKey","id","size","addLabel","removeLabel","followedLabel","notFollowedLabel","rowLabel","_useIsFavorite","isFavorite","toggle","action","ariaLabel","statusLabel","handleChange","_next","e","stopPropagation","handleKeyDown","title","children","pressed","onChange","onKeyDown","labels","makeFavoriteColumn","options","opts","getRowId","defaultGetRowId","r","key","getRowLabel","L","_objectSpread","process","env","console","warn","header","component","sx","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","undefined"],"sources":["../../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport FavoriteToggle from \"../components/FavoriteToggle\";\r\nimport Tooltip from \"../components/Tooltip\";\r\nimport { useIsFavorite } from \"../personalization/capabilities/favorites\";\r\nimport type { DataGridColumn } from \"../types/datagrid\";\r\nimport type { RowId } from \"../types/common\";\r\n\r\n/**\r\n * FavoriteColumn - Portnet UI v2 (pattern)\r\n *\r\n * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for\r\n * a compact \"follow\" (suivi) star column. Spread it into the grid's\r\n * `columns` first so it sits at the LEFT of each row:\r\n *\r\n * const columns = [\r\n * makeFavoriteColumn({ resourceKey: \"ti:list\", getRowId: (r) => r.reference }),\r\n * { key: \"reference\", header: \"Référence\", ... },\r\n * ...\r\n * ];\r\n * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />\r\n *\r\n * Behaviour:\r\n * - ALWAYS VISIBLE: the star is rendered on every row in both states\r\n * (filled ★ when followed, outline ☆ when not) — it is NOT\r\n * hover-revealed. It sits at the left of the row.\r\n * - COMPACT: no visible column header (the header carries only a\r\n * visually hidden accessible name \"Suivis\"), and a narrow 44px width,\r\n * so the column takes minimal space.\r\n * - STATUS TOOLTIP: hovering or focusing the star shows its current\r\n * status — \"Suivi\" when followed, \"Non suivi\" otherwise. The button's\r\n * accessible name stays action-oriented (\"Suivre\" / \"Ne plus suivre\",\r\n * optionally enriched with the row label) and aria-pressed conveys the\r\n * state, so screen-reader semantics are unaffected.\r\n * - `toggleable: false` keeps the column out of ColumnsToggle (the user\r\n * can't hide it); not sortable / resizable / reorderable (sorting BY\r\n * follow status is a separate concern — see useFavoritesView /\r\n * sortRowsByFavorites).\r\n * - Each cell reads useIsFavorite (a boolean selector), so toggling one\r\n * row re-renders only that row's star.\r\n * - Toggling never triggers the row's onRowClick (click + keydown\r\n * propagation stopped, mirroring the DataGrid selection checkbox).\r\n *\r\n * `getRowId` MUST match the one passed to <DataGrid> so the follow id and\r\n * the grid row id agree. Requires a <UserPersonalizationProvider>\r\n * ancestor (useIsFavorite throws otherwise).\r\n */\r\n\r\ntype FavoriteToggleSize = NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"size\"]\r\n>;\r\n\r\nexport interface FavoriteColumnLabels {\r\n columnHeader: string;\r\n addFavorite: string;\r\n removeFavorite: string;\r\n statusFollowed: string;\r\n statusNotFollowed: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n columnHeader: \"Suivis\",\r\n addFavorite: \"Suivre\",\r\n removeFavorite: \"Ne plus suivre\",\r\n statusFollowed: \"Suivi\",\r\n statusNotFollowed: \"Non suivi\",\r\n} satisfies FavoriteColumnLabels);\r\n\r\n/** Visually hidden, but exposed to assistive tech (the column's accessible name). */\r\nconst SR_ONLY_SX = Object.freeze({\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: 0,\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0 0 0 0)\",\r\n whiteSpace: \"nowrap\",\r\n border: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\ninterface FavoriteCellProps {\r\n resourceKey: string;\r\n id: RowId;\r\n size: FavoriteToggleSize;\r\n addLabel: string;\r\n removeLabel: string;\r\n followedLabel: string;\r\n notFollowedLabel: string;\r\n rowLabel?: string | undefined;\r\n}\r\n\r\nfunction FavoriteCell(props: FavoriteCellProps): React.JSX.Element {\r\n const {\r\n resourceKey,\r\n id,\r\n size,\r\n addLabel,\r\n removeLabel,\r\n followedLabel,\r\n notFollowedLabel,\r\n rowLabel,\r\n } = props;\r\n const { isFavorite, toggle } = useIsFavorite(resourceKey, id);\r\n\r\n // Action-oriented accessible name (toggle convention); aria-pressed (set\r\n // by FavoriteToggle) carries the state. Always provided, so the Tooltip\r\n // never mirrors its title onto the trigger.\r\n const action = isFavorite ? removeLabel : addLabel;\r\n const ariaLabel = rowLabel ? action + \" : \" + rowLabel : action;\r\n // Visible status shown on hover/focus.\r\n const statusLabel = isFavorite ? followedLabel : notFollowedLabel;\r\n\r\n const handleChange: NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"onChange\"]\r\n > = function handleChange(_next, e) {\r\n // Don't let the toggle's click bubble to the row's onRowClick.\r\n if (e && typeof e.stopPropagation === \"function\") e.stopPropagation();\r\n toggle();\r\n };\r\n const handleKeyDown: NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"onKeyDown\"]\r\n > = function handleKeyDown(e) {\r\n // Prevent row-level Enter/Space (onRowClick) from also firing; the\r\n // button's own native activation is unaffected.\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <Tooltip title={statusLabel}>\r\n <FavoriteToggle\r\n pressed={isFavorite}\r\n onChange={handleChange}\r\n onKeyDown={handleKeyDown}\r\n size={size}\r\n labels={{ addFavorite: addLabel, removeFavorite: removeLabel }}\r\n aria-label={ariaLabel}\r\n />\r\n </Tooltip>\r\n );\r\n}\r\n\r\nexport interface MakeFavoriteColumnOptions<T> {\r\n /** Required — follow namespace. */\r\n resourceKey: string;\r\n /** MUST match the grid's getRowId. Defaults to (r) => r.id. */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n /** Column key. @default \"__favorite__\" */\r\n key?: string | undefined;\r\n /** Toggle size (sm fits dense rows). @default \"sm\" */\r\n size?: FavoriteToggleSize | undefined;\r\n /** Column width (narrow / compact). @default 44 */\r\n width?: number | string | undefined;\r\n /** (row) => string, enriches the per-row aria-label. */\r\n getRowLabel?: ((row: T) => string) | undefined;\r\n labels?: Partial<FavoriteColumnLabels> | undefined;\r\n}\r\n\r\n/**\r\n * Builds a v2 DataGrid column definition for the compact follow-star column.\r\n */\r\nexport default function makeFavoriteColumn<T>(\r\n options: MakeFavoriteColumnOptions<T>\r\n): DataGridColumn<T> {\r\n const opts = options;\r\n const resourceKey = opts.resourceKey;\r\n const getRowId: (row: T) => RowId =\r\n typeof opts.getRowId === \"function\"\r\n ? opts.getRowId\r\n : function defaultGetRowId(r: T): RowId {\r\n return (r as { id: RowId }).id;\r\n };\r\n const key = opts.key || \"__favorite__\";\r\n const size = opts.size || \"sm\";\r\n const width: number | string = opts.width != null ? opts.width : 44;\r\n const getRowLabel =\r\n typeof opts.getRowLabel === \"function\" ? opts.getRowLabel : null;\r\n const L: FavoriteColumnLabels = opts.labels\r\n ? { ...DEFAULT_LABELS, ...opts.labels }\r\n : DEFAULT_LABELS;\r\n\r\n if (process.env[\"NODE_ENV\"] !== \"production\" && !resourceKey) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.\"\r\n );\r\n }\r\n\r\n return {\r\n key: key,\r\n header: (\r\n <Box component=\"span\" sx={SR_ONLY_SX}>\r\n {L.columnHeader}\r\n </Box>\r\n ),\r\n align: \"center\",\r\n sortable: false,\r\n toggleable: false, // kept out of ColumnsToggle (cannot be hidden)\r\n resizable: false,\r\n reorderable: false,\r\n width: width,\r\n render: function renderFavorite(row: T): React.ReactNode {\r\n return (\r\n <FavoriteCell\r\n resourceKey={resourceKey}\r\n id={getRowId(row)}\r\n size={size}\r\n addLabel={L.addFavorite}\r\n removeLabel={L.removeFavorite}\r\n followedLabel={L.statusFollowed}\r\n notFollowedLabel={L.statusNotFollowed}\r\n rowLabel={getRowLabel ? getRowLabel(row) : undefined}\r\n />\r\n );\r\n },\r\n };\r\n}\r\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,91 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import * as React from "react";
8
+ import StarRoundedIcon from "@mui/icons-material/StarRounded";
9
+ import Segmented from "../components/Segmented";
10
+ import { mergeLabels } from "../utils/mergeLabels";
11
+
12
+ /**
13
+ * FavoritesFilter - Portnet UI v2 (pattern)
14
+ *
15
+ * Presentational "Tous / Suivis" toggle for the follow filter, built on
16
+ * the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).
17
+ * Provider-free — drive it from the same state you pass to
18
+ * useFavoritesView:
19
+ *
20
+ * const [favFilter, setFavFilter] = React.useState("all");
21
+ * const view = useFavoritesView("ti:list", rows, {
22
+ * getRowId, filterMode: favFilter,
23
+ * });
24
+ * <FavoritesFilter
25
+ * value={favFilter}
26
+ * onChange={setFavFilter}
27
+ * favoriteCount={view.favoriteCount}
28
+ * totalCount={rows.length}
29
+ * />
30
+ *
31
+ * Values ("all" | "only") match FAVORITES_FILTER. Pass `fullWidth` to let
32
+ * it span its row on narrow / mobile toolbars.
33
+ */
34
+ import { jsx as _jsx } from "react/jsx-runtime";
35
+ var DEFAULT_LABELS = Object.freeze({
36
+ all: "Tous",
37
+ favorites: "Suivis",
38
+ ariaLabel: "Filtrer par suivis"
39
+ });
40
+ function withCount(label, count) {
41
+ return typeof count === "number" ? label + " (" + count + ")" : label;
42
+ }
43
+ function FavoritesFilter(props) {
44
+ var _props$value = props.value,
45
+ value = _props$value === void 0 ? "all" : _props$value,
46
+ onChange = props.onChange,
47
+ favoriteCount = props.favoriteCount,
48
+ totalCount = props.totalCount,
49
+ _props$showCounts = props.showCounts,
50
+ showCounts = _props$showCounts === void 0 ? true : _props$showCounts,
51
+ _props$showIcon = props.showIcon,
52
+ showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
53
+ _props$size = props.size,
54
+ size = _props$size === void 0 ? "sm" : _props$size,
55
+ _props$fullWidth = props.fullWidth,
56
+ fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
57
+ labels = props.labels,
58
+ sx = props.sx;
59
+ var L = React.useMemo(function () {
60
+ return mergeLabels(DEFAULT_LABELS, labels);
61
+ }, [labels]);
62
+ var options = React.useMemo(function buildOptions() {
63
+ return [{
64
+ value: "all",
65
+ label: showCounts ? withCount(L.all, totalCount) : L.all
66
+ }, _objectSpread({
67
+ value: "only",
68
+ label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites
69
+ }, showIcon ? {
70
+ icon: /*#__PURE__*/_jsx(StarRoundedIcon, {
71
+ fontSize: "small"
72
+ })
73
+ } : {})];
74
+ }, [L, showCounts, showIcon, totalCount, favoriteCount]);
75
+ var handleChange = React.useCallback(function handleChange(v) {
76
+ // Segmented emits its configured option values only ("all" / "only").
77
+ if (onChange) onChange(v);
78
+ }, [onChange]);
79
+ return /*#__PURE__*/_jsx(Segmented, _objectSpread({
80
+ value: value,
81
+ onChange: handleChange,
82
+ options: options,
83
+ size: size,
84
+ fullWidth: fullWidth,
85
+ "aria-label": L.ariaLabel
86
+ }, sx !== undefined ? {
87
+ sx: sx
88
+ } : {}));
89
+ }
90
+ export default FavoritesFilter;
91
+ //# sourceMappingURL=FavoritesFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FavoritesFilter.js","names":["React","StarRoundedIcon","Segmented","mergeLabels","jsx","_jsx","DEFAULT_LABELS","Object","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","_props$value","value","onChange","favoriteCount","totalCount","_props$showCounts","showCounts","_props$showIcon","showIcon","_props$size","size","_props$fullWidth","fullWidth","labels","sx","L","useMemo","options","buildOptions","_objectSpread","icon","fontSize","handleChange","useCallback","v","undefined"],"sources":["../../../../src/lib/v2/patterns/FavoritesFilter.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport StarRoundedIcon from \"@mui/icons-material/StarRounded\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport Segmented from \"../components/Segmented\";\r\nimport type { SegmentedOption, SegmentedValue } from \"../components/Segmented\";\r\nimport type { FavoritesFilterMode } from \"../personalization/capabilities/favoritesView\";\r\nimport { mergeLabels } from \"../utils/mergeLabels\";\r\n\r\n/**\r\n * FavoritesFilter - Portnet UI v2 (pattern)\r\n *\r\n * Presentational \"Tous / Suivis\" toggle for the follow filter, built on\r\n * the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).\r\n * Provider-free — drive it from the same state you pass to\r\n * useFavoritesView:\r\n *\r\n * const [favFilter, setFavFilter] = React.useState(\"all\");\r\n * const view = useFavoritesView(\"ti:list\", rows, {\r\n * getRowId, filterMode: favFilter,\r\n * });\r\n * <FavoritesFilter\r\n * value={favFilter}\r\n * onChange={setFavFilter}\r\n * favoriteCount={view.favoriteCount}\r\n * totalCount={rows.length}\r\n * />\r\n *\r\n * Values (\"all\" | \"only\") match FAVORITES_FILTER. Pass `fullWidth` to let\r\n * it span its row on narrow / mobile toolbars.\r\n */\r\n\r\nexport interface FavoritesFilterLabels {\r\n all: string;\r\n favorites: string;\r\n ariaLabel: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n all: \"Tous\",\r\n favorites: \"Suivis\",\r\n ariaLabel: \"Filtrer par suivis\",\r\n} satisfies FavoritesFilterLabels);\r\n\r\nfunction withCount(label: string, count: number | undefined): string {\r\n return typeof count === \"number\" ? label + \" (\" + count + \")\" : label;\r\n}\r\n\r\nexport interface FavoritesFilterProps {\r\n /** Current mode (matches FAVORITES_FILTER). @default \"all\" */\r\n value?: FavoritesFilterMode | undefined;\r\n /** (mode) => void. */\r\n onChange?: ((value: FavoritesFilterMode) => void) | undefined;\r\n /** Count shown on the \"Suivis\" segment. */\r\n favoriteCount?: number | undefined;\r\n /** Count shown on the \"Tous\" segment. */\r\n totalCount?: number | undefined;\r\n showCounts?: boolean | undefined;\r\n showIcon?: boolean | undefined;\r\n size?: \"sm\" | \"md\" | undefined;\r\n /** Span the available width — useful on narrow / mobile toolbars. */\r\n fullWidth?: boolean | undefined;\r\n /** Localised labels (FR default; EN/AR supported). */\r\n labels?: Partial<FavoritesFilterLabels> | undefined;\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FavoritesFilter(props: FavoritesFilterProps): React.JSX.Element {\r\n const {\r\n value = \"all\",\r\n onChange,\r\n favoriteCount,\r\n totalCount,\r\n showCounts = true,\r\n showIcon = true,\r\n size = \"sm\",\r\n fullWidth = false,\r\n labels,\r\n sx,\r\n } = props;\r\n const L = React.useMemo<FavoritesFilterLabels>(\r\n () => (mergeLabels(DEFAULT_LABELS, labels)),\r\n [labels]\r\n );\r\n\r\n const options = React.useMemo<SegmentedOption[]>(\r\n function buildOptions() {\r\n return [\r\n {\r\n value: \"all\",\r\n label: showCounts ? withCount(L.all, totalCount) : L.all,\r\n },\r\n {\r\n value: \"only\",\r\n label: showCounts\r\n ? withCount(L.favorites, favoriteCount)\r\n : L.favorites,\r\n ...(showIcon ? { icon: <StarRoundedIcon fontSize=\"small\" /> } : {}),\r\n },\r\n ];\r\n },\r\n [L, showCounts, showIcon, totalCount, favoriteCount]\r\n );\r\n\r\n const handleChange = React.useCallback(\r\n function handleChange(v: SegmentedValue): void {\r\n // Segmented emits its configured option values only (\"all\" / \"only\").\r\n if (onChange) onChange(v as FavoritesFilterMode);\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <Segmented\r\n value={value}\r\n onChange={handleChange}\r\n options={options}\r\n size={size}\r\n fullWidth={fullWidth}\r\n aria-label={L.ariaLabel}\r\n {...(sx !== undefined ? { sx } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default FavoritesFilter;\r\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,101 @@
1
+ import * as React from "react";
2
+ import Box from "@mui/material/Box";
3
+ import Banner from "../components/Banner";
4
+
5
+ /**
6
+ * FormErrorSummary — Portnet UI v2
7
+ *
8
+ * Charter §05 / R-FV.2. Synthesis banner rendered above a form after a
9
+ * failed-submit so the user sees, at-a-glance, every field that needs
10
+ * attention. Each entry is a clickable jump-to-field affordance; the host
11
+ * supplies the navigation behaviour via `onItemClick`.
12
+ *
13
+ * Composition: pure v2.Banner + a semantic <ul> of <button> jump-links.
14
+ * No host-specific scroll/focus logic baked in.
15
+ *
16
+ * Renders nothing when `errors` is empty / nullish — host can mount
17
+ * unconditionally above the form.
18
+ *
19
+ * Accessibility:
20
+ * - <button type="button"> instead of <a href="#…">. The entries trigger
21
+ * an action (focus/scroll) and don't navigate.
22
+ * - Explicit role="list" + role="listitem" because some screen readers
23
+ * strip list semantics when CSS list-style:none is applied.
24
+ * - Banner already carries the alert/role semantics for the region.
25
+ * - Explicit :focus-visible outline on each jump-button on --danger-fg,
26
+ * which passes WCAG 1.4.11 ≥ 3:1 on danger-soft (finding B4-EXT-2).
27
+ *
28
+ * Charter R-AI.2: composition of v2.Banner only — no local primitive.
29
+ */
30
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
+ function FormErrorSummary(_ref) {
32
+ var errors = _ref.errors,
33
+ labelByName = _ref.labelByName,
34
+ onItemClick = _ref.onItemClick,
35
+ title = _ref.title;
36
+ if (!errors || errors.length === 0) return null;
37
+ var heading = title || "Veuillez corriger les erreurs ci-dessous";
38
+ var handleClick = function handleClick(e, name) {
39
+ e.preventDefault();
40
+ if (typeof onItemClick === "function") {
41
+ onItemClick(name);
42
+ }
43
+ };
44
+ return /*#__PURE__*/_jsx(Banner, {
45
+ variant: "error",
46
+ title: heading,
47
+ children: /*#__PURE__*/_jsx(Box, {
48
+ component: "ul",
49
+ role: "list",
50
+ sx: {
51
+ margin: 0,
52
+ paddingInlineStart: "var(--s-5)",
53
+ fontSize: "var(--text-sm)",
54
+ listStyle: "disc"
55
+ },
56
+ children: errors.map(function (err, idx) {
57
+ var label = labelByName && labelByName[err.name] || err.name;
58
+ return /*#__PURE__*/_jsxs(Box, {
59
+ component: "li",
60
+ role: "listitem",
61
+ sx: {
62
+ marginBottom: "var(--s-1)"
63
+ },
64
+ children: [/*#__PURE__*/_jsx(Box, {
65
+ component: "button",
66
+ type: "button",
67
+ onClick: function onClick(e) {
68
+ return handleClick(e, err.name);
69
+ },
70
+ sx: {
71
+ // Reset default <button> chrome so the link reads visually
72
+ // as a hyperlink in the banner body.
73
+ background: "transparent",
74
+ border: "none",
75
+ padding: 0,
76
+ margin: 0,
77
+ font: "inherit",
78
+ cursor: "pointer",
79
+ color: "var(--danger-fg)",
80
+ textDecoration: "underline",
81
+ fontWeight: "var(--fw-medium)",
82
+ // R-F.1 — explicit focus-visible outline. Outline on
83
+ // currentColor (danger-fg) passes 1.4.11 ≥ 3:1 on the soft
84
+ // danger background; borderRadius aligns the ring with the DS.
85
+ "&:focus-visible": {
86
+ outline: "2px solid var(--danger-fg)",
87
+ outlineOffset: "var(--pui-outline-offset)",
88
+ borderRadius: "var(--r-sm)"
89
+ }
90
+ },
91
+ children: label
92
+ }), ": ", /*#__PURE__*/_jsx("span", {
93
+ children: err.message
94
+ })]
95
+ }, "".concat(err.name, "-").concat(idx));
96
+ })
97
+ })
98
+ });
99
+ }
100
+ export default FormErrorSummary;
101
+ //# sourceMappingURL=FormErrorSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormErrorSummary.js","names":["React","Box","Banner","jsx","_jsx","jsxs","_jsxs","FormErrorSummary","_ref","errors","labelByName","onItemClick","title","length","heading","handleClick","e","name","preventDefault","variant","children","component","role","sx","margin","paddingInlineStart","fontSize","listStyle","map","err","idx","label","marginBottom","type","onClick","background","border","padding","font","cursor","color","textDecoration","fontWeight","outline","outlineOffset","borderRadius","message","concat"],"sources":["../../../../src/lib/v2/patterns/FormErrorSummary.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport Banner from \"../components/Banner\";\r\n\r\n/**\r\n * FormErrorSummary — Portnet UI v2\r\n *\r\n * Charter §05 / R-FV.2. Synthesis banner rendered above a form after a\r\n * failed-submit so the user sees, at-a-glance, every field that needs\r\n * attention. Each entry is a clickable jump-to-field affordance; the host\r\n * supplies the navigation behaviour via `onItemClick`.\r\n *\r\n * Composition: pure v2.Banner + a semantic <ul> of <button> jump-links.\r\n * No host-specific scroll/focus logic baked in.\r\n *\r\n * Renders nothing when `errors` is empty / nullish — host can mount\r\n * unconditionally above the form.\r\n *\r\n * Accessibility:\r\n * - <button type=\"button\"> instead of <a href=\"#…\">. The entries trigger\r\n * an action (focus/scroll) and don't navigate.\r\n * - Explicit role=\"list\" + role=\"listitem\" because some screen readers\r\n * strip list semantics when CSS list-style:none is applied.\r\n * - Banner already carries the alert/role semantics for the region.\r\n * - Explicit :focus-visible outline on each jump-button on --danger-fg,\r\n * which passes WCAG 1.4.11 ≥ 3:1 on danger-soft (finding B4-EXT-2).\r\n *\r\n * Charter R-AI.2: composition of v2.Banner only — no local primitive.\r\n */\r\n\r\nexport interface FormErrorSummaryError {\r\n name: string;\r\n message: string;\r\n}\r\n\r\nexport interface FormErrorSummaryProps {\r\n errors?: FormErrorSummaryError[] | undefined;\r\n labelByName?: Record<string, string> | undefined;\r\n onItemClick?: ((name: string) => void) | undefined;\r\n title?: string | undefined;\r\n}\r\n\r\nfunction FormErrorSummary({\r\n errors,\r\n labelByName,\r\n onItemClick,\r\n title,\r\n}: FormErrorSummaryProps) {\r\n if (!errors || errors.length === 0) return null;\r\n\r\n const heading = title || \"Veuillez corriger les erreurs ci-dessous\";\r\n\r\n const handleClick = (\r\n e: React.MouseEvent<HTMLButtonElement>,\r\n name: string\r\n ) => {\r\n e.preventDefault();\r\n if (typeof onItemClick === \"function\") {\r\n onItemClick(name);\r\n }\r\n };\r\n\r\n return (\r\n <Banner variant=\"error\" title={heading}>\r\n <Box\r\n component=\"ul\"\r\n role=\"list\"\r\n sx={{\r\n margin: 0,\r\n paddingInlineStart: \"var(--s-5)\",\r\n fontSize: \"var(--text-sm)\",\r\n listStyle: \"disc\",\r\n }}\r\n >\r\n {errors.map((err, idx) => {\r\n const label = (labelByName && labelByName[err.name]) || err.name;\r\n return (\r\n <Box\r\n component=\"li\"\r\n role=\"listitem\"\r\n key={`${err.name}-${idx}`}\r\n sx={{ marginBottom: \"var(--s-1)\" }}\r\n >\r\n <Box\r\n component=\"button\"\r\n type=\"button\"\r\n onClick={(e) => handleClick(e, err.name)}\r\n sx={{\r\n // Reset default <button> chrome so the link reads visually\r\n // as a hyperlink in the banner body.\r\n background: \"transparent\",\r\n border: \"none\",\r\n padding: 0,\r\n margin: 0,\r\n font: \"inherit\",\r\n cursor: \"pointer\",\r\n color: \"var(--danger-fg)\",\r\n textDecoration: \"underline\",\r\n fontWeight: \"var(--fw-medium)\",\r\n // R-F.1 — explicit focus-visible outline. Outline on\r\n // currentColor (danger-fg) passes 1.4.11 ≥ 3:1 on the soft\r\n // danger background; borderRadius aligns the ring with the DS.\r\n \"&:focus-visible\": {\r\n outline: \"2px solid var(--danger-fg)\",\r\n outlineOffset: \"var(--pui-outline-offset)\",\r\n borderRadius: \"var(--r-sm)\",\r\n },\r\n }}\r\n >\r\n {label}\r\n </Box>\r\n {\": \"}\r\n <span>{err.message}</span>\r\n </Box>\r\n );\r\n })}\r\n </Box>\r\n </Banner>\r\n );\r\n}\r\n\r\nexport default FormErrorSummary;\r\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,126 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
+ import * as React from "react";
8
+ import Box from "@mui/material/Box";
9
+ import ActionBar from "./ActionBar";
10
+ import PageContent from "./PageContent";
11
+ import ProgressBar from "../components/ProgressBar";
12
+
13
+ /**
14
+ * FormPageShell — Portnet UI v2 (pattern)
15
+ *
16
+ * Charter §07 R-L.2 — canonical shell for create/edit form pages.
17
+ *
18
+ * Combines a sticky ActionBar (surface=false, accent title) with a
19
+ * responsive PageContent wrapper so every module's form page has the
20
+ * same structure without reimplementing it.
21
+ *
22
+ * ┌───────────────────────────────────────────────────────────────┐
23
+ * │ 🏠 > Breadcrumb │ sticky
24
+ * │ Title [secondary] [primary] [overflow…] │
25
+ * │ Subtitle │
26
+ * └───────────────────────────────────────────────────────────────┘
27
+ * ┌───────────────────────────────────────────────────────────────┐
28
+ * │ [ProgressBar ── progressLabel] ← if progress prop given │
29
+ * │ children │
30
+ * └───────────────────────────────────────────────────────────────┘
31
+ *
32
+ * @example
33
+ * <FormPageShell
34
+ * home={() => navigate("/")}
35
+ * back={() => navigate("/list")}
36
+ * breadcrumb={["Autorisations", "Nouvelle autorisation"]}
37
+ * title="Nouvelle autorisation"
38
+ * subtitle="Saisissez les informations…"
39
+ * secondary={[{ label: "Enregistrer", icon: <SaveIcon />, onClick: handleSave }]}
40
+ * primary={{ label: "Déposer", iconRight: <ArrowIcon />, onClick: handleDeposit }}
41
+ * overflow={[{ label: "Retour à la liste", onClick: goBack }]}
42
+ * progress={requiredPct}
43
+ * progressLabel={isComplete ? "Prêt à déposer ✓" : `${filled}/${total} requis`}
44
+ * >
45
+ * <FormSection number={1} title="Informations">…</FormSection>
46
+ * </FormPageShell>
47
+ */
48
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
49
+ var PROGRESS_ROW_SX = Object.freeze({
50
+ display: "flex",
51
+ alignItems: "center",
52
+ gap: "var(--s-3)",
53
+ marginBottom: "var(--s-5)"
54
+ });
55
+ var PROGRESS_BAR_WRAPPER_SX = Object.freeze({
56
+ flex: 1,
57
+ minWidth: 0
58
+ });
59
+ var PROGRESS_LABEL_SX = Object.freeze({
60
+ fontSize: "var(--text-xs)",
61
+ color: "var(--fg-muted)",
62
+ whiteSpace: "nowrap",
63
+ fontVariantNumeric: "tabular-nums",
64
+ flexShrink: 0
65
+ });
66
+
67
+ /**
68
+ * Valeurs par défaut inline — plus de defaultProps.
69
+ * React 18.3+ supprime le support de defaultProps pour les function
70
+ * components. Aligné sur le pattern DataGridToolbar (B14).
71
+ */
72
+ function FormPageShell(_ref) {
73
+ var home = _ref.home,
74
+ back = _ref.back,
75
+ breadcrumb = _ref.breadcrumb,
76
+ title = _ref.title,
77
+ subtitle = _ref.subtitle,
78
+ icon = _ref.icon,
79
+ _ref$secondary = _ref.secondary,
80
+ secondary = _ref$secondary === void 0 ? [] : _ref$secondary,
81
+ primary = _ref.primary,
82
+ _ref$overflow = _ref.overflow,
83
+ overflow = _ref$overflow === void 0 ? [] : _ref$overflow,
84
+ progress = _ref.progress,
85
+ progressLabel = _ref.progressLabel,
86
+ children = _ref.children,
87
+ contentSx = _ref.contentSx;
88
+ return /*#__PURE__*/_jsxs(_Fragment, {
89
+ children: [/*#__PURE__*/_jsx(ActionBar, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
90
+ surface: false,
91
+ title: title,
92
+ subtitle: subtitle,
93
+ secondary: secondary,
94
+ overflow: overflow
95
+ }, home !== undefined ? {
96
+ home: home
97
+ } : {}), back !== undefined ? {
98
+ back: back
99
+ } : {}), breadcrumb !== undefined ? {
100
+ breadcrumb: breadcrumb
101
+ } : {}), icon !== undefined ? {
102
+ icon: icon
103
+ } : {}), primary !== undefined ? {
104
+ primary: primary
105
+ } : {})), /*#__PURE__*/_jsxs(PageContent, _objectSpread(_objectSpread({}, contentSx !== undefined ? {
106
+ sx: contentSx
107
+ } : {}), {}, {
108
+ children: [typeof progress === "number" && /*#__PURE__*/_jsxs(Box, {
109
+ sx: PROGRESS_ROW_SX,
110
+ children: [/*#__PURE__*/_jsx(Box, {
111
+ sx: PROGRESS_BAR_WRAPPER_SX,
112
+ children: /*#__PURE__*/_jsx(ProgressBar, {
113
+ value: progress,
114
+ "aria-label": "Avancement de la saisie"
115
+ })
116
+ }), progressLabel && /*#__PURE__*/_jsx(Box, {
117
+ component: "span",
118
+ sx: PROGRESS_LABEL_SX,
119
+ children: progressLabel
120
+ })]
121
+ }), children]
122
+ }))]
123
+ });
124
+ }
125
+ export default FormPageShell;
126
+ //# sourceMappingURL=FormPageShell.js.map