@portnet/ui 6.0.2 → 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 +652 -0
- package/dist/esm/index.js +72 -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 -38
- 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 +11 -11
- package/dist/esm/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FileCard.test.js +18 -17
- package/dist/esm/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js +87 -179
- package/dist/esm/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js +32 -44
- package/dist/esm/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- 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 +118 -199
- package/dist/esm/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/esm/v2/__tests__/MobileRowCard.test.js +44 -42
- 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 -21
- 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 +81 -86
- 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 +155 -59
- 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 +37 -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 +2 -3
- 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 +15 -17
- 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 +29 -39
- package/dist/esm/v2/patterns/FormikCheckbox.js.map +1 -1
- 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 -69
- package/dist/esm/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDatePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/esm/v2/patterns/FormikDateTimePicker.js +44 -58
- package/dist/esm/v2/patterns/FormikDateTimePicker.js.map +1 -1
- 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 -53
- package/dist/esm/v2/patterns/FormikInput.js.map +1 -1
- package/dist/esm/v2/patterns/FormikRadioGroup.js +39 -51
- package/dist/esm/v2/patterns/FormikRadioGroup.js.map +1 -1
- 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 -87
- package/dist/esm/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/esm/v2/patterns/FormikTextarea.js +30 -46
- package/dist/esm/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/esm/v2/patterns/KeyboardShortcutsHelp.js +53 -71
- 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 +27 -22
- package/dist/esm/v2/patterns/RowFavoriteToggle.js.map +1 -1
- 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 +6 -8
- package/dist/esm/v2/patterns/_pickerSerialisation.js.map +1 -1
- 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 +152 -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 +28 -34
- package/dist/esm/v2/personalization/capabilities/gridPreferences.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 +17 -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 +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +110 -49
- 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 +82 -49
- 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 +23 -25
- package/dist/v2/__tests__/FieldWidth.test.js.map +1 -1
- package/dist/v2/__tests__/FileCard.test.js +29 -28
- package/dist/v2/__tests__/FileCard.test.js.map +1 -1
- package/dist/v2/__tests__/FormikCheckbox.test.js +90 -183
- package/dist/v2/__tests__/FormikCheckbox.test.js.map +1 -1
- package/dist/v2/__tests__/FormikDateTimePicker.test.js +38 -48
- package/dist/v2/__tests__/FormikDateTimePicker.test.js.map +1 -1
- 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 +123 -204
- package/dist/v2/__tests__/FormikRadioGroup.test.js.map +1 -1
- package/dist/v2/__tests__/MobileRowCard.test.js +63 -61
- 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 +23 -27
- 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.js +84 -91
- 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 +62 -4
- package/dist/v2/components/Field.d.ts.map +1 -1
- package/dist/v2/components/Field.js +169 -70
- 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 +40 -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.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.js +22 -23
- 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.js +36 -45
- package/dist/v2/patterns/FormikCheckbox.js.map +1 -1
- 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.js +55 -72
- package/dist/v2/patterns/FormikCombobox.js.map +1 -1
- package/dist/v2/patterns/FormikDatePicker.js +50 -64
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -1
- package/dist/v2/patterns/FormikDateTimePicker.js +50 -64
- package/dist/v2/patterns/FormikDateTimePicker.js.map +1 -1
- 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.js +45 -58
- package/dist/v2/patterns/FormikInput.js.map +1 -1
- package/dist/v2/patterns/FormikRadioGroup.js +45 -56
- package/dist/v2/patterns/FormikRadioGroup.js.map +1 -1
- 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.js +70 -92
- package/dist/v2/patterns/FormikSelect.js.map +1 -1
- package/dist/v2/patterns/FormikTextarea.js +35 -51
- package/dist/v2/patterns/FormikTextarea.js.map +1 -1
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +60 -80
- 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 +6 -0
- package/dist/v2/patterns/RowFavoriteToggle.d.ts.map +1 -1
- package/dist/v2/patterns/RowFavoriteToggle.js +38 -30
- package/dist/v2/patterns/RowFavoriteToggle.js.map +1 -1
- 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.js +9 -10
- package/dist/v2/patterns/_pickerSerialisation.js.map +1 -1
- 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 +160 -0
- package/dist/v2/patterns/index.d.ts.map +1 -1
- package/dist/v2/patterns/index.js +157 -79
- 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.js +31 -36
- package/dist/v2/personalization/capabilities/gridPreferences.js.map +1 -1
- package/dist/v2/personalization/capabilities/index.js +12 -12
- 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 +16 -0
- package/dist/v2/personalization/index.d.ts.map +1 -1
- package/dist/v2/personalization/index.js +30 -23
- 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
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.BREAKPOINT_KEYS = void 0;
|
|
7
7
|
exports.bpValue = bpValue;
|
|
8
|
-
exports.mq = exports
|
|
8
|
+
exports.mq = exports.default = exports.breakpoints = void 0;
|
|
9
9
|
/**
|
|
10
10
|
* Breakpoint tokens — Portnet UI v2
|
|
11
11
|
* Aligned with Design System v1.0 §07 (Responsive) + R-RS.1.
|
|
@@ -44,7 +44,7 @@ exports.mq = exports["default"] = exports.breakpoints = void 0;
|
|
|
44
44
|
*/
|
|
45
45
|
|
|
46
46
|
/* Ascending, mobile-first. xs = 0 is the base band (phones 320-480). */
|
|
47
|
-
|
|
47
|
+
const breakpoints = exports.breakpoints = Object.freeze({
|
|
48
48
|
xs: 0,
|
|
49
49
|
sm: 481,
|
|
50
50
|
md: 768,
|
|
@@ -57,12 +57,12 @@ var breakpoints = exports.breakpoints = Object.freeze({
|
|
|
57
57
|
|
|
58
58
|
/* Ordered key list — the canonical iteration order for any mobile-first
|
|
59
59
|
* cascade (base -> up). Re-used by Layout.js so the order can't drift. */
|
|
60
|
-
|
|
60
|
+
const BREAKPOINT_KEYS = exports.BREAKPOINT_KEYS = Object.freeze(["xs", "sm", "md", "lg", "xl"]);
|
|
61
61
|
|
|
62
62
|
/* MUI parity: down()/between() subtract this from the upper bound so a
|
|
63
63
|
* `down(key)` query and the matching `up(key)` query never overlap at
|
|
64
64
|
* the exact pixel. Mirrors MUI's default step (5/100 = 0.05px). */
|
|
65
|
-
|
|
65
|
+
const STEP = 0.05;
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Resolve a key to its numeric min-width, falling back to 0 for an
|
|
@@ -70,13 +70,13 @@ var STEP = 0.05;
|
|
|
70
70
|
* emitting a NaN width (which silently disables the whole query).
|
|
71
71
|
*/
|
|
72
72
|
function bpValue(key) {
|
|
73
|
-
|
|
73
|
+
const v = breakpoints[key];
|
|
74
74
|
return typeof v === "number" ? v : 0;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
/* Next key up the scale, or null when `key` is the largest. */
|
|
78
78
|
function nextKey(key) {
|
|
79
|
-
|
|
79
|
+
const i = BREAKPOINT_KEYS.indexOf(key);
|
|
80
80
|
return i >= 0 && i < BREAKPOINT_KEYS.length - 1 ? BREAKPOINT_KEYS[i + 1] : null;
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -95,20 +95,20 @@ function nextKey(key) {
|
|
|
95
95
|
* Usage (sx object key):
|
|
96
96
|
* sx={{ [mq.up("md")]: { flexDirection: "row" } }}
|
|
97
97
|
*/
|
|
98
|
-
|
|
99
|
-
up
|
|
100
|
-
return
|
|
98
|
+
const mq = exports.mq = Object.freeze({
|
|
99
|
+
up(key) {
|
|
100
|
+
return `@media (min-width:${bpValue(key)}px)`;
|
|
101
101
|
},
|
|
102
|
-
down
|
|
103
|
-
return
|
|
102
|
+
down(key) {
|
|
103
|
+
return `@media (max-width:${bpValue(key) - STEP}px)`;
|
|
104
104
|
},
|
|
105
|
-
between
|
|
106
|
-
return
|
|
105
|
+
between(start, end) {
|
|
106
|
+
return `@media (min-width:${bpValue(start)}px) and (max-width:${bpValue(end) - STEP}px)`;
|
|
107
107
|
},
|
|
108
|
-
only
|
|
109
|
-
|
|
108
|
+
only(key) {
|
|
109
|
+
const next = nextKey(key);
|
|
110
110
|
return next ? mq.between(key, next) : mq.up(key);
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
var _default = exports
|
|
113
|
+
var _default = exports.default = breakpoints;
|
|
114
114
|
//# sourceMappingURL=breakpoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoints.js","names":["breakpoints","exports","Object","freeze","xs","sm","md","lg","xl","BREAKPOINT_KEYS","STEP","bpValue","key","v","nextKey","i","indexOf","length","mq","up","
|
|
1
|
+
{"version":3,"file":"breakpoints.js","names":["breakpoints","exports","Object","freeze","xs","sm","md","lg","xl","BREAKPOINT_KEYS","STEP","bpValue","key","v","nextKey","i","indexOf","length","mq","up","down","between","start","end","only","next","_default","default"],"sources":["../../../src/lib/v2/tokens/breakpoints.ts"],"sourcesContent":["/**\r\n * Breakpoint tokens — Portnet UI v2\r\n * Aligned with Design System v1.0 §07 (Responsive) + R-RS.1.\r\n *\r\n * SINGLE SOURCE OF TRUTH for the responsive breakpoint scale.\r\n * Previously these lived inside tokens/density.js, conflating two\r\n * unrelated concerns (row/control density vs. viewport breakpoints).\r\n * They now live here; density.js re-exports `breakpoints` so every\r\n * existing `import { breakpoints } from \"@portnet/ui/v2/tokens\"`\r\n * (and the `densityLayout` shape) keeps working unchanged.\r\n *\r\n * Two layers consume this scale and MUST stay in lockstep:\r\n * 1. The MUI theme — createPortnetTheme wires `breakpoints` into\r\n * createTheme's `breakpoints.values`, so `theme.breakpoints.up()`\r\n * and every `sx={{ prop: { xs, md } }}` on a MUI component resolve\r\n * against THESE values.\r\n * 2. The CSS layer — the `mq` helpers below emit the SAME media\r\n * queries as strings, for:\r\n * - the theme-free v2 Box/Stack responsive sx engine (Layout.js),\r\n * - raw `.css` / container styles,\r\n * - any `sx={{ [mq.up(\"md\")]: {...} }}`,\r\n * and the `--bp-*` CSS variables emitted by cssVariables.js for\r\n * pure-CSS / container-query consumers.\r\n *\r\n * IMPORTANT — keep `breakpoints` a PURE value map ({ key: number }).\r\n * MUI's createTheme iterates `breakpoints.values` to build its own\r\n * up/down/between; a non-numeric key (e.g. a helper function) would be\r\n * mis-read as a breakpoint named \"up\". Helpers therefore live on the\r\n * SEPARATE `mq` export, never on `breakpoints` itself.\r\n *\r\n * Charter viewport targets covered:\r\n * - xs band : 320 / 360 / 375 / 390 / 414 (phones, base, no query)\r\n * - md : 768 / 820 (tablet)\r\n * - lg : 1024 (small desktop / landscape tablet)\r\n * - xl band : 1280 / 1440 / 1920 (desktop)\r\n */\r\n\r\n/* Ascending, mobile-first. xs = 0 is the base band (phones 320-480). */\r\nexport const breakpoints = Object.freeze({\r\n xs: 0,\r\n sm: 481,\r\n md: 768,\r\n lg: 1024,\r\n xl: 1280,\r\n});\r\n\r\n/* Local key type — canonical union of breakpoint keys. Not exported;\r\n * the public token surface is unchanged. */\r\ntype BreakpointKey = keyof typeof breakpoints;\r\n\r\n/* Ordered key list — the canonical iteration order for any mobile-first\r\n * cascade (base -> up). Re-used by Layout.js so the order can't drift. */\r\nexport const BREAKPOINT_KEYS = Object.freeze([\"xs\", \"sm\", \"md\", \"lg\", \"xl\"] as const);\r\n\r\n/* MUI parity: down()/between() subtract this from the upper bound so a\r\n * `down(key)` query and the matching `up(key)` query never overlap at\r\n * the exact pixel. Mirrors MUI's default step (5/100 = 0.05px). */\r\nconst STEP = 0.05;\r\n\r\n/**\r\n * Resolve a key to its numeric min-width, falling back to 0 for an\r\n * unknown key so a typo degrades to \"always matches\" rather than\r\n * emitting a NaN width (which silently disables the whole query).\r\n */\r\nexport function bpValue(key: BreakpointKey): number {\r\n const v = breakpoints[key];\r\n return typeof v === \"number\" ? v : 0;\r\n}\r\n\r\n/* Next key up the scale, or null when `key` is the largest. */\r\nfunction nextKey(key: BreakpointKey) {\r\n const i = BREAKPOINT_KEYS.indexOf(key);\r\n return i >= 0 && i < BREAKPOINT_KEYS.length - 1\r\n ? BREAKPOINT_KEYS[i + 1]\r\n : null;\r\n}\r\n\r\n/**\r\n * Token-derived media-query string helpers. Output is identical in\r\n * intent to MUI's `theme.breakpoints.*` so the CSS layer and the\r\n * JS/MUI layer can never diverge.\r\n *\r\n * mq.up(\"md\") -> \"@media (min-width:<md>px)\"\r\n * mq.down(\"md\") -> \"@media (max-width:<md - 0.05>px)\"\r\n * mq.between(\"sm\",\"lg\") -> \"@media (min-width:<sm>px) and (max-width:<lg - 0.05>px)\"\r\n * mq.only(\"md\") -> mq.between(\"md\",\"lg\")\r\n *\r\n * Usage (theme-free CSS layer / raw stylesheet):\r\n * `${mq.up(\"md\")}{ .x{ gap:24px } }`\r\n * Usage (sx object key):\r\n * sx={{ [mq.up(\"md\")]: { flexDirection: \"row\" } }}\r\n */\r\nexport const mq = Object.freeze({\r\n up(key: BreakpointKey): string {\r\n return `@media (min-width:${bpValue(key)}px)`;\r\n },\r\n down(key: BreakpointKey): string {\r\n return `@media (max-width:${bpValue(key) - STEP}px)`;\r\n },\r\n between(start: BreakpointKey, end: BreakpointKey): string {\r\n return `@media (min-width:${bpValue(start)}px) and (max-width:${bpValue(end) - STEP}px)`;\r\n },\r\n only(key: BreakpointKey): string {\r\n const next = nextKey(key);\r\n return next ? mq.between(key, next) : mq.up(key);\r\n },\r\n});\r\n\r\nexport default breakpoints;\r\n"],"mappings":";;;;;;;;AAAA;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;AACO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,MAAM,CAACC,MAAM,CAAC;EACvCC,EAAE,EAAK,CAAC;EACRC,EAAE,EAAG,GAAG;EACRC,EAAE,EAAG,GAAG;EACRC,EAAE,EAAE,IAAI;EACRC,EAAE,EAAE;AACN,CAAC,CAAC;;AAEF;AACA;;AAGA;AACA;AACO,MAAMC,eAAe,GAAAR,OAAA,CAAAQ,eAAA,GAAGP,MAAM,CAACC,MAAM,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;;AAErF;AACA;AACA;AACA,MAAMO,IAAI,GAAG,IAAI;;AAEjB;AACA;AACA;AACA;AACA;AACO,SAASC,OAAOA,CAACC,GAAkB,EAAU;EAClD,MAAMC,CAAC,GAAGb,WAAW,CAACY,GAAG,CAAC;EAC1B,OAAO,OAAOC,CAAC,KAAK,QAAQ,GAAGA,CAAC,GAAG,CAAC;AACtC;;AAEA;AACA,SAASC,OAAOA,CAACF,GAAkB,EAAE;EACnC,MAAMG,CAAC,GAAGN,eAAe,CAACO,OAAO,CAACJ,GAAG,CAAC;EACtC,OAAOG,CAAC,IAAI,CAAC,IAAIA,CAAC,GAAGN,eAAe,CAACQ,MAAM,GAAG,CAAC,GAC3CR,eAAe,CAACM,CAAC,GAAG,CAAC,CAAC,GACtB,IAAI;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,EAAE,GAAAjB,OAAA,CAAAiB,EAAA,GAAGhB,MAAM,CAACC,MAAM,CAAC;EAC9BgB,EAAEA,CAACP,GAAkB,EAAU;IAC7B,OAAO,qBAAqBD,OAAO,CAACC,GAAG,CAAC,KAAK;EAC/C,CAAC;EACDQ,IAAIA,CAACR,GAAkB,EAAU;IAC/B,OAAO,qBAAqBD,OAAO,CAACC,GAAG,CAAC,GAAGF,IAAI,KAAK;EACtD,CAAC;EACDW,OAAOA,CAACC,KAAoB,EAAEC,GAAkB,EAAU;IACxD,OAAO,qBAAqBZ,OAAO,CAACW,KAAK,CAAC,sBAAsBX,OAAO,CAACY,GAAG,CAAC,GAAGb,IAAI,KAAK;EAC1F,CAAC;EACDc,IAAIA,CAACZ,GAAkB,EAAU;IAC/B,MAAMa,IAAI,GAAGX,OAAO,CAACF,GAAG,CAAC;IACzB,OAAOa,IAAI,GAAGP,EAAE,CAACG,OAAO,CAACT,GAAG,EAAEa,IAAI,CAAC,GAAGP,EAAE,CAACC,EAAE,CAACP,GAAG,CAAC;EAClD;AACF,CAAC,CAAC;AAAC,IAAAc,QAAA,GAAAzB,OAAA,CAAA0B,OAAA,GAEY3B,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The palette, in display order. Entries 1-8 (indices 0-7) are the
|
|
3
|
+
* hue-balanced, CVD-verified core; 9-12 extend it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const chartCategorical: readonly ["#C92E1D", "#A89318", "#3B7911", "#18A84B", "#127681", "#7A8CEC", "#9B30E1", "#E860B8", "#119870", "#B915B0", "#9A0DF9", "#965848"];
|
|
6
|
+
/** Size of the hue-balanced core. Beyond it, separation is still verified but the sequence stops being evenly spaced. */
|
|
7
|
+
export declare const CHART_CATEGORICAL_CORE = 8;
|
|
8
|
+
/**
|
|
9
|
+
* Colour for the n-th category, cycling past the end of the palette.
|
|
10
|
+
*
|
|
11
|
+
* Non-finite or negative indices resolve to the first entry rather than
|
|
12
|
+
* throwing: a chart is a read-only view, and a bad index should not blank a
|
|
13
|
+
* page. In development an out-of-range index also warns, because CYCLING IS
|
|
14
|
+
* SILENT — two slices sharing a colour looks like a design choice, not like the
|
|
15
|
+
* data-loss it is.
|
|
16
|
+
*/
|
|
17
|
+
export declare function chartColor(index: number): string;
|
|
18
|
+
/** Label colours, index-aligned with `chartCategorical`. */
|
|
19
|
+
export declare const chartCategoricalOn: readonly string[];
|
|
20
|
+
/** AA-safe colour for text drawn on top of `chartColor(index)`. Cycles identically. */
|
|
21
|
+
export declare function chartColorOn(index: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Non-data chart furniture — title, labels, canvas (capability gap G-54).
|
|
24
|
+
*
|
|
25
|
+
* ────────────────────────────────────────────────────────────────────────────────
|
|
26
|
+
* THIS IS A ROLE→TOKEN MAPPING, NOT A STORE OF VALUES, and the distinction is
|
|
27
|
+
* the justification. Every value below already exists in this library, and a
|
|
28
|
+
* module reading `ink.fgMuted` for its axis labels is already compliant with
|
|
29
|
+
* R-2.3. What no module can get right alone is WHICH token plays WHICH role:
|
|
30
|
+
* is a chart title an `h2` or an `h3`? are axis labels `xs` or `sm`? is the
|
|
31
|
+
* canvas `surface` or transparent?
|
|
32
|
+
*
|
|
33
|
+
* Left unanswered, each screen answers it again. Observed in
|
|
34
|
+
* `autorisation-admis-pour-conforme-fe` (Area 5): three bilan screens, five
|
|
35
|
+
* chart definitions, the same five-line block of title / label / canvas styling
|
|
36
|
+
* copied into each — agreeing only because they were copied from one another.
|
|
37
|
+
* The next module starts from a blank chart and picks `h2`, and nothing in code
|
|
38
|
+
* review can call that wrong, because the platform never said.
|
|
39
|
+
*
|
|
40
|
+
* So this is the answer, once: a chart title reads as a card title (`h3`,
|
|
41
|
+
* semibold, full-strength ink), its labels as hints (`xs`, muted ink), and its
|
|
42
|
+
* canvas is TRANSPARENT — the chart sits on whatever `Surface` holds it, and a
|
|
43
|
+
* hard-coded white canvas is exactly what breaks a chart in dark mode.
|
|
44
|
+
* ────────────────────────────────────────────────────────────────────────────────
|
|
45
|
+
*
|
|
46
|
+
* LIBRARY-AGNOSTIC BY CONSTRUCTION. Plain strings, no chart library imported,
|
|
47
|
+
* no option shape assumed: Highcharts, Recharts, Chart.js and a hand-written
|
|
48
|
+
* SVG all take these. A consumer maps them to its renderer's option names,
|
|
49
|
+
* which is a binding — and a binding holding no design values is not a
|
|
50
|
+
* duplication of this.
|
|
51
|
+
*
|
|
52
|
+
* FONT SIZES ARE STRINGS WITH UNITS, unlike `fontSize.*`, which are integers.
|
|
53
|
+
* Chart libraries pass their style objects to SVG attributes rather than to
|
|
54
|
+
* React's style prop, so they never get a unit appended for free — a bare `16`
|
|
55
|
+
* is silently ignored by some renderers and read as `16px` by others.
|
|
56
|
+
*
|
|
57
|
+
* WHAT THIS DOES NOT MAKE ACCESSIBLE. Nothing here supplies the text
|
|
58
|
+
* equivalent WCAG 1.1.1 requires of a chart, or the non-colour channel of
|
|
59
|
+
* 1.4.1. See the `ChartFigure` pattern, which carries the caption, and the note
|
|
60
|
+
* at the head of this file.
|
|
61
|
+
*/
|
|
62
|
+
export declare const chartChrome: Readonly<{
|
|
63
|
+
/** Canvas fill. Transparent so the holding `Surface` shows through, light or dark. */
|
|
64
|
+
background: "transparent";
|
|
65
|
+
/** One family for every text in the chart — §02.2 UI stack. */
|
|
66
|
+
fontFamily: string;
|
|
67
|
+
/** Chart title: reads as a card title (§02.2 `h3`). */
|
|
68
|
+
title: Readonly<{
|
|
69
|
+
color: string;
|
|
70
|
+
fontSize: `${number}px`;
|
|
71
|
+
fontWeight: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** Axis labels, legend items, data labels drawn OUTSIDE a slice: hints. */
|
|
74
|
+
label: Readonly<{
|
|
75
|
+
color: string;
|
|
76
|
+
fontSize: `${number}px`;
|
|
77
|
+
}>;
|
|
78
|
+
}>;
|
|
79
|
+
declare const chart: {
|
|
80
|
+
chartCategorical: readonly ["#C92E1D", "#A89318", "#3B7911", "#18A84B", "#127681", "#7A8CEC", "#9B30E1", "#E860B8", "#119870", "#B915B0", "#9A0DF9", "#965848"];
|
|
81
|
+
chartColor: typeof chartColor;
|
|
82
|
+
chartColorOn: typeof chartColorOn;
|
|
83
|
+
chartChrome: Readonly<{
|
|
84
|
+
/** Canvas fill. Transparent so the holding `Surface` shows through, light or dark. */
|
|
85
|
+
background: "transparent";
|
|
86
|
+
/** One family for every text in the chart — §02.2 UI stack. */
|
|
87
|
+
fontFamily: string;
|
|
88
|
+
/** Chart title: reads as a card title (§02.2 `h3`). */
|
|
89
|
+
title: Readonly<{
|
|
90
|
+
color: string;
|
|
91
|
+
fontSize: `${number}px`;
|
|
92
|
+
fontWeight: string;
|
|
93
|
+
}>;
|
|
94
|
+
/** Axis labels, legend items, data labels drawn OUTSIDE a slice: hints. */
|
|
95
|
+
label: Readonly<{
|
|
96
|
+
color: string;
|
|
97
|
+
fontSize: `${number}px`;
|
|
98
|
+
}>;
|
|
99
|
+
}>;
|
|
100
|
+
CHART_CATEGORICAL_CORE: number;
|
|
101
|
+
};
|
|
102
|
+
export default chart;
|
|
103
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/tokens/chart.ts"],"names":[],"mappings":"AA+FA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,+IAalB,CAAC;AAEZ,yHAAyH;AACzH,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAehD;AAyCD,4DAA4D;AAC5D,eAAO,MAAM,kBAAkB,mBAE9B,CAAC;AAEF,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMlD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,WAAW;IACtB,sFAAsF;;IAEtF,+DAA+D;;IAE/D,uDAAuD;;;;;;IAMvD,2EAA2E;;;;;EAK3E,CAAC;AAEH,QAAA,MAAM,KAAK;;;;;QAjBT,sFAAsF;;QAEtF,+DAA+D;;QAE/D,uDAAuD;;;;;;QAMvD,2EAA2E;;;;;;;CAa5E,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.chartChrome = exports.chartCategoricalOn = exports.chartCategorical = exports.CHART_CATEGORICAL_CORE = void 0;
|
|
7
|
+
exports.chartColor = chartColor;
|
|
8
|
+
exports.chartColorOn = chartColorOn;
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
var _contrast = require("../utils/contrast");
|
|
11
|
+
var _colors = require("./colors");
|
|
12
|
+
var _typography = require("./typography");
|
|
13
|
+
/**
|
|
14
|
+
* Categorical chart palette — Portnet UI v2
|
|
15
|
+
*
|
|
16
|
+
* A cyclable sequence of visually distinct fills for CATEGORY series in
|
|
17
|
+
* charts (pie slices, stacked bars, multi-series lines). Charter §02.
|
|
18
|
+
*
|
|
19
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
20
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-37)
|
|
21
|
+
*
|
|
22
|
+
* R-2.3 MUST: "aucune valeur magique : tout px/color/font-size passe par un
|
|
23
|
+
* token". R-AI.1 MUST repeats it for generated UI. Yet the library shipped only
|
|
24
|
+
* SEMANTIC colour: brand, ink, surface, border, the four severities and the six
|
|
25
|
+
* workflow statuses. None of them answers "give me N colours that a reader can
|
|
26
|
+
* tell apart", so every charting screen wrote its own list of hex literals.
|
|
27
|
+
*
|
|
28
|
+
* Observed in `refonte-frontend` (Area 4): THIRTY-TWO literals across two
|
|
29
|
+
* files — a 30-entry palette in `GraphiqueCamembert` (itself already
|
|
30
|
+
* de-duplicated from two copies) plus two more in
|
|
31
|
+
* `ChartBilanDPCIParDelegation`. The file carried a comment explaining, quite
|
|
32
|
+
* correctly, why it could not be fixed locally: mapping categories onto the
|
|
33
|
+
* SEMANTIC tones would make "red" mean *a category of measuring instrument*
|
|
34
|
+
* rather than *an error*, which R-2.2 exists to prevent. So the module was
|
|
35
|
+
* stuck between two MUST rules, and the only way out was here.
|
|
36
|
+
*
|
|
37
|
+
* >>> THE ARGUMENT FOR OWNING IT IS THE VERIFICATION, NOT THE STORAGE. Moving
|
|
38
|
+
* >>> thirty hex codes from a module to a library would only relocate them. The
|
|
39
|
+
* >>> reason they belong here is that a categorical palette carries three
|
|
40
|
+
* >>> claims no host can check for itself, and that this repository already has
|
|
41
|
+
* >>> the tooling for: each fill must clear the 3:1 non-text floor (WCAG
|
|
42
|
+
* >>> 1.4.11 / R-C.3) against the surface it sits on, the entries must stay
|
|
43
|
+
* >>> apart from each other, and they must stay apart under colour-vision
|
|
44
|
+
* >>> deficiency — a pie chart encodes its data in hue alone, so a palette that
|
|
45
|
+
* >>> collapses under deuteranopia loses the data, not just the styling. The
|
|
46
|
+
* >>> module's 30 literals had NONE of the three verified. See
|
|
47
|
+
* >>> __tests__/chart-palette.test.ts, which asserts all three. <<<
|
|
48
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
49
|
+
*
|
|
50
|
+
* HOW THESE VALUES WERE DERIVED
|
|
51
|
+
*
|
|
52
|
+
* Hue-balanced, then constrained — not picked by eye:
|
|
53
|
+
*
|
|
54
|
+
* 1. Twelve hues, the first eight evenly spaced around the wheel, so the
|
|
55
|
+
* sequence reads as intentional rather than arbitrary.
|
|
56
|
+
* 2. Lightness solved numerically per entry so that relative luminance lands
|
|
57
|
+
* inside the window where a fill clears 3:1 against BOTH the light surface
|
|
58
|
+
* (#FFFFFF) and the dark-mode surface. That window is roughly
|
|
59
|
+
* L ∈ [0.119, 0.300] and it is why ONE array serves both themes — unlike
|
|
60
|
+
* `status`, which needs a `dark.status` override. Entries alternate
|
|
61
|
+
* between the two ends of the window, which adds a lightness difference to
|
|
62
|
+
* the hue difference between neighbours.
|
|
63
|
+
* 3. Entries 9 to 12 were then chosen by maximising the minimum separation
|
|
64
|
+
* against the first eight, measured as the WORST of three distances:
|
|
65
|
+
* normal vision, deuteranopia and protanopia (Viénot simulation, CIE76).
|
|
66
|
+
*
|
|
67
|
+
* Measured properties (all pinned in the test):
|
|
68
|
+
* · every entry ≥ 3.06:1 on #FFFFFF and ≥ 3.37:1 on the dark surface;
|
|
69
|
+
* · minimum pairwise separation ≥ 12 ΔE under normal vision AND under both
|
|
70
|
+
* simulated dichromacies — the closest pair is entry 1 (red) against
|
|
71
|
+
* entry 3 (olive), at ~12.4.
|
|
72
|
+
*
|
|
73
|
+
* USE THE FIRST EIGHT WHERE YOU CAN. Entries 1-8 are the hue-balanced core;
|
|
74
|
+
* 9-12 extend it for larger sets. Past twelve, `chartColor` CYCLES, and two
|
|
75
|
+
* slices then share a colour — which is a defect in the chart, not in the
|
|
76
|
+
* palette. A series with more than a dozen categories should aggregate its
|
|
77
|
+
* tail into a single "Autres" slice: R-3.1 / R-3.2 cap what one screen may
|
|
78
|
+
* show at once for the same reason.
|
|
79
|
+
*
|
|
80
|
+
* COLOUR IS NEVER THE ONLY CHANNEL (WCAG 1.4.1). This palette makes slices
|
|
81
|
+
* distinguishable; it does not make a chart accessible. Every consumer still
|
|
82
|
+
* owes a legend with text labels, and a text equivalent of the data — 1.1.1
|
|
83
|
+
* for the chart as a whole.
|
|
84
|
+
*
|
|
85
|
+
* Usage — prefer the JS token in a chart library, since SVG presentation
|
|
86
|
+
* attributes given a `var()` are not reliably resolved by every renderer:
|
|
87
|
+
*
|
|
88
|
+
* import { chartColor } from "@portnet/ui/tokens";
|
|
89
|
+
* <Cell fill={chartColor(index)} />
|
|
90
|
+
*
|
|
91
|
+
* In CSS or `sx`, the same values are emitted as `--chart-1` … `--chart-12`
|
|
92
|
+
* (see theme/cssVariables).
|
|
93
|
+
*
|
|
94
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
95
|
+
* TEXT *ON* A SLICE IS A SECOND CONTRAST PROBLEM — see `chartColorOn`.
|
|
96
|
+
*
|
|
97
|
+
* The 3:1 floor above covers the FILL against the page. A percentage printed
|
|
98
|
+
* inside the slice is text on that fill, and owes 4.5:1 (WCAG 1.4.3). The
|
|
99
|
+
* palette deliberately spans two lightness tiers, so no single label colour
|
|
100
|
+
* works for all twelve: `refonte-frontend` printed `fill="white"` on all six
|
|
101
|
+
* of its pies, which was ~3:1 on half of them.
|
|
102
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The palette, in display order. Entries 1-8 (indices 0-7) are the
|
|
107
|
+
* hue-balanced, CVD-verified core; 9-12 extend it.
|
|
108
|
+
*/
|
|
109
|
+
const chartCategorical = exports.chartCategorical = Object.freeze(["#C92E1D",
|
|
110
|
+
// 1 red
|
|
111
|
+
"#A89318",
|
|
112
|
+
// 2 amber / olive-gold
|
|
113
|
+
"#3B7911",
|
|
114
|
+
// 3 olive green
|
|
115
|
+
"#18A84B",
|
|
116
|
+
// 4 green
|
|
117
|
+
"#127681",
|
|
118
|
+
// 5 teal
|
|
119
|
+
"#7A8CEC",
|
|
120
|
+
// 6 periwinkle
|
|
121
|
+
"#9B30E1",
|
|
122
|
+
// 7 violet
|
|
123
|
+
"#E860B8",
|
|
124
|
+
// 8 pink
|
|
125
|
+
"#119870",
|
|
126
|
+
// 9 jade
|
|
127
|
+
"#B915B0",
|
|
128
|
+
// 10 magenta
|
|
129
|
+
"#9A0DF9",
|
|
130
|
+
// 11 blue-violet
|
|
131
|
+
"#965848" // 12 brown
|
|
132
|
+
]);
|
|
133
|
+
|
|
134
|
+
/** Size of the hue-balanced core. Beyond it, separation is still verified but the sequence stops being evenly spaced. */
|
|
135
|
+
const CHART_CATEGORICAL_CORE = exports.CHART_CATEGORICAL_CORE = 8;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Colour for the n-th category, cycling past the end of the palette.
|
|
139
|
+
*
|
|
140
|
+
* Non-finite or negative indices resolve to the first entry rather than
|
|
141
|
+
* throwing: a chart is a read-only view, and a bad index should not blank a
|
|
142
|
+
* page. In development an out-of-range index also warns, because CYCLING IS
|
|
143
|
+
* SILENT — two slices sharing a colour looks like a design choice, not like the
|
|
144
|
+
* data-loss it is.
|
|
145
|
+
*/
|
|
146
|
+
function chartColor(index) {
|
|
147
|
+
const total = chartCategorical.length;
|
|
148
|
+
if (!Number.isFinite(index) || index < 0) {
|
|
149
|
+
return chartCategorical[0];
|
|
150
|
+
}
|
|
151
|
+
const i = Math.floor(index);
|
|
152
|
+
if (i >= total && process.env["NODE_ENV"] !== "production") {
|
|
153
|
+
// eslint-disable-next-line no-console
|
|
154
|
+
console.warn(`[@portnet/ui] chartColor(${i}): the palette holds ${total} colours, so ` + `this category reuses the colour of category ${i % total}. Aggregate ` + `the tail of the series instead (R-3.2).`);
|
|
155
|
+
}
|
|
156
|
+
return chartCategorical[i % total];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Label colour for text drawn ON a slice — `#FFFFFF` or `ink.fg`, whichever
|
|
161
|
+
* clears WCAG 1.4.3 AA against that fill.
|
|
162
|
+
*
|
|
163
|
+
* DERIVED, NOT TABULATED, and that is the whole point: a parallel array of
|
|
164
|
+
* twelve label colours would be a second list to keep in step with the first,
|
|
165
|
+
* and the failure mode of letting them drift is silent — unreadable text, at
|
|
166
|
+
* the exact spot where the chart states its numbers. Computed here with this
|
|
167
|
+
* library's own `contrastRatio`, so nudging a hue re-derives its label colour
|
|
168
|
+
* in the same breath.
|
|
169
|
+
*
|
|
170
|
+
* Measured: every entry pairs at ≥ 4.98:1, so the AA floor holds with margin
|
|
171
|
+
* on all twelve. The dev warning below is for a future hue that lands in the
|
|
172
|
+
* band where NEITHER candidate reaches 4.5:1 — possible in principle, since the
|
|
173
|
+
* fill constraint only bounds luminance to [0.119, 0.300].
|
|
174
|
+
*/
|
|
175
|
+
const LABEL_CANDIDATES = Object.freeze(["#FFFFFF", _colors.ink.fg]);
|
|
176
|
+
function pickLabelColour(fill) {
|
|
177
|
+
let best = LABEL_CANDIDATES[0];
|
|
178
|
+
let bestRatio = 0;
|
|
179
|
+
for (const candidate of LABEL_CANDIDATES) {
|
|
180
|
+
const ratio = (0, _contrast.contrastRatio)(candidate, fill) ?? 0;
|
|
181
|
+
if (ratio > bestRatio) {
|
|
182
|
+
bestRatio = ratio;
|
|
183
|
+
best = candidate;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (bestRatio < _contrast.WCAG_AA_NORMAL && process.env["NODE_ENV"] !== "production") {
|
|
187
|
+
// eslint-disable-next-line no-console
|
|
188
|
+
console.warn(`[@portnet/ui] chart fill ${fill} has no AA-compliant label colour ` + `(best ${bestRatio.toFixed(2)}:1). Draw the label outside the slice, or ` + `re-solve the fill's lightness.`);
|
|
189
|
+
}
|
|
190
|
+
return best;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Label colours, index-aligned with `chartCategorical`. */
|
|
194
|
+
const chartCategoricalOn = exports.chartCategoricalOn = Object.freeze(chartCategorical.map(pickLabelColour));
|
|
195
|
+
|
|
196
|
+
/** AA-safe colour for text drawn on top of `chartColor(index)`. Cycles identically. */
|
|
197
|
+
function chartColorOn(index) {
|
|
198
|
+
const total = chartCategoricalOn.length;
|
|
199
|
+
if (!Number.isFinite(index) || index < 0) {
|
|
200
|
+
return chartCategoricalOn[0];
|
|
201
|
+
}
|
|
202
|
+
return chartCategoricalOn[Math.floor(index) % total];
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Non-data chart furniture — title, labels, canvas (capability gap G-54).
|
|
207
|
+
*
|
|
208
|
+
* ────────────────────────────────────────────────────────────────────────────────
|
|
209
|
+
* THIS IS A ROLE→TOKEN MAPPING, NOT A STORE OF VALUES, and the distinction is
|
|
210
|
+
* the justification. Every value below already exists in this library, and a
|
|
211
|
+
* module reading `ink.fgMuted` for its axis labels is already compliant with
|
|
212
|
+
* R-2.3. What no module can get right alone is WHICH token plays WHICH role:
|
|
213
|
+
* is a chart title an `h2` or an `h3`? are axis labels `xs` or `sm`? is the
|
|
214
|
+
* canvas `surface` or transparent?
|
|
215
|
+
*
|
|
216
|
+
* Left unanswered, each screen answers it again. Observed in
|
|
217
|
+
* `autorisation-admis-pour-conforme-fe` (Area 5): three bilan screens, five
|
|
218
|
+
* chart definitions, the same five-line block of title / label / canvas styling
|
|
219
|
+
* copied into each — agreeing only because they were copied from one another.
|
|
220
|
+
* The next module starts from a blank chart and picks `h2`, and nothing in code
|
|
221
|
+
* review can call that wrong, because the platform never said.
|
|
222
|
+
*
|
|
223
|
+
* So this is the answer, once: a chart title reads as a card title (`h3`,
|
|
224
|
+
* semibold, full-strength ink), its labels as hints (`xs`, muted ink), and its
|
|
225
|
+
* canvas is TRANSPARENT — the chart sits on whatever `Surface` holds it, and a
|
|
226
|
+
* hard-coded white canvas is exactly what breaks a chart in dark mode.
|
|
227
|
+
* ────────────────────────────────────────────────────────────────────────────────
|
|
228
|
+
*
|
|
229
|
+
* LIBRARY-AGNOSTIC BY CONSTRUCTION. Plain strings, no chart library imported,
|
|
230
|
+
* no option shape assumed: Highcharts, Recharts, Chart.js and a hand-written
|
|
231
|
+
* SVG all take these. A consumer maps them to its renderer's option names,
|
|
232
|
+
* which is a binding — and a binding holding no design values is not a
|
|
233
|
+
* duplication of this.
|
|
234
|
+
*
|
|
235
|
+
* FONT SIZES ARE STRINGS WITH UNITS, unlike `fontSize.*`, which are integers.
|
|
236
|
+
* Chart libraries pass their style objects to SVG attributes rather than to
|
|
237
|
+
* React's style prop, so they never get a unit appended for free — a bare `16`
|
|
238
|
+
* is silently ignored by some renderers and read as `16px` by others.
|
|
239
|
+
*
|
|
240
|
+
* WHAT THIS DOES NOT MAKE ACCESSIBLE. Nothing here supplies the text
|
|
241
|
+
* equivalent WCAG 1.1.1 requires of a chart, or the non-colour channel of
|
|
242
|
+
* 1.4.1. See the `ChartFigure` pattern, which carries the caption, and the note
|
|
243
|
+
* at the head of this file.
|
|
244
|
+
*/
|
|
245
|
+
const chartChrome = exports.chartChrome = Object.freeze({
|
|
246
|
+
/** Canvas fill. Transparent so the holding `Surface` shows through, light or dark. */
|
|
247
|
+
background: "transparent",
|
|
248
|
+
/** One family for every text in the chart — §02.2 UI stack. */
|
|
249
|
+
fontFamily: _typography.fontFamily.sans,
|
|
250
|
+
/** Chart title: reads as a card title (§02.2 `h3`). */
|
|
251
|
+
title: Object.freeze({
|
|
252
|
+
color: _colors.ink.fg,
|
|
253
|
+
fontSize: `${_typography.fontSize.h3}px`,
|
|
254
|
+
fontWeight: String(_typography.fontWeight.semibold)
|
|
255
|
+
}),
|
|
256
|
+
/** Axis labels, legend items, data labels drawn OUTSIDE a slice: hints. */
|
|
257
|
+
label: Object.freeze({
|
|
258
|
+
color: _colors.ink.fgMuted,
|
|
259
|
+
fontSize: `${_typography.fontSize.xs}px`
|
|
260
|
+
})
|
|
261
|
+
});
|
|
262
|
+
const chart = {
|
|
263
|
+
chartCategorical,
|
|
264
|
+
chartColor,
|
|
265
|
+
chartColorOn,
|
|
266
|
+
chartChrome,
|
|
267
|
+
CHART_CATEGORICAL_CORE
|
|
268
|
+
};
|
|
269
|
+
var _default = exports.default = chart;
|
|
270
|
+
//# sourceMappingURL=chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","names":["_contrast","require","_colors","_typography","chartCategorical","exports","Object","freeze","CHART_CATEGORICAL_CORE","chartColor","index","total","length","Number","isFinite","i","Math","floor","process","env","console","warn","LABEL_CANDIDATES","ink","fg","pickLabelColour","fill","best","bestRatio","candidate","ratio","contrastRatio","WCAG_AA_NORMAL","toFixed","chartCategoricalOn","map","chartColorOn","chartChrome","background","fontFamily","sans","title","color","fontSize","h3","fontWeight","String","semibold","label","fgMuted","xs","chart","_default","default"],"sources":["../../../src/lib/v2/tokens/chart.ts"],"sourcesContent":["/**\r\n * Categorical chart palette — Portnet UI v2\r\n *\r\n * A cyclable sequence of visually distinct fills for CATEGORY series in\r\n * charts (pie slices, stacked bars, multi-series lines). Charter §02.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-37)\r\n *\r\n * R-2.3 MUST: \"aucune valeur magique : tout px/color/font-size passe par un\r\n * token\". R-AI.1 MUST repeats it for generated UI. Yet the library shipped only\r\n * SEMANTIC colour: brand, ink, surface, border, the four severities and the six\r\n * workflow statuses. None of them answers \"give me N colours that a reader can\r\n * tell apart\", so every charting screen wrote its own list of hex literals.\r\n *\r\n * Observed in `refonte-frontend` (Area 4): THIRTY-TWO literals across two\r\n * files — a 30-entry palette in `GraphiqueCamembert` (itself already\r\n * de-duplicated from two copies) plus two more in\r\n * `ChartBilanDPCIParDelegation`. The file carried a comment explaining, quite\r\n * correctly, why it could not be fixed locally: mapping categories onto the\r\n * SEMANTIC tones would make \"red\" mean *a category of measuring instrument*\r\n * rather than *an error*, which R-2.2 exists to prevent. So the module was\r\n * stuck between two MUST rules, and the only way out was here.\r\n *\r\n * >>> THE ARGUMENT FOR OWNING IT IS THE VERIFICATION, NOT THE STORAGE. Moving\r\n * >>> thirty hex codes from a module to a library would only relocate them. The\r\n * >>> reason they belong here is that a categorical palette carries three\r\n * >>> claims no host can check for itself, and that this repository already has\r\n * >>> the tooling for: each fill must clear the 3:1 non-text floor (WCAG\r\n * >>> 1.4.11 / R-C.3) against the surface it sits on, the entries must stay\r\n * >>> apart from each other, and they must stay apart under colour-vision\r\n * >>> deficiency — a pie chart encodes its data in hue alone, so a palette that\r\n * >>> collapses under deuteranopia loses the data, not just the styling. The\r\n * >>> module's 30 literals had NONE of the three verified. See\r\n * >>> __tests__/chart-palette.test.ts, which asserts all three. <<<\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * HOW THESE VALUES WERE DERIVED\r\n *\r\n * Hue-balanced, then constrained — not picked by eye:\r\n *\r\n * 1. Twelve hues, the first eight evenly spaced around the wheel, so the\r\n * sequence reads as intentional rather than arbitrary.\r\n * 2. Lightness solved numerically per entry so that relative luminance lands\r\n * inside the window where a fill clears 3:1 against BOTH the light surface\r\n * (#FFFFFF) and the dark-mode surface. That window is roughly\r\n * L ∈ [0.119, 0.300] and it is why ONE array serves both themes — unlike\r\n * `status`, which needs a `dark.status` override. Entries alternate\r\n * between the two ends of the window, which adds a lightness difference to\r\n * the hue difference between neighbours.\r\n * 3. Entries 9 to 12 were then chosen by maximising the minimum separation\r\n * against the first eight, measured as the WORST of three distances:\r\n * normal vision, deuteranopia and protanopia (Viénot simulation, CIE76).\r\n *\r\n * Measured properties (all pinned in the test):\r\n * · every entry ≥ 3.06:1 on #FFFFFF and ≥ 3.37:1 on the dark surface;\r\n * · minimum pairwise separation ≥ 12 ΔE under normal vision AND under both\r\n * simulated dichromacies — the closest pair is entry 1 (red) against\r\n * entry 3 (olive), at ~12.4.\r\n *\r\n * USE THE FIRST EIGHT WHERE YOU CAN. Entries 1-8 are the hue-balanced core;\r\n * 9-12 extend it for larger sets. Past twelve, `chartColor` CYCLES, and two\r\n * slices then share a colour — which is a defect in the chart, not in the\r\n * palette. A series with more than a dozen categories should aggregate its\r\n * tail into a single \"Autres\" slice: R-3.1 / R-3.2 cap what one screen may\r\n * show at once for the same reason.\r\n *\r\n * COLOUR IS NEVER THE ONLY CHANNEL (WCAG 1.4.1). This palette makes slices\r\n * distinguishable; it does not make a chart accessible. Every consumer still\r\n * owes a legend with text labels, and a text equivalent of the data — 1.1.1\r\n * for the chart as a whole.\r\n *\r\n * Usage — prefer the JS token in a chart library, since SVG presentation\r\n * attributes given a `var()` are not reliably resolved by every renderer:\r\n *\r\n * import { chartColor } from \"@portnet/ui/tokens\";\r\n * <Cell fill={chartColor(index)} />\r\n *\r\n * In CSS or `sx`, the same values are emitted as `--chart-1` … `--chart-12`\r\n * (see theme/cssVariables).\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * TEXT *ON* A SLICE IS A SECOND CONTRAST PROBLEM — see `chartColorOn`.\r\n *\r\n * The 3:1 floor above covers the FILL against the page. A percentage printed\r\n * inside the slice is text on that fill, and owes 4.5:1 (WCAG 1.4.3). The\r\n * palette deliberately spans two lightness tiers, so no single label colour\r\n * works for all twelve: `refonte-frontend` printed `fill=\"white\"` on all six\r\n * of its pies, which was ~3:1 on half of them.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n */\r\nimport { contrastRatio, WCAG_AA_NORMAL } from \"../utils/contrast\";\r\nimport { ink } from \"./colors\";\r\nimport { fontFamily, fontSize, fontWeight } from \"./typography\";\r\n\r\n/**\r\n * The palette, in display order. Entries 1-8 (indices 0-7) are the\r\n * hue-balanced, CVD-verified core; 9-12 extend it.\r\n */\r\nexport const chartCategorical = Object.freeze([\r\n \"#C92E1D\", // 1 red\r\n \"#A89318\", // 2 amber / olive-gold\r\n \"#3B7911\", // 3 olive green\r\n \"#18A84B\", // 4 green\r\n \"#127681\", // 5 teal\r\n \"#7A8CEC\", // 6 periwinkle\r\n \"#9B30E1\", // 7 violet\r\n \"#E860B8\", // 8 pink\r\n \"#119870\", // 9 jade\r\n \"#B915B0\", // 10 magenta\r\n \"#9A0DF9\", // 11 blue-violet\r\n \"#965848\", // 12 brown\r\n] as const);\r\n\r\n/** Size of the hue-balanced core. Beyond it, separation is still verified but the sequence stops being evenly spaced. */\r\nexport const CHART_CATEGORICAL_CORE = 8;\r\n\r\n/**\r\n * Colour for the n-th category, cycling past the end of the palette.\r\n *\r\n * Non-finite or negative indices resolve to the first entry rather than\r\n * throwing: a chart is a read-only view, and a bad index should not blank a\r\n * page. In development an out-of-range index also warns, because CYCLING IS\r\n * SILENT — two slices sharing a colour looks like a design choice, not like the\r\n * data-loss it is.\r\n */\r\nexport function chartColor(index: number): string {\r\n const total = chartCategorical.length;\r\n if (!Number.isFinite(index) || index < 0) {\r\n return chartCategorical[0] as string;\r\n }\r\n const i = Math.floor(index);\r\n if (i >= total && process.env[\"NODE_ENV\"] !== \"production\") {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n `[@portnet/ui] chartColor(${i}): the palette holds ${total} colours, so ` +\r\n `this category reuses the colour of category ${i % total}. Aggregate ` +\r\n `the tail of the series instead (R-3.2).`\r\n );\r\n }\r\n return chartCategorical[i % total] as string;\r\n}\r\n\r\n/**\r\n * Label colour for text drawn ON a slice — `#FFFFFF` or `ink.fg`, whichever\r\n * clears WCAG 1.4.3 AA against that fill.\r\n *\r\n * DERIVED, NOT TABULATED, and that is the whole point: a parallel array of\r\n * twelve label colours would be a second list to keep in step with the first,\r\n * and the failure mode of letting them drift is silent — unreadable text, at\r\n * the exact spot where the chart states its numbers. Computed here with this\r\n * library's own `contrastRatio`, so nudging a hue re-derives its label colour\r\n * in the same breath.\r\n *\r\n * Measured: every entry pairs at ≥ 4.98:1, so the AA floor holds with margin\r\n * on all twelve. The dev warning below is for a future hue that lands in the\r\n * band where NEITHER candidate reaches 4.5:1 — possible in principle, since the\r\n * fill constraint only bounds luminance to [0.119, 0.300].\r\n */\r\nconst LABEL_CANDIDATES: readonly string[] = Object.freeze([\"#FFFFFF\", ink.fg]);\r\n\r\nfunction pickLabelColour(fill: string): string {\r\n let best = LABEL_CANDIDATES[0] as string;\r\n let bestRatio = 0;\r\n for (const candidate of LABEL_CANDIDATES) {\r\n const ratio = contrastRatio(candidate, fill) ?? 0;\r\n if (ratio > bestRatio) {\r\n bestRatio = ratio;\r\n best = candidate;\r\n }\r\n }\r\n if (bestRatio < WCAG_AA_NORMAL && process.env[\"NODE_ENV\"] !== \"production\") {\r\n // eslint-disable-next-line no-console\r\n console.warn(\r\n `[@portnet/ui] chart fill ${fill} has no AA-compliant label colour ` +\r\n `(best ${bestRatio.toFixed(2)}:1). Draw the label outside the slice, or ` +\r\n `re-solve the fill's lightness.`\r\n );\r\n }\r\n return best;\r\n}\r\n\r\n/** Label colours, index-aligned with `chartCategorical`. */\r\nexport const chartCategoricalOn = Object.freeze(\r\n chartCategorical.map(pickLabelColour)\r\n);\r\n\r\n/** AA-safe colour for text drawn on top of `chartColor(index)`. Cycles identically. */\r\nexport function chartColorOn(index: number): string {\r\n const total = chartCategoricalOn.length;\r\n if (!Number.isFinite(index) || index < 0) {\r\n return chartCategoricalOn[0] as string;\r\n }\r\n return chartCategoricalOn[Math.floor(index) % total] as string;\r\n}\r\n\r\n/**\r\n * Non-data chart furniture — title, labels, canvas (capability gap G-54).\r\n *\r\n * ────────────────────────────────────────────────────────────────────────────────\r\n * THIS IS A ROLE→TOKEN MAPPING, NOT A STORE OF VALUES, and the distinction is\r\n * the justification. Every value below already exists in this library, and a\r\n * module reading `ink.fgMuted` for its axis labels is already compliant with\r\n * R-2.3. What no module can get right alone is WHICH token plays WHICH role:\r\n * is a chart title an `h2` or an `h3`? are axis labels `xs` or `sm`? is the\r\n * canvas `surface` or transparent?\r\n *\r\n * Left unanswered, each screen answers it again. Observed in\r\n * `autorisation-admis-pour-conforme-fe` (Area 5): three bilan screens, five\r\n * chart definitions, the same five-line block of title / label / canvas styling\r\n * copied into each — agreeing only because they were copied from one another.\r\n * The next module starts from a blank chart and picks `h2`, and nothing in code\r\n * review can call that wrong, because the platform never said.\r\n *\r\n * So this is the answer, once: a chart title reads as a card title (`h3`,\r\n * semibold, full-strength ink), its labels as hints (`xs`, muted ink), and its\r\n * canvas is TRANSPARENT — the chart sits on whatever `Surface` holds it, and a\r\n * hard-coded white canvas is exactly what breaks a chart in dark mode.\r\n * ────────────────────────────────────────────────────────────────────────────────\r\n *\r\n * LIBRARY-AGNOSTIC BY CONSTRUCTION. Plain strings, no chart library imported,\r\n * no option shape assumed: Highcharts, Recharts, Chart.js and a hand-written\r\n * SVG all take these. A consumer maps them to its renderer's option names,\r\n * which is a binding — and a binding holding no design values is not a\r\n * duplication of this.\r\n *\r\n * FONT SIZES ARE STRINGS WITH UNITS, unlike `fontSize.*`, which are integers.\r\n * Chart libraries pass their style objects to SVG attributes rather than to\r\n * React's style prop, so they never get a unit appended for free — a bare `16`\r\n * is silently ignored by some renderers and read as `16px` by others.\r\n *\r\n * WHAT THIS DOES NOT MAKE ACCESSIBLE. Nothing here supplies the text\r\n * equivalent WCAG 1.1.1 requires of a chart, or the non-colour channel of\r\n * 1.4.1. See the `ChartFigure` pattern, which carries the caption, and the note\r\n * at the head of this file.\r\n */\r\nexport const chartChrome = Object.freeze({\r\n /** Canvas fill. Transparent so the holding `Surface` shows through, light or dark. */\r\n background: \"transparent\",\r\n /** One family for every text in the chart — §02.2 UI stack. */\r\n fontFamily: fontFamily.sans,\r\n /** Chart title: reads as a card title (§02.2 `h3`). */\r\n title: Object.freeze({\r\n color: ink.fg,\r\n fontSize: `${fontSize.h3}px`,\r\n fontWeight: String(fontWeight.semibold),\r\n }),\r\n /** Axis labels, legend items, data labels drawn OUTSIDE a slice: hints. */\r\n label: Object.freeze({\r\n color: ink.fgMuted,\r\n fontSize: `${fontSize.xs}px`,\r\n }),\r\n});\r\n\r\nconst chart = {\r\n chartCategorical,\r\n chartColor,\r\n chartColorOn,\r\n chartChrome,\r\n CHART_CATEGORICAL_CORE,\r\n};\r\nexport default chart;\r\n"],"mappings":";;;;;;;;;AA2FA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AA7FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAKA;AACA;AACA;AACA;AACO,MAAMG,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAGE,MAAM,CAACC,MAAM,CAAC,CAC5C,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS;AAAE;AACX,SAAS,CAAE;AAAA,CACH,CAAC;;AAEX;AACO,MAAMC,sBAAsB,GAAAH,OAAA,CAAAG,sBAAA,GAAG,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACC,KAAa,EAAU;EAChD,MAAMC,KAAK,GAAGP,gBAAgB,CAACQ,MAAM;EACrC,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;IACxC,OAAON,gBAAgB,CAAC,CAAC,CAAC;EAC5B;EACA,MAAMW,CAAC,GAAGC,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC;EAC3B,IAAIK,CAAC,IAAIJ,KAAK,IAAIO,OAAO,CAACC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE;IAC1D;IACAC,OAAO,CAACC,IAAI,CACV,4BAA4BN,CAAC,wBAAwBJ,KAAK,eAAe,GACvE,+CAA+CI,CAAC,GAAGJ,KAAK,cAAc,GACtE,yCACJ,CAAC;EACH;EACA,OAAOP,gBAAgB,CAACW,CAAC,GAAGJ,KAAK,CAAC;AACpC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMW,gBAAmC,GAAGhB,MAAM,CAACC,MAAM,CAAC,CAAC,SAAS,EAAEgB,WAAG,CAACC,EAAE,CAAC,CAAC;AAE9E,SAASC,eAAeA,CAACC,IAAY,EAAU;EAC7C,IAAIC,IAAI,GAAGL,gBAAgB,CAAC,CAAC,CAAW;EACxC,IAAIM,SAAS,GAAG,CAAC;EACjB,KAAK,MAAMC,SAAS,IAAIP,gBAAgB,EAAE;IACxC,MAAMQ,KAAK,GAAG,IAAAC,uBAAa,EAACF,SAAS,EAAEH,IAAI,CAAC,IAAI,CAAC;IACjD,IAAII,KAAK,GAAGF,SAAS,EAAE;MACrBA,SAAS,GAAGE,KAAK;MACjBH,IAAI,GAAGE,SAAS;IAClB;EACF;EACA,IAAID,SAAS,GAAGI,wBAAc,IAAId,OAAO,CAACC,GAAG,CAAC,UAAU,CAAC,KAAK,YAAY,EAAE;IAC1E;IACAC,OAAO,CAACC,IAAI,CACV,4BAA4BK,IAAI,oCAAoC,GAClE,SAASE,SAAS,CAACK,OAAO,CAAC,CAAC,CAAC,4CAA4C,GACzE,gCACJ,CAAC;EACH;EACA,OAAON,IAAI;AACb;;AAEA;AACO,MAAMO,kBAAkB,GAAA7B,OAAA,CAAA6B,kBAAA,GAAG5B,MAAM,CAACC,MAAM,CAC7CH,gBAAgB,CAAC+B,GAAG,CAACV,eAAe,CACtC,CAAC;;AAED;AACO,SAASW,YAAYA,CAAC1B,KAAa,EAAU;EAClD,MAAMC,KAAK,GAAGuB,kBAAkB,CAACtB,MAAM;EACvC,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,IAAIA,KAAK,GAAG,CAAC,EAAE;IACxC,OAAOwB,kBAAkB,CAAC,CAAC,CAAC;EAC9B;EACA,OAAOA,kBAAkB,CAAClB,IAAI,CAACC,KAAK,CAACP,KAAK,CAAC,GAAGC,KAAK,CAAC;AACtD;;AAEA;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;AACO,MAAM0B,WAAW,GAAAhC,OAAA,CAAAgC,WAAA,GAAG/B,MAAM,CAACC,MAAM,CAAC;EACvC;EACA+B,UAAU,EAAE,aAAa;EACzB;EACAC,UAAU,EAAEA,sBAAU,CAACC,IAAI;EAC3B;EACAC,KAAK,EAAEnC,MAAM,CAACC,MAAM,CAAC;IACnBmC,KAAK,EAAEnB,WAAG,CAACC,EAAE;IACbmB,QAAQ,EAAE,GAAGA,oBAAQ,CAACC,EAAE,IAAI;IAC5BC,UAAU,EAAEC,MAAM,CAACD,sBAAU,CAACE,QAAQ;EACxC,CAAC,CAAC;EACF;EACAC,KAAK,EAAE1C,MAAM,CAACC,MAAM,CAAC;IACnBmC,KAAK,EAAEnB,WAAG,CAAC0B,OAAO;IAClBN,QAAQ,EAAE,GAAGA,oBAAQ,CAACO,EAAE;EAC1B,CAAC;AACH,CAAC,CAAC;AAEF,MAAMC,KAAK,GAAG;EACZ/C,gBAAgB;EAChBK,UAAU;EACV2B,YAAY;EACZC,WAAW;EACX7B;AACF,CAAC;AAAC,IAAA4C,QAAA,GAAA/C,OAAA,CAAAgD,OAAA,GACaF,KAAK","ignoreList":[]}
|