@portnet/ui 5.0.27 → 6.0.0
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 +524 -0
- package/README.md +101 -38
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +174 -203
- package/dist/index.js.map +1 -0
- package/dist/v2/__tests__/MobileRowCard.test.js +337 -0
- package/dist/v2/__tests__/MobileRowCard.test.js.map +1 -0
- package/dist/v2/__tests__/apiError.test.js +182 -0
- package/dist/v2/__tests__/apiError.test.js.map +1 -0
- package/dist/v2/__tests__/banned-patterns.test.js +272 -0
- package/dist/v2/__tests__/banned-patterns.test.js.map +1 -0
- package/dist/v2/__tests__/contrast-palette.test.js +225 -0
- package/dist/v2/__tests__/contrast-palette.test.js.map +1 -0
- package/dist/v2/__tests__/cssVariables.test.js +158 -0
- package/dist/v2/__tests__/cssVariables.test.js.map +1 -0
- package/dist/v2/__tests__/labels-merge.test.js +153 -0
- package/dist/v2/__tests__/labels-merge.test.js.map +1 -0
- package/dist/v2/__tests__/locale-fallback.test.js +111 -0
- package/dist/v2/__tests__/locale-fallback.test.js.map +1 -0
- package/dist/v2/__tests__/useFocusTrap.test.js +517 -0
- package/dist/v2/__tests__/useFocusTrap.test.js.map +1 -0
- package/dist/v2/components/Accordion.d.ts +56 -0
- package/dist/v2/components/Accordion.d.ts.map +1 -0
- package/dist/v2/components/Accordion.js +238 -0
- package/dist/v2/components/Accordion.js.map +1 -0
- package/dist/v2/components/ActionStrip.d.ts +67 -0
- package/dist/v2/components/ActionStrip.d.ts.map +1 -0
- package/dist/v2/components/ActionStrip.js +154 -0
- package/dist/v2/components/ActionStrip.js.map +1 -0
- package/dist/v2/components/Banner.d.ts +49 -0
- package/dist/v2/components/Banner.d.ts.map +1 -0
- package/dist/v2/components/Banner.js +183 -0
- package/dist/v2/components/Banner.js.map +1 -0
- package/dist/v2/components/Busy.d.ts +18 -0
- package/dist/v2/components/Busy.d.ts.map +1 -0
- package/dist/v2/components/Busy.js +104 -0
- package/dist/v2/components/Busy.js.map +1 -0
- package/dist/v2/components/Button.d.ts +36 -0
- package/dist/v2/components/Button.d.ts.map +1 -0
- package/dist/v2/components/Button.js +122 -0
- package/dist/v2/components/Button.js.map +1 -0
- package/dist/v2/components/CategoryTag.d.ts +45 -0
- package/dist/v2/components/CategoryTag.d.ts.map +1 -0
- package/dist/v2/components/CategoryTag.js +89 -0
- package/dist/v2/components/CategoryTag.js.map +1 -0
- package/dist/v2/components/Checkbox.d.ts +59 -0
- package/dist/v2/components/Checkbox.d.ts.map +1 -0
- package/dist/v2/components/Checkbox.js +134 -0
- package/dist/v2/components/Checkbox.js.map +1 -0
- package/dist/v2/components/Chip.d.ts +48 -0
- package/dist/v2/components/Chip.d.ts.map +1 -0
- package/dist/v2/components/Chip.js +131 -0
- package/dist/v2/components/Chip.js.map +1 -0
- package/dist/v2/components/Combobox.d.ts +134 -0
- package/dist/v2/components/Combobox.d.ts.map +1 -0
- package/dist/v2/components/Combobox.js +399 -0
- package/dist/v2/components/Combobox.js.map +1 -0
- package/dist/v2/components/CommandPalette.d.ts +36 -0
- package/dist/v2/components/CommandPalette.d.ts.map +1 -0
- package/dist/v2/components/CommandPalette.js +672 -0
- package/dist/v2/components/CommandPalette.js.map +1 -0
- package/dist/v2/components/ConfirmDialog.d.ts +23 -0
- package/dist/v2/components/ConfirmDialog.d.ts.map +1 -0
- package/dist/v2/components/ConfirmDialog.js +150 -0
- package/dist/v2/components/ConfirmDialog.js.map +1 -0
- package/dist/v2/components/DatePicker.d.ts +21 -0
- package/dist/v2/components/DatePicker.d.ts.map +1 -0
- package/dist/v2/components/DatePicker.js +207 -0
- package/dist/v2/components/DatePicker.js.map +1 -0
- package/dist/v2/components/DateRangePicker.d.ts +81 -0
- package/dist/v2/components/DateRangePicker.d.ts.map +1 -0
- package/dist/v2/components/DateRangePicker.js +295 -0
- package/dist/v2/components/DateRangePicker.js.map +1 -0
- package/dist/v2/components/DateTimePicker.d.ts +21 -0
- package/dist/v2/components/DateTimePicker.d.ts.map +1 -0
- package/dist/v2/components/DateTimePicker.js +189 -0
- package/dist/v2/components/DateTimePicker.js.map +1 -0
- package/dist/v2/components/Drawer.d.ts +34 -0
- package/dist/v2/components/Drawer.d.ts.map +1 -0
- package/dist/v2/components/Drawer.js +339 -0
- package/dist/v2/components/Drawer.js.map +1 -0
- package/dist/v2/components/Dropzone.d.ts +150 -0
- package/dist/v2/components/Dropzone.d.ts.map +1 -0
- package/dist/v2/components/Dropzone.js +539 -0
- package/dist/v2/components/Dropzone.js.map +1 -0
- package/dist/v2/components/EmptyState.d.ts +36 -0
- package/dist/v2/components/EmptyState.d.ts.map +1 -0
- package/dist/v2/components/EmptyState.js +112 -0
- package/dist/v2/components/EmptyState.js.map +1 -0
- package/dist/v2/components/FavoriteToggle.d.ts +22 -0
- package/dist/v2/components/FavoriteToggle.d.ts.map +1 -0
- package/dist/v2/components/FavoriteToggle.js +134 -0
- package/dist/v2/components/FavoriteToggle.js.map +1 -0
- package/dist/v2/components/Field.d.ts +58 -0
- package/dist/v2/components/Field.d.ts.map +1 -0
- package/dist/v2/components/Field.js +186 -0
- package/dist/v2/components/Field.js.map +1 -0
- package/dist/v2/components/FieldHelp.d.ts +54 -0
- package/dist/v2/components/FieldHelp.d.ts.map +1 -0
- package/dist/v2/components/FieldHelp.js +209 -0
- package/dist/v2/components/FieldHelp.js.map +1 -0
- package/dist/v2/components/FilterTab.d.ts +35 -0
- package/dist/v2/components/FilterTab.d.ts.map +1 -0
- package/dist/v2/components/FilterTab.js +144 -0
- package/dist/v2/components/FilterTab.js.map +1 -0
- package/dist/v2/components/ForbiddenPage.d.ts +40 -0
- package/dist/v2/components/ForbiddenPage.d.ts.map +1 -0
- package/dist/v2/components/ForbiddenPage.js +81 -0
- package/dist/v2/components/ForbiddenPage.js.map +1 -0
- package/dist/v2/components/FormGrid.d.ts +76 -0
- package/dist/v2/components/FormGrid.d.ts.map +1 -0
- package/dist/v2/components/FormGrid.js +177 -0
- package/dist/v2/components/FormGrid.js.map +1 -0
- package/dist/v2/components/FormikDisplay.d.ts +38 -0
- package/dist/v2/components/FormikDisplay.d.ts.map +1 -0
- package/dist/v2/components/FormikDisplay.js +125 -0
- package/dist/v2/components/FormikDisplay.js.map +1 -0
- package/dist/v2/components/Input.d.ts +62 -0
- package/dist/v2/components/Input.d.ts.map +1 -0
- package/dist/v2/components/Input.js +115 -0
- package/dist/v2/components/Input.js.map +1 -0
- package/dist/v2/components/KPICard.d.ts +22 -0
- package/dist/v2/components/KPICard.d.ts.map +1 -0
- package/dist/v2/components/KPICard.js +205 -0
- package/dist/v2/components/KPICard.js.map +1 -0
- package/dist/v2/components/KV.d.ts +25 -0
- package/dist/v2/components/KV.d.ts.map +1 -0
- package/dist/v2/components/KV.js +82 -0
- package/dist/v2/components/KV.js.map +1 -0
- package/dist/v2/components/KVGrid.d.ts +44 -0
- package/dist/v2/components/KVGrid.d.ts.map +1 -0
- package/dist/v2/components/KVGrid.js +73 -0
- package/dist/v2/components/KVGrid.js.map +1 -0
- package/dist/v2/components/Layout.d.ts +78 -0
- package/dist/v2/components/Layout.d.ts.map +1 -0
- package/dist/v2/components/Layout.js +284 -0
- package/dist/v2/components/Layout.js.map +1 -0
- package/dist/v2/components/MobileRowCard.d.ts +63 -0
- package/dist/v2/components/MobileRowCard.d.ts.map +1 -0
- package/dist/v2/components/MobileRowCard.js +321 -0
- package/dist/v2/components/MobileRowCard.js.map +1 -0
- package/dist/v2/components/Modal.d.ts +21 -0
- package/dist/v2/components/Modal.d.ts.map +1 -0
- package/dist/v2/components/Modal.js +281 -0
- package/dist/v2/components/Modal.js.map +1 -0
- package/dist/v2/components/NetworkErrorPage.d.ts +11 -0
- package/dist/v2/components/NetworkErrorPage.d.ts.map +1 -0
- package/dist/v2/components/NetworkErrorPage.js +86 -0
- package/dist/v2/components/NetworkErrorPage.js.map +1 -0
- package/dist/v2/components/NotFoundPage.d.ts +9 -0
- package/dist/v2/components/NotFoundPage.d.ts.map +1 -0
- package/dist/v2/components/NotFoundPage.js +66 -0
- package/dist/v2/components/NotFoundPage.js.map +1 -0
- package/dist/v2/components/NumberInput.d.ts +83 -0
- package/dist/v2/components/NumberInput.d.ts.map +1 -0
- package/dist/v2/components/NumberInput.js +316 -0
- package/dist/v2/components/NumberInput.js.map +1 -0
- package/dist/v2/components/OverflowMenu.d.ts +55 -0
- package/dist/v2/components/OverflowMenu.d.ts.map +1 -0
- package/dist/v2/components/OverflowMenu.js +196 -0
- package/dist/v2/components/OverflowMenu.js.map +1 -0
- package/dist/v2/components/PdfViewer.d.ts +56 -0
- package/dist/v2/components/PdfViewer.d.ts.map +1 -0
- package/dist/v2/components/PdfViewer.js +132 -0
- package/dist/v2/components/PdfViewer.js.map +1 -0
- package/dist/v2/components/ProgressBar.d.ts +53 -0
- package/dist/v2/components/ProgressBar.d.ts.map +1 -0
- package/dist/v2/components/ProgressBar.js +209 -0
- package/dist/v2/components/ProgressBar.js.map +1 -0
- package/dist/v2/components/Radio.d.ts +78 -0
- package/dist/v2/components/Radio.d.ts.map +1 -0
- package/dist/v2/components/Radio.js +238 -0
- package/dist/v2/components/Radio.js.map +1 -0
- package/dist/v2/components/SectionHeader.d.ts +53 -0
- package/dist/v2/components/SectionHeader.d.ts.map +1 -0
- package/dist/v2/components/SectionHeader.js +140 -0
- package/dist/v2/components/SectionHeader.js.map +1 -0
- package/dist/v2/components/Segmented.d.ts +61 -0
- package/dist/v2/components/Segmented.d.ts.map +1 -0
- package/dist/v2/components/Segmented.js +261 -0
- package/dist/v2/components/Segmented.js.map +1 -0
- package/dist/v2/components/Select.d.ts +72 -0
- package/dist/v2/components/Select.d.ts.map +1 -0
- package/dist/v2/components/Select.js +382 -0
- package/dist/v2/components/Select.js.map +1 -0
- package/dist/v2/components/ServerErrorPage.d.ts +11 -0
- package/dist/v2/components/ServerErrorPage.d.ts.map +1 -0
- package/dist/v2/components/ServerErrorPage.js +82 -0
- package/dist/v2/components/ServerErrorPage.js.map +1 -0
- package/dist/v2/components/Skeleton.d.ts +56 -0
- package/dist/v2/components/Skeleton.d.ts.map +1 -0
- package/dist/v2/components/Skeleton.js +281 -0
- package/dist/v2/components/Skeleton.js.map +1 -0
- package/dist/v2/components/SkipLink.d.ts +30 -0
- package/dist/v2/components/SkipLink.d.ts.map +1 -0
- package/dist/v2/components/SkipLink.js +58 -0
- package/dist/v2/components/SkipLink.js.map +1 -0
- package/dist/v2/components/Spinner.d.ts +40 -0
- package/dist/v2/components/Spinner.d.ts.map +1 -0
- package/dist/v2/components/Spinner.js +76 -0
- package/dist/v2/components/Spinner.js.map +1 -0
- package/dist/v2/components/Status.d.ts +42 -0
- package/dist/v2/components/Status.d.ts.map +1 -0
- package/dist/v2/components/Status.js +71 -0
- package/dist/v2/components/Status.js.map +1 -0
- package/dist/v2/components/Stepper.d.ts +136 -0
- package/dist/v2/components/Stepper.d.ts.map +1 -0
- package/dist/v2/components/Stepper.js +415 -0
- package/dist/v2/components/Stepper.js.map +1 -0
- package/dist/v2/components/Switch.d.ts +30 -0
- package/dist/v2/components/Switch.d.ts.map +1 -0
- package/dist/v2/components/Switch.js +136 -0
- package/dist/v2/components/Switch.js.map +1 -0
- package/dist/v2/components/Tabs.d.ts +49 -0
- package/dist/v2/components/Tabs.d.ts.map +1 -0
- package/dist/v2/components/Tabs.js +160 -0
- package/dist/v2/components/Tabs.js.map +1 -0
- package/dist/v2/components/TelInput.d.ts +33 -0
- package/dist/v2/components/TelInput.d.ts.map +1 -0
- package/dist/v2/components/TelInput.js +282 -0
- package/dist/v2/components/TelInput.js.map +1 -0
- package/dist/v2/components/Textarea.d.ts +23 -0
- package/dist/v2/components/Textarea.d.ts.map +1 -0
- package/dist/v2/components/Textarea.js +80 -0
- package/dist/v2/components/Textarea.js.map +1 -0
- package/dist/v2/components/TimePicker.d.ts +21 -0
- package/dist/v2/components/TimePicker.d.ts.map +1 -0
- package/dist/v2/components/TimePicker.js +141 -0
- package/dist/v2/components/TimePicker.js.map +1 -0
- package/dist/v2/components/Toast.d.ts +32 -0
- package/dist/v2/components/Toast.d.ts.map +1 -0
- package/dist/v2/components/Toast.js +384 -0
- package/dist/v2/components/Toast.js.map +1 -0
- package/dist/v2/components/Tooltip.d.ts +9 -0
- package/dist/v2/components/Tooltip.d.ts.map +1 -0
- package/dist/v2/components/Tooltip.js +169 -0
- package/dist/v2/components/Tooltip.js.map +1 -0
- package/dist/v2/components/_ErrorPageBody.d.ts +48 -0
- package/dist/v2/components/_ErrorPageBody.d.ts.map +1 -0
- package/dist/v2/components/_ErrorPageBody.js +96 -0
- package/dist/v2/components/_ErrorPageBody.js.map +1 -0
- package/dist/v2/components/_pickerShared.d.ts +47 -0
- package/dist/v2/components/_pickerShared.d.ts.map +1 -0
- package/dist/v2/components/_pickerShared.js +68 -0
- package/dist/v2/components/_pickerShared.js.map +1 -0
- package/dist/v2/components/index.d.ts +83 -0
- package/dist/v2/components/index.d.ts.map +1 -0
- package/dist/v2/components/index.js +477 -0
- package/dist/v2/components/index.js.map +1 -0
- package/dist/v2/hooks/index.d.ts +11 -0
- package/dist/v2/hooks/index.d.ts.map +1 -0
- package/dist/v2/hooks/index.js +85 -0
- package/dist/v2/hooks/index.js.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.d.ts +22 -0
- package/dist/v2/hooks/useDelayedFlag.d.ts.map +1 -0
- package/dist/v2/hooks/useDelayedFlag.js +60 -0
- package/dist/v2/hooks/useDelayedFlag.js.map +1 -0
- package/dist/v2/hooks/useDensity.d.ts +23 -0
- package/dist/v2/hooks/useDensity.d.ts.map +1 -0
- package/dist/v2/hooks/useDensity.js +124 -0
- package/dist/v2/hooks/useDensity.js.map +1 -0
- package/dist/v2/hooks/useFocusFirstError.d.ts +121 -0
- package/dist/v2/hooks/useFocusFirstError.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusFirstError.js +203 -0
- package/dist/v2/hooks/useFocusFirstError.js.map +1 -0
- package/dist/v2/hooks/useFocusTrap.d.ts +3 -0
- package/dist/v2/hooks/useFocusTrap.d.ts.map +1 -0
- package/dist/v2/hooks/useFocusTrap.js +207 -0
- package/dist/v2/hooks/useFocusTrap.js.map +1 -0
- package/dist/v2/hooks/useFormAutoSave.d.ts +42 -0
- package/dist/v2/hooks/useFormAutoSave.d.ts.map +1 -0
- package/dist/v2/hooks/useFormAutoSave.js +186 -0
- package/dist/v2/hooks/useFormAutoSave.js.map +1 -0
- package/dist/v2/hooks/useFormCompletionProgress.d.ts +52 -0
- package/dist/v2/hooks/useFormCompletionProgress.d.ts.map +1 -0
- package/dist/v2/hooks/useFormCompletionProgress.js +136 -0
- package/dist/v2/hooks/useFormCompletionProgress.js.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.d.ts +31 -0
- package/dist/v2/hooks/useResolvedDensity.d.ts.map +1 -0
- package/dist/v2/hooks/useResolvedDensity.js +50 -0
- package/dist/v2/hooks/useResolvedDensity.js.map +1 -0
- package/dist/v2/hooks/useSortedRows.d.ts +25 -0
- package/dist/v2/hooks/useSortedRows.d.ts.map +1 -0
- package/dist/v2/hooks/useSortedRows.js +38 -0
- package/dist/v2/hooks/useSortedRows.js.map +1 -0
- package/dist/v2/hooks/useTabLoading.d.ts +39 -0
- package/dist/v2/hooks/useTabLoading.d.ts.map +1 -0
- package/dist/v2/hooks/useTabLoading.js +85 -0
- package/dist/v2/hooks/useTabLoading.js.map +1 -0
- package/dist/v2/index.d.ts +115 -0
- package/dist/v2/index.d.ts.map +1 -0
- package/dist/v2/index.js +1127 -0
- package/dist/v2/index.js.map +1 -0
- package/dist/v2/modalContext.d.ts +96 -0
- package/dist/v2/modalContext.d.ts.map +1 -0
- package/dist/v2/modalContext.js +113 -0
- package/dist/v2/modalContext.js.map +1 -0
- package/dist/v2/models/favorite.d.ts +14 -0
- package/dist/v2/models/favorite.d.ts.map +1 -0
- package/dist/v2/models/favorite.js +6 -0
- package/dist/v2/models/favorite.js.map +1 -0
- package/dist/v2/models/index.d.ts +11 -0
- package/dist/v2/models/index.d.ts.map +1 -0
- package/dist/v2/models/index.js +50 -0
- package/dist/v2/models/index.js.map +1 -0
- package/dist/v2/models/personalization.d.ts +65 -0
- package/dist/v2/models/personalization.d.ts.map +1 -0
- package/dist/v2/models/personalization.js +6 -0
- package/dist/v2/models/personalization.js.map +1 -0
- package/dist/v2/models/referentiel.d.ts +67 -0
- package/dist/v2/models/referentiel.d.ts.map +1 -0
- package/dist/v2/models/referentiel.js +6 -0
- package/dist/v2/models/referentiel.js.map +1 -0
- package/dist/v2/models/savedFilter.d.ts +22 -0
- package/dist/v2/models/savedFilter.d.ts.map +1 -0
- package/dist/v2/models/savedFilter.js +6 -0
- package/dist/v2/models/savedFilter.js.map +1 -0
- package/dist/v2/patterns/ActionBar.d.ts +137 -0
- package/dist/v2/patterns/ActionBar.d.ts.map +1 -0
- package/dist/v2/patterns/ActionBar.js +601 -0
- package/dist/v2/patterns/ActionBar.js.map +1 -0
- package/dist/v2/patterns/BulkActionBar.d.ts +63 -0
- package/dist/v2/patterns/BulkActionBar.d.ts.map +1 -0
- package/dist/v2/patterns/BulkActionBar.js +153 -0
- package/dist/v2/patterns/BulkActionBar.js.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts +62 -0
- package/dist/v2/patterns/CollapsibleDataGrid.d.ts.map +1 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js +306 -0
- package/dist/v2/patterns/CollapsibleDataGrid.js.map +1 -0
- package/dist/v2/patterns/ColumnsToggle.d.ts +55 -0
- package/dist/v2/patterns/ColumnsToggle.d.ts.map +1 -0
- package/dist/v2/patterns/ColumnsToggle.js +314 -0
- package/dist/v2/patterns/ColumnsToggle.js.map +1 -0
- package/dist/v2/patterns/DataGrid.d.ts +7 -0
- package/dist/v2/patterns/DataGrid.d.ts.map +1 -0
- package/dist/v2/patterns/DataGrid.js +834 -0
- package/dist/v2/patterns/DataGrid.js.map +1 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts +68 -0
- package/dist/v2/patterns/DataGridSettingsMenu.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridSettingsMenu.js +381 -0
- package/dist/v2/patterns/DataGridSettingsMenu.js.map +1 -0
- package/dist/v2/patterns/DataGridToolbar.d.ts +81 -0
- package/dist/v2/patterns/DataGridToolbar.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridToolbar.js +255 -0
- package/dist/v2/patterns/DataGridToolbar.js.map +1 -0
- package/dist/v2/patterns/DataGridVirtualized.d.ts +76 -0
- package/dist/v2/patterns/DataGridVirtualized.d.ts.map +1 -0
- package/dist/v2/patterns/DataGridVirtualized.js +528 -0
- package/dist/v2/patterns/DataGridVirtualized.js.map +1 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts +46 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.d.ts.map +1 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js +77 -0
- package/dist/v2/patterns/DeleteResourceConfirmDialog.js.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts +72 -0
- package/dist/v2/patterns/FavoriteColumn.d.ts.map +1 -0
- package/dist/v2/patterns/FavoriteColumn.js +171 -0
- package/dist/v2/patterns/FavoriteColumn.js.map +1 -0
- package/dist/v2/patterns/FavoritesFilter.d.ts +51 -0
- package/dist/v2/patterns/FavoritesFilter.d.ts.map +1 -0
- package/dist/v2/patterns/FavoritesFilter.js +97 -0
- package/dist/v2/patterns/FavoritesFilter.js.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.d.ts +39 -0
- package/dist/v2/patterns/FormErrorSummary.d.ts.map +1 -0
- package/dist/v2/patterns/FormErrorSummary.js +111 -0
- package/dist/v2/patterns/FormErrorSummary.js.map +1 -0
- package/dist/v2/patterns/FormPageShell.d.ts +55 -0
- package/dist/v2/patterns/FormPageShell.d.ts.map +1 -0
- package/dist/v2/patterns/FormPageShell.js +133 -0
- package/dist/v2/patterns/FormPageShell.js.map +1 -0
- package/dist/v2/patterns/FormSection.d.ts +53 -0
- package/dist/v2/patterns/FormSection.d.ts.map +1 -0
- package/dist/v2/patterns/FormSection.js +162 -0
- package/dist/v2/patterns/FormSection.js.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts +51 -0
- package/dist/v2/patterns/FormikCheckboxGroup.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCheckboxGroup.js +117 -0
- package/dist/v2/patterns/FormikCheckboxGroup.js.map +1 -0
- package/dist/v2/patterns/FormikCombobox.d.ts +43 -0
- package/dist/v2/patterns/FormikCombobox.d.ts.map +1 -0
- package/dist/v2/patterns/FormikCombobox.js +121 -0
- package/dist/v2/patterns/FormikCombobox.js.map +1 -0
- package/dist/v2/patterns/FormikDatePicker.d.ts +87 -0
- package/dist/v2/patterns/FormikDatePicker.d.ts.map +1 -0
- package/dist/v2/patterns/FormikDatePicker.js +177 -0
- package/dist/v2/patterns/FormikDatePicker.js.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.d.ts +59 -0
- package/dist/v2/patterns/FormikErrorFocus.d.ts.map +1 -0
- package/dist/v2/patterns/FormikErrorFocus.js +83 -0
- package/dist/v2/patterns/FormikErrorFocus.js.map +1 -0
- package/dist/v2/patterns/FormikFile.d.ts +43 -0
- package/dist/v2/patterns/FormikFile.d.ts.map +1 -0
- package/dist/v2/patterns/FormikFile.js +156 -0
- package/dist/v2/patterns/FormikFile.js.map +1 -0
- package/dist/v2/patterns/FormikInput.d.ts +37 -0
- package/dist/v2/patterns/FormikInput.d.ts.map +1 -0
- package/dist/v2/patterns/FormikInput.js +87 -0
- package/dist/v2/patterns/FormikInput.js.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts +33 -0
- package/dist/v2/patterns/FormikReferentielField.d.ts.map +1 -0
- package/dist/v2/patterns/FormikReferentielField.js +124 -0
- package/dist/v2/patterns/FormikReferentielField.js.map +1 -0
- package/dist/v2/patterns/FormikSelect.d.ts +40 -0
- package/dist/v2/patterns/FormikSelect.d.ts.map +1 -0
- package/dist/v2/patterns/FormikSelect.js +139 -0
- package/dist/v2/patterns/FormikSelect.js.map +1 -0
- package/dist/v2/patterns/FormikTextarea.d.ts +31 -0
- package/dist/v2/patterns/FormikTextarea.d.ts.map +1 -0
- package/dist/v2/patterns/FormikTextarea.js +84 -0
- package/dist/v2/patterns/FormikTextarea.js.map +1 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts +44 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.d.ts.map +1 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.js +207 -0
- package/dist/v2/patterns/KeyboardShortcutsHelp.js.map +1 -0
- package/dist/v2/patterns/NetworkErrorBanner.d.ts +26 -0
- package/dist/v2/patterns/NetworkErrorBanner.d.ts.map +1 -0
- package/dist/v2/patterns/NetworkErrorBanner.js +82 -0
- package/dist/v2/patterns/NetworkErrorBanner.js.map +1 -0
- package/dist/v2/patterns/PageContent.d.ts +40 -0
- package/dist/v2/patterns/PageContent.d.ts.map +1 -0
- package/dist/v2/patterns/PageContent.js +69 -0
- package/dist/v2/patterns/PageContent.js.map +1 -0
- package/dist/v2/patterns/ReferentielField.d.ts +118 -0
- package/dist/v2/patterns/ReferentielField.d.ts.map +1 -0
- package/dist/v2/patterns/ReferentielField.js +617 -0
- package/dist/v2/patterns/ReferentielField.js.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.d.ts +68 -0
- package/dist/v2/patterns/SaveFilterDialog.d.ts.map +1 -0
- package/dist/v2/patterns/SaveFilterDialog.js +203 -0
- package/dist/v2/patterns/SaveFilterDialog.js.map +1 -0
- package/dist/v2/patterns/SavedFiltersMenu.d.ts +74 -0
- package/dist/v2/patterns/SavedFiltersMenu.d.ts.map +1 -0
- package/dist/v2/patterns/SavedFiltersMenu.js +412 -0
- package/dist/v2/patterns/SavedFiltersMenu.js.map +1 -0
- package/dist/v2/patterns/SkeletonPageShell.d.ts +76 -0
- package/dist/v2/patterns/SkeletonPageShell.d.ts.map +1 -0
- package/dist/v2/patterns/SkeletonPageShell.js +347 -0
- package/dist/v2/patterns/SkeletonPageShell.js.map +1 -0
- package/dist/v2/patterns/SortableHeader.d.ts +47 -0
- package/dist/v2/patterns/SortableHeader.d.ts.map +1 -0
- package/dist/v2/patterns/SortableHeader.js +193 -0
- package/dist/v2/patterns/SortableHeader.js.map +1 -0
- package/dist/v2/patterns/Tour.d.ts +55 -0
- package/dist/v2/patterns/Tour.d.ts.map +1 -0
- package/dist/v2/patterns/Tour.js +473 -0
- package/dist/v2/patterns/Tour.js.map +1 -0
- package/dist/v2/patterns/_dataGridShared.d.ts +125 -0
- package/dist/v2/patterns/_dataGridShared.d.ts.map +1 -0
- package/dist/v2/patterns/_dataGridShared.js +406 -0
- package/dist/v2/patterns/_dataGridShared.js.map +1 -0
- package/dist/v2/patterns/_sort.d.ts +22 -0
- package/dist/v2/patterns/_sort.d.ts.map +1 -0
- package/dist/v2/patterns/_sort.js +118 -0
- package/dist/v2/patterns/_sort.js.map +1 -0
- package/dist/v2/patterns/_useColumnReorder.d.ts +69 -0
- package/dist/v2/patterns/_useColumnReorder.d.ts.map +1 -0
- package/dist/v2/patterns/_useColumnReorder.js +264 -0
- package/dist/v2/patterns/_useColumnReorder.js.map +1 -0
- package/dist/v2/patterns/_useColumnResize.d.ts +49 -0
- package/dist/v2/patterns/_useColumnResize.d.ts.map +1 -0
- package/dist/v2/patterns/_useColumnResize.js +198 -0
- package/dist/v2/patterns/_useColumnResize.js.map +1 -0
- package/dist/v2/patterns/index.d.ts +62 -0
- package/dist/v2/patterns/index.d.ts.map +1 -0
- package/dist/v2/patterns/index.js +246 -0
- package/dist/v2/patterns/index.js.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts +80 -0
- package/dist/v2/personalization/PersonalizationProvider.d.ts.map +1 -0
- package/dist/v2/personalization/PersonalizationProvider.js +177 -0
- package/dist/v2/personalization/PersonalizationProvider.js.map +1 -0
- package/dist/v2/personalization/adapters/_storageKey.d.ts +35 -0
- package/dist/v2/personalization/adapters/_storageKey.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/_storageKey.js +69 -0
- package/dist/v2/personalization/adapters/_storageKey.js.map +1 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts +31 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js +128 -0
- package/dist/v2/personalization/adapters/createLocalStorageAdapter.js.map +1 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts +25 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.js +76 -0
- package/dist/v2/personalization/adapters/createMemoryAdapter.js.map +1 -0
- package/dist/v2/personalization/adapters/index.d.ts +10 -0
- package/dist/v2/personalization/adapters/index.d.ts.map +1 -0
- package/dist/v2/personalization/adapters/index.js +21 -0
- package/dist/v2/personalization/adapters/index.js.map +1 -0
- package/dist/v2/personalization/capabilities/favorites.d.ts +53 -0
- package/dist/v2/personalization/capabilities/favorites.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/favorites.js +223 -0
- package/dist/v2/personalization/capabilities/favorites.js.map +1 -0
- package/dist/v2/personalization/capabilities/favoritesView.d.ts +58 -0
- package/dist/v2/personalization/capabilities/favoritesView.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/favoritesView.js +121 -0
- package/dist/v2/personalization/capabilities/favoritesView.js.map +1 -0
- package/dist/v2/personalization/capabilities/index.d.ts +16 -0
- package/dist/v2/personalization/capabilities/index.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/index.js +69 -0
- package/dist/v2/personalization/capabilities/index.js.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.d.ts +61 -0
- package/dist/v2/personalization/capabilities/savedFilters.d.ts.map +1 -0
- package/dist/v2/personalization/capabilities/savedFilters.js +297 -0
- package/dist/v2/personalization/capabilities/savedFilters.js.map +1 -0
- package/dist/v2/personalization/createPersonalizationStore.d.ts +76 -0
- package/dist/v2/personalization/createPersonalizationStore.d.ts.map +1 -0
- package/dist/v2/personalization/createPersonalizationStore.js +475 -0
- package/dist/v2/personalization/createPersonalizationStore.js.map +1 -0
- package/dist/v2/personalization/index.d.ts +33 -0
- package/dist/v2/personalization/index.d.ts.map +1 -0
- package/dist/v2/personalization/index.js +111 -0
- package/dist/v2/personalization/index.js.map +1 -0
- package/dist/v2/personalization/personalizationContext.d.ts +78 -0
- package/dist/v2/personalization/personalizationContext.d.ts.map +1 -0
- package/dist/v2/personalization/personalizationContext.js +121 -0
- package/dist/v2/personalization/personalizationContext.js.map +1 -0
- package/dist/v2/personalization/schema.d.ts +60 -0
- package/dist/v2/personalization/schema.d.ts.map +1 -0
- package/dist/v2/personalization/schema.js +102 -0
- package/dist/v2/personalization/schema.js.map +1 -0
- package/dist/v2/personalization/types.d.ts +81 -0
- package/dist/v2/personalization/types.d.ts.map +1 -0
- package/dist/v2/personalization/types.js +6 -0
- package/dist/v2/personalization/types.js.map +1 -0
- package/dist/v2/referentiel/ReferentielProvider.d.ts +53 -0
- package/dist/v2/referentiel/ReferentielProvider.d.ts.map +1 -0
- package/dist/v2/referentiel/ReferentielProvider.js +94 -0
- package/dist/v2/referentiel/ReferentielProvider.js.map +1 -0
- package/dist/v2/referentiel/index.d.ts +18 -0
- package/dist/v2/referentiel/index.d.ts.map +1 -0
- package/dist/v2/referentiel/index.js +44 -0
- package/dist/v2/referentiel/index.js.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.d.ts +15 -0
- package/dist/v2/referentiel/useReferentielClient.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielClient.js +46 -0
- package/dist/v2/referentiel/useReferentielClient.js.map +1 -0
- package/dist/v2/referentiel/useReferentielOptions.d.ts +40 -0
- package/dist/v2/referentiel/useReferentielOptions.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielOptions.js +177 -0
- package/dist/v2/referentiel/useReferentielOptions.js.map +1 -0
- package/dist/v2/referentiel/useReferentielSearch.d.ts +76 -0
- package/dist/v2/referentiel/useReferentielSearch.d.ts.map +1 -0
- package/dist/v2/referentiel/useReferentielSearch.js +140 -0
- package/dist/v2/referentiel/useReferentielSearch.js.map +1 -0
- package/dist/v2/styles/base.css +425 -0
- package/dist/v2/styles/css.d.ts +10 -0
- package/dist/v2/styles/index.d.ts +12 -0
- package/dist/v2/styles/index.d.ts.map +1 -0
- package/dist/v2/styles/index.js +4 -0
- package/dist/v2/styles/index.js.map +1 -0
- package/dist/v2/theme/_brand.d.ts +29 -0
- package/dist/v2/theme/_brand.d.ts.map +1 -0
- package/dist/v2/theme/_brand.js +69 -0
- package/dist/v2/theme/_brand.js.map +1 -0
- package/dist/v2/theme/_brandSecondary.d.ts +26 -0
- package/dist/v2/theme/_brandSecondary.d.ts.map +1 -0
- package/dist/v2/theme/_brandSecondary.js +65 -0
- package/dist/v2/theme/_brandSecondary.js.map +1 -0
- package/dist/v2/theme/createPortnetTheme.d.ts +50 -0
- package/dist/v2/theme/createPortnetTheme.d.ts.map +1 -0
- package/dist/v2/theme/createPortnetTheme.js +529 -0
- package/dist/v2/theme/createPortnetTheme.js.map +1 -0
- package/dist/v2/theme/cssVariables.d.ts +41 -0
- package/dist/v2/theme/cssVariables.d.ts.map +1 -0
- package/dist/v2/theme/cssVariables.js +205 -0
- package/dist/v2/theme/cssVariables.js.map +1 -0
- package/dist/v2/theme/index.d.ts +33 -0
- package/dist/v2/theme/index.d.ts.map +1 -0
- package/dist/v2/theme/index.js +60 -0
- package/dist/v2/theme/index.js.map +1 -0
- package/dist/v2/tokens/breakpoints.d.ts +74 -0
- package/dist/v2/tokens/breakpoints.d.ts.map +1 -0
- package/dist/v2/tokens/breakpoints.js +114 -0
- package/dist/v2/tokens/breakpoints.js.map +1 -0
- package/dist/v2/tokens/colors.d.ts +228 -0
- package/dist/v2/tokens/colors.d.ts.map +1 -0
- package/dist/v2/tokens/colors.js +225 -0
- package/dist/v2/tokens/colors.js.map +1 -0
- package/dist/v2/tokens/density.d.ts +142 -0
- package/dist/v2/tokens/density.d.ts.map +1 -0
- package/dist/v2/tokens/density.js +111 -0
- package/dist/v2/tokens/density.js.map +1 -0
- package/dist/v2/tokens/index.d.ts +556 -0
- package/dist/v2/tokens/index.d.ts.map +1 -0
- package/dist/v2/tokens/index.js +313 -0
- package/dist/v2/tokens/index.js.map +1 -0
- package/dist/v2/tokens/motion.d.ts +85 -0
- package/dist/v2/tokens/motion.d.ts.map +1 -0
- package/dist/v2/tokens/motion.js +94 -0
- package/dist/v2/tokens/motion.js.map +1 -0
- package/dist/v2/tokens/radius.d.ts +18 -0
- package/dist/v2/tokens/radius.d.ts.map +1 -0
- package/dist/v2/tokens/radius.js +28 -0
- package/dist/v2/tokens/radius.js.map +1 -0
- package/dist/v2/tokens/shadows.d.ts +25 -0
- package/dist/v2/tokens/shadows.d.ts.map +1 -0
- package/dist/v2/tokens/shadows.js +46 -0
- package/dist/v2/tokens/shadows.js.map +1 -0
- package/dist/v2/tokens/spacing.d.ts +38 -0
- package/dist/v2/tokens/spacing.d.ts.map +1 -0
- package/dist/v2/tokens/spacing.js +57 -0
- package/dist/v2/tokens/spacing.js.map +1 -0
- package/dist/v2/tokens/state.d.ts +40 -0
- package/dist/v2/tokens/state.d.ts.map +1 -0
- package/dist/v2/tokens/state.js +47 -0
- package/dist/v2/tokens/state.js.map +1 -0
- package/dist/v2/tokens/statusPalette.d.ts +54 -0
- package/dist/v2/tokens/statusPalette.d.ts.map +1 -0
- package/dist/v2/tokens/statusPalette.js +72 -0
- package/dist/v2/tokens/statusPalette.js.map +1 -0
- package/dist/v2/tokens/tokens.json +153 -0
- package/dist/v2/tokens/typography.d.ts +206 -0
- package/dist/v2/tokens/typography.d.ts.map +1 -0
- package/dist/v2/tokens/typography.js +155 -0
- package/dist/v2/tokens/typography.js.map +1 -0
- package/dist/v2/tokens/zIndex.d.ts +33 -0
- package/dist/v2/tokens/zIndex.d.ts.map +1 -0
- package/dist/v2/tokens/zIndex.js +50 -0
- package/dist/v2/tokens/zIndex.js.map +1 -0
- package/dist/v2/types/common.d.ts +24 -0
- package/dist/v2/types/common.d.ts.map +1 -0
- package/dist/v2/types/common.js +6 -0
- package/dist/v2/types/common.js.map +1 -0
- package/dist/v2/types/datagrid.d.ts +131 -0
- package/dist/v2/types/datagrid.d.ts.map +1 -0
- package/dist/v2/types/datagrid.js +6 -0
- package/dist/v2/types/datagrid.js.map +1 -0
- package/dist/v2/types/index.d.ts +11 -0
- package/dist/v2/types/index.d.ts.map +1 -0
- package/dist/v2/types/index.js +28 -0
- package/dist/v2/types/index.js.map +1 -0
- package/dist/v2/utils/apiError.d.ts +90 -0
- package/dist/v2/utils/apiError.d.ts.map +1 -0
- package/dist/v2/utils/apiError.js +227 -0
- package/dist/v2/utils/apiError.js.map +1 -0
- package/dist/v2/utils/contrast.d.ts +68 -0
- package/dist/v2/utils/contrast.d.ts.map +1 -0
- package/dist/v2/utils/contrast.js +167 -0
- package/dist/v2/utils/contrast.js.map +1 -0
- package/dist/v2/utils/cx.d.ts +9 -0
- package/dist/v2/utils/cx.d.ts.map +1 -0
- package/dist/v2/utils/cx.js +45 -0
- package/dist/v2/utils/cx.js.map +1 -0
- package/dist/v2/utils/fileDownload.d.ts +94 -0
- package/dist/v2/utils/fileDownload.d.ts.map +1 -0
- package/dist/v2/utils/fileDownload.js +236 -0
- package/dist/v2/utils/fileDownload.js.map +1 -0
- package/dist/v2/utils/fmtMoney.d.ts +28 -0
- package/dist/v2/utils/fmtMoney.d.ts.map +1 -0
- package/dist/v2/utils/fmtMoney.js +84 -0
- package/dist/v2/utils/fmtMoney.js.map +1 -0
- package/dist/v2/utils/index.d.ts +8 -0
- package/dist/v2/utils/index.d.ts.map +1 -0
- package/dist/v2/utils/index.js +90 -0
- package/dist/v2/utils/index.js.map +1 -0
- package/dist/v2/utils/networkStatus.d.ts +88 -0
- package/dist/v2/utils/networkStatus.d.ts.map +1 -0
- package/dist/v2/utils/networkStatus.js +121 -0
- package/dist/v2/utils/networkStatus.js.map +1 -0
- package/package.json +191 -73
- package/dist/api/guideApi.js +0 -12
- package/dist/api/guideImageService.js +0 -119
- package/dist/api/reclamationApi.js +0 -102
- package/dist/assets/guides/FAQ.json +0 -118
- package/dist/assets/guides/index.js +0 -11
- package/dist/assets/images/tijariaLogo.ico +0 -0
- package/dist/components/buttons/PuiButton.js +0 -217
- package/dist/components/buttons/PuiIconButton.js +0 -98
- package/dist/components/common/PuiAlertContext.js +0 -12
- package/dist/components/common/PuiHelpWidgetContext.js +0 -17
- package/dist/components/common/StyledMuiButton.js +0 -48
- package/dist/components/common/StyledMuiTextField.js +0 -180
- package/dist/components/inputs/PuiAutocomplete.js +0 -352
- package/dist/components/inputs/PuiCheckbox.js +0 -308
- package/dist/components/inputs/PuiCheckboxGroup.js +0 -215
- package/dist/components/inputs/PuiCheckboxItem.js +0 -162
- package/dist/components/inputs/PuiDateField.js +0 -280
- package/dist/components/inputs/PuiDateTimeField.js +0 -276
- package/dist/components/inputs/PuiFileField.js +0 -265
- package/dist/components/inputs/PuiRadioGroup.js +0 -197
- package/dist/components/inputs/PuiRadioItem.js +0 -100
- package/dist/components/inputs/PuiSelect.js +0 -427
- package/dist/components/inputs/PuiTextField.js +0 -263
- package/dist/components/others/PuiBadge.js +0 -58
- package/dist/components/others/PuiChip.js +0 -150
- package/dist/components/others/PuiDialog.js +0 -102
- package/dist/components/others/PuiFormikForm.js +0 -70
- package/dist/components/others/PuiGrid.js +0 -23
- package/dist/components/others/PuiIcon.js +0 -92
- package/dist/components/others/PuiLoadingBackdrop.js +0 -32
- package/dist/components/others/PuiMainContainer.js +0 -41
- package/dist/components/others/PuiNavigation.js +0 -68
- package/dist/components/others/PuiSection.js +0 -187
- package/dist/components/others/PuiTooltip.js +0 -86
- package/dist/components/providers/PuiAlertProvider.js +0 -134
- package/dist/components/providers/PuiHelpWidgetProvider.js +0 -91
- package/dist/components/providers/PuiLocalizationProvider.js +0 -34
- package/dist/components/referentiel/common/ReferetielContext.js +0 -12
- package/dist/components/referentiel/common/constants/specificReferentielsApis.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsBaseColumns.js +0 -691
- package/dist/components/referentiel/common/constants/specificReferentielsBaseFilters.js +0 -598
- package/dist/components/referentiel/common/constants/specificReferentielsInitialValues.js +0 -80
- package/dist/components/referentiel/common/constants/specificReferentielsKeys.js +0 -18
- package/dist/components/referentiel/common/constants/specificReferentielsTitles.js +0 -22
- package/dist/components/referentiel/common/constants/specificReferentielsValidationSchemas.js +0 -85
- package/dist/components/referentiel/components/PuiBasePopupReferentielField.js +0 -356
- package/dist/components/referentiel/components/PuiCustomPopupReferentielField.js +0 -181
- package/dist/components/referentiel/components/PuiSimplePopupReferentielField.js +0 -325
- package/dist/components/referentiel/components/PuiSimpleReferentielField.js +0 -203
- package/dist/components/referentiel/components/PuiSpecificReferentielField.js +0 -352
- package/dist/components/referentiel/providers/PuiReferentielProvider.js +0 -66
- package/dist/components/tab/PuiTab.js +0 -25
- package/dist/components/tab/PuiTabs.js +0 -148
- package/dist/components/table/PuiTable.js +0 -643
- package/dist/components/table/PuiTableAction.js +0 -75
- package/dist/components/typography/PuiDefinition.js +0 -42
- package/dist/components/typography/PuiIndication.js +0 -80
- package/dist/components/typography/PuiMainTitle.js +0 -144
- package/dist/components/ui/dialogs/PuiSearchDialog.js +0 -106
- package/dist/components/ui/pages/errors/PuiErrorBasePage.js +0 -73
- package/dist/components/ui/pages/errors/PuiForbiddenErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNetworkErrorPage.js +0 -36
- package/dist/components/ui/pages/errors/PuiNotFoundErrorPage.js +0 -30
- package/dist/components/ui/pages/errors/PuiServerErrorPage.js +0 -37
- package/dist/components/ui/pages/general/PuiDefaultPage.js +0 -68
- package/dist/components/ui/pages/general/PuiSearchPage.js +0 -203
- package/dist/components/widgets/GuideImage.js +0 -251
- package/dist/components/widgets/PuiHelpWidget.js +0 -4153
- package/dist/config/apperance.js +0 -26
- package/dist/config/mapping.js +0 -26
- package/dist/config/referentiel.js +0 -10
- package/dist/general/yupValidationErrors.js +0 -8
- package/dist/hooks/useAlert.js +0 -19
- package/dist/hooks/useAxios.js +0 -23
- package/dist/hooks/useQuery.js +0 -21
- package/dist/hooks/useReclamation.js +0 -100
- package/dist/styles/ReclamationFormModal.css +0 -629
- package/dist/styles/help-widget.css +0 -621
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"datagrid.js","names":[],"sources":["../../../src/lib/v2/types/datagrid.ts"],"sourcesContent":["/**\r\n * @portnet/ui v2 — DataGrid generic contract.\r\n *\r\n * Derived verbatim from the DataGrid / SortableHeader / _dataGridShared\r\n * PropTypes + implementation (the executable contract). MUI-independent:\r\n * component-level composition with MUI prop types happens in the component\r\n * itself (Part 2), not here.\r\n */\r\n\r\nimport type { Dispatch, ReactNode, SetStateAction } from \"react\";\r\nimport type { Alignment, Breakpoint, Density, RowId, SortDescriptor } from \"./common\";\r\n\r\n/** A DataGrid column definition over row type `T`. */\r\nexport interface DataGridColumn<T> {\r\n /** Unique column key; also the default value accessor (`row[key]`). */\r\n key: string;\r\n /** Header content. */\r\n header: ReactNode;\r\n align?: Alignment;\r\n /** Right-align + tabular numerals. */\r\n numeric?: boolean;\r\n /** Monospaced cell font + tabular numerals. */\r\n mono?: boolean;\r\n /** Default true when `onSortChange` is set; `false` opts the column out of sorting. */\r\n sortable?: boolean;\r\n /** Default true when the grid is `resizable`; `false` opts the column out. */\r\n resizable?: boolean;\r\n /** Default true when the grid is `reorderable`; `false` opts the column out. */\r\n reorderable?: boolean;\r\n /** Reveal the cell only on row hover / focus-within / coarse pointer. */\r\n hoverOnly?: boolean;\r\n /** Column may be toggled by a column-visibility UI. */\r\n toggleable?: boolean;\r\n /** Preferred width (px number or CSS length). */\r\n width?: number | string;\r\n /** Hard max width (px number or CSS length). */\r\n maxWidth?: number | string;\r\n /** Wrap long content instead of truncating with an ellipsis. */\r\n wrap?: boolean;\r\n /** Custom cell renderer; overrides `getValue` / `row[key]`. */\r\n render?: (row: T) => ReactNode;\r\n /** Custom value accessor used when `render` is absent (default `row[key]`). */\r\n getValue?: (row: T) => unknown;\r\n}\r\n\r\n/** Pagination model for DataGrid (`page` is 1-based). */\r\nexport interface DataGridPagination {\r\n page: number;\r\n pageSize: number;\r\n total: number;\r\n onPageChange: (page: number) => void;\r\n onPageSizeChange?: (pageSize: number) => void;\r\n pageSizes?: number[];\r\n}\r\n\r\n/** i18n labels for the DataGrid pagination bar. */\r\nexport interface DataGridPaginationLabels {\r\n loading?: ReactNode;\r\n rowsPerPage?: ReactNode;\r\n firstPage?: string;\r\n previousPage?: string;\r\n nextPage?: string;\r\n lastPage?: string;\r\n /** Accessible name for the pagination navigation landmark (WCAG landmark / 2.4.1). */\r\n navLabel?: string;\r\n /** Range summary; `fmt` is the resolved locale number formatter. */\r\n rangeOf?: (from: number, to: number, total: number, fmt: (n: number) => string) => ReactNode;\r\n}\r\n\r\n/** i18n labels for DataGrid. */\r\nexport interface DataGridLabels {\r\n tableAria?: string;\r\n selectAll?: string;\r\n selectRow?: (id: RowId) => string;\r\n actionsHeader?: string;\r\n pagination?: DataGridPaginationLabels;\r\n}\r\n\r\n/** Context object passed to `renderMobileCard`. */\r\nexport interface DataGridMobileCardContext {\r\n isActive: boolean;\r\n isSelected: boolean;\r\n}\r\n\r\n/** Options accepted by the exported `applySort` helper. */\r\nexport interface ApplySortOptions {\r\n /** BCP-47 locale for collation (default \"fr-FR\"). */\r\n locale?: string;\r\n}\r\n\r\n/** Props for the DataGrid pattern over row type `T`. */\r\nexport interface DataGridProps<T> {\r\n rows?: T[];\r\n columns: DataGridColumn<T>[];\r\n loading?: boolean;\r\n /** Any truthy value switches the grid to its error branch (renders `errorState`). */\r\n error?: unknown;\r\n sort?: SortDescriptor[];\r\n /**\r\n * Sort-state setter. DataGrid forwards this straight to SortableHeader,\r\n * which invokes it with an UPDATER function — so it must behave like a\r\n * `useState` dispatcher (accepts a value OR a `(prev) => next` updater).\r\n */\r\n onSortChange?: Dispatch<SetStateAction<SortDescriptor[]>>;\r\n selection?: Set<RowId> | RowId[];\r\n /** Receives the next selection as a `Set`. Presence enables the checkbox column. */\r\n onSelectionChange?: (selection: Set<RowId>) => void;\r\n pagination?: DataGridPagination;\r\n emptyState?: ReactNode;\r\n filteredEmptyState?: ReactNode;\r\n errorState?: ReactNode;\r\n /** Row identity (default `(row) => row.id`). */\r\n getRowId?: (row: T) => RowId;\r\n onRowClick?: (row: T) => void;\r\n rowFlashId?: RowId;\r\n activeRowId?: RowId;\r\n /** Renders the per-row actions overlay. Presence enables the actions column. */\r\n rowActions?: (row: T) => ReactNode;\r\n hiddenColumns?: Set<string> | string[];\r\n /** Marks an empty result as filter-induced (renders `filteredEmptyState`). */\r\n filtered?: boolean;\r\n density?: Density;\r\n /** Contextual accessible table name (WCAG 1.3.1 / Charter R-DG). */\r\n ariaLabel?: string;\r\n /** BCP-47 locale for number formatting (default \"fr-FR\"). */\r\n locale?: string;\r\n labels?: DataGridLabels;\r\n maxBodyHeight?: number | string;\r\n resizable?: boolean;\r\n columnWidths?: Record<string, number>;\r\n onColumnWidthsChange?: (widths: Record<string, number>) => void;\r\n reorderable?: boolean;\r\n columnOrder?: string[];\r\n onColumnOrderChange?: (order: string[]) => void;\r\n /** Opt-in mobile card renderer; below `mobileBreakpoint` the grid renders cards. */\r\n renderMobileCard?: (row: T, ctx: DataGridMobileCardContext) => ReactNode;\r\n mobileBreakpoint?: Breakpoint;\r\n}\r\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @portnet/ui v2 — Shared UI type architecture (barrel).
|
|
3
|
+
*
|
|
4
|
+
* Reusable UI/structural types. Business/domain models live under ../models.
|
|
5
|
+
* Topic modules are re-exported here; component-specific prop types are added
|
|
6
|
+
* as each component migrates (Part 2). The public typed surface is finalised
|
|
7
|
+
* in Batch 5 (barrels + `exports` type conditions).
|
|
8
|
+
*/
|
|
9
|
+
export * from "./common";
|
|
10
|
+
export * from "./datagrid";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _common = require("./common");
|
|
7
|
+
Object.keys(_common).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _common[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _common[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _datagrid = require("./datagrid");
|
|
18
|
+
Object.keys(_datagrid).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _datagrid[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _datagrid[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_common","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_datagrid"],"sources":["../../../src/lib/v2/types/index.ts"],"sourcesContent":["/**\r\n * @portnet/ui v2 — Shared UI type architecture (barrel).\r\n *\r\n * Reusable UI/structural types. Business/domain models live under ../models.\r\n * Topic modules are re-exported here; component-specific prop types are added\r\n * as each component migrates (Part 2). The public typed surface is finalised\r\n * in Batch 5 (barrels + `exports` type conditions).\r\n */\r\n\r\nexport * from \"./common\";\r\nexport * from \"./datagrid\";\r\n"],"mappings":";;;;;AASA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,SAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,SAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,SAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* apiError — narrow an `unknown` rejection into something displayable.
|
|
3
|
+
*
|
|
4
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
5
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-04)
|
|
6
|
+
*
|
|
7
|
+
* The Platform TypeScript Guidelines mandate `useUnknownInCatchVariables`, so
|
|
8
|
+
* `catch (e)` binds `unknown` in EVERY saga of EVERY consuming module. The same
|
|
9
|
+
* guidelines forbid `any` and unsafe assertions. Between those two rules sits a
|
|
10
|
+
* narrowing helper that the library did not provide — so each module wrote its
|
|
11
|
+
* own, and the observed outcome was that they wrote it the forbidden way:
|
|
12
|
+
*
|
|
13
|
+
* (error as { response?: { data?: { message?: unknown } } }).response
|
|
14
|
+
*
|
|
15
|
+
* i.e. an unchecked assertion on an `unknown`, used to work around a flag the
|
|
16
|
+
* platform imposes. Two modules audited (`procuration-portnet-fe`,
|
|
17
|
+
* `procuration-fe`) had independently reached for exactly that construct.
|
|
18
|
+
* A mandated strict-mode flag with no sanctioned escape hatch produces
|
|
19
|
+
* unsanctioned ones.
|
|
20
|
+
*
|
|
21
|
+
* Implementation notes
|
|
22
|
+
* --------------------
|
|
23
|
+
* `readPath` walks nested objects using the `in` operator, which narrows without
|
|
24
|
+
* an assertion, and `Reflect.get`, which returns the value as `unknown` rather
|
|
25
|
+
* than widening anything to `any`. No assertion appears anywhere in this file.
|
|
26
|
+
*
|
|
27
|
+
* Deliberately DUCK-TYPED rather than built on `axios.isAxiosError`. Three
|
|
28
|
+
* reasons: this library must not take a hard axios dependency for a string
|
|
29
|
+
* helper; a plain object shaped like an axios error (a hand-rolled reject, a
|
|
30
|
+
* test double, a non-axios transport) still resolves correctly; and the check
|
|
31
|
+
* stays valid across axios majors.
|
|
32
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
33
|
+
*
|
|
34
|
+
* getApiErrorMessage(err) → backend message, or the default
|
|
35
|
+
* getApiErrorMessage(err, "Échec de l'envoi.") → custom fallback
|
|
36
|
+
* getApiErrorStatus(err) → 404 | undefined
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and
|
|
40
|
+
* §09.3 (no raw technical detail — never "Erreur 422 Unprocessable Entity").
|
|
41
|
+
* Override per call site when a screen can say something more useful.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_API_ERROR_MESSAGE = "Une erreur est survenue. Veuillez r\u00E9essayer.";
|
|
44
|
+
/**
|
|
45
|
+
* Best available human-readable message for a rejection of unknown shape.
|
|
46
|
+
*
|
|
47
|
+
* Resolution order, first match wins:
|
|
48
|
+
* 1. the rejection itself, when it is a non-empty string;
|
|
49
|
+
* 2. `error.response.data.message` — the backend's own message;
|
|
50
|
+
* 3. `error.message` — **only when it is not a transport artefact** (G-07);
|
|
51
|
+
* 4. `fallback`.
|
|
52
|
+
*
|
|
53
|
+
* Step 3 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
|
|
54
|
+
* timeouts and errno codes are SUPPRESSED so the caller's own French copy is
|
|
55
|
+
* used instead (Charter §09.3 — no raw technical detail). A message a module
|
|
56
|
+
* threw deliberately still passes through. Use `getApiErrorDetail` when you want
|
|
57
|
+
* the unfiltered string for a log.
|
|
58
|
+
*
|
|
59
|
+
* Never throws and never returns an empty string, so it is safe to render
|
|
60
|
+
* directly into a toast or a `Banner`.
|
|
61
|
+
*
|
|
62
|
+
* @param error The caught value. `unknown` by design.
|
|
63
|
+
* @param fallback Message when nothing usable is found.
|
|
64
|
+
*/
|
|
65
|
+
export declare function getApiErrorMessage(error: unknown, fallback?: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Unfiltered technical detail for LOGGING — never for display.
|
|
68
|
+
*
|
|
69
|
+
* `getApiErrorMessage` deliberately suppresses transport phrasings (G-07), which
|
|
70
|
+
* is right for a toast and wrong for a console or an APM breadcrumb, where
|
|
71
|
+
* `"Request failed with status code 502"` is exactly what an operator needs. This
|
|
72
|
+
* is the escape hatch: it returns the raw `error.message` when there is one,
|
|
73
|
+
* whatever its shape.
|
|
74
|
+
*
|
|
75
|
+
* Pair them:
|
|
76
|
+
*
|
|
77
|
+
* toast(getApiErrorMessage(err, "Échec de l'envoi."), "error");
|
|
78
|
+
* console.error("[submit]", getApiErrorStatus(err), getApiErrorDetail(err));
|
|
79
|
+
*/
|
|
80
|
+
export declare function getApiErrorDetail(error: unknown): string | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* HTTP status carried by a rejection, when there is one.
|
|
83
|
+
*
|
|
84
|
+
* Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —
|
|
85
|
+
* which is the signal callers use to distinguish "the server answered with an
|
|
86
|
+
* error" from "there was no answer at all" (Charter R-4.3: a status-less failure
|
|
87
|
+
* is a network banner, not a toast).
|
|
88
|
+
*/
|
|
89
|
+
export declare function getApiErrorStatus(error: unknown): number | undefined;
|
|
90
|
+
//# sourceMappingURL=apiError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiError.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/apiError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,sDACU,CAAC;AA6GjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,QAAQ,GAAE,MAAkC,GAC3C,MAAM,CAQR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAGpE"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DEFAULT_API_ERROR_MESSAGE = void 0;
|
|
7
|
+
exports.getApiErrorDetail = getApiErrorDetail;
|
|
8
|
+
exports.getApiErrorMessage = getApiErrorMessage;
|
|
9
|
+
exports.getApiErrorStatus = getApiErrorStatus;
|
|
10
|
+
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); }
|
|
11
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
/**
|
|
15
|
+
* apiError — narrow an `unknown` rejection into something displayable.
|
|
16
|
+
*
|
|
17
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
18
|
+
* WHY THIS BELONGS IN THE LIBRARY (capability gap G-04)
|
|
19
|
+
*
|
|
20
|
+
* The Platform TypeScript Guidelines mandate `useUnknownInCatchVariables`, so
|
|
21
|
+
* `catch (e)` binds `unknown` in EVERY saga of EVERY consuming module. The same
|
|
22
|
+
* guidelines forbid `any` and unsafe assertions. Between those two rules sits a
|
|
23
|
+
* narrowing helper that the library did not provide — so each module wrote its
|
|
24
|
+
* own, and the observed outcome was that they wrote it the forbidden way:
|
|
25
|
+
*
|
|
26
|
+
* (error as { response?: { data?: { message?: unknown } } }).response
|
|
27
|
+
*
|
|
28
|
+
* i.e. an unchecked assertion on an `unknown`, used to work around a flag the
|
|
29
|
+
* platform imposes. Two modules audited (`procuration-portnet-fe`,
|
|
30
|
+
* `procuration-fe`) had independently reached for exactly that construct.
|
|
31
|
+
* A mandated strict-mode flag with no sanctioned escape hatch produces
|
|
32
|
+
* unsanctioned ones.
|
|
33
|
+
*
|
|
34
|
+
* Implementation notes
|
|
35
|
+
* --------------------
|
|
36
|
+
* `readPath` walks nested objects using the `in` operator, which narrows without
|
|
37
|
+
* an assertion, and `Reflect.get`, which returns the value as `unknown` rather
|
|
38
|
+
* than widening anything to `any`. No assertion appears anywhere in this file.
|
|
39
|
+
*
|
|
40
|
+
* Deliberately DUCK-TYPED rather than built on `axios.isAxiosError`. Three
|
|
41
|
+
* reasons: this library must not take a hard axios dependency for a string
|
|
42
|
+
* helper; a plain object shaped like an axios error (a hand-rolled reject, a
|
|
43
|
+
* test double, a non-axios transport) still resolves correctly; and the check
|
|
44
|
+
* stays valid across axios majors.
|
|
45
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
46
|
+
*
|
|
47
|
+
* getApiErrorMessage(err) → backend message, or the default
|
|
48
|
+
* getApiErrorMessage(err, "Échec de l'envoi.") → custom fallback
|
|
49
|
+
* getApiErrorStatus(err) → 404 | undefined
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and
|
|
54
|
+
* §09.3 (no raw technical detail — never "Erreur 422 Unprocessable Entity").
|
|
55
|
+
* Override per call site when a screen can say something more useful.
|
|
56
|
+
*/
|
|
57
|
+
var DEFAULT_API_ERROR_MESSAGE = exports.DEFAULT_API_ERROR_MESSAGE = "Une erreur est survenue. Veuillez réessayer.";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Walk `path` through nested non-null objects, returning the value at the end,
|
|
61
|
+
* or `undefined` if any hop is missing. Assertion-free.
|
|
62
|
+
*/
|
|
63
|
+
var readPath = function readPath(source, path) {
|
|
64
|
+
var current = source;
|
|
65
|
+
var _iterator = _createForOfIteratorHelper(path),
|
|
66
|
+
_step;
|
|
67
|
+
try {
|
|
68
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
69
|
+
var key = _step.value;
|
|
70
|
+
if (_typeof(current) !== "object" || current === null || !(key in current)) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
current = Reflect.get(current, key);
|
|
74
|
+
}
|
|
75
|
+
} catch (err) {
|
|
76
|
+
_iterator.e(err);
|
|
77
|
+
} finally {
|
|
78
|
+
_iterator.f();
|
|
79
|
+
}
|
|
80
|
+
return current;
|
|
81
|
+
};
|
|
82
|
+
var asNonEmptyString = function asNonEmptyString(value) {
|
|
83
|
+
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Transport-layer phrasings that must NEVER reach a user — capability gap G-07.
|
|
88
|
+
*
|
|
89
|
+
* ──────────────────────────────────────────────────────────────────────
|
|
90
|
+
* THE DEFECT THIS FIXES
|
|
91
|
+
*
|
|
92
|
+
* `getApiErrorMessage` resolved `error.message` BEFORE its fallback. An
|
|
93
|
+
* `AxiosError` always has `.message`, so on any server error carrying no
|
|
94
|
+
* `response.data.message` — a 500 with an empty body, a gateway error, a
|
|
95
|
+
* timeout — step 3 won and the user was shown:
|
|
96
|
+
*
|
|
97
|
+
* "Request failed with status code 500"
|
|
98
|
+
*
|
|
99
|
+
* English, technical, and precisely the shape Charter §09.3 names as forbidden
|
|
100
|
+
* ("✗ « Erreur 422 — Unprocessable Entity »"). Worse, it made every consuming
|
|
101
|
+
* module's carefully-written French fallback effectively UNREACHABLE — the
|
|
102
|
+
* argument was accepted and then almost never used. Found during the
|
|
103
|
+
* `procuration-portnet-fe` Area 10 audit, where 12 call sites pass a considered
|
|
104
|
+
* fallback that could essentially never render.
|
|
105
|
+
*
|
|
106
|
+
* WHY A DENY-LIST AND NOT SIMPLY DROPPING STEP 3
|
|
107
|
+
*
|
|
108
|
+
* Step 3 also carries LEGITIMATE messages: any `throw new Error("Ce titre ne
|
|
109
|
+
* peut pas être supprimé car il est en cours de validation.")` in module code
|
|
110
|
+
* arrives through exactly the same path. Removing the hop would trade a leak of
|
|
111
|
+
* technical strings for the loss of real business messages across the whole
|
|
112
|
+
* platform — a worse outcome. So the hop stays and only transport phrasings are
|
|
113
|
+
* suppressed.
|
|
114
|
+
*
|
|
115
|
+
* The list is deliberately CONSERVATIVE: anything not recognised passes through,
|
|
116
|
+
* on the assumption a human wrote it. A false negative shows one ugly string; a
|
|
117
|
+
* false positive silently replaces a real business message with a generic
|
|
118
|
+
* fallback, which is the more damaging error.
|
|
119
|
+
*
|
|
120
|
+
* Sourced from axios's own message construction (`settle`, `AxiosError` codes
|
|
121
|
+
* ECONNABORTED / ETIMEDOUT / ERR_NETWORK / ERR_CANCELED) plus the Node socket
|
|
122
|
+
* phrasing that surfaces through SSR and test doubles.
|
|
123
|
+
* ──────────────────────────────────────────────────────────────────────
|
|
124
|
+
*/
|
|
125
|
+
var TRANSPORT_MESSAGE_PATTERNS = [/^request failed with status code \d+$/i, /^network error$/i, /^timeout of \d+ms exceeded$/i, /^timeout exceeded$/i, /^request aborted$/i, /^canceled$/i, /^unsupported protocol/i, /^maximum content size exceeded$/i, /^socket hang up$/i,
|
|
126
|
+
/* ── errno codes and axios error codes ── CASE-SENSITIVE, DELIBERATELY ─────
|
|
127
|
+
*
|
|
128
|
+
* These two are the only patterns here NOT marked `/i`, and the asymmetry is
|
|
129
|
+
* load-bearing. errno constants are uppercase by universal convention
|
|
130
|
+
* (`ETIMEDOUT`, `ECONNREFUSED`, `ENOTFOUND`, `EPIPE`), so an uppercase-only
|
|
131
|
+
* match identifies them precisely. Matching case-insensitively would make
|
|
132
|
+
* `/^e[a-z]+$/i` swallow ordinary French words beginning with "e" — "erreur",
|
|
133
|
+
* "expiré", "échec" — turning a real business message into a generic fallback,
|
|
134
|
+
* which is the more damaging failure this list is tuned against.
|
|
135
|
+
*
|
|
136
|
+
* ⚠ An earlier version of the first pattern was `/^ec[a-z]+$/i`, which matched
|
|
137
|
+
* `ECONNREFUSED` (it begins "EC") but silently MISSED `ETIMEDOUT` ("ET"),
|
|
138
|
+
* despite the comment claiming otherwise. The unit test caught it. Do not
|
|
139
|
+
* narrow the prefix again: the family is "E + uppercase word", not "EC...".
|
|
140
|
+
*
|
|
141
|
+
* Residual, accepted: an all-caps single word like "ERREUR" is treated as an
|
|
142
|
+
* errno code. A module should not be throwing all-caps single-word messages at
|
|
143
|
+
* users, and replacing one with a proper French fallback is an improvement. */
|
|
144
|
+
/^E[A-Z]{3,}$/,
|
|
145
|
+
// errno: ETIMEDOUT, ECONNREFUSED, ECONNRESET, ENOTFOUND, EPIPE
|
|
146
|
+
/^ERR_[A-Z_]+$/ // axios: ERR_NETWORK, ERR_CANCELED, ERR_BAD_RESPONSE
|
|
147
|
+
];
|
|
148
|
+
|
|
149
|
+
/** Is this string an axios/transport artefact rather than something for a user? */
|
|
150
|
+
var isTransportMessage = function isTransportMessage(value) {
|
|
151
|
+
return TRANSPORT_MESSAGE_PATTERNS.some(function (pattern) {
|
|
152
|
+
return pattern.test(value.trim());
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* `error.message`, but only when it is fit to show a user.
|
|
158
|
+
*
|
|
159
|
+
* Suppresses transport phrasings (G-07) so the caller's French fallback is
|
|
160
|
+
* reached instead. Module-thrown `Error` messages pass through untouched.
|
|
161
|
+
*/
|
|
162
|
+
var asUserFacingMessage = function asUserFacingMessage(value) {
|
|
163
|
+
var text = asNonEmptyString(value);
|
|
164
|
+
if (text === undefined) return undefined;
|
|
165
|
+
return isTransportMessage(text) ? undefined : text;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Best available human-readable message for a rejection of unknown shape.
|
|
170
|
+
*
|
|
171
|
+
* Resolution order, first match wins:
|
|
172
|
+
* 1. the rejection itself, when it is a non-empty string;
|
|
173
|
+
* 2. `error.response.data.message` — the backend's own message;
|
|
174
|
+
* 3. `error.message` — **only when it is not a transport artefact** (G-07);
|
|
175
|
+
* 4. `fallback`.
|
|
176
|
+
*
|
|
177
|
+
* Step 3 is filtered: `"Request failed with status code 500"`, `"Network Error"`,
|
|
178
|
+
* timeouts and errno codes are SUPPRESSED so the caller's own French copy is
|
|
179
|
+
* used instead (Charter §09.3 — no raw technical detail). A message a module
|
|
180
|
+
* threw deliberately still passes through. Use `getApiErrorDetail` when you want
|
|
181
|
+
* the unfiltered string for a log.
|
|
182
|
+
*
|
|
183
|
+
* Never throws and never returns an empty string, so it is safe to render
|
|
184
|
+
* directly into a toast or a `Banner`.
|
|
185
|
+
*
|
|
186
|
+
* @param error The caught value. `unknown` by design.
|
|
187
|
+
* @param fallback Message when nothing usable is found.
|
|
188
|
+
*/
|
|
189
|
+
function getApiErrorMessage(error) {
|
|
190
|
+
var _ref, _asNonEmptyString;
|
|
191
|
+
var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_API_ERROR_MESSAGE;
|
|
192
|
+
if (typeof error === "string" && error.length > 0) return error;
|
|
193
|
+
return (_ref = (_asNonEmptyString = asNonEmptyString(readPath(error, ["response", "data", "message"]))) !== null && _asNonEmptyString !== void 0 ? _asNonEmptyString : asUserFacingMessage(readPath(error, ["message"]))) !== null && _ref !== void 0 ? _ref : fallback;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Unfiltered technical detail for LOGGING — never for display.
|
|
198
|
+
*
|
|
199
|
+
* `getApiErrorMessage` deliberately suppresses transport phrasings (G-07), which
|
|
200
|
+
* is right for a toast and wrong for a console or an APM breadcrumb, where
|
|
201
|
+
* `"Request failed with status code 502"` is exactly what an operator needs. This
|
|
202
|
+
* is the escape hatch: it returns the raw `error.message` when there is one,
|
|
203
|
+
* whatever its shape.
|
|
204
|
+
*
|
|
205
|
+
* Pair them:
|
|
206
|
+
*
|
|
207
|
+
* toast(getApiErrorMessage(err, "Échec de l'envoi."), "error");
|
|
208
|
+
* console.error("[submit]", getApiErrorStatus(err), getApiErrorDetail(err));
|
|
209
|
+
*/
|
|
210
|
+
function getApiErrorDetail(error) {
|
|
211
|
+
if (typeof error === "string" && error.length > 0) return error;
|
|
212
|
+
return asNonEmptyString(readPath(error, ["message"]));
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* HTTP status carried by a rejection, when there is one.
|
|
217
|
+
*
|
|
218
|
+
* Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —
|
|
219
|
+
* which is the signal callers use to distinguish "the server answered with an
|
|
220
|
+
* error" from "there was no answer at all" (Charter R-4.3: a status-less failure
|
|
221
|
+
* is a network banner, not a toast).
|
|
222
|
+
*/
|
|
223
|
+
function getApiErrorStatus(error) {
|
|
224
|
+
var status = readPath(error, ["response", "status"]);
|
|
225
|
+
return typeof status === "number" ? status : undefined;
|
|
226
|
+
}
|
|
227
|
+
//# sourceMappingURL=apiError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiError.js","names":["DEFAULT_API_ERROR_MESSAGE","exports","readPath","source","path","current","_iterator","_createForOfIteratorHelper","_step","s","n","done","key","value","_typeof","undefined","Reflect","get","err","e","f","asNonEmptyString","length","TRANSPORT_MESSAGE_PATTERNS","isTransportMessage","some","pattern","test","trim","asUserFacingMessage","text","getApiErrorMessage","error","_ref","_asNonEmptyString","fallback","arguments","getApiErrorDetail","getApiErrorStatus","status"],"sources":["../../../src/lib/v2/utils/apiError.ts"],"sourcesContent":["/**\r\n * apiError — narrow an `unknown` rejection into something displayable.\r\n *\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n * WHY THIS BELONGS IN THE LIBRARY (capability gap G-04)\r\n *\r\n * The Platform TypeScript Guidelines mandate `useUnknownInCatchVariables`, so\r\n * `catch (e)` binds `unknown` in EVERY saga of EVERY consuming module. The same\r\n * guidelines forbid `any` and unsafe assertions. Between those two rules sits a\r\n * narrowing helper that the library did not provide — so each module wrote its\r\n * own, and the observed outcome was that they wrote it the forbidden way:\r\n *\r\n * (error as { response?: { data?: { message?: unknown } } }).response\r\n *\r\n * i.e. an unchecked assertion on an `unknown`, used to work around a flag the\r\n * platform imposes. Two modules audited (`procuration-portnet-fe`,\r\n * `procuration-fe`) had independently reached for exactly that construct.\r\n * A mandated strict-mode flag with no sanctioned escape hatch produces\r\n * unsanctioned ones.\r\n *\r\n * Implementation notes\r\n * --------------------\r\n * `readPath` walks nested objects using the `in` operator, which narrows without\r\n * an assertion, and `Reflect.get`, which returns the value as `unknown` rather\r\n * than widening anything to `any`. No assertion appears anywhere in this file.\r\n *\r\n * Deliberately DUCK-TYPED rather than built on `axios.isAxiosError`. Three\r\n * reasons: this library must not take a hard axios dependency for a string\r\n * helper; a plain object shaped like an axios error (a hand-rolled reject, a\r\n * test double, a non-axios transport) still resolves correctly; and the check\r\n * stays valid across axios majors.\r\n * ─────────────────────────────────────────────────────────────────────────────\r\n *\r\n * getApiErrorMessage(err) → backend message, or the default\r\n * getApiErrorMessage(err, \"Échec de l'envoi.\") → custom fallback\r\n * getApiErrorStatus(err) → 404 | undefined\r\n */\r\n\r\n/**\r\n * Default user-facing fallback. French per Charter §09 (voice, vouvoiement) and\r\n * §09.3 (no raw technical detail — never \"Erreur 422 Unprocessable Entity\").\r\n * Override per call site when a screen can say something more useful.\r\n */\r\nexport const DEFAULT_API_ERROR_MESSAGE =\r\n \"Une erreur est survenue. Veuillez réessayer.\";\r\n\r\n/**\r\n * Walk `path` through nested non-null objects, returning the value at the end,\r\n * or `undefined` if any hop is missing. Assertion-free.\r\n */\r\nconst readPath = (source: unknown, path: readonly string[]): unknown => {\r\n let current: unknown = source;\r\n\r\n for (const key of path) {\r\n if (typeof current !== \"object\" || current === null || !(key in current)) {\r\n return undefined;\r\n }\r\n current = Reflect.get(current, key);\r\n }\r\n\r\n return current;\r\n};\r\n\r\nconst asNonEmptyString = (value: unknown): string | undefined =>\r\n typeof value === \"string\" && value.length > 0 ? value : undefined;\r\n\r\n/**\r\n * Transport-layer phrasings that must NEVER reach a user — capability gap G-07.\r\n *\r\n * ──────────────────────────────────────────────────────────────────────\r\n * THE DEFECT THIS FIXES\r\n *\r\n * `getApiErrorMessage` resolved `error.message` BEFORE its fallback. An\r\n * `AxiosError` always has `.message`, so on any server error carrying no\r\n * `response.data.message` — a 500 with an empty body, a gateway error, a\r\n * timeout — step 3 won and the user was shown:\r\n *\r\n * \"Request failed with status code 500\"\r\n *\r\n * English, technical, and precisely the shape Charter §09.3 names as forbidden\r\n * (\"✗ « Erreur 422 — Unprocessable Entity »\"). Worse, it made every consuming\r\n * module's carefully-written French fallback effectively UNREACHABLE — the\r\n * argument was accepted and then almost never used. Found during the\r\n * `procuration-portnet-fe` Area 10 audit, where 12 call sites pass a considered\r\n * fallback that could essentially never render.\r\n *\r\n * WHY A DENY-LIST AND NOT SIMPLY DROPPING STEP 3\r\n *\r\n * Step 3 also carries LEGITIMATE messages: any `throw new Error(\"Ce titre ne\r\n * peut pas être supprimé car il est en cours de validation.\")` in module code\r\n * arrives through exactly the same path. Removing the hop would trade a leak of\r\n * technical strings for the loss of real business messages across the whole\r\n * platform — a worse outcome. So the hop stays and only transport phrasings are\r\n * suppressed.\r\n *\r\n * The list is deliberately CONSERVATIVE: anything not recognised passes through,\r\n * on the assumption a human wrote it. A false negative shows one ugly string; a\r\n * false positive silently replaces a real business message with a generic\r\n * fallback, which is the more damaging error.\r\n *\r\n * Sourced from axios's own message construction (`settle`, `AxiosError` codes\r\n * ECONNABORTED / ETIMEDOUT / ERR_NETWORK / ERR_CANCELED) plus the Node socket\r\n * phrasing that surfaces through SSR and test doubles.\r\n * ──────────────────────────────────────────────────────────────────────\r\n */\r\nconst TRANSPORT_MESSAGE_PATTERNS: readonly RegExp[] = [\r\n /^request failed with status code \\d+$/i,\r\n /^network error$/i,\r\n /^timeout of \\d+ms exceeded$/i,\r\n /^timeout exceeded$/i,\r\n /^request aborted$/i,\r\n /^canceled$/i,\r\n /^unsupported protocol/i,\r\n /^maximum content size exceeded$/i,\r\n /^socket hang up$/i,\r\n /* ── errno codes and axios error codes ── CASE-SENSITIVE, DELIBERATELY ─────\r\n *\r\n * These two are the only patterns here NOT marked `/i`, and the asymmetry is\r\n * load-bearing. errno constants are uppercase by universal convention\r\n * (`ETIMEDOUT`, `ECONNREFUSED`, `ENOTFOUND`, `EPIPE`), so an uppercase-only\r\n * match identifies them precisely. Matching case-insensitively would make\r\n * `/^e[a-z]+$/i` swallow ordinary French words beginning with \"e\" — \"erreur\",\r\n * \"expiré\", \"échec\" — turning a real business message into a generic fallback,\r\n * which is the more damaging failure this list is tuned against.\r\n *\r\n * ⚠ An earlier version of the first pattern was `/^ec[a-z]+$/i`, which matched\r\n * `ECONNREFUSED` (it begins \"EC\") but silently MISSED `ETIMEDOUT` (\"ET\"),\r\n * despite the comment claiming otherwise. The unit test caught it. Do not\r\n * narrow the prefix again: the family is \"E + uppercase word\", not \"EC...\".\r\n *\r\n * Residual, accepted: an all-caps single word like \"ERREUR\" is treated as an\r\n * errno code. A module should not be throwing all-caps single-word messages at\r\n * users, and replacing one with a proper French fallback is an improvement. */\r\n /^E[A-Z]{3,}$/, // errno: ETIMEDOUT, ECONNREFUSED, ECONNRESET, ENOTFOUND, EPIPE\r\n /^ERR_[A-Z_]+$/, // axios: ERR_NETWORK, ERR_CANCELED, ERR_BAD_RESPONSE\r\n];\r\n\r\n/** Is this string an axios/transport artefact rather than something for a user? */\r\nconst isTransportMessage = (value: string): boolean =>\r\n TRANSPORT_MESSAGE_PATTERNS.some((pattern) => pattern.test(value.trim()));\r\n\r\n/**\r\n * `error.message`, but only when it is fit to show a user.\r\n *\r\n * Suppresses transport phrasings (G-07) so the caller's French fallback is\r\n * reached instead. Module-thrown `Error` messages pass through untouched.\r\n */\r\nconst asUserFacingMessage = (value: unknown): string | undefined => {\r\n const text = asNonEmptyString(value);\r\n if (text === undefined) return undefined;\r\n return isTransportMessage(text) ? undefined : text;\r\n};\r\n\r\n/**\r\n * Best available human-readable message for a rejection of unknown shape.\r\n *\r\n * Resolution order, first match wins:\r\n * 1. the rejection itself, when it is a non-empty string;\r\n * 2. `error.response.data.message` — the backend's own message;\r\n * 3. `error.message` — **only when it is not a transport artefact** (G-07);\r\n * 4. `fallback`.\r\n *\r\n * Step 3 is filtered: `\"Request failed with status code 500\"`, `\"Network Error\"`,\r\n * timeouts and errno codes are SUPPRESSED so the caller's own French copy is\r\n * used instead (Charter §09.3 — no raw technical detail). A message a module\r\n * threw deliberately still passes through. Use `getApiErrorDetail` when you want\r\n * the unfiltered string for a log.\r\n *\r\n * Never throws and never returns an empty string, so it is safe to render\r\n * directly into a toast or a `Banner`.\r\n *\r\n * @param error The caught value. `unknown` by design.\r\n * @param fallback Message when nothing usable is found.\r\n */\r\nexport function getApiErrorMessage(\r\n error: unknown,\r\n fallback: string = DEFAULT_API_ERROR_MESSAGE\r\n): string {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n\r\n return (\r\n asNonEmptyString(readPath(error, [\"response\", \"data\", \"message\"])) ??\r\n asUserFacingMessage(readPath(error, [\"message\"])) ??\r\n fallback\r\n );\r\n}\r\n\r\n/**\r\n * Unfiltered technical detail for LOGGING — never for display.\r\n *\r\n * `getApiErrorMessage` deliberately suppresses transport phrasings (G-07), which\r\n * is right for a toast and wrong for a console or an APM breadcrumb, where\r\n * `\"Request failed with status code 502\"` is exactly what an operator needs. This\r\n * is the escape hatch: it returns the raw `error.message` when there is one,\r\n * whatever its shape.\r\n *\r\n * Pair them:\r\n *\r\n * toast(getApiErrorMessage(err, \"Échec de l'envoi.\"), \"error\");\r\n * console.error(\"[submit]\", getApiErrorStatus(err), getApiErrorDetail(err));\r\n */\r\nexport function getApiErrorDetail(error: unknown): string | undefined {\r\n if (typeof error === \"string\" && error.length > 0) return error;\r\n return asNonEmptyString(readPath(error, [\"message\"]));\r\n}\r\n\r\n/**\r\n * HTTP status carried by a rejection, when there is one.\r\n *\r\n * Returns `undefined` for a network drop, a timeout, or any non-HTTP rejection —\r\n * which is the signal callers use to distinguish \"the server answered with an\r\n * error\" from \"there was no answer at all\" (Charter R-4.3: a status-less failure\r\n * is a network banner, not a toast).\r\n */\r\nexport function getApiErrorStatus(error: unknown): number | undefined {\r\n const status = readPath(error, [\"response\", \"status\"]);\r\n return typeof status === \"number\" ? status : undefined;\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,yBAAyB,GAAAC,OAAA,CAAAD,yBAAA,GACpC,8CAA8C;;AAEhD;AACA;AACA;AACA;AACA,IAAME,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,MAAe,EAAEC,IAAuB,EAAc;EACtE,IAAIC,OAAgB,GAAGF,MAAM;EAAC,IAAAG,SAAA,GAAAC,0BAAA,CAEZH,IAAI;IAAAI,KAAA;EAAA;IAAtB,KAAAF,SAAA,CAAAG,CAAA,MAAAD,KAAA,GAAAF,SAAA,CAAAI,CAAA,IAAAC,IAAA,GAAwB;MAAA,IAAbC,GAAG,GAAAJ,KAAA,CAAAK,KAAA;MACZ,IAAIC,OAAA,CAAOT,OAAO,MAAK,QAAQ,IAAIA,OAAO,KAAK,IAAI,IAAI,EAAEO,GAAG,IAAIP,OAAO,CAAC,EAAE;QACxE,OAAOU,SAAS;MAClB;MACAV,OAAO,GAAGW,OAAO,CAACC,GAAG,CAACZ,OAAO,EAAEO,GAAG,CAAC;IACrC;EAAC,SAAAM,GAAA;IAAAZ,SAAA,CAAAa,CAAA,CAAAD,GAAA;EAAA;IAAAZ,SAAA,CAAAc,CAAA;EAAA;EAED,OAAOf,OAAO;AAChB,CAAC;AAED,IAAMgB,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAIR,KAAc;EAAA,OACtC,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACS,MAAM,GAAG,CAAC,GAAGT,KAAK,GAAGE,SAAS;AAAA;;AAEnE;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,IAAMQ,0BAA6C,GAAG,CACpD,wCAAwC,EACxC,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,wBAAwB,EACxB,kCAAkC,EAClC,mBAAmB;AACnB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE,cAAc;AAAE;AAChB,eAAe,CAAE;AAAA,CAClB;;AAED;AACA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIX,KAAa;EAAA,OACvCU,0BAA0B,CAACE,IAAI,CAAC,UAACC,OAAO;IAAA,OAAKA,OAAO,CAACC,IAAI,CAACd,KAAK,CAACe,IAAI,CAAC,CAAC,CAAC;EAAA,EAAC;AAAA;;AAE1E;AACA;AACA;AACA;AACA;AACA;AACA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIhB,KAAc,EAAyB;EAClE,IAAMiB,IAAI,GAAGT,gBAAgB,CAACR,KAAK,CAAC;EACpC,IAAIiB,IAAI,KAAKf,SAAS,EAAE,OAAOA,SAAS;EACxC,OAAOS,kBAAkB,CAACM,IAAI,CAAC,GAAGf,SAAS,GAAGe,IAAI;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,KAAc,EAEN;EAAA,IAAAC,IAAA,EAAAC,iBAAA;EAAA,IADRC,QAAgB,GAAAC,SAAA,CAAAd,MAAA,QAAAc,SAAA,QAAArB,SAAA,GAAAqB,SAAA,MAAGpC,yBAAyB;EAE5C,IAAI,OAAOgC,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACV,MAAM,GAAG,CAAC,EAAE,OAAOU,KAAK;EAE/D,QAAAC,IAAA,IAAAC,iBAAA,GACEb,gBAAgB,CAACnB,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,cAAAE,iBAAA,cAAAA,iBAAA,GAClEL,mBAAmB,CAAC3B,QAAQ,CAAC8B,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,cAAAC,IAAA,cAAAA,IAAA,GACjDE,QAAQ;AAEZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,iBAAiBA,CAACL,KAAc,EAAsB;EACpE,IAAI,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACV,MAAM,GAAG,CAAC,EAAE,OAAOU,KAAK;EAC/D,OAAOX,gBAAgB,CAACnB,QAAQ,CAAC8B,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;AACvD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,iBAAiBA,CAACN,KAAc,EAAsB;EACpE,IAAMO,MAAM,GAAGrC,QAAQ,CAAC8B,KAAK,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;EACtD,OAAO,OAAOO,MAAM,KAAK,QAAQ,GAAGA,MAAM,GAAGxB,SAAS;AACxD","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WCAG 2.1 contrast utilities — Portnet UI v2
|
|
3
|
+
*
|
|
4
|
+
* Reference: https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio
|
|
5
|
+
*
|
|
6
|
+
* Pure functions, framework-agnostic, no deps. Reusable by any
|
|
7
|
+
* host module that needs to validate a runtime brand override
|
|
8
|
+
* against WCAG 1.4.3 AA (typical scenario: a host-shell event
|
|
9
|
+
* injects a tenant brand and the consumer wants to dev-warn when
|
|
10
|
+
* the resulting accent/foreground pair drops below 4.5:1).
|
|
11
|
+
*
|
|
12
|
+
* Also used by the dark-mode work (F29) to audit dual-mode token
|
|
13
|
+
* pairs and by Storybook contrast stories.
|
|
14
|
+
*/
|
|
15
|
+
/** Normal text contrast ratio threshold (AA). */
|
|
16
|
+
export declare const WCAG_AA_NORMAL = 4.5;
|
|
17
|
+
/** Large text (≥ 18pt or ≥ 14pt bold) contrast ratio threshold (AA). */
|
|
18
|
+
export declare const WCAG_AA_LARGE = 3;
|
|
19
|
+
/** UI components & graphical objects contrast ratio threshold (AA 1.4.11). */
|
|
20
|
+
export declare const WCAG_AA_UI_NON_TEXT = 3;
|
|
21
|
+
type RGB = {
|
|
22
|
+
r: number;
|
|
23
|
+
g: number;
|
|
24
|
+
b: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Parse a CSS color string into an { r, g, b } object with 0..255
|
|
28
|
+
* channels. Returns null for unparseable input.
|
|
29
|
+
*
|
|
30
|
+
* Supported formats:
|
|
31
|
+
* - "#RGB" (3-digit hex shorthand)
|
|
32
|
+
* - "#RRGGBB" (6-digit hex)
|
|
33
|
+
* - "#RRGGBBAA" (8-digit hex; alpha channel is dropped)
|
|
34
|
+
* - "rgb(r, g, b)"
|
|
35
|
+
* - "rgba(r, g, b, a)" (alpha dropped)
|
|
36
|
+
*
|
|
37
|
+
* HSL / HWB / LAB / named-colors are NOT supported — the v2 token
|
|
38
|
+
* surface and observed host-shell brand payloads are always hex
|
|
39
|
+
* or rgb(). A wider parser can be swapped in later without
|
|
40
|
+
* changing the public API of this function.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseColor(input: unknown): RGB | null;
|
|
43
|
+
/**
|
|
44
|
+
* Compute relative luminance of an sRGB color per WCAG 2.1.
|
|
45
|
+
* Accepts an { r, g, b } object (channels in 0..255).
|
|
46
|
+
* Returns a number in 0..1, or null if input is invalid.
|
|
47
|
+
*/
|
|
48
|
+
export declare function relativeLuminance(rgb: RGB | null | undefined): number | null;
|
|
49
|
+
/**
|
|
50
|
+
* WCAG contrast ratio between two colors.
|
|
51
|
+
*
|
|
52
|
+
* Accepts either CSS color strings (parsed via parseColor) or
|
|
53
|
+
* already-parsed { r, g, b } objects. Returns a number in
|
|
54
|
+
* [1.0, 21.0], or null if either input is unparseable.
|
|
55
|
+
*/
|
|
56
|
+
export declare function contrastRatio(c1: string | RGB, c2: string | RGB): number | null;
|
|
57
|
+
/**
|
|
58
|
+
* Verdict helper — `passesContrast(ratio, "normal")` returns true
|
|
59
|
+
* if the ratio meets the requested WCAG AA threshold. Returns
|
|
60
|
+
* false on null ratios so callers can treat unparseable inputs as
|
|
61
|
+
* failures.
|
|
62
|
+
*
|
|
63
|
+
* `level` accepts "normal" | "large" | "ui". Unknown levels default
|
|
64
|
+
* to the strictest threshold.
|
|
65
|
+
*/
|
|
66
|
+
export declare function passesContrast(ratio: number | null | undefined, level?: "normal" | "large" | "ui"): boolean;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=contrast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../../src/lib/v2/utils/contrast.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,iDAAiD;AACjD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC,wEAAwE;AACxE,eAAO,MAAM,aAAa,IAAM,CAAC;AAEjC,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,IAAM,CAAC;AAIvC,KAAK,GAAG,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,GAAG,GAAG,IAAI,CAyCrD;AAUD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAU5E;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,GAAG,GAAG,EAChB,EAAE,EAAE,MAAM,GAAG,GAAG,GACf,MAAM,GAAG,IAAI,CASf;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,KAAK,GAAE,QAAQ,GAAG,OAAO,GAAG,IAAe,GAC1C,OAAO,CAgBT"}
|