@portnet/ui 6.0.1 → 6.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +737 -0
- package/dist/esm/index.js +90 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/v2/__tests__/AppMain.test.js +130 -0
- package/dist/esm/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js +180 -0
- package/dist/esm/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js +150 -0
- package/dist/esm/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js +93 -0
- package/dist/esm/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldError.test.js +71 -39
- package/dist/esm/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FieldNaming.test.js +160 -0
- package/dist/esm/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js +146 -0
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -18
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +173 -0
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +236 -0
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js +101 -0
- package/dist/esm/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js +299 -0
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -43
- package/dist/esm/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js +165 -0
- package/dist/esm/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js +156 -0
- package/dist/esm/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js +37 -52
- package/dist/esm/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/esm/v2/__tests__/apiError.test.js +50 -69
- package/dist/esm/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/esm/v2/__tests__/banned-patterns.test.js +41 -122
- package/dist/esm/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/esm/v2/__tests__/chart-palette.test.js +204 -0
- package/dist/esm/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/esm/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/esm/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/esm/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/esm/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/esm/v2/__tests__/fileValidation.test.js +134 -0
- package/dist/esm/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js +321 -0
- package/dist/esm/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js +68 -0
- package/dist/esm/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js +218 -0
- package/dist/esm/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/esm/v2/__tests__/labels-merge.test.js +17 -22
- package/dist/esm/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/esm/v2/__tests__/locale-fallback.test.js +35 -40
- package/dist/esm/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js +143 -0
- package/dist/esm/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/esm/v2/__tests__/rowActions.test.js +182 -0
- package/dist/esm/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js +155 -0
- package/dist/esm/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/esm/v2/__tests__/useFocusTrap.test.js +266 -402
- package/dist/esm/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js +120 -0
- package/dist/esm/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/esm/v2/components/Accordion.js +48 -70
- package/dist/esm/v2/components/Accordion.js.map +1 -1
- package/dist/esm/v2/components/ActionStrip.js +31 -43
- package/dist/esm/v2/components/ActionStrip.js.map +1 -1
- package/dist/esm/v2/components/Banner.js +25 -22
- package/dist/esm/v2/components/Banner.js.map +1 -1
- package/dist/esm/v2/components/Busy.js +14 -19
- package/dist/esm/v2/components/Busy.js.map +1 -1
- package/dist/esm/v2/components/Button.js +34 -45
- package/dist/esm/v2/components/Button.js.map +1 -1
- package/dist/esm/v2/components/CategoryTag.js +44 -27
- package/dist/esm/v2/components/CategoryTag.js.map +1 -1
- package/dist/esm/v2/components/Checkbox.js +32 -38
- package/dist/esm/v2/components/Checkbox.js.map +1 -1
- package/dist/esm/v2/components/Chip.js +23 -36
- package/dist/esm/v2/components/Chip.js.map +1 -1
- package/dist/esm/v2/components/Combobox.js +112 -136
- package/dist/esm/v2/components/Combobox.js.map +1 -1
- package/dist/esm/v2/components/CommandPalette.js +113 -198
- package/dist/esm/v2/components/CommandPalette.js.map +1 -1
- package/dist/esm/v2/components/ConfirmDialog.js +36 -45
- package/dist/esm/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/esm/v2/components/DatePicker.js +78 -81
- package/dist/esm/v2/components/DatePicker.js.map +1 -1
- package/dist/esm/v2/components/DateRangePicker.js +63 -74
- package/dist/esm/v2/components/DateRangePicker.js.map +1 -1
- package/dist/esm/v2/components/DateTimePicker.js +118 -90
- package/dist/esm/v2/components/DateTimePicker.js.map +1 -1
- package/dist/esm/v2/components/Drawer.js +71 -65
- package/dist/esm/v2/components/Drawer.js.map +1 -1
- package/dist/esm/v2/components/Dropzone.js +130 -177
- package/dist/esm/v2/components/Dropzone.js.map +1 -1
- package/dist/esm/v2/components/EmptyState.js +9 -9
- package/dist/esm/v2/components/EmptyState.js.map +1 -1
- package/dist/esm/v2/components/FavoriteToggle.js +24 -33
- package/dist/esm/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/esm/v2/components/Field.js +210 -52
- package/dist/esm/v2/components/Field.js.map +1 -1
- package/dist/esm/v2/components/FieldError.js +9 -13
- package/dist/esm/v2/components/FieldError.js.map +1 -1
- package/dist/esm/v2/components/FieldHelp.js +28 -49
- package/dist/esm/v2/components/FieldHelp.js.map +1 -1
- package/dist/esm/v2/components/FileCard.js +14 -19
- package/dist/esm/v2/components/FileCard.js.map +1 -1
- package/dist/esm/v2/components/FilterTab.js +22 -31
- package/dist/esm/v2/components/FilterTab.js.map +1 -1
- package/dist/esm/v2/components/ForbiddenPage.js +28 -8
- package/dist/esm/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/esm/v2/components/FormGrid.js +48 -54
- package/dist/esm/v2/components/FormGrid.js.map +1 -1
- package/dist/esm/v2/components/FormikDisplay.js +98 -24
- package/dist/esm/v2/components/FormikDisplay.js.map +1 -1
- package/dist/esm/v2/components/Input.js +75 -34
- package/dist/esm/v2/components/Input.js.map +1 -1
- package/dist/esm/v2/components/KPICard.js +42 -51
- package/dist/esm/v2/components/KPICard.js.map +1 -1
- package/dist/esm/v2/components/KPIStrip.js +9 -15
- package/dist/esm/v2/components/KPIStrip.js.map +1 -1
- package/dist/esm/v2/components/KV.js +16 -23
- package/dist/esm/v2/components/KV.js.map +1 -1
- package/dist/esm/v2/components/KVGrid.js +15 -23
- package/dist/esm/v2/components/KVGrid.js.map +1 -1
- package/dist/esm/v2/components/Layout.js +81 -117
- package/dist/esm/v2/components/Layout.js.map +1 -1
- package/dist/esm/v2/components/MobileRowCard.js +64 -75
- package/dist/esm/v2/components/MobileRowCard.js.map +1 -1
- package/dist/esm/v2/components/Modal.js +44 -53
- package/dist/esm/v2/components/Modal.js.map +1 -1
- package/dist/esm/v2/components/NetworkErrorPage.js +28 -11
- package/dist/esm/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/esm/v2/components/NotFoundPage.js +28 -9
- package/dist/esm/v2/components/NotFoundPage.js.map +1 -1
- package/dist/esm/v2/components/NumberInput.js +77 -107
- package/dist/esm/v2/components/NumberInput.js.map +1 -1
- package/dist/esm/v2/components/OverflowMenu.js +24 -42
- package/dist/esm/v2/components/OverflowMenu.js.map +1 -1
- package/dist/esm/v2/components/PdfViewer.js +24 -33
- package/dist/esm/v2/components/PdfViewer.js.map +1 -1
- package/dist/esm/v2/components/ProgressBar.js +28 -36
- package/dist/esm/v2/components/ProgressBar.js.map +1 -1
- package/dist/esm/v2/components/Radio.js +49 -57
- package/dist/esm/v2/components/Radio.js.map +1 -1
- package/dist/esm/v2/components/SectionErrorBoundary.js +84 -130
- package/dist/esm/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/esm/v2/components/SectionHeader.js +24 -31
- package/dist/esm/v2/components/SectionHeader.js.map +1 -1
- package/dist/esm/v2/components/Segmented.js +59 -84
- package/dist/esm/v2/components/Segmented.js.map +1 -1
- package/dist/esm/v2/components/Select.js +100 -138
- package/dist/esm/v2/components/Select.js.map +1 -1
- package/dist/esm/v2/components/ServerErrorPage.js +27 -10
- package/dist/esm/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/esm/v2/components/Skeleton.js +81 -96
- package/dist/esm/v2/components/Skeleton.js.map +1 -1
- package/dist/esm/v2/components/SkipLink.js +6 -7
- package/dist/esm/v2/components/SkipLink.js.map +1 -1
- package/dist/esm/v2/components/Spinner.js +13 -22
- package/dist/esm/v2/components/Spinner.js.map +1 -1
- package/dist/esm/v2/components/Status.js +14 -25
- package/dist/esm/v2/components/Status.js.map +1 -1
- package/dist/esm/v2/components/Stepper.js +68 -71
- package/dist/esm/v2/components/Stepper.js.map +1 -1
- package/dist/esm/v2/components/Surface.js +25 -44
- package/dist/esm/v2/components/Surface.js.map +1 -1
- package/dist/esm/v2/components/Switch.js +21 -29
- package/dist/esm/v2/components/Switch.js.map +1 -1
- package/dist/esm/v2/components/TabPanel.js +84 -0
- package/dist/esm/v2/components/TabPanel.js.map +1 -0
- package/dist/esm/v2/components/Tabs.js +43 -19
- package/dist/esm/v2/components/Tabs.js.map +1 -1
- package/dist/esm/v2/components/TelInput.js +75 -108
- package/dist/esm/v2/components/TelInput.js.map +1 -1
- package/dist/esm/v2/components/Textarea.js +21 -30
- package/dist/esm/v2/components/Textarea.js.map +1 -1
- package/dist/esm/v2/components/TimePicker.js +59 -69
- package/dist/esm/v2/components/TimePicker.js.map +1 -1
- package/dist/esm/v2/components/Toast.js +109 -163
- package/dist/esm/v2/components/Toast.js.map +1 -1
- package/dist/esm/v2/components/Tooltip.js +18 -31
- package/dist/esm/v2/components/Tooltip.js.map +1 -1
- package/dist/esm/v2/components/_ErrorPageBody.js +6 -5
- package/dist/esm/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/esm/v2/components/_pickerShared.js +2 -2
- package/dist/esm/v2/components/_pickerShared.js.map +1 -1
- package/dist/esm/v2/components/index.js +64 -0
- package/dist/esm/v2/components/index.js.map +1 -1
- package/dist/esm/v2/hooks/index.js +62 -0
- package/dist/esm/v2/hooks/index.js.map +1 -1
- package/dist/esm/v2/hooks/useAppliedFilters.js +112 -0
- package/dist/esm/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js +82 -0
- package/dist/esm/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/esm/v2/hooks/useDelayedFlag.js +5 -19
- package/dist/esm/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/esm/v2/hooks/useDensity.js +13 -17
- package/dist/esm/v2/hooks/useDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusFirstError.js +25 -33
- package/dist/esm/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js +81 -0
- package/dist/esm/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/esm/v2/hooks/useFocusTrap.js +19 -23
- package/dist/esm/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/esm/v2/hooks/useFormAutoSave.js +38 -53
- package/dist/esm/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/esm/v2/hooks/useFormCompletionProgress.js +32 -51
- package/dist/esm/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js +125 -0
- package/dist/esm/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js +99 -0
- package/dist/esm/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/esm/v2/hooks/useResolvedDensity.js +2 -10
- package/dist/esm/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/esm/v2/hooks/useSortedRows.js +3 -5
- package/dist/esm/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/esm/v2/hooks/useTabLoading.js +6 -21
- package/dist/esm/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/esm/v2/index.js +14 -4
- package/dist/esm/v2/index.js.map +1 -1
- package/dist/esm/v2/modalContext.js +2 -2
- package/dist/esm/v2/modalContext.js.map +1 -1
- package/dist/esm/v2/models/favorite.js.map +1 -1
- package/dist/esm/v2/models/personalization.js.map +1 -1
- package/dist/esm/v2/models/referentiel.js.map +1 -1
- package/dist/esm/v2/models/savedFilter.js.map +1 -1
- package/dist/esm/v2/patterns/ActionBar.js +115 -159
- package/dist/esm/v2/patterns/ActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/AppMain.js +108 -0
- package/dist/esm/v2/patterns/AppMain.js.map +1 -0
- package/dist/esm/v2/patterns/BulkActionBar.js +31 -34
- package/dist/esm/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/esm/v2/patterns/ChartFigure.js +151 -0
- package/dist/esm/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js +111 -152
- package/dist/esm/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/ColumnsToggle.js +43 -77
- package/dist/esm/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/esm/v2/patterns/DataGrid.js +221 -255
- package/dist/esm/v2/patterns/DataGrid.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js +76 -94
- package/dist/esm/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridToolbar.js +85 -89
- package/dist/esm/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/esm/v2/patterns/DataGridVirtualized.js +141 -182
- package/dist/esm/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js +26 -30
- package/dist/esm/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/esm/v2/patterns/DetailSplit.js +108 -0
- package/dist/esm/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/esm/v2/patterns/FavoriteColumn.js +26 -75
- package/dist/esm/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/esm/v2/patterns/FavoritesFilter.js +30 -39
- package/dist/esm/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/esm/v2/patterns/FilterTabBar.js +112 -0
- package/dist/esm/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/esm/v2/patterns/FormErrorSummary.js +12 -13
- package/dist/esm/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/esm/v2/patterns/FormPageShell.js +43 -41
- package/dist/esm/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/FormSection.js +30 -38
- package/dist/esm/v2/patterns/FormSection.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCheckbox.js +130 -0
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -0
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js +56 -60
- package/dist/esm/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/esm/v2/patterns/FormikCombobox.js +51 -66
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +51 -99
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +136 -0
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -0
- package/dist/esm/v2/patterns/FormikErrorFocus.js +22 -23
- package/dist/esm/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/esm/v2/patterns/FormikErrorSummary.js +89 -0
- package/dist/esm/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/esm/v2/patterns/FormikFile.js +94 -78
- package/dist/esm/v2/patterns/FormikFile.js.map +1 -1
- package/dist/esm/v2/patterns/FormikInput.js +40 -50
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +129 -0
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -0
- package/dist/esm/v2/patterns/FormikReferentielField.js +49 -59
- package/dist/esm/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/FormikSelect.js +64 -84
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -43
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +64 -65
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/esm/v2/patterns/NetworkErrorBanner.js +6 -7
- package/dist/esm/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/esm/v2/patterns/PageContent.js +10 -14
- package/dist/esm/v2/patterns/PageContent.js.map +1 -1
- package/dist/esm/v2/patterns/PreviewDrawer.js +153 -0
- package/dist/esm/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/esm/v2/patterns/ReferentielField.js +327 -312
- package/dist/esm/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/esm/v2/patterns/RowFavoriteToggle.js +127 -0
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -0
- package/dist/esm/v2/patterns/SaveFilterDialog.js +38 -66
- package/dist/esm/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/esm/v2/patterns/SavedFiltersMenu.js +62 -81
- package/dist/esm/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/esm/v2/patterns/SkeletonPageShell.js +106 -129
- package/dist/esm/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/esm/v2/patterns/SortableHeader.js +22 -45
- package/dist/esm/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/esm/v2/patterns/Tour.js +94 -120
- package/dist/esm/v2/patterns/Tour.js.map +1 -1
- package/dist/esm/v2/patterns/_dataGridShared.js +107 -128
- package/dist/esm/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/esm/v2/patterns/_pickerSerialisation.js +72 -0
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -0
- package/dist/esm/v2/patterns/_sort.js +17 -33
- package/dist/esm/v2/patterns/_sort.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnReorder.js +122 -160
- package/dist/esm/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/esm/v2/patterns/_useColumnResize.js +78 -96
- package/dist/esm/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/esm/v2/patterns/filterCriteria.js +102 -0
- package/dist/esm/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/esm/v2/patterns/index.js +235 -0
- package/dist/esm/v2/patterns/index.js.map +1 -1
- package/dist/esm/v2/patterns/rowActions.js +223 -0
- package/dist/esm/v2/patterns/rowActions.js.map +1 -0
- package/dist/esm/v2/personalization/PersonalizationProvider.js +50 -47
- package/dist/esm/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/esm/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js +22 -23
- package/dist/esm/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js +13 -13
- package/dist/esm/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favorites.js +36 -60
- package/dist/esm/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/favoritesView.js +22 -34
- package/dist/esm/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js +203 -0
- package/dist/esm/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/index.js +5 -0
- package/dist/esm/v2/personalization/capabilities/index.js.map +1 -1
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js +119 -0
- package/dist/esm/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/esm/v2/personalization/capabilities/savedFilters.js +90 -98
- package/dist/esm/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/esm/v2/personalization/createPersonalizationStore.js +78 -181
- package/dist/esm/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/esm/v2/personalization/index.js +35 -0
- package/dist/esm/v2/personalization/index.js.map +1 -1
- package/dist/esm/v2/personalization/personalizationContext.js +9 -9
- package/dist/esm/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/esm/v2/personalization/schema.js +8 -9
- package/dist/esm/v2/personalization/schema.js.map +1 -1
- package/dist/esm/v2/referentiel/ReferentielProvider.js +27 -42
- package/dist/esm/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/esm/v2/referentiel/types.js +2 -0
- package/dist/esm/v2/referentiel/types.js.map +1 -0
- package/dist/esm/v2/referentiel/useReferentielClient.js +10 -11
- package/dist/esm/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielOptions.js +60 -117
- package/dist/esm/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/esm/v2/referentiel/useReferentielSearch.js +37 -91
- package/dist/esm/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/esm/v2/theme/_brand.js +8 -24
- package/dist/esm/v2/theme/_brand.js.map +1 -1
- package/dist/esm/v2/theme/_brandSecondary.js +8 -24
- package/dist/esm/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/esm/v2/theme/createPortnetTheme.js +51 -61
- package/dist/esm/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/esm/v2/theme/cssVariables.js +62 -69
- package/dist/esm/v2/theme/cssVariables.js.map +1 -1
- package/dist/esm/v2/theme/index.js +5 -5
- package/dist/esm/v2/theme/index.js.map +1 -1
- package/dist/esm/v2/tokens/breakpoints.js +14 -14
- package/dist/esm/v2/tokens/breakpoints.js.map +1 -1
- package/dist/esm/v2/tokens/chart.js +261 -0
- package/dist/esm/v2/tokens/chart.js.map +1 -0
- package/dist/esm/v2/tokens/colors.js +22 -22
- package/dist/esm/v2/tokens/colors.js.map +1 -1
- package/dist/esm/v2/tokens/density.js +62 -7
- package/dist/esm/v2/tokens/density.js.map +1 -1
- package/dist/esm/v2/tokens/index.js +49 -34
- package/dist/esm/v2/tokens/index.js.map +1 -1
- package/dist/esm/v2/tokens/motion.js +12 -20
- package/dist/esm/v2/tokens/motion.js.map +1 -1
- package/dist/esm/v2/tokens/radius.js +1 -1
- package/dist/esm/v2/tokens/radius.js.map +1 -1
- package/dist/esm/v2/tokens/shadows.js +6 -6
- package/dist/esm/v2/tokens/shadows.js.map +1 -1
- package/dist/esm/v2/tokens/spacing.js +2 -2
- package/dist/esm/v2/tokens/spacing.js.map +1 -1
- package/dist/esm/v2/tokens/state.js +1 -1
- package/dist/esm/v2/tokens/state.js.map +1 -1
- package/dist/esm/v2/tokens/statusPalette.js +17 -21
- package/dist/esm/v2/tokens/statusPalette.js.map +1 -1
- package/dist/esm/v2/tokens/tokens.json +6 -1
- package/dist/esm/v2/tokens/typography.js +13 -13
- package/dist/esm/v2/tokens/typography.js.map +1 -1
- package/dist/esm/v2/tokens/zIndex.js +1 -1
- package/dist/esm/v2/tokens/zIndex.js.map +1 -1
- package/dist/esm/v2/types/datagrid.js.map +1 -1
- package/dist/esm/v2/utils/apiError.js +16 -37
- package/dist/esm/v2/utils/apiError.js.map +1 -1
- package/dist/esm/v2/utils/contrast.js +31 -32
- package/dist/esm/v2/utils/contrast.js.map +1 -1
- package/dist/esm/v2/utils/cx.js +5 -25
- package/dist/esm/v2/utils/cx.js.map +1 -1
- package/dist/esm/v2/utils/fileDownload.js +23 -26
- package/dist/esm/v2/utils/fileDownload.js.map +1 -1
- package/dist/esm/v2/utils/fileValidation.js +209 -0
- package/dist/esm/v2/utils/fileValidation.js.map +1 -0
- package/dist/esm/v2/utils/fmtDate.js +111 -0
- package/dist/esm/v2/utils/fmtDate.js.map +1 -0
- package/dist/esm/v2/utils/fmtMoney.js +8 -10
- package/dist/esm/v2/utils/fmtMoney.js.map +1 -1
- package/dist/esm/v2/utils/formikErrors.js +78 -0
- package/dist/esm/v2/utils/formikErrors.js.map +1 -0
- package/dist/esm/v2/utils/index.js +35 -2
- package/dist/esm/v2/utils/index.js.map +1 -1
- package/dist/esm/v2/utils/mergeLabels.js +7 -12
- package/dist/esm/v2/utils/mergeLabels.js.map +1 -1
- package/dist/esm/v2/utils/networkStatus.js +12 -12
- package/dist/esm/v2/utils/networkStatus.js.map +1 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +122 -47
- package/dist/index.js.map +1 -1
- package/dist/v2/__tests__/AppMain.test.js +133 -0
- package/dist/v2/__tests__/AppMain.test.js.map +1 -0
- package/dist/v2/__tests__/ChartFigure.test.js +183 -0
- package/dist/v2/__tests__/ChartFigure.test.js.map +1 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js +153 -0
- package/dist/v2/__tests__/DataGridRowActionsPropagation.test.js.map +1 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js +94 -0
- package/dist/v2/__tests__/DrawerTactileTargets.test.js.map +1 -0
- package/dist/v2/__tests__/FieldError.test.js +98 -69
- package/dist/v2/__tests__/FieldError.test.js.map +1 -1
- package/dist/v2/__tests__/FieldNaming.test.js +161 -0
- package/dist/v2/__tests__/FieldNaming.test.js.map +1 -0
- package/dist/v2/__tests__/FieldWidth.test.js +148 -0
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FileCard.test.js +45 -48
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +175 -0
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +237 -0
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js +102 -0
- package/dist/v2/__tests__/FormikDisplayWidth.test.js.map +1 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js +300 -0
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -0
- package/dist/v2/__tests__/MobileRowCard.test.js +100 -102
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -1
- package/dist/v2/__tests__/PreviewDrawer.test.js +169 -0
- package/dist/v2/__tests__/PreviewDrawer.test.js.map +1 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js +159 -0
- package/dist/v2/__tests__/ReferentielFieldContainer.test.js.map +1 -0
- package/dist/v2/__tests__/SectionErrorBoundary.test.js +53 -68
- package/dist/v2/__tests__/SectionErrorBoundary.test.js.map +1 -1
- package/dist/v2/__tests__/apiError.test.js +50 -69
- package/dist/v2/__tests__/apiError.test.js.map +1 -1
- package/dist/v2/__tests__/banned-patterns.test.js +42 -123
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -1
- package/dist/v2/__tests__/chart-palette.test.js +205 -0
- package/dist/v2/__tests__/chart-palette.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +42 -74
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -1
- package/dist/v2/__tests__/cssVariables.test.js +44 -51
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -1
- package/dist/v2/__tests__/fileValidation.test.js +136 -0
- package/dist/v2/__tests__/fileValidation.test.js.map +1 -0
- package/dist/v2/__tests__/filterCriteria.test.js +324 -0
- package/dist/v2/__tests__/filterCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/fmtDate.test.js +69 -0
- package/dist/v2/__tests__/fmtDate.test.js.map +1 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js +221 -0
- package/dist/v2/__tests__/gap-leakage-refonte.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +38 -46
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -1
- package/dist/v2/__tests__/locale-fallback.test.js +47 -52
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -1
- package/dist/v2/__tests__/reviveSavedCriteria.test.js +144 -0
- package/dist/v2/__tests__/reviveSavedCriteria.test.js.map +1 -0
- package/dist/v2/__tests__/rowActions.test.js +186 -0
- package/dist/v2/__tests__/rowActions.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js +156 -0
- package/dist/v2/__tests__/useFocusOnRouteChange.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +270 -407
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -1
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js +123 -0
- package/dist/v2/__tests__/usePrefersReducedMotion.test.js.map +1 -0
- package/dist/v2/components/Accordion.js +60 -82
- package/dist/v2/components/Accordion.js.map +1 -1
- package/dist/v2/components/ActionStrip.js +40 -52
- package/dist/v2/components/ActionStrip.js.map +1 -1
- package/dist/v2/components/Banner.js +42 -41
- package/dist/v2/components/Banner.js.map +1 -1
- package/dist/v2/components/Busy.js +22 -27
- package/dist/v2/components/Busy.js.map +1 -1
- package/dist/v2/components/Button.js +39 -50
- package/dist/v2/components/Button.js.map +1 -1
- package/dist/v2/components/CategoryTag.d.ts.map +1 -1
- package/dist/v2/components/CategoryTag.js +49 -32
- package/dist/v2/components/CategoryTag.js.map +1 -1
- package/dist/v2/components/Checkbox.js +39 -45
- package/dist/v2/components/Checkbox.js.map +1 -1
- package/dist/v2/components/Chip.js +29 -42
- package/dist/v2/components/Chip.js.map +1 -1
- package/dist/v2/components/Combobox.js +122 -144
- package/dist/v2/components/Combobox.js.map +1 -1
- package/dist/v2/components/CommandPalette.js +138 -225
- package/dist/v2/components/CommandPalette.js.map +1 -1
- package/dist/v2/components/ConfirmDialog.js +46 -56
- package/dist/v2/components/ConfirmDialog.js.map +1 -1
- package/dist/v2/components/DatePicker.js +81 -86
- package/dist/v2/components/DatePicker.js.map +1 -1
- package/dist/v2/components/DateRangePicker.js +77 -87
- package/dist/v2/components/DateRangePicker.js.map +1 -1
- package/dist/v2/components/DateTimePicker.d.ts.map +1 -1
- package/dist/v2/components/DateTimePicker.js +121 -95
- package/dist/v2/components/DateTimePicker.js.map +1 -1
- package/dist/v2/components/Drawer.d.ts.map +1 -1
- package/dist/v2/components/Drawer.js +93 -88
- package/dist/v2/components/Drawer.js.map +1 -1
- package/dist/v2/components/Dropzone.js +150 -196
- package/dist/v2/components/Dropzone.js.map +1 -1
- package/dist/v2/components/EmptyState.js +18 -20
- package/dist/v2/components/EmptyState.js.map +1 -1
- package/dist/v2/components/FavoriteToggle.js +28 -39
- package/dist/v2/components/FavoriteToggle.js.map +1 -1
- package/dist/v2/components/Field.d.ts +121 -5
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +221 -62
- package/dist/v2/components/Field.js.map +1 -1
- package/dist/v2/components/FieldError.js +18 -21
- package/dist/v2/components/FieldError.js.map +1 -1
- package/dist/v2/components/FieldHelp.js +40 -60
- package/dist/v2/components/FieldHelp.js.map +1 -1
- package/dist/v2/components/FileCard.js +27 -31
- package/dist/v2/components/FileCard.js.map +1 -1
- package/dist/v2/components/FilterTab.js +30 -38
- package/dist/v2/components/FilterTab.js.map +1 -1
- package/dist/v2/components/ForbiddenPage.d.ts +25 -1
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -1
- package/dist/v2/components/ForbiddenPage.js +37 -17
- package/dist/v2/components/ForbiddenPage.js.map +1 -1
- package/dist/v2/components/FormGrid.js +53 -59
- package/dist/v2/components/FormGrid.js.map +1 -1
- package/dist/v2/components/FormikDisplay.d.ts +50 -1
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -1
- package/dist/v2/components/FormikDisplay.js +108 -33
- package/dist/v2/components/FormikDisplay.js.map +1 -1
- package/dist/v2/components/Input.d.ts +40 -0
- package/dist/v2/components/Input.d.ts.map +1 -1
- package/dist/v2/components/Input.js +81 -41
- package/dist/v2/components/Input.js.map +1 -1
- package/dist/v2/components/KPICard.js +57 -67
- package/dist/v2/components/KPICard.js.map +1 -1
- package/dist/v2/components/KPIStrip.js +16 -22
- package/dist/v2/components/KPIStrip.js.map +1 -1
- package/dist/v2/components/KV.js +25 -31
- package/dist/v2/components/KV.js.map +1 -1
- package/dist/v2/components/KVGrid.js +19 -26
- package/dist/v2/components/KVGrid.js.map +1 -1
- package/dist/v2/components/Layout.js +91 -120
- package/dist/v2/components/Layout.js.map +1 -1
- package/dist/v2/components/MobileRowCard.js +79 -91
- package/dist/v2/components/MobileRowCard.js.map +1 -1
- package/dist/v2/components/Modal.js +61 -69
- package/dist/v2/components/Modal.js.map +1 -1
- package/dist/v2/components/NetworkErrorPage.d.ts +19 -1
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -1
- package/dist/v2/components/NetworkErrorPage.js +38 -21
- package/dist/v2/components/NetworkErrorPage.js.map +1 -1
- package/dist/v2/components/NotFoundPage.d.ts +17 -1
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -1
- package/dist/v2/components/NotFoundPage.js +37 -18
- package/dist/v2/components/NotFoundPage.js.map +1 -1
- package/dist/v2/components/NumberInput.js +88 -118
- package/dist/v2/components/NumberInput.js.map +1 -1
- package/dist/v2/components/OverflowMenu.js +38 -56
- package/dist/v2/components/OverflowMenu.js.map +1 -1
- package/dist/v2/components/PdfViewer.js +34 -45
- package/dist/v2/components/PdfViewer.js.map +1 -1
- package/dist/v2/components/ProgressBar.js +42 -49
- package/dist/v2/components/ProgressBar.js.map +1 -1
- package/dist/v2/components/Radio.js +59 -67
- package/dist/v2/components/Radio.js.map +1 -1
- package/dist/v2/components/SectionErrorBoundary.js +90 -135
- package/dist/v2/components/SectionErrorBoundary.js.map +1 -1
- package/dist/v2/components/SectionHeader.js +34 -41
- package/dist/v2/components/SectionHeader.js.map +1 -1
- package/dist/v2/components/Segmented.js +69 -93
- package/dist/v2/components/Segmented.js.map +1 -1
- package/dist/v2/components/Select.d.ts +26 -2
- package/dist/v2/components/Select.d.ts.map +1 -1
- package/dist/v2/components/Select.js +120 -155
- package/dist/v2/components/Select.js.map +1 -1
- package/dist/v2/components/ServerErrorPage.d.ts +27 -1
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -1
- package/dist/v2/components/ServerErrorPage.js +37 -20
- package/dist/v2/components/ServerErrorPage.js.map +1 -1
- package/dist/v2/components/Skeleton.js +86 -100
- package/dist/v2/components/Skeleton.js.map +1 -1
- package/dist/v2/components/SkipLink.js +9 -12
- package/dist/v2/components/SkipLink.js.map +1 -1
- package/dist/v2/components/Spinner.js +16 -25
- package/dist/v2/components/Spinner.js.map +1 -1
- package/dist/v2/components/Status.js +18 -29
- package/dist/v2/components/Status.js.map +1 -1
- package/dist/v2/components/Stepper.js +80 -82
- package/dist/v2/components/Stepper.js.map +1 -1
- package/dist/v2/components/Surface.js +34 -49
- package/dist/v2/components/Surface.js.map +1 -1
- package/dist/v2/components/Switch.js +29 -37
- package/dist/v2/components/Switch.js.map +1 -1
- package/dist/v2/components/TabPanel.d.ts +17 -0
- package/dist/v2/components/TabPanel.d.ts.map +1 -0
- package/dist/v2/components/TabPanel.js +90 -0
- package/dist/v2/components/TabPanel.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +25 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -1
- package/dist/v2/components/Tabs.js +53 -29
- package/dist/v2/components/Tabs.js.map +1 -1
- package/dist/v2/components/TelInput.js +80 -115
- package/dist/v2/components/TelInput.js.map +1 -1
- package/dist/v2/components/Textarea.js +26 -35
- package/dist/v2/components/Textarea.js.map +1 -1
- package/dist/v2/components/TimePicker.js +62 -74
- package/dist/v2/components/TimePicker.js.map +1 -1
- package/dist/v2/components/Toast.js +119 -174
- package/dist/v2/components/Toast.js.map +1 -1
- package/dist/v2/components/Tooltip.js +23 -38
- package/dist/v2/components/Tooltip.js.map +1 -1
- package/dist/v2/components/_ErrorPageBody.js +15 -16
- package/dist/v2/components/_ErrorPageBody.js.map +1 -1
- package/dist/v2/components/_pickerShared.js +5 -5
- package/dist/v2/components/_pickerShared.js.map +1 -1
- package/dist/v2/components/index.d.ts +67 -1
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/components/index.js +153 -136
- package/dist/v2/components/index.js.map +1 -1
- package/dist/v2/hooks/index.d.ts +65 -0
- package/dist/v2/hooks/index.d.ts.map +1 -1
- package/dist/v2/hooks/index.js +63 -24
- package/dist/v2/hooks/index.js.map +1 -1
- package/dist/v2/hooks/useAppliedFilters.d.ts +102 -0
- package/dist/v2/hooks/useAppliedFilters.d.ts.map +1 -0
- package/dist/v2/hooks/useAppliedFilters.js +117 -0
- package/dist/v2/hooks/useAppliedFilters.js.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts +64 -0
- package/dist/v2/hooks/useDebouncedCallback.d.ts.map +1 -0
- package/dist/v2/hooks/useDebouncedCallback.js +87 -0
- package/dist/v2/hooks/useDebouncedCallback.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +6 -20
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -1
- package/dist/v2/hooks/useDensity.d.ts.map +1 -1
- package/dist/v2/hooks/useDensity.js +14 -18
- package/dist/v2/hooks/useDensity.js.map +1 -1
- package/dist/v2/hooks/useFocusFirstError.js +26 -34
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -1
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts +65 -0
- package/dist/v2/hooks/useFocusOnRouteChange.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js +88 -0
- package/dist/v2/hooks/useFocusOnRouteChange.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +20 -24
- package/dist/v2/hooks/useFocusTrap.js.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.d.ts +4 -4
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -1
- package/dist/v2/hooks/useFormAutoSave.js +39 -54
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -1
- package/dist/v2/hooks/useFormCompletionProgress.js +33 -52
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -1
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts +25 -0
- package/dist/v2/hooks/useKeyboardShortcuts.d.ts.map +1 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js +132 -0
- package/dist/v2/hooks/useKeyboardShortcuts.js.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts +56 -0
- package/dist/v2/hooks/usePrefersReducedMotion.d.ts.map +1 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js +105 -0
- package/dist/v2/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +5 -13
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -1
- package/dist/v2/hooks/useSortedRows.js +4 -6
- package/dist/v2/hooks/useSortedRows.js.map +1 -1
- package/dist/v2/hooks/useTabLoading.js +7 -22
- package/dist/v2/hooks/useTabLoading.js.map +1 -1
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/index.js +143 -145
- package/dist/v2/index.js.map +1 -1
- package/dist/v2/modalContext.js +2 -2
- package/dist/v2/modalContext.js.map +1 -1
- package/dist/v2/models/favorite.d.ts +8 -9
- package/dist/v2/models/favorite.d.ts.map +1 -1
- package/dist/v2/models/favorite.js.map +1 -1
- package/dist/v2/models/index.js +4 -4
- package/dist/v2/models/index.js.map +1 -1
- package/dist/v2/models/personalization.d.ts +44 -48
- package/dist/v2/models/personalization.d.ts.map +1 -1
- package/dist/v2/models/personalization.js.map +1 -1
- package/dist/v2/models/referentiel.d.ts +32 -50
- package/dist/v2/models/referentiel.d.ts.map +1 -1
- package/dist/v2/models/referentiel.js.map +1 -1
- package/dist/v2/models/savedFilter.d.ts +8 -17
- package/dist/v2/models/savedFilter.d.ts.map +1 -1
- package/dist/v2/models/savedFilter.js.map +1 -1
- package/dist/v2/patterns/ActionBar.js +152 -187
- package/dist/v2/patterns/ActionBar.js.map +1 -1
- package/dist/v2/patterns/AppMain.d.ts +109 -0
- package/dist/v2/patterns/AppMain.d.ts.map +1 -0
- package/dist/v2/patterns/AppMain.js +115 -0
- package/dist/v2/patterns/AppMain.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +40 -42
- package/dist/v2/patterns/BulkActionBar.js.map +1 -1
- package/dist/v2/patterns/ChartFigure.d.ts +124 -0
- package/dist/v2/patterns/ChartFigure.d.ts.map +1 -0
- package/dist/v2/patterns/ChartFigure.js +159 -0
- package/dist/v2/patterns/ChartFigure.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +138 -174
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -1
- package/dist/v2/patterns/ColumnsToggle.js +60 -94
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -1
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -1
- package/dist/v2/patterns/DataGrid.js +262 -297
- package/dist/v2/patterns/DataGrid.js.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +12 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -1
- package/dist/v2/patterns/DataGridSettingsMenu.js +104 -121
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -1
- package/dist/v2/patterns/DataGridToolbar.js +103 -106
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -1
- package/dist/v2/patterns/DataGridVirtualized.js +179 -217
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -1
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +32 -35
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -1
- package/dist/v2/patterns/DetailSplit.d.ts +87 -0
- package/dist/v2/patterns/DetailSplit.d.ts.map +1 -0
- package/dist/v2/patterns/DetailSplit.js +116 -0
- package/dist/v2/patterns/DetailSplit.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts +9 -9
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -1
- package/dist/v2/patterns/FavoriteColumn.js +32 -80
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -1
- package/dist/v2/patterns/FavoritesFilter.js +36 -44
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -1
- package/dist/v2/patterns/FilterTabBar.d.ts +28 -0
- package/dist/v2/patterns/FilterTabBar.d.ts.map +1 -0
- package/dist/v2/patterns/FilterTabBar.js +120 -0
- package/dist/v2/patterns/FilterTabBar.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +20 -23
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -1
- package/dist/v2/patterns/FormPageShell.js +53 -50
- package/dist/v2/patterns/FormPageShell.js.map +1 -1
- package/dist/v2/patterns/FormSection.d.ts +8 -3
- package/dist/v2/patterns/FormSection.d.ts.map +1 -1
- package/dist/v2/patterns/FormSection.js +44 -51
- package/dist/v2/patterns/FormSection.js.map +1 -1
- package/dist/v2/patterns/FormikCheckbox.d.ts +77 -0
- package/dist/v2/patterns/FormikCheckbox.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCheckbox.js +138 -0
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +17 -1
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCheckboxGroup.js +62 -65
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -1
- package/dist/v2/patterns/FormikCombobox.d.ts +7 -1
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -1
- package/dist/v2/patterns/FormikCombobox.js +55 -69
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts +13 -1
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +59 -106
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.d.ts +111 -0
- package/dist/v2/patterns/FormikDateTimePicker.d.ts.map +1 -0
- package/dist/v2/patterns/FormikDateTimePicker.js +144 -0
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.js +25 -26
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -1
- package/dist/v2/patterns/FormikErrorSummary.d.ts +74 -0
- package/dist/v2/patterns/FormikErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorSummary.js +97 -0
- package/dist/v2/patterns/FormikErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +14 -1
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -1
- package/dist/v2/patterns/FormikFile.js +99 -83
- package/dist/v2/patterns/FormikFile.js.map +1 -1
- package/dist/v2/patterns/FormikInput.d.ts +11 -1
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -1
- package/dist/v2/patterns/FormikInput.js +45 -55
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.d.ts +80 -0
- package/dist/v2/patterns/FormikRadioGroup.d.ts.map +1 -0
- package/dist/v2/patterns/FormikRadioGroup.js +137 -0
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts +12 -1
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/FormikReferentielField.js +54 -64
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -1
- package/dist/v2/patterns/FormikSelect.d.ts +9 -1
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -1
- package/dist/v2/patterns/FormikSelect.js +70 -89
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.d.ts +9 -1
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -48
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +14 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +71 -74
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -1
- package/dist/v2/patterns/NetworkErrorBanner.js +13 -16
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -1
- package/dist/v2/patterns/PageContent.js +17 -20
- package/dist/v2/patterns/PageContent.js.map +1 -1
- package/dist/v2/patterns/PreviewDrawer.d.ts +49 -0
- package/dist/v2/patterns/PreviewDrawer.d.ts.map +1 -0
- package/dist/v2/patterns/PreviewDrawer.js +159 -0
- package/dist/v2/patterns/PreviewDrawer.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +86 -2
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -1
- package/dist/v2/patterns/ReferentielField.js +347 -327
- package/dist/v2/patterns/ReferentielField.js.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.d.ts +98 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -0
- package/dist/v2/patterns/RowFavoriteToggle.js +135 -0
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.js +50 -77
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -1
- package/dist/v2/patterns/SavedFiltersMenu.js +89 -107
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -1
- package/dist/v2/patterns/SkeletonPageShell.js +122 -143
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -1
- package/dist/v2/patterns/SortableHeader.js +35 -57
- package/dist/v2/patterns/SortableHeader.js.map +1 -1
- package/dist/v2/patterns/Tour.js +121 -142
- package/dist/v2/patterns/Tour.js.map +1 -1
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -1
- package/dist/v2/patterns/_dataGridShared.js +131 -147
- package/dist/v2/patterns/_dataGridShared.js.map +1 -1
- package/dist/v2/patterns/_pickerSerialisation.d.ts +44 -0
- package/dist/v2/patterns/_pickerSerialisation.d.ts.map +1 -0
- package/dist/v2/patterns/_pickerSerialisation.js +80 -0
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -0
- package/dist/v2/patterns/_sort.js +17 -33
- package/dist/v2/patterns/_sort.js.map +1 -1
- package/dist/v2/patterns/_useColumnReorder.js +124 -163
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -1
- package/dist/v2/patterns/_useColumnResize.js +80 -99
- package/dist/v2/patterns/_useColumnResize.js.map +1 -1
- package/dist/v2/patterns/filterCriteria.d.ts +78 -0
- package/dist/v2/patterns/filterCriteria.d.ts.map +1 -0
- package/dist/v2/patterns/filterCriteria.js +110 -0
- package/dist/v2/patterns/filterCriteria.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +247 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +182 -70
- package/dist/v2/patterns/index.js.map +1 -1
- package/dist/v2/patterns/rowActions.d.ts +150 -0
- package/dist/v2/patterns/rowActions.d.ts.map +1 -0
- package/dist/v2/patterns/rowActions.js +232 -0
- package/dist/v2/patterns/rowActions.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -1
- package/dist/v2/personalization/PersonalizationProvider.js +57 -53
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -1
- package/dist/v2/personalization/adapters/_storageKey.js +5 -5
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -1
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +25 -24
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +14 -14
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -1
- package/dist/v2/personalization/adapters/index.js +5 -5
- package/dist/v2/personalization/adapters/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/favorites.js +39 -62
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -1
- package/dist/v2/personalization/capabilities/favoritesView.js +25 -37
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -1
- package/dist/v2/personalization/capabilities/gridPreferences.d.ts +100 -0
- package/dist/v2/personalization/capabilities/gridPreferences.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js +210 -0
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -0
- package/dist/v2/personalization/capabilities/index.d.ts +6 -0
- package/dist/v2/personalization/capabilities/index.d.ts.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +23 -10
- package/dist/v2/personalization/capabilities/index.js.map +1 -1
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts +88 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js +126 -0
- package/dist/v2/personalization/capabilities/reviveSavedCriteria.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +93 -100
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -1
- package/dist/v2/personalization/createPersonalizationStore.js +81 -182
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -1
- package/dist/v2/personalization/index.d.ts +34 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +41 -21
- package/dist/v2/personalization/index.js.map +1 -1
- package/dist/v2/personalization/personalizationContext.js +10 -12
- package/dist/v2/personalization/personalizationContext.js.map +1 -1
- package/dist/v2/personalization/schema.js +8 -9
- package/dist/v2/personalization/schema.js.map +1 -1
- package/dist/v2/referentiel/ReferentielProvider.js +31 -45
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -1
- package/dist/v2/referentiel/index.js +11 -13
- package/dist/v2/referentiel/index.js.map +1 -1
- package/dist/v2/referentiel/types.d.ts +105 -0
- package/dist/v2/referentiel/types.d.ts.map +1 -0
- package/dist/v2/referentiel/types.js +6 -0
- package/dist/v2/referentiel/types.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +13 -16
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.d.ts +7 -17
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielOptions.js +63 -120
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.d.ts +7 -48
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -1
- package/dist/v2/referentiel/useReferentielSearch.js +40 -95
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -1
- package/dist/v2/theme/_brand.js +12 -26
- package/dist/v2/theme/_brand.js.map +1 -1
- package/dist/v2/theme/_brandSecondary.js +12 -26
- package/dist/v2/theme/_brandSecondary.js.map +1 -1
- package/dist/v2/theme/createPortnetTheme.js +41 -49
- package/dist/v2/theme/createPortnetTheme.js.map +1 -1
- package/dist/v2/theme/cssVariables.d.ts +3 -3
- package/dist/v2/theme/cssVariables.d.ts.map +1 -1
- package/dist/v2/theme/cssVariables.js +65 -70
- package/dist/v2/theme/cssVariables.js.map +1 -1
- package/dist/v2/theme/index.js +10 -10
- package/dist/v2/theme/index.js.map +1 -1
- package/dist/v2/tokens/breakpoints.js +16 -16
- package/dist/v2/tokens/breakpoints.js.map +1 -1
- package/dist/v2/tokens/chart.d.ts +103 -0
- package/dist/v2/tokens/chart.d.ts.map +1 -0
- package/dist/v2/tokens/chart.js +270 -0
- package/dist/v2/tokens/chart.js.map +1 -0
- package/dist/v2/tokens/colors.js +24 -24
- package/dist/v2/tokens/colors.js.map +1 -1
- package/dist/v2/tokens/density.d.ts +104 -0
- package/dist/v2/tokens/density.d.ts.map +1 -1
- package/dist/v2/tokens/density.js +67 -12
- package/dist/v2/tokens/density.js.map +1 -1
- package/dist/v2/tokens/index.d.ts +50 -1
- package/dist/v2/tokens/index.d.ts.map +1 -1
- package/dist/v2/tokens/index.js +116 -68
- package/dist/v2/tokens/index.js.map +1 -1
- package/dist/v2/tokens/motion.js +16 -22
- package/dist/v2/tokens/motion.js.map +1 -1
- package/dist/v2/tokens/radius.js +3 -3
- package/dist/v2/tokens/radius.js.map +1 -1
- package/dist/v2/tokens/shadows.js +8 -8
- package/dist/v2/tokens/shadows.js.map +1 -1
- package/dist/v2/tokens/spacing.js +4 -4
- package/dist/v2/tokens/spacing.js.map +1 -1
- package/dist/v2/tokens/state.js +3 -3
- package/dist/v2/tokens/state.js.map +1 -1
- package/dist/v2/tokens/statusPalette.js +21 -23
- package/dist/v2/tokens/statusPalette.js.map +1 -1
- package/dist/v2/tokens/tokens.json +6 -1
- package/dist/v2/tokens/typography.js +15 -15
- package/dist/v2/tokens/typography.js.map +1 -1
- package/dist/v2/tokens/zIndex.js +3 -3
- package/dist/v2/tokens/zIndex.js.map +1 -1
- package/dist/v2/types/datagrid.d.ts +9 -1
- package/dist/v2/types/datagrid.d.ts.map +1 -1
- package/dist/v2/types/datagrid.js.map +1 -1
- package/dist/v2/types/index.js +2 -2
- package/dist/v2/types/index.js.map +1 -1
- package/dist/v2/utils/apiError.js +16 -37
- package/dist/v2/utils/apiError.js.map +1 -1
- package/dist/v2/utils/contrast.js +31 -32
- package/dist/v2/utils/contrast.js.map +1 -1
- package/dist/v2/utils/cx.js +7 -27
- package/dist/v2/utils/cx.js.map +1 -1
- package/dist/v2/utils/fileDownload.js +25 -28
- package/dist/v2/utils/fileDownload.js.map +1 -1
- package/dist/v2/utils/fileValidation.d.ts +116 -0
- package/dist/v2/utils/fileValidation.d.ts.map +1 -0
- package/dist/v2/utils/fileValidation.js +220 -0
- package/dist/v2/utils/fileValidation.js.map +1 -0
- package/dist/v2/utils/fmtDate.d.ts +103 -0
- package/dist/v2/utils/fmtDate.d.ts.map +1 -0
- package/dist/v2/utils/fmtDate.js +119 -0
- package/dist/v2/utils/fmtDate.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +3 -3
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -1
- package/dist/v2/utils/fmtMoney.js +9 -11
- package/dist/v2/utils/fmtMoney.js.map +1 -1
- package/dist/v2/utils/formikErrors.d.ts +67 -0
- package/dist/v2/utils/formikErrors.d.ts.map +1 -0
- package/dist/v2/utils/formikErrors.js +85 -0
- package/dist/v2/utils/formikErrors.js.map +1 -0
- package/dist/v2/utils/index.d.ts +5 -0
- package/dist/v2/utils/index.d.ts.map +1 -1
- package/dist/v2/utils/index.js +67 -18
- package/dist/v2/utils/index.js.map +1 -1
- package/dist/v2/utils/mergeLabels.js +9 -14
- package/dist/v2/utils/mergeLabels.js.map +1 -1
- package/dist/v2/utils/networkStatus.js +14 -14
- package/dist/v2/utils/networkStatus.js.map +1 -1
- package/package.json +26 -9
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import FavoriteToggle from "../components/FavoriteToggle";
|
|
1
|
+
import type { FavoriteToggleSize, RowFavoriteToggleLabels } from "./RowFavoriteToggle";
|
|
3
2
|
import type { DataGridColumn } from "../types/datagrid";
|
|
4
3
|
import type { RowId } from "../types/common";
|
|
5
4
|
/**
|
|
@@ -40,14 +39,16 @@ import type { RowId } from "../types/common";
|
|
|
40
39
|
* `getRowId` MUST match the one passed to <DataGrid> so the follow id and
|
|
41
40
|
* the grid row id agree. Requires a <UserPersonalizationProvider>
|
|
42
41
|
* ancestor (useIsFavorite throws otherwise).
|
|
42
|
+
*
|
|
43
|
+
* The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a
|
|
44
|
+
* private `FavoriteCell` in this file, which made the follow control reachable
|
|
45
|
+
* as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the
|
|
46
|
+
* `MobileRowCard` `leading` slot that DataGrid switches to below its
|
|
47
|
+
* `mobileBreakpoint`, and the copies drifted on their accessible names. Both
|
|
48
|
+
* now render the same component, so desktop and mobile agree by construction.
|
|
43
49
|
*/
|
|
44
|
-
|
|
45
|
-
export interface FavoriteColumnLabels {
|
|
50
|
+
export interface FavoriteColumnLabels extends RowFavoriteToggleLabels {
|
|
46
51
|
columnHeader: string;
|
|
47
|
-
addFavorite: string;
|
|
48
|
-
removeFavorite: string;
|
|
49
|
-
statusFollowed: string;
|
|
50
|
-
statusNotFollowed: string;
|
|
51
52
|
}
|
|
52
53
|
export interface MakeFavoriteColumnOptions<T> {
|
|
53
54
|
/** Required — follow namespace. */
|
|
@@ -68,5 +69,4 @@ export interface MakeFavoriteColumnOptions<T> {
|
|
|
68
69
|
* Builds a v2 DataGrid column definition for the compact follow-star column.
|
|
69
70
|
*/
|
|
70
71
|
export default function makeFavoriteColumn<T>(options: MakeFavoriteColumnOptions<T>): DataGridColumn<T>;
|
|
71
|
-
export {};
|
|
72
72
|
//# sourceMappingURL=FavoriteColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteColumn.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FavoriteColumn.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE,YAAY,EAAE,MAAM,CAAC;CACtB;AAoBD,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,KAAK,CAAC,GAAG,SAAS,CAAC;IAC3C,0CAA0C;IAC1C,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,sDAAsD;IACtD,IAAI,CAAC,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACtC,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACpC,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,MAAM,CAAC,GAAG,SAAS,CAAC;IAC/C,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC;CACpD;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,CAAC,EAC1C,OAAO,EAAE,yBAAyB,CAAC,CAAC,CAAC,GACpC,cAAc,CAAC,CAAC,CAAC,CAkDnB"}
|
|
@@ -3,22 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = makeFavoriteColumn;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
-
var
|
|
10
|
-
var _Tooltip = _interopRequireDefault(require("../components/Tooltip"));
|
|
11
|
-
var _favorites = require("../personalization/capabilities/favorites");
|
|
9
|
+
var _RowFavoriteToggle = _interopRequireWildcard(require("./RowFavoriteToggle"));
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
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); }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
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; }
|
|
20
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
-
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); } /**
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/**
|
|
22
14
|
* FavoriteColumn - Portnet UI v2 (pattern)
|
|
23
15
|
*
|
|
24
16
|
* `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for
|
|
@@ -56,17 +48,22 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
56
48
|
* `getRowId` MUST match the one passed to <DataGrid> so the follow id and
|
|
57
49
|
* the grid row id agree. Requires a <UserPersonalizationProvider>
|
|
58
50
|
* ancestor (useIsFavorite throws otherwise).
|
|
51
|
+
*
|
|
52
|
+
* The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a
|
|
53
|
+
* private `FavoriteCell` in this file, which made the follow control reachable
|
|
54
|
+
* as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the
|
|
55
|
+
* `MobileRowCard` `leading` slot that DataGrid switches to below its
|
|
56
|
+
* `mobileBreakpoint`, and the copies drifted on their accessible names. Both
|
|
57
|
+
* now render the same component, so desktop and mobile agree by construction.
|
|
59
58
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
statusFollowed: "Suivi",
|
|
65
|
-
statusNotFollowed: "Non suivi"
|
|
59
|
+
|
|
60
|
+
const DEFAULT_LABELS = Object.freeze({
|
|
61
|
+
..._RowFavoriteToggle.DEFAULT_ROW_FAVORITE_LABELS,
|
|
62
|
+
columnHeader: "Suivis"
|
|
66
63
|
});
|
|
67
64
|
|
|
68
65
|
/** Visually hidden, but exposed to assistive tech (the column's accessible name). */
|
|
69
|
-
|
|
66
|
+
const SR_ONLY_SX = Object.freeze({
|
|
70
67
|
position: "absolute",
|
|
71
68
|
width: "1px",
|
|
72
69
|
height: "1px",
|
|
@@ -77,72 +74,30 @@ var SR_ONLY_SX = Object.freeze({
|
|
|
77
74
|
whiteSpace: "nowrap",
|
|
78
75
|
border: 0
|
|
79
76
|
});
|
|
80
|
-
function FavoriteCell(props) {
|
|
81
|
-
var resourceKey = props.resourceKey,
|
|
82
|
-
id = props.id,
|
|
83
|
-
size = props.size,
|
|
84
|
-
addLabel = props.addLabel,
|
|
85
|
-
removeLabel = props.removeLabel,
|
|
86
|
-
followedLabel = props.followedLabel,
|
|
87
|
-
notFollowedLabel = props.notFollowedLabel,
|
|
88
|
-
rowLabel = props.rowLabel;
|
|
89
|
-
var _useIsFavorite = (0, _favorites.useIsFavorite)(resourceKey, id),
|
|
90
|
-
isFavorite = _useIsFavorite.isFavorite,
|
|
91
|
-
toggle = _useIsFavorite.toggle;
|
|
92
|
-
|
|
93
|
-
// Action-oriented accessible name (toggle convention); aria-pressed (set
|
|
94
|
-
// by FavoriteToggle) carries the state. Always provided, so the Tooltip
|
|
95
|
-
// never mirrors its title onto the trigger.
|
|
96
|
-
var action = isFavorite ? removeLabel : addLabel;
|
|
97
|
-
var ariaLabel = rowLabel ? action + " : " + rowLabel : action;
|
|
98
|
-
// Visible status shown on hover/focus.
|
|
99
|
-
var statusLabel = isFavorite ? followedLabel : notFollowedLabel;
|
|
100
|
-
var handleChange = function handleChange(_next, e) {
|
|
101
|
-
// Don't let the toggle's click bubble to the row's onRowClick.
|
|
102
|
-
if (e && typeof e.stopPropagation === "function") e.stopPropagation();
|
|
103
|
-
toggle();
|
|
104
|
-
};
|
|
105
|
-
var handleKeyDown = function handleKeyDown(e) {
|
|
106
|
-
// Prevent row-level Enter/Space (onRowClick) from also firing; the
|
|
107
|
-
// button's own native activation is unaffected.
|
|
108
|
-
e.stopPropagation();
|
|
109
|
-
};
|
|
110
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Tooltip["default"], {
|
|
111
|
-
title: statusLabel,
|
|
112
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FavoriteToggle["default"], {
|
|
113
|
-
pressed: isFavorite,
|
|
114
|
-
onChange: handleChange,
|
|
115
|
-
onKeyDown: handleKeyDown,
|
|
116
|
-
size: size,
|
|
117
|
-
labels: {
|
|
118
|
-
addFavorite: addLabel,
|
|
119
|
-
removeFavorite: removeLabel
|
|
120
|
-
},
|
|
121
|
-
"aria-label": ariaLabel
|
|
122
|
-
})
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
77
|
/**
|
|
126
78
|
* Builds a v2 DataGrid column definition for the compact follow-star column.
|
|
127
79
|
*/
|
|
128
80
|
function makeFavoriteColumn(options) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
81
|
+
const opts = options;
|
|
82
|
+
const resourceKey = opts.resourceKey;
|
|
83
|
+
const getRowId = typeof opts.getRowId === "function" ? opts.getRowId : function defaultGetRowId(r) {
|
|
132
84
|
return r.id;
|
|
133
85
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
86
|
+
const key = opts.key || "__favorite__";
|
|
87
|
+
const size = opts.size || "sm";
|
|
88
|
+
const width = opts.width != null ? opts.width : 44;
|
|
89
|
+
const getRowLabel = typeof opts.getRowLabel === "function" ? opts.getRowLabel : null;
|
|
90
|
+
const L = opts.labels ? {
|
|
91
|
+
...DEFAULT_LABELS,
|
|
92
|
+
...opts.labels
|
|
93
|
+
} : DEFAULT_LABELS;
|
|
139
94
|
if (process.env["NODE_ENV"] !== "production" && !resourceKey) {
|
|
140
95
|
// eslint-disable-next-line no-console
|
|
141
96
|
console.warn("[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.");
|
|
142
97
|
}
|
|
143
98
|
return {
|
|
144
99
|
key: key,
|
|
145
|
-
header: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box
|
|
100
|
+
header: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
146
101
|
component: "span",
|
|
147
102
|
sx: SR_ONLY_SX,
|
|
148
103
|
children: L.columnHeader
|
|
@@ -155,14 +110,11 @@ function makeFavoriteColumn(options) {
|
|
|
155
110
|
reorderable: false,
|
|
156
111
|
width: width,
|
|
157
112
|
render: function renderFavorite(row) {
|
|
158
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
113
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_RowFavoriteToggle.default, {
|
|
159
114
|
resourceKey: resourceKey,
|
|
160
|
-
|
|
115
|
+
rowId: getRowId(row),
|
|
161
116
|
size: size,
|
|
162
|
-
|
|
163
|
-
removeLabel: L.removeFavorite,
|
|
164
|
-
followedLabel: L.statusFollowed,
|
|
165
|
-
notFollowedLabel: L.statusNotFollowed,
|
|
117
|
+
labels: L,
|
|
166
118
|
rowLabel: getRowLabel ? getRowLabel(row) : undefined
|
|
167
119
|
});
|
|
168
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoriteColumn.js","names":["React","_interopRequireWildcard","require","_Box","_interopRequireDefault","_FavoriteToggle","_Tooltip","_favorites","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Symbol","iterator","constructor","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","TypeError","Number","DEFAULT_LABELS","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","useIsFavorite","isFavorite","toggle","action","ariaLabel","statusLabel","handleChange","_next","e","stopPropagation","handleKeyDown","jsx","title","children","pressed","onChange","onKeyDown","labels","makeFavoriteColumn","options","opts","getRowId","defaultGetRowId","r","getRowLabel","L","process","env","console","warn","header","component","sx","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row"],"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":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAA0E,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAE,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAA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A,CAAAqG,GAAA,EAAC1G,IAAA,WAAG;MAAC8H,SAAS,EAAC,MAAM;MAACC,EAAE,EAAErD,UAAW;MAAAkC,QAAA,EAClCY,CAAC,CAACnD;IAAY,CACZ,CACN;IACD2D,KAAK,EAAE,QAAQ;IACfC,QAAQ,EAAE,KAAK;IACfC,UAAU,EAAE,KAAK;IAAE;IACnBC,SAAS,EAAE,KAAK;IAChBC,WAAW,EAAE,KAAK;IAClBxD,KAAK,EAAEA,KAAK;IACZyD,MAAM,EAAE,SAASC,cAAcA,CAACC,GAAM,EAAmB;MACvD,oBACE,IAAAlI,WAAA,CAAAqG,GAAA,EAACtB,YAAY;QACXE,WAAW,EAAEA,WAAY;QACzBC,EAAE,EAAE6B,QAAQ,CAACmB,GAAG,CAAE;QAClB/C,IAAI,EAAEA,IAAK;QACXC,QAAQ,EAAE+B,CAAC,CAAClD,WAAY;QACxBoB,WAAW,EAAE8B,CAAC,CAACjD,cAAe;QAC9BoB,aAAa,EAAE6B,CAAC,CAAChD,cAAe;QAChCoB,gBAAgB,EAAE4B,CAAC,CAAC/C,iBAAkB;QACtCoB,QAAQ,EAAE0B,WAAW,GAAGA,WAAW,CAACgB,GAAG,CAAC,GAAGxE;MAAU,CACtD,CAAC;IAEN;EACF,CAAC;AACH","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FavoriteColumn.js","names":["React","_interopRequireWildcard","require","_Box","_interopRequireDefault","_RowFavoriteToggle","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","freeze","DEFAULT_ROW_FAVORITE_LABELS","columnHeader","SR_ONLY_SX","position","width","height","padding","margin","overflow","clip","whiteSpace","border","makeFavoriteColumn","options","opts","resourceKey","getRowId","defaultGetRowId","id","key","size","getRowLabel","L","labels","process","env","console","warn","header","jsx","component","sx","children","align","sortable","toggleable","resizable","reorderable","render","renderFavorite","row","rowId","rowLabel","undefined"],"sources":["../../../src/lib/v2/patterns/FavoriteColumn.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport Box from \"@mui/material/Box\";\r\nimport type { SxProps, Theme } from \"@mui/material/styles\";\r\n\r\nimport RowFavoriteToggle, {\r\n DEFAULT_ROW_FAVORITE_LABELS,\r\n} from \"./RowFavoriteToggle\";\r\nimport type {\r\n FavoriteToggleSize,\r\n RowFavoriteToggleLabels,\r\n} from \"./RowFavoriteToggle\";\r\nimport type { DataGridColumn } from \"../types/datagrid\";\r\nimport type { RowId } from \"../types/common\";\r\n\r\n/**\r\n * FavoriteColumn - Portnet UI v2 (pattern)\r\n *\r\n * `makeFavoriteColumn(options)` builds a v2 DataGrid column definition for\r\n * a compact \"follow\" (suivi) star column. Spread it into the grid's\r\n * `columns` first so it sits at the LEFT of each row:\r\n *\r\n * const columns = [\r\n * makeFavoriteColumn({ resourceKey: \"ti:list\", getRowId: (r) => r.reference }),\r\n * { key: \"reference\", header: \"Référence\", ... },\r\n * ...\r\n * ];\r\n * <DataGrid columns={columns} rows={rows} getRowId={(r) => r.reference} ... />\r\n *\r\n * Behaviour:\r\n * - ALWAYS VISIBLE: the star is rendered on every row in both states\r\n * (filled ★ when followed, outline ☆ when not) — it is NOT\r\n * hover-revealed. It sits at the left of the row.\r\n * - COMPACT: no visible column header (the header carries only a\r\n * visually hidden accessible name \"Suivis\"), and a narrow 44px width,\r\n * so the column takes minimal space.\r\n * - STATUS TOOLTIP: hovering or focusing the star shows its current\r\n * status — \"Suivi\" when followed, \"Non suivi\" otherwise. The button's\r\n * accessible name stays action-oriented (\"Suivre\" / \"Ne plus suivre\",\r\n * optionally enriched with the row label) and aria-pressed conveys the\r\n * state, so screen-reader semantics are unaffected.\r\n * - `toggleable: false` keeps the column out of ColumnsToggle (the user\r\n * can't hide it); not sortable / resizable / reorderable (sorting BY\r\n * follow status is a separate concern — see useFavoritesView /\r\n * sortRowsByFavorites).\r\n * - Each cell reads useIsFavorite (a boolean selector), so toggling one\r\n * row re-renders only that row's star.\r\n * - Toggling never triggers the row's onRowClick (click + keydown\r\n * propagation stopped, mirroring the DataGrid selection checkbox).\r\n *\r\n * `getRowId` MUST match the one passed to <DataGrid> so the follow id and\r\n * the grid row id agree. Requires a <UserPersonalizationProvider>\r\n * ancestor (useIsFavorite throws otherwise).\r\n *\r\n * The per-row star itself is `RowFavoriteToggle` (gap G-36). It used to be a\r\n * private `FavoriteCell` in this file, which made the follow control reachable\r\n * as a DataGrid column and nowhere else — so hosts rebuilt it by hand for the\r\n * `MobileRowCard` `leading` slot that DataGrid switches to below its\r\n * `mobileBreakpoint`, and the copies drifted on their accessible names. Both\r\n * now render the same component, so desktop and mobile agree by construction.\r\n */\r\n\r\nexport interface FavoriteColumnLabels extends RowFavoriteToggleLabels {\r\n columnHeader: string;\r\n}\r\n\r\nconst DEFAULT_LABELS = Object.freeze({\r\n ...DEFAULT_ROW_FAVORITE_LABELS,\r\n columnHeader: \"Suivis\",\r\n} satisfies FavoriteColumnLabels);\r\n\r\n/** Visually hidden, but exposed to assistive tech (the column's accessible name). */\r\nconst SR_ONLY_SX = Object.freeze({\r\n position: \"absolute\",\r\n width: \"1px\",\r\n height: \"1px\",\r\n padding: 0,\r\n margin: \"-1px\",\r\n overflow: \"hidden\",\r\n clip: \"rect(0 0 0 0)\",\r\n whiteSpace: \"nowrap\",\r\n border: 0,\r\n} satisfies SxProps<Theme>);\r\n\r\nexport interface MakeFavoriteColumnOptions<T> {\r\n /** Required — follow namespace. */\r\n resourceKey: string;\r\n /** MUST match the grid's getRowId. Defaults to (r) => r.id. */\r\n getRowId?: ((row: T) => RowId) | undefined;\r\n /** Column key. @default \"__favorite__\" */\r\n key?: string | undefined;\r\n /** Toggle size (sm fits dense rows). @default \"sm\" */\r\n size?: FavoriteToggleSize | undefined;\r\n /** Column width (narrow / compact). @default 44 */\r\n width?: number | string | undefined;\r\n /** (row) => string, enriches the per-row aria-label. */\r\n getRowLabel?: ((row: T) => string) | undefined;\r\n labels?: Partial<FavoriteColumnLabels> | undefined;\r\n}\r\n\r\n/**\r\n * Builds a v2 DataGrid column definition for the compact follow-star column.\r\n */\r\nexport default function makeFavoriteColumn<T>(\r\n options: MakeFavoriteColumnOptions<T>\r\n): DataGridColumn<T> {\r\n const opts = options;\r\n const resourceKey = opts.resourceKey;\r\n const getRowId: (row: T) => RowId =\r\n typeof opts.getRowId === \"function\"\r\n ? opts.getRowId\r\n : function defaultGetRowId(r: T): RowId {\r\n return (r as { id: RowId }).id;\r\n };\r\n const key = opts.key || \"__favorite__\";\r\n const size = opts.size || \"sm\";\r\n const width: number | string = opts.width != null ? opts.width : 44;\r\n const getRowLabel =\r\n typeof opts.getRowLabel === \"function\" ? opts.getRowLabel : null;\r\n const L: FavoriteColumnLabels = opts.labels\r\n ? { ...DEFAULT_LABELS, ...opts.labels }\r\n : DEFAULT_LABELS;\r\n\r\n if (process.env[\"NODE_ENV\"] !== \"production\" && !resourceKey) {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n \"[@portnet/ui v2] makeFavoriteColumn: `resourceKey` is required to scope follows.\"\r\n );\r\n }\r\n\r\n return {\r\n key: key,\r\n header: (\r\n <Box component=\"span\" sx={SR_ONLY_SX}>\r\n {L.columnHeader}\r\n </Box>\r\n ),\r\n align: \"center\",\r\n sortable: false,\r\n toggleable: false, // kept out of ColumnsToggle (cannot be hidden)\r\n resizable: false,\r\n reorderable: false,\r\n width: width,\r\n render: function renderFavorite(row: T): React.ReactNode {\r\n return (\r\n <RowFavoriteToggle\r\n resourceKey={resourceKey}\r\n rowId={getRowId(row)}\r\n size={size}\r\n labels={L}\r\n rowLabel={getRowLabel ? getRowLabel(row) : undefined}\r\n />\r\n );\r\n },\r\n };\r\n}\r\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAJ,uBAAA,CAAAC,OAAA;AA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zB,cAAc;EAElB,IAAI0B,OAAO,CAACC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,IAAI,CAACV,WAAW,EAAE;IAC5D;IACAW,OAAO,CAACC,IAAI,CACV,kFACF,CAAC;EACH;EAEA,OAAO;IACLR,GAAG,EAAEA,GAAG;IACRS,MAAM,eACJ,IAAAlD,WAAA,CAAAmD,GAAA,EAACtD,IAAA,CAAAM,OAAG;MAACiD,SAAS,EAAC,MAAM;MAACC,EAAE,EAAE7B,UAAW;MAAA8B,QAAA,EAClCV,CAAC,CAACrB;IAAY,CACZ,CACN;IACDgC,KAAK,EAAE,QAAQ;IACfC,QAAQ,EAAE,KAAK;IACfC,UAAU,EAAE,KAAK;IAAE;IACnBC,SAAS,EAAE,KAAK;IAChBC,WAAW,EAAE,KAAK;IAClBjC,KAAK,EAAEA,KAAK;IACZkC,MAAM,EAAE,SAASC,cAAcA,CAACC,GAAM,EAAmB;MACvD,oBACE,IAAA9D,WAAA,CAAAmD,GAAA,EAACpD,kBAAA,CAAAI,OAAiB;QAChBkC,WAAW,EAAEA,WAAY;QACzB0B,KAAK,EAAEzB,QAAQ,CAACwB,GAAG,CAAE;QACrBpB,IAAI,EAAEA,IAAK;QACXG,MAAM,EAAED,CAAE;QACVoB,QAAQ,EAAErB,WAAW,GAAGA,WAAW,CAACmB,GAAG,CAAC,GAAGG;MAAU,CACtD,CAAC;IAEN;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var React = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _StarRounded = _interopRequireDefault(require("@mui/icons-material/StarRounded"));
|
|
9
9
|
var _Segmented = _interopRequireDefault(require("../components/Segmented"));
|
|
10
10
|
var _mergeLabels = require("../utils/mergeLabels");
|
|
11
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
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; }
|
|
18
|
-
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; }
|
|
19
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
-
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); } /**
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
/**
|
|
21
15
|
* FavoritesFilter - Portnet UI v2 (pattern)
|
|
22
16
|
*
|
|
23
17
|
* Presentational "Tous / Suivis" toggle for the follow filter, built on
|
|
@@ -39,7 +33,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
39
33
|
* Values ("all" | "only") match FAVORITES_FILTER. Pass `fullWidth` to let
|
|
40
34
|
* it span its row on narrow / mobile toolbars.
|
|
41
35
|
*/
|
|
42
|
-
|
|
36
|
+
|
|
37
|
+
const DEFAULT_LABELS = Object.freeze({
|
|
43
38
|
all: "Tous",
|
|
44
39
|
favorites: "Suivis",
|
|
45
40
|
ariaLabel: "Filtrer par suivis"
|
|
@@ -48,51 +43,48 @@ function withCount(label, count) {
|
|
|
48
43
|
return typeof count === "number" ? label + " (" + count + ")" : label;
|
|
49
44
|
}
|
|
50
45
|
function FavoritesFilter(props) {
|
|
51
|
-
|
|
52
|
-
value =
|
|
53
|
-
onChange
|
|
54
|
-
favoriteCount
|
|
55
|
-
totalCount
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
sx = props.sx;
|
|
66
|
-
var L = React.useMemo(function () {
|
|
67
|
-
return (0, _mergeLabels.mergeLabels)(DEFAULT_LABELS, labels);
|
|
68
|
-
}, [labels]);
|
|
69
|
-
var options = React.useMemo(function buildOptions() {
|
|
46
|
+
const {
|
|
47
|
+
value = "all",
|
|
48
|
+
onChange,
|
|
49
|
+
favoriteCount,
|
|
50
|
+
totalCount,
|
|
51
|
+
showCounts = true,
|
|
52
|
+
showIcon = true,
|
|
53
|
+
size = "sm",
|
|
54
|
+
fullWidth = false,
|
|
55
|
+
labels,
|
|
56
|
+
sx
|
|
57
|
+
} = props;
|
|
58
|
+
const L = React.useMemo(() => (0, _mergeLabels.mergeLabels)(DEFAULT_LABELS, labels), [labels]);
|
|
59
|
+
const options = React.useMemo(function buildOptions() {
|
|
70
60
|
return [{
|
|
71
61
|
value: "all",
|
|
72
62
|
label: showCounts ? withCount(L.all, totalCount) : L.all
|
|
73
|
-
},
|
|
63
|
+
}, {
|
|
74
64
|
value: "only",
|
|
75
|
-
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
65
|
+
label: showCounts ? withCount(L.favorites, favoriteCount) : L.favorites,
|
|
66
|
+
...(showIcon ? {
|
|
67
|
+
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_StarRounded.default, {
|
|
68
|
+
fontSize: "small"
|
|
69
|
+
})
|
|
70
|
+
} : {})
|
|
71
|
+
}];
|
|
81
72
|
}, [L, showCounts, showIcon, totalCount, favoriteCount]);
|
|
82
|
-
|
|
73
|
+
const handleChange = React.useCallback(function handleChange(v) {
|
|
83
74
|
// Segmented emits its configured option values only ("all" / "only").
|
|
84
75
|
if (onChange) onChange(v);
|
|
85
76
|
}, [onChange]);
|
|
86
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segmented
|
|
77
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segmented.default, {
|
|
87
78
|
value: value,
|
|
88
79
|
onChange: handleChange,
|
|
89
80
|
options: options,
|
|
90
81
|
size: size,
|
|
91
82
|
fullWidth: fullWidth,
|
|
92
|
-
"aria-label": L.ariaLabel
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
83
|
+
"aria-label": L.ariaLabel,
|
|
84
|
+
...(sx !== undefined ? {
|
|
85
|
+
sx
|
|
86
|
+
} : {})
|
|
87
|
+
});
|
|
96
88
|
}
|
|
97
|
-
var _default = exports
|
|
89
|
+
var _default = exports.default = FavoritesFilter;
|
|
98
90
|
//# sourceMappingURL=FavoritesFilter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FavoritesFilter.js","names":["React","_interopRequireWildcard","require","_StarRounded","_interopRequireDefault","_Segmented","_mergeLabels","_jsxRuntime","obj","__esModule","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Symbol","iterator","constructor","ownKeys","object","enumerableOnly","keys","getOwnPropertySymbols","symbols","filter","sym","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","value","_toPropertyKey","configurable","writable","arg","_toPrimitive","String","input","hint","prim","toPrimitive","undefined","res","TypeError","Number","DEFAULT_LABELS","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","_props$value","onChange","favoriteCount","totalCount","_props$showCounts","showCounts","_props$showIcon","showIcon","_props$size","size","_props$fullWidth","fullWidth","labels","sx","L","useMemo","mergeLabels","options","buildOptions","icon","jsx","fontSize","handleChange","useCallback","v","_default","exports"],"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,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AAAmD,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAE,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAAA,SAAAE,yBAAAC,WAAA,e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MAAO,CAAE;IAAE,CAAC,GAAG,CAAC,CAAC,EAErE;EACH,CAAC,EACD,CAACP,CAAC,EAAET,UAAU,EAAEE,QAAQ,EAAEJ,UAAU,EAAED,aAAa,CACrD,CAAC;EAED,IAAMoB,YAAY,GAAGrG,KAAK,CAACsG,WAAW,CACpC,SAASD,YAAYA,CAACE,CAAiB,EAAQ;IAC7C;IACA,IAAIvB,QAAQ,EAAEA,QAAQ,CAACuB,CAAwB,CAAC;EAClD,CAAC,EACD,CAACvB,QAAQ,CACX,CAAC;EAED,oBACE,IAAAzE,WAAA,CAAA4F,GAAA,EAAC9F,UAAA,WAAS,EAAAuC,aAAA;IACRU,KAAK,EAAEA,KAAM;IACb0B,QAAQ,EAAEqB,YAAa;IACvBL,OAAO,EAAEA,OAAQ;IACjBR,IAAI,EAAEA,IAAK;IACXE,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAACpB;EAAU,GACnBmB,EAAE,KAAK3B,SAAS,GAAG;IAAE2B,EAAE,EAAFA;EAAG,CAAC,GAAG,CAAC,CAAC,CACpC,CAAC;AAEN;AAAC,IAAAY,QAAA,GAAAC,OAAA,cAEc5B,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FavoritesFilter.js","names":["React","_interopRequireWildcard","require","_StarRounded","_interopRequireDefault","_Segmented","_mergeLabels","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DEFAULT_LABELS","freeze","all","favorites","ariaLabel","withCount","label","count","FavoritesFilter","props","value","onChange","favoriteCount","totalCount","showCounts","showIcon","size","fullWidth","labels","sx","L","useMemo","mergeLabels","options","buildOptions","icon","jsx","fontSize","handleChange","useCallback","v","undefined","_default","exports"],"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,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA,IAAA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C,CACF;EACH,CAAC,EACD,CAACP,CAAC,EAAEN,UAAU,EAAEC,QAAQ,EAAEF,UAAU,EAAED,aAAa,CACrD,CAAC;EAED,MAAMgB,YAAY,GAAGvD,KAAK,CAACwD,WAAW,CACpC,SAASD,YAAYA,CAACE,CAAiB,EAAQ;IAC7C;IACA,IAAInB,QAAQ,EAAEA,QAAQ,CAACmB,CAAwB,CAAC;EAClD,CAAC,EACD,CAACnB,QAAQ,CACX,CAAC;EAED,oBACE,IAAA/B,WAAA,CAAA8C,GAAA,EAAChD,UAAA,CAAAK,OAAS;IACR2B,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEiB,YAAa;IACvBL,OAAO,EAAEA,OAAQ;IACjBP,IAAI,EAAEA,IAAK;IACXC,SAAS,EAAEA,SAAU;IACrB,cAAYG,CAAC,CAAChB,SAAU;IAAA,IACnBe,EAAE,KAAKY,SAAS,GAAG;MAAEZ;IAAG,CAAC,GAAG,CAAC,CAAC;EAAA,CACpC,CAAC;AAEN;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAAlD,OAAA,GAEcyB,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { SxProps, Theme } from "@mui/material/styles";
|
|
3
|
+
export interface FilterTabBarProps {
|
|
4
|
+
/** The status pills (`FilterTab`), left-hand group. */
|
|
5
|
+
children?: React.ReactNode | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Right-hand group — typically `FavoritesFilter` + `SavedFiltersMenu`.
|
|
8
|
+
* Omit it and the pills fill the row.
|
|
9
|
+
*/
|
|
10
|
+
end?: React.ReactNode | undefined;
|
|
11
|
+
/** Accessible name of the pill group. @default "Filtrer par statut" */
|
|
12
|
+
ariaLabel?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Accessible name of the right-hand group.
|
|
15
|
+
* @default "Favoris et filtres enregistrés"
|
|
16
|
+
*/
|
|
17
|
+
endAriaLabel?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Bottom border marking the bar as the listing card's header.
|
|
20
|
+
* @default true
|
|
21
|
+
*/
|
|
22
|
+
divider?: boolean | undefined;
|
|
23
|
+
/** MUI sx overrides applied to the bar. */
|
|
24
|
+
sx?: SxProps<Theme> | undefined;
|
|
25
|
+
}
|
|
26
|
+
declare function FilterTabBar({ children, end, ariaLabel, endAriaLabel, divider, sx, }: FilterTabBarProps): React.JSX.Element;
|
|
27
|
+
export default FilterTabBar;
|
|
28
|
+
//# sourceMappingURL=FilterTabBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterTabBar.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/patterns/FilterTabBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AA4E3D,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACvC;;;OAGG;IACH,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAClC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,2CAA2C;IAC3C,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC;CACjC;AAED,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,GAAG,EACH,SAAgC,EAChC,YAA+C,EAC/C,OAAc,EACd,EAAE,GACH,EAAE,iBAAiB,qBA0BnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _Box = _interopRequireDefault(require("@mui/material/Box"));
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* FilterTabBar — Portnet UI v2 (pattern)
|
|
14
|
+
*
|
|
15
|
+
* Charter §03 · Platform Mandatory UX Patterns §Status Chips, §Favorites,
|
|
16
|
+
* §User Personalization.
|
|
17
|
+
*
|
|
18
|
+
* The bar that seats the status pills at the top of a listing card. The
|
|
19
|
+
* library shipped `FilterTab` — the pill — and nothing to seat them in,
|
|
20
|
+
* so every listing re-derived the same row: the geometry, the card-header
|
|
21
|
+
* separator, and the split between the status group on the left and the
|
|
22
|
+
* personalization controls (favorites toggle, saved filters) on the right.
|
|
23
|
+
*
|
|
24
|
+
* Promoted from `refonte-frontend` (Area 5), where FOUR listings carried
|
|
25
|
+
* the identical pair of frozen style objects:
|
|
26
|
+
*
|
|
27
|
+
* const BARRE_CHIPS_STATUT = { display: "flex", flexWrap: "wrap",
|
|
28
|
+
* alignItems: "center", justifyContent: "space-between",
|
|
29
|
+
* gap: "var(--s-2)", padding: "var(--s-3) var(--s-4)",
|
|
30
|
+
* borderBottom: "1px solid var(--border)" };
|
|
31
|
+
* const GROUPE_BARRE = { display: "flex", flexWrap: "wrap",
|
|
32
|
+
* alignItems: "center", gap: "var(--s-2)" };
|
|
33
|
+
*
|
|
34
|
+
* THE COPIES HAD ALREADY DRIFTED, which is the whole argument: one of the
|
|
35
|
+
* four omitted `justifyContent: "space-between"`, so its right-hand group
|
|
36
|
+
* sat against the pills instead of at the far edge — the same listing,
|
|
37
|
+
* two layouts, on screens a user moves between in one session (R-2.1).
|
|
38
|
+
*
|
|
39
|
+
* TWO GROUPS, TWO LANDMARKS. Each half renders as `role="group"` with its
|
|
40
|
+
* own accessible name rather than one flat row of buttons: a listing
|
|
41
|
+
* commonly shows eight or more pills, and a screen-reader user needs to
|
|
42
|
+
* know where the status filters end and the personalization controls
|
|
43
|
+
* begin. The names default to French, per this library's label
|
|
44
|
+
* convention; override them on a localised host.
|
|
45
|
+
*
|
|
46
|
+
* THE SEPARATOR ASSUMES THE CANONICAL CARD. §07 stacks this bar directly
|
|
47
|
+
* above the toolbar and the grid inside a single
|
|
48
|
+
* `<Surface padding="none" elevation="xs" clip>`, and `borderBottom`
|
|
49
|
+
* is what makes the bar read as that card's header instead of a floating
|
|
50
|
+
* row. Pass `divider={false}` when the bar is not the first child of a
|
|
51
|
+
* card.
|
|
52
|
+
*
|
|
53
|
+
* Usage:
|
|
54
|
+
* <Surface padding="none" elevation="xs" clip>
|
|
55
|
+
* <FilterTabBar
|
|
56
|
+
* end={
|
|
57
|
+
* <>
|
|
58
|
+
* <FavoritesFilter … />
|
|
59
|
+
* <SavedFiltersMenu … />
|
|
60
|
+
* </>
|
|
61
|
+
* }
|
|
62
|
+
* >
|
|
63
|
+
* <FilterTab active={!statut} variant="neutral" onClick={…}>Tous</FilterTab>
|
|
64
|
+
* {statuts.map((s) => (
|
|
65
|
+
* <FilterTab key={s.id} …>{s.description}</FilterTab>
|
|
66
|
+
* ))}
|
|
67
|
+
* </FilterTabBar>
|
|
68
|
+
*
|
|
69
|
+
* <DataGridToolbar … />
|
|
70
|
+
* <DataGrid … />
|
|
71
|
+
* </Surface>
|
|
72
|
+
*
|
|
73
|
+
* With no `end`, the pills simply fill the row — `space-between` on a
|
|
74
|
+
* single group behaves as `flex-start`, so no branch is needed.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/** Geometry of one half of the bar. Both groups share it by construction. */
|
|
78
|
+
const GROUP_SX = Object.freeze({
|
|
79
|
+
display: "flex",
|
|
80
|
+
flexWrap: "wrap",
|
|
81
|
+
alignItems: "center",
|
|
82
|
+
gap: "var(--s-2)"
|
|
83
|
+
});
|
|
84
|
+
function FilterTabBar({
|
|
85
|
+
children,
|
|
86
|
+
end,
|
|
87
|
+
ariaLabel = "Filtrer par statut",
|
|
88
|
+
endAriaLabel = "Favoris et filtres enregistrés",
|
|
89
|
+
divider = true,
|
|
90
|
+
sx
|
|
91
|
+
}) {
|
|
92
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Box.default, {
|
|
93
|
+
sx: {
|
|
94
|
+
display: "flex",
|
|
95
|
+
flexWrap: "wrap",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
/* Pills left, personalization right. Harmless with one group. */
|
|
98
|
+
justifyContent: "space-between",
|
|
99
|
+
gap: "var(--s-2)",
|
|
100
|
+
padding: "var(--s-3) var(--s-4)",
|
|
101
|
+
...(divider ? {
|
|
102
|
+
borderBottom: "1px solid var(--border)"
|
|
103
|
+
} : {}),
|
|
104
|
+
...sx
|
|
105
|
+
},
|
|
106
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
107
|
+
role: "group",
|
|
108
|
+
"aria-label": ariaLabel,
|
|
109
|
+
sx: GROUP_SX,
|
|
110
|
+
children: children
|
|
111
|
+
}), end != null ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Box.default, {
|
|
112
|
+
role: "group",
|
|
113
|
+
"aria-label": endAriaLabel,
|
|
114
|
+
sx: GROUP_SX,
|
|
115
|
+
children: end
|
|
116
|
+
}) : null]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
var _default = exports.default = FilterTabBar;
|
|
120
|
+
//# sourceMappingURL=FilterTabBar.js.map
|