@alveole/theme 0.17.1 → 0.18.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.
@@ -1,3 +1,4 @@
1
+ export declare const isMobile: boolean;
1
2
  export declare const CustomTypography: {
2
3
  readonly 'Titres alternatifs': {
3
4
  readonly XS: {
@@ -1 +1 @@
1
- {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../src/constants/Typography.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,8FAA8F;;QAE5F,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsHjB,CAAC"}
1
+ {"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../src/constants/Typography.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,SAAiH,CAAC;AAEvI,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkC3B,8FAA8F;;QAE5F,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;QAOvB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsHjB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { Platform } from 'react-native';
2
2
  import { Fonts } from './Font';
3
+ export const isMobile = Platform.OS !== 'web' || navigator?.userAgent?.includes('iPhone') || navigator?.userAgent?.includes('Android');
3
4
  export const CustomTypography = {
4
5
  'Titres alternatifs': {
5
6
  XS: {
@@ -38,43 +39,43 @@ export const CustomTypography = {
38
39
  /** Font size: 18/20 */
39
40
  'H6 - XXS': {
40
41
  fontFamily: Fonts['Inter-Bold'],
41
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 20 : 18,
42
- lineHeight: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 28 : 24,
42
+ fontSize: !isMobile ? 20 : 18,
43
+ lineHeight: !isMobile ? 28 : 24,
43
44
  letterSpacing: 0,
44
45
  },
45
46
  /** Font size: 20/22 */
46
47
  'H5 - XS': {
47
48
  fontFamily: Fonts['Inter-Bold'],
48
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 22 : 20,
49
+ fontSize: !isMobile ? 22 : 20,
49
50
  lineHeight: 28,
50
51
  letterSpacing: 0,
51
52
  },
52
53
  /** Font size: 22/24 */
53
54
  'H4 - SM': {
54
55
  fontFamily: Fonts['Inter-Bold'],
55
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 24 : 22,
56
- lineHeight: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 32 : 28,
56
+ fontSize: !isMobile ? 24 : 22,
57
+ lineHeight: !isMobile ? 32 : 28,
57
58
  letterSpacing: 0,
58
59
  },
59
60
  /** Font size: 24/28 */
60
61
  'H3 - MD': {
61
62
  fontFamily: Fonts['Inter-Bold'],
62
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 28 : 24,
63
- lineHeight: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 36 : 32,
63
+ fontSize: !isMobile ? 28 : 24,
64
+ lineHeight: !isMobile ? 36 : 32,
64
65
  letterSpacing: 0,
65
66
  },
66
67
  /** Font size: 28/32 */
67
68
  'H2 - LG': {
68
69
  fontFamily: Fonts['Inter-Bold'],
69
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 32 : 28,
70
- lineHeight: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 36 : 32,
70
+ fontSize: !isMobile ? 32 : 28,
71
+ lineHeight: !isMobile ? 36 : 32,
71
72
  letterSpacing: 0,
72
73
  },
73
74
  /** Font size: 40/48 */
74
75
  'H1 - XL': {
75
76
  fontFamily: Fonts['Barlow-SemiBold'],
76
- fontSize: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 40 : 32,
77
- lineHeight: Platform.OS === 'web' || navigator?.userAgent?.includes('Mobile') ? 48 : 40,
77
+ fontSize: !isMobile ? 40 : 32,
78
+ lineHeight: !isMobile ? 48 : 40,
78
79
  letterSpacing: 0,
79
80
  },
80
81
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alveole/theme",
3
- "version": "0.17.1",
3
+ "version": "0.18.1",
4
4
  "description": "Shared theme tokens and utilities.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",