@hoddy-ui/core 2.0.0 → 2.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "2.0.0",
3
+ "version": "2.5.1",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -11,19 +11,20 @@ const Typography: React.FC<TypographyProps> = forwardRef(
11
11
  children,
12
12
  color = "dark",
13
13
  style = {},
14
- textCase = null,
14
+ textCase,
15
15
  variant = "body1",
16
16
  align = "left",
17
17
  gutterBottom = 0,
18
18
  adjustsFontSizeToFit,
19
19
  fontWeight = 400,
20
20
  fontFamily, // NEW PROP ADDED
21
+ fontSize,
21
22
  ...props
22
23
  },
23
24
  ref
24
25
  ) => {
25
26
  const colors: any = useColors();
26
- const fontSize = {
27
+ const _fontSize = {
27
28
  h1: moderateScale(42),
28
29
  h2: moderateScale(37),
29
30
  h3: moderateScale(32),
@@ -37,7 +38,7 @@ const Typography: React.FC<TypographyProps> = forwardRef(
37
38
 
38
39
  const styles: any = StyleSheet.create({
39
40
  text: {
40
- fontSize: fontSize[variant],
41
+ fontSize: fontSize || _fontSize[variant],
41
42
  marginBottom: verticalScale(gutterBottom) || 0,
42
43
  color: colors[color]?.main || color,
43
44
  textTransform: textCase,
package/src/types.ts CHANGED
@@ -273,6 +273,7 @@ export interface TypographyProps extends TextProps {
273
273
  numberOfLines?: number;
274
274
  adjustsFontSizeToFit?: boolean;
275
275
  fontFamily?: string;
276
+ fontSize?: number;
276
277
  fontWeight?: 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
277
278
  }
278
279