@abyss-project/commons-front-core 15.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/dist/{CookieConsentSettings-B7NfjgaI.js → CookieConsentSettings-DM0P2po1.js} +1 -1
- package/dist/{Surface-BEhoEhyC.js → Surface-DW78GtlG.js} +6 -0
- package/dist/{Tabs-DJ9_ZFjM.js → Tabs-DGh_2Lgc.js} +1 -1
- 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 +5 -0
- package/dist/components/data/LineChart/LineChart.d.ts +26 -1
- package/dist/components/editors/MarkdownEditor/MarkdownEditor.d.ts +22 -1
- package/dist/components/editors/MarkdownEditor/index.d.ts +1 -1
- package/dist/components/inputs/DropTargetOverlay/DropTargetOverlay.d.ts +12 -0
- package/dist/components/inputs/DropTargetOverlay/DropTargetOverlay.spec.d.ts +1 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/cookie-consent.js +2 -2
- package/dist/{design-theme-N9jJSXdK.js → design-theme-BNfby4u0.js} +95 -90
- package/dist/{editors-QM76tqZI.js → editors-CoA-ElkI.js} +6654 -6626
- package/dist/editors.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-file-drop-target.hook.d.ts +34 -0
- package/dist/hooks/use-rich-intl.hook.d.ts +58 -20
- package/dist/{index-DCk0q3d7.js → index--WDnqvkI.js} +3 -3
- package/dist/{index-COUUAr5G.js → index-9AhVX_o8.js} +1 -1
- package/dist/{index-3-SmpH5N.js → index-B4W3BpjI.js} +4 -4
- package/dist/{index-CQU0eEXk.js → index-BIX2oQnD.js} +4 -4
- package/dist/{index-mmrA4ErC.js → index-BNnh8uiO.js} +2 -2
- package/dist/{index-5OVR3WNo.js → index-BPIERrcr.js} +3 -3
- package/dist/{index-DmAoL9-1.js → index-BX4GOdlN.js} +4 -4
- package/dist/{index-D1M_muSg.js → index-BXY3SD83.js} +2 -2
- package/dist/{index-4b2f7sdW.js → index-C2MJfXbp.js} +2 -2
- package/dist/{index-BKAfoA1a.js → index-CMyVfh9D.js} +2 -2
- package/dist/{index-D8ncJrf1.js → index-CpJ_UF5V.js} +2 -2
- package/dist/{index-DYXAfA_s.js → index-DF-LePxe.js} +2 -2
- package/dist/{index-jZGexiyT.js → index-DJ4F-yGQ.js} +3 -3
- package/dist/{index-pX3CTxFd.js → index-DSRCuEE1.js} +2 -2
- package/dist/{index-C6jhogFt.js → index-DakS19sw.js} +2 -2
- package/dist/{index-Taee9VIc.js → index-Dgongfv-.js} +2 -2
- package/dist/{index-DA-HUFp6.js → index-Dl1yghiT.js} +2 -2
- package/dist/{index-Ce0rv5wr.js → index-MEKGvAmO.js} +3 -3
- package/dist/{index-nKbvjf2P.js → index-SJdLMrNS.js} +2 -2
- package/dist/{index-DW3SBSsW.js → index-ebpXyaXh.js} +2 -2
- package/dist/{index-CM5COMvb.js → index-jHXiCbzE.js} +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5940 -5628
- package/dist/legacy/theme/create-theme.d.ts +7 -1
- package/dist/legacy/theme/create-theme.spec.d.ts +1 -0
- package/dist/legacy.js +581 -571
- package/dist/motion/Appear.d.ts +25 -0
- package/dist/motion/AppearList.d.ts +31 -0
- package/dist/motion/index.d.ts +4 -0
- package/dist/motion/motion.d.ts +24 -0
- package/dist/motion/motion.spec.d.ts +1 -0
- package/dist/motion/use-added-keys.hook.d.ts +7 -0
- package/dist/motion/use-added-keys.hook.spec.d.ts +1 -0
- package/dist/rum/AbyssRumProvider.d.ts +1 -1
- package/dist/rum/feedback-ticket.d.ts +2 -2
- package/dist/rum/rum-provider-config.d.ts +1 -1
- package/dist/theme/AbyssThemeProvider.d.ts +2 -1
- package/dist/theme/DesignCssVariables.d.ts +2 -1
- package/dist/theme/augmentation.d.ts +2 -1
- package/dist/theme/create-abyss-theme.d.ts +4 -1
- package/dist/theme/design-theme.d.ts +1 -1
- package/dist/theme/index.d.ts +2 -1
- package/dist/theme/reduced-motion.d.ts +7 -0
- package/dist/theme/reduced-motion.spec.d.ts +1 -0
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/fr.d.ts +3 -0
- package/package.json +5 -5
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export interface AppearProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Whether the content is shown. Defaults to `true`. Going `false` fades it out and unmounts it;
|
|
7
|
+
* going `true` again mounts it and animates it in.
|
|
8
|
+
*/
|
|
9
|
+
in?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Animate the entry when this component mounts. Defaults to `true`; `false` for what is already
|
|
12
|
+
* there at the first render of a page, which never animates.
|
|
13
|
+
*/
|
|
14
|
+
appear?: boolean;
|
|
15
|
+
/** Called once the exit fade is over and the content is unmounted. */
|
|
16
|
+
onExited?: () => void;
|
|
17
|
+
/** Styles of the wrapper element (its layout, say), merged after the motion styles. */
|
|
18
|
+
sx?: SxProps<Theme>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Wraps an element that enters: it fades in while rising 4 px (`motion.enter`), and fades out
|
|
22
|
+
* when `in` turns `false` (`motion.exit`). The animation lives on a wrapper `div`, so the wrapped
|
|
23
|
+
* element keeps its own `transform` (a dnd-kit card, see the README).
|
|
24
|
+
*/
|
|
25
|
+
export declare function Appear({ children, in: shown, appear, onExited, sx, }: AppearProps): JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
|
+
export interface AppearListProps {
|
|
4
|
+
/**
|
|
5
|
+
* The items of the list, each with a stable `key`. An item whose key was not there before is
|
|
6
|
+
* animated in; one whose key disappears is faded out before it unmounts. The items present at
|
|
7
|
+
* the first render are never animated.
|
|
8
|
+
*/
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Fade the removed items out before unmounting them. Defaults to `true`. `false` for a list
|
|
12
|
+
* whose items are replaced wholesale (a new page, a new filter), where the leaving items would
|
|
13
|
+
* sit next to the entering ones.
|
|
14
|
+
*/
|
|
15
|
+
exit?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Animate the items added by this update. Defaults to `true`; `false` for items that arrive by a
|
|
18
|
+
* drag and drop (a card dropped into a column), which must not fade in under the pointer. It is
|
|
19
|
+
* read when the children change: the items already in the list are never affected.
|
|
20
|
+
*/
|
|
21
|
+
enter?: boolean;
|
|
22
|
+
/** Styles of the wrapper `div` of every item (it becomes the item in a flex or grid parent). */
|
|
23
|
+
itemSx?: SxProps<Theme>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Animates the items added to a list after its first render (`Appear`: fade and 4 px rise) and the
|
|
27
|
+
* ones removed from it (fade out, unless `exit` is off), never the list as first shown. Each item sits in a wrapper
|
|
28
|
+
* `div`, which carries the animation: an item with its own inline `transform` (a dnd-kit card) is
|
|
29
|
+
* not disturbed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function AppearList({ children, exit, enter, itemSx, }: AppearListProps): JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CSSObject, Theme } from '@mui/material/styles';
|
|
2
|
+
/** How far an element rises while it fades in, in px. */
|
|
3
|
+
export declare const ENTER_OFFSET = 4;
|
|
4
|
+
/**
|
|
5
|
+
* The motion of the design system, read from the theme: the durations and the standard curve of
|
|
6
|
+
* `theme.design`, so a theme created with `reducedMotion` (or the user's « reduce animations »
|
|
7
|
+
* preference, through `AbyssThemeProvider`) turns all of it off.
|
|
8
|
+
*/
|
|
9
|
+
export declare const motion: {
|
|
10
|
+
/**
|
|
11
|
+
* Styles of an element that has just mounted: it fades in while rising 4 px, over
|
|
12
|
+
* `durations.base` on `easings.standard`. Put them on a wrapper, not on an element that carries
|
|
13
|
+
* its own inline `transform` (a dnd-kit card): the animation would own `transform` while it runs.
|
|
14
|
+
*/
|
|
15
|
+
enter: (theme: Theme) => CSSObject;
|
|
16
|
+
/**
|
|
17
|
+
* Timing of an element that leaves: a plain fade over `durations.fast`, as the `timeout` and
|
|
18
|
+
* `easing` of an MUI `Fade`.
|
|
19
|
+
*/
|
|
20
|
+
exit: (theme: Theme) => {
|
|
21
|
+
timeout: number;
|
|
22
|
+
easing: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The keys that showed up after the first render, among the `keys` of the current one: what a
|
|
3
|
+
* list adds while it is on screen, never what it opened with. A key that leaves and comes back
|
|
4
|
+
* counts as added again. For lists whose items cannot sit in a wrapper (table rows): the host
|
|
5
|
+
* gives these items `motion.enter`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useAddedKeys(keys: string[]): ReadonlySet<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ import { AbyssRumFeedbackTicket } from './feedback-ticket';
|
|
|
8
8
|
export type AbyssRumProviderConfig = Omit<AbyssRumOptions, 'consent' | 'onFeedbackSent'> & {
|
|
9
9
|
/** Called for each feedback Monitor stored, after its ticket was filed (or skipped, or failed). */
|
|
10
10
|
onFeedbackSent?: (feedback: RumFeedbackSent) => void;
|
|
11
|
-
/** Files each feedback as
|
|
11
|
+
/** Files each feedback as a Desk ticket; without it, feedback stays in Monitor. */
|
|
12
12
|
feedbackTicket?: AbyssRumFeedbackTicket;
|
|
13
13
|
};
|
|
14
14
|
export type AbyssRumProviderProps = PropsWithChildren<{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RumFeedbackSent } from '@abyss-project/monitor-browser';
|
|
2
2
|
/** Where a front files its users' feedback, and how it links back to the session. */
|
|
3
3
|
export interface AbyssRumFeedbackTicket {
|
|
4
|
-
/** Slug of the
|
|
4
|
+
/** Slug of the Desk intake (`/public/desk/intake/:slug`). */
|
|
5
5
|
intakeSlug: string;
|
|
6
6
|
/** Section of the intake the ticket is filed in. */
|
|
7
|
-
|
|
7
|
+
deskSectionId: string;
|
|
8
8
|
/** Product name, in the ticket title: `[<appName>] Retour utilisateur`. */
|
|
9
9
|
appName: string;
|
|
10
10
|
/** The Monitor page of the session at the instant of the feedback. */
|
|
@@ -21,7 +21,7 @@ export interface AbyssRumProviderConfigInput {
|
|
|
21
21
|
appName: string;
|
|
22
22
|
/** abyss-main's front URL, where the session page lives; only its origin is kept. */
|
|
23
23
|
mainFrontUrl: string | undefined;
|
|
24
|
-
/** Slug of the
|
|
24
|
+
/** Slug of the Desk intake the feedback is filed in. */
|
|
25
25
|
feedbackIntakeSlug: string | undefined;
|
|
26
26
|
/** Section of that intake. */
|
|
27
27
|
feedbackSectionId: string | undefined;
|
|
@@ -9,6 +9,7 @@ export interface AbyssThemeProviderProps {
|
|
|
9
9
|
/**
|
|
10
10
|
* Provides the design system theme: the MUI theme of `mode`, the `--abyss-*` variables of both
|
|
11
11
|
* modes, `data-theme` on the document root (read by those variables), and the CSS baseline with
|
|
12
|
-
* tabular figures.
|
|
12
|
+
* tabular figures. It follows the « reduce animations » preference: under it every duration of the
|
|
13
|
+
* theme and every `--abyss-duration-*` variable is 0.
|
|
13
14
|
*/
|
|
14
15
|
export declare function AbyssThemeProvider({ mode, density, children, }: AbyssThemeProviderProps): JSX.Element;
|
|
@@ -6,6 +6,7 @@ export interface DesignCssVariablesProps {
|
|
|
6
6
|
* Writes the `--abyss-*` variables of `mode` on the document root, the ones `AbyssThemeProvider`
|
|
7
7
|
* writes. For a host still under the legacy theme provider: the design system components that
|
|
8
8
|
* paint through those variables (`ToolIcon`, the `AppShell` product icon) then render as they do
|
|
9
|
-
* under `AbyssThemeProvider
|
|
9
|
+
* under `AbyssThemeProvider`, the « reduce animations » rule of the durations included. Never
|
|
10
|
+
* mount both: `AbyssThemeProvider` already writes them.
|
|
10
11
|
*/
|
|
11
12
|
export declare function DesignCssVariables({ mode, }: DesignCssVariablesProps): JSX.Element;
|
|
@@ -21,7 +21,8 @@ export interface DesignTheme {
|
|
|
21
21
|
overlay: string;
|
|
22
22
|
modal: string;
|
|
23
23
|
};
|
|
24
|
-
durations:
|
|
24
|
+
/** Motion durations in ms; all 0 under `prefers-reduced-motion: reduce`. */
|
|
25
|
+
durations: Record<keyof typeof durations, number>;
|
|
25
26
|
easings: typeof easings;
|
|
26
27
|
}
|
|
27
28
|
declare module '@mui/material/styles' {
|
|
@@ -3,8 +3,11 @@ import { Density } from './augmentation';
|
|
|
3
3
|
import { ThemeMode } from './tokens/primitives';
|
|
4
4
|
/**
|
|
5
5
|
* The MUI theme of the design system, generated from the tokens (ADR-0174 §1, §3). Its values are
|
|
6
|
-
* also exposed under `theme.design` for the components that style themselves.
|
|
6
|
+
* also exposed under `theme.design` for the components that style themselves. With
|
|
7
|
+
* `reducedMotion`, every duration (`theme.design.durations`, `theme.transitions.duration`) is 0:
|
|
8
|
+
* the one place the reduced-motion preference reaches the components.
|
|
7
9
|
*/
|
|
8
10
|
export declare function createAbyssTheme(mode: ThemeMode, options?: {
|
|
9
11
|
density?: Density;
|
|
12
|
+
reducedMotion?: boolean;
|
|
10
13
|
}): Theme;
|
|
@@ -5,4 +5,4 @@ import { ThemeMode } from './tokens/primitives';
|
|
|
5
5
|
* `createTheme`, so a new component rendered in an app still on the legacy theme reads the same
|
|
6
6
|
* tokens.
|
|
7
7
|
*/
|
|
8
|
-
export declare function buildDesignTheme(mode: ThemeMode, density?: Density): DesignTheme;
|
|
8
|
+
export declare function buildDesignTheme(mode: ThemeMode, density?: Density, reducedMotion?: boolean): DesignTheme;
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ export * from './tokens';
|
|
|
2
2
|
export * from './augmentation';
|
|
3
3
|
export * from './create-abyss-theme';
|
|
4
4
|
export * from './css-variables';
|
|
5
|
+
export * from './reduced-motion';
|
|
5
6
|
export * from './AbyssThemeProvider';
|
|
6
7
|
export * from './DesignCssVariables';
|
|
7
8
|
export * from './design-media';
|
|
8
9
|
export * from './use-design-breakpoint';
|
|
9
|
-
export { focusRing, px } from './components/shared';
|
|
10
|
+
export { focusRing, px, transitionOf } from './components/shared';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The media query of the « reduce animations » system preference. */
|
|
2
|
+
export declare const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
3
|
+
/**
|
|
4
|
+
* The `--abyss-duration-*` variables at 0 under the reduced-motion preference: the CSS side of
|
|
5
|
+
* `createAbyssTheme({ reducedMotion: true })`, for what paints from the variables.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildReducedMotionCssVariables(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abyss-project/commons-front-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.1.0",
|
|
4
4
|
"description": "Front Core package of AbyssProject",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@abyss-project/capacitor-auth": "^1.0.0",
|
|
69
69
|
"@abyss-project/cloud": "^2.4.0",
|
|
70
|
-
"@abyss-project/console": "^15.1.0",
|
|
71
70
|
"@abyss-project/monitor-browser": "^2.0.0",
|
|
71
|
+
"@abyss-project/workspace": "^4.6.0",
|
|
72
72
|
"@dnd-kit/core": "^6.0.0",
|
|
73
73
|
"@dnd-kit/sortable": "^9.0.0",
|
|
74
74
|
"@dnd-kit/utilities": "^3.0.0",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"react-router-dom": "^6.15.0",
|
|
89
89
|
"react-toastify": "^8.0.2 || ^10.0.0",
|
|
90
90
|
"zustand": "^5.0.0",
|
|
91
|
-
"@abyss-project/main": "
|
|
91
|
+
"@abyss-project/main": "29.1.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependenciesMeta": {
|
|
94
94
|
"@abyss-project/capacitor-auth": {
|
|
@@ -139,12 +139,12 @@
|
|
|
139
139
|
"use-debounce": "^10.0.5",
|
|
140
140
|
"uuid": "^9.0.0",
|
|
141
141
|
"yup": "^0.32.11",
|
|
142
|
-
"@abyss-project/main": "
|
|
142
|
+
"@abyss-project/main": "29.1.0"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
145
|
"@abyss-project/cloud": "^2.4.0",
|
|
146
|
-
"@abyss-project/console": "^15.1.0",
|
|
147
146
|
"@abyss-project/monitor-browser": "^2.0.0",
|
|
147
|
+
"@abyss-project/workspace": "^4.6.0",
|
|
148
148
|
"@playwright/test": "^1.52.0",
|
|
149
149
|
"@testing-library/react": "^16.3.2",
|
|
150
150
|
"@types/byte-size": "^8.1.0",
|