@alveole/theme 0.43.3 → 1.0.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/dist/ThemeProvider.d.ts.map +1 -1
- package/dist/ThemeProvider.js +6 -11
- package/dist/WebThemeStyles.d.ts +5 -0
- package/dist/WebThemeStyles.d.ts.map +1 -0
- package/dist/WebThemeStyles.js +4 -0
- package/dist/WebThemeStyles.web.d.ts +5 -0
- package/dist/WebThemeStyles.web.d.ts.map +1 -0
- package/dist/WebThemeStyles.web.js +9 -0
- package/dist/constants/Palette.d.ts +3 -0
- package/dist/constants/Palette.d.ts.map +1 -1
- package/dist/constants/Typography.d.ts +9 -9
- package/dist/constants/Typography.js +1 -1
- 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/helpers/alphaColor.d.ts +1 -8
- package/dist/helpers/alphaColor.d.ts.map +1 -1
- package/dist/helpers/alphaColor.js +3 -6
- package/dist/helpers/elevationStyle.d.ts.map +1 -1
- package/dist/helpers/elevationStyle.js +3 -4
- package/dist/helpers/injectVariableCSS.d.ts +4 -0
- package/dist/helpers/injectVariableCSS.d.ts.map +1 -1
- package/dist/helpers/injectVariableCSS.js +117 -5
- package/dist/helpers/sanitizeCSSKey.d.ts +2 -0
- package/dist/helpers/sanitizeCSSKey.d.ts.map +1 -0
- package/dist/helpers/sanitizeCSSKey.js +4 -0
- package/dist/helpers/useThemeBuilder.d.ts.map +1 -1
- package/dist/helpers/useThemeBuilder.js +58 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/type/Theme.d.ts +4 -2
- package/dist/type/Theme.d.ts.map +1 -1
- package/package.json +6 -4
|
@@ -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;AACjF,OAAO,EAAE,aAAa,EAAmB,MAAM,2BAA2B,CAAC;AAE3E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAMpC,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAChD,aAAa,GAAG;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CACF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,OAAO,kBAAkB,sBAkCtD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,KAI3B,CAAC"}
|
package/dist/ThemeProvider.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
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 } from 'react-native';
|
|
5
|
-
import { injectFontFaceCSS, injectFontSmoothingCSS, injectVariableCSS } from './helpers/injectVariableCSS';
|
|
6
4
|
import { useThemeBuilder } from './helpers/useThemeBuilder';
|
|
7
5
|
import { ThemeProviderLoader } from './ThemeProviderLoader';
|
|
6
|
+
import { WebThemeStyles } from './WebThemeStyles';
|
|
8
7
|
const ThemeContext = createContext(null);
|
|
9
8
|
const MIN_LOADING_DELAY = 0;
|
|
10
9
|
export const ThemeProvider = (props) => {
|
|
@@ -17,19 +16,15 @@ export const ThemeProvider = (props) => {
|
|
|
17
16
|
}, []);
|
|
18
17
|
React.useEffect(() => {
|
|
19
18
|
void SystemUI.setBackgroundColorAsync('white');
|
|
20
|
-
if (Platform.OS === 'web') {
|
|
21
|
-
injectVariableCSS(theme);
|
|
22
|
-
injectFontSmoothingCSS();
|
|
23
|
-
injectFontFaceCSS();
|
|
24
|
-
}
|
|
25
19
|
}, []);
|
|
26
20
|
React.useEffect(() => {
|
|
27
21
|
if (onReady && theme.isReady)
|
|
28
22
|
onReady();
|
|
29
23
|
}, [onReady, theme.isReady]);
|
|
30
|
-
if ((!theme.isReady || showLoader) && loader !== false)
|
|
31
|
-
return _jsx(ThemeProviderLoader, {});
|
|
32
|
-
|
|
24
|
+
if ((!theme.isReady || showLoader) && loader !== false) {
|
|
25
|
+
return (_jsxs(_Fragment, { children: [_jsx(WebThemeStyles, { theme: theme }), _jsx(ThemeProviderLoader, {})] }));
|
|
26
|
+
}
|
|
27
|
+
return (_jsxs(ThemeContext.Provider, { value: theme, children: [_jsx(WebThemeStyles, { theme: theme }), props.children] }));
|
|
33
28
|
};
|
|
34
29
|
export const useTheme = () => {
|
|
35
30
|
const ctx = useContext(ThemeContext);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebThemeStyles.d.ts","sourceRoot":"","sources":["../src/WebThemeStyles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAGpC,wBAAgB,cAAc,CAAC,CAAC,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,QAEjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebThemeStyles.web.d.ts","sourceRoot":"","sources":["../src/WebThemeStyles.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAKpC,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,+BAUzD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { generateCSSVariables, generateFontFaceCSS, generateFontSmoothingCSS } from './helpers/injectVariableCSS';
|
|
4
|
+
const fontFaceCSS = generateFontFaceCSS();
|
|
5
|
+
const fontSmoothingCSS = generateFontSmoothingCSS();
|
|
6
|
+
export function WebThemeStyles({ theme }) {
|
|
7
|
+
const cssVariables = useMemo(() => generateCSSVariables(theme), [theme]);
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { precedence: "default", dangerouslySetInnerHTML: { __html: cssVariables } }), _jsx("style", { precedence: "default", dangerouslySetInnerHTML: { __html: fontFaceCSS } }), _jsx("style", { precedence: "default", dangerouslySetInnerHTML: { __html: fontSmoothingCSS } })] }));
|
|
9
|
+
}
|
|
@@ -395,6 +395,9 @@ export declare const CustomPalette: {
|
|
|
395
395
|
export type LeafStrings<T> = T extends string ? string : {
|
|
396
396
|
[K in keyof T]: LeafStrings<T[K]>;
|
|
397
397
|
};
|
|
398
|
+
export type LeafFlexible<T> = T extends string ? string : T extends number ? number | string : {
|
|
399
|
+
[K in keyof T]: LeafFlexible<T[K]>;
|
|
400
|
+
};
|
|
398
401
|
export type Palette = LeafStrings<typeof CustomPalette>;
|
|
399
402
|
export type DeepPartial<T> = {
|
|
400
403
|
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Palette.d.ts","sourceRoot":"","sources":["../../src/constants/Palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiGxB,kHAAkH;;IAElH,iGAAiG;;IAEjG,gGAAgG;;IAEhG,uFAAuF;;IAEvF,6FAA6F;;IAE7F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f;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAE7C,MAAM,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,aAAa,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
|
|
@@ -90,40 +90,40 @@ export declare const CustomTypography: {
|
|
|
90
90
|
};
|
|
91
91
|
readonly 'Corps de texte': {
|
|
92
92
|
readonly XS: {
|
|
93
|
-
readonly
|
|
93
|
+
readonly Regular: {
|
|
94
94
|
readonly fontSize: 12;
|
|
95
95
|
readonly lineHeight: 20;
|
|
96
96
|
readonly letterSpacing: 0;
|
|
97
|
-
readonly
|
|
97
|
+
readonly fontFamily: string;
|
|
98
|
+
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
98
99
|
};
|
|
99
|
-
readonly
|
|
100
|
+
readonly Bold: {
|
|
100
101
|
readonly fontSize: 12;
|
|
101
102
|
readonly lineHeight: 20;
|
|
102
103
|
readonly letterSpacing: 0;
|
|
103
104
|
readonly fontFamily: string;
|
|
104
105
|
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
105
106
|
};
|
|
106
|
-
readonly
|
|
107
|
-
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
108
|
-
readonly Regular: {
|
|
107
|
+
readonly Caps: {
|
|
109
108
|
readonly fontSize: 12;
|
|
110
109
|
readonly lineHeight: 20;
|
|
111
110
|
readonly letterSpacing: 0;
|
|
111
|
+
readonly textTransform: "uppercase";
|
|
112
112
|
readonly fontFamily: string;
|
|
113
113
|
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
114
114
|
};
|
|
115
|
-
readonly
|
|
115
|
+
readonly CapsBold: {
|
|
116
116
|
readonly fontSize: 12;
|
|
117
117
|
readonly lineHeight: 20;
|
|
118
118
|
readonly letterSpacing: 0;
|
|
119
|
+
readonly textTransform: "uppercase";
|
|
119
120
|
readonly fontFamily: string;
|
|
120
121
|
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
121
122
|
};
|
|
122
|
-
readonly
|
|
123
|
+
readonly SemiBold: {
|
|
123
124
|
readonly fontSize: 12;
|
|
124
125
|
readonly lineHeight: 20;
|
|
125
126
|
readonly letterSpacing: 0;
|
|
126
|
-
readonly textTransform: "uppercase";
|
|
127
127
|
readonly fontFamily: string;
|
|
128
128
|
readonly fontWeight?: import("react-native").TextStyle["fontWeight"];
|
|
129
129
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,WAAW,CAAC"}
|
package/dist/constants/index.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { Color } from '../constants';
|
|
2
2
|
type Between0And1 = number;
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Génère une couleur avec de l’opacité à partir d’une valeur hexadecimal
|
|
6
|
-
* @param hexadecimalColor - La couleur hexadecimal (Issue du thème ou string)
|
|
7
|
-
* @param opacity - Entre 0 et 1
|
|
8
|
-
* @returns La valeur rgba, par exemple: 'rgba(235, 220, 200, 0.5)'
|
|
9
|
-
*/
|
|
10
|
-
export declare const alpha: (hexadecimalColor: Color, opacity: Between0And1) => RGBAColor;
|
|
3
|
+
export declare const alpha: (hexadecimalColor: Color, opacity: Between0And1) => string;
|
|
11
4
|
export {};
|
|
12
5
|
//# sourceMappingURL=alphaColor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaColor.d.ts","sourceRoot":"","sources":["../../src/helpers/alphaColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,KAAK,YAAY,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"alphaColor.d.ts","sourceRoot":"","sources":["../../src/helpers/alphaColor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErC,KAAK,YAAY,GAAG,MAAM,CAAC;AAE3B,eAAO,MAAM,KAAK,GAAI,kBAAkB,KAAK,EAAE,SAAS,YAAY,KAAG,MAetE,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Génère une couleur avec de l’opacité à partir d’une valeur hexadecimal
|
|
3
|
-
* @param hexadecimalColor - La couleur hexadecimal (Issue du thème ou string)
|
|
4
|
-
* @param opacity - Entre 0 et 1
|
|
5
|
-
* @returns La valeur rgba, par exemple: 'rgba(235, 220, 200, 0.5)'
|
|
6
|
-
*/
|
|
7
1
|
export const alpha = (hexadecimalColor, opacity) => {
|
|
2
|
+
if (hexadecimalColor.startsWith('var(')) {
|
|
3
|
+
return `color-mix(in srgb, ${hexadecimalColor} ${Math.round(opacity * 100)}%, transparent)`;
|
|
4
|
+
}
|
|
8
5
|
hexadecimalColor = hexadecimalColor.replace(/^#/, '');
|
|
9
6
|
if (hexadecimalColor.length === 3)
|
|
10
7
|
hexadecimalColor = hexadecimalColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elevationStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/elevationStyle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,cAAc,CAAC;AAKxD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"elevationStyle.d.ts","sourceRoot":"","sources":["../../src/helpers/elevationStyle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,cAAc,CAAC;AAKxD;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,OAAO,YAAY;;;;;;;;;;;aAIjD,CAAC"}
|
|
@@ -7,10 +7,9 @@ const isElevationKey = (key) => Object.prototype.hasOwnProperty.call(Elevations,
|
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
9
|
export const elevationStyle = (level) => {
|
|
10
|
-
|
|
11
|
-
if (value == null)
|
|
10
|
+
if (!isElevationKey(level))
|
|
12
11
|
return;
|
|
13
12
|
if (Platform.OS === 'web')
|
|
14
|
-
return { boxShadow:
|
|
15
|
-
return
|
|
13
|
+
return { boxShadow: `var(--elevation-${level})` };
|
|
14
|
+
return Elevations[level].mobile;
|
|
16
15
|
};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Theme } from '../type';
|
|
2
|
+
export declare const generateCSSVariables: (theme: Theme) => string;
|
|
2
3
|
export declare const injectFontFaceCSS: () => void;
|
|
3
4
|
export declare const injectFontSmoothingCSS: () => void;
|
|
4
5
|
export declare const injectVariableCSS: (theme: Theme) => void;
|
|
6
|
+
export declare const generateFontFaceCSS: () => string;
|
|
7
|
+
export declare const generateFontSmoothingCSS: () => string;
|
|
8
|
+
export declare const generateDefaultThemeCSS: () => string;
|
|
5
9
|
//# sourceMappingURL=injectVariableCSS.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injectVariableCSS.d.ts","sourceRoot":"","sources":["../../src/helpers/injectVariableCSS.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"injectVariableCSS.d.ts","sourceRoot":"","sources":["../../src/helpers/injectVariableCSS.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AA6BhC,eAAO,MAAM,oBAAoB,GAAI,OAAO,KAAK,KAAG,MA2DnD,CAAC;AA8CF,eAAO,MAAM,iBAAiB,YAiB7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAYlC,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,OAAO,KAAK,SAY7C,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAAO,MAMxB,CAAC;AAEhB,eAAO,MAAM,wBAAwB,QAAO,MAC6E,CAAC;AAE1H,eAAO,MAAM,uBAAuB,QAAO,MAO9B,CAAC"}
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import { Spacings } from '../constants';
|
|
1
|
+
import { Colors, CustomPalette, Spacings } from '../constants';
|
|
2
|
+
import { Elevations } from '../constants/Elevation';
|
|
2
3
|
import { FontWeightMap, FontsMap } from '../constants/Font';
|
|
3
|
-
|
|
4
|
+
import { RadiusList } from '../constants/Radius';
|
|
5
|
+
import { CustomTypography } from '../constants/Typography';
|
|
6
|
+
import { sanitizeCSSKey } from './sanitizeCSSKey';
|
|
7
|
+
const buildColorVarMap = (constants) => {
|
|
8
|
+
const map = new Map();
|
|
9
|
+
Object.entries(constants).forEach(([name, shades]) => {
|
|
10
|
+
Object.entries(shades).forEach(([variant, value]) => {
|
|
11
|
+
if (typeof value === 'string') {
|
|
12
|
+
map.set(value, `--color-${name}-${variant}`);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
return map;
|
|
17
|
+
};
|
|
18
|
+
const generateSemanticTokenLines = (category, tokens, colorVarMap) => {
|
|
19
|
+
const lines = [];
|
|
20
|
+
Object.entries(tokens).forEach(([token, value]) => {
|
|
21
|
+
if (typeof value !== 'string')
|
|
22
|
+
return;
|
|
23
|
+
const varRef = colorVarMap.get(value);
|
|
24
|
+
lines.push(` --${category}-${token}: ${varRef ? `var(${varRef})` : value};`);
|
|
25
|
+
});
|
|
26
|
+
return lines;
|
|
27
|
+
};
|
|
28
|
+
export const generateCSSVariables = (theme) => {
|
|
4
29
|
const lines = [];
|
|
5
|
-
|
|
30
|
+
const colorVarMap = buildColorVarMap(theme.color._constants);
|
|
31
|
+
// Couleurs palette
|
|
6
32
|
Object.entries(theme.color._constants).forEach(([key, colors]) => {
|
|
7
33
|
Object.entries(colors).forEach(([variant, value]) => {
|
|
8
34
|
lines.push(` --color-${key}-${variant}: ${value};`);
|
|
@@ -10,9 +36,81 @@ const generateCSSVariables = (theme) => {
|
|
|
10
36
|
});
|
|
11
37
|
// Spacing
|
|
12
38
|
Object.entries(Spacings).forEach(([key, value]) => {
|
|
13
|
-
lines.push(` --spacing-${key}: ${value}px;`);
|
|
39
|
+
lines.push(` --spacing-${sanitizeCSSKey(key)}: ${value}px;`);
|
|
40
|
+
});
|
|
41
|
+
// Radius
|
|
42
|
+
Object.entries(RadiusList).forEach(([key, value]) => {
|
|
43
|
+
lines.push(` --radius-${key}: ${value}px;`);
|
|
44
|
+
});
|
|
45
|
+
// Elevations
|
|
46
|
+
Object.entries(Elevations).forEach(([key, value]) => {
|
|
47
|
+
lines.push(` --elevation-${key}: ${value.web};`);
|
|
48
|
+
});
|
|
49
|
+
// Font base variables + reverse map pour les tokens typographiques
|
|
50
|
+
const fontReverseMap = new Map();
|
|
51
|
+
Object.entries(FontWeightMap).forEach(([key, { familyWithFallback, weight }]) => {
|
|
52
|
+
fontReverseMap.set(`${familyWithFallback}__${weight}`, key);
|
|
53
|
+
lines.push(` --font-${key}-family: ${familyWithFallback};`);
|
|
54
|
+
lines.push(` --font-${key}-weight: ${weight};`);
|
|
55
|
+
});
|
|
56
|
+
// Semantic tokens typographiques (--typography-{...}-font-size, etc.)
|
|
57
|
+
collectTypographyLines([], CustomTypography, fontReverseMap, lines);
|
|
58
|
+
// Semantic tokens light (--{category}-{token}: var(--color-...))
|
|
59
|
+
const light = theme.color._rawLight;
|
|
60
|
+
Object.entries(light).forEach(([category, tokens]) => {
|
|
61
|
+
if (typeof tokens !== 'object' || tokens === null)
|
|
62
|
+
return;
|
|
63
|
+
lines.push(...generateSemanticTokenLines(category, tokens, colorVarMap));
|
|
64
|
+
});
|
|
65
|
+
const rootBlock = `:root {\n${lines.join('\n')}\n}`;
|
|
66
|
+
// Overrides dark mode
|
|
67
|
+
const darkLines = [];
|
|
68
|
+
const dark = theme.color.dark;
|
|
69
|
+
Object.entries(dark).forEach(([category, tokens]) => {
|
|
70
|
+
if (typeof tokens !== 'object' || tokens === null)
|
|
71
|
+
return;
|
|
72
|
+
darkLines.push(...generateSemanticTokenLines(category, tokens, colorVarMap));
|
|
73
|
+
});
|
|
74
|
+
if (darkLines.length === 0)
|
|
75
|
+
return rootBlock;
|
|
76
|
+
const darkBlock = `@media (prefers-color-scheme: dark) {\n :root {\n${darkLines.map(l => ' ' + l).join('\n')}\n }\n}`;
|
|
77
|
+
return `${rootBlock}\n\n${darkBlock}`;
|
|
78
|
+
};
|
|
79
|
+
const collectTypographyLines = (path, node, fontReverseMap, lines) => {
|
|
80
|
+
if (typeof node !== 'object' || node === null)
|
|
81
|
+
return;
|
|
82
|
+
const obj = node;
|
|
83
|
+
if (typeof obj.fontSize === 'number') {
|
|
84
|
+
const prefix = ` --typography-${path.map(sanitizeCSSKey).join('-')}`;
|
|
85
|
+
if (typeof obj.fontFamily === 'string') {
|
|
86
|
+
const weight = typeof obj.fontWeight === 'string' ? obj.fontWeight : '';
|
|
87
|
+
const fontKey = fontReverseMap.get(`${obj.fontFamily}__${weight}`) ??
|
|
88
|
+
(obj.fontFamily in FontWeightMap ? obj.fontFamily : undefined);
|
|
89
|
+
if (fontKey) {
|
|
90
|
+
lines.push(`${prefix}-font-family: var(--font-${fontKey}-family);`);
|
|
91
|
+
lines.push(`${prefix}-font-weight: var(--font-${fontKey}-weight);`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
lines.push(`${prefix}-font-family: ${obj.fontFamily};`);
|
|
95
|
+
if (weight)
|
|
96
|
+
lines.push(`${prefix}-font-weight: ${weight};`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
lines.push(`${prefix}-font-size: ${obj.fontSize}px;`);
|
|
100
|
+
if (typeof obj.lineHeight === 'number') {
|
|
101
|
+
lines.push(`${prefix}-line-height: ${obj.lineHeight}px;`);
|
|
102
|
+
}
|
|
103
|
+
if (typeof obj.letterSpacing === 'number' && obj.letterSpacing !== 0) {
|
|
104
|
+
lines.push(`${prefix}-letter-spacing: ${obj.letterSpacing}px;`);
|
|
105
|
+
}
|
|
106
|
+
if (typeof obj.textTransform === 'string') {
|
|
107
|
+
lines.push(`${prefix}-text-transform: ${obj.textTransform};`);
|
|
108
|
+
}
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
Object.entries(obj).forEach(([key, value]) => {
|
|
112
|
+
collectTypographyLines([...path, key], value, fontReverseMap, lines);
|
|
14
113
|
});
|
|
15
|
-
return `:root {\n${lines.join('\n')}\n}`;
|
|
16
114
|
};
|
|
17
115
|
export const injectFontFaceCSS = () => {
|
|
18
116
|
if (typeof document === 'undefined')
|
|
@@ -55,3 +153,17 @@ export const injectVariableCSS = (theme) => {
|
|
|
55
153
|
styleTag.innerHTML = generateCSSVariables(theme);
|
|
56
154
|
document.head.appendChild(styleTag);
|
|
57
155
|
};
|
|
156
|
+
export const generateFontFaceCSS = () => Object.entries(FontsMap)
|
|
157
|
+
.map(([key, src]) => {
|
|
158
|
+
const { family, weight } = FontWeightMap[key];
|
|
159
|
+
return `@font-face {\n font-family: '${family}';\n src: url('${src}') format('truetype');\n font-weight: ${weight};\n font-style: normal;\n}`;
|
|
160
|
+
})
|
|
161
|
+
.join('\n');
|
|
162
|
+
export const generateFontSmoothingCSS = () => 'body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }';
|
|
163
|
+
export const generateDefaultThemeCSS = () => generateCSSVariables({
|
|
164
|
+
color: {
|
|
165
|
+
_constants: Colors,
|
|
166
|
+
_rawLight: CustomPalette.light,
|
|
167
|
+
dark: CustomPalette.dark,
|
|
168
|
+
},
|
|
169
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitizeCSSKey.d.ts","sourceRoot":"","sources":["../../src/helpers/sanitizeCSSKey.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAInB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeBuilder.d.ts","sourceRoot":"","sources":["../../src/helpers/useThemeBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKrC,OAAO,EAKL,WAAW,EAKX,OAAO,
|
|
1
|
+
{"version":3,"file":"useThemeBuilder.d.ts","sourceRoot":"","sources":["../../src/helpers/useThemeBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKrC,OAAO,EAKL,WAAW,EAKX,OAAO,EAIR,MAAM,cAAc,CAAC;AAOtB,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC9B,CAAC;AAgDF,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,GAAG,KAAK,GAAG;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAuEnF"}
|
|
@@ -1,36 +1,87 @@
|
|
|
1
1
|
import { useFonts } from 'expo-font';
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { useWindowDimensions } from 'react-native';
|
|
3
|
+
import { Platform, useWindowDimensions } from 'react-native';
|
|
4
4
|
import { breakpointToVariant, Colors, CustomPalette, CustomTypography, Fonts, FontsMap, Grilles, Heights, Sizes, Spacings, } from '../constants';
|
|
5
5
|
import { RadiusList } from '../constants/Radius';
|
|
6
6
|
import { alpha } from './alphaColor';
|
|
7
7
|
import { deepMerge } from './deepMerge';
|
|
8
8
|
import { elevationStyle } from './elevationStyle';
|
|
9
|
+
import { sanitizeCSSKey } from './sanitizeCSSKey';
|
|
10
|
+
const toCSSVarPalette = (palette) => {
|
|
11
|
+
if (Platform.OS !== 'web')
|
|
12
|
+
return palette;
|
|
13
|
+
const light = palette.light;
|
|
14
|
+
const webLight = {};
|
|
15
|
+
Object.entries(light).forEach(([category, tokens]) => {
|
|
16
|
+
if (typeof tokens !== 'object' || tokens === null) {
|
|
17
|
+
webLight[category] = tokens;
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
webLight[category] = {};
|
|
21
|
+
Object.entries(tokens).forEach(([token, value]) => {
|
|
22
|
+
webLight[category][token] = typeof value === 'string' ? `var(--${category}-${token})` : value;
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
return { ...palette, light: webLight };
|
|
26
|
+
};
|
|
27
|
+
const toCSSVarTypography = (node, path = []) => {
|
|
28
|
+
if (typeof node.fontSize === 'number') {
|
|
29
|
+
const prefix = path.map(sanitizeCSSKey).join('-');
|
|
30
|
+
const result = { ...node };
|
|
31
|
+
result.fontFamily = `var(--typography-${prefix}-font-family)`;
|
|
32
|
+
result.fontWeight = `var(--typography-${prefix}-font-weight)`;
|
|
33
|
+
result.fontSize = `var(--typography-${prefix}-font-size)`;
|
|
34
|
+
result.lineHeight = `var(--typography-${prefix}-line-height)`;
|
|
35
|
+
if (typeof node.letterSpacing === 'number' && node.letterSpacing !== 0) {
|
|
36
|
+
result.letterSpacing = `var(--typography-${prefix}-letter-spacing)`;
|
|
37
|
+
}
|
|
38
|
+
if (typeof node.textTransform === 'string') {
|
|
39
|
+
result.textTransform = `var(--typography-${prefix}-text-transform)`;
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
const result = {};
|
|
44
|
+
Object.entries(node).forEach(([key, value]) => {
|
|
45
|
+
result[key] =
|
|
46
|
+
typeof value === 'object' && value !== null
|
|
47
|
+
? toCSSVarTypography(value, [...path, key])
|
|
48
|
+
: value;
|
|
49
|
+
});
|
|
50
|
+
return result;
|
|
51
|
+
};
|
|
9
52
|
export function useThemeBuilder(params) {
|
|
10
53
|
const { width } = useWindowDimensions();
|
|
11
54
|
const [loadedFonts] = useFonts(FontsMap);
|
|
12
55
|
const variant = useMemo(() => breakpointToVariant(width), [width]);
|
|
13
|
-
const
|
|
56
|
+
const rawMergedPalette = useMemo(() => deepMerge(CustomPalette, params.color), [params.color]);
|
|
57
|
+
const mergedPalette = useMemo(() => toCSSVarPalette(rawMergedPalette), [rawMergedPalette]);
|
|
14
58
|
const isReady = useMemo(() => width != null && variant != null && width > 0 && loadedFonts, [loadedFonts, variant, width]);
|
|
15
|
-
const externalPadding = useCallback(() => (
|
|
59
|
+
const externalPadding = useCallback(() => (Platform.OS === 'web'
|
|
60
|
+
? `var(--spacing-${sanitizeCSSKey(variant === 'mobile' ? '2W' : '3W')})`
|
|
61
|
+
: variant === 'mobile'
|
|
62
|
+
? Spacings['2W']
|
|
63
|
+
: Spacings['3W']), [variant]);
|
|
64
|
+
const webTypography = useMemo(() => Platform.OS === 'web'
|
|
65
|
+
? toCSSVarTypography(CustomTypography)
|
|
66
|
+
: CustomTypography, []);
|
|
16
67
|
return {
|
|
17
68
|
// Spacings
|
|
18
|
-
spacing: key => Spacings[key],
|
|
69
|
+
spacing: key => (Platform.OS === 'web' ? `var(--spacing-${sanitizeCSSKey(key)})` : Spacings[key]),
|
|
19
70
|
externalPadding,
|
|
20
71
|
// Radius
|
|
21
|
-
radius: key => RadiusList[key],
|
|
72
|
+
radius: key => (Platform.OS === 'web' ? `var(--radius-${key})` : RadiusList[key]),
|
|
22
73
|
// Grilles
|
|
23
74
|
grilles: Grilles,
|
|
24
75
|
// Breakpoints
|
|
25
76
|
variant,
|
|
26
77
|
isVariant: useCallback(match => variant === match, [variant]),
|
|
27
78
|
// Colors
|
|
28
|
-
color: { _constants: Colors, alpha, ...mergedPalette },
|
|
79
|
+
color: { _constants: Colors, _rawLight: rawMergedPalette.light, alpha, ...mergedPalette },
|
|
29
80
|
// Shadows
|
|
30
81
|
shadows: elevationStyle,
|
|
31
82
|
// Typographies
|
|
32
83
|
text: {
|
|
33
|
-
...
|
|
84
|
+
...webTypography,
|
|
34
85
|
fontSize: Sizes,
|
|
35
86
|
lineHeight: Heights,
|
|
36
87
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './helpers/deepMerge';
|
|
3
|
+
export * from './helpers/injectVariableCSS';
|
|
3
4
|
export * from './helpers/isSpacingKey';
|
|
4
5
|
export * from './helpers/makeStyles';
|
|
6
|
+
export * from './helpers/sanitizeCSSKey';
|
|
5
7
|
export * from './ThemeProvider';
|
|
6
8
|
export * from './type';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './helpers/deepMerge';
|
|
3
|
+
export * from './helpers/injectVariableCSS';
|
|
3
4
|
export * from './helpers/isSpacingKey';
|
|
4
5
|
export * from './helpers/makeStyles';
|
|
6
|
+
export * from './helpers/sanitizeCSSKey';
|
|
5
7
|
export * from './ThemeProvider';
|
|
6
8
|
export * from './type';
|
package/dist/type/Theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Colors,
|
|
1
|
+
import type { Colors, CustomTypography, Fonts, Grilles, Palette, Spacing, SpacingKey, Variant } from '../constants';
|
|
2
2
|
import { Radius, RadiusKey } from '../constants/Radius';
|
|
3
3
|
import { alpha } from '../helpers/alphaColor';
|
|
4
4
|
import { elevationStyle } from '../helpers/elevationStyle';
|
|
@@ -17,7 +17,9 @@ export interface Theme {
|
|
|
17
17
|
color: {
|
|
18
18
|
/** @deprecated Utiliser la palette */
|
|
19
19
|
_constants: typeof Colors;
|
|
20
|
-
|
|
20
|
+
/** Palette light avec valeurs hex brutes, utilisée par injectVariableCSS */
|
|
21
|
+
_rawLight: Palette['light'];
|
|
22
|
+
} & Palette & {
|
|
21
23
|
alpha: typeof alpha;
|
|
22
24
|
};
|
|
23
25
|
}
|
package/dist/type/Theme.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/type/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Theme.d.ts","sourceRoot":"","sources":["../../src/type/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,KAAK;IAEpB,OAAO,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,OAAO,CAAC;IACtC,mEAAmE;IACnE,eAAe,EAAE,MAAM,OAAO,CAAC;IAG/B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;IAGzC,OAAO,EAAE,OAAO,cAAc,CAAC;IAG/B,MAAM,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,MAAM,CAAC;IAGnC,OAAO,EAAE,OAAO,OAAO,CAAC;IAGxB,IAAI,EAAE,UAAU,GAAG,OAAO,gBAAgB,CAAC;IAG3C,IAAI,EAAE,OAAO,KAAK,CAAC;IAGnB,KAAK,EAAE;QACL,sCAAsC;QACtC,UAAU,EAAE,OAAO,MAAM,CAAC;QAC1B,4EAA4E;QAC5E,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;KAC7B,GAAG,OAAO,GAAG;QACV,KAAK,EAAE,OAAO,KAAK,CAAC;KACrB,CAAC;CACL"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alveole/theme",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Shared theme tokens and utilities.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@alveole/eslint-config": "file:../eslint-config",
|
|
20
|
-
"eslint": "
|
|
20
|
+
"eslint": "9.39.4",
|
|
21
|
+
"react": "19.2.3",
|
|
22
|
+
"react-native": "0.85.3"
|
|
21
23
|
},
|
|
22
24
|
"peerDependencies": {
|
|
23
25
|
"@tamagui/core": "*",
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
"access": "public"
|
|
31
33
|
},
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"@uiw/react-signature": "
|
|
34
|
-
"react-native-signature-canvas": "
|
|
35
|
+
"@uiw/react-signature": "1.3.5",
|
|
36
|
+
"react-native-signature-canvas": "5.1.0"
|
|
35
37
|
}
|
|
36
38
|
}
|