@abyss-project/commons-front-core 9.2.0 → 9.3.1
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/README.md +28 -0
- package/catalog/catalog-entries.ts +5 -0
- package/catalog/pages/AmbientBackground.tsx +83 -0
- package/catalog/pages/BarChart.tsx +127 -0
- package/catalog/pages/ConfirmDialogWarning.tsx +45 -0
- package/catalog/pages/LineChart.tsx +21 -1
- package/catalog/pages/index.ts +6 -0
- package/dist/{AbyssCookieConsentProvider-DUYUEZaO.js → AbyssCookieConsentProvider-CeDdkoPq.js} +15 -5
- package/dist/{CookieConsentSettings.component-aVDMZLIs.js → CookieConsentSettings.component-tJE0g-SS.js} +1 -1
- package/dist/components/data/BarChart/BarChart.d.ts +47 -0
- package/dist/components/data/BarChart/BarChart.spec.d.ts +1 -0
- package/dist/components/data/DataTable/DataTableDesktop.d.ts +1 -1
- package/dist/components/data/DataTable/DataTableMobile.d.ts +1 -1
- package/dist/components/data/DataTable/data-table.types.d.ts +6 -0
- package/dist/components/data/LineChart/LineChart.d.ts +18 -6
- package/dist/components/data/chart-series-tone.d.ts +21 -0
- package/dist/components/data/chart-series-tone.spec.d.ts +1 -0
- package/dist/components/data/index.d.ts +2 -0
- package/dist/components/inputs/ColorField/ColorField.d.ts +8 -5
- package/dist/components/layers/ConfirmDialog/ConfirmDialog.d.ts +6 -2
- package/dist/components/structure/AmbientBackground/AmbientBackground.d.ts +24 -0
- package/dist/components/structure/AmbientBackground/AmbientBackground.spec.d.ts +1 -0
- package/dist/components/structure/index.d.ts +1 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-DyWPbqXp.js → design-theme-D3DQFMu-.js} +10914 -9815
- package/dist/hooks/use-rich-intl.hook.d.ts +10 -0
- package/dist/{index-C6YE_5pO.js → index-3wZ_n-X5.js} +2 -2
- package/dist/{index-C9Vm0yCV.js → index-7E3aXufv.js} +2 -2
- package/dist/{index-DPsPJ7S5.js → index-9E4QhCRp.js} +2 -2
- package/dist/{index-CAWnWyTQ.js → index-B7yu6Zm9.js} +2 -2
- package/dist/{index-BM8u6b8w.js → index-BK4lWFRR.js} +3 -3
- package/dist/{index-BMgcTA0L.js → index-BTfe4Sz-.js} +3 -3
- package/dist/{index-_kMEUAM7.js → index-BbwAoYtC.js} +4 -4
- package/dist/{index-elrbx7C5.js → index-BcUA-oDy.js} +4 -4
- package/dist/{index-CX-2IC2j.js → index-BfICcXrk.js} +3 -3
- package/dist/{index-77h-J0x1.js → index-By24n0PI.js} +2 -2
- package/dist/{index-Bdv62RC2.js → index-CMyNL_Kk.js} +2 -2
- package/dist/{index-C6rmH0hM.js → index-CNMUrFys.js} +24253 -25354
- package/dist/{index-DKF4BSrW.js → index-CTkBexi5.js} +2 -2
- package/dist/{index-BGIR-HuR.js → index-CUoOFhRH.js} +2 -2
- package/dist/{index-ChBWwrvm.js → index-CZvosKer.js} +4 -4
- package/dist/{index-BykEZXU6.js → index-CzkoqdQK.js} +3 -3
- package/dist/{index-C4plH_av.js → index-D3QW807K.js} +2 -2
- package/dist/{index-LNg1bMNB.js → index-D6Gkj-V6.js} +2 -2
- package/dist/{index-URaKKzT4.js → index-DYUdQPwj.js} +2 -2
- package/dist/{index-CZj1-4RN.js → index-DeoE1f9Z.js} +2 -2
- package/dist/{index-WINZVUn3.js → index-F67JSDx7.js} +1 -1
- package/dist/{index-UXYdJQT_.js → index-rpW-_Gh4.js} +2 -2
- package/dist/index.js +4595 -4293
- package/dist/legacy/utils/file.utils.d.ts +1 -2
- package/dist/legacy.js +105 -105
- package/dist/theme/tokens/choice-swatches.d.ts +12 -0
- package/dist/theme/tokens/choice-swatches.spec.d.ts +1 -0
- package/dist/theme/tokens/index.d.ts +1 -0
- package/dist/translations/en.d.ts +5 -0
- package/dist/translations/fr.d.ts +5 -0
- package/dist/utils/file.utils.d.ts +10 -0
- package/dist/utils/file.utils.spec.d.ts +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
- package/test-results/catalog/.last-run.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,34 @@ export const buildRumOptions = () =>
|
|
|
90
90
|
|
|
91
91
|
## Changements visibles
|
|
92
92
|
|
|
93
|
+
### 9.3.0
|
|
94
|
+
|
|
95
|
+
Pages des outils du front principal sur le design system (carte #286, zone 4a). Pièces nouvelles et évolutions,
|
|
96
|
+
chacune documentée dans le `README.md` de son dossier et montrée dans le catalogue.
|
|
97
|
+
|
|
98
|
+
- **`BarChart`** (`data`) : barres Nivo sous `abyssNivoTheme`, groupées ou empilées (`stacked`), verticales ou
|
|
99
|
+
horizontales (`BarChartLayout`) ; une série par `id`, une catégorie par groupe, une clé absente n'est pas une barre ;
|
|
100
|
+
infobulle à la valeur propre de la série ; légende au-delà d'une série ; figure nommée et tableau des valeurs pour
|
|
101
|
+
les lecteurs d'écran ; « Aucune donnée à afficher » sans valeur. Graduations de l'axe des catégories selon la
|
|
102
|
+
largeur mesurée. Remplace `AbyssBarChart`.
|
|
103
|
+
- **Ton sémantique des séries** (`data`) : `ChartSeriesTone` (`Success`, `Warning`, `Danger`, `Info`, `Neutral`) et
|
|
104
|
+
`seriesColorTokens`, partagés par `LineChart` et `BarChart`. Une série à ton prend le jeton `status.*` de son ton ;
|
|
105
|
+
les séries sans ton gardent la palette `data.series.*` dans leur ordre (ADR-0174, avenant 9.3.0).
|
|
106
|
+
- **`LineChart`** (`data`) : `tone` par série et `stacked` (aires empilées depuis zéro, une abscisse absente d'une
|
|
107
|
+
série comptée à zéro ; infobulle et tableau gardent les valeurs propres). Le reste du contrat 9.2.0 est inchangé.
|
|
108
|
+
- **`AmbientBackground`** (`structure`) : fond de décor animé et sobre (lueurs d'`accent` et de `data.series.5` en
|
|
109
|
+
`color-mix` sur les variables `--abyss-*`), `aria-hidden`, hors du flux, `Viewport` ou `Container` ; figé sous
|
|
110
|
+
`prefers-reduced-motion`, sous 768 px et avec `paused`, état exposé par `data-motion`. Remplace `WaterParticles`.
|
|
111
|
+
- **`ConfirmDialogTone.Warning`** (`layers`) : bouton en `status.warning`, texte dans l'encre `paper`/`paper.on` la
|
|
112
|
+
plus contrastée, focus initial sur « Annuler » ; accepté par `useConfirmDialog`.
|
|
113
|
+
- **`DataTable`** (`data`) : `label` facultatif, nom accessible de la table et de la liste mobile.
|
|
114
|
+
- **Palette de choix** (`theme`) : `CHOICE_SWATCHES`, douze teintes catégorielles (une tous les 30° depuis la teinte
|
|
115
|
+
de marque, `0.72 0.12` en OKLCH), valeurs hexadécimales stables, lisibles sous l'encre `paper.on` à 4,5:1 au moins
|
|
116
|
+
dans les deux thèmes. **`ColorField`** les propose quand l'hôte ne passe pas `swatches` (devenu facultatif).
|
|
117
|
+
- **Utilitaires sortis de `legacy/`** : `getFileIcon` et `getFileColor` sont exportés de la racine ; `getFileColor`
|
|
118
|
+
y rend une couleur des jetons, `var(--abyss-data-series-n)` ou `var(--abyss-text-muted)`.
|
|
119
|
+
- **Traductions** : clés `ds.data.bar-chart.*` (FR et EN).
|
|
120
|
+
|
|
93
121
|
### 9.2.0
|
|
94
122
|
|
|
95
123
|
Organisation et projet du front principal sur le design system (carte #286, zone 3). Pièces nouvelles et évolutions,
|
|
@@ -52,6 +52,9 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
52
52
|
entry('FilterBar', 'structure', 'filter-bar', RESPONSIVE),
|
|
53
53
|
entry('SplitView', 'structure', 'split-view', RESPONSIVE),
|
|
54
54
|
entry('Tabs', 'structure', 'tabs', RESPONSIVE),
|
|
55
|
+
entry('AmbientBackground', 'structure', 'ambient-background', {
|
|
56
|
+
mobileCapture: true,
|
|
57
|
+
}),
|
|
55
58
|
entry('NotificationsMenu', 'structure', 'notifications-menu', {
|
|
56
59
|
mobileCapture: true,
|
|
57
60
|
}),
|
|
@@ -68,6 +71,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
68
71
|
entry('Sparkline', 'data', 'sparkline'),
|
|
69
72
|
entry('Pagination', 'data', 'pagination', RESPONSIVE),
|
|
70
73
|
entry('LineChart', 'data', 'line-chart'),
|
|
74
|
+
entry('BarChart', 'data', 'bar-chart'),
|
|
71
75
|
entry('ChartTheme', 'data', 'chart-theme'),
|
|
72
76
|
entry('UsageMeter', 'data', 'usage-meter'),
|
|
73
77
|
entry('StatusBadge', 'meaning', 'status-badge'),
|
|
@@ -87,6 +91,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
87
91
|
entry('QRCodeModal', 'business', 'qr-code-modal', { mobileCapture: true }),
|
|
88
92
|
entry('Modal', 'layers', 'modal', { mobileCapture: true }),
|
|
89
93
|
entry('ConfirmDialog', 'layers', 'confirm-dialog'),
|
|
94
|
+
entry('ConfirmDialogWarning', 'layers', 'confirm-dialog-warning'),
|
|
90
95
|
entry('Drawer', 'layers', 'drawer'),
|
|
91
96
|
entry('Menu', 'layers', 'menu'),
|
|
92
97
|
entry('Toast', 'layers', 'toast'),
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
AmbientBackground,
|
|
7
|
+
AmbientBackgroundPlacement,
|
|
8
|
+
} from '../../src/components/structure/AmbientBackground/AmbientBackground';
|
|
9
|
+
import { hairline, px } from '../../src/theme/components/shared';
|
|
10
|
+
import { Example, Showcase } from '../frame';
|
|
11
|
+
|
|
12
|
+
/** A panel the background stops at: positioned, clipped, as a host lays it out. */
|
|
13
|
+
const Panel = styled('div')(({ theme }) => {
|
|
14
|
+
const { tokens, space, radii, typeScale } = theme.design;
|
|
15
|
+
return {
|
|
16
|
+
position: 'relative',
|
|
17
|
+
overflow: 'hidden',
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
alignItems: 'flex-start',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
gap: px(space[3]),
|
|
23
|
+
minHeight: px(space[10] * 4),
|
|
24
|
+
padding: px(space[6]),
|
|
25
|
+
backgroundColor: tokens['bg.canvas'],
|
|
26
|
+
border: hairline(tokens['border.subtle']),
|
|
27
|
+
borderRadius: px(radii.md),
|
|
28
|
+
color: tokens['text.primary'],
|
|
29
|
+
fontSize: px(typeScale.body),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/** The content of a panel, laid above its background. */
|
|
34
|
+
const Content = styled('div')(({ theme }) => ({
|
|
35
|
+
position: 'relative',
|
|
36
|
+
display: 'flex',
|
|
37
|
+
flexDirection: 'column',
|
|
38
|
+
alignItems: 'flex-start',
|
|
39
|
+
gap: px(theme.design.space[2]),
|
|
40
|
+
}));
|
|
41
|
+
|
|
42
|
+
const Title = styled('strong')(({ theme }) => ({
|
|
43
|
+
fontSize: px(theme.design.typeScale.sectionTitle),
|
|
44
|
+
}));
|
|
45
|
+
|
|
46
|
+
const PausableScanner = () => {
|
|
47
|
+
const [scanning, setScanning] = useState(true);
|
|
48
|
+
return (
|
|
49
|
+
<Panel>
|
|
50
|
+
<AmbientBackground
|
|
51
|
+
placement={AmbientBackgroundPlacement.Container}
|
|
52
|
+
paused={!scanning}
|
|
53
|
+
/>
|
|
54
|
+
<Content>
|
|
55
|
+
<Title>{scanning ? 'Analyse en cours…' : 'Analyse terminée'}</Title>
|
|
56
|
+
<Button variant="outlined" onClick={() => setScanning(!scanning)}>
|
|
57
|
+
{scanning ? 'Figer le fond' : 'Relancer le fond'}
|
|
58
|
+
</Button>
|
|
59
|
+
</Content>
|
|
60
|
+
</Panel>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const AmbientBackgroundPage = () => (
|
|
65
|
+
<Showcase
|
|
66
|
+
family="Structure"
|
|
67
|
+
name="AmbientBackground"
|
|
68
|
+
description="Fond de décor : lueurs d'accent et de data.series.5 qui dérivent lentement sous le contenu, masquées aux lecteurs d'écran, figées sous prefers-reduced-motion, sous 768 px et en pause."
|
|
69
|
+
>
|
|
70
|
+
<Example title="Dans un panneau (placement Container)">
|
|
71
|
+
<Panel>
|
|
72
|
+
<AmbientBackground placement={AmbientBackgroundPlacement.Container} />
|
|
73
|
+
<Content>
|
|
74
|
+
<Title>Envoyez vos fichiers avec Beam</Title>
|
|
75
|
+
<span>Le fond reste sous le contenu et ne prend aucun clic.</span>
|
|
76
|
+
</Content>
|
|
77
|
+
</Panel>
|
|
78
|
+
</Example>
|
|
79
|
+
<Example title="En pause : le scanner de Probe entre deux analyses">
|
|
80
|
+
<PausableScanner />
|
|
81
|
+
</Example>
|
|
82
|
+
</Showcase>
|
|
83
|
+
);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BarChart,
|
|
3
|
+
BarChartLayout,
|
|
4
|
+
} from '../../src/components/data/BarChart/BarChart';
|
|
5
|
+
import type {
|
|
6
|
+
BarChartCategory,
|
|
7
|
+
BarChartSeries,
|
|
8
|
+
} from '../../src/components/data/BarChart/BarChart';
|
|
9
|
+
import { ChartSeriesTone } from '../../src/components/data/chart-series-tone';
|
|
10
|
+
import { Surface } from '../../src/components/structure/Surface/Surface';
|
|
11
|
+
import { Example, Showcase } from '../frame';
|
|
12
|
+
|
|
13
|
+
const count = new Intl.NumberFormat('fr-FR');
|
|
14
|
+
const seconds = new Intl.NumberFormat('fr-FR', {
|
|
15
|
+
style: 'unit',
|
|
16
|
+
unit: 'second',
|
|
17
|
+
maximumFractionDigits: 1,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const DURATION: BarChartSeries[] = [{ id: 'duration', label: 'Durée moyenne' }];
|
|
21
|
+
|
|
22
|
+
const CONFIGS: BarChartCategory[] = [
|
|
23
|
+
{ id: 'invoice', label: 'Factures', values: { duration: 4.2 } },
|
|
24
|
+
{ id: 'receipt', label: 'Reçus', values: { duration: 2.8 } },
|
|
25
|
+
{ id: 'payslip', label: 'Bulletins de paie', values: { duration: 6.1 } },
|
|
26
|
+
{ id: 'id-card', label: 'Pièces d’identité', values: { duration: 3.4 } },
|
|
27
|
+
{ id: 'bank', label: 'Relevés bancaires', values: { duration: 7.9 } },
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const OUTCOMES: BarChartSeries[] = [
|
|
31
|
+
{ id: 'succeeded', label: 'Réussies', tone: ChartSeriesTone.Success },
|
|
32
|
+
{ id: 'failed', label: 'Échouées', tone: ChartSeriesTone.Danger },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
const OUTCOMES_BY_CONFIG: BarChartCategory[] = [
|
|
36
|
+
{ id: 'invoice', label: 'Factures', values: { succeeded: 412, failed: 9 } },
|
|
37
|
+
{ id: 'receipt', label: 'Reçus', values: { succeeded: 268, failed: 21 } },
|
|
38
|
+
{ id: 'payslip', label: 'Bulletins', values: { succeeded: 133 } },
|
|
39
|
+
{ id: 'id-card', label: 'Identité', values: { succeeded: 96, failed: 14 } },
|
|
40
|
+
{ id: 'bank', label: 'Relevés', values: { succeeded: 57, failed: 3 } },
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const TOOLS: BarChartSeries[] = ['Atlas', 'Board', 'Draw'].map((label) => ({
|
|
44
|
+
id: label.toLowerCase(),
|
|
45
|
+
label,
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
const MONTHS = [
|
|
49
|
+
'Jan.',
|
|
50
|
+
'Fév.',
|
|
51
|
+
'Mars',
|
|
52
|
+
'Avr.',
|
|
53
|
+
'Mai',
|
|
54
|
+
'Juin',
|
|
55
|
+
'Juil.',
|
|
56
|
+
'Août',
|
|
57
|
+
'Sept.',
|
|
58
|
+
'Oct.',
|
|
59
|
+
'Nov.',
|
|
60
|
+
'Déc.',
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const BY_MONTH: BarChartCategory[] = MONTHS.map((label, month) => ({
|
|
64
|
+
id: `m${month + 1}`,
|
|
65
|
+
label,
|
|
66
|
+
values: Object.fromEntries(
|
|
67
|
+
TOOLS.map(({ id }, index) => [
|
|
68
|
+
id,
|
|
69
|
+
12 + index * 6 + Math.round(8 * Math.sin((month + index) / 2)),
|
|
70
|
+
]),
|
|
71
|
+
),
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
export const BarChartPage = () => (
|
|
75
|
+
<Showcase
|
|
76
|
+
family="Données"
|
|
77
|
+
name="BarChart"
|
|
78
|
+
description="Barres Nivo sous abyssNivoTheme, groupées ou empilées, verticales ou horizontales : palette data.series ou ton status.* quand la série porte un sens, légende au-delà d'une série, figure nommée et tableau des valeurs pour les lecteurs d'écran."
|
|
79
|
+
>
|
|
80
|
+
<Example title="Une série, horizontale">
|
|
81
|
+
<Surface padding={4}>
|
|
82
|
+
<BarChart
|
|
83
|
+
series={DURATION}
|
|
84
|
+
categories={CONFIGS}
|
|
85
|
+
height={220}
|
|
86
|
+
layout={BarChartLayout.Horizontal}
|
|
87
|
+
formatValue={(value) => seconds.format(value)}
|
|
88
|
+
label="Durée moyenne d’une extraction par configuration"
|
|
89
|
+
/>
|
|
90
|
+
</Surface>
|
|
91
|
+
</Example>
|
|
92
|
+
<Example title="Empilées, séries à ton (réussites et échecs)">
|
|
93
|
+
<Surface padding={4}>
|
|
94
|
+
<BarChart
|
|
95
|
+
series={OUTCOMES}
|
|
96
|
+
categories={OUTCOMES_BY_CONFIG}
|
|
97
|
+
height={240}
|
|
98
|
+
stacked
|
|
99
|
+
formatValue={(value) => count.format(value)}
|
|
100
|
+
label="Extractions réussies et échouées par configuration"
|
|
101
|
+
/>
|
|
102
|
+
</Surface>
|
|
103
|
+
</Example>
|
|
104
|
+
<Example title="Groupées, palette de séries, douze catégories">
|
|
105
|
+
<Surface padding={4}>
|
|
106
|
+
<BarChart
|
|
107
|
+
series={TOOLS}
|
|
108
|
+
categories={BY_MONTH}
|
|
109
|
+
height={240}
|
|
110
|
+
formatValue={(value) => count.format(value)}
|
|
111
|
+
label="Contenus créés par outil et par mois"
|
|
112
|
+
/>
|
|
113
|
+
</Surface>
|
|
114
|
+
</Example>
|
|
115
|
+
<Example title="Aucune donnée">
|
|
116
|
+
<Surface padding={4}>
|
|
117
|
+
<BarChart
|
|
118
|
+
series={DURATION}
|
|
119
|
+
categories={[]}
|
|
120
|
+
height={160}
|
|
121
|
+
formatValue={(value) => seconds.format(value)}
|
|
122
|
+
label="Durée moyenne d’une extraction par configuration"
|
|
123
|
+
/>
|
|
124
|
+
</Surface>
|
|
125
|
+
</Example>
|
|
126
|
+
</Showcase>
|
|
127
|
+
);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import Button from '@mui/material/Button';
|
|
3
|
+
import {
|
|
4
|
+
ConfirmDialog,
|
|
5
|
+
ConfirmDialogTone,
|
|
6
|
+
} from '../../src/components/layers/ConfirmDialog/ConfirmDialog';
|
|
7
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
8
|
+
|
|
9
|
+
export const ConfirmDialogWarningPage = () => {
|
|
10
|
+
const { log } = useEventLog();
|
|
11
|
+
const [open, setOpen] = useState(true);
|
|
12
|
+
return (
|
|
13
|
+
<Showcase
|
|
14
|
+
family="Couches"
|
|
15
|
+
name="ConfirmDialog — ton Warning"
|
|
16
|
+
description="Confirmation d'une action permise mais risquée : bouton en status.warning, texte dans l'encre paper la plus contrastée, focus initial sur « Annuler »."
|
|
17
|
+
>
|
|
18
|
+
<Example title="Télécharger un fichier encore en analyse">
|
|
19
|
+
<Button
|
|
20
|
+
variant="outlined"
|
|
21
|
+
color="warning"
|
|
22
|
+
onClick={() => setOpen(true)}
|
|
23
|
+
>
|
|
24
|
+
Télécharger contrat-2026.pdf
|
|
25
|
+
</Button>
|
|
26
|
+
</Example>
|
|
27
|
+
<LastEvent />
|
|
28
|
+
<ConfirmDialog
|
|
29
|
+
open={open}
|
|
30
|
+
tone={ConfirmDialogTone.Warning}
|
|
31
|
+
title="Télécharger un fichier en cours d’analyse ?"
|
|
32
|
+
body="L’analyse antivirus de contrat-2026.pdf n’est pas terminée : rien ne garantit encore que le fichier est sain."
|
|
33
|
+
confirmLabel="Télécharger quand même"
|
|
34
|
+
onConfirm={() => {
|
|
35
|
+
setOpen(false);
|
|
36
|
+
log('télécharger');
|
|
37
|
+
}}
|
|
38
|
+
onCancel={() => {
|
|
39
|
+
setOpen(false);
|
|
40
|
+
log('annuler');
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
43
|
+
</Showcase>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
LineChartSeries,
|
|
4
4
|
LineChartX,
|
|
5
5
|
} from '../../src/components/data/LineChart/LineChart';
|
|
6
|
+
import { ChartSeriesTone } from '../../src/components/data/chart-series-tone';
|
|
6
7
|
import { Surface } from '../../src/components/structure/Surface/Surface';
|
|
7
8
|
import { Example, Showcase } from '../frame';
|
|
8
9
|
|
|
@@ -27,12 +28,16 @@ const hourly = (
|
|
|
27
28
|
id: string,
|
|
28
29
|
label: string,
|
|
29
30
|
values: number[],
|
|
31
|
+
tone?: ChartSeriesTone,
|
|
30
32
|
): LineChartSeries => ({
|
|
31
33
|
id,
|
|
32
34
|
label,
|
|
33
35
|
points: values.map((y, hour) => ({ x: atHour(hour), y })),
|
|
36
|
+
tone,
|
|
34
37
|
});
|
|
35
38
|
|
|
39
|
+
const DELIVERED = REQUESTS.map((value, hour) => value - ERRORS[hour]);
|
|
40
|
+
|
|
36
41
|
const SIX_SERIES: LineChartSeries[] = [
|
|
37
42
|
'Atlas',
|
|
38
43
|
'Board',
|
|
@@ -64,7 +69,7 @@ export const LineChartPage = () => (
|
|
|
64
69
|
<Showcase
|
|
65
70
|
family="Données"
|
|
66
71
|
name="LineChart"
|
|
67
|
-
description="Courbes Nivo sous abyssNivoTheme : couleurs prises dans l'ordre de la palette data.series, légende au-delà d'une série, figure nommée et tableau des valeurs pour les lecteurs d'écran."
|
|
72
|
+
description="Courbes Nivo sous abyssNivoTheme : couleurs prises dans l'ordre de la palette data.series, ou dans status.* pour une série à ton ; aires empilées avec stacked ; légende au-delà d'une série, figure nommée et tableau des valeurs pour les lecteurs d'écran."
|
|
68
73
|
>
|
|
69
74
|
<Example title="Une série, aire">
|
|
70
75
|
<Surface padding={4}>
|
|
@@ -92,6 +97,21 @@ export const LineChartPage = () => (
|
|
|
92
97
|
/>
|
|
93
98
|
</Surface>
|
|
94
99
|
</Example>
|
|
100
|
+
<Example title="Empilées, séries à ton (délivrés et échecs)">
|
|
101
|
+
<Surface padding={4}>
|
|
102
|
+
<LineChart
|
|
103
|
+
series={[
|
|
104
|
+
hourly('delivered', 'Délivrés', DELIVERED, ChartSeriesTone.Success),
|
|
105
|
+
hourly('failed', 'Échecs', ERRORS, ChartSeriesTone.Danger),
|
|
106
|
+
]}
|
|
107
|
+
height={240}
|
|
108
|
+
stacked
|
|
109
|
+
formatX={formatHour}
|
|
110
|
+
formatY={(y) => count.format(y)}
|
|
111
|
+
label="Webhooks délivrés et en échec par heure"
|
|
112
|
+
/>
|
|
113
|
+
</Surface>
|
|
114
|
+
</Example>
|
|
95
115
|
<Example title="Palette des six séries">
|
|
96
116
|
<Surface padding={4}>
|
|
97
117
|
<LineChart
|
package/catalog/pages/index.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
2
|
import { AccountMenuPage } from './AccountMenu';
|
|
3
3
|
import { ActionBarPage } from './ActionBar';
|
|
4
|
+
import { AmbientBackgroundPage } from './AmbientBackground';
|
|
4
5
|
import { AppShellPage } from './AppShell';
|
|
5
6
|
import { AvatarPage } from './Avatar';
|
|
7
|
+
import { BarChartPage } from './BarChart';
|
|
6
8
|
import { BottomSheetPage } from './BottomSheet';
|
|
7
9
|
import { CalloutPage } from './Callout';
|
|
8
10
|
import { ChartThemePage } from './ChartTheme';
|
|
@@ -10,6 +12,7 @@ import { CloudImportPage } from './CloudImport';
|
|
|
10
12
|
import { ColorFieldPage } from './ColorField';
|
|
11
13
|
import { CommandPalettePage } from './CommandPalette';
|
|
12
14
|
import { ConfirmDialogPage } from './ConfirmDialog';
|
|
15
|
+
import { ConfirmDialogWarningPage } from './ConfirmDialogWarning';
|
|
13
16
|
import { ContextSelectorPage } from './ContextSelector';
|
|
14
17
|
import { CopyFieldPage } from './CopyField';
|
|
15
18
|
import { LineChartPage } from './LineChart';
|
|
@@ -65,8 +68,10 @@ import { UsageMeterPage } from './UsageMeter';
|
|
|
65
68
|
export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
66
69
|
AccountMenu: AccountMenuPage,
|
|
67
70
|
ActionBar: ActionBarPage,
|
|
71
|
+
AmbientBackground: AmbientBackgroundPage,
|
|
68
72
|
AppShell: AppShellPage,
|
|
69
73
|
Avatar: AvatarPage,
|
|
74
|
+
BarChart: BarChartPage,
|
|
70
75
|
BottomSheet: BottomSheetPage,
|
|
71
76
|
Callout: CalloutPage,
|
|
72
77
|
ChartTheme: ChartThemePage,
|
|
@@ -74,6 +79,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
|
74
79
|
ColorField: ColorFieldPage,
|
|
75
80
|
CommandPalette: CommandPalettePage,
|
|
76
81
|
ConfirmDialog: ConfirmDialogPage,
|
|
82
|
+
ConfirmDialogWarning: ConfirmDialogWarningPage,
|
|
77
83
|
ContextSelector: ContextSelectorPage,
|
|
78
84
|
CopyField: CopyFieldPage,
|
|
79
85
|
LineChart: LineChartPage,
|
package/dist/{AbyssCookieConsentProvider-DUYUEZaO.js → AbyssCookieConsentProvider-CeDdkoPq.js}
RENAMED
|
@@ -1854,6 +1854,11 @@ const fm = {
|
|
|
1854
1854
|
"no-value": "Aucune valeur",
|
|
1855
1855
|
empty: "Aucune donnée à afficher"
|
|
1856
1856
|
},
|
|
1857
|
+
"bar-chart": {
|
|
1858
|
+
category: "Catégorie",
|
|
1859
|
+
"no-value": "Aucune valeur",
|
|
1860
|
+
empty: "Aucune donnée à afficher"
|
|
1861
|
+
},
|
|
1857
1862
|
"data-table": {
|
|
1858
1863
|
"select-all": "Sélectionner toutes les lignes",
|
|
1859
1864
|
"select-row": "Sélectionner la ligne",
|
|
@@ -3649,6 +3654,11 @@ const fm = {
|
|
|
3649
3654
|
"no-value": "No value",
|
|
3650
3655
|
empty: "No data to show"
|
|
3651
3656
|
},
|
|
3657
|
+
"bar-chart": {
|
|
3658
|
+
category: "Category",
|
|
3659
|
+
"no-value": "No value",
|
|
3660
|
+
empty: "No data to show"
|
|
3661
|
+
},
|
|
3652
3662
|
"data-table": {
|
|
3653
3663
|
"select-all": "Select all rows",
|
|
3654
3664
|
"select-row": "Select row",
|
|
@@ -8411,12 +8421,12 @@ export {
|
|
|
8411
8421
|
gm as k,
|
|
8412
8422
|
zm as l,
|
|
8413
8423
|
Mt as m,
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8424
|
+
he as n,
|
|
8425
|
+
oe as o,
|
|
8426
|
+
Ze as p,
|
|
8427
|
+
Nn as q,
|
|
8418
8428
|
Mm as r,
|
|
8419
|
-
|
|
8429
|
+
rv as s,
|
|
8420
8430
|
$s as t,
|
|
8421
8431
|
dv as u,
|
|
8422
8432
|
Lt as v,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { useState as m, useEffect as C } from "react";
|
|
3
3
|
import { Card as v, CardContent as b, Stack as u, Typography as o, FormControlLabel as l, Box as r, Checkbox as d, Button as M } from "@mui/material";
|
|
4
|
-
import { g as R, u as x } from "./AbyssCookieConsentProvider-
|
|
4
|
+
import { g as R, u as x } from "./AbyssCookieConsentProvider-CeDdkoPq.js";
|
|
5
5
|
const B = () => {
|
|
6
6
|
const t = R(), { consent: i, save: y } = x(), [h, g] = m((i == null ? void 0 : i.analytics) ?? !1), [k, f] = m((i == null ? void 0 : i.marketing) ?? !1), c = i == null ? void 0 : i.analytics, n = i == null ? void 0 : i.marketing;
|
|
7
7
|
return C(() => {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChartSeriesTone } from '../chart-series-tone';
|
|
2
|
+
export declare enum BarChartLayout {
|
|
3
|
+
/** Bars rise from the category axis at the bottom. */
|
|
4
|
+
Vertical = "vertical",
|
|
5
|
+
/** Bars run from the category axis on the left: long category names, many categories. */
|
|
6
|
+
Horizontal = "horizontal"
|
|
7
|
+
}
|
|
8
|
+
export interface BarChartSeries {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Name of the series, in the legend, the tooltip and the table of values. */
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* The meaning of the series when its color states one (failures, successes): it is then drawn in
|
|
14
|
+
* the `status.*` color of the tone. Without tone, the series takes the next data series color.
|
|
15
|
+
*/
|
|
16
|
+
tone?: ChartSeriesTone;
|
|
17
|
+
}
|
|
18
|
+
export interface BarChartCategory {
|
|
19
|
+
id: string;
|
|
20
|
+
/** Text of the category axis, the tooltip and the table of values. */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Value of each series for this category, keyed by series id; a missing key is no bar. */
|
|
23
|
+
values: Record<string, number>;
|
|
24
|
+
}
|
|
25
|
+
export interface BarChartProps {
|
|
26
|
+
series: BarChartSeries[];
|
|
27
|
+
categories: BarChartCategory[];
|
|
28
|
+
/** Height of the plot, in px; the width follows the container. */
|
|
29
|
+
height: number;
|
|
30
|
+
/** `Vertical` by default. */
|
|
31
|
+
layout?: BarChartLayout;
|
|
32
|
+
/** Stacks the series of a category; grouped side by side otherwise. */
|
|
33
|
+
stacked?: boolean;
|
|
34
|
+
/** Text of a value: axis ticks, tooltip, table of values. */
|
|
35
|
+
formatValue(value: number): string;
|
|
36
|
+
/** Accessible name of the figure and caption of its table. */
|
|
37
|
+
label: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A bar chart drawn by nivo under `abyssNivoTheme`: one bar per series and category, grouped side by
|
|
41
|
+
* side or stacked, vertical or horizontal. Each series is colored by its tone (`status.*`) or else
|
|
42
|
+
* in the order of the data series palette among the series without tone, never by the host. Beyond
|
|
43
|
+
* one series, a legend names the colors. For screen readers the figure is named by `label` and its
|
|
44
|
+
* drawing is replaced by a table of every value; a chart without any value says so instead of
|
|
45
|
+
* drawing empty axes.
|
|
46
|
+
*/
|
|
47
|
+
export declare function BarChart({ series, categories, height, layout, stacked, formatValue, label, }: BarChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,4 +3,4 @@ import { DataTableProps } from './data-table.types';
|
|
|
3
3
|
* The table form of `DataTable`, from 768 px up. From 768 to 1199 px (next to the icon rail) the
|
|
4
4
|
* `Optional` columns are hidden.
|
|
5
5
|
*/
|
|
6
|
-
export declare function DataTableDesktop<T>({ columns: allColumns, rows, getRowId, density, selection, sort, onRowClick, loading, empty, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function DataTableDesktop<T>({ columns: allColumns, rows, getRowId, density, selection, sort, onRowClick, loading, empty, label, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,4 +3,4 @@ import { DataTableProps } from './data-table.types';
|
|
|
3
3
|
* The two-level list form of `DataTable` below 768 px (`.mli`): the selection stays, and the bulk
|
|
4
4
|
* actions move into an `ActionBar` at the bottom of the screen.
|
|
5
5
|
*/
|
|
6
|
-
export declare function DataTableMobile<T>({ rows, getRowId, selection, onRowClick, loading, empty, mobileRow, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function DataTableMobile<T>({ rows, getRowId, selection, onRowClick, loading, empty, mobileRow, label, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -74,4 +74,10 @@ export interface DataTableProps<T> {
|
|
|
74
74
|
empty: ReactNode;
|
|
75
75
|
/** The two-level item that replaces a row below 768 px. */
|
|
76
76
|
mobileRow: DataTableMobileRow<T>;
|
|
77
|
+
/**
|
|
78
|
+
* Accessible name of the table, and of the list that replaces it below 768 px: what the rows are
|
|
79
|
+
* (« Transferts Beam »). Without it, the table has no name and the list keeps the generic
|
|
80
|
+
* « Lignes ».
|
|
81
|
+
*/
|
|
82
|
+
label?: string;
|
|
77
83
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChartSeriesTone } from '../chart-series-tone';
|
|
1
2
|
export type LineChartX = Date | number;
|
|
2
3
|
export interface LineChartPoint {
|
|
3
4
|
x: LineChartX;
|
|
@@ -8,6 +9,11 @@ export interface LineChartSeries {
|
|
|
8
9
|
/** Name of the series, in the legend, the tooltip and the table of values. */
|
|
9
10
|
label: string;
|
|
10
11
|
points: LineChartPoint[];
|
|
12
|
+
/**
|
|
13
|
+
* The meaning of the series when its color states one (failures, successes): it is then drawn in
|
|
14
|
+
* the `status.*` color of the tone. Without tone, the series takes the next data series color.
|
|
15
|
+
*/
|
|
16
|
+
tone?: ChartSeriesTone;
|
|
11
17
|
}
|
|
12
18
|
export interface LineChartProps {
|
|
13
19
|
series: LineChartSeries[];
|
|
@@ -15,6 +21,11 @@ export interface LineChartProps {
|
|
|
15
21
|
height: number;
|
|
16
22
|
/** Fills the area under each line at the `.soft` opacity, from a zero baseline. */
|
|
17
23
|
area?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Stacks the series as areas from a zero baseline (`area` implied): an x a series has no point at
|
|
26
|
+
* counts as zero there. The tooltip and the table of values keep each series' own values.
|
|
27
|
+
*/
|
|
28
|
+
stacked?: boolean;
|
|
18
29
|
/** Text of an x value: axis ticks, tooltip, table of values. */
|
|
19
30
|
formatX(x: LineChartX): string;
|
|
20
31
|
/** Text of a y value: axis ticks, tooltip, table of values. */
|
|
@@ -23,10 +34,11 @@ export interface LineChartProps {
|
|
|
23
34
|
label: string;
|
|
24
35
|
}
|
|
25
36
|
/**
|
|
26
|
-
* A line chart drawn by nivo under `abyssNivoTheme`: one line per series, colored
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
37
|
+
* A line chart drawn by nivo under `abyssNivoTheme`: one line per series, colored by its tone
|
|
38
|
+
* (`status.*`) or else in the order of the data series palette among the series without tone
|
|
39
|
+
* (`data.series.1`, `2`…, the seventh starting over), never by the host. Dates give a time scale,
|
|
40
|
+
* numbers a linear one; `stacked` piles the series up as areas. Beyond one series, a legend names
|
|
41
|
+
* the colors. For screen readers the figure is named by `label` and its drawing is replaced by a
|
|
42
|
+
* table of every value; a chart without any point says so instead of drawing empty axes.
|
|
31
43
|
*/
|
|
32
|
-
export declare function LineChart({ series, height, area, formatX, formatY, label, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function LineChart({ series, height, area, stacked, formatX, formatY, label, }: LineChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SemanticToken } from '../../theme/tokens/semantic';
|
|
2
|
+
/**
|
|
3
|
+
* The meaning of a chart series whose color states something (ADR-0174, amendment « ton sémantique
|
|
4
|
+
* des séries »): a series of failures, of successes. A series without a meaning takes no tone and
|
|
5
|
+
* keeps the data series palette.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ChartSeriesTone {
|
|
8
|
+
Success = "success",
|
|
9
|
+
Warning = "warning",
|
|
10
|
+
Danger = "danger",
|
|
11
|
+
Info = "info",
|
|
12
|
+
Neutral = "neutral"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Colour token of each series: its tone, else the next data.series token among the series without
|
|
16
|
+
* tone. The palette counts only the series without tone (the first of them takes `data.series.1`,
|
|
17
|
+
* whatever toned series stand before it) and starts over after its sixth color.
|
|
18
|
+
*/
|
|
19
|
+
export declare function seriesColorTokens(series: {
|
|
20
|
+
tone?: ChartSeriesTone;
|
|
21
|
+
}[]): SemanticToken[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,14 +2,17 @@ export interface ColorFieldProps {
|
|
|
2
2
|
label: string;
|
|
3
3
|
value: string;
|
|
4
4
|
onChange(hex: string): void;
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Colors offered as one-click choices. `CHOICE_SWATCHES` by default, the user choice palette of the
|
|
7
|
+
* design system; a caller whose domain has its own colors passes them.
|
|
8
|
+
*/
|
|
9
|
+
swatches?: readonly string[];
|
|
7
10
|
}
|
|
8
11
|
/** `#rrggbb` or `rrggbb` as lowercase `#rrggbb`; `null` when it is not a 6-digit hexadecimal. */
|
|
9
12
|
export declare const normalizeHex: (input: string) => string | null;
|
|
10
13
|
/**
|
|
11
|
-
* A color input: a hexadecimal text field with a preview, plus the caller's
|
|
12
|
-
* emits `onChange` once the text is a valid `#rrggbb`
|
|
13
|
-
* other text shows a message and emits nothing. The swatches are toggle buttons in a labelled group.
|
|
14
|
+
* A color input: a hexadecimal text field with a preview, plus swatches (the caller's, or the
|
|
15
|
+
* choice palette `CHOICE_SWATCHES`). Typing emits `onChange` once the text is a valid `#rrggbb`
|
|
16
|
+
* (the `#` is optional, the case is normalized); any other text shows a message and emits nothing. The swatches are toggle buttons in a labelled group.
|
|
14
17
|
*/
|
|
15
18
|
export declare function ColorField({ label, value, onChange, swatches, }: ColorFieldProps): import("react/jsx-runtime").JSX.Element;
|