@abyss-project/commons-front-core 21.7.0 → 21.8.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/DateTimeField.tsx +55 -0
- package/catalog/pages/ModalFullScreen.tsx +78 -0
- package/catalog/pages/index.ts +4 -0
- package/dist/{CookieConsentSettings-BrCSm1XE.js → CookieConsentSettings-DmdpkY4W.js} +1 -1
- package/dist/{Surface-D72TnJbC.js → Surface-Bz9IlYzh.js} +552 -450
- package/dist/{Tabs-DVLY2xcX.js → Tabs-BCsiGmjM.js} +1 -1
- package/dist/components/inputs/DateTimeField/DateTimeField.d.ts +22 -0
- package/dist/components/inputs/DateTimeField/DateTimeField.spec.d.ts +1 -0
- package/dist/components/inputs/date-localization.d.ts +2 -1
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/layers/Modal/Modal.d.ts +20 -5
- package/dist/components/mobile/BottomSheet/BottomSheet.d.ts +11 -2
- package/dist/components/structure/AppShell/ShellNavigation.spec.d.ts +1 -0
- package/dist/components/structure/AppShell/use-reveal-active-entry.d.ts +10 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{editors-e2Ub2tja.js → editors-ROEvrYr4.js} +27 -27
- package/dist/editors.js +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +10 -0
- package/dist/{index-BQQDVuBk.js → index-5A2mIQ9G.js} +4 -4
- package/dist/{index-Delldxwj.js → index-BNlYqNm9.js} +3 -3
- package/dist/{index-u1nOu-io.js → index-BRaIFAIi.js} +4 -4
- package/dist/{index-BBPqIUfY.js → index-BVTeKL8H.js} +3 -3
- package/dist/{index-dl-FmtUS.js → index-BlYhAWr_.js} +1 -1
- package/dist/{index-D9dkSnz4.js → index-Btj0N4JN.js} +2 -2
- package/dist/{index-CCRG32M5.js → index-BuPLdG_9.js} +2 -2
- package/dist/{index-DmcHGNWF.js → index-BzT36p42.js} +4 -4
- package/dist/{index-Dl-asA62.js → index-CXgXyfY3.js} +2 -2
- package/dist/{index-DVZlrW-W.js → index-C_j0gA3H.js} +2 -2
- package/dist/{index-C3_b7Tvv.js → index-CeZseajO.js} +2 -2
- package/dist/{index-Rxl7Ly4v.js → index-Clxj6idW.js} +2 -2
- package/dist/{index-C7azTLVR.js → index-CpA0L8Ml.js} +2 -2
- package/dist/{index-DjMG8gzD.js → index-Cq_z0w7j.js} +3 -3
- package/dist/{index-fnqZ2bHM.js → index-D9WfqtNo.js} +2 -2
- package/dist/{index-DErr8t0U.js → index-DccwknnA.js} +2 -2
- package/dist/{index-CXpH_nma.js → index-DoQsEkVC.js} +3 -3
- package/dist/{index-BFJmgYfI.js → index-DxotIOMC.js} +2 -2
- package/dist/{index-BpaOna7B.js → index-L5J7_NGN.js} +2 -2
- package/dist/{index-B31D2APk.js → index-M8pctP26.js} +2 -2
- package/dist/{index-Co9YsCOx.js → index-z_gfRs5k.js} +2 -2
- package/dist/index.js +10293 -10109
- package/dist/translations/en.d.ts +5 -0
- package/dist/translations/fr.d.ts +5 -0
- package/package.json +2 -2
- package/scripts/check-dist-dir-imports.cjs +42 -0
- package/test-results/catalog/.last-run.json +4 -0
- package/vite.config.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog — @abyss-project/commons-front-core
|
|
2
2
|
|
|
3
|
+
## 21.8.1
|
|
4
|
+
|
|
5
|
+
Card #821. 21.8.0 left a bare `@mui/x-date-pickers/locales` directory import in `dist/index.js`: every consumer loading the dist under Node ESM (vitest) failed with ERR_UNSUPPORTED_DIR_IMPORT. The sub-path is now bundled like `AdapterDateFns` and `PickersDay`, and the build fails on any `@mui/x-date-pickers` sub-path import left in `dist/` (`scripts/check-dist-dir-imports.cjs`). Do not use 21.8.0.
|
|
6
|
+
|
|
7
|
+
## 21.8.0
|
|
8
|
+
|
|
9
|
+
Card #821. `ModalSize.FullScreen`: the `Modal` covers the viewport at every tier (never the bottom sheet below 768 px), edge to edge, header, body and footer clearing the device safe areas; the body has no padding and fills the remaining height (a viewer, an editor, a timer). New `Modal` and `BottomSheet` props for every size: `headerActions` (controls before the close button), `closeDisabled` (close button disabled, Escape and scrim ignored) and `onKeyDown`. `DateTimeField` (family `inputs`): date and time on the MUI X `DateTimePicker`, same contract as `DateField` at minute precision (`minDateTime`, `maxDateTime`, messages `ds.inputs.date-time.*`). The date pickers now take MUI X's own labels (clock, view switching) in the viewer's language. `AppShell` scrolls its navigation so that the active entry clears the bottom fade, on display and whenever the active entry changes, never the page and never against a manual scroll.
|
|
10
|
+
|
|
3
11
|
## 21.6.0
|
|
4
12
|
|
|
5
13
|
Card #851. `LoadingScreen` (family `states`): the branded loading screen, the mark of the product breathing over a thin sliding bar, for a wait that has no layout of its own to draw. Props `tool` (`ToolKind`, the Abyss mark by default), `placement` (`LoadingScreenPlacement.Viewport` over the window, `Page` in the content slot of a shell) and `delayed` (nothing before `durations.slow`). A busy `status` named by `ds.states.loading-screen.label`; still under `prefers-reduced-motion` (ADR-0298). `AbyssSessionBoundary` and `RequireSession` show it with the mark of their `service` instead of a bare spinner; `getServiceTool` and `SERVICE_TOOLS` map a service to its `ToolKind`. `ToolIcon` gains the 64 px size.
|
package/catalog/captures-plan.ts
CHANGED
|
@@ -72,6 +72,7 @@ const EXTRA_STATES: Record<string, CaptureState[]> = {
|
|
|
72
72
|
ComboboxField: ['list-open'],
|
|
73
73
|
ExpressionSearch: ['list-open'],
|
|
74
74
|
DateField: ['calendar-open'],
|
|
75
|
+
DateTimeField: ['calendar-open'],
|
|
75
76
|
NotificationsMenu: ['panel-open'],
|
|
76
77
|
AccountMenu: ['panel-open'],
|
|
77
78
|
ValueMenu: ['menu-open'],
|
|
@@ -112,6 +112,9 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
112
112
|
mobileCapture: true,
|
|
113
113
|
}),
|
|
114
114
|
entry('Modal', 'layers', 'modal', { mobileCapture: true }),
|
|
115
|
+
entry('ModalFullScreen', 'layers', 'modal-full-screen', {
|
|
116
|
+
mobileCapture: true,
|
|
117
|
+
}),
|
|
115
118
|
entry('ConfirmDialog', 'layers', 'confirm-dialog'),
|
|
116
119
|
entry('ConfirmDialogWarning', 'layers', 'confirm-dialog-warning'),
|
|
117
120
|
entry('Drawer', 'layers', 'drawer'),
|
|
@@ -126,6 +129,7 @@ export const CATALOG_ENTRIES: CatalogEntry[] = [
|
|
|
126
129
|
entry('ProductTour', 'layers', 'product-tour', { mobileCapture: true }),
|
|
127
130
|
entry('RichSelect', 'inputs', 'rich-select'),
|
|
128
131
|
entry('DateField', 'inputs', 'date-field'),
|
|
132
|
+
entry('DateTimeField', 'inputs', 'date-time-field'),
|
|
129
133
|
entry('DateRangeField', 'inputs', 'date-range-field'),
|
|
130
134
|
entry('ColorField', 'inputs', 'color-field'),
|
|
131
135
|
entry('SegmentedControl', 'inputs', 'segmented-control'),
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { DateTimeField } from '../../src/components/inputs/DateTimeField/DateTimeField';
|
|
4
|
+
import { breakpoints } from '../../src/theme/tokens/primitives';
|
|
5
|
+
import { Columns, Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
6
|
+
import { formatShortDate } from '../fixtures';
|
|
7
|
+
|
|
8
|
+
export const DateTimeFieldPage = () => {
|
|
9
|
+
const { log } = useEventLog();
|
|
10
|
+
const intl = useIntl();
|
|
11
|
+
const [start, setStart] = useState<Date | null>(new Date(2026, 9, 5, 18, 30));
|
|
12
|
+
const [end, setEnd] = useState<Date | null>(null);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Showcase
|
|
16
|
+
family="Saisie"
|
|
17
|
+
name="DateTimeField"
|
|
18
|
+
description="Date et heure saisies au clavier ou au sélecteur, au format de la langue de l'application ; seule une date-heure complète entre les bornes est émise, à la minute."
|
|
19
|
+
>
|
|
20
|
+
<Columns>
|
|
21
|
+
<Example title="Début de l'événement" maxWidth={breakpoints.sm}>
|
|
22
|
+
<DateTimeField
|
|
23
|
+
label="Début"
|
|
24
|
+
value={start}
|
|
25
|
+
onChange={(next) => {
|
|
26
|
+
setStart(next);
|
|
27
|
+
log(
|
|
28
|
+
next
|
|
29
|
+
? `début ${formatShortDate(next)} ${intl.formatTime(next)}`
|
|
30
|
+
: 'début vide',
|
|
31
|
+
);
|
|
32
|
+
}}
|
|
33
|
+
/>
|
|
34
|
+
</Example>
|
|
35
|
+
<Example title="Fin, après le début" maxWidth={breakpoints.sm}>
|
|
36
|
+
<DateTimeField
|
|
37
|
+
label="Fin"
|
|
38
|
+
value={end}
|
|
39
|
+
onChange={setEnd}
|
|
40
|
+
minDateTime={start ?? undefined}
|
|
41
|
+
/>
|
|
42
|
+
</Example>
|
|
43
|
+
<Example title="Erreur de l'hôte" maxWidth={breakpoints.sm}>
|
|
44
|
+
<DateTimeField
|
|
45
|
+
label="Expiration du lien"
|
|
46
|
+
value={new Date(2026, 4, 28, 9, 0)}
|
|
47
|
+
onChange={() => undefined}
|
|
48
|
+
error="Le lien ne peut pas expirer dans le passé."
|
|
49
|
+
/>
|
|
50
|
+
</Example>
|
|
51
|
+
</Columns>
|
|
52
|
+
<LastEvent />
|
|
53
|
+
</Showcase>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import Box from '@mui/material/Box';
|
|
3
|
+
import Button from '@mui/material/Button';
|
|
4
|
+
import IconButton from '@mui/material/IconButton';
|
|
5
|
+
import Tooltip from '@mui/material/Tooltip';
|
|
6
|
+
import DownloadOutlined from '@mui/icons-material/DownloadOutlined';
|
|
7
|
+
import ShareOutlined from '@mui/icons-material/ShareOutlined';
|
|
8
|
+
import { Modal, ModalSize } from '../../src/components/layers/Modal/Modal';
|
|
9
|
+
import { hairline, px } from '../../src/theme/components/shared';
|
|
10
|
+
import { Example, LastEvent, Showcase, useEventLog } from '../frame';
|
|
11
|
+
|
|
12
|
+
export const ModalFullScreenPage = () => {
|
|
13
|
+
const { log } = useEventLog();
|
|
14
|
+
const [open, setOpen] = useState(true);
|
|
15
|
+
const action = (label: string, icon: JSX.Element) => (
|
|
16
|
+
<Tooltip title={label}>
|
|
17
|
+
<IconButton aria-label={label} onClick={() => log(label)}>
|
|
18
|
+
{icon}
|
|
19
|
+
</IconButton>
|
|
20
|
+
</Tooltip>
|
|
21
|
+
);
|
|
22
|
+
return (
|
|
23
|
+
<Showcase
|
|
24
|
+
family="Couches"
|
|
25
|
+
name="Modal plein écran"
|
|
26
|
+
description="ModalSize.FullScreen : la fenêtre couvre l'écran à toutes les tailles (jamais de feuille du bas), en-tête du Modal avec actions d'en-tête avant Fermer, corps sans marge que le contenu occupe en entier (visionneuse, éditeur, minuteur). Marges de sécurité de l'appareil comprises."
|
|
27
|
+
>
|
|
28
|
+
<Example title="Visionneuse d'un fichier">
|
|
29
|
+
<Button variant="contained" onClick={() => setOpen(true)}>
|
|
30
|
+
Ouvrir
|
|
31
|
+
</Button>
|
|
32
|
+
</Example>
|
|
33
|
+
<LastEvent />
|
|
34
|
+
<Modal
|
|
35
|
+
open={open}
|
|
36
|
+
onClose={() => {
|
|
37
|
+
setOpen(false);
|
|
38
|
+
log('fermer');
|
|
39
|
+
}}
|
|
40
|
+
size={ModalSize.FullScreen}
|
|
41
|
+
title="facture-ovh-2026-10.pdf"
|
|
42
|
+
description="3 sur 12 · 184 Ko"
|
|
43
|
+
headerActions={
|
|
44
|
+
<>
|
|
45
|
+
{action('Partager', <ShareOutlined />)}
|
|
46
|
+
{action('Télécharger', <DownloadOutlined />)}
|
|
47
|
+
</>
|
|
48
|
+
}
|
|
49
|
+
onKeyDown={(event) => {
|
|
50
|
+
if (event.key === 'ArrowRight' || event.key === 'ArrowLeft') {
|
|
51
|
+
log(`touche ${event.key}`);
|
|
52
|
+
}
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
<Box
|
|
56
|
+
sx={(theme) => ({
|
|
57
|
+
flex: 1,
|
|
58
|
+
display: 'flex',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
justifyContent: 'center',
|
|
61
|
+
padding: px(theme.design.space[5]),
|
|
62
|
+
})}
|
|
63
|
+
>
|
|
64
|
+
<Box
|
|
65
|
+
sx={(theme) => ({
|
|
66
|
+
width: '100%',
|
|
67
|
+
maxWidth: px(theme.design.space[10] * 6),
|
|
68
|
+
aspectRatio: '1 / 1.414',
|
|
69
|
+
backgroundColor: theme.design.tokens['bg.raised'],
|
|
70
|
+
border: hairline(theme.design.tokens['border.subtle']),
|
|
71
|
+
borderRadius: px(theme.design.radii.md),
|
|
72
|
+
})}
|
|
73
|
+
/>
|
|
74
|
+
</Box>
|
|
75
|
+
</Modal>
|
|
76
|
+
</Showcase>
|
|
77
|
+
);
|
|
78
|
+
};
|
package/catalog/pages/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import { CompanySearchFieldPage } from './CompanySearchField';
|
|
|
32
32
|
import { EntityImageFieldPage } from './EntityImageField';
|
|
33
33
|
import { DataTablePage } from './DataTable';
|
|
34
34
|
import { DateFieldPage } from './DateField';
|
|
35
|
+
import { DateTimeFieldPage } from './DateTimeField';
|
|
35
36
|
import { DateRangeFieldPage } from './DateRangeField';
|
|
36
37
|
import { DrawerPage } from './Drawer';
|
|
37
38
|
import { DropZonePage } from './DropZone';
|
|
@@ -51,6 +52,7 @@ import { MenuPage } from './Menu';
|
|
|
51
52
|
import { MethodBadgePage } from './MethodBadge';
|
|
52
53
|
import { MobileShellPage } from './MobileShell';
|
|
53
54
|
import { ModalPage } from './Modal';
|
|
55
|
+
import { ModalFullScreenPage } from './ModalFullScreen';
|
|
54
56
|
import { NotificationsMenuPage } from './NotificationsMenu';
|
|
55
57
|
import { LoadingScreenPage } from './LoadingScreen';
|
|
56
58
|
import { NumberFieldPage } from './NumberField';
|
|
@@ -120,6 +122,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
|
120
122
|
EntityImageField: EntityImageFieldPage,
|
|
121
123
|
DataTable: DataTablePage,
|
|
122
124
|
DateField: DateFieldPage,
|
|
125
|
+
DateTimeField: DateTimeFieldPage,
|
|
123
126
|
DateRangeField: DateRangeFieldPage,
|
|
124
127
|
Drawer: DrawerPage,
|
|
125
128
|
DropZone: DropZonePage,
|
|
@@ -139,6 +142,7 @@ export const CATALOG_PAGES: Record<string, ComponentType> = {
|
|
|
139
142
|
MethodBadge: MethodBadgePage,
|
|
140
143
|
MobileShell: MobileShellPage,
|
|
141
144
|
Modal: ModalPage,
|
|
145
|
+
ModalFullScreen: ModalFullScreenPage,
|
|
142
146
|
NotificationsMenu: NotificationsMenuPage,
|
|
143
147
|
NumberField: NumberFieldPage,
|
|
144
148
|
PageHeader: PageHeaderPage,
|
|
@@ -3,7 +3,7 @@ import { useState as v, useCallback as b, useEffect as T, useLayoutEffect as ie,
|
|
|
3
3
|
import w from "@mui/material/Button";
|
|
4
4
|
import Q from "@mui/material/Switch";
|
|
5
5
|
import { styled as y } from "@mui/material/styles";
|
|
6
|
-
import { T as K, w as O, p as f, d as D, D as N, S as R, a as V, u as M, M as C, b as X, h as ae, c as ce, e as le } from "./Surface-
|
|
6
|
+
import { T as K, w as O, p as f, d as D, D as N, S as R, a as V, u as M, M as C, b as X, h as ae, c as ce, e as le } from "./Surface-Bz9IlYzh.js";
|
|
7
7
|
import { useQuery as de, useMutation as ue } from "@tanstack/react-query";
|
|
8
8
|
import { AbyssCore as j } from "@abyss-project/main";
|
|
9
9
|
import { createPortal as fe } from "react-dom";
|