@alveole/theme 2.0.0-alpha.4 → 2.0.0-alpha.41
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/dist/ThemeProvider.d.ts +12 -0
- package/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +16 -2
- package/dist/constants/Color.d.ts +3 -1
- package/dist/constants/Color.d.ts.map +1 -1
- package/dist/constants/Color.js +3 -1
- package/dist/constants/FocusProps.d.ts +2 -5
- package/dist/constants/FocusProps.d.ts.map +1 -1
- package/dist/constants/FocusProps.js +2 -3
- package/dist/constants/LinkProps.d.ts +3 -7
- package/dist/constants/LinkProps.d.ts.map +1 -1
- package/dist/constants/LinkProps.js +4 -5
- package/dist/constants/Motion.d.ts +25 -0
- package/dist/constants/Motion.d.ts.map +1 -0
- package/dist/constants/Motion.js +23 -0
- package/dist/constants/Palette.d.ts +112 -14
- package/dist/constants/Palette.d.ts.map +1 -1
- package/dist/constants/Palette.js +99 -11
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/marques.d.ts +11 -0
- package/dist/constants/marques.d.ts.map +1 -0
- package/dist/constants/marques.js +10 -0
- package/dist/default.css +207 -3
- package/dist/helpers/alphaColor.d.ts +3 -2
- package/dist/helpers/alphaColor.d.ts.map +1 -1
- package/dist/helpers/alphaColor.js +2 -2
- package/dist/helpers/contrastColor.d.ts.map +1 -1
- package/dist/helpers/contrastColor.js +13 -0
- package/dist/helpers/injectVariableCSS.d.ts +1 -1
- package/dist/helpers/injectVariableCSS.d.ts.map +1 -1
- package/dist/helpers/injectVariableCSS.js +18 -6
- package/dist/helpers/motionCSS.d.ts +6 -0
- package/dist/helpers/motionCSS.d.ts.map +1 -0
- package/dist/helpers/motionCSS.js +9 -0
- package/dist/helpers/resoudreMode.d.ts +4 -0
- package/dist/helpers/resoudreMode.d.ts.map +1 -0
- package/dist/helpers/resoudreMode.js +9 -0
- package/dist/helpers/useThemeBuilder.d.ts +2 -2
- package/dist/helpers/useThemeBuilder.d.ts.map +1 -1
- package/dist/helpers/useThemeBuilder.js +8 -2
- package/dist/type/Theme.d.ts +4 -2
- package/dist/type/Theme.d.ts.map +1 -1
- package/package.json +10 -5
package/dist/ThemeProvider.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import React, { type PropsWithChildren } from 'react';
|
|
2
|
+
import { type ColorMode } from './helpers/resoudreMode';
|
|
2
3
|
import { CustomBuilder } from './helpers/useThemeBuilder';
|
|
3
4
|
import type { Theme } from './type';
|
|
4
5
|
export type ThemeProviderProps = PropsWithChildren<CustomBuilder & {
|
|
5
6
|
loader?: boolean;
|
|
6
7
|
onReady?: () => void;
|
|
7
8
|
staticCSS?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Mode de couleur, web uniquement. `light` par défaut ; `system` suit le réglage de
|
|
11
|
+
* l'appareil ; `dark` et `light` le forcent.
|
|
12
|
+
*/
|
|
13
|
+
colorMode?: ColorMode;
|
|
8
14
|
}>;
|
|
15
|
+
export type { ColorMode };
|
|
9
16
|
export declare const ThemeProvider: (props: ThemeProviderProps) => React.JSX.Element;
|
|
10
17
|
export declare const useTheme: () => Theme;
|
|
18
|
+
/**
|
|
19
|
+
* Le mode de couleur effectivement affiché, `system` résolu. Pour ce qui ne passe pas par les
|
|
20
|
+
* variables CSS des jetons, comme une couleur calculée. Toujours `light` en natif.
|
|
21
|
+
*/
|
|
22
|
+
export declare const useColorMode: () => "light" | "dark";
|
|
11
23
|
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA6B,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../src/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAA6B,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAmB,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAOpC,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAChD,aAAa,GAAG;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CACF,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,sBA0CtD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,KAI3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,QAAO,OAAO,GAAG,MAAsC,CAAC"}
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as SystemUI from 'expo-system-ui';
|
|
3
3
|
import React, { createContext, useContext } from 'react';
|
|
4
|
+
import { Platform, useColorScheme } from 'react-native';
|
|
5
|
+
import { resoudreMode } from './helpers/resoudreMode';
|
|
4
6
|
import { useThemeBuilder } from './helpers/useThemeBuilder';
|
|
5
7
|
import { ThemeProviderLoader } from './ThemeProviderLoader';
|
|
6
8
|
import { WebThemeStyles } from './WebThemeStyles';
|
|
7
9
|
const ThemeContext = createContext(null);
|
|
10
|
+
const ColorModeContext = createContext('light');
|
|
8
11
|
const MIN_LOADING_DELAY = 0;
|
|
9
12
|
export const ThemeProvider = (props) => {
|
|
10
|
-
const { loader = true, onReady, staticCSS = false, ...builder } = props;
|
|
13
|
+
const { loader = true, onReady, staticCSS = false, colorMode = 'light', ...builder } = props;
|
|
11
14
|
const theme = useThemeBuilder(builder);
|
|
15
|
+
const modeEffectif = resoudreMode(colorMode, useColorScheme());
|
|
12
16
|
const [showLoader, setShowLoader] = React.useState(true);
|
|
13
17
|
React.useEffect(() => {
|
|
14
18
|
const timeout = setTimeout(() => setShowLoader(false), MIN_LOADING_DELAY);
|
|
@@ -17,6 +21,11 @@ export const ThemeProvider = (props) => {
|
|
|
17
21
|
React.useEffect(() => {
|
|
18
22
|
void SystemUI.setBackgroundColorAsync('white');
|
|
19
23
|
}, []);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
// Le CSS du thème redéfinit les jetons selon cet attribut (voir generateCSSVariables).
|
|
26
|
+
if (Platform.OS === 'web')
|
|
27
|
+
document.documentElement.dataset.colorMode = colorMode;
|
|
28
|
+
}, [colorMode]);
|
|
20
29
|
React.useEffect(() => {
|
|
21
30
|
if (onReady && theme.isReady)
|
|
22
31
|
onReady();
|
|
@@ -24,7 +33,7 @@ export const ThemeProvider = (props) => {
|
|
|
24
33
|
if ((!theme.isReady || showLoader) && loader !== false) {
|
|
25
34
|
return (_jsxs(_Fragment, { children: [!staticCSS && _jsx(WebThemeStyles, { theme: theme }), _jsx(ThemeProviderLoader, {})] }));
|
|
26
35
|
}
|
|
27
|
-
return (
|
|
36
|
+
return (_jsx(ThemeContext.Provider, { value: theme, children: _jsxs(ColorModeContext.Provider, { value: modeEffectif, children: [!staticCSS && _jsx(WebThemeStyles, { theme: theme }), props.children] }) }));
|
|
28
37
|
};
|
|
29
38
|
export const useTheme = () => {
|
|
30
39
|
const ctx = useContext(ThemeContext);
|
|
@@ -32,3 +41,8 @@ export const useTheme = () => {
|
|
|
32
41
|
throw new Error('useTheme must be used inside ThemeProvider');
|
|
33
42
|
return ctx;
|
|
34
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Le mode de couleur effectivement affiché, `system` résolu. Pour ce qui ne passe pas par les
|
|
46
|
+
* variables CSS des jetons, comme une couleur calculée. Toujours `light` en natif.
|
|
47
|
+
*/
|
|
48
|
+
export const useColorMode = () => useContext(ColorModeContext);
|
|
@@ -94,6 +94,7 @@ export declare const Colors: {
|
|
|
94
94
|
readonly 625: "#F96B24";
|
|
95
95
|
readonly 'main-525': "#D64D00";
|
|
96
96
|
readonly 425: "#BC4401";
|
|
97
|
+
readonly 100: "#2E1C12";
|
|
97
98
|
};
|
|
98
99
|
readonly RougeErreur: {
|
|
99
100
|
readonly 975: "#FEF5F4";
|
|
@@ -102,6 +103,7 @@ export declare const Colors: {
|
|
|
102
103
|
readonly 850: "#FAC0BB";
|
|
103
104
|
readonly 'main-525': "#E62C1C";
|
|
104
105
|
readonly 425: "#C62416";
|
|
106
|
+
readonly 100: "#2E1715";
|
|
105
107
|
};
|
|
106
108
|
readonly RougeGroseille: {
|
|
107
109
|
readonly 75: "#2A070C";
|
|
@@ -237,7 +239,7 @@ export declare const Colors: {
|
|
|
237
239
|
readonly 900: "#DEE3EC";
|
|
238
240
|
readonly 925: "#E6EAF1";
|
|
239
241
|
readonly 950: "#EFF1F6";
|
|
240
|
-
readonly 975: "#
|
|
242
|
+
readonly 975: "#F7FAFB";
|
|
241
243
|
readonly 1000: "#FFFFFF";
|
|
242
244
|
};
|
|
243
245
|
readonly BleuCaptive: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/constants/Color.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;QAEf,kBAAkB;;;;;;QAMlB,kBAAkB;;QAElB,kBAAkB
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../src/constants/Color.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;QAEf,kBAAkB;;;;;;QAMlB,kBAAkB;;QAElB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA2MlB,kBAAkB;;QAElB,kBAAkB;;QAElB,kBAAkB;;QAElB,kBAAkB;;QAElB,kBAAkB;;QAElB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAkClB,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CzB,CAAC;AAGX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,MAAM,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,CAAC;AAC/D,MAAM,MAAM,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC"}
|
package/dist/constants/Color.js
CHANGED
|
@@ -94,6 +94,7 @@ export const Colors = {
|
|
|
94
94
|
625: '#F96B24',
|
|
95
95
|
'main-525': '#D64D00',
|
|
96
96
|
425: '#BC4401',
|
|
97
|
+
100: '#2E1C12',
|
|
97
98
|
},
|
|
98
99
|
RougeErreur: {
|
|
99
100
|
975: '#FEF5F4',
|
|
@@ -102,6 +103,7 @@ export const Colors = {
|
|
|
102
103
|
850: '#FAC0BB',
|
|
103
104
|
'main-525': '#E62C1C',
|
|
104
105
|
425: '#C62416',
|
|
106
|
+
100: '#2E1715',
|
|
105
107
|
},
|
|
106
108
|
RougeGroseille: {
|
|
107
109
|
75: '#2A070C',
|
|
@@ -237,7 +239,7 @@ export const Colors = {
|
|
|
237
239
|
900: '#DEE3EC',
|
|
238
240
|
925: '#E6EAF1',
|
|
239
241
|
950: '#EFF1F6',
|
|
240
|
-
975: '#
|
|
242
|
+
975: '#F7FAFB',
|
|
241
243
|
1000: '#FFFFFF',
|
|
242
244
|
},
|
|
243
245
|
BleuCaptive: {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { Marques } from './marques';
|
|
1
2
|
/**
|
|
2
3
|
* `ring` pose la bague hors de l'element. `inset` la rentre a l'interieur, pour ce qui est a
|
|
3
4
|
* ras d'un bord ou rogne par un parent : cellules de tableau, items de barre laterale.
|
|
4
5
|
*/
|
|
5
6
|
export type FocusRingVariant = 'ring' | 'inset';
|
|
6
|
-
type FocusRingProps = {
|
|
7
|
-
dataSet: Record<string, string>;
|
|
8
|
-
};
|
|
9
7
|
/**
|
|
10
8
|
* Les props par lesquelles un composant demande la bague de focus du kit.
|
|
11
9
|
*
|
|
@@ -17,6 +15,5 @@ type FocusRingProps = {
|
|
|
17
15
|
* iOS (cf. UnsupportedCSSProperties), et un anneau natif demanderait une vue dessinee en
|
|
18
16
|
* absolu.
|
|
19
17
|
*/
|
|
20
|
-
export declare const focusRingProps: (variante?: FocusRingVariant) =>
|
|
21
|
-
export {};
|
|
18
|
+
export declare const focusRingProps: (variante?: FocusRingVariant) => Marques;
|
|
22
19
|
//# sourceMappingURL=FocusProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FocusProps.d.ts","sourceRoot":"","sources":["../../src/constants/FocusProps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FocusProps.d.ts","sourceRoot":"","sources":["../../src/constants/FocusProps.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAW,MAAM,WAAW,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,WAAU,gBAAyB,KAAG,OACxB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FOCUS_DATA_SET_KEY } from './Focus';
|
|
2
|
+
import { marques } from './marques';
|
|
2
3
|
/**
|
|
3
4
|
* Les props par lesquelles un composant demande la bague de focus du kit.
|
|
4
5
|
*
|
|
@@ -10,6 +11,4 @@ import { FOCUS_DATA_SET_KEY } from './Focus';
|
|
|
10
11
|
* iOS (cf. UnsupportedCSSProperties), et un anneau natif demanderait une vue dessinee en
|
|
11
12
|
* absolu.
|
|
12
13
|
*/
|
|
13
|
-
export const focusRingProps = (variante = 'ring') => ({
|
|
14
|
-
dataSet: { [FOCUS_DATA_SET_KEY]: variante },
|
|
15
|
-
});
|
|
14
|
+
export const focusRingProps = (variante = 'ring') => marques({ [FOCUS_DATA_SET_KEY]: variante });
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Les props d'un lien de texte du kit : la marque de lien et la bague de focus
|
|
3
|
-
*
|
|
2
|
+
* Les props d'un lien de texte du kit : la marque de lien et la bague de focus, posees
|
|
3
|
+
* ensemble, sans quoi l'etalement de l'une ecraserait le `dataSet` de l'autre.
|
|
4
4
|
*/
|
|
5
|
-
export declare const linkProps: () =>
|
|
6
|
-
dataSet: {
|
|
7
|
-
alveoleLink: string;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
5
|
+
export declare const linkProps: () => import("./marques").Marques;
|
|
10
6
|
//# sourceMappingURL=LinkProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkProps.d.ts","sourceRoot":"","sources":["../../src/constants/LinkProps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LinkProps.d.ts","sourceRoot":"","sources":["../../src/constants/LinkProps.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,SAAS,mCAA8E,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { focusRingProps } from './FocusProps';
|
|
2
2
|
import { LINK_DATA_SET_KEY } from './Link';
|
|
3
|
+
import { marques } from './marques';
|
|
3
4
|
/**
|
|
4
|
-
* Les props d'un lien de texte du kit : la marque de lien et la bague de focus
|
|
5
|
-
*
|
|
5
|
+
* Les props d'un lien de texte du kit : la marque de lien et la bague de focus, posees
|
|
6
|
+
* ensemble, sans quoi l'etalement de l'une ecraserait le `dataSet` de l'autre.
|
|
6
7
|
*/
|
|
7
|
-
export const linkProps = () => ({
|
|
8
|
-
dataSet: { ...focusRingProps().dataSet, [LINK_DATA_SET_KEY]: 'text' },
|
|
9
|
-
});
|
|
8
|
+
export const linkProps = () => marques({ ...focusRingProps().dataSet, [LINK_DATA_SET_KEY]: 'text' });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Durées de mouvement, en millisecondes. `none` sert au mouvement réduit. */
|
|
2
|
+
export declare const MotionDuration: {
|
|
3
|
+
readonly none: 0;
|
|
4
|
+
readonly instant: 100;
|
|
5
|
+
readonly fast: 150;
|
|
6
|
+
readonly base: 200;
|
|
7
|
+
readonly slow: 300;
|
|
8
|
+
};
|
|
9
|
+
/** Courbes CSS : une apparition décélère en arrivant, une disparition accélère en partant. */
|
|
10
|
+
export declare const MotionEasing: {
|
|
11
|
+
readonly standard: "cubic-bezier(0.2, 0, 0, 1)";
|
|
12
|
+
readonly enter: "cubic-bezier(0, 0, 0, 1)";
|
|
13
|
+
readonly exit: "cubic-bezier(0.3, 0, 1, 1)";
|
|
14
|
+
};
|
|
15
|
+
export type MotionKey = keyof typeof MotionDuration;
|
|
16
|
+
/**
|
|
17
|
+
* La transition CSS d'un composant stylé par `makeStyles`, prise sur les jetons. Ne vaut que sur
|
|
18
|
+
* le web, où react-native-web la passe au CSS : sur natif, ces propriétés sont ignorées.
|
|
19
|
+
*/
|
|
20
|
+
export declare const motionTransition: (proprietes: readonly string[], cle?: MotionKey, courbe?: keyof typeof MotionEasing) => {
|
|
21
|
+
transitionProperty: string;
|
|
22
|
+
transitionDuration: string;
|
|
23
|
+
transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)" | "cubic-bezier(0, 0, 0, 1)" | "cubic-bezier(0.3, 0, 1, 1)";
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=Motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Motion.d.ts","sourceRoot":"","sources":["../../src/constants/Motion.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX,8FAA8F;AAC9F,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,cAAc,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,SAAS,MAAM,EAAE,EAC7B,MAAK,SAAkB,EACvB,SAAQ,MAAM,OAAO,YAAyB;;;;CAK9C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Durées de mouvement, en millisecondes. `none` sert au mouvement réduit. */
|
|
2
|
+
export const MotionDuration = {
|
|
3
|
+
none: 0,
|
|
4
|
+
instant: 100,
|
|
5
|
+
fast: 150,
|
|
6
|
+
base: 200,
|
|
7
|
+
slow: 300,
|
|
8
|
+
};
|
|
9
|
+
/** Courbes CSS : une apparition décélère en arrivant, une disparition accélère en partant. */
|
|
10
|
+
export const MotionEasing = {
|
|
11
|
+
standard: 'cubic-bezier(0.2, 0, 0, 1)',
|
|
12
|
+
enter: 'cubic-bezier(0, 0, 0, 1)',
|
|
13
|
+
exit: 'cubic-bezier(0.3, 0, 1, 1)',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* La transition CSS d'un composant stylé par `makeStyles`, prise sur les jetons. Ne vaut que sur
|
|
17
|
+
* le web, où react-native-web la passe au CSS : sur natif, ces propriétés sont ignorées.
|
|
18
|
+
*/
|
|
19
|
+
export const motionTransition = (proprietes, cle = 'fast', courbe = 'standard') => ({
|
|
20
|
+
transitionProperty: proprietes.join(', '),
|
|
21
|
+
transitionDuration: `var(--motion-${cle}, ${MotionDuration[cle]}ms)`,
|
|
22
|
+
transitionTimingFunction: MotionEasing[courbe],
|
|
23
|
+
});
|
|
@@ -8,18 +8,25 @@ export declare const CustomPalette: {
|
|
|
8
8
|
};
|
|
9
9
|
readonly background: {
|
|
10
10
|
readonly 'alt-primary': "#F2F9FF";
|
|
11
|
-
|
|
11
|
+
/** Fond alternatif d'une zone qui se distingue du fond de page. */
|
|
12
|
+
readonly 'alt-grey': "#F7FAFB";
|
|
12
13
|
readonly 'action-low-primary': "#D2E8FE";
|
|
14
|
+
/** Fond contrasté d'un élément posé sur le fond de page, comme un champ ou un tag. */
|
|
13
15
|
readonly 'contrast-grey': "#EFF1F6";
|
|
14
16
|
readonly 'contrast-success': "#B9FDD5";
|
|
15
17
|
readonly 'contrast-error': "#FDEAE8";
|
|
16
18
|
readonly 'contrast-info': "#E5F1FE";
|
|
17
19
|
readonly 'contrast-warning': "#FFEEE5";
|
|
20
|
+
/** Fond par défaut des pages et des surfaces. */
|
|
18
21
|
readonly 'default-grey': "#FFFFFF";
|
|
19
|
-
|
|
22
|
+
/** Fond d'une surface par défaut survolée. */
|
|
23
|
+
readonly 'default-grey-hover': "#EFF1F6";
|
|
24
|
+
/** Fond d'une surface par défaut pressée. */
|
|
20
25
|
readonly 'default-grey-active': "#E6EAF1";
|
|
21
26
|
readonly 'active-primary': "#002764";
|
|
27
|
+
/** Fond d'un élément désactivé. */
|
|
22
28
|
readonly 'disabled-grey': "#E6EAF1";
|
|
29
|
+
/** Fond d'une surface flottante, comme le contenu d'un popover. */
|
|
23
30
|
readonly 'active-inverted': "#FFFFFF";
|
|
24
31
|
readonly 'transparent-hover': "rgba(0, 0, 0, 0.04)";
|
|
25
32
|
readonly 'action-high-primary': "#002764";
|
|
@@ -32,15 +39,20 @@ export declare const CustomPalette: {
|
|
|
32
39
|
readonly 'open-primary': "#D2E8FE";
|
|
33
40
|
};
|
|
34
41
|
readonly border: {
|
|
42
|
+
/** Bordure par défaut des cartes, des séparateurs et des champs. */
|
|
35
43
|
readonly 'default-grey': "#DEE3EC";
|
|
44
|
+
/** Bordure contrastée d'un élément qui doit se détacher de son fond. */
|
|
36
45
|
readonly 'contrast-grey': "#8D97AC";
|
|
37
46
|
readonly 'default-primary': "#0264C7";
|
|
38
47
|
readonly 'action-high-primary': "#002764";
|
|
48
|
+
/** Bordure d'une action secondaire mise en avant. */
|
|
39
49
|
readonly 'action-high-grey': "#151617";
|
|
40
50
|
readonly 'active-primary': "#002764";
|
|
41
51
|
readonly 'open-primary': "#D2E8FE";
|
|
52
|
+
/** Bordure d'un élément désactivé. */
|
|
42
53
|
readonly 'disabled-grey': "#E6EAF1";
|
|
43
54
|
readonly 'plain-primary': "#002764";
|
|
55
|
+
/** Bordure pleine d'un élément neutre sélectionné ou actif. */
|
|
44
56
|
readonly 'plain-grey': "#373A3F";
|
|
45
57
|
readonly 'plain-success': "#1B7440";
|
|
46
58
|
readonly 'plain-error': "#C62416";
|
|
@@ -49,20 +61,28 @@ export declare const CustomPalette: {
|
|
|
49
61
|
readonly 'action-low-primary': "#B4D9FE";
|
|
50
62
|
};
|
|
51
63
|
readonly text: {
|
|
64
|
+
/** Texte des titres. */
|
|
52
65
|
readonly 'title-grey': "#151617";
|
|
53
66
|
readonly 'title-primary': "#002764";
|
|
67
|
+
/** Texte courant par défaut. */
|
|
54
68
|
readonly 'default-grey': "#373A3F";
|
|
69
|
+
/** Texte secondaire des mentions, aides et indications. */
|
|
55
70
|
readonly 'mention-grey': "#5F6571";
|
|
71
|
+
/** Texte des libellés de champs. */
|
|
56
72
|
readonly 'label-grey': "#151617";
|
|
57
73
|
readonly 'action-high-primary': "#012B53";
|
|
74
|
+
/** Texte d'une action secondaire mise en avant. */
|
|
58
75
|
readonly 'action-high-grey': "#151617";
|
|
59
76
|
readonly 'action-high-info': "#0264C7";
|
|
60
77
|
readonly 'action-high-warning': "#BC4401";
|
|
61
78
|
readonly 'action-high-error': "#C62416";
|
|
79
|
+
/** Texte posé sur un fond sombre ou coloré. */
|
|
62
80
|
readonly 'inverted-grey': "#FFFFFF";
|
|
63
81
|
readonly 'inverted-primary': "#F2F9FF";
|
|
64
82
|
readonly 'active-primary': "#002764";
|
|
83
|
+
/** Texte d'un élément neutre actif ou sélectionné. */
|
|
65
84
|
readonly 'active-grey': "#151617";
|
|
85
|
+
/** Texte d'un élément désactivé. */
|
|
66
86
|
readonly 'disabled-grey': "#8D97AC";
|
|
67
87
|
readonly 'default-success': "#1B7440";
|
|
68
88
|
readonly 'default-error': "#C62416";
|
|
@@ -77,17 +97,82 @@ export declare const CustomPalette: {
|
|
|
77
97
|
readonly 'color-950-default-yellow': "#F9F0CC";
|
|
78
98
|
};
|
|
79
99
|
};
|
|
80
|
-
/**
|
|
100
|
+
/** Équivalents sombres des tokens light : mêmes clés, nuances inversées sur l'échelle. */
|
|
81
101
|
readonly dark: {
|
|
82
|
-
readonly
|
|
83
|
-
|
|
84
|
-
readonly '
|
|
102
|
+
readonly artwork: {
|
|
103
|
+
readonly 'major-primary': "#B4D9FE";
|
|
104
|
+
readonly 'decorative-primary': "#012448";
|
|
105
|
+
readonly 'minor-secondary': "#DA2275";
|
|
85
106
|
};
|
|
86
107
|
readonly background: {
|
|
87
|
-
/** @deprecated Ne pas utiliser pour de nouveaux usages */
|
|
88
108
|
readonly 'alt-primary': "#011E3A";
|
|
89
|
-
|
|
109
|
+
readonly 'alt-grey': "#1D1E20";
|
|
110
|
+
readonly 'action-low-primary': "#012B53";
|
|
90
111
|
readonly 'contrast-grey': "#232427";
|
|
112
|
+
readonly 'contrast-success': "#18271E";
|
|
113
|
+
readonly 'contrast-error': "#2E1715";
|
|
114
|
+
readonly 'contrast-info': "#012448";
|
|
115
|
+
readonly 'contrast-warning': "#2E1C12";
|
|
116
|
+
readonly 'default-grey': "#151617";
|
|
117
|
+
readonly 'default-grey-hover': "#282A2D";
|
|
118
|
+
readonly 'default-grey-active': "#2D2F32";
|
|
119
|
+
readonly 'active-primary': "#2591FE";
|
|
120
|
+
readonly 'disabled-grey': "#323439";
|
|
121
|
+
readonly 'active-inverted': "#232427";
|
|
122
|
+
readonly 'transparent-hover': "rgba(255, 255, 255, 0.08)";
|
|
123
|
+
readonly 'action-high-primary': "#2591FE";
|
|
124
|
+
readonly 'action-high-primary-hover': "#0264C7";
|
|
125
|
+
readonly 'action-high-error': "#E62C1C";
|
|
126
|
+
readonly 'flat-error': "#E62C1C";
|
|
127
|
+
readonly 'flat-info': "#2591FE";
|
|
128
|
+
readonly 'flat-success': "#27A65C";
|
|
129
|
+
readonly 'flat-warning': "#F96B24";
|
|
130
|
+
readonly 'open-primary': "#012B53";
|
|
131
|
+
};
|
|
132
|
+
readonly border: {
|
|
133
|
+
readonly 'default-grey': "#323439";
|
|
134
|
+
readonly 'contrast-grey': "#5F6571";
|
|
135
|
+
readonly 'default-primary': "#2591FE";
|
|
136
|
+
readonly 'action-high-primary': "#B4D9FE";
|
|
137
|
+
readonly 'action-high-grey': "#EFF1F6";
|
|
138
|
+
readonly 'active-primary': "#B4D9FE";
|
|
139
|
+
readonly 'open-primary': "#012B53";
|
|
140
|
+
readonly 'disabled-grey': "#323439";
|
|
141
|
+
readonly 'plain-primary': "#B4D9FE";
|
|
142
|
+
readonly 'plain-grey': "#DEE3EC";
|
|
143
|
+
readonly 'plain-success': "#27A65C";
|
|
144
|
+
readonly 'plain-error': "#FAC0BB";
|
|
145
|
+
readonly 'plain-warning': "#F96B24";
|
|
146
|
+
readonly 'plain-info': "#2591FE";
|
|
147
|
+
readonly 'action-low-primary': "#033B72";
|
|
148
|
+
};
|
|
149
|
+
readonly text: {
|
|
150
|
+
readonly 'title-grey': "#F7FAFB";
|
|
151
|
+
readonly 'title-primary': "#B4D9FE";
|
|
152
|
+
readonly 'default-grey': "#CED5E1";
|
|
153
|
+
readonly 'mention-grey': "#8D97AC";
|
|
154
|
+
readonly 'label-grey': "#F7FAFB";
|
|
155
|
+
readonly 'action-high-primary': "#D2E8FE";
|
|
156
|
+
readonly 'action-high-grey': "#F7FAFB";
|
|
157
|
+
readonly 'action-high-info': "#B4D9FE";
|
|
158
|
+
readonly 'action-high-warning': "#FFC6AA";
|
|
159
|
+
readonly 'action-high-error': "#FAC0BB";
|
|
160
|
+
readonly 'inverted-grey': "#151617";
|
|
161
|
+
readonly 'inverted-primary': "#011E3A";
|
|
162
|
+
readonly 'active-primary': "#B4D9FE";
|
|
163
|
+
readonly 'active-grey': "#F7FAFB";
|
|
164
|
+
readonly 'disabled-grey': "#5F6571";
|
|
165
|
+
readonly 'default-success': "#3EEA86";
|
|
166
|
+
readonly 'default-error': "#FAC0BB";
|
|
167
|
+
readonly 'default-warning': "#FFC6AA";
|
|
168
|
+
readonly 'default-info': "#B4D9FE";
|
|
169
|
+
};
|
|
170
|
+
readonly system: {
|
|
171
|
+
readonly focus: "#0A76F6";
|
|
172
|
+
};
|
|
173
|
+
readonly illustration: {
|
|
174
|
+
readonly 'color-sun-default-yellow': "#FFE571";
|
|
175
|
+
readonly 'color-950-default-yellow': "#2C2404";
|
|
91
176
|
};
|
|
92
177
|
};
|
|
93
178
|
/** @deprecated Utiliser light.background['action-high-primary'] ou les tokens du thème light selon le contexte */
|
|
@@ -285,7 +370,7 @@ export declare const CustomPalette: {
|
|
|
285
370
|
/** @deprecated Utiliser light.background['default-grey-active'] */
|
|
286
371
|
readonly 'default-active': "#EFF1F6";
|
|
287
372
|
/** @deprecated Utiliser light.background['alt-grey'] */
|
|
288
|
-
readonly 'alt-grey': "#
|
|
373
|
+
readonly 'alt-grey': "#F7FAFB";
|
|
289
374
|
/** @deprecated Utiliser light.background['active-inverted'] */
|
|
290
375
|
readonly inverse: "#012448";
|
|
291
376
|
/** @deprecated Utiliser light.background['action-high-primary'] */
|
|
@@ -293,7 +378,7 @@ export declare const CustomPalette: {
|
|
|
293
378
|
/** @deprecated Utiliser light.background['disabled-grey'] */
|
|
294
379
|
readonly 'disabled-grey': "#E6EAF1";
|
|
295
380
|
/** @deprecated Utiliser light.background['default-grey-hover'] */
|
|
296
|
-
readonly 'default-hover': "#
|
|
381
|
+
readonly 'default-hover': "#EFF1F6";
|
|
297
382
|
/** @deprecated Utiliser light.background['open-primary'] */
|
|
298
383
|
readonly 'open-bleu-captive': "#D2E8FE";
|
|
299
384
|
/** @deprecated Utiliser light.background['open-primary'] */
|
|
@@ -330,13 +415,13 @@ export declare const CustomPalette: {
|
|
|
330
415
|
/** @deprecated Utiliser light.background (transparent-hover) */
|
|
331
416
|
readonly secondary: {
|
|
332
417
|
readonly default: "transparent";
|
|
333
|
-
readonly hover: "#
|
|
418
|
+
readonly hover: "#EFF1F6";
|
|
334
419
|
readonly disabled: "transparent";
|
|
335
420
|
};
|
|
336
421
|
/** @deprecated Utiliser light.background (transparent-hover) */
|
|
337
422
|
readonly tertiary: {
|
|
338
423
|
readonly default: "transparent";
|
|
339
|
-
readonly hover: "#
|
|
424
|
+
readonly hover: "#EFF1F6";
|
|
340
425
|
readonly disabled: "transparent";
|
|
341
426
|
};
|
|
342
427
|
/** @deprecated Utiliser light.background['action-high-error'] et light.background['flat-error'] */
|
|
@@ -370,7 +455,7 @@ export declare const CustomPalette: {
|
|
|
370
455
|
readonly nav: {
|
|
371
456
|
readonly link: {
|
|
372
457
|
/** @deprecated Utiliser light.background['default-grey-hover'] */
|
|
373
|
-
readonly hover: "#
|
|
458
|
+
readonly hover: "#F7FAFB";
|
|
374
459
|
};
|
|
375
460
|
};
|
|
376
461
|
/** @deprecated Utiliser light.background et light.border pour le stepper */
|
|
@@ -389,13 +474,26 @@ export declare const CustomPalette: {
|
|
|
389
474
|
readonly focus: "#0A76F6";
|
|
390
475
|
};
|
|
391
476
|
};
|
|
477
|
+
export type ThemeColor = string & {
|
|
478
|
+
readonly __couleurDuTheme: true;
|
|
479
|
+
};
|
|
392
480
|
export type LeafStrings<T> = T extends string ? string : {
|
|
393
481
|
[K in keyof T]: LeafStrings<T[K]>;
|
|
394
482
|
};
|
|
483
|
+
export type LeafThemeColors<T> = T extends string ? ThemeColor : {
|
|
484
|
+
[K in keyof T]: LeafThemeColors<T[K]>;
|
|
485
|
+
};
|
|
395
486
|
export type LeafFlexible<T> = T extends string ? string : T extends number ? number | string : {
|
|
396
487
|
[K in keyof T]: LeafFlexible<T[K]>;
|
|
397
488
|
};
|
|
398
|
-
|
|
489
|
+
/** Palette telle qu'une app la fournit, en couleurs ecrites en dur. */
|
|
490
|
+
export type PaletteSource = LeafStrings<typeof CustomPalette>;
|
|
491
|
+
export type Palette = LeafThemeColors<typeof CustomPalette>;
|
|
492
|
+
/**
|
|
493
|
+
* Seul point ou une couleur ecrite en dur devient une couleur du theme. La marque n'existe qu'au
|
|
494
|
+
* typage : la surcharge la pose sans assertion, la palette rendue est celle recue.
|
|
495
|
+
*/
|
|
496
|
+
export declare function enCouleursDuTheme(palette: PaletteSource): Palette;
|
|
399
497
|
export type DeepPartial<T> = {
|
|
400
498
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
401
499
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/constants/Palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;QAEtB,kDAAkD
|
|
1
|
+
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/constants/Palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;QAEtB,kDAAkD;;;;;;;;YAQhD,mEAAmE;;;YAGnE,sFAAsF;;;;;;YAMtF,iDAAiD;;YAEjD,8CAA8C;;YAE9C,6CAA6C;;;YAG7C,mCAAmC;;YAEnC,mEAAmE;;;;;;;;;;;;;YAanE,oEAAoE;;YAEpE,wEAAwE;;;;YAIxE,qDAAqD;;;;YAIrD,sCAAsC;;;YAGtC,+DAA+D;;;;;;;;;YAS/D,wBAAwB;;;YAGxB,gCAAgC;;YAEhC,2DAA2D;;YAE3D,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