@abyss-project/commons-front-core 7.0.0 → 8.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/README.md +24 -0
- package/catalog/playwright.ci.config.ts +29 -0
- package/catalog/vite.config.ts +6 -1
- package/dist/{AbyssModal.component-Be9980v8.js → AbyssCookieConsentProvider-BhSzVu8P.js} +2393 -2142
- package/dist/CookieConsentSettings.component-DMEAuCVS.js +77 -0
- package/dist/auth/components/AuthHeroLayout/AuthHeroLayout.component.d.ts +39 -0
- package/dist/auth/components/AuthHeroLayout/AuthHeroLayout.component.spec.d.ts +1 -0
- package/dist/auth/components/AuthHeroLayout/auth-hero.context.d.ts +11 -0
- package/dist/auth/components/index.d.ts +3 -0
- package/dist/auth/components/shared/OneTimeCodeField.component.d.ts +6 -2
- package/dist/auth/components/shared/OneTimeCodeField.component.spec.d.ts +1 -0
- package/dist/auth/components/test-support/own-css.d.ts +5 -0
- package/dist/components/layers/Toast/Toast.d.ts +1 -1
- package/dist/components/structure/AppShell/AppShell.d.ts +1 -1
- package/dist/components/structure/test-support/structure-test-harness.d.ts +1 -1
- package/dist/cookie-consent.js +17 -16
- package/dist/{design-theme-BSrfO5Lg.js → design-theme-CvLzOz3p.js} +3469 -3262
- package/dist/fonts.css +1 -1
- package/dist/hooks/use-rich-intl.hook.d.ts +36 -0
- package/dist/{index-DEAXSgTl.js → index-21vSFz6u.js} +2 -2
- package/dist/{index-BLlNcpG3.js → index-6KdfKdSJ.js} +2 -2
- package/dist/{index-C_Sk7zwR.js → index-7HAvRXgu.js} +2 -2
- package/dist/{index-MZi-_cYy.js → index-ASLTmD1Y.js} +2 -2
- package/dist/{index-BzCSI9XW.js → index-BTjzj7mm.js} +2 -2
- package/dist/{index-A5kt29MO.js → index-BVS73U9E.js} +4 -4
- package/dist/{index-Do1fJzj3.js → index-BkfBpYKR.js} +3 -3
- package/dist/{index-CHSMfNLS.js → index-BqIg55B3.js} +4 -4
- package/dist/{index-CqYmPMRC.js → index-Btnmn1iK.js} +4 -4
- package/dist/{index-DwH67Kcz.js → index-BtsnuEJC.js} +25265 -23537
- package/dist/{index-CfGWl_3N.js → index-C92C_oG5.js} +2 -2
- package/dist/{index-CQtuGy2v.js → index-CHGRiRCe.js} +3 -3
- package/dist/{index-Ds5uSeS4.js → index-ClLoBnCN.js} +2 -2
- package/dist/{index-WQz3nM40.js → index-D4Qh2Iww.js} +3 -3
- package/dist/{index-BuzeZTOG.js → index-D5e4uD4k.js} +2 -2
- package/dist/{index-Cnpf4y1o.js → index-D_GWBYM2.js} +1 -1
- package/dist/{index-Dj8ju3uH.js → index-DixNft1u.js} +2 -2
- package/dist/{index-Bkf4H0Hz.js → index-GoHiFeaw.js} +2 -2
- package/dist/{index-BaELetix.js → index-LdiTmDFg.js} +2 -2
- package/dist/{index-DTPUe23x.js → index-Ni4BmFs4.js} +2 -2
- package/dist/{index-CrrfwI5H.js → index-bR-mnNUA.js} +2 -2
- package/dist/{index-l4rCdiSM.js → index-l7FAjaVB.js} +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2610 -2232
- package/dist/legacy/components/CookieConsent/AbyssCookieConsentProvider.d.ts +5 -0
- package/dist/legacy/components/CookieConsent/AbyssCookieConsentProvider.spec.d.ts +1 -0
- package/dist/legacy/components/Utils/AbyssErrorPage/AbyssErrorBoundary.component.spec.d.ts +1 -0
- package/dist/legacy/fonts.css +1 -1
- package/dist/legacy.js +206 -205
- package/dist/rum/AbyssRumProvider.d.ts +29 -0
- package/dist/rum/AbyssRumProvider.spec.d.ts +1 -0
- package/dist/rum/feedback-ticket.d.ts +24 -0
- package/dist/rum/index.d.ts +2 -0
- package/dist/theme/augmentation.d.ts +1 -1
- package/dist/theme/components/shared.d.ts +1 -1
- package/dist/theme/create-abyss-theme.d.ts +1 -1
- package/dist/theme/design-theme.d.ts +1 -1
- package/dist/theme/tokens/oklch.d.ts +1 -1
- package/dist/theme/tokens/soft.d.ts +1 -1
- package/dist/translations/en.d.ts +14 -0
- package/dist/translations/fr.d.ts +14 -0
- package/package.json +10 -5
- package/vite.config.ts +1 -1
- package/dist/CookieConsentSettings.component-CE2qOlyC.js +0 -299
- package/test-results/catalog/.last-run.json +0 -4
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as C } from "react";
|
|
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-BhSzVu8P.js";
|
|
5
|
+
const B = () => {
|
|
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
|
+
return C(() => {
|
|
8
|
+
c !== void 0 && g(c), n !== void 0 && f(n);
|
|
9
|
+
}, [c, n]), /* @__PURE__ */ e(v, { sx: { borderRadius: 3 }, children: /* @__PURE__ */ e(b, { children: /* @__PURE__ */ a(u, { spacing: 2, children: [
|
|
10
|
+
/* @__PURE__ */ e(o, { variant: "h6", children: t.formatRichMessage({ id: "cookies.configure.title" }) }),
|
|
11
|
+
/* @__PURE__ */ e(
|
|
12
|
+
l,
|
|
13
|
+
{
|
|
14
|
+
control: /* @__PURE__ */ e(d, { checked: !0, disabled: !0 }),
|
|
15
|
+
label: /* @__PURE__ */ a(r, { children: [
|
|
16
|
+
/* @__PURE__ */ e(o, { variant: "body2", fontWeight: 600, children: t.formatRichMessage({
|
|
17
|
+
id: "cookies.category.essentials.title"
|
|
18
|
+
}) }),
|
|
19
|
+
/* @__PURE__ */ e(o, { variant: "caption", color: "text.secondary", children: t.formatRichMessage({
|
|
20
|
+
id: "cookies.category.essentials.description"
|
|
21
|
+
}) })
|
|
22
|
+
] })
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ e(
|
|
26
|
+
l,
|
|
27
|
+
{
|
|
28
|
+
control: /* @__PURE__ */ e(
|
|
29
|
+
d,
|
|
30
|
+
{
|
|
31
|
+
checked: h,
|
|
32
|
+
onChange: (p, s) => g(s)
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
label: /* @__PURE__ */ a(r, { children: [
|
|
36
|
+
/* @__PURE__ */ e(o, { variant: "body2", fontWeight: 600, children: t.formatRichMessage({
|
|
37
|
+
id: "cookies.category.analytics.title"
|
|
38
|
+
}) }),
|
|
39
|
+
/* @__PURE__ */ e(o, { variant: "caption", color: "text.secondary", children: t.formatRichMessage({
|
|
40
|
+
id: "cookies.category.analytics.description"
|
|
41
|
+
}) })
|
|
42
|
+
] })
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ e(
|
|
46
|
+
l,
|
|
47
|
+
{
|
|
48
|
+
control: /* @__PURE__ */ e(
|
|
49
|
+
d,
|
|
50
|
+
{
|
|
51
|
+
checked: k,
|
|
52
|
+
onChange: (p, s) => f(s)
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
label: /* @__PURE__ */ a(r, { children: [
|
|
56
|
+
/* @__PURE__ */ e(o, { variant: "body2", fontWeight: 600, children: t.formatRichMessage({
|
|
57
|
+
id: "cookies.category.marketing.title"
|
|
58
|
+
}) }),
|
|
59
|
+
/* @__PURE__ */ e(o, { variant: "caption", color: "text.secondary", children: t.formatRichMessage({
|
|
60
|
+
id: "cookies.category.marketing.description"
|
|
61
|
+
}) })
|
|
62
|
+
] })
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ e(r, { children: /* @__PURE__ */ e(
|
|
66
|
+
M,
|
|
67
|
+
{
|
|
68
|
+
variant: "contained",
|
|
69
|
+
onClick: () => y({ analytics: h, marketing: k }),
|
|
70
|
+
children: t.formatRichMessage({ id: "cookies.action.save" })
|
|
71
|
+
}
|
|
72
|
+
) })
|
|
73
|
+
] }) }) });
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
B as C
|
|
77
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { AbyssService } from '@abyss-project/main';
|
|
3
|
+
/**
|
|
4
|
+
* - `web` (default): the hero below `md` only; from `md` up the children render alone, so the
|
|
5
|
+
* host keeps its own desktop layout (abyss-main's split screen).
|
|
6
|
+
* - `native`: the hero at every width, the sheet centred and at most `SHEET_MAX_WIDTH` wide on a
|
|
7
|
+
* large screen (a tablet in landscape keeps the service's identity).
|
|
8
|
+
*/
|
|
9
|
+
export declare enum AuthHeroLayoutVariant {
|
|
10
|
+
WEB = "web",
|
|
11
|
+
NATIVE = "native"
|
|
12
|
+
}
|
|
13
|
+
export type AuthHeroLayoutProps = {
|
|
14
|
+
/**
|
|
15
|
+
* Requested service, already validated. null/undefined or a service without a tagline -> Abyss
|
|
16
|
+
* logo, name and tagline; a service without logo (Odyssey) -> Abyss logo, its own name and tagline.
|
|
17
|
+
*/
|
|
18
|
+
service?: AbyssService | null;
|
|
19
|
+
/** `AuthHeroLayoutVariant.WEB` by default. */
|
|
20
|
+
variant?: AuthHeroLayoutVariant;
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The frame of the sign-in screen (D1, D6): a hero carrying the requested service's logo, name and
|
|
25
|
+
* tagline on the brand gradient, then a sheet with rounded top corners climbing over it, holding
|
|
26
|
+
* the children. The hero pads the top safe area, the sheet the bottom one (D7). The sheet is the
|
|
27
|
+
* page's `<main>` landmark (the hosts have none around the sign-in screen).
|
|
28
|
+
*
|
|
29
|
+
* - `AuthHeroLayoutVariant.WEB` (default): the hero below `md` only. From `md` up the children
|
|
30
|
+
* render alone, so the host keeps its own desktop layout; the wrappers then take no box
|
|
31
|
+
* (`display: contents`), which keeps the children mounted when the screen crosses the breakpoint
|
|
32
|
+
* (a rotated tablet does not restart the flow).
|
|
33
|
+
* - `AuthHeroLayoutVariant.NATIVE`: the hero at every width; on a screen wider than a phone the
|
|
34
|
+
* sheet is centred, at most 480 px wide, and the hero's content is aligned on it.
|
|
35
|
+
*
|
|
36
|
+
* Children shrink the hero through `useAuthHero().setCompact` (`AuthFlow` does it at the code,
|
|
37
|
+
* second-factor and enrolment steps).
|
|
38
|
+
*/
|
|
39
|
+
export declare const AuthHeroLayout: FC<AuthHeroLayoutProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
export interface AuthHeroContextValue {
|
|
3
|
+
/** Shrinks the hero (tile and name on one line, no tagline), or brings it back to full size. */
|
|
4
|
+
setCompact: (compact: boolean) => void;
|
|
5
|
+
/** Rendered in the hero's sheet: the hero pads the top safe area, the sheet the bottom one. */
|
|
6
|
+
insideHero: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** Outside an `AuthHeroLayout` (or on a large screen): no hero to shrink, no safe area handled. */
|
|
9
|
+
export declare const AuthHeroContext: Context<AuthHeroContextValue>;
|
|
10
|
+
/** The hero around the auth screen, if any; a no-op outside `AuthHeroLayout`. */
|
|
11
|
+
export declare const useAuthHero: () => AuthHeroContextValue;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { AuthFlow } from './AuthFlow/AuthFlow.component';
|
|
2
2
|
export type { AuthFlowProps } from './AuthFlow/AuthFlow.component';
|
|
3
|
+
export { AuthHeroLayout, AuthHeroLayoutVariant, } from './AuthHeroLayout/AuthHeroLayout.component';
|
|
4
|
+
export type { AuthHeroLayoutProps } from './AuthHeroLayout/AuthHeroLayout.component';
|
|
5
|
+
export { useAuthHero } from './AuthHeroLayout/auth-hero.context';
|
|
3
6
|
export type { AuthFlowContext, AuthFlowLegal, AuthFlowResult, } from './AuthFlow/auth-flow.types';
|
|
4
7
|
export { AuthProviderButtons, AuthProviderKind, } from './AuthProviderButtons/AuthProviderButtons.component';
|
|
5
8
|
export type { AuthFlowProviders, AuthProviderButtonsProps, } from './AuthProviderButtons/AuthProviderButtons.component';
|
|
@@ -10,8 +10,12 @@ type Props = {
|
|
|
10
10
|
autoFocus?: boolean;
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
|
-
* Six-digit code field (e-mail code, TOTP).
|
|
14
|
-
*
|
|
13
|
+
* Six-digit code field (e-mail code, TOTP), drawn as six cells. The cells only render the value:
|
|
14
|
+
* the field stays a single real `<input>` laid transparent over them, so `one-time-code` still
|
|
15
|
+
* lets the platform offer the code it just received, a pasted code keeps working whatever its
|
|
16
|
+
* spacing (only the digits are kept), and a click on any cell lands in that input. After an
|
|
17
|
+
* error, the focus comes back to the input as soon as it can be typed in again, and the cells
|
|
18
|
+
* leave their red state at the first new digit (the host's message keeps saying the cause).
|
|
15
19
|
*/
|
|
16
20
|
export declare const OneTimeCodeField: ({ id, label, value, onChange, disabled, error, autoFocus, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
21
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,7 +22,7 @@ export interface ToastProviderProps {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Time a toast stays on screen, in ms, counted again from the start each time the pointer or the
|
|
25
|
-
* focus leaves it. Not an ADR-
|
|
25
|
+
* focus leaves it. Not an ADR-0174 value: the ADR fixes animation durations only.
|
|
26
26
|
*/
|
|
27
27
|
export declare const TOAST_DURATION = 5000;
|
|
28
28
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AppShellProps } from './app-shell.types';
|
|
2
2
|
/**
|
|
3
|
-
* The frame of every web front (ADR-
|
|
3
|
+
* The frame of every web front (ADR-0174 §5, mock-up `.app`, `.side`): the space card with the
|
|
4
4
|
* product icon and the personal or organization space menu, the "Mon espace Abyss" link, the
|
|
5
5
|
* navigation sections with their counts, an optional footer, a top bar and the page. There is no
|
|
6
6
|
* application switcher: each service keeps its own front.
|
|
@@ -3,7 +3,7 @@ import { RenderResult } from '@testing-library/react';
|
|
|
3
3
|
import { Theme } from '@mui/material/styles';
|
|
4
4
|
import { Density, ThemeMode } from '../../../theme';
|
|
5
5
|
export declare const THEME_MODES: ThemeMode[];
|
|
6
|
-
/** Viewport widths of the three layouts (ADR-
|
|
6
|
+
/** Viewport widths of the three layouts (ADR-0174 §3, paliers). */
|
|
7
7
|
export declare const VIEWPORT: {
|
|
8
8
|
readonly desktop: 1440;
|
|
9
9
|
readonly tablet: 1024;
|
package/dist/cookie-consent.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { C as
|
|
1
|
+
import { A as e, c as a, C as n, D as C, R as i, V as t, d as r, f as A, r as k, e as c, u as l, b, a as f, w as u } from "./AbyssCookieConsentProvider-BhSzVu8P.js";
|
|
2
|
+
import { C as E } from "./CookieConsentSettings.component-DMEAuCVS.js";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
4
|
+
e as AbyssCookieConsentProvider,
|
|
5
|
+
a as COOKIE_NAME,
|
|
6
|
+
n as CookieConsentBanner,
|
|
7
|
+
E as CookieConsentSettings,
|
|
8
|
+
C as DEFAULT_PRIVACY_HREF,
|
|
9
|
+
i as ReconcileAction,
|
|
10
|
+
t as VALIDITY_DAYS,
|
|
11
|
+
r as clearCookie,
|
|
12
|
+
A as flattenTranslations,
|
|
13
|
+
k as readCookie,
|
|
14
|
+
c as reconcile,
|
|
15
|
+
l as useAbyssCookieConsent,
|
|
16
|
+
b as useCookieConsent,
|
|
17
|
+
f as useOptionalAbyssCookieConsent,
|
|
18
|
+
u as writeCookie
|
|
18
19
|
};
|