@portnet/ui 6.0.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +196 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FileCard.test.js +144 -0
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +333 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +235 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
- package/dist/esm/v2/__tests__/apiError.test.js +181 -0
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -0
- package/dist/esm/v2/__tests__/banned-patterns.test.js +270 -0
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +224 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/cssVariables.test.js +157 -0
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +147 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -0
- package/dist/esm/v2/__tests__/locale-fallback.test.js +109 -0
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +514 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +230 -0
- package/dist/esm/v2/components/Accordion.js.map +1 -0
- package/dist/esm/v2/components/ActionStrip.js +146 -0
- package/dist/esm/v2/components/ActionStrip.js.map +1 -0
- package/dist/esm/v2/components/Banner.js +254 -0
- package/dist/esm/v2/components/Banner.js.map +1 -0
- package/dist/esm/v2/components/Busy.js +97 -0
- package/dist/esm/v2/components/Busy.js.map +1 -0
- package/dist/esm/v2/components/Button.js +114 -0
- package/dist/esm/v2/components/Button.js.map +1 -0
- package/dist/esm/v2/components/CategoryTag.js +81 -0
- package/dist/esm/v2/components/CategoryTag.js.map +1 -0
- package/dist/esm/v2/components/Checkbox.js +124 -0
- package/dist/esm/v2/components/Checkbox.js.map +1 -0
- package/dist/esm/v2/components/Chip.js +124 -0
- package/dist/esm/v2/components/Chip.js.map +1 -0
- package/dist/esm/v2/components/Combobox.js +394 -0
- package/dist/esm/v2/components/Combobox.js.map +1 -0
- package/dist/esm/v2/components/CommandPalette.js +660 -0
- package/dist/esm/v2/components/CommandPalette.js.map +1 -0
- package/dist/esm/v2/components/ConfirmDialog.js +144 -0
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -0
- package/dist/esm/v2/components/DatePicker.js +200 -0
- package/dist/esm/v2/components/DatePicker.js.map +1 -0
- package/dist/esm/v2/components/DateRangePicker.js +289 -0
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -0
- package/dist/esm/v2/components/DateTimePicker.js +182 -0
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -0
- package/dist/esm/v2/components/Drawer.js +333 -0
- package/dist/esm/v2/components/Drawer.js.map +1 -0
- package/dist/esm/v2/components/Dropzone.js +540 -0
- package/dist/esm/v2/components/Dropzone.js.map +1 -0
- package/dist/esm/v2/components/EmptyState.js +102 -0
- package/dist/esm/v2/components/EmptyState.js.map +1 -0
- package/dist/esm/v2/components/FavoriteToggle.js +127 -0
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -0
- package/dist/esm/v2/components/Field.js +197 -0
- package/dist/esm/v2/components/Field.js.map +1 -0
- package/dist/esm/v2/components/FieldError.js +124 -0
- package/dist/esm/v2/components/FieldError.js.map +1 -0
- package/dist/esm/v2/components/FieldHelp.js +202 -0
- package/dist/esm/v2/components/FieldHelp.js.map +1 -0
- package/dist/esm/v2/components/FileCard.js +162 -0
- package/dist/esm/v2/components/FileCard.js.map +1 -0
- package/dist/esm/v2/components/FilterTab.js +138 -0
- package/dist/esm/v2/components/FilterTab.js.map +1 -0
- package/dist/esm/v2/components/ForbiddenPage.js +74 -0
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -0
- package/dist/esm/v2/components/FormGrid.js +179 -0
- package/dist/esm/v2/components/FormGrid.js.map +1 -0
- package/dist/esm/v2/components/FormikDisplay.js +118 -0
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -0
- package/dist/esm/v2/components/Input.js +107 -0
- package/dist/esm/v2/components/Input.js.map +1 -0
- package/dist/esm/v2/components/KPICard.js +237 -0
- package/dist/esm/v2/components/KPICard.js.map +1 -0
- package/dist/esm/v2/components/KPIStrip.js +84 -0
- package/dist/esm/v2/components/KPIStrip.js.map +1 -0
- package/dist/esm/v2/components/KV.js +75 -0
- package/dist/esm/v2/components/KV.js.map +1 -0
- package/dist/esm/v2/components/KVGrid.js +74 -0
- package/dist/esm/v2/components/KVGrid.js.map +1 -0
- package/dist/esm/v2/components/Layout.js +284 -0
- package/dist/esm/v2/components/Layout.js.map +1 -0
- package/dist/esm/v2/components/MobileRowCard.js +314 -0
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -0
- package/dist/esm/v2/components/Modal.js +276 -0
- package/dist/esm/v2/components/Modal.js.map +1 -0
- package/dist/esm/v2/components/NetworkErrorPage.js +78 -0
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -0
- package/dist/esm/v2/components/NotFoundPage.js +58 -0
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -0
- package/dist/esm/v2/components/NumberInput.js +309 -0
- package/dist/esm/v2/components/NumberInput.js.map +1 -0
- package/dist/esm/v2/components/OverflowMenu.js +184 -0
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -0
- package/dist/esm/v2/components/PdfViewer.js +122 -0
- package/dist/esm/v2/components/PdfViewer.js.map +1 -0
- package/dist/esm/v2/components/ProgressBar.js +202 -0
- package/dist/esm/v2/components/ProgressBar.js.map +1 -0
- package/dist/esm/v2/components/Radio.js +228 -0
- package/dist/esm/v2/components/Radio.js.map +1 -0
- package/dist/esm/v2/components/SectionErrorBoundary.js +214 -0
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -0
- package/dist/esm/v2/components/SectionHeader.js +132 -0
- package/dist/esm/v2/components/SectionHeader.js.map +1 -0
- package/dist/esm/v2/components/Segmented.js +254 -0
- package/dist/esm/v2/components/Segmented.js.map +1 -0
- package/dist/esm/v2/components/Select.js +490 -0
- package/dist/esm/v2/components/Select.js.map +1 -0
- package/dist/esm/v2/components/ServerErrorPage.js +74 -0
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -0
- package/dist/esm/v2/components/Skeleton.js +269 -0
- package/dist/esm/v2/components/Skeleton.js.map +1 -0
- package/dist/esm/v2/components/SkipLink.js +49 -0
- package/dist/esm/v2/components/SkipLink.js.map +1 -0
- package/dist/esm/v2/components/Spinner.js +69 -0
- package/dist/esm/v2/components/Spinner.js.map +1 -0
- package/dist/esm/v2/components/Status.js +64 -0
- package/dist/esm/v2/components/Status.js.map +1 -0
- package/dist/esm/v2/components/Stepper.js +432 -0
- package/dist/esm/v2/components/Stepper.js.map +1 -0
- package/dist/esm/v2/components/Surface.js +159 -0
- package/dist/esm/v2/components/Surface.js.map +1 -0
- package/dist/esm/v2/components/Switch.js +128 -0
- package/dist/esm/v2/components/Switch.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +150 -0
- package/dist/esm/v2/components/Tabs.js.map +1 -0
- package/dist/esm/v2/components/TelInput.js +274 -0
- package/dist/esm/v2/components/TelInput.js.map +1 -0
- package/dist/esm/v2/components/Textarea.js +72 -0
- package/dist/esm/v2/components/Textarea.js.map +1 -0
- package/dist/esm/v2/components/TimePicker.js +134 -0
- package/dist/esm/v2/components/TimePicker.js.map +1 -0
- package/dist/esm/v2/components/Toast.js +376 -0
- package/dist/esm/v2/components/Toast.js.map +1 -0
- package/dist/esm/v2/components/Tooltip.js +161 -0
- package/dist/esm/v2/components/Tooltip.js.map +1 -0
- package/dist/esm/v2/components/_ErrorPageBody.js +85 -0
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -0
- package/dist/esm/v2/components/_pickerShared.js +60 -0
- package/dist/esm/v2/components/_pickerShared.js.map +1 -0
- package/dist/esm/v2/components/index.js +244 -0
- package/dist/esm/v2/components/index.js.map +1 -0
- package/dist/esm/v2/hooks/index.js +10 -0
- package/dist/esm/v2/hooks/index.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +55 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -0
- package/dist/esm/v2/hooks/useDensity.js +119 -0
- package/dist/esm/v2/hooks/useDensity.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusFirstError.js +197 -0
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +202 -0
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -0
- package/dist/esm/v2/hooks/useFormAutoSave.js +181 -0
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -0
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +131 -0
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +44 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -0
- package/dist/esm/v2/hooks/useSortedRows.js +32 -0
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -0
- package/dist/esm/v2/hooks/useTabLoading.js +79 -0
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -0
- package/dist/esm/v2/index.js +121 -0
- package/dist/esm/v2/index.js.map +1 -0
- package/dist/esm/v2/modalContext.js +108 -0
- package/dist/esm/v2/modalContext.js.map +1 -0
- package/dist/esm/v2/models/favorite.js +2 -0
- package/dist/esm/v2/models/favorite.js.map +1 -0
- package/dist/esm/v2/models/index.js +12 -0
- package/dist/esm/v2/models/index.js.map +1 -0
- package/dist/esm/v2/models/personalization.js +2 -0
- package/dist/esm/v2/models/personalization.js.map +1 -0
- package/dist/esm/v2/models/referentiel.js +2 -0
- package/dist/esm/v2/models/referentiel.js.map +1 -0
- package/dist/esm/v2/models/savedFilter.js +2 -0
- package/dist/esm/v2/models/savedFilter.js.map +1 -0
- package/dist/esm/v2/patterns/ActionBar.js +603 -0
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +147 -0
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +303 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -0
- package/dist/esm/v2/patterns/ColumnsToggle.js +301 -0
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -0
- package/dist/esm/v2/patterns/DataGrid.js +820 -0
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +375 -0
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridToolbar.js +249 -0
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -0
- package/dist/esm/v2/patterns/DataGridVirtualized.js +523 -0
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -0
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +70 -0
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +164 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -0
- package/dist/esm/v2/patterns/FavoritesFilter.js +91 -0
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +101 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormPageShell.js +126 -0
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -0
- package/dist/esm/v2/patterns/FormSection.js +190 -0
- package/dist/esm/v2/patterns/FormSection.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +110 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCombobox.js +115 -0
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -0
- package/dist/esm/v2/patterns/FormikDatePicker.js +196 -0
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js +77 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +148 -0
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -0
- package/dist/esm/v2/patterns/FormikInput.js +127 -0
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js +116 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -0
- package/dist/esm/v2/patterns/FormikSelect.js +159 -0
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -0
- package/dist/esm/v2/patterns/FormikTextarea.js +76 -0
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -0
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +195 -0
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +72 -0
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -0
- package/dist/esm/v2/patterns/PageContent.js +62 -0
- package/dist/esm/v2/patterns/PageContent.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +615 -0
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js +197 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -0
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +406 -0
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -0
- package/dist/esm/v2/patterns/SkeletonPageShell.js +342 -0
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -0
- package/dist/esm/v2/patterns/SortableHeader.js +179 -0
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -0
- package/dist/esm/v2/patterns/Tour.js +471 -0
- package/dist/esm/v2/patterns/Tour.js.map +1 -0
- package/dist/esm/v2/patterns/_dataGridShared.js +431 -0
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -0
- package/dist/esm/v2/patterns/_sort.js +112 -0
- package/dist/esm/v2/patterns/_sort.js.map +1 -0
- package/dist/esm/v2/patterns/_useColumnReorder.js +257 -0
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -0
- package/dist/esm/v2/patterns/_useColumnResize.js +191 -0
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +95 -0
- package/dist/esm/v2/patterns/index.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +168 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/_storageKey.js +60 -0
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +124 -0
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +70 -0
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
- package/dist/esm/v2/personalization/adapters/index.js +11 -0
- package/dist/esm/v2/personalization/adapters/index.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/favorites.js +216 -0
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +111 -0
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/index.js +17 -0
- package/dist/esm/v2/personalization/capabilities/index.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +291 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -0
- package/dist/esm/v2/personalization/createPersonalizationStore.js +472 -0
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -0
- package/dist/esm/v2/personalization/index.js +46 -0
- package/dist/esm/v2/personalization/index.js.map +1 -0
- package/dist/esm/v2/personalization/personalizationContext.js +108 -0
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -0
- package/dist/esm/v2/personalization/schema.js +92 -0
- package/dist/esm/v2/personalization/schema.js.map +1 -0
- package/dist/esm/v2/personalization/types.js +2 -0
- package/dist/esm/v2/personalization/types.js.map +1 -0
- package/dist/esm/v2/referentiel/ReferentielProvider.js +87 -0
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -0
- package/dist/esm/v2/referentiel/index.js +15 -0
- package/dist/esm/v2/referentiel/index.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +37 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielOptions.js +169 -0
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielSearch.js +132 -0
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -0
- package/dist/esm/v2/styles/base.css +425 -0
- package/dist/esm/v2/styles/css.d.ts +10 -0
- package/dist/esm/v2/styles/index.js +12 -0
- package/dist/esm/v2/styles/index.js.map +1 -0
- package/dist/esm/v2/theme/_brand.js +64 -0
- package/dist/esm/v2/theme/_brand.js.map +1 -0
- package/dist/esm/v2/theme/_brandSecondary.js +60 -0
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -0
- package/dist/esm/v2/theme/createPortnetTheme.js +548 -0
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -0
- package/dist/esm/v2/theme/cssVariables.js +198 -0
- package/dist/esm/v2/theme/cssVariables.js.map +1 -0
- package/dist/esm/v2/theme/index.js +32 -0
- package/dist/esm/v2/theme/index.js.map +1 -0
- package/dist/esm/v2/tokens/breakpoints.js +106 -0
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +219 -0
- package/dist/esm/v2/tokens/colors.js.map +1 -0
- package/dist/esm/v2/tokens/density.js +98 -0
- package/dist/esm/v2/tokens/density.js.map +1 -0
- package/dist/esm/v2/tokens/index.js +80 -0
- package/dist/esm/v2/tokens/index.js.map +1 -0
- package/dist/esm/v2/tokens/motion.js +88 -0
- package/dist/esm/v2/tokens/motion.js.map +1 -0
- package/dist/esm/v2/tokens/radius.js +22 -0
- package/dist/esm/v2/tokens/radius.js.map +1 -0
- package/dist/esm/v2/tokens/shadows.js +40 -0
- package/dist/esm/v2/tokens/shadows.js.map +1 -0
- package/dist/esm/v2/tokens/spacing.js +51 -0
- package/dist/esm/v2/tokens/spacing.js.map +1 -0
- package/dist/esm/v2/tokens/state.js +41 -0
- package/dist/esm/v2/tokens/state.js.map +1 -0
- package/dist/esm/v2/tokens/statusPalette.js +66 -0
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -0
- package/dist/esm/v2/tokens/tokens.json +153 -0
- package/dist/esm/v2/tokens/typography.js +149 -0
- package/dist/esm/v2/tokens/typography.js.map +1 -0
- package/dist/esm/v2/tokens/zIndex.js +44 -0
- package/dist/esm/v2/tokens/zIndex.js.map +1 -0
- package/dist/esm/v2/types/common.js +2 -0
- package/dist/esm/v2/types/common.js.map +1 -0
- package/dist/esm/v2/types/datagrid.js +2 -0
- package/dist/esm/v2/types/datagrid.js.map +1 -0
- package/dist/esm/v2/types/index.js +12 -0
- package/dist/esm/v2/types/index.js.map +1 -0
- package/dist/esm/v2/utils/apiError.js +281 -0
- package/dist/esm/v2/utils/apiError.js.map +1 -0
- package/dist/esm/v2/utils/contrast.js +157 -0
- package/dist/esm/v2/utils/contrast.js.map +1 -0
- package/dist/esm/v2/utils/cx.js +38 -0
- package/dist/esm/v2/utils/cx.js.map +1 -0
- package/dist/esm/v2/utils/fileDownload.js +226 -0
- package/dist/esm/v2/utils/fileDownload.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +78 -0
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -0
- package/dist/esm/v2/utils/index.js +43 -0
- package/dist/esm/v2/utils/index.js.map +1 -0
- package/dist/esm/v2/utils/mergeLabels.js +86 -0
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -0
- package/dist/esm/v2/utils/networkStatus.js +114 -0
- package/dist/esm/v2/utils/networkStatus.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/v2/__tests__/FieldError.test.js +164 -0
- package/dist/v2/__tests__/FieldError.test.js.map +1 -0
- package/dist/v2/__tests__/FileCard.test.js +148 -0
- package/dist/v2/__tests__/FileCard.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +237 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -0
- package/dist/v2/components/Accordion.d.ts +6 -6
- package/dist/v2/components/Accordion.d.ts.map +1 -1
- package/dist/v2/components/Accordion.js.map +1 -1
- package/dist/v2/components/ActionStrip.d.ts +12 -12
- package/dist/v2/components/ActionStrip.d.ts.map +1 -1
- package/dist/v2/components/ActionStrip.js.map +1 -1
- package/dist/v2/components/Banner.d.ts +48 -9
- package/dist/v2/components/Banner.d.ts.map +1 -1
- package/dist/v2/components/Banner.js +116 -35
- package/dist/v2/components/Banner.js.map +1 -1
- package/dist/v2/components/Busy.d.ts +3 -3
- package/dist/v2/components/Busy.d.ts.map +1 -1
- package/dist/v2/components/Busy.js.map +1 -1
- package/dist/v2/components/Button.d.ts +6 -6
- package/dist/v2/components/Button.d.ts.map +1 -1
- package/dist/v2/components/Button.js.map +1 -1
- package/dist/v2/components/CategoryTag.d.ts +3 -3
- package/dist/v2/components/CategoryTag.d.ts.map +1 -1
- package/dist/v2/components/CategoryTag.js.map +1 -1
- package/dist/v2/components/Checkbox.d.ts +11 -11
- package/dist/v2/components/Checkbox.d.ts.map +1 -1
- package/dist/v2/components/Checkbox.js.map +1 -1
- package/dist/v2/components/Chip.d.ts +8 -8
- package/dist/v2/components/Chip.d.ts.map +1 -1
- package/dist/v2/components/Chip.js +2 -1
- package/dist/v2/components/Chip.js.map +1 -1
- package/dist/v2/components/Combobox.d.ts +27 -27
- package/dist/v2/components/Combobox.d.ts.map +1 -1
- package/dist/v2/components/Combobox.js +3 -2
- package/dist/v2/components/Combobox.js.map +1 -1
- package/dist/v2/components/CommandPalette.d.ts +20 -20
- package/dist/v2/components/CommandPalette.d.ts.map +1 -1
- package/dist/v2/components/CommandPalette.js +2 -6
- package/dist/v2/components/CommandPalette.js.map +1 -1
- package/dist/v2/components/ConfirmDialog.d.ts +13 -13
- package/dist/v2/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/v2/components/ConfirmDialog.js +2 -1
- package/dist/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/v2/components/DatePicker.d.ts +11 -11
- package/dist/v2/components/DatePicker.d.ts.map +1 -1
- package/dist/v2/components/DatePicker.js.map +1 -1
- package/dist/v2/components/DateRangePicker.d.ts +16 -16
- package/dist/v2/components/DateRangePicker.d.ts.map +1 -1
- package/dist/v2/components/DateRangePicker.js +2 -1
- package/dist/v2/components/DateRangePicker.js.map +1 -1
- package/dist/v2/components/DateTimePicker.d.ts +11 -11
- package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
- package/dist/v2/components/DateTimePicker.js.map +1 -1
- package/dist/v2/components/Drawer.d.ts +18 -18
- package/dist/v2/components/Drawer.d.ts.map +1 -1
- package/dist/v2/components/Drawer.js +2 -1
- package/dist/v2/components/Drawer.js.map +1 -1
- package/dist/v2/components/Dropzone.d.ts +34 -34
- package/dist/v2/components/Dropzone.d.ts.map +1 -1
- package/dist/v2/components/Dropzone.js +11 -3
- package/dist/v2/components/Dropzone.js.map +1 -1
- package/dist/v2/components/EmptyState.d.ts +7 -7
- package/dist/v2/components/EmptyState.d.ts.map +1 -1
- package/dist/v2/components/EmptyState.js.map +1 -1
- package/dist/v2/components/FavoriteToggle.d.ts +7 -7
- package/dist/v2/components/FavoriteToggle.d.ts.map +1 -1
- package/dist/v2/components/FavoriteToggle.js +2 -1
- package/dist/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/v2/components/Field.d.ts +17 -12
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +25 -7
- package/dist/v2/components/Field.js.map +1 -1
- package/dist/v2/components/FieldError.d.ts +78 -0
- package/dist/v2/components/FieldError.d.ts.map +1 -0
- package/dist/v2/components/FieldError.js +131 -0
- package/dist/v2/components/FieldError.js.map +1 -0
- package/dist/v2/components/FieldHelp.d.ts +7 -7
- package/dist/v2/components/FieldHelp.d.ts.map +1 -1
- package/dist/v2/components/FieldHelp.js.map +1 -1
- package/dist/v2/components/FileCard.d.ts +75 -0
- package/dist/v2/components/FileCard.d.ts.map +1 -0
- package/dist/v2/components/FileCard.js +169 -0
- package/dist/v2/components/FileCard.js.map +1 -0
- package/dist/v2/components/FilterTab.d.ts +9 -9
- package/dist/v2/components/FilterTab.d.ts.map +1 -1
- package/dist/v2/components/FilterTab.js +2 -1
- package/dist/v2/components/FilterTab.js.map +1 -1
- package/dist/v2/components/FormGrid.d.ts +9 -4
- package/dist/v2/components/FormGrid.d.ts.map +1 -1
- package/dist/v2/components/FormGrid.js +11 -1
- package/dist/v2/components/FormGrid.js.map +1 -1
- package/dist/v2/components/FormikDisplay.d.ts +6 -6
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
- package/dist/v2/components/FormikDisplay.js.map +1 -1
- package/dist/v2/components/Input.d.ts +6 -6
- package/dist/v2/components/Input.d.ts.map +1 -1
- package/dist/v2/components/Input.js.map +1 -1
- package/dist/v2/components/KPICard.d.ts +43 -13
- package/dist/v2/components/KPICard.d.ts.map +1 -1
- package/dist/v2/components/KPICard.js +53 -14
- package/dist/v2/components/KPICard.js.map +1 -1
- package/dist/v2/components/KPIStrip.d.ts +68 -0
- package/dist/v2/components/KPIStrip.d.ts.map +1 -0
- package/dist/v2/components/KPIStrip.js +92 -0
- package/dist/v2/components/KPIStrip.js.map +1 -0
- package/dist/v2/components/KV.d.ts +3 -3
- package/dist/v2/components/KV.d.ts.map +1 -1
- package/dist/v2/components/KV.js.map +1 -1
- package/dist/v2/components/KVGrid.d.ts +2 -2
- package/dist/v2/components/KVGrid.d.ts.map +1 -1
- package/dist/v2/components/KVGrid.js +8 -1
- package/dist/v2/components/KVGrid.js.map +1 -1
- package/dist/v2/components/Layout.d.ts +7 -7
- package/dist/v2/components/Layout.d.ts.map +1 -1
- package/dist/v2/components/Layout.js.map +1 -1
- package/dist/v2/components/MobileRowCard.d.ts +13 -13
- package/dist/v2/components/MobileRowCard.d.ts.map +1 -1
- package/dist/v2/components/MobileRowCard.js.map +1 -1
- package/dist/v2/components/Modal.d.ts +12 -12
- package/dist/v2/components/Modal.d.ts.map +1 -1
- package/dist/v2/components/Modal.js.map +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
- package/dist/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/v2/components/NumberInput.d.ts +14 -14
- package/dist/v2/components/NumberInput.d.ts.map +1 -1
- package/dist/v2/components/NumberInput.js +7 -6
- package/dist/v2/components/NumberInput.js.map +1 -1
- package/dist/v2/components/OverflowMenu.d.ts +14 -14
- package/dist/v2/components/OverflowMenu.d.ts.map +1 -1
- package/dist/v2/components/OverflowMenu.js +4 -8
- package/dist/v2/components/OverflowMenu.js.map +1 -1
- package/dist/v2/components/PdfViewer.d.ts +9 -9
- package/dist/v2/components/PdfViewer.d.ts.map +1 -1
- package/dist/v2/components/PdfViewer.js.map +1 -1
- package/dist/v2/components/ProgressBar.d.ts +10 -10
- package/dist/v2/components/ProgressBar.d.ts.map +1 -1
- package/dist/v2/components/ProgressBar.js.map +1 -1
- package/dist/v2/components/Radio.d.ts +7 -7
- package/dist/v2/components/Radio.d.ts.map +1 -1
- package/dist/v2/components/Radio.js.map +1 -1
- package/dist/v2/components/SectionErrorBoundary.d.ts +89 -0
- package/dist/v2/components/SectionErrorBoundary.d.ts.map +1 -0
- package/dist/v2/components/SectionErrorBoundary.js +221 -0
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -0
- package/dist/v2/components/SectionHeader.d.ts +5 -5
- package/dist/v2/components/SectionHeader.d.ts.map +1 -1
- package/dist/v2/components/SectionHeader.js.map +1 -1
- package/dist/v2/components/Segmented.d.ts +11 -11
- package/dist/v2/components/Segmented.d.ts.map +1 -1
- package/dist/v2/components/Segmented.js.map +1 -1
- package/dist/v2/components/Select.d.ts +33 -15
- package/dist/v2/components/Select.d.ts.map +1 -1
- package/dist/v2/components/Select.js +147 -30
- package/dist/v2/components/Select.js.map +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
- package/dist/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/v2/components/Skeleton.d.ts +15 -15
- package/dist/v2/components/Skeleton.d.ts.map +1 -1
- package/dist/v2/components/Skeleton.js.map +1 -1
- package/dist/v2/components/SkipLink.d.ts +2 -2
- package/dist/v2/components/SkipLink.d.ts.map +1 -1
- package/dist/v2/components/SkipLink.js.map +1 -1
- package/dist/v2/components/Status.d.ts +3 -3
- package/dist/v2/components/Status.d.ts.map +1 -1
- package/dist/v2/components/Status.js.map +1 -1
- package/dist/v2/components/Stepper.d.ts +28 -22
- package/dist/v2/components/Stepper.d.ts.map +1 -1
- package/dist/v2/components/Stepper.js +31 -5
- package/dist/v2/components/Stepper.js.map +1 -1
- package/dist/v2/components/Surface.d.ts +94 -0
- package/dist/v2/components/Surface.d.ts.map +1 -0
- package/dist/v2/components/Surface.js +163 -0
- package/dist/v2/components/Surface.js.map +1 -0
- package/dist/v2/components/Switch.d.ts +4 -4
- package/dist/v2/components/Switch.d.ts.map +1 -1
- package/dist/v2/components/Switch.js.map +1 -1
- package/dist/v2/components/Tabs.d.ts +6 -6
- package/dist/v2/components/Tabs.d.ts.map +1 -1
- package/dist/v2/components/Tabs.js.map +1 -1
- package/dist/v2/components/TelInput.d.ts +8 -8
- package/dist/v2/components/TelInput.d.ts.map +1 -1
- package/dist/v2/components/TelInput.js +18 -18
- package/dist/v2/components/TelInput.js.map +1 -1
- package/dist/v2/components/Textarea.d.ts +1 -1
- package/dist/v2/components/Textarea.d.ts.map +1 -1
- package/dist/v2/components/Textarea.js.map +1 -1
- package/dist/v2/components/TimePicker.d.ts +11 -11
- package/dist/v2/components/TimePicker.d.ts.map +1 -1
- package/dist/v2/components/TimePicker.js.map +1 -1
- package/dist/v2/components/Toast.d.ts +6 -6
- package/dist/v2/components/Toast.d.ts.map +1 -1
- package/dist/v2/components/Toast.js +9 -8
- package/dist/v2/components/Toast.js.map +1 -1
- package/dist/v2/components/Tooltip.d.ts +1 -1
- package/dist/v2/components/Tooltip.d.ts.map +1 -1
- package/dist/v2/components/Tooltip.js.map +1 -1
- package/dist/v2/components/index.d.ts +143 -0
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/components/index.js +35 -0
- package/dist/v2/components/index.js.map +1 -1
- package/dist/v2/models/favorite.d.ts +1 -1
- package/dist/v2/models/favorite.d.ts.map +1 -1
- package/dist/v2/models/favorite.js.map +1 -1
- package/dist/v2/models/personalization.d.ts +13 -13
- 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 +11 -11
- 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 -8
- package/dist/v2/models/savedFilter.d.ts.map +1 -1
- package/dist/v2/models/savedFilter.js.map +1 -1
- package/dist/v2/patterns/ActionBar.d.ts +33 -33
- package/dist/v2/patterns/ActionBar.d.ts.map +1 -1
- package/dist/v2/patterns/ActionBar.js +2 -1
- package/dist/v2/patterns/ActionBar.js.map +1 -1
- package/dist/v2/patterns/BulkActionBar.d.ts +12 -12
- package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -1
- package/dist/v2/patterns/BulkActionBar.js +2 -1
- package/dist/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts +15 -15
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -1
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.d.ts +7 -7
- package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.js +4 -8
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -12
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.js +9 -8
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.d.ts +40 -40
- package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.js +2 -1
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.d.ts +27 -27
- package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +5 -5
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/v2/patterns/FavoriteColumn.d.ts +6 -6
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.d.ts +10 -10
- package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.js +2 -1
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/v2/patterns/FormErrorSummary.d.ts +4 -4
- package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -1
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/v2/patterns/FormPageShell.d.ts +4 -4
- package/dist/v2/patterns/FormPageShell.d.ts.map +1 -1
- package/dist/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/v2/patterns/FormSection.d.ts +19 -8
- package/dist/v2/patterns/FormSection.d.ts.map +1 -1
- package/dist/v2/patterns/FormSection.js +106 -71
- package/dist/v2/patterns/FormSection.js.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +6 -6
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/v2/patterns/FormikCombobox.d.ts +11 -11
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts +36 -8
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +27 -1
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikErrorFocus.d.ts +3 -3
- package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -1
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/v2/patterns/FormikFile.d.ts +8 -8
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
- package/dist/v2/patterns/FormikFile.js.map +1 -1
- package/dist/v2/patterns/FormikInput.d.ts +41 -6
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
- package/dist/v2/patterns/FormikInput.js +49 -1
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts +8 -8
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/v2/patterns/FormikSelect.d.ts +33 -12
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +28 -2
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.d.ts +5 -5
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +7 -7
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +2 -6
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.d.ts +4 -4
- package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/v2/patterns/PageContent.d.ts +3 -3
- package/dist/v2/patterns/PageContent.d.ts.map +1 -1
- package/dist/v2/patterns/PageContent.js.map +1 -1
- package/dist/v2/patterns/ReferentielField.d.ts +49 -49
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/ReferentielField.js +2 -1
- package/dist/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/v2/patterns/SaveFilterDialog.d.ts +10 -10
- package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -1
- package/dist/v2/patterns/SaveFilterDialog.js +9 -8
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.d.ts +7 -7
- package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.js +9 -8
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.d.ts +7 -7
- package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/v2/patterns/SortableHeader.d.ts +1 -1
- package/dist/v2/patterns/SortableHeader.d.ts.map +1 -1
- package/dist/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/v2/patterns/Tour.d.ts +12 -12
- package/dist/v2/patterns/Tour.d.ts.map +1 -1
- package/dist/v2/patterns/Tour.js +9 -8
- package/dist/v2/patterns/Tour.js.map +1 -1
- package/dist/v2/patterns/_dataGridShared.d.ts +25 -6
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
- package/dist/v2/patterns/_dataGridShared.js +37 -3
- package/dist/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.d.ts +1 -1
- package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/v2/patterns/_useColumnResize.d.ts +1 -1
- package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -1
- package/dist/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/v2/patterns/index.d.ts +27 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.d.ts +9 -9
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.d.ts +3 -3
- package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/v2/personalization/capabilities/savedFilters.d.ts +3 -3
- package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -1
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.d.ts +8 -8
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/v2/personalization/schema.d.ts +2 -2
- package/dist/v2/personalization/schema.d.ts.map +1 -1
- package/dist/v2/personalization/schema.js.map +1 -1
- package/dist/v2/personalization/types.d.ts +19 -19
- package/dist/v2/personalization/types.d.ts.map +1 -1
- package/dist/v2/personalization/types.js.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.d.ts +4 -4
- package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.d.ts +4 -4
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.d.ts +3 -3
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/v2/theme/createPortnetTheme.d.ts +32 -7
- package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -1
- package/dist/v2/theme/createPortnetTheme.js +25 -1
- package/dist/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/v2/types/datagrid.d.ts +59 -59
- package/dist/v2/types/datagrid.d.ts.map +1 -1
- package/dist/v2/types/datagrid.js.map +1 -1
- package/dist/v2/utils/apiError.d.ts +65 -4
- package/dist/v2/utils/apiError.d.ts.map +1 -1
- package/dist/v2/utils/apiError.js +69 -6
- package/dist/v2/utils/apiError.js.map +1 -1
- package/dist/v2/utils/index.d.ts +1 -0
- package/dist/v2/utils/index.d.ts.map +1 -1
- package/dist/v2/utils/index.js +7 -0
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/mergeLabels.d.ts +59 -0
- package/dist/v2/utils/mergeLabels.d.ts.map +1 -0
- package/dist/v2/utils/mergeLabels.js +93 -0
- package/dist/v2/utils/mergeLabels.js.map +1 -0
- package/package.json +23 -15
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import ConfirmDialog from "../components/ConfirmDialog";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* DeleteResourceConfirmDialog — Portnet UI v2
|
|
12
|
+
*
|
|
13
|
+
* Opinionated wrapper over v2.ConfirmDialog for irreversible delete actions
|
|
14
|
+
* across the design system. Hard-wires the "danger" variant (Charter §09.3 —
|
|
15
|
+
* the only correct choice for a destructive irreversible action) and sensible
|
|
16
|
+
* FR defaults for the button labels.
|
|
17
|
+
*
|
|
18
|
+
* The prop names `isOpen` / `onDelete` are deliberately chosen over
|
|
19
|
+
* v2.ConfirmDialog's `open` / `onConfirm` because call sites read more
|
|
20
|
+
* naturally with action-specific verbs — every host-module audit converged on
|
|
21
|
+
* this naming and the wrapper formalises it as the destructive-action
|
|
22
|
+
* convention.
|
|
23
|
+
*
|
|
24
|
+
* <DeleteResourceConfirmDialog
|
|
25
|
+
* isOpen // bool, REQUIRED
|
|
26
|
+
* onClose // () => void, REQUIRED
|
|
27
|
+
* onDelete // () => void, REQUIRED — fires on confirm
|
|
28
|
+
* title // node, REQUIRED — surfaces the resource type
|
|
29
|
+
* description? // node — single-sentence consequence
|
|
30
|
+
* impact? // node[] — bullet-list of side effects (Charter R-5.1)
|
|
31
|
+
* confirmLabel? // node, default "Confirmer"
|
|
32
|
+
* cancelLabel? // node, default "Annuler"
|
|
33
|
+
* loading? // bool — disables both buttons + spinner on confirm
|
|
34
|
+
* />
|
|
35
|
+
*
|
|
36
|
+
* Charter R-5.1 + §09.3 + R-M.*. WCAG 2.4.7 (focus visible — inherited from Modal).
|
|
37
|
+
*/
|
|
38
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
39
|
+
function DeleteResourceConfirmDialog(_ref) {
|
|
40
|
+
var isOpen = _ref.isOpen,
|
|
41
|
+
onClose = _ref.onClose,
|
|
42
|
+
onDelete = _ref.onDelete,
|
|
43
|
+
title = _ref.title,
|
|
44
|
+
description = _ref.description,
|
|
45
|
+
impact = _ref.impact,
|
|
46
|
+
_ref$confirmLabel = _ref.confirmLabel,
|
|
47
|
+
confirmLabel = _ref$confirmLabel === void 0 ? "Confirmer" : _ref$confirmLabel,
|
|
48
|
+
_ref$cancelLabel = _ref.cancelLabel,
|
|
49
|
+
cancelLabel = _ref$cancelLabel === void 0 ? "Annuler" : _ref$cancelLabel,
|
|
50
|
+
_ref$loading = _ref.loading,
|
|
51
|
+
loading = _ref$loading === void 0 ? false : _ref$loading;
|
|
52
|
+
return /*#__PURE__*/_jsx(ConfirmDialog, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
53
|
+
title: title,
|
|
54
|
+
description: description,
|
|
55
|
+
cancelLabel: cancelLabel,
|
|
56
|
+
confirmLabel: confirmLabel,
|
|
57
|
+
confirmVariant: "danger",
|
|
58
|
+
loading: loading
|
|
59
|
+
}, isOpen !== undefined ? {
|
|
60
|
+
open: isOpen
|
|
61
|
+
} : {}), onClose !== undefined ? {
|
|
62
|
+
onClose: onClose
|
|
63
|
+
} : {}), onDelete !== undefined ? {
|
|
64
|
+
onConfirm: onDelete
|
|
65
|
+
} : {}), impact !== undefined ? {
|
|
66
|
+
impact: impact
|
|
67
|
+
} : {}));
|
|
68
|
+
}
|
|
69
|
+
export default DeleteResourceConfirmDialog;
|
|
70
|
+
//# sourceMappingURL=DeleteResourceConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeleteResourceConfirmDialog.js","names":["React","ConfirmDialog","jsx","_jsx","DeleteResourceConfirmDialog","_ref","isOpen","onClose","onDelete","title","description","impact","_ref$confirmLabel","confirmLabel","_ref$cancelLabel","cancelLabel","_ref$loading","loading","_objectSpread","confirmVariant","undefined","open","onConfirm"],"sources":["../../../../src/lib/v2/patterns/DeleteResourceConfirmDialog.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport ConfirmDialog from \"../components/ConfirmDialog\";\r\n\r\n/**\r\n * DeleteResourceConfirmDialog — Portnet UI v2\r\n *\r\n * Opinionated wrapper over v2.ConfirmDialog for irreversible delete actions\r\n * across the design system. Hard-wires the \"danger\" variant (Charter §09.3 —\r\n * the only correct choice for a destructive irreversible action) and sensible\r\n * FR defaults for the button labels.\r\n *\r\n * The prop names `isOpen` / `onDelete` are deliberately chosen over\r\n * v2.ConfirmDialog's `open` / `onConfirm` because call sites read more\r\n * naturally with action-specific verbs — every host-module audit converged on\r\n * this naming and the wrapper formalises it as the destructive-action\r\n * convention.\r\n *\r\n * <DeleteResourceConfirmDialog\r\n * isOpen // bool, REQUIRED\r\n * onClose // () => void, REQUIRED\r\n * onDelete // () => void, REQUIRED — fires on confirm\r\n * title // node, REQUIRED — surfaces the resource type\r\n * description? // node — single-sentence consequence\r\n * impact? // node[] — bullet-list of side effects (Charter R-5.1)\r\n * confirmLabel? // node, default \"Confirmer\"\r\n * cancelLabel? // node, default \"Annuler\"\r\n * loading? // bool — disables both buttons + spinner on confirm\r\n * />\r\n *\r\n * Charter R-5.1 + §09.3 + R-M.*. WCAG 2.4.7 (focus visible — inherited from Modal).\r\n */\r\n\r\ntype ConfirmDialogProps = React.ComponentProps<typeof ConfirmDialog>;\r\n\r\nexport interface DeleteResourceConfirmDialogProps {\r\n isOpen: ConfirmDialogProps[\"open\"];\r\n onClose: ConfirmDialogProps[\"onClose\"];\r\n /** Fires on confirm (maps to ConfirmDialog's onConfirm). */\r\n onDelete: ConfirmDialogProps[\"onConfirm\"];\r\n title: ConfirmDialogProps[\"title\"];\r\n description?: ConfirmDialogProps[\"description\"] | undefined;\r\n impact?: ConfirmDialogProps[\"impact\"] | undefined;\r\n confirmLabel?: ConfirmDialogProps[\"confirmLabel\"] | undefined;\r\n cancelLabel?: ConfirmDialogProps[\"cancelLabel\"] | undefined;\r\n loading?: ConfirmDialogProps[\"loading\"] | undefined;\r\n}\r\n\r\nfunction DeleteResourceConfirmDialog({\r\n isOpen,\r\n onClose,\r\n onDelete,\r\n title,\r\n description,\r\n impact,\r\n confirmLabel = \"Confirmer\",\r\n cancelLabel = \"Annuler\",\r\n loading = false,\r\n}: DeleteResourceConfirmDialogProps) {\r\n return (\r\n <ConfirmDialog\r\n title={title}\r\n description={description}\r\n cancelLabel={cancelLabel}\r\n confirmLabel={confirmLabel}\r\n confirmVariant=\"danger\"\r\n loading={loading}\r\n {...(isOpen !== undefined ? { open: isOpen } : {})}\r\n {...(onClose !== undefined ? { onClose } : {})}\r\n {...(onDelete !== undefined ? { onConfirm: onDelete } : {})}\r\n {...(impact !== undefined ? { impact } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default DeleteResourceConfirmDialog;\r\n"],"mappings":";;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,6BAA6B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3BA,SAAAC,GAAA,IAAAC,IAAA;AA4CA,SAASC,2BAA2BA,CAAAC,IAAA,EAUC;EAAA,IATnCC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACPC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,KAAK,GAAAJ,IAAA,CAALI,KAAK;IACLC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,MAAM,GAAAN,IAAA,CAANM,MAAM;IAAAC,iBAAA,GAAAP,IAAA,CACNQ,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAG,WAAW,GAAAA,iBAAA;IAAAE,gBAAA,GAAAT,IAAA,CAC1BU,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,SAAS,GAAAA,gBAAA;IAAAE,YAAA,GAAAX,IAAA,CACvBY,OAAO;IAAPA,OAAO,GAAAD,YAAA,cAAG,KAAK,GAAAA,YAAA;EAEf,oBACEb,IAAA,CAACF,aAAa,EAAAiB,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA;IACZT,KAAK,EAAEA,KAAM;IACbC,WAAW,EAAEA,WAAY;IACzBK,WAAW,EAAEA,WAAY;IACzBF,YAAY,EAAEA,YAAa;IAC3BM,cAAc,EAAC,QAAQ;IACvBF,OAAO,EAAEA;EAAQ,GACZX,MAAM,KAAKc,SAAS,GAAG;IAAEC,IAAI,EAAEf;EAAO,CAAC,GAAG,CAAC,CAAC,GAC5CC,OAAO,KAAKa,SAAS,GAAG;IAAEb,OAAO,EAAPA;EAAQ,CAAC,GAAG,CAAC,CAAC,GACxCC,QAAQ,KAAKY,SAAS,GAAG;IAAEE,SAAS,EAAEd;EAAS,CAAC,GAAG,CAAC,CAAC,GACrDG,MAAM,KAAKS,SAAS,GAAG;IAAET,MAAM,EAANA;EAAO,CAAC,GAAG,CAAC,CAAC,CAC5C,CAAC;AAEN;AAEA,eAAeP,2BAA2B","ignoreList":[]}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import Box from "@mui/material/Box";
|
|
9
|
+
import FavoriteToggle from "../components/FavoriteToggle";
|
|
10
|
+
import Tooltip from "../components/Tooltip";
|
|
11
|
+
import { useIsFavorite } from "../personalization/capabilities/favorites";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* FavoriteColumn - Portnet UI v2 (pattern)
|
|
15
|
+
*
|
|
16
|
+
* `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for
|
|
17
|
+
* a compact "follow" (suivi) star column. Spread it into the grid's
|
|
18
|
+
* `columns` first so it sits at the LEFT of each row:
|
|
19
|
+
*
|
|
20
|
+
* const columns = [
|
|
21
|
+
* makeFavoriteColumn({ resourceKey: "ti:list", getRowId: (r) => r.reference }),
|
|
22
|
+
* { key: "reference", header: "Référence", ... },
|
|
23
|
+
* ...
|
|
24
|
+
* ];
|
|
25
|
+
* <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />
|
|
26
|
+
*
|
|
27
|
+
* Behaviour:
|
|
28
|
+
* - ALWAYS VISIBLE: the star is rendered on every row in both states
|
|
29
|
+
* (filled ★ when followed, outline ☆ when not) — it is NOT
|
|
30
|
+
* hover-revealed. It sits at the left of the row.
|
|
31
|
+
* - COMPACT: no visible column header (the header carries only a
|
|
32
|
+
* visually hidden accessible name "Suivis"), and a narrow 44px width,
|
|
33
|
+
* so the column takes minimal space.
|
|
34
|
+
* - STATUS TOOLTIP: hovering or focusing the star shows its current
|
|
35
|
+
* status — "Suivi" when followed, "Non suivi" otherwise. The button's
|
|
36
|
+
* accessible name stays action-oriented ("Suivre" / "Ne plus suivre",
|
|
37
|
+
* optionally enriched with the row label) and aria-pressed conveys the
|
|
38
|
+
* state, so screen-reader semantics are unaffected.
|
|
39
|
+
* - `toggleable: false` keeps the column out of ColumnsToggle (the user
|
|
40
|
+
* can't hide it); not sortable / resizable / reorderable (sorting BY
|
|
41
|
+
* follow status is a separate concern — see useFavoritesView /
|
|
42
|
+
* sortRowsByFavorites).
|
|
43
|
+
* - Each cell reads useIsFavorite (a boolean selector), so toggling one
|
|
44
|
+
* row re-renders only that row's star.
|
|
45
|
+
* - Toggling never triggers the row's onRowClick (click + keydown
|
|
46
|
+
* propagation stopped, mirroring the DataGrid selection checkbox).
|
|
47
|
+
*
|
|
48
|
+
* `getRowId` MUST match the one passed to <DataGrid> so the follow id and
|
|
49
|
+
* the grid row id agree. Requires a <UserPersonalizationProvider>
|
|
50
|
+
* ancestor (useIsFavorite throws otherwise).
|
|
51
|
+
*/
|
|
52
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
53
|
+
var DEFAULT_LABELS = Object.freeze({
|
|
54
|
+
columnHeader: "Suivis",
|
|
55
|
+
addFavorite: "Suivre",
|
|
56
|
+
removeFavorite: "Ne plus suivre",
|
|
57
|
+
statusFollowed: "Suivi",
|
|
58
|
+
statusNotFollowed: "Non suivi"
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/** Visually hidden, but exposed to assistive tech (the column's accessible name). */
|
|
62
|
+
var SR_ONLY_SX = Object.freeze({
|
|
63
|
+
position: "absolute",
|
|
64
|
+
width: "1px",
|
|
65
|
+
height: "1px",
|
|
66
|
+
padding: 0,
|
|
67
|
+
margin: "-1px",
|
|
68
|
+
overflow: "hidden",
|
|
69
|
+
clip: "rect(0 0 0 0)",
|
|
70
|
+
whiteSpace: "nowrap",
|
|
71
|
+
border: 0
|
|
72
|
+
});
|
|
73
|
+
function FavoriteCell(props) {
|
|
74
|
+
var resourceKey = props.resourceKey,
|
|
75
|
+
id = props.id,
|
|
76
|
+
size = props.size,
|
|
77
|
+
addLabel = props.addLabel,
|
|
78
|
+
removeLabel = props.removeLabel,
|
|
79
|
+
followedLabel = props.followedLabel,
|
|
80
|
+
notFollowedLabel = props.notFollowedLabel,
|
|
81
|
+
rowLabel = props.rowLabel;
|
|
82
|
+
var _useIsFavorite = useIsFavorite(resourceKey, id),
|
|
83
|
+
isFavorite = _useIsFavorite.isFavorite,
|
|
84
|
+
toggle = _useIsFavorite.toggle;
|
|
85
|
+
|
|
86
|
+
// Action-oriented accessible name (toggle convention); aria-pressed (set
|
|
87
|
+
// by FavoriteToggle) carries the state. Always provided, so the Tooltip
|
|
88
|
+
// never mirrors its title onto the trigger.
|
|
89
|
+
var action = isFavorite ? removeLabel : addLabel;
|
|
90
|
+
var ariaLabel = rowLabel ? action + " : " + rowLabel : action;
|
|
91
|
+
// Visible status shown on hover/focus.
|
|
92
|
+
var statusLabel = isFavorite ? followedLabel : notFollowedLabel;
|
|
93
|
+
var handleChange = function handleChange(_next, e) {
|
|
94
|
+
// Don't let the toggle's click bubble to the row's onRowClick.
|
|
95
|
+
if (e && typeof e.stopPropagation === "function") e.stopPropagation();
|
|
96
|
+
toggle();
|
|
97
|
+
};
|
|
98
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
99
|
+
// Prevent row-level Enter/Space (onRowClick) from also firing; the
|
|
100
|
+
// button's own native activation is unaffected.
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
};
|
|
103
|
+
return /*#__PURE__*/_jsx(Tooltip, {
|
|
104
|
+
title: statusLabel,
|
|
105
|
+
children: /*#__PURE__*/_jsx(FavoriteToggle, {
|
|
106
|
+
pressed: isFavorite,
|
|
107
|
+
onChange: handleChange,
|
|
108
|
+
onKeyDown: handleKeyDown,
|
|
109
|
+
size: size,
|
|
110
|
+
labels: {
|
|
111
|
+
addFavorite: addLabel,
|
|
112
|
+
removeFavorite: removeLabel
|
|
113
|
+
},
|
|
114
|
+
"aria-label": ariaLabel
|
|
115
|
+
})
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Builds a v2 DataGrid column definition for the compact follow-star column.
|
|
120
|
+
*/
|
|
121
|
+
export default function makeFavoriteColumn(options) {
|
|
122
|
+
var opts = options;
|
|
123
|
+
var resourceKey = opts.resourceKey;
|
|
124
|
+
var getRowId = typeof opts.getRowId === "function" ? opts.getRowId : function defaultGetRowId(r) {
|
|
125
|
+
return r.id;
|
|
126
|
+
};
|
|
127
|
+
var key = opts.key || "__favorite__";
|
|
128
|
+
var size = opts.size || "sm";
|
|
129
|
+
var width = opts.width != null ? opts.width : 44;
|
|
130
|
+
var getRowLabel = typeof opts.getRowLabel === "function" ? opts.getRowLabel : null;
|
|
131
|
+
var L = opts.labels ? _objectSpread(_objectSpread({}, DEFAULT_LABELS), opts.labels) : DEFAULT_LABELS;
|
|
132
|
+
if (process.env["NODE_ENV"] !== "production" && !resourceKey) {
|
|
133
|
+
// eslint-disable-next-line no-console
|
|
134
|
+
console.warn("[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.");
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
key: key,
|
|
138
|
+
header: /*#__PURE__*/_jsx(Box, {
|
|
139
|
+
component: "span",
|
|
140
|
+
sx: SR_ONLY_SX,
|
|
141
|
+
children: L.columnHeader
|
|
142
|
+
}),
|
|
143
|
+
align: "center",
|
|
144
|
+
sortable: false,
|
|
145
|
+
toggleable: false,
|
|
146
|
+
// kept out of ColumnsToggle (cannot be hidden)
|
|
147
|
+
resizable: false,
|
|
148
|
+
reorderable: false,
|
|
149
|
+
width: width,
|
|
150
|
+
render: function renderFavorite(row) {
|
|
151
|
+
return /*#__PURE__*/_jsx(FavoriteCell, {
|
|
152
|
+
resourceKey: resourceKey,
|
|
153
|
+
id: getRowId(row),
|
|
154
|
+
size: size,
|
|
155
|
+
addLabel: L.addFavorite,
|
|
156
|
+
removeLabel: L.removeFavorite,
|
|
157
|
+
followedLabel: L.statusFollowed,
|
|
158
|
+
notFollowedLabel: L.statusNotFollowed,
|
|
159
|
+
rowLabel: getRowLabel ? getRowLabel(row) : undefined
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=FavoriteColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavoriteColumn.js","names":["React","Box","FavoriteToggle","Tooltip","useIsFavorite","jsx","_jsx","DEFAULT_LABELS","Object","freeze","columnHeader","addFavorite","removeFavorite","statusFollowed","statusNotFollowed","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","FavoriteCell","props","resourceKey","id","size","addLabel","removeLabel","followedLabel","notFollowedLabel","rowLabel","_useIsFavorite","isFavorite","toggle","action","ariaLabel","statusLabel","handleChange","_next","e","stopPropagation","handleKeyDown","title","children","pressed","onChange","onKeyDown","labels","makeFavoriteColumn","options","opts","getRowId","defaultGetRowId","r","key","getRowLabel","L","_objectSpread","process","env","console","warn","header","component","sx","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","undefined"],"sources":["../../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport FavoriteToggle from \"../components/FavoriteToggle\";\r\nimport Tooltip from \"../components/Tooltip\";\r\nimport { useIsFavorite } from \"../personalization/capabilities/favorites\";\r\nimport type { DataGridColumn } from \"../types/datagrid\";\r\nimport type { RowId } from \"../types/common\";\r\n\r\n/**\r\n * FavoriteColumn - Portnet UI v2 (pattern)\r\n *\r\n * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for\r\n * a compact \"follow\" (suivi) star column. Spread it into the grid's\r\n * `columns` first so it sits at the LEFT of each row:\r\n *\r\n * const columns = [\r\n * makeFavoriteColumn({ resourceKey: \"ti:list\", getRowId: (r) => r.reference }),\r\n * { key: \"reference\", header: \"Référence\", ... },\r\n * ...\r\n * ];\r\n * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />\r\n *\r\n * Behaviour:\r\n * - ALWAYS VISIBLE: the star is rendered on every row in both states\r\n * (filled ★ when followed, outline ☆ when not) — it is NOT\r\n * hover-revealed. It sits at the left of the row.\r\n * - COMPACT: no visible column header (the header carries only a\r\n * visually hidden accessible name \"Suivis\"), and a narrow 44px width,\r\n * so the column takes minimal space.\r\n * - STATUS TOOLTIP: hovering or focusing the star shows its current\r\n * status — \"Suivi\" when followed, \"Non suivi\" otherwise. The button's\r\n * accessible name stays action-oriented (\"Suivre\" / \"Ne plus suivre\",\r\n * optionally enriched with the row label) and aria-pressed conveys the\r\n * state, so screen-reader semantics are unaffected.\r\n * - `toggleable: false` keeps the column out of ColumnsToggle (the user\r\n * can't hide it); not sortable / resizable / reorderable (sorting BY\r\n * follow status is a separate concern — see useFavoritesView /\r\n * sortRowsByFavorites).\r\n * - Each cell reads useIsFavorite (a boolean selector), so toggling one\r\n * row re-renders only that row's star.\r\n * - Toggling never triggers the row's onRowClick (click + keydown\r\n * propagation stopped, mirroring the DataGrid selection checkbox).\r\n *\r\n * `getRowId` MUST match the one passed to <DataGrid> so the follow id and\r\n * the grid row id agree. Requires a <UserPersonalizationProvider>\r\n * ancestor (useIsFavorite throws otherwise).\r\n */\r\n\r\ntype FavoriteToggleSize = NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"size\"]\r\n>;\r\n\r\nexport interface FavoriteColumnLabels {\r\n columnHeader: string;\r\n addFavorite: string;\r\n removeFavorite: string;\r\n statusFollowed: string;\r\n statusNotFollowed: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n columnHeader: \"Suivis\",\r\n addFavorite: \"Suivre\",\r\n removeFavorite: \"Ne plus suivre\",\r\n statusFollowed: \"Suivi\",\r\n statusNotFollowed: \"Non suivi\",\r\n} satisfies FavoriteColumnLabels);\r\n\r\n/** Visually hidden, but exposed to assistive tech (the column's accessible name). */\r\nconst SR_ONLY_SX = Object.freeze({\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: 0,\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0 0 0 0)\",\r\n whiteSpace: \"nowrap\",\r\n border: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\ninterface FavoriteCellProps {\r\n resourceKey: string;\r\n id: RowId;\r\n size: FavoriteToggleSize;\r\n addLabel: string;\r\n removeLabel: string;\r\n followedLabel: string;\r\n notFollowedLabel: string;\r\n rowLabel?: string | undefined;\r\n}\r\n\r\nfunction FavoriteCell(props: FavoriteCellProps): React.JSX.Element {\r\n const {\r\n resourceKey,\r\n id,\r\n size,\r\n addLabel,\r\n removeLabel,\r\n followedLabel,\r\n notFollowedLabel,\r\n rowLabel,\r\n } = props;\r\n const { isFavorite, toggle } = useIsFavorite(resourceKey, id);\r\n\r\n // Action-oriented accessible name (toggle convention); aria-pressed (set\r\n // by FavoriteToggle) carries the state. Always provided, so the Tooltip\r\n // never mirrors its title onto the trigger.\r\n const action = isFavorite ? removeLabel : addLabel;\r\n const ariaLabel = rowLabel ? action + \" : \" + rowLabel : action;\r\n // Visible status shown on hover/focus.\r\n const statusLabel = isFavorite ? followedLabel : notFollowedLabel;\r\n\r\n const handleChange: NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"onChange\"]\r\n > = function handleChange(_next, e) {\r\n // Don't let the toggle's click bubble to the row's onRowClick.\r\n if (e && typeof e.stopPropagation === \"function\") e.stopPropagation();\r\n toggle();\r\n };\r\n const handleKeyDown: NonNullable<\r\n React.ComponentProps<typeof FavoriteToggle>[\"onKeyDown\"]\r\n > = function handleKeyDown(e) {\r\n // Prevent row-level Enter/Space (onRowClick) from also firing; the\r\n // button's own native activation is unaffected.\r\n e.stopPropagation();\r\n };\r\n\r\n return (\r\n <Tooltip title={statusLabel}>\r\n <FavoriteToggle\r\n pressed={isFavorite}\r\n onChange={handleChange}\r\n onKeyDown={handleKeyDown}\r\n size={size}\r\n labels={{ addFavorite: addLabel, removeFavorite: removeLabel }}\r\n aria-label={ariaLabel}\r\n />\r\n </Tooltip>\r\n );\r\n}\r\n\r\nexport interface MakeFavoriteColumnOptions<T> {\r\n /** Required — follow namespace. */\r\n resourceKey: string;\r\n /** MUST match the grid's getRowId. Defaults to (r) => r.id. */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n /** Column key. @default \"__favorite__\" */\r\n key?: string | undefined;\r\n /** Toggle size (sm fits dense rows). @default \"sm\" */\r\n size?: FavoriteToggleSize | undefined;\r\n /** Column width (narrow / compact). @default 44 */\r\n width?: number | string | undefined;\r\n /** (row) => string, enriches the per-row aria-label. */\r\n getRowLabel?: ((row: T) => string) | undefined;\r\n labels?: Partial<FavoriteColumnLabels> | undefined;\r\n}\r\n\r\n/**\r\n * Builds a v2 DataGrid column definition for the compact follow-star column.\r\n */\r\nexport default function makeFavoriteColumn<T>(\r\n options: MakeFavoriteColumnOptions<T>\r\n): DataGridColumn<T> {\r\n const opts = options;\r\n const resourceKey = opts.resourceKey;\r\n const getRowId: (row: T) => RowId =\r\n typeof opts.getRowId === \"function\"\r\n ? opts.getRowId\r\n : function defaultGetRowId(r: T): RowId {\r\n return (r as { id: RowId }).id;\r\n };\r\n const key = opts.key || \"__favorite__\";\r\n const size = opts.size || \"sm\";\r\n const width: number | string = opts.width != null ? opts.width : 44;\r\n const getRowLabel =\r\n typeof opts.getRowLabel === \"function\" ? opts.getRowLabel : null;\r\n const L: FavoriteColumnLabels = opts.labels\r\n ? { ...DEFAULT_LABELS, ...opts.labels }\r\n : DEFAULT_LABELS;\r\n\r\n if (process.env[\"NODE_ENV\"] !== \"production\" && !resourceKey) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.\"\r\n );\r\n }\r\n\r\n return {\r\n key: key,\r\n header: (\r\n <Box component=\"span\" sx={SR_ONLY_SX}>\r\n {L.columnHeader}\r\n </Box>\r\n ),\r\n align: \"center\",\r\n sortable: false,\r\n toggleable: false, // kept out of ColumnsToggle (cannot be hidden)\r\n resizable: false,\r\n reorderable: false,\r\n width: width,\r\n render: function renderFavorite(row: T): React.ReactNode {\r\n return (\r\n <FavoriteCell\r\n resourceKey={resourceKey}\r\n id={getRowId(row)}\r\n size={size}\r\n addLabel={L.addFavorite}\r\n removeLabel={L.removeFavorite}\r\n followedLabel={L.statusFollowed}\r\n notFollowedLabel={L.statusNotFollowed}\r\n rowLabel={getRowLabel ? getRowLabel(row) : undefined}\r\n />\r\n );\r\n },\r\n };\r\n}\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import StarRoundedIcon from "@mui/icons-material/StarRounded";
|
|
9
|
+
import Segmented from "../components/Segmented";
|
|
10
|
+
import { mergeLabels } from "../utils/mergeLabels";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* FavoritesFilter - Portnet UI v2 (pattern)
|
|
14
|
+
*
|
|
15
|
+
* Presentational "Tous / Suivis" toggle for the follow filter, built on
|
|
16
|
+
* the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).
|
|
17
|
+
* Provider-free — drive it from the same state you pass to
|
|
18
|
+
* useFavoritesView:
|
|
19
|
+
*
|
|
20
|
+
* const [favFilter, setFavFilter] = React.useState("all");
|
|
21
|
+
* const view = useFavoritesView("ti:list", rows, {
|
|
22
|
+
* getRowId, filterMode: favFilter,
|
|
23
|
+
* });
|
|
24
|
+
* <FavoritesFilter
|
|
25
|
+
* value={favFilter}
|
|
26
|
+
* onChange={setFavFilter}
|
|
27
|
+
* favoriteCount={view.favoriteCount}
|
|
28
|
+
* totalCount={rows.length}
|
|
29
|
+
* />
|
|
30
|
+
*
|
|
31
|
+
* Values ("all" | "only") match FAVORITES_FILTER. Pass `fullWidth` to let
|
|
32
|
+
* it span its row on narrow / mobile toolbars.
|
|
33
|
+
*/
|
|
34
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
35
|
+
var DEFAULT_LABELS = Object.freeze({
|
|
36
|
+
all: "Tous",
|
|
37
|
+
favorites: "Suivis",
|
|
38
|
+
ariaLabel: "Filtrer par suivis"
|
|
39
|
+
});
|
|
40
|
+
function withCount(label, count) {
|
|
41
|
+
return typeof count === "number" ? label + " (" + count + ")" : label;
|
|
42
|
+
}
|
|
43
|
+
function FavoritesFilter(props) {
|
|
44
|
+
var _props$value = props.value,
|
|
45
|
+
value = _props$value === void 0 ? "all" : _props$value,
|
|
46
|
+
onChange = props.onChange,
|
|
47
|
+
favoriteCount = props.favoriteCount,
|
|
48
|
+
totalCount = props.totalCount,
|
|
49
|
+
_props$showCounts = props.showCounts,
|
|
50
|
+
showCounts = _props$showCounts === void 0 ? true : _props$showCounts,
|
|
51
|
+
_props$showIcon = props.showIcon,
|
|
52
|
+
showIcon = _props$showIcon === void 0 ? true : _props$showIcon,
|
|
53
|
+
_props$size = props.size,
|
|
54
|
+
size = _props$size === void 0 ? "sm" : _props$size,
|
|
55
|
+
_props$fullWidth = props.fullWidth,
|
|
56
|
+
fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
|
|
57
|
+
labels = props.labels,
|
|
58
|
+
sx = props.sx;
|
|
59
|
+
var L = React.useMemo(function () {
|
|
60
|
+
return mergeLabels(DEFAULT_LABELS, labels);
|
|
61
|
+
}, [labels]);
|
|
62
|
+
var options = React.useMemo(function buildOptions() {
|
|
63
|
+
return [{
|
|
64
|
+
value: "all",
|
|
65
|
+
label: showCounts ? withCount(L.all, totalCount) : L.all
|
|
66
|
+
}, _objectSpread({
|
|
67
|
+
value: "only",
|
|
68
|
+
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites
|
|
69
|
+
}, showIcon ? {
|
|
70
|
+
icon: /*#__PURE__*/_jsx(StarRoundedIcon, {
|
|
71
|
+
fontSize: "small"
|
|
72
|
+
})
|
|
73
|
+
} : {})];
|
|
74
|
+
}, [L, showCounts, showIcon, totalCount, favoriteCount]);
|
|
75
|
+
var handleChange = React.useCallback(function handleChange(v) {
|
|
76
|
+
// Segmented emits its configured option values only ("all" / "only").
|
|
77
|
+
if (onChange) onChange(v);
|
|
78
|
+
}, [onChange]);
|
|
79
|
+
return /*#__PURE__*/_jsx(Segmented, _objectSpread({
|
|
80
|
+
value: value,
|
|
81
|
+
onChange: handleChange,
|
|
82
|
+
options: options,
|
|
83
|
+
size: size,
|
|
84
|
+
fullWidth: fullWidth,
|
|
85
|
+
"aria-label": L.ariaLabel
|
|
86
|
+
}, sx !== undefined ? {
|
|
87
|
+
sx: sx
|
|
88
|
+
} : {}));
|
|
89
|
+
}
|
|
90
|
+
export default FavoritesFilter;
|
|
91
|
+
//# sourceMappingURL=FavoritesFilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FavoritesFilter.js","names":["React","StarRoundedIcon","Segmented","mergeLabels","jsx","_jsx","DEFAULT_LABELS","Object","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","_props$value","value","onChange","favoriteCount","totalCount","_props$showCounts","showCounts","_props$showIcon","showIcon","_props$size","size","_props$fullWidth","fullWidth","labels","sx","L","useMemo","options","buildOptions","_objectSpread","icon","fontSize","handleChange","useCallback","v","undefined"],"sources":["../../../../src/lib/v2/patterns/FavoritesFilter.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport StarRoundedIcon from \"@mui/icons-material/StarRounded\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport Segmented from \"../components/Segmented\";\r\nimport type { SegmentedOption, SegmentedValue } from \"../components/Segmented\";\r\nimport type { FavoritesFilterMode } from \"../personalization/capabilities/favoritesView\";\r\nimport { mergeLabels } from \"../utils/mergeLabels\";\r\n\r\n/**\r\n * FavoritesFilter - Portnet UI v2 (pattern)\r\n *\r\n * Presentational \"Tous / Suivis\" toggle for the follow filter, built on\r\n * the v2 Segmented (role=radiogroup, arrow-key selection, focus halo).\r\n * Provider-free — drive it from the same state you pass to\r\n * useFavoritesView:\r\n *\r\n * const [favFilter, setFavFilter] = React.useState(\"all\");\r\n * const view = useFavoritesView(\"ti:list\", rows, {\r\n * getRowId, filterMode: favFilter,\r\n * });\r\n * <FavoritesFilter\r\n * value={favFilter}\r\n * onChange={setFavFilter}\r\n * favoriteCount={view.favoriteCount}\r\n * totalCount={rows.length}\r\n * />\r\n *\r\n * Values (\"all\" | \"only\") match FAVORITES_FILTER. Pass `fullWidth` to let\r\n * it span its row on narrow / mobile toolbars.\r\n */\r\n\r\nexport interface FavoritesFilterLabels {\r\n all: string;\r\n favorites: string;\r\n ariaLabel: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n all: \"Tous\",\r\n favorites: \"Suivis\",\r\n ariaLabel: \"Filtrer par suivis\",\r\n} satisfies FavoritesFilterLabels);\r\n\r\nfunction withCount(label: string, count: number | undefined): string {\r\n return typeof count === \"number\" ? label + \" (\" + count + \")\" : label;\r\n}\r\n\r\nexport interface FavoritesFilterProps {\r\n /** Current mode (matches FAVORITES_FILTER). @default \"all\" */\r\n value?: FavoritesFilterMode | undefined;\r\n /** (mode) => void. */\r\n onChange?: ((value: FavoritesFilterMode) => void) | undefined;\r\n /** Count shown on the \"Suivis\" segment. */\r\n favoriteCount?: number | undefined;\r\n /** Count shown on the \"Tous\" segment. */\r\n totalCount?: number | undefined;\r\n showCounts?: boolean | undefined;\r\n showIcon?: boolean | undefined;\r\n size?: \"sm\" | \"md\" | undefined;\r\n /** Span the available width — useful on narrow / mobile toolbars. */\r\n fullWidth?: boolean | undefined;\r\n /** Localised labels (FR default; EN/AR supported). */\r\n labels?: Partial<FavoritesFilterLabels> | undefined;\r\n sx?: SxProps<Theme> | undefined;\r\n}\r\n\r\nfunction FavoritesFilter(props: FavoritesFilterProps): React.JSX.Element {\r\n const {\r\n value = \"all\",\r\n onChange,\r\n favoriteCount,\r\n totalCount,\r\n showCounts = true,\r\n showIcon = true,\r\n size = \"sm\",\r\n fullWidth = false,\r\n labels,\r\n sx,\r\n } = props;\r\n const L = React.useMemo<FavoritesFilterLabels>(\r\n () => (mergeLabels(DEFAULT_LABELS, labels)),\r\n [labels]\r\n );\r\n\r\n const options = React.useMemo<SegmentedOption[]>(\r\n function buildOptions() {\r\n return [\r\n {\r\n value: \"all\",\r\n label: showCounts ? withCount(L.all, totalCount) : L.all,\r\n },\r\n {\r\n value: \"only\",\r\n label: showCounts\r\n ? withCount(L.favorites, favoriteCount)\r\n : L.favorites,\r\n ...(showIcon ? { icon: <StarRoundedIcon fontSize=\"small\" /> } : {}),\r\n },\r\n ];\r\n },\r\n [L, showCounts, showIcon, totalCount, favoriteCount]\r\n );\r\n\r\n const handleChange = React.useCallback(\r\n function handleChange(v: SegmentedValue): void {\r\n // Segmented emits its configured option values only (\"all\" / \"only\").\r\n if (onChange) onChange(v as FavoritesFilterMode);\r\n },\r\n [onChange]\r\n );\r\n\r\n return (\r\n <Segmented\r\n value={value}\r\n onChange={handleChange}\r\n options={options}\r\n size={size}\r\n fullWidth={fullWidth}\r\n aria-label={L.ariaLabel}\r\n {...(sx !== undefined ? { sx } : {})}\r\n />\r\n );\r\n}\r\n\r\nexport default FavoritesFilter;\r\n"],"mappings":";;;;;;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,IAAMC,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,IAAAC,YAAA,GAWID,KAAK,CAVPE,KAAK;IAALA,KAAK,GAAAD,YAAA,cAAG,KAAK,GAAAA,YAAA;IACbE,QAAQ,GASNH,KAAK,CATPG,QAAQ;IACRC,aAAa,GAQXJ,KAAK,CARPI,aAAa;IACbC,UAAU,GAORL,KAAK,CAPPK,UAAU;IAAAC,iBAAA,GAORN,KAAK,CANPO,UAAU;IAAVA,UAAU,GAAAD,iBAAA,cAAG,IAAI,GAAAA,iBAAA;IAAAE,eAAA,GAMfR,KAAK,CALPS,QAAQ;IAARA,QAAQ,GAAAD,eAAA,cAAG,IAAI,GAAAA,eAAA;IAAAE,WAAA,GAKbV,KAAK,CAJPW,IAAI;IAAJA,IAAI,GAAAD,WAAA,cAAG,IAAI,GAAAA,WAAA;IAAAE,gBAAA,GAITZ,KAAK,CAHPa,SAAS;IAATA,SAAS,GAAAD,gBAAA,cAAG,KAAK,GAAAA,gBAAA;IACjBE,MAAM,GAEJd,KAAK,CAFPc,MAAM;IACNC,EAAE,GACAf,KAAK,CADPe,EAAE;EAEJ,IAAMC,CAAC,GAAGhC,KAAK,CAACiC,OAAO,CACrB;IAAA,OAAO9B,WAAW,CAACG,cAAc,EAAEwB,MAAM,CAAC;EAAA,CAAC,EAC3C,CAACA,MAAM,CACT,CAAC;EAED,IAAMI,OAAO,GAAGlC,KAAK,CAACiC,OAAO,CAC3B,SAASE,YAAYA,CAAA,EAAG;IACtB,OAAO,CACL;MACEjB,KAAK,EAAE,KAAK;MACZL,KAAK,EAAEU,UAAU,GAAGX,SAAS,CAACoB,CAAC,CAACvB,GAAG,EAAEY,UAAU,CAAC,GAAGW,CAAC,CAACvB;IACvD,CAAC,EAAA2B,aAAA;MAEClB,KAAK,EAAE,MAAM;MACbL,KAAK,EAAEU,UAAU,GACbX,SAAS,CAACoB,CAAC,CAACtB,SAAS,EAAEU,aAAa,CAAC,GACrCY,CAAC,CAACtB;IAAS,GACXe,QAAQ,GAAG;MAAEY,IAAI,eAAEhC,IAAA,CAACJ,eAAe;QAACqC,QAAQ,EAAC;MAAO,CAAE;IAAE,CAAC,GAAG,CAAC,CAAC,EAErE;EACH,CAAC,EACD,CAACN,CAAC,EAAET,UAAU,EAAEE,QAAQ,EAAEJ,UAAU,EAAED,aAAa,CACrD,CAAC;EAED,IAAMmB,YAAY,GAAGvC,KAAK,CAACwC,WAAW,CACpC,SAASD,YAAYA,CAACE,CAAiB,EAAQ;IAC7C;IACA,IAAItB,QAAQ,EAAEA,QAAQ,CAACsB,CAAwB,CAAC;EAClD,CAAC,EACD,CAACtB,QAAQ,CACX,CAAC;EAED,oBACEd,IAAA,CAACH,SAAS,EAAAkC,aAAA;IACRlB,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEoB,YAAa;IACvBL,OAAO,EAAEA,OAAQ;IACjBP,IAAI,EAAEA,IAAK;IACXE,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAACrB;EAAU,GACnBoB,EAAE,KAAKW,SAAS,GAAG;IAAEX,EAAE,EAAFA;EAAG,CAAC,GAAG,CAAC,CAAC,CACpC,CAAC;AAEN;AAEA,eAAehB,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import Box from "@mui/material/Box";
|
|
3
|
+
import Banner from "../components/Banner";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FormErrorSummary — Portnet UI v2
|
|
7
|
+
*
|
|
8
|
+
* Charter §05 / R-FV.2. Synthesis banner rendered above a form after a
|
|
9
|
+
* failed-submit so the user sees, at-a-glance, every field that needs
|
|
10
|
+
* attention. Each entry is a clickable jump-to-field affordance; the host
|
|
11
|
+
* supplies the navigation behaviour via `onItemClick`.
|
|
12
|
+
*
|
|
13
|
+
* Composition: pure v2.Banner + a semantic <ul> of <button> jump-links.
|
|
14
|
+
* No host-specific scroll/focus logic baked in.
|
|
15
|
+
*
|
|
16
|
+
* Renders nothing when `errors` is empty / nullish — host can mount
|
|
17
|
+
* unconditionally above the form.
|
|
18
|
+
*
|
|
19
|
+
* Accessibility:
|
|
20
|
+
* - <button type="button"> instead of <a href="#…">. The entries trigger
|
|
21
|
+
* an action (focus/scroll) and don't navigate.
|
|
22
|
+
* - Explicit role="list" + role="listitem" because some screen readers
|
|
23
|
+
* strip list semantics when CSS list-style:none is applied.
|
|
24
|
+
* - Banner already carries the alert/role semantics for the region.
|
|
25
|
+
* - Explicit :focus-visible outline on each jump-button on --danger-fg,
|
|
26
|
+
* which passes WCAG 1.4.11 ≥ 3:1 on danger-soft (finding B4-EXT-2).
|
|
27
|
+
*
|
|
28
|
+
* Charter R-AI.2: composition of v2.Banner only — no local primitive.
|
|
29
|
+
*/
|
|
30
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
31
|
+
function FormErrorSummary(_ref) {
|
|
32
|
+
var errors = _ref.errors,
|
|
33
|
+
labelByName = _ref.labelByName,
|
|
34
|
+
onItemClick = _ref.onItemClick,
|
|
35
|
+
title = _ref.title;
|
|
36
|
+
if (!errors || errors.length === 0) return null;
|
|
37
|
+
var heading = title || "Veuillez corriger les erreurs ci-dessous";
|
|
38
|
+
var handleClick = function handleClick(e, name) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
if (typeof onItemClick === "function") {
|
|
41
|
+
onItemClick(name);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return /*#__PURE__*/_jsx(Banner, {
|
|
45
|
+
variant: "error",
|
|
46
|
+
title: heading,
|
|
47
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
48
|
+
component: "ul",
|
|
49
|
+
role: "list",
|
|
50
|
+
sx: {
|
|
51
|
+
margin: 0,
|
|
52
|
+
paddingInlineStart: "var(--s-5)",
|
|
53
|
+
fontSize: "var(--text-sm)",
|
|
54
|
+
listStyle: "disc"
|
|
55
|
+
},
|
|
56
|
+
children: errors.map(function (err, idx) {
|
|
57
|
+
var label = labelByName && labelByName[err.name] || err.name;
|
|
58
|
+
return /*#__PURE__*/_jsxs(Box, {
|
|
59
|
+
component: "li",
|
|
60
|
+
role: "listitem",
|
|
61
|
+
sx: {
|
|
62
|
+
marginBottom: "var(--s-1)"
|
|
63
|
+
},
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
65
|
+
component: "button",
|
|
66
|
+
type: "button",
|
|
67
|
+
onClick: function onClick(e) {
|
|
68
|
+
return handleClick(e, err.name);
|
|
69
|
+
},
|
|
70
|
+
sx: {
|
|
71
|
+
// Reset default <button> chrome so the link reads visually
|
|
72
|
+
// as a hyperlink in the banner body.
|
|
73
|
+
background: "transparent",
|
|
74
|
+
border: "none",
|
|
75
|
+
padding: 0,
|
|
76
|
+
margin: 0,
|
|
77
|
+
font: "inherit",
|
|
78
|
+
cursor: "pointer",
|
|
79
|
+
color: "var(--danger-fg)",
|
|
80
|
+
textDecoration: "underline",
|
|
81
|
+
fontWeight: "var(--fw-medium)",
|
|
82
|
+
// R-F.1 — explicit focus-visible outline. Outline on
|
|
83
|
+
// currentColor (danger-fg) passes 1.4.11 ≥ 3:1 on the soft
|
|
84
|
+
// danger background; borderRadius aligns the ring with the DS.
|
|
85
|
+
"&:focus-visible": {
|
|
86
|
+
outline: "2px solid var(--danger-fg)",
|
|
87
|
+
outlineOffset: "var(--pui-outline-offset)",
|
|
88
|
+
borderRadius: "var(--r-sm)"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
children: label
|
|
92
|
+
}), ": ", /*#__PURE__*/_jsx("span", {
|
|
93
|
+
children: err.message
|
|
94
|
+
})]
|
|
95
|
+
}, "".concat(err.name, "-").concat(idx));
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
export default FormErrorSummary;
|
|
101
|
+
//# sourceMappingURL=FormErrorSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormErrorSummary.js","names":["React","Box","Banner","jsx","_jsx","jsxs","_jsxs","FormErrorSummary","_ref","errors","labelByName","onItemClick","title","length","heading","handleClick","e","name","preventDefault","variant","children","component","role","sx","margin","paddingInlineStart","fontSize","listStyle","map","err","idx","label","marginBottom","type","onClick","background","border","padding","font","cursor","color","textDecoration","fontWeight","outline","outlineOffset","borderRadius","message","concat"],"sources":["../../../../src/lib/v2/patterns/FormErrorSummary.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport Banner from \"../components/Banner\";\r\n\r\n/**\r\n * FormErrorSummary — Portnet UI v2\r\n *\r\n * Charter §05 / R-FV.2. Synthesis banner rendered above a form after a\r\n * failed-submit so the user sees, at-a-glance, every field that needs\r\n * attention. Each entry is a clickable jump-to-field affordance; the host\r\n * supplies the navigation behaviour via `onItemClick`.\r\n *\r\n * Composition: pure v2.Banner + a semantic <ul> of <button> jump-links.\r\n * No host-specific scroll/focus logic baked in.\r\n *\r\n * Renders nothing when `errors` is empty / nullish — host can mount\r\n * unconditionally above the form.\r\n *\r\n * Accessibility:\r\n * - <button type=\"button\"> instead of <a href=\"#…\">. The entries trigger\r\n * an action (focus/scroll) and don't navigate.\r\n * - Explicit role=\"list\" + role=\"listitem\" because some screen readers\r\n * strip list semantics when CSS list-style:none is applied.\r\n * - Banner already carries the alert/role semantics for the region.\r\n * - Explicit :focus-visible outline on each jump-button on --danger-fg,\r\n * which passes WCAG 1.4.11 ≥ 3:1 on danger-soft (finding B4-EXT-2).\r\n *\r\n * Charter R-AI.2: composition of v2.Banner only — no local primitive.\r\n */\r\n\r\nexport interface FormErrorSummaryError {\r\n name: string;\r\n message: string;\r\n}\r\n\r\nexport interface FormErrorSummaryProps {\r\n errors?: FormErrorSummaryError[] | undefined;\r\n labelByName?: Record<string, string> | undefined;\r\n onItemClick?: ((name: string) => void) | undefined;\r\n title?: string | undefined;\r\n}\r\n\r\nfunction FormErrorSummary({\r\n errors,\r\n labelByName,\r\n onItemClick,\r\n title,\r\n}: FormErrorSummaryProps) {\r\n if (!errors || errors.length === 0) return null;\r\n\r\n const heading = title || \"Veuillez corriger les erreurs ci-dessous\";\r\n\r\n const handleClick = (\r\n e: React.MouseEvent<HTMLButtonElement>,\r\n name: string\r\n ) => {\r\n e.preventDefault();\r\n if (typeof onItemClick === \"function\") {\r\n onItemClick(name);\r\n }\r\n };\r\n\r\n return (\r\n <Banner variant=\"error\" title={heading}>\r\n <Box\r\n component=\"ul\"\r\n role=\"list\"\r\n sx={{\r\n margin: 0,\r\n paddingInlineStart: \"var(--s-5)\",\r\n fontSize: \"var(--text-sm)\",\r\n listStyle: \"disc\",\r\n }}\r\n >\r\n {errors.map((err, idx) => {\r\n const label = (labelByName && labelByName[err.name]) || err.name;\r\n return (\r\n <Box\r\n component=\"li\"\r\n role=\"listitem\"\r\n key={`${err.name}-${idx}`}\r\n sx={{ marginBottom: \"var(--s-1)\" }}\r\n >\r\n <Box\r\n component=\"button\"\r\n type=\"button\"\r\n onClick={(e) => handleClick(e, err.name)}\r\n sx={{\r\n // Reset default <button> chrome so the link reads visually\r\n // as a hyperlink in the banner body.\r\n background: \"transparent\",\r\n border: \"none\",\r\n padding: 0,\r\n margin: 0,\r\n font: \"inherit\",\r\n cursor: \"pointer\",\r\n color: \"var(--danger-fg)\",\r\n textDecoration: \"underline\",\r\n fontWeight: \"var(--fw-medium)\",\r\n // R-F.1 — explicit focus-visible outline. Outline on\r\n // currentColor (danger-fg) passes 1.4.11 ≥ 3:1 on the soft\r\n // danger background; borderRadius aligns the ring with the DS.\r\n \"&:focus-visible\": {\r\n outline: \"2px solid var(--danger-fg)\",\r\n outlineOffset: \"var(--pui-outline-offset)\",\r\n borderRadius: \"var(--r-sm)\",\r\n },\r\n }}\r\n >\r\n {label}\r\n </Box>\r\n {\": \"}\r\n <span>{err.message}</span>\r\n </Box>\r\n );\r\n })}\r\n </Box>\r\n </Banner>\r\n );\r\n}\r\n\r\nexport default FormErrorSummary;\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import Box from "@mui/material/Box";
|
|
9
|
+
import ActionBar from "./ActionBar";
|
|
10
|
+
import PageContent from "./PageContent";
|
|
11
|
+
import ProgressBar from "../components/ProgressBar";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* FormPageShell — Portnet UI v2 (pattern)
|
|
15
|
+
*
|
|
16
|
+
* Charter §07 R-L.2 — canonical shell for create/edit form pages.
|
|
17
|
+
*
|
|
18
|
+
* Combines a sticky ActionBar (surface=false, accent title) with a
|
|
19
|
+
* responsive PageContent wrapper so every module's form page has the
|
|
20
|
+
* same structure without reimplementing it.
|
|
21
|
+
*
|
|
22
|
+
* ┌───────────────────────────────────────────────────────────────┐
|
|
23
|
+
* │ 🏠 > Breadcrumb │ sticky
|
|
24
|
+
* │ Title [secondary] [primary] [overflow…] │
|
|
25
|
+
* │ Subtitle │
|
|
26
|
+
* └───────────────────────────────────────────────────────────────┘
|
|
27
|
+
* ┌───────────────────────────────────────────────────────────────┐
|
|
28
|
+
* │ [ProgressBar ── progressLabel] ← if progress prop given │
|
|
29
|
+
* │ children │
|
|
30
|
+
* └───────────────────────────────────────────────────────────────┘
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <FormPageShell
|
|
34
|
+
* home={() => navigate("/")}
|
|
35
|
+
* back={() => navigate("/list")}
|
|
36
|
+
* breadcrumb={["Autorisations", "Nouvelle autorisation"]}
|
|
37
|
+
* title="Nouvelle autorisation"
|
|
38
|
+
* subtitle="Saisissez les informations…"
|
|
39
|
+
* secondary={[{ label: "Enregistrer", icon: <SaveIcon />, onClick: handleSave }]}
|
|
40
|
+
* primary={{ label: "Déposer", iconRight: <ArrowIcon />, onClick: handleDeposit }}
|
|
41
|
+
* overflow={[{ label: "Retour à la liste", onClick: goBack }]}
|
|
42
|
+
* progress={requiredPct}
|
|
43
|
+
* progressLabel={isComplete ? "Prêt à déposer ✓" : `${filled}/${total} requis`}
|
|
44
|
+
* >
|
|
45
|
+
* <FormSection number={1} title="Informations">…</FormSection>
|
|
46
|
+
* </FormPageShell>
|
|
47
|
+
*/
|
|
48
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
49
|
+
var PROGRESS_ROW_SX = Object.freeze({
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
gap: "var(--s-3)",
|
|
53
|
+
marginBottom: "var(--s-5)"
|
|
54
|
+
});
|
|
55
|
+
var PROGRESS_BAR_WRAPPER_SX = Object.freeze({
|
|
56
|
+
flex: 1,
|
|
57
|
+
minWidth: 0
|
|
58
|
+
});
|
|
59
|
+
var PROGRESS_LABEL_SX = Object.freeze({
|
|
60
|
+
fontSize: "var(--text-xs)",
|
|
61
|
+
color: "var(--fg-muted)",
|
|
62
|
+
whiteSpace: "nowrap",
|
|
63
|
+
fontVariantNumeric: "tabular-nums",
|
|
64
|
+
flexShrink: 0
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Valeurs par défaut inline — plus de defaultProps.
|
|
69
|
+
* React 18.3+ supprime le support de defaultProps pour les function
|
|
70
|
+
* components. Aligné sur le pattern DataGridToolbar (B14).
|
|
71
|
+
*/
|
|
72
|
+
function FormPageShell(_ref) {
|
|
73
|
+
var home = _ref.home,
|
|
74
|
+
back = _ref.back,
|
|
75
|
+
breadcrumb = _ref.breadcrumb,
|
|
76
|
+
title = _ref.title,
|
|
77
|
+
subtitle = _ref.subtitle,
|
|
78
|
+
icon = _ref.icon,
|
|
79
|
+
_ref$secondary = _ref.secondary,
|
|
80
|
+
secondary = _ref$secondary === void 0 ? [] : _ref$secondary,
|
|
81
|
+
primary = _ref.primary,
|
|
82
|
+
_ref$overflow = _ref.overflow,
|
|
83
|
+
overflow = _ref$overflow === void 0 ? [] : _ref$overflow,
|
|
84
|
+
progress = _ref.progress,
|
|
85
|
+
progressLabel = _ref.progressLabel,
|
|
86
|
+
children = _ref.children,
|
|
87
|
+
contentSx = _ref.contentSx;
|
|
88
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
89
|
+
children: [/*#__PURE__*/_jsx(ActionBar, _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
90
|
+
surface: false,
|
|
91
|
+
title: title,
|
|
92
|
+
subtitle: subtitle,
|
|
93
|
+
secondary: secondary,
|
|
94
|
+
overflow: overflow
|
|
95
|
+
}, home !== undefined ? {
|
|
96
|
+
home: home
|
|
97
|
+
} : {}), back !== undefined ? {
|
|
98
|
+
back: back
|
|
99
|
+
} : {}), breadcrumb !== undefined ? {
|
|
100
|
+
breadcrumb: breadcrumb
|
|
101
|
+
} : {}), icon !== undefined ? {
|
|
102
|
+
icon: icon
|
|
103
|
+
} : {}), primary !== undefined ? {
|
|
104
|
+
primary: primary
|
|
105
|
+
} : {})), /*#__PURE__*/_jsxs(PageContent, _objectSpread(_objectSpread({}, contentSx !== undefined ? {
|
|
106
|
+
sx: contentSx
|
|
107
|
+
} : {}), {}, {
|
|
108
|
+
children: [typeof progress === "number" && /*#__PURE__*/_jsxs(Box, {
|
|
109
|
+
sx: PROGRESS_ROW_SX,
|
|
110
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
111
|
+
sx: PROGRESS_BAR_WRAPPER_SX,
|
|
112
|
+
children: /*#__PURE__*/_jsx(ProgressBar, {
|
|
113
|
+
value: progress,
|
|
114
|
+
"aria-label": "Avancement de la saisie"
|
|
115
|
+
})
|
|
116
|
+
}), progressLabel && /*#__PURE__*/_jsx(Box, {
|
|
117
|
+
component: "span",
|
|
118
|
+
sx: PROGRESS_LABEL_SX,
|
|
119
|
+
children: progressLabel
|
|
120
|
+
})]
|
|
121
|
+
}), children]
|
|
122
|
+
}))]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
export default FormPageShell;
|
|
126
|
+
//# sourceMappingURL=FormPageShell.js.map
|