@abyss-project/commons-front-core 16.1.0 → 16.1.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/CHANGELOG.md +8 -0
- package/catalog/captures-plan.ts +1 -0
- package/catalog/catalog-entries.ts +4 -0
- package/catalog/pages/Accordion.tsx +93 -0
- package/catalog/pages/Breadcrumbs.tsx +61 -0
- package/catalog/pages/ComboboxField.tsx +220 -0
- package/catalog/pages/Menu.tsx +3 -1
- package/catalog/pages/Modal.tsx +3 -1
- package/catalog/pages/SegmentedControl.tsx +18 -4
- package/catalog/pages/StatusBadge.tsx +37 -18
- package/catalog/pages/index.ts +6 -0
- package/catalog/specs/write-capture-index.ts +1 -0
- package/dist/{CookieConsentSettings-DM0P2po1.js → CookieConsentSettings-CTAyLGkm.js} +1 -1
- package/dist/{Surface-DW78GtlG.js → Surface-76bwVL_Z.js} +370 -323
- package/dist/{Tabs-DGh_2Lgc.js → Tabs-D2bdAWGo.js} +384 -376
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/ComboboxField/ComboboxField.d.ts +190 -0
- package/dist/components/inputs/ComboboxField/ComboboxField.spec.d.ts +1 -0
- package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +8 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/layers/Menu/Menu.d.ts +11 -1
- package/dist/components/layers/Modal/Modal.d.ts +3 -1
- package/dist/components/meaning/StatusBadge/StatusBadge.d.ts +25 -3
- package/dist/components/mobile/BottomSheet/BottomSheet.d.ts +3 -1
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.d.ts +43 -0
- package/dist/components/navigation/Breadcrumbs/Breadcrumbs.spec.d.ts +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/structure/Accordion/Accordion.d.ts +65 -0
- package/dist/components/structure/Accordion/Accordion.spec.d.ts +1 -0
- package/dist/components/structure/PageHeader/PageHeader.d.ts +3 -5
- package/dist/components/structure/index.d.ts +1 -0
- package/dist/components/structure/test-support/structure-test-harness.d.ts +6 -1
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-BNfby4u0.js → design-theme-B1PgRGnU.js} +2 -2
- package/dist/{editors-CoA-ElkI.js → editors-C2rcatuM.js} +27 -27
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +26 -0
- package/dist/{index-DSRCuEE1.js → index-3lv992-d.js} +2 -2
- package/dist/{index-9AhVX_o8.js → index-4Yy0aUgK.js} +1 -1
- package/dist/{index-BNnh8uiO.js → index-BFmuZ1fy.js} +2 -2
- package/dist/{index-B4W3BpjI.js → index-BQDShLfx.js} +4 -4
- package/dist/{index-CpJ_UF5V.js → index-BT4II8Xn.js} +2 -2
- package/dist/{index-BPIERrcr.js → index-CNEoRNth.js} +3 -3
- package/dist/{index-C2MJfXbp.js → index-CSuco3OH.js} +2 -2
- package/dist/{index-BXY3SD83.js → index-CV-IfV6z.js} +2 -2
- package/dist/{index-jHXiCbzE.js → index-CY7TSo5q.js} +2 -2
- package/dist/{index-Dl1yghiT.js → index-Cv2nccBd.js} +2 -2
- package/dist/{index-DakS19sw.js → index-CwT2qdxO.js} +2 -2
- package/dist/{index-DJ4F-yGQ.js → index-D0JsaNEm.js} +3 -3
- package/dist/{index-SJdLMrNS.js → index-Dc4AUxs3.js} +2 -2
- package/dist/{index-ebpXyaXh.js → index-Dn53bUXz.js} +2 -2
- package/dist/{index--WDnqvkI.js → index-DoXNSm4g.js} +3 -3
- package/dist/{index-Dgongfv-.js → index-Ds9SlbVU.js} +2 -2
- package/dist/{index-BX4GOdlN.js → index-N01-gzsR.js} +4 -4
- package/dist/{index-DF-LePxe.js → index-PFLipTVz.js} +2 -2
- package/dist/{index-MEKGvAmO.js → index-vvVLoC4J.js} +3 -3
- package/dist/{index-CMyVfh9D.js → index-wZeZLKGl.js} +2 -2
- package/dist/{index-BIX2oQnD.js → index-zLjfdiAC.js} +4 -4
- package/dist/index.js +7381 -6705
- package/dist/legacy.js +1014 -921
- package/dist/translations/en.d.ts +13 -0
- package/dist/translations/fr.d.ts +13 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog — @abyss-project/commons-front-core
|
|
2
2
|
|
|
3
|
+
## 16.1.1
|
|
4
|
+
|
|
5
|
+
No export or signature changed (card #782).
|
|
6
|
+
|
|
7
|
+
- MUI icons are imported one by one (`@mui/icons-material/<Icon>`) in `legacy/` and the design theme: the published `dist/legacy.js` and `dist/design-theme-*.js` no longer import the `@mui/icons-material` barrel (~10 000 modules), which every vitest test file of a consumer loaded again. Measured: importing `dist/legacy.js` 33-41 s -> 9 s, the design theme 22-25 s -> 4 s.
|
|
8
|
+
- ESLint `@typescript-eslint/no-restricted-imports` forbids the barrel in this package (type imports allowed).
|
|
9
|
+
- `load-safety.spec.ts` no longer mocks the barrel.
|
|
10
|
+
|
|
3
11
|
## 16.1.0
|
|
4
12
|
|
|
5
13
|
Additions only (card #227, lot D2, ADR-0248). No export removed, no signature changed.
|
package/catalog/captures-plan.ts
CHANGED
|
@@ -53,6 +53,7 @@ const STATE_SUFFIX: Record<CaptureState, string> = {
|
|
|
53
53
|
const EXTRA_STATES: Record<string, CaptureState> = {
|
|
54
54
|
SceneMobile: 'sheet-open',
|
|
55
55
|
RichSelect: 'list-open',
|
|
56
|
+
ComboboxField: 'list-open',
|
|
56
57
|
ExpressionSearch: 'list-open',
|
|
57
58
|
DateField: 'calendar-open',
|
|
58
59
|
NotificationsMenu: 'panel-open',
|
|
@@ -12,6 +12,7 @@ export type CatalogFamily =
|
|
|
12
12
|
| 'meaning'
|
|
13
13
|
| 'business'
|
|
14
14
|
| 'layers'
|
|
15
|
+
| 'navigation'
|
|
15
16
|
| 'inputs';
|
|
16
17
|
|
|
17
18
|
export interface CatalogEntry {
|
|
@@ -52,6 +53,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
52
53
|
entry('FilterBar', 'structure', 'filter-bar', RESPONSIVE),
|
|
53
54
|
entry('SplitView', 'structure', 'split-view', RESPONSIVE),
|
|
54
55
|
entry('Tabs', 'structure', 'tabs', RESPONSIVE),
|
|
56
|
+
entry('Accordion', 'structure', 'accordion', RESPONSIVE),
|
|
55
57
|
entry('AmbientBackground', 'structure', 'ambient-background', {
|
|
56
58
|
mobileCapture: true,
|
|
57
59
|
}),
|
|
@@ -59,6 +61,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
59
61
|
mobileCapture: true,
|
|
60
62
|
}),
|
|
61
63
|
entry('AccountMenu', 'structure', 'account-menu'),
|
|
64
|
+
entry('Breadcrumbs', 'navigation', 'breadcrumbs', RESPONSIVE),
|
|
62
65
|
entry('MobileShell', 'mobile', 'mobile-shell', RESPONSIVE),
|
|
63
66
|
entry('BottomSheet', 'mobile', 'bottom-sheet', RESPONSIVE),
|
|
64
67
|
entry('ActionBar', 'mobile', 'action-bar', RESPONSIVE),
|
|
@@ -115,6 +118,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
115
118
|
entry('NumberField', 'inputs', 'number-field'),
|
|
116
119
|
entry('SettingsRow', 'inputs', 'settings-row', RESPONSIVE),
|
|
117
120
|
entry('CopyField', 'inputs', 'copy-field', RESPONSIVE),
|
|
121
|
+
entry('ComboboxField', 'inputs', 'combobox-field', RESPONSIVE),
|
|
118
122
|
entry('UserPicker', 'inputs', 'user-picker', RESPONSIVE),
|
|
119
123
|
entry('CompanySearchField', 'inputs', 'company-search-field', RESPONSIVE),
|
|
120
124
|
entry('EntityImageField', 'inputs', 'entity-image-field', RESPONSIVE),
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import BoltOutlined from '@mui/icons-material/BoltOutlined';
|
|
3
|
+
import NotificationsNoneOutlined from '@mui/icons-material/NotificationsNoneOutlined';
|
|
4
|
+
import ScheduleOutlined from '@mui/icons-material/ScheduleOutlined';
|
|
5
|
+
import {
|
|
6
|
+
Accordion,
|
|
7
|
+
AccordionGroup,
|
|
8
|
+
AccordionTone,
|
|
9
|
+
AccordionVariant,
|
|
10
|
+
} from '../../src/components/structure/Accordion/Accordion';
|
|
11
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
12
|
+
|
|
13
|
+
export const AccordionPage = () => {
|
|
14
|
+
const { log } = useEventLog();
|
|
15
|
+
const [remindersOpen, setRemindersOpen] = useState(true);
|
|
16
|
+
return (
|
|
17
|
+
<Showcase
|
|
18
|
+
family="Structure"
|
|
19
|
+
name="Accordion"
|
|
20
|
+
description="Section repliable : un en-tête de 44 px qui ouvre et ferme son contenu, avec résumé, icône et ton d’erreur. Plusieurs ouvertes, ou une seule dans un groupe."
|
|
21
|
+
>
|
|
22
|
+
<Example title="Blocs de réglage, résumé d’état" maxWidth={640}>
|
|
23
|
+
<AccordionGroup defaultValue={['cron']}>
|
|
24
|
+
<Accordion
|
|
25
|
+
id="cron"
|
|
26
|
+
title="Exécution des tâches planifiées"
|
|
27
|
+
summary={
|
|
28
|
+
<>
|
|
29
|
+
Alerter si une exécution dépasse <strong>10 minutes</strong>
|
|
30
|
+
</>
|
|
31
|
+
}
|
|
32
|
+
icon={<ScheduleOutlined fontSize="small" />}
|
|
33
|
+
onExpandedChange={(open) =>
|
|
34
|
+
log(`cron ${open ? 'ouvert' : 'fermé'}`)
|
|
35
|
+
}
|
|
36
|
+
>
|
|
37
|
+
Réglages de la tâche planifiée.
|
|
38
|
+
</Accordion>
|
|
39
|
+
<Accordion
|
|
40
|
+
id="sentinel"
|
|
41
|
+
title="Sondes de disponibilité"
|
|
42
|
+
summary="Deux sondes actives, toutes les minutes"
|
|
43
|
+
icon={<BoltOutlined fontSize="small" />}
|
|
44
|
+
aside="Modifier"
|
|
45
|
+
>
|
|
46
|
+
Réglages des sondes.
|
|
47
|
+
</Accordion>
|
|
48
|
+
</AccordionGroup>
|
|
49
|
+
</Example>
|
|
50
|
+
<Example title="Champs à corriger" maxWidth={640}>
|
|
51
|
+
<Accordion
|
|
52
|
+
title="Rappels de canal"
|
|
53
|
+
summary="2 champs à corriger"
|
|
54
|
+
tone={AccordionTone.Danger}
|
|
55
|
+
icon={<NotificationsNoneOutlined fontSize="small" />}
|
|
56
|
+
expanded={remindersOpen}
|
|
57
|
+
onExpandedChange={setRemindersOpen}
|
|
58
|
+
>
|
|
59
|
+
Intervalle et nombre de rappels.
|
|
60
|
+
</Accordion>
|
|
61
|
+
</Example>
|
|
62
|
+
<Example title="À plat, une seule ouverte à la fois" maxWidth={420}>
|
|
63
|
+
<AccordionGroup exclusive defaultValue={['projects']}>
|
|
64
|
+
<Accordion
|
|
65
|
+
id="projects"
|
|
66
|
+
variant={AccordionVariant.Flat}
|
|
67
|
+
title="Projets"
|
|
68
|
+
icon={<BoltOutlined fontSize="small" />}
|
|
69
|
+
>
|
|
70
|
+
Créer un projet, inviter des membres, choisir un outil.
|
|
71
|
+
</Accordion>
|
|
72
|
+
<Accordion
|
|
73
|
+
id="billing"
|
|
74
|
+
variant={AccordionVariant.Flat}
|
|
75
|
+
title="Facturation"
|
|
76
|
+
icon={<ScheduleOutlined fontSize="small" />}
|
|
77
|
+
>
|
|
78
|
+
Plan, moyens de paiement et factures.
|
|
79
|
+
</Accordion>
|
|
80
|
+
<Accordion
|
|
81
|
+
id="security"
|
|
82
|
+
variant={AccordionVariant.Flat}
|
|
83
|
+
title="Sécurité"
|
|
84
|
+
icon={<NotificationsNoneOutlined fontSize="small" />}
|
|
85
|
+
>
|
|
86
|
+
Double authentification et sessions ouvertes.
|
|
87
|
+
</Accordion>
|
|
88
|
+
</AccordionGroup>
|
|
89
|
+
</Example>
|
|
90
|
+
<LastEvent />
|
|
91
|
+
</Showcase>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Breadcrumbs } from '../../src/components/navigation/Breadcrumbs/Breadcrumbs';
|
|
2
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
3
|
+
|
|
4
|
+
const DEEP_PATH = [
|
|
5
|
+
'Espace',
|
|
6
|
+
'Documentation',
|
|
7
|
+
'Produit',
|
|
8
|
+
'Guides',
|
|
9
|
+
'Démarrage',
|
|
10
|
+
'Installation',
|
|
11
|
+
'Premiers pas',
|
|
12
|
+
].map((label) => ({ label, href: `/${label}` }));
|
|
13
|
+
|
|
14
|
+
const LONG_LABEL = 'Un chemin de page très long qui ne tient pas sur une ligne';
|
|
15
|
+
|
|
16
|
+
export const BreadcrumbsPage = () => {
|
|
17
|
+
const { log } = useEventLog();
|
|
18
|
+
return (
|
|
19
|
+
<Showcase
|
|
20
|
+
family="Navigation"
|
|
21
|
+
name="Breadcrumbs"
|
|
22
|
+
description="Fil d’Ariane : liens ou boutons, la page courante en dernier. Un chemin long cache son milieu derrière « … » ; sur une ligne, chaque miette est coupée par une ellipse."
|
|
23
|
+
>
|
|
24
|
+
<Example title="Chemin court, page courante" maxWidth={640}>
|
|
25
|
+
<Breadcrumbs
|
|
26
|
+
items={[
|
|
27
|
+
{ label: 'Banking', href: '/accueil' },
|
|
28
|
+
{ label: 'Comptes', href: '/comptes' },
|
|
29
|
+
{ label: 'Compte courant' },
|
|
30
|
+
]}
|
|
31
|
+
/>
|
|
32
|
+
</Example>
|
|
33
|
+
<Example
|
|
34
|
+
title="Chemin long : cinq miettes au plus, « … » au milieu"
|
|
35
|
+
maxWidth={640}
|
|
36
|
+
>
|
|
37
|
+
<Breadcrumbs items={DEEP_PATH} maxItems={5} maxItemsMobile={3} />
|
|
38
|
+
</Example>
|
|
39
|
+
<Example title="Miettes longues, sur une ligne" maxWidth={420}>
|
|
40
|
+
<Breadcrumbs
|
|
41
|
+
items={[
|
|
42
|
+
{ label: LONG_LABEL, href: '/long' },
|
|
43
|
+
{ label: LONG_LABEL, href: '/long/2' },
|
|
44
|
+
{ label: LONG_LABEL },
|
|
45
|
+
]}
|
|
46
|
+
/>
|
|
47
|
+
</Example>
|
|
48
|
+
<Example title="Miette qui agit, retour à la ligne permis" maxWidth={420}>
|
|
49
|
+
<Breadcrumbs
|
|
50
|
+
wrap
|
|
51
|
+
items={[
|
|
52
|
+
{ label: 'Projets', onClick: () => log('projets') },
|
|
53
|
+
{ label: 'Atlas', href: '/atlas' },
|
|
54
|
+
{ label: 'Réglages du fil d’Ariane' },
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
</Example>
|
|
58
|
+
<LastEvent />
|
|
59
|
+
</Showcase>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import ArticleOutlined from '@mui/icons-material/ArticleOutlined';
|
|
3
|
+
import DashboardOutlined from '@mui/icons-material/DashboardOutlined';
|
|
4
|
+
import DrawOutlined from '@mui/icons-material/DrawOutlined';
|
|
5
|
+
import {
|
|
6
|
+
ComboboxField,
|
|
7
|
+
ComboboxInputSource,
|
|
8
|
+
ComboboxTag,
|
|
9
|
+
} from '../../src/components/inputs/ComboboxField/ComboboxField';
|
|
10
|
+
import type { ComboboxOption } from '../../src/components/inputs/ComboboxField/ComboboxField';
|
|
11
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
12
|
+
|
|
13
|
+
const TOOLS: ComboboxOption[] = [
|
|
14
|
+
{
|
|
15
|
+
value: 'atlas',
|
|
16
|
+
label: 'Atlas',
|
|
17
|
+
description: 'Pages, wiki et documentation',
|
|
18
|
+
icon: <ArticleOutlined fontSize="small" />,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
value: 'board',
|
|
22
|
+
label: 'Board',
|
|
23
|
+
description: 'Tableaux de tâches',
|
|
24
|
+
icon: <DashboardOutlined fontSize="small" />,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: 'draw',
|
|
28
|
+
label: 'Draw',
|
|
29
|
+
description: 'Schémas et tableaux blancs',
|
|
30
|
+
icon: <DrawOutlined fontSize="small" />,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
interface Label {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
color: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const LABELS: Label[] = [
|
|
41
|
+
{ id: 'l1', name: 'Urgent', color: '#e5484d' },
|
|
42
|
+
{ id: 'l2', name: 'À planifier', color: '#3e63dd' },
|
|
43
|
+
{ id: 'l3', name: 'Client', color: '#30a46c' },
|
|
44
|
+
{ id: 'l4', name: 'Dette technique', color: '#8e4ec6' },
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const ROUTES = [
|
|
48
|
+
'/project/:id/monitor/alerts',
|
|
49
|
+
'/project/:id/monitor/logs',
|
|
50
|
+
'/project/:id/storage',
|
|
51
|
+
];
|
|
52
|
+
|
|
53
|
+
interface Region {
|
|
54
|
+
name: string;
|
|
55
|
+
zone: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const REGIONS: Region[] = [
|
|
59
|
+
{ name: 'Paris', zone: 'Europe' },
|
|
60
|
+
{ name: 'Francfort', zone: 'Europe' },
|
|
61
|
+
{ name: 'Montréal', zone: 'Amérique' },
|
|
62
|
+
{ name: 'Virginie', zone: 'Amérique' },
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
/** Delay of the simulated server search, in ms. */
|
|
66
|
+
const SEARCH_DELAY = 600;
|
|
67
|
+
|
|
68
|
+
/** A server search answered from memory, after a delay: the catalog has no network. */
|
|
69
|
+
const useSimulatedSearch = () => {
|
|
70
|
+
const [query, setQuery] = useState('');
|
|
71
|
+
const [results, setResults] = useState<string[]>(ROUTES);
|
|
72
|
+
const [loading, setLoading] = useState(false);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
setLoading(true);
|
|
75
|
+
const timer = setTimeout(() => {
|
|
76
|
+
setResults(
|
|
77
|
+
ROUTES.filter((route) =>
|
|
78
|
+
route.toLowerCase().includes(query.trim().toLowerCase()),
|
|
79
|
+
),
|
|
80
|
+
);
|
|
81
|
+
setLoading(false);
|
|
82
|
+
}, SEARCH_DELAY);
|
|
83
|
+
return () => clearTimeout(timer);
|
|
84
|
+
}, [query]);
|
|
85
|
+
return { results, loading, search: setQuery };
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const ComboboxFieldPage = () => {
|
|
89
|
+
const { log } = useEventLog();
|
|
90
|
+
const [tool, setTool] = useState<ComboboxOption | null>(TOOLS[0]);
|
|
91
|
+
const [labels, setLabels] = useState<Label[]>([LABELS[0], LABELS[2]]);
|
|
92
|
+
const [key, setKey] = useState('');
|
|
93
|
+
const [route, setRoute] = useState('');
|
|
94
|
+
const [recipients, setRecipients] = useState<string[]>(['alice@abyss.fr']);
|
|
95
|
+
const [region, setRegion] = useState<Region | null>(null);
|
|
96
|
+
const remote = useSimulatedSearch();
|
|
97
|
+
return (
|
|
98
|
+
<Showcase
|
|
99
|
+
family="Saisie"
|
|
100
|
+
name="ComboboxField"
|
|
101
|
+
description="Champ à liste filtrée par la saisie : un choix, plusieurs (puces retirables), ou du texte libre à côté des options. Options riches, groupes, recherche confiée au serveur."
|
|
102
|
+
>
|
|
103
|
+
<Example title="Choix simple, options riches" maxWidth={480}>
|
|
104
|
+
<ComboboxField
|
|
105
|
+
label="Outil"
|
|
106
|
+
placeholder="Choisir un outil"
|
|
107
|
+
options={TOOLS}
|
|
108
|
+
value={tool}
|
|
109
|
+
onChange={(next) => {
|
|
110
|
+
setTool(next);
|
|
111
|
+
log(`outil ${next?.value ?? 'aucun'}`);
|
|
112
|
+
}}
|
|
113
|
+
help="Les options portent une icône et une description."
|
|
114
|
+
/>
|
|
115
|
+
</Example>
|
|
116
|
+
<Example title="Choix multiple, puces colorées" maxWidth={480}>
|
|
117
|
+
<ComboboxField<Label>
|
|
118
|
+
multiple
|
|
119
|
+
label="Étiquettes"
|
|
120
|
+
placeholder="Ajouter une étiquette"
|
|
121
|
+
options={LABELS}
|
|
122
|
+
value={labels}
|
|
123
|
+
getOptionLabel={(label) => label.name}
|
|
124
|
+
getOptionKey={(label) => label.id}
|
|
125
|
+
disableCloseOnSelect
|
|
126
|
+
renderTag={(label, item) => (
|
|
127
|
+
<ComboboxTag label={label.name} color={label.color} item={item} />
|
|
128
|
+
)}
|
|
129
|
+
onChange={(next) => {
|
|
130
|
+
setLabels(next);
|
|
131
|
+
log(`étiquettes ${next.map((label) => label.name).join(', ')}`);
|
|
132
|
+
}}
|
|
133
|
+
/>
|
|
134
|
+
</Example>
|
|
135
|
+
<Example title="Texte libre avec suggestions, police mono" maxWidth={480}>
|
|
136
|
+
<ComboboxField
|
|
137
|
+
freeSolo
|
|
138
|
+
monospace
|
|
139
|
+
label="Clé d’attribut"
|
|
140
|
+
placeholder="plan, route, navigateur…"
|
|
141
|
+
options={['plan', 'route', 'navigateur']}
|
|
142
|
+
value={null}
|
|
143
|
+
onChange={(next) => log(`clé ${String(next)}`)}
|
|
144
|
+
inputValue={key}
|
|
145
|
+
onInputChange={(text) => setKey(text)}
|
|
146
|
+
/>
|
|
147
|
+
</Example>
|
|
148
|
+
<Example title="Texte libre en puces, aucune liste" maxWidth={480}>
|
|
149
|
+
<ComboboxField<string>
|
|
150
|
+
multiple
|
|
151
|
+
freeSolo
|
|
152
|
+
autoSelect
|
|
153
|
+
label="Destinataires"
|
|
154
|
+
placeholder="Saisir une adresse puis Entrée"
|
|
155
|
+
options={[]}
|
|
156
|
+
value={recipients}
|
|
157
|
+
onChange={(next) => {
|
|
158
|
+
setRecipients(next.map(String));
|
|
159
|
+
log(`destinataires ${next.length}`);
|
|
160
|
+
}}
|
|
161
|
+
help="Entrée ou la sortie du champ crée la puce."
|
|
162
|
+
/>
|
|
163
|
+
</Example>
|
|
164
|
+
<Example title="Options groupées" maxWidth={480}>
|
|
165
|
+
<ComboboxField<Region>
|
|
166
|
+
label="Région"
|
|
167
|
+
placeholder="Choisir une région"
|
|
168
|
+
options={REGIONS}
|
|
169
|
+
value={region}
|
|
170
|
+
getOptionLabel={(item) => item.name}
|
|
171
|
+
groupBy={(item) => item.zone}
|
|
172
|
+
onChange={(next) => {
|
|
173
|
+
setRegion(next);
|
|
174
|
+
log(`région ${next?.name ?? 'aucune'}`);
|
|
175
|
+
}}
|
|
176
|
+
/>
|
|
177
|
+
</Example>
|
|
178
|
+
<Example title="Recherche serveur" maxWidth={480}>
|
|
179
|
+
<ComboboxField
|
|
180
|
+
freeSolo
|
|
181
|
+
monospace
|
|
182
|
+
label="Route"
|
|
183
|
+
placeholder="/project/:id/…"
|
|
184
|
+
options={remote.results}
|
|
185
|
+
loading={remote.loading}
|
|
186
|
+
filterOptions={(all) => all}
|
|
187
|
+
value={null}
|
|
188
|
+
onChange={(next) => log(`route ${String(next)}`)}
|
|
189
|
+
inputValue={route}
|
|
190
|
+
onInputChange={(text, source) => {
|
|
191
|
+
setRoute(text);
|
|
192
|
+
if (source === ComboboxInputSource.Typed) {
|
|
193
|
+
remote.search(text);
|
|
194
|
+
}
|
|
195
|
+
}}
|
|
196
|
+
/>
|
|
197
|
+
</Example>
|
|
198
|
+
<Example title="Obligatoire, en erreur" maxWidth={480}>
|
|
199
|
+
<ComboboxField
|
|
200
|
+
label="Outil"
|
|
201
|
+
required
|
|
202
|
+
options={TOOLS}
|
|
203
|
+
value={null}
|
|
204
|
+
onChange={() => undefined}
|
|
205
|
+
error="Choisissez un outil."
|
|
206
|
+
/>
|
|
207
|
+
</Example>
|
|
208
|
+
<Example title="Inactif" maxWidth={480}>
|
|
209
|
+
<ComboboxField
|
|
210
|
+
label="Outil"
|
|
211
|
+
options={TOOLS}
|
|
212
|
+
value={TOOLS[1]}
|
|
213
|
+
onChange={() => undefined}
|
|
214
|
+
disabled
|
|
215
|
+
/>
|
|
216
|
+
</Example>
|
|
217
|
+
<LastEvent />
|
|
218
|
+
</Showcase>
|
|
219
|
+
);
|
|
220
|
+
};
|
package/catalog/pages/Menu.tsx
CHANGED
|
@@ -30,7 +30,7 @@ export const MenuPage = () => {
|
|
|
30
30
|
<Showcase
|
|
31
31
|
family="Couches"
|
|
32
32
|
name="Menu"
|
|
33
|
-
description="Menu d'actions : icône, description, raccourci, ton danger, entrées désactivées sautées par les flèches."
|
|
33
|
+
description="Menu d'actions : titres de groupe, icône, description, raccourci, ton danger, entrées désactivées sautées par les flèches."
|
|
34
34
|
>
|
|
35
35
|
<Example title="Actions d'un fichier">
|
|
36
36
|
<Button
|
|
@@ -48,6 +48,7 @@ export const MenuPage = () => {
|
|
|
48
48
|
open={anchor !== null}
|
|
49
49
|
onClose={() => setAnchor(null)}
|
|
50
50
|
items={[
|
|
51
|
+
{ id: 'group-file', title: 'Fichier' },
|
|
51
52
|
{
|
|
52
53
|
id: 'share',
|
|
53
54
|
label: 'Partager',
|
|
@@ -84,6 +85,7 @@ export const MenuPage = () => {
|
|
|
84
85
|
onSelect: select('chiffrer'),
|
|
85
86
|
},
|
|
86
87
|
MenuSeparator.Divider,
|
|
88
|
+
{ id: 'group-danger', title: 'Zone sensible' },
|
|
87
89
|
{
|
|
88
90
|
id: 'trash',
|
|
89
91
|
label: 'Mettre à la corbeille',
|
package/catalog/pages/Modal.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import Button from '@mui/material/Button';
|
|
3
|
+
import CategoryOutlined from '@mui/icons-material/CategoryOutlined';
|
|
3
4
|
import { Modal } from '../../src/components/layers/Modal/Modal';
|
|
4
5
|
import { KeyValueList } from '../../src/components/data/KeyValueList/KeyValueList';
|
|
5
6
|
import { RichSelect } from '../../src/components/inputs/RichSelect/RichSelect';
|
|
@@ -14,7 +15,7 @@ export const ModalPage = () => {
|
|
|
14
15
|
<Showcase
|
|
15
16
|
family="Couches"
|
|
16
17
|
name="Modal"
|
|
17
|
-
description="Fenêtre modale : titre, description, corps qui défile, pied d'actions. Sous 768 px elle devient une feuille du bas."
|
|
18
|
+
description="Fenêtre modale : titre (avec une icône facultative), description, corps qui défile, pied d'actions. Sous 768 px elle devient une feuille du bas."
|
|
18
19
|
>
|
|
19
20
|
<Example title="Catégoriser une transaction">
|
|
20
21
|
<Button variant="contained" onClick={() => setOpen(true)}>
|
|
@@ -29,6 +30,7 @@ export const ModalPage = () => {
|
|
|
29
30
|
log('fermer');
|
|
30
31
|
}}
|
|
31
32
|
title="Catégoriser la transaction"
|
|
33
|
+
titleIcon={<CategoryOutlined />}
|
|
32
34
|
description="OVHcloud · PRLV SEPA OVH SAS · 06/10/2026"
|
|
33
35
|
actions={
|
|
34
36
|
<>
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
+
import GridViewOutlined from '@mui/icons-material/GridViewOutlined';
|
|
3
|
+
import ViewListOutlined from '@mui/icons-material/ViewListOutlined';
|
|
2
4
|
import { SegmentedControl } from '../../src/components/inputs/SegmentedControl/SegmentedControl';
|
|
3
5
|
import type { SegmentedOption } from '../../src/components/inputs/SegmentedControl/SegmentedControl';
|
|
4
6
|
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
@@ -14,10 +16,14 @@ const PERIOD_OPTIONS: SegmentedOption<Period>[] = [
|
|
|
14
16
|
];
|
|
15
17
|
|
|
16
18
|
const LAYOUT_OPTIONS: SegmentedOption<Layout>[] = [
|
|
17
|
-
{ value: 'grid', label: 'Grille' },
|
|
18
|
-
{ value: 'list', label: 'Liste' },
|
|
19
|
+
{ value: 'grid', label: 'Grille', icon: <GridViewOutlined /> },
|
|
20
|
+
{ value: 'list', label: 'Liste', icon: <ViewListOutlined /> },
|
|
19
21
|
];
|
|
20
22
|
|
|
23
|
+
const LAYOUT_ICON_ONLY_OPTIONS: SegmentedOption<Layout>[] = LAYOUT_OPTIONS.map(
|
|
24
|
+
(option) => ({ ...option, iconOnly: true }),
|
|
25
|
+
);
|
|
26
|
+
|
|
21
27
|
export const SegmentedControlPage = () => {
|
|
22
28
|
const { log } = useEventLog();
|
|
23
29
|
const [view, setView] =
|
|
@@ -29,7 +35,7 @@ export const SegmentedControlPage = () => {
|
|
|
29
35
|
<Showcase
|
|
30
36
|
family="Saisie"
|
|
31
37
|
name="SegmentedControl"
|
|
32
|
-
description="Choix exclusif entre quelques vues : un seul arrêt de tabulation, flèches, Début et Fin, compteur
|
|
38
|
+
description="Choix exclusif entre quelques vues : un seul arrêt de tabulation, flèches, Début et Fin, compteur et icône facultatifs."
|
|
33
39
|
>
|
|
34
40
|
<Example title="Vues des transactions, avec compteurs">
|
|
35
41
|
<SegmentedControl
|
|
@@ -50,7 +56,7 @@ export const SegmentedControlPage = () => {
|
|
|
50
56
|
onChange={(next) => setPeriod(next)}
|
|
51
57
|
/>
|
|
52
58
|
</Example>
|
|
53
|
-
<Example title="Disposition">
|
|
59
|
+
<Example title="Disposition, avec icône">
|
|
54
60
|
<SegmentedControl
|
|
55
61
|
ariaLabel="Disposition"
|
|
56
62
|
options={LAYOUT_OPTIONS}
|
|
@@ -58,6 +64,14 @@ export const SegmentedControlPage = () => {
|
|
|
58
64
|
onChange={(next) => setLayout(next)}
|
|
59
65
|
/>
|
|
60
66
|
</Example>
|
|
67
|
+
<Example title="Disposition, icônes seules">
|
|
68
|
+
<SegmentedControl
|
|
69
|
+
ariaLabel="Disposition (icônes)"
|
|
70
|
+
options={LAYOUT_ICON_ONLY_OPTIONS}
|
|
71
|
+
value={layout}
|
|
72
|
+
onChange={(next) => setLayout(next)}
|
|
73
|
+
/>
|
|
74
|
+
</Example>
|
|
61
75
|
<LastEvent />
|
|
62
76
|
</Showcase>
|
|
63
77
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
1
2
|
import {
|
|
2
3
|
StatusBadge,
|
|
3
4
|
StatusTone,
|
|
@@ -13,21 +14,39 @@ const TONES: Array<{ tone: StatusTone; label: string }> = [
|
|
|
13
14
|
{ tone: StatusTone.Neutral, label: 'Terminé' },
|
|
14
15
|
];
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
17
|
+
const FILTERS = ['Statut : Actif', 'Étiquette : Urgent', 'Membre : Camille'];
|
|
18
|
+
|
|
19
|
+
export const StatusBadgePage = () => {
|
|
20
|
+
const [filters, setFilters] = useState(FILTERS);
|
|
21
|
+
return (
|
|
22
|
+
<Showcase
|
|
23
|
+
family="Sens"
|
|
24
|
+
name="StatusBadge"
|
|
25
|
+
description="État d'un objet : six tons sémantiques, avec ou sans point, retirable pour un filtre ou une valeur que l'on peut ôter."
|
|
26
|
+
>
|
|
27
|
+
<Example title="Sans point" framed>
|
|
28
|
+
{TONES.map(({ tone, label }) => (
|
|
29
|
+
<StatusBadge key={tone} tone={tone} label={label} />
|
|
30
|
+
))}
|
|
31
|
+
</Example>
|
|
32
|
+
<Example title="Avec point" framed>
|
|
33
|
+
{TONES.map(({ tone, label }) => (
|
|
34
|
+
<StatusBadge key={tone} tone={tone} label={label} dot />
|
|
35
|
+
))}
|
|
36
|
+
</Example>
|
|
37
|
+
<Example title="Retirable (filtres actifs)" framed>
|
|
38
|
+
{filters.map((filter) => (
|
|
39
|
+
<StatusBadge
|
|
40
|
+
key={filter}
|
|
41
|
+
tone={StatusTone.Neutral}
|
|
42
|
+
label={filter}
|
|
43
|
+
removeLabel={`Retirer le filtre ${filter}`}
|
|
44
|
+
onRemove={() =>
|
|
45
|
+
setFilters(filters.filter((kept) => kept !== filter))
|
|
46
|
+
}
|
|
47
|
+
/>
|
|
48
|
+
))}
|
|
49
|
+
</Example>
|
|
50
|
+
</Showcase>
|
|
51
|
+
);
|
|
52
|
+
};
|
package/catalog/pages/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
+
import { AccordionPage } from './Accordion';
|
|
2
3
|
import { AccountMenuPage } from './AccountMenu';
|
|
3
4
|
import { ActionBarPage } from './ActionBar';
|
|
4
5
|
import { AmbientBackgroundPage } from './AmbientBackground';
|
|
@@ -7,11 +8,13 @@ import { AppShellPage } from './AppShell';
|
|
|
7
8
|
import { AvatarPage } from './Avatar';
|
|
8
9
|
import { BarChartPage } from './BarChart';
|
|
9
10
|
import { BottomSheetPage } from './BottomSheet';
|
|
11
|
+
import { BreadcrumbsPage } from './Breadcrumbs';
|
|
10
12
|
import { CalloutPage } from './Callout';
|
|
11
13
|
import { ChartThemePage } from './ChartTheme';
|
|
12
14
|
import { CloudImportPage } from './CloudImport';
|
|
13
15
|
import { ColorFieldPage } from './ColorField';
|
|
14
16
|
import { CommandPalettePage } from './CommandPalette';
|
|
17
|
+
import { ComboboxFieldPage } from './ComboboxField';
|
|
15
18
|
import { ConfirmDialogPage } from './ConfirmDialog';
|
|
16
19
|
import { ConfirmDialogWarningPage } from './ConfirmDialogWarning';
|
|
17
20
|
import { ContextSelectorPage } from './ContextSelector';
|
|
@@ -76,6 +79,7 @@ import { ValueMenuPage } from './ValueMenu';
|
|
|
76
79
|
|
|
77
80
|
/** Every catalog page, by the `component` URL parameter (`catalog-entries.ts`). */
|
|
78
81
|
export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
82
|
+
Accordion: AccordionPage,
|
|
79
83
|
AccountMenu: AccountMenuPage,
|
|
80
84
|
ActionBar: ActionBarPage,
|
|
81
85
|
AmbientBackground: AmbientBackgroundPage,
|
|
@@ -84,11 +88,13 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
|
84
88
|
Avatar: AvatarPage,
|
|
85
89
|
BarChart: BarChartPage,
|
|
86
90
|
BottomSheet: BottomSheetPage,
|
|
91
|
+
Breadcrumbs: BreadcrumbsPage,
|
|
87
92
|
Callout: CalloutPage,
|
|
88
93
|
ChartTheme: ChartThemePage,
|
|
89
94
|
CloudImport: CloudImportPage,
|
|
90
95
|
ColorField: ColorFieldPage,
|
|
91
96
|
CommandPalette: CommandPalettePage,
|
|
97
|
+
ComboboxField: ComboboxFieldPage,
|
|
92
98
|
ConfirmDialog: ConfirmDialogPage,
|
|
93
99
|
ConfirmDialogWarning: ConfirmDialogWarningPage,
|
|
94
100
|
ContextSelector: ContextSelectorPage,
|
|
@@ -3,7 +3,7 @@ import { useState as y, useCallback as p, useEffect as T, useId as h, useRef as
|
|
|
3
3
|
import I from "@mui/material/Button";
|
|
4
4
|
import H from "@mui/material/Switch";
|
|
5
5
|
import { styled as d } from "@mui/material/styles";
|
|
6
|
-
import { p as o, h as ee, d as D, D as O, a as $, t as V, u as A, S as Y, M as te, b as ne } from "./Surface-
|
|
6
|
+
import { p as o, h as ee, d as D, D as O, a as $, t as V, u as A, S as Y, M as te, b as ne } from "./Surface-76bwVL_Z.js";
|
|
7
7
|
import { useQuery as ie, useMutation as oe } from "@tanstack/react-query";
|
|
8
8
|
import { AbyssCore as W } from "@abyss-project/main";
|
|
9
9
|
import se from "@mui/material/Link";
|