@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,7 +1,3 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
2
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
3
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
4
|
-
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); }
|
|
5
1
|
import { useMemo } from "react";
|
|
6
2
|
|
|
7
3
|
/**
|
|
@@ -37,38 +33,32 @@ import { useMemo } from "react";
|
|
|
37
33
|
* "articles" → values.articles (array length checked)
|
|
38
34
|
*/
|
|
39
35
|
|
|
40
|
-
export default function useFormCompletionProgress(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return useMemo(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
var totalRequired = required.length;
|
|
58
|
-
var totalOptional = optional.length;
|
|
59
|
-
var requiredPct = totalRequired ? Math.round(filledRequired / totalRequired * 100) : 100;
|
|
60
|
-
var overallFilled = filledRequired + filledOptional;
|
|
61
|
-
var overallTotal = totalRequired + totalOptional;
|
|
62
|
-
var overallPct = overallTotal ? Math.round(overallFilled / overallTotal * 100) : 0;
|
|
36
|
+
export default function useFormCompletionProgress({
|
|
37
|
+
values,
|
|
38
|
+
requiredFields,
|
|
39
|
+
optionalFields = []
|
|
40
|
+
}) {
|
|
41
|
+
return useMemo(() => {
|
|
42
|
+
const required = Array.isArray(requiredFields) ? requiredFields : [];
|
|
43
|
+
const optional = Array.isArray(optionalFields) ? optionalFields : [];
|
|
44
|
+
const filledRequired = required.filter(path => isFilled(getFieldValue(values, path))).length;
|
|
45
|
+
const filledOptional = optional.filter(path => isFilled(getFieldValue(values, path))).length;
|
|
46
|
+
const missingRequired = required.filter(path => !isFilled(getFieldValue(values, path)));
|
|
47
|
+
const totalRequired = required.length;
|
|
48
|
+
const totalOptional = optional.length;
|
|
49
|
+
const requiredPct = totalRequired ? Math.round(filledRequired / totalRequired * 100) : 100;
|
|
50
|
+
const overallFilled = filledRequired + filledOptional;
|
|
51
|
+
const overallTotal = totalRequired + totalOptional;
|
|
52
|
+
const overallPct = overallTotal ? Math.round(overallFilled / overallTotal * 100) : 0;
|
|
63
53
|
return {
|
|
64
|
-
requiredPct
|
|
65
|
-
overallPct
|
|
66
|
-
filledRequired
|
|
67
|
-
totalRequired
|
|
68
|
-
filledOptional
|
|
69
|
-
totalOptional
|
|
54
|
+
requiredPct,
|
|
55
|
+
overallPct,
|
|
56
|
+
filledRequired,
|
|
57
|
+
totalRequired,
|
|
58
|
+
filledOptional,
|
|
59
|
+
totalOptional,
|
|
70
60
|
isCompleteRequired: totalRequired === 0 || filledRequired === totalRequired,
|
|
71
|
-
missingRequired
|
|
61
|
+
missingRequired
|
|
72
62
|
};
|
|
73
63
|
}, [values, requiredFields, optionalFields]);
|
|
74
64
|
}
|
|
@@ -84,23 +74,14 @@ export default function useFormCompletionProgress(_ref) {
|
|
|
84
74
|
* getFieldValue({}, "doesNotExist") → undefined
|
|
85
75
|
*/
|
|
86
76
|
function getFieldValue(obj, path) {
|
|
87
|
-
if (!obj ||
|
|
77
|
+
if (!obj || typeof obj !== "object") return undefined;
|
|
88
78
|
if (!path) return undefined;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var p = _step.value;
|
|
96
|
-
if (cur === null || cur === undefined) return undefined;
|
|
97
|
-
if (_typeof(cur) !== "object") return undefined;
|
|
98
|
-
cur = cur[p];
|
|
99
|
-
}
|
|
100
|
-
} catch (err) {
|
|
101
|
-
_iterator.e(err);
|
|
102
|
-
} finally {
|
|
103
|
-
_iterator.f();
|
|
79
|
+
const parts = path.split(".");
|
|
80
|
+
let cur = obj;
|
|
81
|
+
for (const p of parts) {
|
|
82
|
+
if (cur === null || cur === undefined) return undefined;
|
|
83
|
+
if (typeof cur !== "object") return undefined;
|
|
84
|
+
cur = cur[p];
|
|
104
85
|
}
|
|
105
86
|
return cur;
|
|
106
87
|
}
|
|
@@ -124,7 +105,7 @@ function isFilled(v) {
|
|
|
124
105
|
if (typeof v === "string") return v.trim().length > 0;
|
|
125
106
|
if (Array.isArray(v)) return v.length > 0;
|
|
126
107
|
if (v instanceof Date) return !Number.isNaN(v.getTime());
|
|
127
|
-
if (
|
|
108
|
+
if (typeof v === "object") return Object.keys(v).length > 0;
|
|
128
109
|
// numbers, booleans
|
|
129
110
|
return true;
|
|
130
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormCompletionProgress.js","names":["useMemo","useFormCompletionProgress","
|
|
1
|
+
{"version":3,"file":"useFormCompletionProgress.js","names":["useMemo","useFormCompletionProgress","values","requiredFields","optionalFields","required","Array","isArray","optional","filledRequired","filter","path","isFilled","getFieldValue","length","filledOptional","missingRequired","totalRequired","totalOptional","requiredPct","Math","round","overallFilled","overallTotal","overallPct","isCompleteRequired","obj","undefined","parts","split","cur","p","v","trim","Date","Number","isNaN","getTime","Object","keys"],"sources":["../../../../src/lib/v2/hooks/useFormCompletionProgress.ts"],"sourcesContent":["import { useMemo } from \"react\";\r\n\r\n/**\r\n * useFormCompletionProgress — derive required/overall completion\r\n * percentages from current form values and a declared field list.\r\n * Pure useMemo computation, no side effects.\r\n *\r\n * Usage:\r\n * import { v2 } from \"@portnet/ui\";\r\n * const { useFormCompletionProgress, ProgressBar } = v2;\r\n *\r\n * const REQUIRED = [\"typeAutorisation\", \"importer.id\", \"dateFinValidite\"];\r\n * const OPTIONAL = [\"referenceLicence\", \"region\"];\r\n *\r\n * const {\r\n * requiredPct,\r\n * overallPct,\r\n * isCompleteRequired,\r\n * missingRequired,\r\n * filledRequired,\r\n * totalRequired,\r\n * } = useFormCompletionProgress({\r\n * values: formik.values,\r\n * requiredFields: REQUIRED,\r\n * optionalFields: OPTIONAL,\r\n * });\r\n *\r\n * <ProgressBar value={requiredPct} />\r\n * <span>{filledRequired}/{totalRequired} requis</span>\r\n *\r\n * Field paths support dot notation for nested values:\r\n * \"importer.id\" → values.importer.id\r\n * \"articles\" → values.articles (array length checked)\r\n */\r\n\r\ntype FormCompletionProgressOptions<Values> = {\r\n values: Values;\r\n /** Field keys / dot-paths that are required. */\r\n requiredFields: string[];\r\n /** Field keys / dot-paths that are optional. */\r\n optionalFields?: string[] | undefined;\r\n};\r\n\r\ntype FormCompletionProgress = {\r\n requiredPct: number;\r\n overallPct: number;\r\n filledRequired: number;\r\n totalRequired: number;\r\n filledOptional: number;\r\n totalOptional: number;\r\n isCompleteRequired: boolean;\r\n missingRequired: string[];\r\n};\r\n\r\nexport default function useFormCompletionProgress<Values>({\r\n values,\r\n requiredFields,\r\n optionalFields = [],\r\n}: FormCompletionProgressOptions<Values>): FormCompletionProgress {\r\n return useMemo(() => {\r\n const required = Array.isArray(requiredFields) ? requiredFields : [];\r\n const optional = Array.isArray(optionalFields) ? optionalFields : [];\r\n\r\n const filledRequired = required.filter((path) =>\r\n isFilled(getFieldValue(values, path))\r\n ).length;\r\n const filledOptional = optional.filter((path) =>\r\n isFilled(getFieldValue(values, path))\r\n ).length;\r\n\r\n const missingRequired = required.filter(\r\n (path) => !isFilled(getFieldValue(values, path))\r\n );\r\n\r\n const totalRequired = required.length;\r\n const totalOptional = optional.length;\r\n\r\n const requiredPct = totalRequired\r\n ? Math.round((filledRequired / totalRequired) * 100)\r\n : 100;\r\n\r\n const overallFilled = filledRequired + filledOptional;\r\n const overallTotal = totalRequired + totalOptional;\r\n const overallPct = overallTotal\r\n ? Math.round((overallFilled / overallTotal) * 100)\r\n : 0;\r\n\r\n return {\r\n requiredPct,\r\n overallPct,\r\n filledRequired,\r\n totalRequired,\r\n filledOptional,\r\n totalOptional,\r\n isCompleteRequired: totalRequired === 0 || filledRequired === totalRequired,\r\n missingRequired,\r\n };\r\n }, [values, requiredFields, optionalFields]);\r\n}\r\n\r\n/* ── Helpers ───────────────────────────── */\r\n\r\n/**\r\n * Resolves a dot-separated field path against a values object.\r\n * Returns undefined on any missing intermediate.\r\n *\r\n * getFieldValue({ a: { b: { c: 42 } } }, \"a.b.c\") → 42\r\n * getFieldValue({ a: null }, \"a.b.c\") → undefined\r\n * getFieldValue({}, \"doesNotExist\") → undefined\r\n */\r\nfunction getFieldValue(obj: unknown, path: string): unknown {\r\n if (!obj || typeof obj !== \"object\") return undefined;\r\n if (!path) return undefined;\r\n const parts = path.split(\".\");\r\n let cur: unknown = obj;\r\n for (const p of parts) {\r\n if (cur === null || cur === undefined) return undefined;\r\n if (typeof cur !== \"object\") return undefined;\r\n cur = (cur as Record<string, unknown>)[p];\r\n }\r\n return cur;\r\n}\r\n\r\n/**\r\n * Centralised \"is this value considered filled?\" check.\r\n *\r\n * Considered EMPTY:\r\n * - null, undefined\r\n * - \"\" or whitespace-only string\r\n * - empty array []\r\n * - empty plain object {}\r\n *\r\n * Considered FILLED (intentional):\r\n * - 0, false (valid user input distinct from \"unset\")\r\n * - any non-empty array, object with keys, string, number\r\n * - Date instances with valid time\r\n */\r\nfunction isFilled(v: unknown): boolean {\r\n if (v === null || v === undefined) return false;\r\n if (typeof v === \"string\") return v.trim().length > 0;\r\n if (Array.isArray(v)) return v.length > 0;\r\n if (v instanceof Date) return !Number.isNaN(v.getTime());\r\n if (typeof v === \"object\") return Object.keys(v).length > 0;\r\n // numbers, booleans\r\n return true;\r\n}\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* useKeyboardShortcuts — Portnet UI v2 (hook)
|
|
5
|
+
*
|
|
6
|
+
* Raccourcis clavier de page. §Keyboard / R-K.1.
|
|
7
|
+
*
|
|
8
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
9
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-48)
|
|
10
|
+
*
|
|
11
|
+
* The library already owned BOTH ENDS of page shortcuts and not the listener
|
|
12
|
+
* between them:
|
|
13
|
+
*
|
|
14
|
+
* · `KeyboardShortcutsHelp` — the « ? » dialogue that LISTS the shortcuts;
|
|
15
|
+
* · `data-v2-overlay-open` on `<body>` — the signal the library SETS when a
|
|
16
|
+
* modal or drawer is open, and which shortcuts must respect.
|
|
17
|
+
*
|
|
18
|
+
* So a host wiring shortcuts had to write the middle itself, and `ms-ti-fe`
|
|
19
|
+
* did: a `keydown` effect plus `isShortcutBlockingTarget` (a set of eleven
|
|
20
|
+
* interactive ARIA roles, the tag list, `isContentEditable`, `tabIndex >= 0`)
|
|
21
|
+
* plus `isOverlayOpen` reading the library's own attribute back off the body.
|
|
22
|
+
* Forty lines of platform behaviour in a listing page.
|
|
23
|
+
*
|
|
24
|
+
* >>> THE OVERLAY GUARD IS THE REASON THIS CANNOT STAY IN A HOST. The library
|
|
25
|
+
* >>> is what SETS `data-v2-overlay-open`; a host reading it is a module
|
|
26
|
+
* >>> depending on an implementation detail of the component it renders. If
|
|
27
|
+
* >>> that attribute is ever renamed, every host that copied the guard breaks
|
|
28
|
+
* >>> SILENTLY — the shortcuts simply start firing behind open modals, which
|
|
29
|
+
* >>> nothing tests and nobody notices until a « n » keystroke inside a drawer
|
|
30
|
+
* >>> navigates the page away. Owning the listener here means the guard and
|
|
31
|
+
* >>> the signal are maintained together. <<<
|
|
32
|
+
*
|
|
33
|
+
* Raised from `addm-fe` (Area 14), whose listings carry a `searchInputRef`
|
|
34
|
+
* declared and passed to `DataGridToolbar` FOR the « / » shortcut — a wire
|
|
35
|
+
* waiting for a listener that was never written.
|
|
36
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
37
|
+
*
|
|
38
|
+
* WHAT THE HOOK REFUSES TO FIRE ON, and why each case matters:
|
|
39
|
+
*
|
|
40
|
+
* · A MODIFIER is held (⌘/Ctrl/Alt). « n » is a shortcut; ⌘N is the
|
|
41
|
+
* browser's new window, and stealing it is worse than having no shortcut.
|
|
42
|
+
* · The target is an EDITABLE element — input, textarea, select,
|
|
43
|
+
* contenteditable. Typing « / » in a search box must insert a slash.
|
|
44
|
+
* · The target is otherwise INTERACTIVE — a button, a link, anything with an
|
|
45
|
+
* interactive ARIA role or a positive tabIndex. `Espace` on a focused
|
|
46
|
+
* button activates it; a page shortcut must not pre-empt that.
|
|
47
|
+
* · An OVERLAY is open. See the note above.
|
|
48
|
+
*
|
|
49
|
+
* `<main>` is excluded from the tabIndex test deliberately: a page shell gives
|
|
50
|
+
* `<main>` a `tabIndex` so a skip link can reach it, which would otherwise
|
|
51
|
+
* disable every shortcut for a user who just used the skip link.
|
|
52
|
+
*
|
|
53
|
+
* Usage:
|
|
54
|
+
*
|
|
55
|
+
* useKeyboardShortcuts([
|
|
56
|
+
* { keys: ["/"], onTrigger: () => searchRef.current?.focus() },
|
|
57
|
+
* { keys: ["n"], onTrigger: goToCreate, enabled: canCreate },
|
|
58
|
+
* { keys: ["1", "2", "3"], onTrigger: (key) => setBucket(BY_KEY[key]) },
|
|
59
|
+
* ]);
|
|
60
|
+
*
|
|
61
|
+
* The host keeps its own `KeyboardShortcutsHelp` list: this hook knows which
|
|
62
|
+
* keys DO something, not how to describe them to a user (§9.2 — the business
|
|
63
|
+
* wording belongs to the host).
|
|
64
|
+
*/
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Roles whose focused element handles its own keys. Kept here rather than in
|
|
68
|
+
* a host so the list is maintained once for the fleet.
|
|
69
|
+
*/
|
|
70
|
+
const INTERACTIVE_ROLES = new Set(["button", "link", "tab", "menuitem", "menuitemcheckbox", "menuitemradio", "option", "checkbox", "radio", "combobox", "searchbox", "textbox", "switch", "spinbutton", "slider"]);
|
|
71
|
+
const EDITABLE_TAGS = new Set(["INPUT", "TEXTAREA", "SELECT"]);
|
|
72
|
+
function isBlockingTarget(node) {
|
|
73
|
+
if (!node || node === document.body) return false;
|
|
74
|
+
if (!(node instanceof Element)) return false;
|
|
75
|
+
const tag = node.tagName;
|
|
76
|
+
if (EDITABLE_TAGS.has(tag)) return true;
|
|
77
|
+
if (tag === "BUTTON" || tag === "A") return true;
|
|
78
|
+
if (node instanceof HTMLElement && node.isContentEditable) return true;
|
|
79
|
+
const role = node.getAttribute("role");
|
|
80
|
+
if (role && INTERACTIVE_ROLES.has(role)) return true;
|
|
81
|
+
|
|
82
|
+
/* `MAIN` excluded — see the note in the file header on skip links. */
|
|
83
|
+
if (node instanceof HTMLElement && node.tabIndex >= 0 && tag !== "MAIN") {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Is a library overlay (modal / drawer) currently open? */
|
|
90
|
+
function isOverlayOpen() {
|
|
91
|
+
if (typeof document === "undefined") return false;
|
|
92
|
+
return document.body?.getAttribute("data-v2-overlay-open") === "true";
|
|
93
|
+
}
|
|
94
|
+
export function useKeyboardShortcuts(shortcuts, {
|
|
95
|
+
enabled = true
|
|
96
|
+
} = {}) {
|
|
97
|
+
/* The descriptor array is rebuilt on every host render (inline literal, in
|
|
98
|
+
* practice), so it is read through a ref instead of being an effect
|
|
99
|
+
* dependency — otherwise the listener detaches and reattaches on each
|
|
100
|
+
* render, and a keystroke could land between the two. */
|
|
101
|
+
const ref = React.useRef(shortcuts);
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
ref.current = shortcuts;
|
|
104
|
+
}, [shortcuts]);
|
|
105
|
+
React.useEffect(() => {
|
|
106
|
+
if (!enabled || typeof window === "undefined") return undefined;
|
|
107
|
+
const onKeyDown = e => {
|
|
108
|
+
if (e.metaKey || e.ctrlKey || e.altKey) return;
|
|
109
|
+
if (isBlockingTarget(document.activeElement)) return;
|
|
110
|
+
if (isBlockingTarget(e.target)) return;
|
|
111
|
+
if (isOverlayOpen()) return;
|
|
112
|
+
for (const shortcut of ref.current) {
|
|
113
|
+
if (shortcut.enabled === false) continue;
|
|
114
|
+
if (!shortcut.keys.includes(e.key)) continue;
|
|
115
|
+
e.preventDefault();
|
|
116
|
+
shortcut.onTrigger(e.key);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
window.addEventListener("keydown", onKeyDown);
|
|
121
|
+
return () => window.removeEventListener("keydown", onKeyDown);
|
|
122
|
+
}, [enabled]);
|
|
123
|
+
}
|
|
124
|
+
export default useKeyboardShortcuts;
|
|
125
|
+
//# sourceMappingURL=useKeyboardShortcuts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useKeyboardShortcuts.js","names":["React","INTERACTIVE_ROLES","Set","EDITABLE_TAGS","isBlockingTarget","node","document","body","Element","tag","tagName","has","HTMLElement","isContentEditable","role","getAttribute","tabIndex","isOverlayOpen","useKeyboardShortcuts","shortcuts","enabled","ref","useRef","useEffect","current","window","undefined","onKeyDown","e","metaKey","ctrlKey","altKey","activeElement","target","shortcut","keys","includes","key","preventDefault","onTrigger","addEventListener","removeEventListener"],"sources":["../../../../src/lib/v2/hooks/useKeyboardShortcuts.ts"],"sourcesContent":["import * as React from \"react\";\r\n\r\n/**\r\n * useKeyboardShortcuts — Portnet UI v2 (hook)\r\n *\r\n * Raccourcis clavier de page. §Keyboard / R-K.1.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-48)\r\n *\r\n * The library already owned BOTH ENDS of page shortcuts and not the listener\r\n * between them:\r\n *\r\n * · `KeyboardShortcutsHelp` — the « ? » dialogue that LISTS the shortcuts;\r\n * · `data-v2-overlay-open` on `<body>` — the signal the library SETS when a\r\n * modal or drawer is open, and which shortcuts must respect.\r\n *\r\n * So a host wiring shortcuts had to write the middle itself, and `ms-ti-fe`\r\n * did: a `keydown` effect plus `isShortcutBlockingTarget` (a set of eleven\r\n * interactive ARIA roles, the tag list, `isContentEditable`, `tabIndex >= 0`)\r\n * plus `isOverlayOpen` reading the library's own attribute back off the body.\r\n * Forty lines of platform behaviour in a listing page.\r\n *\r\n * >>> THE OVERLAY GUARD IS THE REASON THIS CANNOT STAY IN A HOST. The library\r\n * >>> is what SETS `data-v2-overlay-open`; a host reading it is a module\r\n * >>> depending on an implementation detail of the component it renders. If\r\n * >>> that attribute is ever renamed, every host that copied the guard breaks\r\n * >>> SILENTLY — the shortcuts simply start firing behind open modals, which\r\n * >>> nothing tests and nobody notices until a « n » keystroke inside a drawer\r\n * >>> navigates the page away. Owning the listener here means the guard and\r\n * >>> the signal are maintained together. <<<\r\n *\r\n * Raised from `addm-fe` (Area 14), whose listings carry a `searchInputRef`\r\n * declared and passed to `DataGridToolbar` FOR the « / » shortcut — a wire\r\n * waiting for a listener that was never written.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * WHAT THE HOOK REFUSES TO FIRE ON, and why each case matters:\r\n *\r\n * · A MODIFIER is held (⌘/Ctrl/Alt). « n » is a shortcut; ⌘N is the\r\n * browser's new window, and stealing it is worse than having no shortcut.\r\n * · The target is an EDITABLE element — input, textarea, select,\r\n * contenteditable. Typing « / » in a search box must insert a slash.\r\n * · The target is otherwise INTERACTIVE — a button, a link, anything with an\r\n * interactive ARIA role or a positive tabIndex. `Espace` on a focused\r\n * button activates it; a page shortcut must not pre-empt that.\r\n * · An OVERLAY is open. See the note above.\r\n *\r\n * `<main>` is excluded from the tabIndex test deliberately: a page shell gives\r\n * `<main>` a `tabIndex` so a skip link can reach it, which would otherwise\r\n * disable every shortcut for a user who just used the skip link.\r\n *\r\n * Usage:\r\n *\r\n * useKeyboardShortcuts([\r\n * { keys: [\"/\"], onTrigger: () => searchRef.current?.focus() },\r\n * { keys: [\"n\"], onTrigger: goToCreate, enabled: canCreate },\r\n * { keys: [\"1\", \"2\", \"3\"], onTrigger: (key) => setBucket(BY_KEY[key]) },\r\n * ]);\r\n *\r\n * The host keeps its own `KeyboardShortcutsHelp` list: this hook knows which\r\n * keys DO something, not how to describe them to a user (§9.2 — the business\r\n * wording belongs to the host).\r\n */\r\n\r\n/**\r\n * Roles whose focused element handles its own keys. Kept here rather than in\r\n * a host so the list is maintained once for the fleet.\r\n */\r\nconst INTERACTIVE_ROLES = new Set([\r\n \"button\",\r\n \"link\",\r\n \"tab\",\r\n \"menuitem\",\r\n \"menuitemcheckbox\",\r\n \"menuitemradio\",\r\n \"option\",\r\n \"checkbox\",\r\n \"radio\",\r\n \"combobox\",\r\n \"searchbox\",\r\n \"textbox\",\r\n \"switch\",\r\n \"spinbutton\",\r\n \"slider\",\r\n]);\r\n\r\nconst EDITABLE_TAGS = new Set([\"INPUT\", \"TEXTAREA\", \"SELECT\"]);\r\n\r\nfunction isBlockingTarget(node: EventTarget | null): boolean {\r\n if (!node || node === document.body) return false;\r\n if (!(node instanceof Element)) return false;\r\n\r\n const tag = node.tagName;\r\n if (EDITABLE_TAGS.has(tag)) return true;\r\n if (tag === \"BUTTON\" || tag === \"A\") return true;\r\n\r\n if (node instanceof HTMLElement && node.isContentEditable) return true;\r\n\r\n const role = node.getAttribute(\"role\");\r\n if (role && INTERACTIVE_ROLES.has(role)) return true;\r\n\r\n /* `MAIN` excluded — see the note in the file header on skip links. */\r\n if (node instanceof HTMLElement && node.tabIndex >= 0 && tag !== \"MAIN\") {\r\n return true;\r\n }\r\n\r\n return false;\r\n}\r\n\r\n/** Is a library overlay (modal / drawer) currently open? */\r\nfunction isOverlayOpen(): boolean {\r\n if (typeof document === \"undefined\") return false;\r\n return document.body?.getAttribute(\"data-v2-overlay-open\") === \"true\";\r\n}\r\n\r\nexport interface KeyboardShortcut {\r\n /**\r\n * Keys that trigger it, as `KeyboardEvent.key` values — so `\"/\"`, `\"?\"`,\r\n * `\"1\"`, `\"n\"`. Case matters: `\"n\"` does not match `Shift+N`.\r\n */\r\n keys: readonly string[];\r\n /**\r\n * Receives the key that matched, so one descriptor can serve a range\r\n * (`[\"1\",\"2\",\"3\"]` → one handler that reads which was pressed).\r\n */\r\n onTrigger: (key: string) => void;\r\n /**\r\n * @default true — a shortcut gated on a permission stays DECLARED and\r\n * inactive rather than being spliced out of the array, so the descriptor\r\n * list keeps the same shape as the help dialogue's.\r\n */\r\n enabled?: boolean | undefined;\r\n}\r\n\r\nexport interface UseKeyboardShortcutsOptions {\r\n /** Suspends every shortcut at once. @default true */\r\n enabled?: boolean | undefined;\r\n}\r\n\r\nexport function useKeyboardShortcuts(\r\n shortcuts: readonly KeyboardShortcut[],\r\n { enabled = true }: UseKeyboardShortcutsOptions = {}\r\n): void {\r\n /* The descriptor array is rebuilt on every host render (inline literal, in\r\n * practice), so it is read through a ref instead of being an effect\r\n * dependency — otherwise the listener detaches and reattaches on each\r\n * render, and a keystroke could land between the two. */\r\n const ref = React.useRef(shortcuts);\r\n React.useEffect(() => {\r\n ref.current = shortcuts;\r\n }, [shortcuts]);\r\n\r\n React.useEffect(() => {\r\n if (!enabled || typeof window === \"undefined\") return undefined;\r\n\r\n const onKeyDown = (e: KeyboardEvent): void => {\r\n if (e.metaKey || e.ctrlKey || e.altKey) return;\r\n if (isBlockingTarget(document.activeElement)) return;\r\n if (isBlockingTarget(e.target)) return;\r\n if (isOverlayOpen()) return;\r\n\r\n for (const shortcut of ref.current) {\r\n if (shortcut.enabled === false) continue;\r\n if (!shortcut.keys.includes(e.key)) continue;\r\n e.preventDefault();\r\n shortcut.onTrigger(e.key);\r\n return;\r\n }\r\n };\r\n\r\n window.addEventListener(\"keydown\", onKeyDown);\r\n return () => window.removeEventListener(\"keydown\", onKeyDown);\r\n }, [enabled]);\r\n}\r\n\r\nexport default useKeyboardShortcuts;\r\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* usePrefersReducedMotion — Portnet UI v2
|
|
5
|
+
*
|
|
6
|
+
* `true` when the user has asked the system to reduce motion.
|
|
7
|
+
*
|
|
8
|
+
* const reduced = usePrefersReducedMotion();
|
|
9
|
+
* const options = { chart: { animation: !reduced } };
|
|
10
|
+
*
|
|
11
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
12
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-49)
|
|
13
|
+
*
|
|
14
|
+
* R-7.5 / R-Tg.2 MUST: `prefers-reduced-motion` is respected — animations
|
|
15
|
+
* ≤ 0.01 ms or none. The library already honours the rule everywhere IT owns
|
|
16
|
+
* the animation: `motion.ts` documents it, the base stylesheet carries the
|
|
17
|
+
* media query, `Skeleton` drops its shimmer (R-Sk.4).
|
|
18
|
+
*
|
|
19
|
+
* What was missing is the RUNTIME READ. A host that animates something the
|
|
20
|
+
* library does not own — a chart, a canvas, an imperative scroll, a
|
|
21
|
+
* third-party widget configured in JS — cannot reach the preference through
|
|
22
|
+
* CSS, because the decision is a JS value handed to another library. Every
|
|
23
|
+
* such host wrote the same helper, and every copy observed so far carried the
|
|
24
|
+
* SAME TWO DEFECTS:
|
|
25
|
+
*
|
|
26
|
+
* const prefersReducedMotion = (): boolean =>
|
|
27
|
+
* typeof window !== "undefined" &&
|
|
28
|
+
* typeof window.matchMedia === "function" &&
|
|
29
|
+
* window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
30
|
+
*
|
|
31
|
+
* 1. IT DOES NOT SUBSCRIBE. `matchMedia(...).matches` is read once, during a
|
|
32
|
+
* render that may never happen again. A user who turns the preference ON
|
|
33
|
+
* — which is exactly what someone does when motion starts to hurt — keeps
|
|
34
|
+
* the animations until something unrelated re-renders the screen. The
|
|
35
|
+
* rule is written in the present tense; a snapshot satisfies it by luck.
|
|
36
|
+
* 2. IT IS READ DURING RENDER, so the value is not part of React's state at
|
|
37
|
+
* all: two components on one page can disagree, and nothing reconciles
|
|
38
|
+
* them.
|
|
39
|
+
*
|
|
40
|
+
* `useSyncExternalStore` fixes both at once, and is the primitive React
|
|
41
|
+
* publishes for precisely this shape — an external, subscribable source of
|
|
42
|
+
* truth. It also supplies a correct server snapshot instead of a
|
|
43
|
+
* `typeof window` guard copied into every call site.
|
|
44
|
+
*
|
|
45
|
+
* Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 4 — détection
|
|
46
|
+
* d'infrastructure UI locale), où le helper ci-dessus existait en TROIS copies
|
|
47
|
+
* identiques, une par écran de bilan, chacune appelée depuis un `useMemo` ou
|
|
48
|
+
* depuis une fabrique d'options au niveau module.
|
|
49
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
50
|
+
*
|
|
51
|
+
* REDUCED MOTION IS NOT AN ACCESSIBILITY CERTIFICATE. A chart that stops
|
|
52
|
+
* animating is still a chart that owes a text equivalent (WCAG 1.1.1), and a
|
|
53
|
+
* transition under 200 ms still owes R-Mi.1 its justification.
|
|
54
|
+
*/
|
|
55
|
+
|
|
56
|
+
/** The media query, exported so a consumer can assert on it in a test. */
|
|
57
|
+
export const PREFERS_REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* `null` in any environment without `matchMedia` — server rendering, and the
|
|
61
|
+
* older jsdom versions where the method is simply absent. Callers treat that
|
|
62
|
+
* as "no stated preference", the same default the CSS media query has.
|
|
63
|
+
*/
|
|
64
|
+
function getMediaQueryList() {
|
|
65
|
+
if (typeof window === "undefined") return null;
|
|
66
|
+
if (typeof window.matchMedia !== "function") return null;
|
|
67
|
+
return window.matchMedia(PREFERS_REDUCED_MOTION_QUERY);
|
|
68
|
+
}
|
|
69
|
+
function subscribe(onStoreChange) {
|
|
70
|
+
const mql = getMediaQueryList();
|
|
71
|
+
if (mql === null) return () => undefined;
|
|
72
|
+
|
|
73
|
+
/* Safari 13 / iOS 12 ship `addListener` but not `addEventListener` on
|
|
74
|
+
* MediaQueryList. Both paths are kept: the browserslist floor is Safari 17,
|
|
75
|
+
* but this hook is also what a host reaches for inside a webview it does not
|
|
76
|
+
* choose, and the fallback costs two lines. */
|
|
77
|
+
if (typeof mql.addEventListener === "function") {
|
|
78
|
+
mql.addEventListener("change", onStoreChange);
|
|
79
|
+
return () => mql.removeEventListener("change", onStoreChange);
|
|
80
|
+
}
|
|
81
|
+
mql.addListener(onStoreChange);
|
|
82
|
+
return () => mql.removeListener(onStoreChange);
|
|
83
|
+
}
|
|
84
|
+
function getSnapshot() {
|
|
85
|
+
return getMediaQueryList()?.matches ?? false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Server snapshot — `false`, and NOT the client default in disguise: a server
|
|
90
|
+
* has no user preference to read, and hydration corrects the value before
|
|
91
|
+
* paint, so nothing animates against the user's wish.
|
|
92
|
+
*/
|
|
93
|
+
function getServerSnapshot() {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
export default function usePrefersReducedMotion() {
|
|
97
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=usePrefersReducedMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefersReducedMotion.js","names":["useSyncExternalStore","PREFERS_REDUCED_MOTION_QUERY","getMediaQueryList","window","matchMedia","subscribe","onStoreChange","mql","undefined","addEventListener","removeEventListener","addListener","removeListener","getSnapshot","matches","getServerSnapshot","usePrefersReducedMotion"],"sources":["../../../../src/lib/v2/hooks/usePrefersReducedMotion.ts"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\r\n\r\n/**\r\n * usePrefersReducedMotion — Portnet UI v2\r\n *\r\n * `true` when the user has asked the system to reduce motion.\r\n *\r\n * const reduced = usePrefersReducedMotion();\r\n * const options = { chart: { animation: !reduced } };\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-49)\r\n *\r\n * R-7.5 / R-Tg.2 MUST: `prefers-reduced-motion` is respected — animations\r\n * ≤ 0.01 ms or none. The library already honours the rule everywhere IT owns\r\n * the animation: `motion.ts` documents it, the base stylesheet carries the\r\n * media query, `Skeleton` drops its shimmer (R-Sk.4).\r\n *\r\n * What was missing is the RUNTIME READ. A host that animates something the\r\n * library does not own — a chart, a canvas, an imperative scroll, a\r\n * third-party widget configured in JS — cannot reach the preference through\r\n * CSS, because the decision is a JS value handed to another library. Every\r\n * such host wrote the same helper, and every copy observed so far carried the\r\n * SAME TWO DEFECTS:\r\n *\r\n * const prefersReducedMotion = (): boolean =>\r\n * typeof window !== \"undefined\" &&\r\n * typeof window.matchMedia === \"function\" &&\r\n * window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\r\n *\r\n * 1. IT DOES NOT SUBSCRIBE. `matchMedia(...).matches` is read once, during a\r\n * render that may never happen again. A user who turns the preference ON\r\n * — which is exactly what someone does when motion starts to hurt — keeps\r\n * the animations until something unrelated re-renders the screen. The\r\n * rule is written in the present tense; a snapshot satisfies it by luck.\r\n * 2. IT IS READ DURING RENDER, so the value is not part of React's state at\r\n * all: two components on one page can disagree, and nothing reconciles\r\n * them.\r\n *\r\n * `useSyncExternalStore` fixes both at once, and is the primitive React\r\n * publishes for precisely this shape — an external, subscribable source of\r\n * truth. It also supplies a correct server snapshot instead of a\r\n * `typeof window` guard copied into every call site.\r\n *\r\n * Relevé depuis `autorisation-admis-pour-conforme-fe` (Area 4 — détection\r\n * d'infrastructure UI locale), où le helper ci-dessus existait en TROIS copies\r\n * identiques, une par écran de bilan, chacune appelée depuis un `useMemo` ou\r\n * depuis une fabrique d'options au niveau module.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * REDUCED MOTION IS NOT AN ACCESSIBILITY CERTIFICATE. A chart that stops\r\n * animating is still a chart that owes a text equivalent (WCAG 1.1.1), and a\r\n * transition under 200 ms still owes R-Mi.1 its justification.\r\n */\r\n\r\n/** The media query, exported so a consumer can assert on it in a test. */\r\nexport const PREFERS_REDUCED_MOTION_QUERY = \"(prefers-reduced-motion: reduce)\";\r\n\r\n/**\r\n * `null` in any environment without `matchMedia` — server rendering, and the\r\n * older jsdom versions where the method is simply absent. Callers treat that\r\n * as \"no stated preference\", the same default the CSS media query has.\r\n */\r\nfunction getMediaQueryList(): MediaQueryList | null {\r\n if (typeof window === \"undefined\") return null;\r\n if (typeof window.matchMedia !== \"function\") return null;\r\n return window.matchMedia(PREFERS_REDUCED_MOTION_QUERY);\r\n}\r\n\r\nfunction subscribe(onStoreChange: () => void): () => void {\r\n const mql = getMediaQueryList();\r\n if (mql === null) return () => undefined;\r\n\r\n /* Safari 13 / iOS 12 ship `addListener` but not `addEventListener` on\r\n * MediaQueryList. Both paths are kept: the browserslist floor is Safari 17,\r\n * but this hook is also what a host reaches for inside a webview it does not\r\n * choose, and the fallback costs two lines. */\r\n if (typeof mql.addEventListener === \"function\") {\r\n mql.addEventListener(\"change\", onStoreChange);\r\n return () => mql.removeEventListener(\"change\", onStoreChange);\r\n }\r\n\r\n mql.addListener(onStoreChange);\r\n return () => mql.removeListener(onStoreChange);\r\n}\r\n\r\nfunction getSnapshot(): boolean {\r\n return getMediaQueryList()?.matches ?? false;\r\n}\r\n\r\n/**\r\n * Server snapshot — `false`, and NOT the client default in disguise: a server\r\n * has no user preference to read, and hydration corrects the value before\r\n * paint, so nothing animates against the user's wish.\r\n */\r\nfunction getServerSnapshot(): boolean {\r\n return false;\r\n}\r\n\r\nexport default function usePrefersReducedMotion(): boolean {\r\n return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\r\n}\r\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,OAAO;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,4BAA4B,GAAG,kCAAkC;;AAE9E;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAA,EAA0B;EAClD,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE,OAAO,IAAI;EAC9C,IAAI,OAAOA,MAAM,CAACC,UAAU,KAAK,UAAU,EAAE,OAAO,IAAI;EACxD,OAAOD,MAAM,CAACC,UAAU,CAACH,4BAA4B,CAAC;AACxD;AAEA,SAASI,SAASA,CAACC,aAAyB,EAAc;EACxD,MAAMC,GAAG,GAAGL,iBAAiB,CAAC,CAAC;EAC/B,IAAIK,GAAG,KAAK,IAAI,EAAE,OAAO,MAAMC,SAAS;;EAExC;AACF;AACA;AACA;EACE,IAAI,OAAOD,GAAG,CAACE,gBAAgB,KAAK,UAAU,EAAE;IAC9CF,GAAG,CAACE,gBAAgB,CAAC,QAAQ,EAAEH,aAAa,CAAC;IAC7C,OAAO,MAAMC,GAAG,CAACG,mBAAmB,CAAC,QAAQ,EAAEJ,aAAa,CAAC;EAC/D;EAEAC,GAAG,CAACI,WAAW,CAACL,aAAa,CAAC;EAC9B,OAAO,MAAMC,GAAG,CAACK,cAAc,CAACN,aAAa,CAAC;AAChD;AAEA,SAASO,WAAWA,CAAA,EAAY;EAC9B,OAAOX,iBAAiB,CAAC,CAAC,EAAEY,OAAO,IAAI,KAAK;AAC9C;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAAA,EAAY;EACpC,OAAO,KAAK;AACd;AAEA,eAAe,SAASC,uBAAuBA,CAAA,EAAY;EACzD,OAAOhB,oBAAoB,CAACK,SAAS,EAAEQ,WAAW,EAAEE,iBAAiB,CAAC;AACxE","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
1
|
import useDensity from "./useDensity";
|
|
8
2
|
|
|
9
3
|
/**
|
|
@@ -33,11 +27,9 @@ import useDensity from "./useDensity";
|
|
|
33
27
|
* <DataGrid density={effective} … />
|
|
34
28
|
*/
|
|
35
29
|
|
|
36
|
-
|
|
30
|
+
const VALID = new Set(["comfortable", "compact"]);
|
|
37
31
|
export default function useResolvedDensity(propValue) {
|
|
38
|
-
|
|
39
|
-
_useDensity2 = _slicedToArray(_useDensity, 1),
|
|
40
|
-
globalDensity = _useDensity2[0];
|
|
32
|
+
const [globalDensity] = useDensity();
|
|
41
33
|
if (propValue !== undefined && VALID.has(propValue)) return propValue;
|
|
42
34
|
return globalDensity;
|
|
43
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useResolvedDensity.js","names":["useDensity","VALID","Set","useResolvedDensity","propValue","
|
|
1
|
+
{"version":3,"file":"useResolvedDensity.js","names":["useDensity","VALID","Set","useResolvedDensity","propValue","globalDensity","undefined","has"],"sources":["../../../../src/lib/v2/hooks/useResolvedDensity.ts"],"sourcesContent":["import useDensity from \"./useDensity\";\r\n\r\n/**\r\n * useResolvedDensity — Portnet UI v2\r\n *\r\n * Returns the effective density for a component instance, applying\r\n * the standard resolution order used across the v2 surface:\r\n *\r\n * (1) explicit `propValue` from the caller (component prop)\r\n * (2) the global user preference from useDensity()\r\n * (3) fallback \"comfortable\"\r\n *\r\n * Use this in any component that wants to honour the user-level\r\n * density preference BY DEFAULT but still allow a caller to force\r\n * an override per instance — e.g. a picker dialog that always\r\n * wants \"compact\" regardless of the global preference, or a key\r\n * report that always wants \"comfortable\" for legibility.\r\n *\r\n * The hook always subscribes to useDensity() so the component\r\n * re-renders correctly when the user toggles the global density\r\n * (same tab via setter, other tab via storage event). The prop\r\n * simply wins on the resolved value when it's a valid density.\r\n *\r\n * Charter R-9.5 / R-DG.11.\r\n *\r\n * const effective = useResolvedDensity(props.density);\r\n * <DataGrid density={effective} … />\r\n */\r\n\r\ntype DensityPref = ReturnType<typeof useDensity>[0];\r\n\r\nconst VALID = new Set([\"comfortable\", \"compact\"]);\r\n\r\nexport default function useResolvedDensity(propValue?: DensityPref): DensityPref {\r\n const [globalDensity] = useDensity();\r\n if (propValue !== undefined && VALID.has(propValue)) return propValue;\r\n return globalDensity;\r\n}\r\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAEjD,eAAe,SAASC,kBAAkBA,CAACC,SAAuB,EAAe;EAC/E,MAAM,CAACC,aAAa,CAAC,GAAGL,UAAU,CAAC,CAAC;EACpC,IAAII,SAAS,KAAKE,SAAS,IAAIL,KAAK,CAACM,GAAG,CAACH,SAAS,CAAC,EAAE,OAAOA,SAAS;EACrE,OAAOC,aAAa;AACtB","ignoreList":[]}
|
|
@@ -23,10 +23,8 @@ import { applySort } from "../patterns/_sort";
|
|
|
23
23
|
* @returns A new sorted array (or the same reference when there's nothing to sort).
|
|
24
24
|
*/
|
|
25
25
|
export default function useSortedRows(rows, sort, locale) {
|
|
26
|
-
return useMemo(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
}, [rows, sort, locale]);
|
|
26
|
+
return useMemo(() => applySort(rows, sort, locale === undefined ? {} : {
|
|
27
|
+
locale
|
|
28
|
+
}), [rows, sort, locale]);
|
|
31
29
|
}
|
|
32
30
|
//# sourceMappingURL=useSortedRows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSortedRows.js","names":["useMemo","applySort","useSortedRows","rows","sort","locale","undefined"],"sources":["../../../../src/lib/v2/hooks/useSortedRows.ts"],"sourcesContent":["import { useMemo } from \"react\";\r\nimport { applySort } from \"../patterns/_sort\";\r\nimport type { SortDescriptor } from \"../types/common\";\r\n\r\n/**\r\n * useSortedRows — Portnet UI v2\r\n *\r\n * Memoised, locale-aware sort. Wraps `applySort` (Batch 12 / C1) with a\r\n * useMemo so consumers don't have to wire the dependency array themselves.\r\n *\r\n * const [sort, setSort] = useState<SortDescriptor[]>([{ key: \"date\", dir: \"desc\" }]);\r\n * const sortedRows = useSortedRows(rows, sort, \"fr-FR\");\r\n * <DataGrid rows={sortedRows} sort={sort} onSortChange={setSort} ... />\r\n *\r\n * Re-runs when:\r\n * - `rows` reference changes (host responsibility — pass a stable ref\r\n * when the data hasn't actually changed, otherwise the sort\r\n * runs every render).\r\n * - `sort` reference changes.\r\n * - `locale` value changes (string compare).\r\n *\r\n * For server-side sorting, skip this hook and pass already-sorted rows\r\n * straight to DataGrid.\r\n *\r\n * @returns A new sorted array (or the same reference when there's nothing to sort).\r\n */\r\nexport default function useSortedRows<T extends object>(\r\n rows: T[],\r\n sort: SortDescriptor[],\r\n locale?: string,\r\n): T[] {\r\n return useMemo(\r\n () => applySort(rows, sort, locale === undefined ? {} : { locale }),\r\n [rows, sort, locale],\r\n );\r\n}\r\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,SAAS,QAAQ,mBAAmB;AAG7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CACnCC,IAAS,EACTC,IAAsB,EACtBC,MAAe,EACV;EACL,OAAOL,OAAO,CACZ
|
|
1
|
+
{"version":3,"file":"useSortedRows.js","names":["useMemo","applySort","useSortedRows","rows","sort","locale","undefined"],"sources":["../../../../src/lib/v2/hooks/useSortedRows.ts"],"sourcesContent":["import { useMemo } from \"react\";\r\nimport { applySort } from \"../patterns/_sort\";\r\nimport type { SortDescriptor } from \"../types/common\";\r\n\r\n/**\r\n * useSortedRows — Portnet UI v2\r\n *\r\n * Memoised, locale-aware sort. Wraps `applySort` (Batch 12 / C1) with a\r\n * useMemo so consumers don't have to wire the dependency array themselves.\r\n *\r\n * const [sort, setSort] = useState<SortDescriptor[]>([{ key: \"date\", dir: \"desc\" }]);\r\n * const sortedRows = useSortedRows(rows, sort, \"fr-FR\");\r\n * <DataGrid rows={sortedRows} sort={sort} onSortChange={setSort} ... />\r\n *\r\n * Re-runs when:\r\n * - `rows` reference changes (host responsibility — pass a stable ref\r\n * when the data hasn't actually changed, otherwise the sort\r\n * runs every render).\r\n * - `sort` reference changes.\r\n * - `locale` value changes (string compare).\r\n *\r\n * For server-side sorting, skip this hook and pass already-sorted rows\r\n * straight to DataGrid.\r\n *\r\n * @returns A new sorted array (or the same reference when there's nothing to sort).\r\n */\r\nexport default function useSortedRows<T extends object>(\r\n rows: T[],\r\n sort: SortDescriptor[],\r\n locale?: string,\r\n): T[] {\r\n return useMemo(\r\n () => applySort(rows, sort, locale === undefined ? {} : { locale }),\r\n [rows, sort, locale],\r\n );\r\n}\r\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,SAAS,QAAQ,mBAAmB;AAG7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CACnCC,IAAS,EACTC,IAAsB,EACtBC,MAAe,EACV;EACL,OAAOL,OAAO,CACZ,MAAMC,SAAS,CAACE,IAAI,EAAEC,IAAI,EAAEC,MAAM,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAED;EAAO,CAAC,CAAC,EACnE,CAACF,IAAI,EAAEC,IAAI,EAAEC,MAAM,CACrB,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
1
|
import { useState, useEffect } from "react";
|
|
8
2
|
|
|
9
3
|
/**
|
|
@@ -11,7 +5,7 @@ import { useState, useEffect } from "react";
|
|
|
11
5
|
* skeleton would only flicker into view; above it, the user
|
|
12
6
|
* perceives a stall and benefits from the visual cue.
|
|
13
7
|
*/
|
|
14
|
-
export
|
|
8
|
+
export const PERCEPTION_THRESHOLD_MS = 200;
|
|
15
9
|
|
|
16
10
|
/**
|
|
17
11
|
* useTabLoading — Portnet UI v2
|
|
@@ -44,14 +38,9 @@ export var PERCEPTION_THRESHOLD_MS = 200;
|
|
|
44
38
|
* }, [tab]);
|
|
45
39
|
* const showSkeleton = useTabLoading(tab, PERCEPTION_THRESHOLD_MS, fetching);
|
|
46
40
|
*/
|
|
47
|
-
export default function useTabLoading(tab) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var _useState = useState(false),
|
|
51
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
52
|
-
loading = _useState2[0],
|
|
53
|
-
setLoading = _useState2[1];
|
|
54
|
-
useEffect(function () {
|
|
41
|
+
export default function useTabLoading(tab, ms = PERCEPTION_THRESHOLD_MS, enabled = false) {
|
|
42
|
+
const [loading, setLoading] = useState(false);
|
|
43
|
+
useEffect(() => {
|
|
55
44
|
if (!enabled) {
|
|
56
45
|
// Fetch finished (or never started) — drop any in-flight skeleton.
|
|
57
46
|
setLoading(false);
|
|
@@ -60,9 +49,7 @@ export default function useTabLoading(tab) {
|
|
|
60
49
|
// R-Sk.1 — DELAY showing the skeleton until the perception threshold.
|
|
61
50
|
// If the fetch resolves before then, cleanup clears the timer and
|
|
62
51
|
// the skeleton never flickers in.
|
|
63
|
-
|
|
64
|
-
return setLoading(true);
|
|
65
|
-
}, ms);
|
|
52
|
+
const t = setTimeout(() => setLoading(true), ms);
|
|
66
53
|
|
|
67
54
|
// CRITICAL: cleanup ONLY clears the pending timer. We do NOT reset
|
|
68
55
|
// `loading` to false here, otherwise tab changes while still
|
|
@@ -70,9 +57,7 @@ export default function useTabLoading(tab) {
|
|
|
70
57
|
// 200 ms blank flicker between skeletons. The reset path is the
|
|
71
58
|
// `!enabled` branch above, which fires precisely when loading
|
|
72
59
|
// actually ends.
|
|
73
|
-
return
|
|
74
|
-
return clearTimeout(t);
|
|
75
|
-
};
|
|
60
|
+
return () => clearTimeout(t);
|
|
76
61
|
}, [tab, ms, enabled]);
|
|
77
62
|
return loading;
|
|
78
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTabLoading.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useTabLoading","tab","ms","
|
|
1
|
+
{"version":3,"file":"useTabLoading.js","names":["useState","useEffect","PERCEPTION_THRESHOLD_MS","useTabLoading","tab","ms","enabled","loading","setLoading","undefined","t","setTimeout","clearTimeout"],"sources":["../../../../src/lib/v2/hooks/useTabLoading.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\n\r\n/**\r\n * Charter R-Sk.1 — \"perception threshold\". Below this delay, a\r\n * skeleton would only flicker into view; above it, the user\r\n * perceives a stall and benefits from the visual cue.\r\n */\r\nexport const PERCEPTION_THRESHOLD_MS = 200;\r\n\r\n/**\r\n * useTabLoading — Portnet UI v2\r\n *\r\n * Skeleton-display gate that respects the 200 ms perception threshold.\r\n *\r\n * Charter R-Sk.1 — \"Skeleton displayed if loading > 200 ms; otherwise\r\n * nothing (perception)\". For fetches faster than 200 ms, this hook\r\n * never returns true — the user sees the data land directly with no\r\n * flicker. For fetches slower than 200 ms, the skeleton appears at\r\n * the threshold and stays until the fetch completes.\r\n *\r\n * Caller contract\r\n * - Drive `enabled` from your real loading state (true while a\r\n * fetch is in flight, false otherwise).\r\n * - The hook returns true ONLY when `enabled` has been true for\r\n * at least `ms` ms, and is reset to false the moment `enabled`\r\n * flips back to false.\r\n * - On tab change while still loading, the previous timer is\r\n * cancelled and a fresh one scheduled — but the existing\r\n * skeleton-visible state is PRESERVED (loading stays true if\r\n * it was already true). Without this, fast tab swapping\r\n * produced 200 ms blank flickers between consecutive skeletons.\r\n *\r\n * Example\r\n * const [fetching, setFetching] = useState(false);\r\n * useEffect(() => {\r\n * setFetching(true);\r\n * fetchTabData(tab).finally(() => setFetching(false));\r\n * }, [tab]);\r\n * const showSkeleton = useTabLoading(tab, PERCEPTION_THRESHOLD_MS, fetching);\r\n */\r\nexport default function useTabLoading(\r\n tab: string | number,\r\n ms: number = PERCEPTION_THRESHOLD_MS,\r\n enabled: boolean = false\r\n): boolean {\r\n const [loading, setLoading] = useState(false);\r\n\r\n useEffect(() => {\r\n if (!enabled) {\r\n // Fetch finished (or never started) — drop any in-flight skeleton.\r\n setLoading(false);\r\n return undefined;\r\n }\r\n // R-Sk.1 — DELAY showing the skeleton until the perception threshold.\r\n // If the fetch resolves before then, cleanup clears the timer and\r\n // the skeleton never flickers in.\r\n const t = setTimeout(() => setLoading(true), ms);\r\n\r\n // CRITICAL: cleanup ONLY clears the pending timer. We do NOT reset\r\n // `loading` to false here, otherwise tab changes while still\r\n // fetching (both old and new tab loading) produced a visible\r\n // 200 ms blank flicker between skeletons. The reset path is the\r\n // `!enabled` branch above, which fires precisely when loading\r\n // actually ends.\r\n return () => clearTimeout(t);\r\n }, [tab, ms, enabled]);\r\n\r\n return loading;\r\n}\r\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,QAAQ,OAAO;;AAE3C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,GAAG;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAaA,CACnCC,GAAoB,EACpBC,EAAU,GAAGH,uBAAuB,EACpCI,OAAgB,GAAG,KAAK,EACf;EACT,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGR,QAAQ,CAAC,KAAK,CAAC;EAE7CC,SAAS,CAAC,MAAM;IACd,IAAI,CAACK,OAAO,EAAE;MACZ;MACAE,UAAU,CAAC,KAAK,CAAC;MACjB,OAAOC,SAAS;IAClB;IACA;IACA;IACA;IACA,MAAMC,CAAC,GAAGC,UAAU,CAAC,MAAMH,UAAU,CAAC,IAAI,CAAC,EAAEH,EAAE,CAAC;;IAEhD;IACA;IACA;IACA;IACA;IACA;IACA,OAAO,MAAMO,YAAY,CAACF,CAAC,CAAC;EAC9B,CAAC,EAAE,CAACN,GAAG,EAAEC,EAAE,EAAEC,OAAO,CAAC,CAAC;EAEtB,OAAOC,OAAO;AAChB","ignoreList":[]}
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
* via babel-plugin-transform-define) to remove the manual-sync
|
|
15
15
|
* footgun. Tracked as Batch 7 P3 follow-up (R19 migration backlog).
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
export { _tokens as tokens };
|
|
17
|
+
export const VERSION = "0.8.0-react19.1";
|
|
18
|
+
export * as tokens from "./tokens";
|
|
20
19
|
export { createPortnetTheme, getCssVariables, injectCssVariables, removeCssVariables } from "./theme";
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -49,7 +48,18 @@ export { Spinner, Button, Field, Input, Select, Textarea, Checkbox, CheckboxGrou
|
|
|
49
48
|
* Additive and type-only: no runtime change, no existing export altered.
|
|
50
49
|
*/
|
|
51
50
|
|
|
52
|
-
export { ActionBar, BulkActionBar, ColumnsToggle, FormSection, FormPageShell, FormErrorSummary, PageContent, DataGrid, DataGridVirtualized, DataGridSettingsMenu, DataGridToolbar, CollapsibleDataGrid, SortableHeader, NetworkErrorBanner, ReferentielField, Tour, KeyboardShortcutsHelp, DeleteResourceConfirmDialog, SaveFilterDialog, SavedFiltersMenu, makeFavoriteColumn, FavoritesFilter, applySort, getAriaSort, FormikInput, FormikTextarea, FormikSelect, FormikCombobox, FormikDatePicker, FormikFile, FormikCheckboxGroup,
|
|
51
|
+
export { ActionBar, BulkActionBar, ColumnsToggle, FormSection, FormPageShell, FormErrorSummary, PageContent, DataGrid, DataGridVirtualized, DataGridSettingsMenu, DataGridToolbar, CollapsibleDataGrid, SortableHeader, NetworkErrorBanner, ReferentielField, Tour, KeyboardShortcutsHelp, DeleteResourceConfirmDialog, SaveFilterDialog, SavedFiltersMenu, makeFavoriteColumn, FavoritesFilter, applySort, getAriaSort, FormikInput, FormikTextarea, FormikSelect, FormikCombobox, FormikDatePicker, FormikFile, FormikCheckboxGroup,
|
|
52
|
+
/* G-A, G-C et G-E — `FormikCheckbox`, `FormikRadioGroup` et
|
|
53
|
+
* `FormikDateTimePicker` sont volontairement ABSENTS de cette surface, per
|
|
54
|
+
* la POLICY en bas de `src/lib/index.ts` : ce qui est ajoute apres la
|
|
55
|
+
* deprecation de `@portnet/ui/v2` n'est surface QUE sur la racine plate.
|
|
56
|
+
* Ils y sont atteignables sans rien ajouter ici, `./v2/patterns` etant
|
|
57
|
+
* re-exporte en `export *` depuis `src/lib/index.ts`.
|
|
58
|
+
*
|
|
59
|
+
* Les trois avaient d'abord ete ajoutes ici par erreur, faute d'avoir lu la
|
|
60
|
+
* politique. Le retrait remet la racine plate en sur-ensemble strict de
|
|
61
|
+
* cette surface, ce que le corollaire G-34 de la meme note exige. */
|
|
62
|
+
FormikReferentielField, /** Valeurs système non-éditables — fond grisé, pas d'interaction */
|
|
53
63
|
FormikDisplay } from "./patterns";
|
|
54
64
|
|
|
55
65
|
/**
|