@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
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
var _excluded = ["as", "sx", "style", "className", "children"],
|
|
2
|
-
_excluded2 = ["direction", "gap", "align", "justify", "wrap", "sx", "children"];
|
|
3
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
9
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
18
1
|
import * as React from "react";
|
|
19
2
|
import { mq, BREAKPOINT_KEYS } from "../tokens";
|
|
20
3
|
|
|
@@ -73,18 +56,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
73
56
|
* never emits a media query. Sourced from the canonical breakpoints
|
|
74
57
|
* token (tokens/breakpoints.js) so the order can't drift from the scale
|
|
75
58
|
* wired into the MUI theme. */
|
|
76
|
-
|
|
59
|
+
const BP_ORDER = BREAKPOINT_KEYS;
|
|
77
60
|
function isPlainObject(v) {
|
|
78
|
-
return v != null &&
|
|
61
|
+
return v != null && typeof v === "object" && !Array.isArray(v);
|
|
79
62
|
}
|
|
80
63
|
function isBreakpointObject(v) {
|
|
81
64
|
if (!isPlainObject(v)) return false;
|
|
82
65
|
// Treat as responsive only if EVERY key is a known breakpoint name.
|
|
83
66
|
// Avoids misreading a nested style object as a breakpoint map.
|
|
84
|
-
|
|
85
|
-
return keys.length > 0 && keys.every(
|
|
86
|
-
return BP_ORDER.includes(k);
|
|
87
|
-
});
|
|
67
|
+
const keys = Object.keys(v);
|
|
68
|
+
return keys.length > 0 && keys.every(k => BP_ORDER.includes(k));
|
|
88
69
|
}
|
|
89
70
|
|
|
90
71
|
/**
|
|
@@ -113,49 +94,37 @@ function resolveSx(sx) {
|
|
|
113
94
|
|
|
114
95
|
// Content-addressed signature. Derived ONCE from the sx so the class
|
|
115
96
|
// and every generated var name are stable across renders/instances.
|
|
116
|
-
|
|
97
|
+
const sig = Math.abs(hashString(JSON.stringify(sx))).toString(36);
|
|
117
98
|
|
|
118
99
|
// inlineStyle is the returned CSSProperties; styleWrite is the same
|
|
119
100
|
// object viewed as a keyed record so dynamic string keys can be written
|
|
120
101
|
// (CSSProperties has no string index signature, so the view needs a
|
|
121
102
|
// cast — the two are the SAME object at runtime).
|
|
122
|
-
|
|
123
|
-
|
|
103
|
+
const inlineStyle = {};
|
|
104
|
+
const styleWrite = inlineStyle;
|
|
124
105
|
/* Per-breakpoint declaration buckets, e.g. byBp.md === "--pui-rsp-<sig>-0:row;" */
|
|
125
|
-
|
|
106
|
+
const byBp = {
|
|
126
107
|
xs: "",
|
|
127
108
|
sm: "",
|
|
128
109
|
md: "",
|
|
129
110
|
lg: "",
|
|
130
111
|
xl: ""
|
|
131
112
|
};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
for (
|
|
135
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
136
|
-
prop = _Object$entries$_i[0],
|
|
137
|
-
value = _Object$entries$_i[1];
|
|
113
|
+
let hasResponsive = false;
|
|
114
|
+
let varSeq = 0;
|
|
115
|
+
for (const [prop, value] of Object.entries(sx)) {
|
|
138
116
|
if (isBreakpointObject(value)) {
|
|
139
117
|
hasResponsive = true;
|
|
140
118
|
// Stable, signature-scoped var name (local index, not a global
|
|
141
119
|
// counter). Only ever declared inside `.${className}`, so the name
|
|
142
120
|
// is effectively scoped to elements carrying that class.
|
|
143
|
-
|
|
144
|
-
styleWrite[prop] =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
var bp = _step.value;
|
|
150
|
-
var bpVal = value[bp];
|
|
151
|
-
if (bpVal != null) {
|
|
152
|
-
byBp[bp] += "".concat(varName, ":").concat(bpVal, ";");
|
|
153
|
-
}
|
|
121
|
+
const varName = `--pui-rsp-${sig}-${varSeq++}`;
|
|
122
|
+
styleWrite[prop] = `var(${varName})`;
|
|
123
|
+
for (const bp of BP_ORDER) {
|
|
124
|
+
const bpVal = value[bp];
|
|
125
|
+
if (bpVal != null) {
|
|
126
|
+
byBp[bp] += `${varName}:${bpVal};`;
|
|
154
127
|
}
|
|
155
|
-
} catch (err) {
|
|
156
|
-
_iterator.e(err);
|
|
157
|
-
} finally {
|
|
158
|
-
_iterator.f();
|
|
159
128
|
}
|
|
160
129
|
} else {
|
|
161
130
|
styleWrite[prop] = value;
|
|
@@ -163,34 +132,25 @@ function resolveSx(sx) {
|
|
|
163
132
|
}
|
|
164
133
|
if (!hasResponsive) {
|
|
165
134
|
return {
|
|
166
|
-
inlineStyle
|
|
135
|
+
inlineStyle,
|
|
167
136
|
css: "",
|
|
168
137
|
className: undefined
|
|
169
138
|
};
|
|
170
139
|
}
|
|
171
|
-
|
|
172
|
-
|
|
140
|
+
const className = `pui-rsp-${sig}`;
|
|
141
|
+
let css = "";
|
|
173
142
|
// xs = base (no media query), then ascending min-width queries built
|
|
174
143
|
// by the shared mq.up() helper (single breakpoint→media-query engine).
|
|
175
|
-
if (byBp.xs) css +=
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
180
|
-
var _bp = _step2.value;
|
|
181
|
-
if (byBp[_bp]) {
|
|
182
|
-
css += "".concat(mq.up(_bp), "{.").concat(className, "{").concat(byBp[_bp], "}}");
|
|
183
|
-
}
|
|
144
|
+
if (byBp.xs) css += `.${className}{${byBp.xs}}`;
|
|
145
|
+
for (const bp of ["sm", "md", "lg", "xl"]) {
|
|
146
|
+
if (byBp[bp]) {
|
|
147
|
+
css += `${mq.up(bp)}{.${className}{${byBp[bp]}}}`;
|
|
184
148
|
}
|
|
185
|
-
} catch (err) {
|
|
186
|
-
_iterator2.e(err);
|
|
187
|
-
} finally {
|
|
188
|
-
_iterator2.f();
|
|
189
149
|
}
|
|
190
150
|
return {
|
|
191
|
-
inlineStyle
|
|
192
|
-
css
|
|
193
|
-
className
|
|
151
|
+
inlineStyle,
|
|
152
|
+
css,
|
|
153
|
+
className
|
|
194
154
|
};
|
|
195
155
|
}
|
|
196
156
|
|
|
@@ -198,8 +158,8 @@ function resolveSx(sx) {
|
|
|
198
158
|
* Used to content-address identical sx signatures so their generated
|
|
199
159
|
* class + <style> rule de-duplicate in the DOM. */
|
|
200
160
|
function hashString(str) {
|
|
201
|
-
|
|
202
|
-
for (
|
|
161
|
+
let h = 5381;
|
|
162
|
+
for (let i = 0; i < str.length; i++) {
|
|
203
163
|
h = h * 33 ^ str.charCodeAt(i);
|
|
204
164
|
}
|
|
205
165
|
return h | 0;
|
|
@@ -209,11 +169,11 @@ function hashString(str) {
|
|
|
209
169
|
* unique className. Idempotent: a second Box with the same sx signature
|
|
210
170
|
* reuses the existing <style>. */
|
|
211
171
|
function useResponsiveStyleInjection(css, className) {
|
|
212
|
-
React.useInsertionEffect(
|
|
172
|
+
React.useInsertionEffect(() => {
|
|
213
173
|
if (!css || !className || typeof document === "undefined") return undefined;
|
|
214
|
-
|
|
174
|
+
const id = `pui-rsp-style-${className}`;
|
|
215
175
|
if (document.getElementById(id)) return undefined;
|
|
216
|
-
|
|
176
|
+
const el = document.createElement("style");
|
|
217
177
|
el.id = id;
|
|
218
178
|
el.textContent = css;
|
|
219
179
|
document.head.appendChild(el);
|
|
@@ -224,61 +184,65 @@ function useResponsiveStyleInjection(css, className) {
|
|
|
224
184
|
return undefined;
|
|
225
185
|
}, [css, className]);
|
|
226
186
|
}
|
|
227
|
-
export
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
rspClass = _React$useMemo.className;
|
|
187
|
+
export const Box = /*#__PURE__*/React.forwardRef(function Box({
|
|
188
|
+
as: Component = "div",
|
|
189
|
+
sx,
|
|
190
|
+
style,
|
|
191
|
+
className,
|
|
192
|
+
children,
|
|
193
|
+
...rest
|
|
194
|
+
}, ref) {
|
|
195
|
+
const {
|
|
196
|
+
inlineStyle,
|
|
197
|
+
css,
|
|
198
|
+
className: rspClass
|
|
199
|
+
} = React.useMemo(() => resolveSx(sx), [sx]);
|
|
241
200
|
useResponsiveStyleInjection(css, rspClass);
|
|
242
201
|
|
|
243
202
|
/* Merge sx-derived inline style + explicit style — style wins. */
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
203
|
+
const merged = inlineStyle && style ? {
|
|
204
|
+
...inlineStyle,
|
|
205
|
+
...style
|
|
206
|
+
} : inlineStyle ? inlineStyle : style ? style : undefined;
|
|
207
|
+
const mergedClass = [className, rspClass].filter(Boolean).join(" ") || undefined;
|
|
208
|
+
return /*#__PURE__*/_jsx(Component, {
|
|
247
209
|
ref: ref,
|
|
248
210
|
style: merged,
|
|
249
|
-
className: mergedClass
|
|
250
|
-
|
|
211
|
+
className: mergedClass,
|
|
212
|
+
...rest,
|
|
251
213
|
children: children
|
|
252
|
-
})
|
|
214
|
+
});
|
|
253
215
|
});
|
|
254
|
-
export
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
266
|
-
var layoutSx = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
216
|
+
export const Stack = /*#__PURE__*/React.forwardRef(function Stack({
|
|
217
|
+
direction = "column",
|
|
218
|
+
gap = "var(--s-3)",
|
|
219
|
+
align,
|
|
220
|
+
justify,
|
|
221
|
+
wrap = false,
|
|
222
|
+
sx,
|
|
223
|
+
children,
|
|
224
|
+
...rest
|
|
225
|
+
}, ref) {
|
|
226
|
+
const layoutSx = {
|
|
267
227
|
display: "flex",
|
|
268
228
|
flexDirection: direction,
|
|
269
|
-
gap
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
229
|
+
gap,
|
|
230
|
+
...(align ? {
|
|
231
|
+
alignItems: align
|
|
232
|
+
} : null),
|
|
233
|
+
...(justify ? {
|
|
234
|
+
justifyContent: justify
|
|
235
|
+
} : null),
|
|
236
|
+
...(wrap ? {
|
|
237
|
+
flexWrap: "wrap"
|
|
238
|
+
} : null),
|
|
239
|
+
...sx
|
|
240
|
+
};
|
|
241
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
278
242
|
ref: ref,
|
|
279
|
-
sx: layoutSx
|
|
280
|
-
|
|
243
|
+
sx: layoutSx,
|
|
244
|
+
...rest,
|
|
281
245
|
children: children
|
|
282
|
-
})
|
|
246
|
+
});
|
|
283
247
|
});
|
|
284
248
|
//# sourceMappingURL=Layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","names":["React","mq","BREAKPOINT_KEYS","jsx","_jsx","BP_ORDER","isPlainObject","v","_typeof","Array","isArray","isBreakpointObject","keys","Object","length","every","k","includes","resolveSx","sx","inlineStyle","undefined","css","className","sig","Math","abs","hashString","JSON","stringify","toString","styleWrite","byBp","xs","sm","md","lg","xl","hasResponsive","varSeq","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray","prop","value","varName","concat","_iterator","_createForOfIteratorHelper","_step","s","n","done","bp","bpVal","err","e","f","_iterator2","_step2","up","str","h","i","charCodeAt","useResponsiveStyleInjection","useInsertionEffect","document","id","getElementById","el","createElement","textContent","head","appendChild","Box","forwardRef","_ref","ref","_ref$as","as","Component","style","children","rest","_objectWithoutProperties","_excluded","_React$useMemo","useMemo","rspClass","merged","_objectSpread","mergedClass","filter","Boolean","join","Stack","_ref2","_ref2$direction","direction","_ref2$gap","gap","align","justify","_ref2$wrap","wrap","_excluded2","layoutSx","display","flexDirection","alignItems","justifyContent","flexWrap"],"sources":["../../../../src/lib/v2/components/Layout.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport { mq, BREAKPOINT_KEYS } from \"../tokens\";\r\nimport type { Breakpoint } from \"../types/common\";\r\n\r\n/**\r\n * v2.Box / v2.Stack — token-driven layout primitives.\r\n *\r\n * These render through the inline `style` attribute and stay theme-free\r\n * (no MUI theme runtime, no emotion). Tokens flow through CSS variables\r\n * on :root, exactly as before.\r\n *\r\n * Responsive escape hatch (R-RS.4)\r\n * --------------------------------\r\n * Historically `sx` accepted ONLY plain CSS-property values; a\r\n * breakpoint object (`{ xs, sm, md, lg, xl }`) was silently dropped to\r\n * \"[object Object]\" because inline styles can't carry media queries.\r\n * Modules that needed responsive variation were pushed into bespoke,\r\n * per-module CSS files — which fragments the breakpoint contract and\r\n * violates centralisation.\r\n *\r\n * `sx` now ALSO accepts breakpoint objects on any property, resolved\r\n * against the DESIGN-SYSTEM breakpoint TOKENS (tokens/breakpoints.js),\r\n * the same scale wired into the MUI theme. The mechanism is the standard\r\n * \"CSS variable swapped by media query\" technique, kept entirely inside\r\n * the lib so consumers never hand-write a media query:\r\n *\r\n * <Box sx={{ flexDirection: { xs: \"column\", md: \"row\" }, gap: \"var(--s-3)\" }} />\r\n *\r\n * → a generated scoped class sets, for that element only:\r\n * --pui-rsp-<sig>-0: column; (base, mobile-first)\r\n * ${mq.up(\"md\")} { --pui-rsp-<sig>-0: row } (md token)\r\n * and the inline style references flexDirection: var(--pui-rsp-<sig>-0).\r\n *\r\n * `xs` is treated as the base (min-width 0). sm/md/lg/xl emit\r\n * min-width media queries at the token values via mq.up(), so the\r\n * generated queries are byte-identical to theme.breakpoints.up().\r\n *\r\n * The generated class + variable names are CONTENT-ADDRESSED (derived\r\n * from a hash of the sx), so an identical sx signature always produces\r\n * the identical class and the identical <style> rule — injected once and\r\n * shared by every instance and every re-render. (A volatile counter here\r\n * would mint a fresh class + <style> on each render of an inline-sx Box,\r\n * leaking <style> tags into <head> without bound.)\r\n *\r\n * Precedence: `style` (explicit escape hatch) still overrides `sx`.\r\n *\r\n * <Box as=\"section\" sx={{ display: \"flex\" }} style={{ background: \"var(--surface)\" }} className=\"x\" />\r\n */\r\n\r\n/** A single CSS value, or a per-breakpoint map of CSS values (responsive). */\r\ntype SxValue =\r\n | string\r\n | number\r\n | Partial<Record<Breakpoint, string | number | undefined>>;\r\n\r\n/** Token-driven inline style; each property is a value or a responsive map. */\r\ntype Sx = { [property: string]: SxValue };\r\n\r\n/** Result of splitting an sx into inline style + generated responsive CSS. */\r\ntype ResolvedSx = {\r\n inlineStyle: React.CSSProperties | undefined;\r\n css: string;\r\n className: string | undefined;\r\n};\r\n\r\n/* Token breakpoint keys, ascending. xs is the mobile-first base and\r\n * never emits a media query. Sourced from the canonical breakpoints\r\n * token (tokens/breakpoints.js) so the order can't drift from the scale\r\n * wired into the MUI theme. */\r\nconst BP_ORDER = BREAKPOINT_KEYS;\r\n\r\nfunction isPlainObject(v: unknown): boolean {\r\n return v != null && typeof v === \"object\" && !Array.isArray(v);\r\n}\r\n\r\nfunction isBreakpointObject(\r\n v: unknown,\r\n): v is Partial<Record<Breakpoint, string | number | undefined>> {\r\n if (!isPlainObject(v)) return false;\r\n // Treat as responsive only if EVERY key is a known breakpoint name.\r\n // Avoids misreading a nested style object as a breakpoint map.\r\n const keys = Object.keys(v as Record<string, unknown>);\r\n return keys.length > 0 && keys.every((k) => (BP_ORDER as readonly string[]).includes(k));\r\n}\r\n\r\n/**\r\n * Split an sx object into:\r\n * - inlineStyle : plain props written directly (responsive props point\r\n * at a generated CSS variable)\r\n * - css : a scoped stylesheet string (or \"\" when nothing is\r\n * responsive)\r\n * - className : the generated scope class (or undefined)\r\n *\r\n * The className and the generated variable names are both derived from a\r\n * single content hash of the sx, so the result is STABLE across renders\r\n * and identical across instances that share the same sx — which is what\r\n * makes the <style> injection idempotent (see useResponsiveStyleInjection).\r\n *\r\n * Returns a stable result for a given sx via useMemo at the call site.\r\n */\r\nfunction resolveSx(sx: Sx | undefined): ResolvedSx {\r\n if (sx == null || !isPlainObject(sx)) {\r\n return { inlineStyle: undefined, css: \"\", className: undefined };\r\n }\r\n\r\n // Content-addressed signature. Derived ONCE from the sx so the class\r\n // and every generated var name are stable across renders/instances.\r\n const sig = Math.abs(hashString(JSON.stringify(sx))).toString(36);\r\n\r\n // inlineStyle is the returned CSSProperties; styleWrite is the same\r\n // object viewed as a keyed record so dynamic string keys can be written\r\n // (CSSProperties has no string index signature, so the view needs a\r\n // cast — the two are the SAME object at runtime).\r\n const inlineStyle: React.CSSProperties = {};\r\n const styleWrite = inlineStyle as unknown as Record<string, string | number | undefined>;\r\n /* Per-breakpoint declaration buckets, e.g. byBp.md === \"--pui-rsp-<sig>-0:row;\" */\r\n const byBp: Record<Breakpoint, string> = { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" };\r\n let hasResponsive = false;\r\n let varSeq = 0;\r\n\r\n for (const [prop, value] of Object.entries(sx)) {\r\n if (isBreakpointObject(value)) {\r\n hasResponsive = true;\r\n // Stable, signature-scoped var name (local index, not a global\r\n // counter). Only ever declared inside `.${className}`, so the name\r\n // is effectively scoped to elements carrying that class.\r\n const varName = `--pui-rsp-${sig}-${varSeq++}`;\r\n styleWrite[prop] = `var(${varName})`;\r\n for (const bp of BP_ORDER) {\r\n const bpVal = value[bp];\r\n if (bpVal != null) {\r\n byBp[bp] += `${varName}:${bpVal};`;\r\n }\r\n }\r\n } else {\r\n styleWrite[prop] = value;\r\n }\r\n }\r\n\r\n if (!hasResponsive) {\r\n return { inlineStyle, css: \"\", className: undefined };\r\n }\r\n\r\n const className = `pui-rsp-${sig}`;\r\n\r\n let css = \"\";\r\n // xs = base (no media query), then ascending min-width queries built\r\n // by the shared mq.up() helper (single breakpoint→media-query engine).\r\n if (byBp.xs) css += `.${className}{${byBp.xs}}`;\r\n for (const bp of [\"sm\", \"md\", \"lg\", \"xl\"] as const) {\r\n if (byBp[bp]) {\r\n css += `${mq.up(bp)}{.${className}{${byBp[bp]}}}`;\r\n }\r\n }\r\n\r\n return { inlineStyle, css, className };\r\n}\r\n\r\n/* Small, stable, dependency-free string hash (djb2) for class naming.\r\n * Used to content-address identical sx signatures so their generated\r\n * class + <style> rule de-duplicate in the DOM. */\r\nfunction hashString(str: string): number {\r\n let h = 5381;\r\n for (let i = 0; i < str.length; i++) {\r\n h = (h * 33) ^ str.charCodeAt(i);\r\n }\r\n return h | 0;\r\n}\r\n\r\n/* Injects the generated stylesheet for a responsive sx exactly once per\r\n * unique className. Idempotent: a second Box with the same sx signature\r\n * reuses the existing <style>. */\r\nfunction useResponsiveStyleInjection(css: string, className: string | undefined): void {\r\n React.useInsertionEffect(() => {\r\n if (!css || !className || typeof document === \"undefined\") return undefined;\r\n const id = `pui-rsp-style-${className}`;\r\n if (document.getElementById(id)) return undefined;\r\n const el = document.createElement(\"style\");\r\n el.id = id;\r\n el.textContent = css;\r\n document.head.appendChild(el);\r\n // Not removed on unmount: the rule is keyed by content hash and may\r\n // be shared by sibling instances; leaving it is cheap and avoids a\r\n // flash if the same sx remounts. The set is bounded by the number of\r\n // DISTINCT responsive sx signatures in the app, not instances.\r\n return undefined;\r\n }, [css, className]);\r\n}\r\n\r\nexport interface BoxProps extends React.HTMLAttributes<HTMLElement> {\r\n /** Element or component to render. @default \"div\" */\r\n as?: React.ElementType | undefined;\r\n /**\r\n * Token-driven inline style. Each property may be a plain CSS value or a\r\n * responsive breakpoint map (`{ xs, sm, md, lg, xl }`) resolved against the\r\n * design-system breakpoint tokens. `style` still overrides `sx`.\r\n */\r\n sx?: Sx | undefined;\r\n}\r\n\r\nexport const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(\r\n { as: Component = \"div\", sx, style, className, children, ...rest },\r\n ref,\r\n) {\r\n const { inlineStyle, css, className: rspClass } = React.useMemo(\r\n () => resolveSx(sx),\r\n [sx],\r\n );\r\n useResponsiveStyleInjection(css, rspClass);\r\n\r\n /* Merge sx-derived inline style + explicit style — style wins. */\r\n const merged =\r\n inlineStyle && style ? { ...inlineStyle, ...style } :\r\n inlineStyle ? inlineStyle :\r\n style ? style :\r\n undefined;\r\n\r\n const mergedClass = [className, rspClass].filter(Boolean).join(\" \") || undefined;\r\n\r\n return (\r\n <Component ref={ref} style={merged} className={mergedClass} {...rest}>\r\n {children}\r\n </Component>\r\n );\r\n});\r\n\r\nexport interface StackProps extends BoxProps {\r\n /** Flex direction. @default \"column\" */\r\n direction?: React.CSSProperties[\"flexDirection\"] | undefined;\r\n /** Gap between children (any CSS length or spacing var). @default \"var(--s-3)\" */\r\n gap?: string | number | undefined;\r\n /** align-items. */\r\n align?: React.CSSProperties[\"alignItems\"] | undefined;\r\n /** justify-content. */\r\n justify?: React.CSSProperties[\"justifyContent\"] | undefined;\r\n /** Set flex-wrap: wrap. @default false */\r\n wrap?: boolean | undefined;\r\n}\r\n\r\nexport const Stack = React.forwardRef<HTMLElement, StackProps>(function Stack(\r\n {\r\n direction = \"column\",\r\n gap = \"var(--s-3)\",\r\n align,\r\n justify,\r\n wrap = false,\r\n sx,\r\n children,\r\n ...rest\r\n },\r\n ref,\r\n) {\r\n const layoutSx: Sx = {\r\n display: \"flex\",\r\n flexDirection: direction,\r\n gap,\r\n ...(align ? { alignItems: align } : null),\r\n ...(justify ? { justifyContent: justify } : null),\r\n ...(wrap ? { flexWrap: \"wrap\" } : null),\r\n ...sx,\r\n };\r\n\r\n return (\r\n <Box ref={ref} sx={layoutSx} {...rest}>\r\n {children}\r\n </Box>\r\n );\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,EAAE,EAAEC,eAAe,QAAQ,WAAW;;AAG/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAMA;;AAGA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOA;AACA;AACA;AACA;AACA,IAAMC,QAAQ,GAAGH,eAAe;AAEhC,SAASI,aAAaA,CAACC,CAAU,EAAW;EAC1C,OAAOA,CAAC,IAAI,IAAI,IAAIC,OAAA,CAAOD,CAAC,MAAK,QAAQ,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,CAAC,CAAC;AAChE;AAEA,SAASI,kBAAkBA,CACzBJ,CAAU,EACqD;EAC/D,IAAI,CAACD,aAAa,CAACC,CAAC,CAAC,EAAE,OAAO,KAAK;EACnC;EACA;EACA,IAAMK,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACL,CAA4B,CAAC;EACtD,OAAOK,IAAI,CAACE,MAAM,GAAG,CAAC,IAAIF,IAAI,CAACG,KAAK,CAAC,UAACC,CAAC;IAAA,OAAMX,QAAQ,CAAuBY,QAAQ,CAACD,CAAC,CAAC;EAAA,EAAC;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,SAASA,CAACC,EAAkB,EAAc;EACjD,IAAIA,EA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q","BREAKPOINT_KEYS","jsx","_jsx","BP_ORDER","isPlainObject","v","Array","isArray","isBreakpointObject","keys","Object","length","every","k","includes","resolveSx","sx","inlineStyle","undefined","css","className","sig","Math","abs","hashString","JSON","stringify","toString","styleWrite","byBp","xs","sm","md","lg","xl","hasResponsive","varSeq","prop","value","entries","varName","bp","bpVal","up","str","h","i","charCodeAt","useResponsiveStyleInjection","useInsertionEffect","document","id","getElementById","el","createElement","textContent","head","appendChild","Box","forwardRef","as","Component","style","children","rest","ref","rspClass","useMemo","merged","mergedClass","filter","Boolean","join","Stack","direction","gap","align","justify","wrap","layoutSx","display","flexDirection","alignItems","justifyContent","flexWrap"],"sources":["../../../../src/lib/v2/components/Layout.tsx"],"sourcesContent":["import * as React from \"react\";\r\nimport { mq, BREAKPOINT_KEYS } from \"../tokens\";\r\nimport type { Breakpoint } from \"../types/common\";\r\n\r\n/**\r\n * v2.Box / v2.Stack — token-driven layout primitives.\r\n *\r\n * These render through the inline `style` attribute and stay theme-free\r\n * (no MUI theme runtime, no emotion). Tokens flow through CSS variables\r\n * on :root, exactly as before.\r\n *\r\n * Responsive escape hatch (R-RS.4)\r\n * --------------------------------\r\n * Historically `sx` accepted ONLY plain CSS-property values; a\r\n * breakpoint object (`{ xs, sm, md, lg, xl }`) was silently dropped to\r\n * \"[object Object]\" because inline styles can't carry media queries.\r\n * Modules that needed responsive variation were pushed into bespoke,\r\n * per-module CSS files — which fragments the breakpoint contract and\r\n * violates centralisation.\r\n *\r\n * `sx` now ALSO accepts breakpoint objects on any property, resolved\r\n * against the DESIGN-SYSTEM breakpoint TOKENS (tokens/breakpoints.js),\r\n * the same scale wired into the MUI theme. The mechanism is the standard\r\n * \"CSS variable swapped by media query\" technique, kept entirely inside\r\n * the lib so consumers never hand-write a media query:\r\n *\r\n * <Box sx={{ flexDirection: { xs: \"column\", md: \"row\" }, gap: \"var(--s-3)\" }} />\r\n *\r\n * → a generated scoped class sets, for that element only:\r\n * --pui-rsp-<sig>-0: column; (base, mobile-first)\r\n * ${mq.up(\"md\")} { --pui-rsp-<sig>-0: row } (md token)\r\n * and the inline style references flexDirection: var(--pui-rsp-<sig>-0).\r\n *\r\n * `xs` is treated as the base (min-width 0). sm/md/lg/xl emit\r\n * min-width media queries at the token values via mq.up(), so the\r\n * generated queries are byte-identical to theme.breakpoints.up().\r\n *\r\n * The generated class + variable names are CONTENT-ADDRESSED (derived\r\n * from a hash of the sx), so an identical sx signature always produces\r\n * the identical class and the identical <style> rule — injected once and\r\n * shared by every instance and every re-render. (A volatile counter here\r\n * would mint a fresh class + <style> on each render of an inline-sx Box,\r\n * leaking <style> tags into <head> without bound.)\r\n *\r\n * Precedence: `style` (explicit escape hatch) still overrides `sx`.\r\n *\r\n * <Box as=\"section\" sx={{ display: \"flex\" }} style={{ background: \"var(--surface)\" }} className=\"x\" />\r\n */\r\n\r\n/** A single CSS value, or a per-breakpoint map of CSS values (responsive). */\r\ntype SxValue =\r\n | string\r\n | number\r\n | Partial<Record<Breakpoint, string | number | undefined>>;\r\n\r\n/** Token-driven inline style; each property is a value or a responsive map. */\r\ntype Sx = { [property: string]: SxValue };\r\n\r\n/** Result of splitting an sx into inline style + generated responsive CSS. */\r\ntype ResolvedSx = {\r\n inlineStyle: React.CSSProperties | undefined;\r\n css: string;\r\n className: string | undefined;\r\n};\r\n\r\n/* Token breakpoint keys, ascending. xs is the mobile-first base and\r\n * never emits a media query. Sourced from the canonical breakpoints\r\n * token (tokens/breakpoints.js) so the order can't drift from the scale\r\n * wired into the MUI theme. */\r\nconst BP_ORDER = BREAKPOINT_KEYS;\r\n\r\nfunction isPlainObject(v: unknown): boolean {\r\n return v != null && typeof v === \"object\" && !Array.isArray(v);\r\n}\r\n\r\nfunction isBreakpointObject(\r\n v: unknown,\r\n): v is Partial<Record<Breakpoint, string | number | undefined>> {\r\n if (!isPlainObject(v)) return false;\r\n // Treat as responsive only if EVERY key is a known breakpoint name.\r\n // Avoids misreading a nested style object as a breakpoint map.\r\n const keys = Object.keys(v as Record<string, unknown>);\r\n return keys.length > 0 && keys.every((k) => (BP_ORDER as readonly string[]).includes(k));\r\n}\r\n\r\n/**\r\n * Split an sx object into:\r\n * - inlineStyle : plain props written directly (responsive props point\r\n * at a generated CSS variable)\r\n * - css : a scoped stylesheet string (or \"\" when nothing is\r\n * responsive)\r\n * - className : the generated scope class (or undefined)\r\n *\r\n * The className and the generated variable names are both derived from a\r\n * single content hash of the sx, so the result is STABLE across renders\r\n * and identical across instances that share the same sx — which is what\r\n * makes the <style> injection idempotent (see useResponsiveStyleInjection).\r\n *\r\n * Returns a stable result for a given sx via useMemo at the call site.\r\n */\r\nfunction resolveSx(sx: Sx | undefined): ResolvedSx {\r\n if (sx == null || !isPlainObject(sx)) {\r\n return { inlineStyle: undefined, css: \"\", className: undefined };\r\n }\r\n\r\n // Content-addressed signature. Derived ONCE from the sx so the class\r\n // and every generated var name are stable across renders/instances.\r\n const sig = Math.abs(hashString(JSON.stringify(sx))).toString(36);\r\n\r\n // inlineStyle is the returned CSSProperties; styleWrite is the same\r\n // object viewed as a keyed record so dynamic string keys can be written\r\n // (CSSProperties has no string index signature, so the view needs a\r\n // cast — the two are the SAME object at runtime).\r\n const inlineStyle: React.CSSProperties = {};\r\n const styleWrite = inlineStyle as unknown as Record<string, string | number | undefined>;\r\n /* Per-breakpoint declaration buckets, e.g. byBp.md === \"--pui-rsp-<sig>-0:row;\" */\r\n const byBp: Record<Breakpoint, string> = { xs: \"\", sm: \"\", md: \"\", lg: \"\", xl: \"\" };\r\n let hasResponsive = false;\r\n let varSeq = 0;\r\n\r\n for (const [prop, value] of Object.entries(sx)) {\r\n if (isBreakpointObject(value)) {\r\n hasResponsive = true;\r\n // Stable, signature-scoped var name (local index, not a global\r\n // counter). Only ever declared inside `.${className}`, so the name\r\n // is effectively scoped to elements carrying that class.\r\n const varName = `--pui-rsp-${sig}-${varSeq++}`;\r\n styleWrite[prop] = `var(${varName})`;\r\n for (const bp of BP_ORDER) {\r\n const bpVal = value[bp];\r\n if (bpVal != null) {\r\n byBp[bp] += `${varName}:${bpVal};`;\r\n }\r\n }\r\n } else {\r\n styleWrite[prop] = value;\r\n }\r\n }\r\n\r\n if (!hasResponsive) {\r\n return { inlineStyle, css: \"\", className: undefined };\r\n }\r\n\r\n const className = `pui-rsp-${sig}`;\r\n\r\n let css = \"\";\r\n // xs = base (no media query), then ascending min-width queries built\r\n // by the shared mq.up() helper (single breakpoint→media-query engine).\r\n if (byBp.xs) css += `.${className}{${byBp.xs}}`;\r\n for (const bp of [\"sm\", \"md\", \"lg\", \"xl\"] as const) {\r\n if (byBp[bp]) {\r\n css += `${mq.up(bp)}{.${className}{${byBp[bp]}}}`;\r\n }\r\n }\r\n\r\n return { inlineStyle, css, className };\r\n}\r\n\r\n/* Small, stable, dependency-free string hash (djb2) for class naming.\r\n * Used to content-address identical sx signatures so their generated\r\n * class + <style> rule de-duplicate in the DOM. */\r\nfunction hashString(str: string): number {\r\n let h = 5381;\r\n for (let i = 0; i < str.length; i++) {\r\n h = (h * 33) ^ str.charCodeAt(i);\r\n }\r\n return h | 0;\r\n}\r\n\r\n/* Injects the generated stylesheet for a responsive sx exactly once per\r\n * unique className. Idempotent: a second Box with the same sx signature\r\n * reuses the existing <style>. */\r\nfunction useResponsiveStyleInjection(css: string, className: string | undefined): void {\r\n React.useInsertionEffect(() => {\r\n if (!css || !className || typeof document === \"undefined\") return undefined;\r\n const id = `pui-rsp-style-${className}`;\r\n if (document.getElementById(id)) return undefined;\r\n const el = document.createElement(\"style\");\r\n el.id = id;\r\n el.textContent = css;\r\n document.head.appendChild(el);\r\n // Not removed on unmount: the rule is keyed by content hash and may\r\n // be shared by sibling instances; leaving it is cheap and avoids a\r\n // flash if the same sx remounts. The set is bounded by the number of\r\n // DISTINCT responsive sx signatures in the app, not instances.\r\n return undefined;\r\n }, [css, className]);\r\n}\r\n\r\nexport interface BoxProps extends React.HTMLAttributes<HTMLElement> {\r\n /** Element or component to render. @default \"div\" */\r\n as?: React.ElementType | undefined;\r\n /**\r\n * Token-driven inline style. Each property may be a plain CSS value or a\r\n * responsive breakpoint map (`{ xs, sm, md, lg, xl }`) resolved against the\r\n * design-system breakpoint tokens. `style` still overrides `sx`.\r\n */\r\n sx?: Sx | undefined;\r\n}\r\n\r\nexport const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(\r\n { as: Component = \"div\", sx, style, className, children, ...rest },\r\n ref,\r\n) {\r\n const { inlineStyle, css, className: rspClass } = React.useMemo(\r\n () => resolveSx(sx),\r\n [sx],\r\n );\r\n useResponsiveStyleInjection(css, rspClass);\r\n\r\n /* Merge sx-derived inline style + explicit style — style wins. */\r\n const merged =\r\n inlineStyle && style ? { ...inlineStyle, ...style } :\r\n inlineStyle ? inlineStyle :\r\n style ? style :\r\n undefined;\r\n\r\n const mergedClass = [className, rspClass].filter(Boolean).join(\" \") || undefined;\r\n\r\n return (\r\n <Component ref={ref} style={merged} className={mergedClass} {...rest}>\r\n {children}\r\n </Component>\r\n );\r\n});\r\n\r\nexport interface StackProps extends BoxProps {\r\n /** Flex direction. @default \"column\" */\r\n direction?: React.CSSProperties[\"flexDirection\"] | undefined;\r\n /** Gap between children (any CSS length or spacing var). @default \"var(--s-3)\" */\r\n gap?: string | number | undefined;\r\n /** align-items. */\r\n align?: React.CSSProperties[\"alignItems\"] | undefined;\r\n /** justify-content. */\r\n justify?: React.CSSProperties[\"justifyContent\"] | undefined;\r\n /** Set flex-wrap: wrap. @default false */\r\n wrap?: boolean | undefined;\r\n}\r\n\r\nexport const Stack = React.forwardRef<HTMLElement, StackProps>(function Stack(\r\n {\r\n direction = \"column\",\r\n gap = \"var(--s-3)\",\r\n align,\r\n justify,\r\n wrap = false,\r\n sx,\r\n children,\r\n ...rest\r\n },\r\n ref,\r\n) {\r\n const layoutSx: Sx = {\r\n display: \"flex\",\r\n flexDirection: direction,\r\n gap,\r\n ...(align ? { alignItems: align } : null),\r\n ...(justify ? { justifyContent: justify } : null),\r\n ...(wrap ? { flexWrap: \"wrap\" } : null),\r\n ...sx,\r\n };\r\n\r\n return (\r\n <Box ref={ref} sx={layoutSx} {...rest}>\r\n {children}\r\n </Box>\r\n );\r\n});\r\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,EAAE,EAAEC,eAAe,QAAQ,WAAW;;AAG/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAMA;;AAGA;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAOA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAGH,eAAe;AAEhC,SAASI,aAAaA,CAACC,CAAU,EAAW;EAC1C,OAAOA,CAAC,IAAI,IAAI,IAAI,OAAOA,CAAC,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC;AAChE;AAEA,SAASG,kBAAkBA,CACzBH,CAAU,EACqD;EAC/D,IAAI,CAACD,aAAa,CAACC,CAAC,CAAC,EAAE,OAAO,KAAK;EACnC;EACA;EACA,MAAMI,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACJ,CAA4B,CAAC;EACtD,OAAOI,IAAI,CAACE,MAAM,GAAG,CAAC,IAAIF,IAAI,CAACG,KAAK,CAAEC,CAAC,IAAMV,QAAQ,CAAuBW,QAAQ,CAACD,CAAC,CAAC,CAAC;AAC1F;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,SAASA,CAACC,EAAkB,EAAc;EACjD,IAAIA,EAAE,IAAI,IAAI,IAAI,CAACZ,aAAa,CAACY,EAAE,CAAC,EAAE;IACpC,OAAO;MAAEC,WAAW,EAAEC,SAAS;MAAEC,GAAG,EA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C6D,UAAU,CAA0B,SAASc,KAAKA,CAC3E;EACEC,SAAS,GAAG,QAAQ;EACpBC,GAAG,GAAG,YAAY;EAClBC,KAAK;EACLC,OAAO;EACPC,IAAI,GAAG,KAAK;EACZ9D,EAAE;EACF+C,QAAQ;EACR,GAAGC;AACL,CAAC,EACDC,GAAG,EACH;EACA,MAAMc,QAAY,GAAG;IACnBC,OAAO,EAAE,MAAM;IACfC,aAAa,EAAEP,SAAS;IACxBC,GAAG;IACH,IAAIC,KAAK,GAAM;MAAEM,UAAU,EAAMN;IAAQ,CAAC,GAAG,IAAI,CAAC;IAClD,IAAIC,OAAO,GAAI;MAAEM,cAAc,EAAEN;IAAQ,CAAC,GAAG,IAAI,CAAC;IAClD,IAAIC,IAAI,GAAO;MAAEM,QAAQ,EAAE;IAAO,CAAC,GAAU,IAAI,CAAC;IAClD,GAAGpE;EACL,CAAC;EAED,oBACEd,IAAA,CAACwD,GAAG;IAACO,GAAG,EAAEA,GAAI;IAACjD,EAAE,EAAE+D,QAAS;IAAA,GAAKf,IAAI;IAAAD,QAAA,EAClCA;EAAQ,CACN,CAAC;AAEV,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
1
|
import * as React from "react";
|
|
8
2
|
import Box from "@mui/material/Box";
|
|
9
3
|
import OverflowMenu from "./OverflowMenu";
|
|
@@ -111,13 +105,13 @@ import KV from "./KV";
|
|
|
111
105
|
* in a wrapping row.
|
|
112
106
|
*/
|
|
113
107
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
114
|
-
|
|
108
|
+
const CARD_INNER_SX = Object.freeze({
|
|
115
109
|
display: "flex",
|
|
116
110
|
flexDirection: "column",
|
|
117
111
|
gap: "var(--s-2)",
|
|
118
112
|
padding: "var(--s-3)"
|
|
119
113
|
});
|
|
120
|
-
|
|
114
|
+
const HEADER_SX = Object.freeze({
|
|
121
115
|
display: "flex",
|
|
122
116
|
alignItems: "flex-start",
|
|
123
117
|
justifyContent: "space-between",
|
|
@@ -127,19 +121,19 @@ var HEADER_SX = Object.freeze({
|
|
|
127
121
|
/* Groups `leading` + title on the left of the header so the kebab keeps its
|
|
128
122
|
* space-between position. `minWidth: 0` is what lets the title's ellipsis
|
|
129
123
|
* actually engage inside a flex child. */
|
|
130
|
-
|
|
124
|
+
const HEADER_MAIN_SX = Object.freeze({
|
|
131
125
|
display: "flex",
|
|
132
126
|
alignItems: "center",
|
|
133
127
|
gap: "var(--s-2)",
|
|
134
128
|
minWidth: 0,
|
|
135
129
|
flex: 1
|
|
136
130
|
});
|
|
137
|
-
|
|
131
|
+
const LEADING_SX = Object.freeze({
|
|
138
132
|
display: "inline-flex",
|
|
139
133
|
alignItems: "center",
|
|
140
134
|
flexShrink: 0
|
|
141
135
|
});
|
|
142
|
-
|
|
136
|
+
const TITLE_BASE_SX = Object.freeze({
|
|
143
137
|
fontWeight: "var(--fw-semibold)",
|
|
144
138
|
fontSize: "var(--text-sm)",
|
|
145
139
|
color: "var(--fg)",
|
|
@@ -149,23 +143,24 @@ var TITLE_BASE_SX = Object.freeze({
|
|
|
149
143
|
textOverflow: "ellipsis",
|
|
150
144
|
whiteSpace: "nowrap"
|
|
151
145
|
});
|
|
152
|
-
|
|
146
|
+
const TITLE_MONO_SX = Object.freeze({
|
|
147
|
+
...TITLE_BASE_SX,
|
|
153
148
|
fontFamily: "var(--font-mono)"
|
|
154
|
-
})
|
|
155
|
-
|
|
149
|
+
});
|
|
150
|
+
const SUBTITLE_SX = Object.freeze({
|
|
156
151
|
fontSize: "var(--text-sm)",
|
|
157
152
|
color: "var(--fg-muted)",
|
|
158
153
|
overflow: "hidden",
|
|
159
154
|
textOverflow: "ellipsis",
|
|
160
155
|
whiteSpace: "nowrap"
|
|
161
156
|
});
|
|
162
|
-
|
|
157
|
+
const CHIPS_SX = Object.freeze({
|
|
163
158
|
display: "flex",
|
|
164
159
|
alignItems: "center",
|
|
165
160
|
gap: "var(--s-1)",
|
|
166
161
|
flexWrap: "wrap"
|
|
167
162
|
});
|
|
168
|
-
|
|
163
|
+
const META_SX = Object.freeze({
|
|
169
164
|
fontSize: "var(--text-xs)",
|
|
170
165
|
color: "var(--fg-subtle)"
|
|
171
166
|
});
|
|
@@ -174,7 +169,7 @@ var META_SX = Object.freeze({
|
|
|
174
169
|
* a single column would be more readable, but 320px is the Charter's narrowest
|
|
175
170
|
* supported breakpoint (§07.2 xs) and two columns still fit there. Matches the
|
|
176
171
|
* MOBILE_CARD_KV_SX both modules converged on independently. */
|
|
177
|
-
|
|
172
|
+
const KV_GRID_SX = Object.freeze({
|
|
178
173
|
display: "grid",
|
|
179
174
|
gridTemplateColumns: "1fr 1fr",
|
|
180
175
|
gap: "var(--s-2)"
|
|
@@ -183,7 +178,7 @@ var KV_GRID_SX = Object.freeze({
|
|
|
183
178
|
/* Right cluster of the header row: [trailing] then the kebab. One shared
|
|
184
179
|
* wrapper so a card can carry both a visible action and an overflow menu, and
|
|
185
180
|
* so propagation is stopped once for the whole interactive cluster. */
|
|
186
|
-
|
|
181
|
+
const HEADER_END_SX = Object.freeze({
|
|
187
182
|
display: "inline-flex",
|
|
188
183
|
alignItems: "center",
|
|
189
184
|
gap: "var(--s-1)",
|
|
@@ -192,60 +187,56 @@ var HEADER_END_SX = Object.freeze({
|
|
|
192
187
|
|
|
193
188
|
/** One label/value pair in the card's `kv` grid. Mirrors v2.KV's own props. */
|
|
194
189
|
|
|
195
|
-
function MobileRowCard(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
190
|
+
function MobileRowCard({
|
|
191
|
+
leading,
|
|
192
|
+
trailing,
|
|
193
|
+
title,
|
|
194
|
+
titleMono = false,
|
|
195
|
+
subtitle,
|
|
196
|
+
chips,
|
|
197
|
+
kv,
|
|
198
|
+
meta,
|
|
199
|
+
actions,
|
|
200
|
+
/* No default — see the prop's doc comment. Forwarded only when the host
|
|
201
|
+
* supplies one, so OverflowMenu's own default applies otherwise. */
|
|
202
|
+
actionsAriaLabel
|
|
203
|
+
}) {
|
|
207
204
|
// Filter out divider entries (OverflowMenu separator marks) and
|
|
208
205
|
// null/undefined actions so the kebab only renders when there is
|
|
209
206
|
// at least one real action available.
|
|
210
|
-
|
|
207
|
+
const visibleActions = React.useMemo(() => {
|
|
211
208
|
if (!Array.isArray(actions)) return [];
|
|
212
|
-
return actions.filter(
|
|
213
|
-
return a && !a.divider;
|
|
214
|
-
});
|
|
209
|
+
return actions.filter(a => a && !a.divider);
|
|
215
210
|
}, [actions]);
|
|
216
|
-
|
|
211
|
+
const visibleChips = React.useMemo(() => {
|
|
217
212
|
if (!Array.isArray(chips)) return [];
|
|
218
213
|
return chips.filter(Boolean);
|
|
219
214
|
}, [chips]);
|
|
220
|
-
|
|
215
|
+
const metaParts = React.useMemo(() => {
|
|
221
216
|
if (!Array.isArray(meta)) return [];
|
|
222
|
-
return meta.filter(
|
|
223
|
-
return p != null && p !== "";
|
|
224
|
-
});
|
|
217
|
+
return meta.filter(p => p != null && p !== "");
|
|
225
218
|
}, [meta]);
|
|
226
219
|
|
|
227
220
|
/* Only `label` is required — a pair with an empty value is kept on purpose so
|
|
228
221
|
* KV renders its "—" placeholder and the grid keeps its shape across rows.
|
|
229
222
|
* Entries missing a label are dropped: KV would emit an empty eyebrow and an
|
|
230
223
|
* aria-labelledby pointing at nothing. */
|
|
231
|
-
|
|
224
|
+
const kvPairs = React.useMemo(() => {
|
|
232
225
|
if (!Array.isArray(kv)) return [];
|
|
233
|
-
return kv.filter(
|
|
234
|
-
return p != null && p.label != null && p.label !== "";
|
|
235
|
-
});
|
|
226
|
+
return kv.filter(p => p != null && p.label != null && p.label !== "");
|
|
236
227
|
}, [kv]);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
228
|
+
const hasActions = visibleActions.length > 0;
|
|
229
|
+
const hasTitle = title != null && title !== "";
|
|
230
|
+
const hasLeading = leading != null && leading !== "";
|
|
231
|
+
const hasTrailing = trailing != null && trailing !== "";
|
|
232
|
+
const hasHeader = hasTitle || hasActions || hasLeading || hasTrailing;
|
|
233
|
+
const hasSubtitle = subtitle != null && subtitle !== "";
|
|
243
234
|
|
|
244
235
|
// Title attribute (native hover tooltip) is set only when the value
|
|
245
236
|
// is a string — wrapping a React node yields a "[object Object]"
|
|
246
237
|
// tooltip which is worse than no tooltip.
|
|
247
|
-
|
|
248
|
-
|
|
238
|
+
const titleAttr = typeof title === "string" ? title : undefined;
|
|
239
|
+
const subtitleAttr = typeof subtitle === "string" ? subtitle : undefined;
|
|
249
240
|
return /*#__PURE__*/_jsxs(Box, {
|
|
250
241
|
sx: CARD_INNER_SX,
|
|
251
242
|
children: [hasHeader && /*#__PURE__*/_jsxs(Box, {
|
|
@@ -268,17 +259,16 @@ function MobileRowCard(_ref) {
|
|
|
268
259
|
// the kebab, doesn't also fire onRowClick.
|
|
269
260
|
_jsxs(Box, {
|
|
270
261
|
sx: HEADER_END_SX,
|
|
271
|
-
onClick:
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
} : {}))]
|
|
262
|
+
onClick: e => e.stopPropagation(),
|
|
263
|
+
onKeyDown: e => e.stopPropagation(),
|
|
264
|
+
children: [hasTrailing && trailing, hasActions && /*#__PURE__*/_jsx(OverflowMenu, {
|
|
265
|
+
...(actionsAriaLabel !== undefined ? {
|
|
266
|
+
ariaLabel: actionsAriaLabel
|
|
267
|
+
} : {}),
|
|
268
|
+
...(actions !== undefined ? {
|
|
269
|
+
actions
|
|
270
|
+
} : {})
|
|
271
|
+
})]
|
|
282
272
|
})]
|
|
283
273
|
}), hasSubtitle && /*#__PURE__*/_jsx(Box, {
|
|
284
274
|
sx: SUBTITLE_SX,
|
|
@@ -286,24 +276,23 @@ function MobileRowCard(_ref) {
|
|
|
286
276
|
children: subtitle
|
|
287
277
|
}), visibleChips.length > 0 && /*#__PURE__*/_jsx(Box, {
|
|
288
278
|
sx: CHIPS_SX,
|
|
289
|
-
children: visibleChips.map(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
}, i);
|
|
293
|
-
})
|
|
279
|
+
children: visibleChips.map((c, i) => /*#__PURE__*/_jsx(React.Fragment, {
|
|
280
|
+
children: c
|
|
281
|
+
}, i))
|
|
294
282
|
}), kvPairs.length > 0 && /*#__PURE__*/_jsx(Box, {
|
|
295
283
|
sx: KV_GRID_SX,
|
|
296
|
-
children: kvPairs.map(
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}, pair.value !== undefined ? {
|
|
284
|
+
children: kvPairs.map((pair, i) => /*#__PURE__*/_jsx(KV, {
|
|
285
|
+
label: pair.label,
|
|
286
|
+
...(pair.value !== undefined ? {
|
|
300
287
|
value: pair.value
|
|
301
|
-
} : {}),
|
|
288
|
+
} : {}),
|
|
289
|
+
...(pair.mono !== undefined ? {
|
|
302
290
|
mono: pair.mono
|
|
303
|
-
} : {}),
|
|
291
|
+
} : {}),
|
|
292
|
+
...(pair.fallback !== undefined ? {
|
|
304
293
|
fallback: pair.fallback
|
|
305
|
-
} : {})
|
|
306
|
-
})
|
|
294
|
+
} : {})
|
|
295
|
+
}, i))
|
|
307
296
|
}), metaParts.length > 0 && /*#__PURE__*/_jsx(Box, {
|
|
308
297
|
sx: META_SX,
|
|
309
298
|
children: metaParts.join(" · ")
|