@portnet/ui 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +737 -0
- package/dist/esm/index.js +90 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
- package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +71 -39
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js +146 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -18
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +173 -0
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +236 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +299 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -43
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/esm/v2/__tests__/apiError.test.js +50 -69
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
- package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
- package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +17 -22
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
- package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +48 -70
- package/dist/esm/v2/components/Accordion.js.map +1 -1
- package/dist/esm/v2/components/ActionStrip.js +31 -43
- package/dist/esm/v2/components/ActionStrip.js.map +1 -1
- package/dist/esm/v2/components/Banner.js +25 -22
- package/dist/esm/v2/components/Banner.js.map +1 -1
- package/dist/esm/v2/components/Busy.js +14 -19
- package/dist/esm/v2/components/Busy.js.map +1 -1
- package/dist/esm/v2/components/Button.js +34 -45
- package/dist/esm/v2/components/Button.js.map +1 -1
- package/dist/esm/v2/components/CategoryTag.js +44 -27
- package/dist/esm/v2/components/CategoryTag.js.map +1 -1
- package/dist/esm/v2/components/Checkbox.js +32 -38
- package/dist/esm/v2/components/Checkbox.js.map +1 -1
- package/dist/esm/v2/components/Chip.js +23 -36
- package/dist/esm/v2/components/Chip.js.map +1 -1
- package/dist/esm/v2/components/Combobox.js +112 -136
- package/dist/esm/v2/components/Combobox.js.map +1 -1
- package/dist/esm/v2/components/CommandPalette.js +113 -198
- package/dist/esm/v2/components/CommandPalette.js.map +1 -1
- package/dist/esm/v2/components/ConfirmDialog.js +36 -45
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/esm/v2/components/DatePicker.js +78 -81
- package/dist/esm/v2/components/DatePicker.js.map +1 -1
- package/dist/esm/v2/components/DateRangePicker.js +63 -74
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
- package/dist/esm/v2/components/DateTimePicker.js +118 -90
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
- package/dist/esm/v2/components/Drawer.js +71 -65
- package/dist/esm/v2/components/Drawer.js.map +1 -1
- package/dist/esm/v2/components/Dropzone.js +130 -177
- package/dist/esm/v2/components/Dropzone.js.map +1 -1
- package/dist/esm/v2/components/EmptyState.js +9 -9
- package/dist/esm/v2/components/EmptyState.js.map +1 -1
- package/dist/esm/v2/components/FavoriteToggle.js +24 -33
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/esm/v2/components/Field.js +210 -52
- package/dist/esm/v2/components/Field.js.map +1 -1
- package/dist/esm/v2/components/FieldError.js +9 -13
- package/dist/esm/v2/components/FieldError.js.map +1 -1
- package/dist/esm/v2/components/FieldHelp.js +28 -49
- package/dist/esm/v2/components/FieldHelp.js.map +1 -1
- package/dist/esm/v2/components/FileCard.js +14 -19
- package/dist/esm/v2/components/FileCard.js.map +1 -1
- package/dist/esm/v2/components/FilterTab.js +22 -31
- package/dist/esm/v2/components/FilterTab.js.map +1 -1
- package/dist/esm/v2/components/ForbiddenPage.js +28 -8
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/esm/v2/components/FormGrid.js +48 -54
- package/dist/esm/v2/components/FormGrid.js.map +1 -1
- package/dist/esm/v2/components/FormikDisplay.js +98 -24
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
- package/dist/esm/v2/components/Input.js +75 -34
- package/dist/esm/v2/components/Input.js.map +1 -1
- package/dist/esm/v2/components/KPICard.js +42 -51
- package/dist/esm/v2/components/KPICard.js.map +1 -1
- package/dist/esm/v2/components/KPIStrip.js +9 -15
- package/dist/esm/v2/components/KPIStrip.js.map +1 -1
- package/dist/esm/v2/components/KV.js +16 -23
- package/dist/esm/v2/components/KV.js.map +1 -1
- package/dist/esm/v2/components/KVGrid.js +15 -23
- package/dist/esm/v2/components/KVGrid.js.map +1 -1
- package/dist/esm/v2/components/Layout.js +81 -117
- package/dist/esm/v2/components/Layout.js.map +1 -1
- package/dist/esm/v2/components/MobileRowCard.js +64 -75
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
- package/dist/esm/v2/components/Modal.js +44 -53
- package/dist/esm/v2/components/Modal.js.map +1 -1
- package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/esm/v2/components/NotFoundPage.js +28 -9
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
- package/dist/esm/v2/components/NumberInput.js +77 -107
- package/dist/esm/v2/components/NumberInput.js.map +1 -1
- package/dist/esm/v2/components/OverflowMenu.js +24 -42
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
- package/dist/esm/v2/components/PdfViewer.js +24 -33
- package/dist/esm/v2/components/PdfViewer.js.map +1 -1
- package/dist/esm/v2/components/ProgressBar.js +28 -36
- package/dist/esm/v2/components/ProgressBar.js.map +1 -1
- package/dist/esm/v2/components/Radio.js +49 -57
- package/dist/esm/v2/components/Radio.js.map +1 -1
- package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/esm/v2/components/SectionHeader.js +24 -31
- package/dist/esm/v2/components/SectionHeader.js.map +1 -1
- package/dist/esm/v2/components/Segmented.js +59 -84
- package/dist/esm/v2/components/Segmented.js.map +1 -1
- package/dist/esm/v2/components/Select.js +100 -138
- package/dist/esm/v2/components/Select.js.map +1 -1
- package/dist/esm/v2/components/ServerErrorPage.js +27 -10
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/esm/v2/components/Skeleton.js +81 -96
- package/dist/esm/v2/components/Skeleton.js.map +1 -1
- package/dist/esm/v2/components/SkipLink.js +6 -7
- package/dist/esm/v2/components/SkipLink.js.map +1 -1
- package/dist/esm/v2/components/Spinner.js +13 -22
- package/dist/esm/v2/components/Spinner.js.map +1 -1
- package/dist/esm/v2/components/Status.js +14 -25
- package/dist/esm/v2/components/Status.js.map +1 -1
- package/dist/esm/v2/components/Stepper.js +68 -71
- package/dist/esm/v2/components/Stepper.js.map +1 -1
- package/dist/esm/v2/components/Surface.js +25 -44
- package/dist/esm/v2/components/Surface.js.map +1 -1
- package/dist/esm/v2/components/Switch.js +21 -29
- package/dist/esm/v2/components/Switch.js.map +1 -1
- package/dist/esm/v2/components/TabPanel.js +84 -0
- package/dist/esm/v2/components/TabPanel.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +43 -19
- package/dist/esm/v2/components/Tabs.js.map +1 -1
- package/dist/esm/v2/components/TelInput.js +75 -108
- package/dist/esm/v2/components/TelInput.js.map +1 -1
- package/dist/esm/v2/components/Textarea.js +21 -30
- package/dist/esm/v2/components/Textarea.js.map +1 -1
- package/dist/esm/v2/components/TimePicker.js +59 -69
- package/dist/esm/v2/components/TimePicker.js.map +1 -1
- package/dist/esm/v2/components/Toast.js +109 -163
- package/dist/esm/v2/components/Toast.js.map +1 -1
- package/dist/esm/v2/components/Tooltip.js +18 -31
- package/dist/esm/v2/components/Tooltip.js.map +1 -1
- package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/esm/v2/components/_pickerShared.js +2 -2
- package/dist/esm/v2/components/_pickerShared.js.map +1 -1
- package/dist/esm/v2/components/index.js +64 -0
- package/dist/esm/v2/components/index.js.map +1 -1
- package/dist/esm/v2/hooks/index.js +62 -0
- package/dist/esm/v2/hooks/index.js.map +1 -1
- package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
- package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/esm/v2/hooks/useDensity.js +13 -17
- package/dist/esm/v2/hooks/useDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useSortedRows.js +3 -5
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/esm/v2/hooks/useTabLoading.js +6 -21
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/esm/v2/index.js +14 -4
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/esm/v2/modalContext.js +2 -2
- package/dist/esm/v2/modalContext.js.map +1 -1
- package/dist/esm/v2/models/favorite.js.map +1 -1
- package/dist/esm/v2/models/personalization.js.map +1 -1
- package/dist/esm/v2/models/referentiel.js.map +1 -1
- package/dist/esm/v2/models/savedFilter.js.map +1 -1
- package/dist/esm/v2/patterns/ActionBar.js +115 -159
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/AppMain.js +108 -0
- package/dist/esm/v2/patterns/AppMain.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/ChartFigure.js +151 -0
- package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/esm/v2/patterns/DataGrid.js +221 -255
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/esm/v2/patterns/DetailSplit.js +108 -0
- package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +26 -75
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
- package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/esm/v2/patterns/FormPageShell.js +43 -41
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/FormSection.js +30 -38
- package/dist/esm/v2/patterns/FormSection.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckbox.js +130 -0
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCombobox.js +51 -66
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +51 -99
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +136 -0
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
- package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +94 -78
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
- package/dist/esm/v2/patterns/FormikInput.js +40 -50
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +129 -0
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/FormikSelect.js +64 -84
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -43
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +64 -65
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/esm/v2/patterns/PageContent.js +10 -14
- package/dist/esm/v2/patterns/PageContent.js.map +1 -1
- package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
- package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +327 -312
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/RowFavoriteToggle.js +127 -0
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/SortableHeader.js +22 -45
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/esm/v2/patterns/Tour.js +94 -120
- package/dist/esm/v2/patterns/Tour.js.map +1 -1
- package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/esm/v2/patterns/_pickerSerialisation.js +72 -0
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -0
- package/dist/esm/v2/patterns/_sort.js +17 -33
- package/dist/esm/v2/patterns/_sort.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/esm/v2/patterns/filterCriteria.js +102 -0
- package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +235 -0
- package/dist/esm/v2/patterns/index.js.map +1 -1
- package/dist/esm/v2/patterns/rowActions.js +223 -0
- package/dist/esm/v2/patterns/rowActions.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js +203 -0
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/index.js +5 -0
- package/dist/esm/v2/personalization/capabilities/index.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/esm/v2/personalization/index.js +35 -0
- package/dist/esm/v2/personalization/index.js.map +1 -1
- package/dist/esm/v2/personalization/personalizationContext.js +9 -9
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/esm/v2/personalization/schema.js +8 -9
- package/dist/esm/v2/personalization/schema.js.map +1 -1
- package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/esm/v2/referentiel/types.js +2 -0
- package/dist/esm/v2/referentiel/types.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/esm/v2/theme/_brand.js +8 -24
- package/dist/esm/v2/theme/_brand.js.map +1 -1
- package/dist/esm/v2/theme/_brandSecondary.js +8 -24
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/esm/v2/theme/cssVariables.js +62 -69
- package/dist/esm/v2/theme/cssVariables.js.map +1 -1
- package/dist/esm/v2/theme/index.js +5 -5
- package/dist/esm/v2/theme/index.js.map +1 -1
- package/dist/esm/v2/tokens/breakpoints.js +14 -14
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
- package/dist/esm/v2/tokens/chart.js +261 -0
- package/dist/esm/v2/tokens/chart.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +22 -22
- package/dist/esm/v2/tokens/colors.js.map +1 -1
- package/dist/esm/v2/tokens/density.js +62 -7
- package/dist/esm/v2/tokens/density.js.map +1 -1
- package/dist/esm/v2/tokens/index.js +49 -34
- package/dist/esm/v2/tokens/index.js.map +1 -1
- package/dist/esm/v2/tokens/motion.js +12 -20
- package/dist/esm/v2/tokens/motion.js.map +1 -1
- package/dist/esm/v2/tokens/radius.js +1 -1
- package/dist/esm/v2/tokens/radius.js.map +1 -1
- package/dist/esm/v2/tokens/shadows.js +6 -6
- package/dist/esm/v2/tokens/shadows.js.map +1 -1
- package/dist/esm/v2/tokens/spacing.js +2 -2
- package/dist/esm/v2/tokens/spacing.js.map +1 -1
- package/dist/esm/v2/tokens/state.js +1 -1
- package/dist/esm/v2/tokens/state.js.map +1 -1
- package/dist/esm/v2/tokens/statusPalette.js +17 -21
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
- package/dist/esm/v2/tokens/tokens.json +6 -1
- package/dist/esm/v2/tokens/typography.js +13 -13
- package/dist/esm/v2/tokens/typography.js.map +1 -1
- package/dist/esm/v2/tokens/zIndex.js +1 -1
- package/dist/esm/v2/tokens/zIndex.js.map +1 -1
- package/dist/esm/v2/types/datagrid.js.map +1 -1
- package/dist/esm/v2/utils/apiError.js +16 -37
- package/dist/esm/v2/utils/apiError.js.map +1 -1
- package/dist/esm/v2/utils/contrast.js +31 -32
- package/dist/esm/v2/utils/contrast.js.map +1 -1
- package/dist/esm/v2/utils/cx.js +5 -25
- package/dist/esm/v2/utils/cx.js.map +1 -1
- package/dist/esm/v2/utils/fileDownload.js +23 -26
- package/dist/esm/v2/utils/fileDownload.js.map +1 -1
- package/dist/esm/v2/utils/fileValidation.js +209 -0
- package/dist/esm/v2/utils/fileValidation.js.map +1 -0
- package/dist/esm/v2/utils/fmtDate.js +111 -0
- package/dist/esm/v2/utils/fmtDate.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +8 -10
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
- package/dist/esm/v2/utils/formikErrors.js +78 -0
- package/dist/esm/v2/utils/formikErrors.js.map +1 -0
- package/dist/esm/v2/utils/index.js +35 -2
- package/dist/esm/v2/utils/index.js.map +1 -1
- package/dist/esm/v2/utils/mergeLabels.js +7 -12
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
- package/dist/esm/v2/utils/networkStatus.js +12 -12
- package/dist/esm/v2/utils/networkStatus.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -47
- package/dist/index.js.map +1 -1
- package/dist/v2/__tests__/AppMain.test.js +133 -0
- package/dist/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/v2/__tests__/ChartFigure.test.js +183 -0
- package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/v2/__tests__/FieldError.test.js +98 -69
- package/dist/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/v2/__tests__/FieldNaming.test.js +161 -0
- package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/v2/__tests__/FieldWidth.test.js +148 -0
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FileCard.test.js +45 -48
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +175 -0
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +237 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js +300 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/v2/__tests__/MobileRowCard.test.js +100 -102
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
- package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/v2/__tests__/apiError.test.js +50 -69
- package/dist/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/v2/__tests__/banned-patterns.test.js +42 -123
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/v2/__tests__/chart-palette.test.js +205 -0
- package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/v2/__tests__/fileValidation.test.js +136 -0
- package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/v2/__tests__/filterCriteria.test.js +324 -0
- package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/fmtDate.test.js +69 -0
- package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +38 -46
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/v2/__tests__/locale-fallback.test.js +47 -52
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
- package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/rowActions.test.js +186 -0
- package/dist/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/v2/components/Accordion.js +60 -82
- package/dist/v2/components/Accordion.js.map +1 -1
- package/dist/v2/components/ActionStrip.js +40 -52
- package/dist/v2/components/ActionStrip.js.map +1 -1
- package/dist/v2/components/Banner.js +42 -41
- package/dist/v2/components/Banner.js.map +1 -1
- package/dist/v2/components/Busy.js +22 -27
- package/dist/v2/components/Busy.js.map +1 -1
- package/dist/v2/components/Button.js +39 -50
- package/dist/v2/components/Button.js.map +1 -1
- package/dist/v2/components/CategoryTag.d.ts.map +1 -1
- package/dist/v2/components/CategoryTag.js +49 -32
- package/dist/v2/components/CategoryTag.js.map +1 -1
- package/dist/v2/components/Checkbox.js +39 -45
- package/dist/v2/components/Checkbox.js.map +1 -1
- package/dist/v2/components/Chip.js +29 -42
- package/dist/v2/components/Chip.js.map +1 -1
- package/dist/v2/components/Combobox.js +122 -144
- package/dist/v2/components/Combobox.js.map +1 -1
- package/dist/v2/components/CommandPalette.js +138 -225
- package/dist/v2/components/CommandPalette.js.map +1 -1
- package/dist/v2/components/ConfirmDialog.js +46 -56
- package/dist/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/v2/components/DatePicker.js +81 -86
- package/dist/v2/components/DatePicker.js.map +1 -1
- package/dist/v2/components/DateRangePicker.js +77 -87
- package/dist/v2/components/DateRangePicker.js.map +1 -1
- package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
- package/dist/v2/components/DateTimePicker.js +121 -95
- package/dist/v2/components/DateTimePicker.js.map +1 -1
- package/dist/v2/components/Drawer.d.ts.map +1 -1
- package/dist/v2/components/Drawer.js +93 -88
- package/dist/v2/components/Drawer.js.map +1 -1
- package/dist/v2/components/Dropzone.js +150 -196
- package/dist/v2/components/Dropzone.js.map +1 -1
- package/dist/v2/components/EmptyState.js +18 -20
- package/dist/v2/components/EmptyState.js.map +1 -1
- package/dist/v2/components/FavoriteToggle.js +28 -39
- package/dist/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/v2/components/Field.d.ts +121 -5
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +221 -62
- package/dist/v2/components/Field.js.map +1 -1
- package/dist/v2/components/FieldError.js +18 -21
- package/dist/v2/components/FieldError.js.map +1 -1
- package/dist/v2/components/FieldHelp.js +40 -60
- package/dist/v2/components/FieldHelp.js.map +1 -1
- package/dist/v2/components/FileCard.js +27 -31
- package/dist/v2/components/FileCard.js.map +1 -1
- package/dist/v2/components/FilterTab.js +30 -38
- package/dist/v2/components/FilterTab.js.map +1 -1
- package/dist/v2/components/ForbiddenPage.d.ts +25 -1
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
- package/dist/v2/components/ForbiddenPage.js +37 -17
- package/dist/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/v2/components/FormGrid.js +53 -59
- package/dist/v2/components/FormGrid.js.map +1 -1
- package/dist/v2/components/FormikDisplay.d.ts +50 -1
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
- package/dist/v2/components/FormikDisplay.js +108 -33
- package/dist/v2/components/FormikDisplay.js.map +1 -1
- package/dist/v2/components/Input.d.ts +40 -0
- package/dist/v2/components/Input.d.ts.map +1 -1
- package/dist/v2/components/Input.js +81 -41
- package/dist/v2/components/Input.js.map +1 -1
- package/dist/v2/components/KPICard.js +57 -67
- package/dist/v2/components/KPICard.js.map +1 -1
- package/dist/v2/components/KPIStrip.js +16 -22
- package/dist/v2/components/KPIStrip.js.map +1 -1
- package/dist/v2/components/KV.js +25 -31
- package/dist/v2/components/KV.js.map +1 -1
- package/dist/v2/components/KVGrid.js +19 -26
- package/dist/v2/components/KVGrid.js.map +1 -1
- package/dist/v2/components/Layout.js +91 -120
- package/dist/v2/components/Layout.js.map +1 -1
- package/dist/v2/components/MobileRowCard.js +79 -91
- package/dist/v2/components/MobileRowCard.js.map +1 -1
- package/dist/v2/components/Modal.js +61 -69
- package/dist/v2/components/Modal.js.map +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
- package/dist/v2/components/NetworkErrorPage.js +38 -21
- package/dist/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/v2/components/NotFoundPage.d.ts +17 -1
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
- package/dist/v2/components/NotFoundPage.js +37 -18
- package/dist/v2/components/NotFoundPage.js.map +1 -1
- package/dist/v2/components/NumberInput.js +88 -118
- package/dist/v2/components/NumberInput.js.map +1 -1
- package/dist/v2/components/OverflowMenu.js +38 -56
- package/dist/v2/components/OverflowMenu.js.map +1 -1
- package/dist/v2/components/PdfViewer.js +34 -45
- package/dist/v2/components/PdfViewer.js.map +1 -1
- package/dist/v2/components/ProgressBar.js +42 -49
- package/dist/v2/components/ProgressBar.js.map +1 -1
- package/dist/v2/components/Radio.js +59 -67
- package/dist/v2/components/Radio.js.map +1 -1
- package/dist/v2/components/SectionErrorBoundary.js +90 -135
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/v2/components/SectionHeader.js +34 -41
- package/dist/v2/components/SectionHeader.js.map +1 -1
- package/dist/v2/components/Segmented.js +69 -93
- package/dist/v2/components/Segmented.js.map +1 -1
- package/dist/v2/components/Select.d.ts +26 -2
- package/dist/v2/components/Select.d.ts.map +1 -1
- package/dist/v2/components/Select.js +120 -155
- package/dist/v2/components/Select.js.map +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts +27 -1
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
- package/dist/v2/components/ServerErrorPage.js +37 -20
- package/dist/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/v2/components/Skeleton.js +86 -100
- package/dist/v2/components/Skeleton.js.map +1 -1
- package/dist/v2/components/SkipLink.js +9 -12
- package/dist/v2/components/SkipLink.js.map +1 -1
- package/dist/v2/components/Spinner.js +16 -25
- package/dist/v2/components/Spinner.js.map +1 -1
- package/dist/v2/components/Status.js +18 -29
- package/dist/v2/components/Status.js.map +1 -1
- package/dist/v2/components/Stepper.js +80 -82
- package/dist/v2/components/Stepper.js.map +1 -1
- package/dist/v2/components/Surface.js +34 -49
- package/dist/v2/components/Surface.js.map +1 -1
- package/dist/v2/components/Switch.js +29 -37
- package/dist/v2/components/Switch.js.map +1 -1
- package/dist/v2/components/TabPanel.d.ts +17 -0
- package/dist/v2/components/TabPanel.d.ts.map +1 -0
- package/dist/v2/components/TabPanel.js +90 -0
- package/dist/v2/components/TabPanel.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +25 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -1
- package/dist/v2/components/Tabs.js +53 -29
- package/dist/v2/components/Tabs.js.map +1 -1
- package/dist/v2/components/TelInput.js +80 -115
- package/dist/v2/components/TelInput.js.map +1 -1
- package/dist/v2/components/Textarea.js +26 -35
- package/dist/v2/components/Textarea.js.map +1 -1
- package/dist/v2/components/TimePicker.js +62 -74
- package/dist/v2/components/TimePicker.js.map +1 -1
- package/dist/v2/components/Toast.js +119 -174
- package/dist/v2/components/Toast.js.map +1 -1
- package/dist/v2/components/Tooltip.js +23 -38
- package/dist/v2/components/Tooltip.js.map +1 -1
- package/dist/v2/components/_ErrorPageBody.js +15 -16
- package/dist/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/v2/components/_pickerShared.js +5 -5
- package/dist/v2/components/_pickerShared.js.map +1 -1
- package/dist/v2/components/index.d.ts +67 -1
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/components/index.js +153 -136
- package/dist/v2/components/index.js.map +1 -1
- package/dist/v2/hooks/index.d.ts +65 -0
- package/dist/v2/hooks/index.d.ts.map +1 -1
- package/dist/v2/hooks/index.js +63 -24
- package/dist/v2/hooks/index.js.map +1 -1
- package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
- package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
- package/dist/v2/hooks/useAppliedFilters.js +117 -0
- package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.js +87 -0
- package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +6 -20
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/v2/hooks/useDensity.d.ts.map +1 -1
- package/dist/v2/hooks/useDensity.js +14 -18
- package/dist/v2/hooks/useDensity.js.map +1 -1
- package/dist/v2/hooks/useFocusFirstError.js +26 -34
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +20 -24
- package/dist/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.js +39 -54
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +5 -13
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/v2/hooks/useSortedRows.js +4 -6
- package/dist/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/v2/hooks/useTabLoading.js +7 -22
- package/dist/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/index.js +143 -145
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/modalContext.js +2 -2
- package/dist/v2/modalContext.js.map +1 -1
- package/dist/v2/models/favorite.d.ts +8 -9
- package/dist/v2/models/favorite.d.ts.map +1 -1
- package/dist/v2/models/favorite.js.map +1 -1
- package/dist/v2/models/index.js +4 -4
- package/dist/v2/models/index.js.map +1 -1
- package/dist/v2/models/personalization.d.ts +44 -48
- package/dist/v2/models/personalization.d.ts.map +1 -1
- package/dist/v2/models/personalization.js.map +1 -1
- package/dist/v2/models/referentiel.d.ts +32 -50
- package/dist/v2/models/referentiel.d.ts.map +1 -1
- package/dist/v2/models/referentiel.js.map +1 -1
- package/dist/v2/models/savedFilter.d.ts +8 -17
- package/dist/v2/models/savedFilter.d.ts.map +1 -1
- package/dist/v2/models/savedFilter.js.map +1 -1
- package/dist/v2/patterns/ActionBar.js +152 -187
- package/dist/v2/patterns/ActionBar.js.map +1 -1
- package/dist/v2/patterns/AppMain.d.ts +109 -0
- package/dist/v2/patterns/AppMain.d.ts.map +1 -0
- package/dist/v2/patterns/AppMain.js +115 -0
- package/dist/v2/patterns/AppMain.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +40 -42
- package/dist/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/v2/patterns/ChartFigure.d.ts +124 -0
- package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
- package/dist/v2/patterns/ChartFigure.js +159 -0
- package/dist/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.js +60 -94
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
- package/dist/v2/patterns/DataGrid.js +262 -297
- package/dist/v2/patterns/DataGrid.js.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.js +103 -106
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.js +179 -217
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/v2/patterns/DetailSplit.d.ts +87 -0
- package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
- package/dist/v2/patterns/DetailSplit.js +116 -0
- package/dist/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts +9 -9
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
- package/dist/v2/patterns/FavoriteColumn.js +32 -80
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.js +36 -44
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
- package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
- package/dist/v2/patterns/FilterTabBar.js +120 -0
- package/dist/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +20 -23
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/v2/patterns/FormPageShell.js +53 -50
- package/dist/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/v2/patterns/FormSection.d.ts +8 -3
- package/dist/v2/patterns/FormSection.d.ts.map +1 -1
- package/dist/v2/patterns/FormSection.js +44 -51
- package/dist/v2/patterns/FormSection.js.map +1 -1
- package/dist/v2/patterns/FormikCheckbox.d.ts +77 -0
- package/dist/v2/patterns/FormikCheckbox.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCheckbox.js +138 -0
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/v2/patterns/FormikCombobox.d.ts +7 -1
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js +55 -69
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts +13 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +59 -106
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.d.ts +111 -0
- package/dist/v2/patterns/FormikDateTimePicker.d.ts.map +1 -0
- package/dist/v2/patterns/FormikDateTimePicker.js +144 -0
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.js +25 -26
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
- package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorSummary.js +97 -0
- package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +14 -1
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
- package/dist/v2/patterns/FormikFile.js +99 -83
- package/dist/v2/patterns/FormikFile.js.map +1 -1
- package/dist/v2/patterns/FormikInput.d.ts +11 -1
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
- package/dist/v2/patterns/FormikInput.js +45 -55
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.d.ts +80 -0
- package/dist/v2/patterns/FormikRadioGroup.d.ts.map +1 -0
- package/dist/v2/patterns/FormikRadioGroup.js +137 -0
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.js +54 -64
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/v2/patterns/FormikSelect.d.ts +9 -1
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +70 -89
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.d.ts +9 -1
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -48
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +14 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +71 -74
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/v2/patterns/PageContent.js +17 -20
- package/dist/v2/patterns/PageContent.js.map +1 -1
- package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
- package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
- package/dist/v2/patterns/PreviewDrawer.js +159 -0
- package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +86 -2
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/ReferentielField.js +347 -327
- package/dist/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.d.ts +98 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -0
- package/dist/v2/patterns/RowFavoriteToggle.js +135 -0
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.js +50 -77
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.js +122 -143
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/v2/patterns/SortableHeader.js +35 -57
- package/dist/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/v2/patterns/Tour.js +121 -142
- package/dist/v2/patterns/Tour.js.map +1 -1
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
- package/dist/v2/patterns/_dataGridShared.js +131 -147
- package/dist/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/v2/patterns/_pickerSerialisation.d.ts +44 -0
- package/dist/v2/patterns/_pickerSerialisation.d.ts.map +1 -0
- package/dist/v2/patterns/_pickerSerialisation.js +80 -0
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -0
- package/dist/v2/patterns/_sort.js +17 -33
- package/dist/v2/patterns/_sort.js.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.js +124 -163
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/v2/patterns/_useColumnResize.js +80 -99
- package/dist/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/v2/patterns/filterCriteria.d.ts +78 -0
- package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
- package/dist/v2/patterns/filterCriteria.js +110 -0
- package/dist/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +247 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +182 -70
- package/dist/v2/patterns/index.js.map +1 -1
- package/dist/v2/patterns/rowActions.d.ts +150 -0
- package/dist/v2/patterns/rowActions.d.ts.map +1 -0
- package/dist/v2/patterns/rowActions.js +232 -0
- package/dist/v2/patterns/rowActions.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.js +57 -53
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/index.js +5 -5
- package/dist/v2/personalization/adapters/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/favorites.js +39 -62
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/v2/personalization/capabilities/gridPreferences.d.ts +100 -0
- package/dist/v2/personalization/capabilities/gridPreferences.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js +210 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/v2/personalization/capabilities/index.d.ts +6 -0
- package/dist/v2/personalization/capabilities/index.d.ts.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +23 -10
- package/dist/v2/personalization/capabilities/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.js +81 -182
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/v2/personalization/index.d.ts +34 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +41 -21
- package/dist/v2/personalization/index.js.map +1 -1
- package/dist/v2/personalization/personalizationContext.js +10 -12
- package/dist/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/v2/personalization/schema.js +8 -9
- package/dist/v2/personalization/schema.js.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.js +31 -45
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/v2/referentiel/index.js +11 -13
- package/dist/v2/referentiel/index.js.map +1 -1
- package/dist/v2/referentiel/types.d.ts +105 -0
- package/dist/v2/referentiel/types.d.ts.map +1 -0
- package/dist/v2/referentiel/types.js +6 -0
- package/dist/v2/referentiel/types.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +13 -16
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.js +63 -120
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.js +40 -95
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/v2/theme/_brand.js +12 -26
- package/dist/v2/theme/_brand.js.map +1 -1
- package/dist/v2/theme/_brandSecondary.js +12 -26
- package/dist/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/v2/theme/createPortnetTheme.js +41 -49
- package/dist/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/v2/theme/cssVariables.d.ts +3 -3
- package/dist/v2/theme/cssVariables.d.ts.map +1 -1
- package/dist/v2/theme/cssVariables.js +65 -70
- package/dist/v2/theme/cssVariables.js.map +1 -1
- package/dist/v2/theme/index.js +10 -10
- package/dist/v2/theme/index.js.map +1 -1
- package/dist/v2/tokens/breakpoints.js +16 -16
- package/dist/v2/tokens/breakpoints.js.map +1 -1
- package/dist/v2/tokens/chart.d.ts +103 -0
- package/dist/v2/tokens/chart.d.ts.map +1 -0
- package/dist/v2/tokens/chart.js +270 -0
- package/dist/v2/tokens/chart.js.map +1 -0
- package/dist/v2/tokens/colors.js +24 -24
- package/dist/v2/tokens/colors.js.map +1 -1
- package/dist/v2/tokens/density.d.ts +104 -0
- package/dist/v2/tokens/density.d.ts.map +1 -1
- package/dist/v2/tokens/density.js +67 -12
- package/dist/v2/tokens/density.js.map +1 -1
- package/dist/v2/tokens/index.d.ts +50 -1
- package/dist/v2/tokens/index.d.ts.map +1 -1
- package/dist/v2/tokens/index.js +116 -68
- package/dist/v2/tokens/index.js.map +1 -1
- package/dist/v2/tokens/motion.js +16 -22
- package/dist/v2/tokens/motion.js.map +1 -1
- package/dist/v2/tokens/radius.js +3 -3
- package/dist/v2/tokens/radius.js.map +1 -1
- package/dist/v2/tokens/shadows.js +8 -8
- package/dist/v2/tokens/shadows.js.map +1 -1
- package/dist/v2/tokens/spacing.js +4 -4
- package/dist/v2/tokens/spacing.js.map +1 -1
- package/dist/v2/tokens/state.js +3 -3
- package/dist/v2/tokens/state.js.map +1 -1
- package/dist/v2/tokens/statusPalette.js +21 -23
- package/dist/v2/tokens/statusPalette.js.map +1 -1
- package/dist/v2/tokens/tokens.json +6 -1
- package/dist/v2/tokens/typography.js +15 -15
- package/dist/v2/tokens/typography.js.map +1 -1
- package/dist/v2/tokens/zIndex.js +3 -3
- package/dist/v2/tokens/zIndex.js.map +1 -1
- package/dist/v2/types/datagrid.d.ts +9 -1
- package/dist/v2/types/datagrid.d.ts.map +1 -1
- package/dist/v2/types/datagrid.js.map +1 -1
- package/dist/v2/types/index.js +2 -2
- package/dist/v2/types/index.js.map +1 -1
- package/dist/v2/utils/apiError.js +16 -37
- package/dist/v2/utils/apiError.js.map +1 -1
- package/dist/v2/utils/contrast.js +31 -32
- package/dist/v2/utils/contrast.js.map +1 -1
- package/dist/v2/utils/cx.js +7 -27
- package/dist/v2/utils/cx.js.map +1 -1
- package/dist/v2/utils/fileDownload.js +25 -28
- package/dist/v2/utils/fileDownload.js.map +1 -1
- package/dist/v2/utils/fileValidation.d.ts +116 -0
- package/dist/v2/utils/fileValidation.d.ts.map +1 -0
- package/dist/v2/utils/fileValidation.js +220 -0
- package/dist/v2/utils/fileValidation.js.map +1 -0
- package/dist/v2/utils/fmtDate.d.ts +103 -0
- package/dist/v2/utils/fmtDate.d.ts.map +1 -0
- package/dist/v2/utils/fmtDate.js +119 -0
- package/dist/v2/utils/fmtDate.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +3 -3
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
- package/dist/v2/utils/fmtMoney.js +9 -11
- package/dist/v2/utils/fmtMoney.js.map +1 -1
- package/dist/v2/utils/formikErrors.d.ts +67 -0
- package/dist/v2/utils/formikErrors.d.ts.map +1 -0
- package/dist/v2/utils/formikErrors.js +85 -0
- package/dist/v2/utils/formikErrors.js.map +1 -0
- package/dist/v2/utils/index.d.ts +5 -0
- package/dist/v2/utils/index.d.ts.map +1 -1
- package/dist/v2/utils/index.js +67 -18
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/mergeLabels.js +9 -14
- package/dist/v2/utils/mergeLabels.js.map +1 -1
- package/dist/v2/utils/networkStatus.js +14 -14
- package/dist/v2/utils/networkStatus.js.map +1 -1
- package/package.json +26 -9
|
@@ -1 +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":[]}
|
|
1
|
+
{"version":3,"file":"FavoriteColumn.js","names":["React","Box","RowFavoriteToggle","DEFAULT_ROW_FAVORITE_LABELS","jsx","_jsx","DEFAULT_LABELS","Object","freeze","columnHeader","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","makeFavoriteColumn","options","opts","resourceKey","getRowId","defaultGetRowId","r","id","key","size","getRowLabel","L","labels","process","env","console","warn","header","component","sx","children","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","rowId","rowLabel","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 RowFavoriteToggle, {\r\n DEFAULT_ROW_FAVORITE_LABELS,\r\n} from \"./RowFavoriteToggle\";\r\nimport type {\r\n FavoriteToggleSize,\r\n RowFavoriteToggleLabels,\r\n} from \"./RowFavoriteToggle\";\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 * The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a\r\n * private `FavoriteCell` in this file, which made the follow control reachable\r\n * as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the\r\n * `MobileRowCard` `leading` slot that DataGrid switches to below its\r\n * `mobileBreakpoint`, and the copies drifted on their accessible names. Both\r\n * now render the same component, so desktop and mobile agree by construction.\r\n */\r\n\r\nexport interface FavoriteColumnLabels extends RowFavoriteToggleLabels {\r\n columnHeader: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n ...DEFAULT_ROW_FAVORITE_LABELS,\r\n columnHeader: \"Suivis\",\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\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 <RowFavoriteToggle\r\n resourceKey={resourceKey}\r\n rowId={getRowId(row)}\r\n size={size}\r\n labels={L}\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":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
1
|
import * as React from "react";
|
|
8
2
|
import StarRoundedIcon from "@mui/icons-material/StarRounded";
|
|
9
3
|
import Segmented from "../components/Segmented";
|
|
@@ -32,7 +26,7 @@ import { mergeLabels } from "../utils/mergeLabels";
|
|
|
32
26
|
* it span its row on narrow / mobile toolbars.
|
|
33
27
|
*/
|
|
34
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
-
|
|
29
|
+
const DEFAULT_LABELS = Object.freeze({
|
|
36
30
|
all: "Tous",
|
|
37
31
|
favorites: "Suivis",
|
|
38
32
|
ariaLabel: "Filtrer par suivis"
|
|
@@ -41,51 +35,48 @@ function withCount(label, count) {
|
|
|
41
35
|
return typeof count === "number" ? label + " (" + count + ")" : label;
|
|
42
36
|
}
|
|
43
37
|
function FavoritesFilter(props) {
|
|
44
|
-
|
|
45
|
-
value =
|
|
46
|
-
onChange
|
|
47
|
-
favoriteCount
|
|
48
|
-
totalCount
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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() {
|
|
38
|
+
const {
|
|
39
|
+
value = "all",
|
|
40
|
+
onChange,
|
|
41
|
+
favoriteCount,
|
|
42
|
+
totalCount,
|
|
43
|
+
showCounts = true,
|
|
44
|
+
showIcon = true,
|
|
45
|
+
size = "sm",
|
|
46
|
+
fullWidth = false,
|
|
47
|
+
labels,
|
|
48
|
+
sx
|
|
49
|
+
} = props;
|
|
50
|
+
const L = React.useMemo(() => mergeLabels(DEFAULT_LABELS, labels), [labels]);
|
|
51
|
+
const options = React.useMemo(function buildOptions() {
|
|
63
52
|
return [{
|
|
64
53
|
value: "all",
|
|
65
54
|
label: showCounts ? withCount(L.all, totalCount) : L.all
|
|
66
|
-
},
|
|
55
|
+
}, {
|
|
67
56
|
value: "only",
|
|
68
|
-
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
57
|
+
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites,
|
|
58
|
+
...(showIcon ? {
|
|
59
|
+
icon: /*#__PURE__*/_jsx(StarRoundedIcon, {
|
|
60
|
+
fontSize: "small"
|
|
61
|
+
})
|
|
62
|
+
} : {})
|
|
63
|
+
}];
|
|
74
64
|
}, [L, showCounts, showIcon, totalCount, favoriteCount]);
|
|
75
|
-
|
|
65
|
+
const handleChange = React.useCallback(function handleChange(v) {
|
|
76
66
|
// Segmented emits its configured option values only ("all" / "only").
|
|
77
67
|
if (onChange) onChange(v);
|
|
78
68
|
}, [onChange]);
|
|
79
|
-
return /*#__PURE__*/_jsx(Segmented,
|
|
69
|
+
return /*#__PURE__*/_jsx(Segmented, {
|
|
80
70
|
value: value,
|
|
81
71
|
onChange: handleChange,
|
|
82
72
|
options: options,
|
|
83
73
|
size: size,
|
|
84
74
|
fullWidth: fullWidth,
|
|
85
|
-
"aria-label": L.ariaLabel
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
"aria-label": L.ariaLabel,
|
|
76
|
+
...(sx !== undefined ? {
|
|
77
|
+
sx
|
|
78
|
+
} : {})
|
|
79
|
+
});
|
|
89
80
|
}
|
|
90
81
|
export default FavoritesFilter;
|
|
91
82
|
//# sourceMappingURL=FavoritesFilter.js.map
|
|
@@ -1 +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","
|
|
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","value","onChange","favoriteCount","totalCount","showCounts","showIcon","size","fullWidth","labels","sx","L","useMemo","options","buildOptions","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":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,eAAe,MAAM,iCAAiC;AAG7D,OAAOC,SAAS,MAAM,yBAAyB;AAG/C,SAASC,WAAW,QAAQ,sBAAsB;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArBA,SAAAC,GAAA,IAAAC,IAAA;AA6BA,MAAMC,cAAc,GAAGC,MAAM,CAACC,MAAM,CAAC;EACnCC,GAAG,EAAE,MAAM;EACXC,SAAS,EAAE,QAAQ;EACnBC,SAAS,EAAE;AACb,CAAiC,CAAC;AAElC,SAASC,SAASA,CAACC,KAAa,EAAEC,KAAyB,EAAU;EACnE,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGD,KAAK,GAAG,IAAI,GAAGC,KAAK,GAAG,GAAG,GAAGD,KAAK;AACvE;AAqBA,SAASE,eAAeA,CAACC,KAA2B,EAAqB;EACvE,MAAM;IACJC,KAAK,GAAG,KAAK;IACbC,QAAQ;IACRC,aAAa;IACbC,UAAU;IACVC,UAAU,GAAG,IAAI;IACjBC,QAAQ,GAAG,IAAI;IACfC,IAAI,GAAG,IAAI;IACXC,SAAS,GAAG,KAAK;IACjBC,MAAM;IACNC;EACF,CAAC,GAAGV,KAAK;EACT,MAAMW,CAAC,GAAG3B,KAAK,CAAC4B,OAAO,CACrB,MAAOzB,WAAW,CAACG,cAAc,EAAEmB,MAAM,CAAE,EAC3C,CAACA,MAAM,CACT,CAAC;EAED,MAAMI,OAAO,GAAG7B,KAAK,CAAC4B,OAAO,CAC3B,SAASE,YAAYA,CAAA,EAAG;IACtB,OAAO,CACL;MACEb,KAAK,EAAE,KAAK;MACZJ,KAAK,EAAEQ,UAAU,GAAGT,SAAS,CAACe,CAAC,CAAClB,GAAG,EAAEW,UAAU,CAAC,GAAGO,CAAC,CAAClB;IACvD,CAAC,EACD;MACEQ,KAAK,EAAE,MAAM;MACbJ,KAAK,EAAEQ,UAAU,GACbT,SAAS,CAACe,CAAC,CAACjB,SAAS,EAAES,aAAa,CAAC,GACrCQ,CAAC,CAACjB,SAAS;MACf,IAAIY,QAAQ,GAAG;QAAES,IAAI,eAAE1B,IAAA,CAACJ,eAAe;UAAC+B,QAAQ,EAAC;QAAO,CAAE;MAAE,CAAC,GAAG,CAAC,CAAC;IACpE,CAAC,CACF;EACH,CAAC,EACD,CAACL,CAAC,EAAEN,UAAU,EAAEC,QAAQ,EAAEF,UAAU,EAAED,aAAa,CACrD,CAAC;EAED,MAAMc,YAAY,GAAGjC,KAAK,CAACkC,WAAW,CACpC,SAASD,YAAYA,CAACE,CAAiB,EAAQ;IAC7C;IACA,IAAIjB,QAAQ,EAAEA,QAAQ,CAACiB,CAAwB,CAAC;EAClD,CAAC,EACD,CAACjB,QAAQ,CACX,CAAC;EAED,oBACEb,IAAA,CAACH,SAAS;IACRe,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEe,YAAa;IACvBJ,OAAO,EAAEA,OAAQ;IACjBN,IAAI,EAAEA,IAAK;IACXC,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAAChB,SAAU;IAAA,IACnBe,EAAE,KAAKU,SAAS,GAAG;MAAEV;IAAG,CAAC,GAAG,CAAC,CAAC;EAAA,CACpC,CAAC;AAEN;AAEA,eAAeX,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
/**
|
|
5
|
+
* FilterTabBar — Portnet UI v2 (pattern)
|
|
6
|
+
*
|
|
7
|
+
* Charter §03 · Platform Mandatory UX Patterns §Status Chips, §Favorites,
|
|
8
|
+
* §User Personalization.
|
|
9
|
+
*
|
|
10
|
+
* The bar that seats the status pills at the top of a listing card. The
|
|
11
|
+
* library shipped `FilterTab` — the pill — and nothing to seat them in,
|
|
12
|
+
* so every listing re-derived the same row: the geometry, the card-header
|
|
13
|
+
* separator, and the split between the status group on the left and the
|
|
14
|
+
* personalization controls (favorites toggle, saved filters) on the right.
|
|
15
|
+
*
|
|
16
|
+
* Promoted from `refonte-frontend` (Area 5), where FOUR listings carried
|
|
17
|
+
* the identical pair of frozen style objects:
|
|
18
|
+
*
|
|
19
|
+
* const BARRE_CHIPS_STATUT = { display: "flex", flexWrap: "wrap",
|
|
20
|
+
* alignItems: "center", justifyContent: "space-between",
|
|
21
|
+
* gap: "var(--s-2)", padding: "var(--s-3) var(--s-4)",
|
|
22
|
+
* borderBottom: "1px solid var(--border)" };
|
|
23
|
+
* const GROUPE_BARRE = { display: "flex", flexWrap: "wrap",
|
|
24
|
+
* alignItems: "center", gap: "var(--s-2)" };
|
|
25
|
+
*
|
|
26
|
+
* THE COPIES HAD ALREADY DRIFTED, which is the whole argument: one of the
|
|
27
|
+
* four omitted `justifyContent: "space-between"`, so its right-hand group
|
|
28
|
+
* sat against the pills instead of at the far edge — the same listing,
|
|
29
|
+
* two layouts, on screens a user moves between in one session (R-2.1).
|
|
30
|
+
*
|
|
31
|
+
* TWO GROUPS, TWO LANDMARKS. Each half renders as `role="group"` with its
|
|
32
|
+
* own accessible name rather than one flat row of buttons: a listing
|
|
33
|
+
* commonly shows eight or more pills, and a screen-reader user needs to
|
|
34
|
+
* know where the status filters end and the personalization controls
|
|
35
|
+
* begin. The names default to French, per this library's label
|
|
36
|
+
* convention; override them on a localised host.
|
|
37
|
+
*
|
|
38
|
+
* THE SEPARATOR ASSUMES THE CANONICAL CARD. §07 stacks this bar directly
|
|
39
|
+
* above the toolbar and the grid inside a single
|
|
40
|
+
* `<Surface padding="none" elevation="xs" clip>`, and `borderBottom`
|
|
41
|
+
* is what makes the bar read as that card's header instead of a floating
|
|
42
|
+
* row. Pass `divider={false}` when the bar is not the first child of a
|
|
43
|
+
* card.
|
|
44
|
+
*
|
|
45
|
+
* Usage:
|
|
46
|
+
* <Surface padding="none" elevation="xs" clip>
|
|
47
|
+
* <FilterTabBar
|
|
48
|
+
* end={
|
|
49
|
+
* <>
|
|
50
|
+
* <FavoritesFilter … />
|
|
51
|
+
* <SavedFiltersMenu … />
|
|
52
|
+
* </>
|
|
53
|
+
* }
|
|
54
|
+
* >
|
|
55
|
+
* <FilterTab active={!statut} variant="neutral" onClick={…}>Tous</FilterTab>
|
|
56
|
+
* {statuts.map((s) => (
|
|
57
|
+
* <FilterTab key={s.id} …>{s.description}</FilterTab>
|
|
58
|
+
* ))}
|
|
59
|
+
* </FilterTabBar>
|
|
60
|
+
*
|
|
61
|
+
* <DataGridToolbar … />
|
|
62
|
+
* <DataGrid … />
|
|
63
|
+
* </Surface>
|
|
64
|
+
*
|
|
65
|
+
* With no `end`, the pills simply fill the row — `space-between` on a
|
|
66
|
+
* single group behaves as `flex-start`, so no branch is needed.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
/** Geometry of one half of the bar. Both groups share it by construction. */
|
|
70
|
+
const GROUP_SX = Object.freeze({
|
|
71
|
+
display: "flex",
|
|
72
|
+
flexWrap: "wrap",
|
|
73
|
+
alignItems: "center",
|
|
74
|
+
gap: "var(--s-2)"
|
|
75
|
+
});
|
|
76
|
+
function FilterTabBar({
|
|
77
|
+
children,
|
|
78
|
+
end,
|
|
79
|
+
ariaLabel = "Filtrer par statut",
|
|
80
|
+
endAriaLabel = "Favoris et filtres enregistrés",
|
|
81
|
+
divider = true,
|
|
82
|
+
sx
|
|
83
|
+
}) {
|
|
84
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
85
|
+
sx: {
|
|
86
|
+
display: "flex",
|
|
87
|
+
flexWrap: "wrap",
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
/* Pills left, personalization right. Harmless with one group. */
|
|
90
|
+
justifyContent: "space-between",
|
|
91
|
+
gap: "var(--s-2)",
|
|
92
|
+
padding: "var(--s-3) var(--s-4)",
|
|
93
|
+
...(divider ? {
|
|
94
|
+
borderBottom: "1px solid var(--border)"
|
|
95
|
+
} : {}),
|
|
96
|
+
...sx
|
|
97
|
+
},
|
|
98
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
99
|
+
role: "group",
|
|
100
|
+
"aria-label": ariaLabel,
|
|
101
|
+
sx: GROUP_SX,
|
|
102
|
+
children: children
|
|
103
|
+
}), end != null ? /*#__PURE__*/_jsx(Box, {
|
|
104
|
+
role: "group",
|
|
105
|
+
"aria-label": endAriaLabel,
|
|
106
|
+
sx: GROUP_SX,
|
|
107
|
+
children: end
|
|
108
|
+
}) : null]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
export default FilterTabBar;
|
|
112
|
+
//# sourceMappingURL=FilterTabBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTabBar.js","names":["React","Box","jsx","_jsx","jsxs","_jsxs","GROUP_SX","Object","freeze","display","flexWrap","alignItems","gap","FilterTabBar","children","end","ariaLabel","endAriaLabel","divider","sx","justifyContent","padding","borderBottom","role"],"sources":["../../../../src/lib/v2/patterns/FilterTabBar.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport type { SystemStyleObject } from \"@mui/system\";\r\n\r\n/**\r\n * FilterTabBar — Portnet UI v2 (pattern)\r\n *\r\n * Charter §03 · Platform Mandatory UX Patterns §Status Chips, §Favorites,\r\n * §User Personalization.\r\n *\r\n * The bar that seats the status pills at the top of a listing card. The\r\n * library shipped `FilterTab` — the pill — and nothing to seat them in,\r\n * so every listing re-derived the same row: the geometry, the card-header\r\n * separator, and the split between the status group on the left and the\r\n * personalization controls (favorites toggle, saved filters) on the right.\r\n *\r\n * Promoted from `refonte-frontend` (Area 5), where FOUR listings carried\r\n * the identical pair of frozen style objects:\r\n *\r\n * const BARRE_CHIPS_STATUT = { display: \"flex\", flexWrap: \"wrap\",\r\n * alignItems: \"center\", justifyContent: \"space-between\",\r\n * gap: \"var(--s-2)\", padding: \"var(--s-3) var(--s-4)\",\r\n * borderBottom: \"1px solid var(--border)\" };\r\n * const GROUPE_BARRE = { display: \"flex\", flexWrap: \"wrap\",\r\n * alignItems: \"center\", gap: \"var(--s-2)\" };\r\n *\r\n * THE COPIES HAD ALREADY DRIFTED, which is the whole argument: one of the\r\n * four omitted `justifyContent: \"space-between\"`, so its right-hand group\r\n * sat against the pills instead of at the far edge — the same listing,\r\n * two layouts, on screens a user moves between in one session (R-2.1).\r\n *\r\n * TWO GROUPS, TWO LANDMARKS. Each half renders as `role=\"group\"` with its\r\n * own accessible name rather than one flat row of buttons: a listing\r\n * commonly shows eight or more pills, and a screen-reader user needs to\r\n * know where the status filters end and the personalization controls\r\n * begin. The names default to French, per this library's label\r\n * convention; override them on a localised host.\r\n *\r\n * THE SEPARATOR ASSUMES THE CANONICAL CARD. §07 stacks this bar directly\r\n * above the toolbar and the grid inside a single\r\n * `<Surface padding=\"none\" elevation=\"xs\" clip>`, and `borderBottom`\r\n * is what makes the bar read as that card's header instead of a floating\r\n * row. Pass `divider={false}` when the bar is not the first child of a\r\n * card.\r\n *\r\n * Usage:\r\n * <Surface padding=\"none\" elevation=\"xs\" clip>\r\n * <FilterTabBar\r\n * end={\r\n * <>\r\n * <FavoritesFilter … />\r\n * <SavedFiltersMenu … />\r\n * </>\r\n * }\r\n * >\r\n * <FilterTab active={!statut} variant=\"neutral\" onClick={…}>Tous</FilterTab>\r\n * {statuts.map((s) => (\r\n * <FilterTab key={s.id} …>{s.description}</FilterTab>\r\n * ))}\r\n * </FilterTabBar>\r\n *\r\n * <DataGridToolbar … />\r\n * <DataGrid … />\r\n * </Surface>\r\n *\r\n * With no `end`, the pills simply fill the row — `space-between` on a\r\n * single group behaves as `flex-start`, so no branch is needed.\r\n */\r\n\r\n/** Geometry of one half of the bar. Both groups share it by construction. */\r\nconst GROUP_SX = Object.freeze({\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n alignItems: \"center\",\r\n gap: \"var(--s-2)\",\r\n} as const);\r\n\r\nexport interface FilterTabBarProps {\r\n /** The status pills (`FilterTab`), left-hand group. */\r\n children?: React.ReactNode | undefined;\r\n /**\r\n * Right-hand group — typically `FavoritesFilter` + `SavedFiltersMenu`.\r\n * Omit it and the pills fill the row.\r\n */\r\n end?: React.ReactNode | undefined;\r\n /** Accessible name of the pill group. @default \"Filtrer par statut\" */\r\n ariaLabel?: string | undefined;\r\n /**\r\n * Accessible name of the right-hand group.\r\n * @default \"Favoris et filtres enregistrés\"\r\n */\r\n endAriaLabel?: string | undefined;\r\n /**\r\n * Bottom border marking the bar as the listing card's header.\r\n * @default true\r\n */\r\n divider?: boolean | undefined;\r\n /** MUI sx overrides applied to the bar. */\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FilterTabBar({\r\n children,\r\n end,\r\n ariaLabel = \"Filtrer par statut\",\r\n endAriaLabel = \"Favoris et filtres enregistrés\",\r\n divider = true,\r\n sx,\r\n}: FilterTabBarProps) {\r\n return (\r\n <Box\r\n sx={{\r\n display: \"flex\",\r\n flexWrap: \"wrap\",\r\n alignItems: \"center\",\r\n /* Pills left, personalization right. Harmless with one group. */\r\n justifyContent: \"space-between\",\r\n gap: \"var(--s-2)\",\r\n padding: \"var(--s-3) var(--s-4)\",\r\n ...(divider ? { borderBottom: \"1px solid var(--border)\" } : {}),\r\n ...(sx as SystemStyleObject<Theme>),\r\n }}\r\n >\r\n <Box role=\"group\" aria-label={ariaLabel} sx={GROUP_SX}>\r\n {children}\r\n </Box>\r\n\r\n {end != null ? (\r\n <Box role=\"group\" aria-label={endAriaLabel} sx={GROUP_SX}>\r\n {end}\r\n </Box>\r\n ) : null}\r\n </Box>\r\n );\r\n}\r\n\r\nexport default FilterTabBar;\r\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,MAAM,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAIpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAAC;EAC7BC,OAAO,EAAE,MAAM;EACfC,QAAQ,EAAE,MAAM;EAChBC,UAAU,EAAE,QAAQ;EACpBC,GAAG,EAAE;AACP,CAAU,CAAC;AA0BX,SAASC,YAAYA,CAAC;EACpBC,QAAQ;EACRC,GAAG;EACHC,SAAS,GAAG,oBAAoB;EAChCC,YAAY,GAAG,gCAAgC;EAC/CC,OAAO,GAAG,IAAI;EACdC;AACiB,CAAC,EAAE;EACpB,oBACEd,KAAA,CAACJ,GAAG;IACFkB,EAAE,EAAE;MACFV,OAAO,EAAE,MAAM;MACfC,QAAQ,EAAE,MAAM;MAChBC,UAAU,EAAE,QAAQ;MACpB;MACAS,cAAc,EAAE,eAAe;MAC/BR,GAAG,EAAE,YAAY;MACjBS,OAAO,EAAE,uBAAuB;MAChC,IAAIH,OAAO,GAAG;QAAEI,YAAY,EAAE;MAA0B,CAAC,GAAG,CAAC,CAAC,CAAC;MAC/D,GAAIH;IACN,CAAE;IAAAL,QAAA,gBAEFX,IAAA,CAACF,GAAG;MAACsB,IAAI,EAAC,OAAO;MAAC,cAAYP,SAAU;MAACG,EAAE,EAAEb,QAAS;MAAAQ,QAAA,EACnDA;IAAQ,CACN,CAAC,EAELC,GAAG,IAAI,IAAI,gBACVZ,IAAA,CAACF,GAAG;MAACsB,IAAI,EAAC,OAAO;MAAC,cAAYN,YAAa;MAACE,EAAE,EAAEb,QAAS;MAAAQ,QAAA,EACtDC;IAAG,CACD,CAAC,GACJ,IAAI;EAAA,CACL,CAAC;AAEV;AAEA,eAAeF,YAAY","ignoreList":[]}
|
|
@@ -28,14 +28,15 @@ import Banner from "../components/Banner";
|
|
|
28
28
|
* Charter R-AI.2: composition of v2.Banner only — no local primitive.
|
|
29
29
|
*/
|
|
30
30
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
|
-
function FormErrorSummary(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
function FormErrorSummary({
|
|
32
|
+
errors,
|
|
33
|
+
labelByName,
|
|
34
|
+
onItemClick,
|
|
35
|
+
title
|
|
36
|
+
}) {
|
|
36
37
|
if (!errors || errors.length === 0) return null;
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const heading = title || "Veuillez corriger les erreurs ci-dessous";
|
|
39
|
+
const handleClick = (e, name) => {
|
|
39
40
|
e.preventDefault();
|
|
40
41
|
if (typeof onItemClick === "function") {
|
|
41
42
|
onItemClick(name);
|
|
@@ -53,8 +54,8 @@ function FormErrorSummary(_ref) {
|
|
|
53
54
|
fontSize: "var(--text-sm)",
|
|
54
55
|
listStyle: "disc"
|
|
55
56
|
},
|
|
56
|
-
children: errors.map(
|
|
57
|
-
|
|
57
|
+
children: errors.map((err, idx) => {
|
|
58
|
+
const label = labelByName && labelByName[err.name] || err.name;
|
|
58
59
|
return /*#__PURE__*/_jsxs(Box, {
|
|
59
60
|
component: "li",
|
|
60
61
|
role: "listitem",
|
|
@@ -64,9 +65,7 @@ function FormErrorSummary(_ref) {
|
|
|
64
65
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
65
66
|
component: "button",
|
|
66
67
|
type: "button",
|
|
67
|
-
onClick:
|
|
68
|
-
return handleClick(e, err.name);
|
|
69
|
-
},
|
|
68
|
+
onClick: e => handleClick(e, err.name),
|
|
70
69
|
sx: {
|
|
71
70
|
// Reset default <button> chrome so the link reads visually
|
|
72
71
|
// as a hyperlink in the banner body.
|
|
@@ -92,7 +91,7 @@ function FormErrorSummary(_ref) {
|
|
|
92
91
|
}), ": ", /*#__PURE__*/_jsx("span", {
|
|
93
92
|
children: err.message
|
|
94
93
|
})]
|
|
95
|
-
},
|
|
94
|
+
}, `${err.name}-${idx}`);
|
|
96
95
|
})
|
|
97
96
|
})
|
|
98
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormErrorSummary.js","names":["React","Box","Banner","jsx","_jsx","jsxs","_jsxs","FormErrorSummary","
|
|
1
|
+
{"version":3,"file":"FormErrorSummary.js","names":["React","Box","Banner","jsx","_jsx","jsxs","_jsxs","FormErrorSummary","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"],"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":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,GAAG,MAAM,mBAAmB;AACnC,OAAOC,MAAM,MAAM,sBAAsB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxBA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAsCA,SAASC,gBAAgBA,CAAC;EACxBC,MAAM;EACNC,WAAW;EACXC,WAAW;EACXC;AACqB,CAAC,EAAE;EACxB,IAAI,CAACH,MAAM,IAAIA,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAE/C,MAAMC,OAAO,GAAGF,KAAK,IAAI,0CAA0C;EAEnE,MAAMG,WAAW,GAAGA,CAClBC,CAAsC,EACtCC,IAAY,KACT;IACHD,CAAC,CAACE,cAAc,CAAC,CAAC;IAClB,IAAI,OAAOP,WAAW,KAAK,UAAU,EAAE;MACrCA,WAAW,CAACM,IAAI,CAAC;IACnB;EACF,CAAC;EAED,oBACEZ,IAAA,CAACF,MAAM;IAACgB,OAAO,EAAC,OAAO;IAACP,KAAK,EAAEE,OAAQ;IAAAM,QAAA,eACrCf,IAAA,CAACH,GAAG;MACFmB,SAAS,EAAC,IAAI;MACdC,IAAI,EAAC,MAAM;MACXC,EAAE,EAAE;QACFC,MAAM,EAAE,CAAC;QACTC,kBAAkB,EAAE,YAAY;QAChCC,QAAQ,EAAE,gBAAgB;QAC1BC,SAAS,EAAE;MACb,CAAE;MAAAP,QAAA,EAEDX,MAAM,CAACmB,GAAG,CAAC,CAACC,GAAG,EAAEC,GAAG,KAAK;QACxB,MAAMC,KAAK,GAAIrB,WAAW,IAAIA,WAAW,CAACmB,GAAG,CAACZ,IAAI,CAAC,IAAKY,GAAG,CAACZ,IAAI;QAChE,oBACEV,KAAA,CAACL,GAAG;UACFmB,SAAS,EAAC,IAAI;UACdC,IAAI,EAAC,UAAU;UAEfC,EAAE,EAAE;YAAES,YAAY,EAAE;UAAa,CAAE;UAAAZ,QAAA,gBAEnCf,IAAA,CAACH,GAAG;YACFmB,SAAS,EAAC,QAAQ;YAClBY,IAAI,EAAC,QAAQ;YACbC,OAAO,EAAGlB,CAAC,IAAKD,WAAW,CAACC,CAAC,EAAEa,GAAG,CAACZ,IAAI,CAAE;YACzCM,EAAE,EAAE;cACF;cACA;cACAY,UAAU,EAAE,aAAa;cACzBC,MAAM,EAAE,MAAM;cACdC,OAAO,EAAE,CAAC;cACVb,MAAM,EAAE,CAAC;cACTc,IAAI,EAAE,SAAS;cACfC,MAAM,EAAE,SAAS;cACjBC,KAAK,EAAE,kBAAkB;cACzBC,cAAc,EAAE,WAAW;cAC3BC,UAAU,EAAE,kBAAkB;cAC9B;cACA;cACA;cACA,iBAAiB,EAAE;gBACjBC,OAAO,EAAE,4BAA4B;gBACrCC,aAAa,EAAE,2BAA2B;gBAC1CC,YAAY,EAAE;cAChB;YACF,CAAE;YAAAzB,QAAA,EAEDW;UAAK,CACH,CAAC,EACL,IAAI,eACL1B,IAAA;YAAAe,QAAA,EAAOS,GAAG,CAACiB;UAAO,CAAO,CAAC;QAAA,GAhCrB,GAAGjB,GAAG,CAACZ,IAAI,IAAIa,GAAG,EAiCpB,CAAC;MAEV,CAAC;IAAC,CACC;EAAC,CACA,CAAC;AAEb;AAEA,eAAetB,gBAAgB","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
1
|
import * as React from "react";
|
|
8
2
|
import Box from "@mui/material/Box";
|
|
9
3
|
import ActionBar from "./ActionBar";
|
|
@@ -46,17 +40,17 @@ import ProgressBar from "../components/ProgressBar";
|
|
|
46
40
|
* </FormPageShell>
|
|
47
41
|
*/
|
|
48
42
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
49
|
-
|
|
43
|
+
const PROGRESS_ROW_SX = Object.freeze({
|
|
50
44
|
display: "flex",
|
|
51
45
|
alignItems: "center",
|
|
52
46
|
gap: "var(--s-3)",
|
|
53
47
|
marginBottom: "var(--s-5)"
|
|
54
48
|
});
|
|
55
|
-
|
|
49
|
+
const PROGRESS_BAR_WRAPPER_SX = Object.freeze({
|
|
56
50
|
flex: 1,
|
|
57
51
|
minWidth: 0
|
|
58
52
|
});
|
|
59
|
-
|
|
53
|
+
const PROGRESS_LABEL_SX = Object.freeze({
|
|
60
54
|
fontSize: "var(--text-xs)",
|
|
61
55
|
color: "var(--fg-muted)",
|
|
62
56
|
whiteSpace: "nowrap",
|
|
@@ -69,42 +63,50 @@ var PROGRESS_LABEL_SX = Object.freeze({
|
|
|
69
63
|
* React 18.3+ supprime le support de defaultProps pour les function
|
|
70
64
|
* components. Aligné sur le pattern DataGridToolbar (B14).
|
|
71
65
|
*/
|
|
72
|
-
function FormPageShell(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
66
|
+
function FormPageShell({
|
|
67
|
+
/* ActionBar props */
|
|
68
|
+
home,
|
|
69
|
+
back,
|
|
70
|
+
breadcrumb,
|
|
71
|
+
title,
|
|
72
|
+
subtitle,
|
|
73
|
+
icon,
|
|
74
|
+
secondary = [],
|
|
75
|
+
primary,
|
|
76
|
+
overflow = [],
|
|
77
|
+
/* Progress slot */
|
|
78
|
+
progress,
|
|
79
|
+
progressLabel,
|
|
80
|
+
/* Content */
|
|
81
|
+
children,
|
|
82
|
+
contentSx
|
|
83
|
+
}) {
|
|
88
84
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
|
-
children: [/*#__PURE__*/_jsx(ActionBar,
|
|
85
|
+
children: [/*#__PURE__*/_jsx(ActionBar, {
|
|
90
86
|
surface: false,
|
|
91
87
|
title: title,
|
|
92
88
|
subtitle: subtitle,
|
|
93
89
|
secondary: secondary,
|
|
94
|
-
overflow: overflow
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
back
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
overflow: overflow,
|
|
91
|
+
...(home !== undefined ? {
|
|
92
|
+
home
|
|
93
|
+
} : {}),
|
|
94
|
+
...(back !== undefined ? {
|
|
95
|
+
back
|
|
96
|
+
} : {}),
|
|
97
|
+
...(breadcrumb !== undefined ? {
|
|
98
|
+
breadcrumb
|
|
99
|
+
} : {}),
|
|
100
|
+
...(icon !== undefined ? {
|
|
101
|
+
icon
|
|
102
|
+
} : {}),
|
|
103
|
+
...(primary !== undefined ? {
|
|
104
|
+
primary
|
|
105
|
+
} : {})
|
|
106
|
+
}), /*#__PURE__*/_jsxs(PageContent, {
|
|
107
|
+
...(contentSx !== undefined ? {
|
|
108
|
+
sx: contentSx
|
|
109
|
+
} : {}),
|
|
108
110
|
children: [typeof progress === "number" && /*#__PURE__*/_jsxs(Box, {
|
|
109
111
|
sx: PROGRESS_ROW_SX,
|
|
110
112
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
@@ -119,7 +121,7 @@ function FormPageShell(_ref) {
|
|
|
119
121
|
children: progressLabel
|
|
120
122
|
})]
|
|
121
123
|
}), children]
|
|
122
|
-
})
|
|
124
|
+
})]
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
127
|
export default FormPageShell;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormPageShell.js","names":["React","Box","ActionBar","PageContent","ProgressBar","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PROGRESS_ROW_SX","Object","freeze","display","alignItems","gap","marginBottom","PROGRESS_BAR_WRAPPER_SX","flex","minWidth","PROGRESS_LABEL_SX","fontSize","color","whiteSpace","fontVariantNumeric","flexShrink","FormPageShell","
|
|
1
|
+
{"version":3,"file":"FormPageShell.js","names":["React","Box","ActionBar","PageContent","ProgressBar","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","PROGRESS_ROW_SX","Object","freeze","display","alignItems","gap","marginBottom","PROGRESS_BAR_WRAPPER_SX","flex","minWidth","PROGRESS_LABEL_SX","fontSize","color","whiteSpace","fontVariantNumeric","flexShrink","FormPageShell","home","back","breadcrumb","title","subtitle","icon","secondary","primary","overflow","progress","progressLabel","children","contentSx","surface","undefined","sx","value","component"],"sources":["../../../../src/lib/v2/patterns/FormPageShell.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\nimport ActionBar, { type ActionBarProps } from \"./ActionBar\";\r\nimport PageContent from \"./PageContent\";\r\nimport ProgressBar from \"../components/ProgressBar\";\r\n\r\n/**\r\n * FormPageShell — Portnet UI v2 (pattern)\r\n *\r\n * Charter §07 R-L.2 — canonical shell for create/edit form pages.\r\n *\r\n * Combines a sticky ActionBar (surface=false, accent title) with a\r\n * responsive PageContent wrapper so every module's form page has the\r\n * same structure without reimplementing it.\r\n *\r\n * ┌───────────────────────────────────────────────────────────────┐\r\n * │ 🏠 > Breadcrumb │ sticky\r\n * │ Title [secondary] [primary] [overflow…] │\r\n * │ Subtitle │\r\n * └───────────────────────────────────────────────────────────────┘\r\n * ┌───────────────────────────────────────────────────────────────┐\r\n * │ [ProgressBar ── progressLabel] ← if progress prop given │\r\n * │ children │\r\n * └───────────────────────────────────────────────────────────────┘\r\n *\r\n * @example\r\n * <FormPageShell\r\n * home={() => navigate(\"/\")}\r\n * back={() => navigate(\"/list\")}\r\n * breadcrumb={[\"Autorisations\", \"Nouvelle autorisation\"]}\r\n * title=\"Nouvelle autorisation\"\r\n * subtitle=\"Saisissez les informations…\"\r\n * secondary={[{ label: \"Enregistrer\", icon: <SaveIcon />, onClick: handleSave }]}\r\n * primary={{ label: \"Déposer\", iconRight: <ArrowIcon />, onClick: handleDeposit }}\r\n * overflow={[{ label: \"Retour à la liste\", onClick: goBack }]}\r\n * progress={requiredPct}\r\n * progressLabel={isComplete ? \"Prêt à déposer ✓\" : `${filled}/${total} requis`}\r\n * >\r\n * <FormSection number={1} title=\"Informations\">…</FormSection>\r\n * </FormPageShell>\r\n */\r\n\r\nexport interface FormPageShellProps\r\n extends Pick<\r\n ActionBarProps,\r\n | \"home\"\r\n | \"back\"\r\n | \"breadcrumb\"\r\n | \"title\"\r\n | \"subtitle\"\r\n | \"icon\"\r\n | \"secondary\"\r\n | \"primary\"\r\n | \"overflow\"\r\n > {\r\n /** 0-100; renders a ProgressBar when provided. */\r\n progress?: number | undefined;\r\n /** Companion text beside the progress bar. */\r\n progressLabel?: React.ReactNode | undefined;\r\n children?: React.ReactNode | undefined;\r\n /** MUI sx override for PageContent. */\r\n contentSx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nconst PROGRESS_ROW_SX = Object.freeze({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n gap: \"var(--s-3)\",\r\n marginBottom: \"var(--s-5)\",\r\n} satisfies SxProps<Theme>);\r\n\r\nconst PROGRESS_BAR_WRAPPER_SX = Object.freeze({ flex: 1, minWidth: 0 });\r\n\r\nconst PROGRESS_LABEL_SX = Object.freeze({\r\n fontSize: \"var(--text-xs)\",\r\n color: \"var(--fg-muted)\",\r\n whiteSpace: \"nowrap\",\r\n fontVariantNumeric: \"tabular-nums\",\r\n flexShrink: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\n/**\r\n * Valeurs par défaut inline — plus de defaultProps.\r\n * React 18.3+ supprime le support de defaultProps pour les function\r\n * components. Aligné sur le pattern DataGridToolbar (B14).\r\n */\r\nfunction FormPageShell({\r\n /* ActionBar props */\r\n home,\r\n back,\r\n breadcrumb,\r\n title,\r\n subtitle,\r\n icon,\r\n secondary = [],\r\n primary,\r\n overflow = [],\r\n /* Progress slot */\r\n progress,\r\n progressLabel,\r\n /* Content */\r\n children,\r\n contentSx,\r\n}: FormPageShellProps) {\r\n return (\r\n <>\r\n <ActionBar\r\n surface={false}\r\n title={title}\r\n subtitle={subtitle}\r\n secondary={secondary}\r\n overflow={overflow}\r\n {...(home !== undefined ? { home } : {})}\r\n {...(back !== undefined ? { back } : {})}\r\n {...(breadcrumb !== undefined ? { breadcrumb } : {})}\r\n {...(icon !== undefined ? { icon } : {})}\r\n {...(primary !== undefined ? { primary } : {})}\r\n />\r\n\r\n <PageContent {...(contentSx !== undefined ? { sx: contentSx } : {})}>\r\n {typeof progress === \"number\" && (\r\n <Box sx={PROGRESS_ROW_SX}>\r\n <Box sx={PROGRESS_BAR_WRAPPER_SX}>\r\n <ProgressBar\r\n value={progress}\r\n aria-label=\"Avancement de la saisie\"\r\n />\r\n </Box>\r\n {progressLabel && (\r\n <Box component=\"span\" sx={PROGRESS_LABEL_SX}>\r\n {progressLabel}\r\n </Box>\r\n )}\r\n </Box>\r\n )}\r\n {children}\r\n </PageContent>\r\n </>\r\n );\r\n}\r\n\r\nexport default FormPageShell;\r\n"],"mappings":"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","ignoreList":[]}
|