@pagopa/io-app-design-system 1.36.11 → 1.36.13
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/lib/commonjs/components/listitems/ListItemNav.js +4 -2
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/typography/BaseTypography.js +3 -2
- package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js +5 -3
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/BodyMonospace.js +4 -2
- package/lib/commonjs/components/typography/BodyMonospace.js.map +1 -1
- package/lib/commonjs/components/typography/ButtonText.js +5 -3
- package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
- package/lib/commonjs/components/typography/Caption.js +5 -3
- package/lib/commonjs/components/typography/Caption.js.map +1 -1
- package/lib/commonjs/components/typography/Chip.js +5 -3
- package/lib/commonjs/components/typography/Chip.js.map +1 -1
- package/lib/commonjs/components/typography/Factory.js +4 -2
- package/lib/commonjs/components/typography/Factory.js.map +1 -1
- package/lib/commonjs/components/typography/H1.js +5 -3
- package/lib/commonjs/components/typography/H1.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js +5 -3
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H3.js +5 -3
- package/lib/commonjs/components/typography/H3.js.map +1 -1
- package/lib/commonjs/components/typography/H4.js +5 -3
- package/lib/commonjs/components/typography/H4.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js +5 -3
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js +5 -3
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/Hero.js +5 -3
- package/lib/commonjs/components/typography/Hero.js.map +1 -1
- package/lib/commonjs/components/typography/Label.js +5 -3
- package/lib/commonjs/components/typography/Label.js.map +1 -1
- package/lib/commonjs/components/typography/LabelHeader.js +5 -3
- package/lib/commonjs/components/typography/LabelHeader.js.map +1 -1
- package/lib/commonjs/components/typography/LabelLink.js +5 -3
- package/lib/commonjs/components/typography/LabelLink.js.map +1 -1
- package/lib/commonjs/components/typography/LabelSmall.js +5 -3
- package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
- package/lib/commonjs/components/typography/LabelSmallAlt.js +5 -3
- package/lib/commonjs/components/typography/LabelSmallAlt.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +4 -2
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/typography/BaseTypography.js +3 -2
- package/lib/module/components/typography/BaseTypography.js.map +1 -1
- package/lib/module/components/typography/Body.js +4 -3
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/BodyMonospace.js +3 -2
- package/lib/module/components/typography/BodyMonospace.js.map +1 -1
- package/lib/module/components/typography/ButtonText.js +4 -3
- package/lib/module/components/typography/ButtonText.js.map +1 -1
- package/lib/module/components/typography/Caption.js +4 -3
- package/lib/module/components/typography/Caption.js.map +1 -1
- package/lib/module/components/typography/Chip.js +4 -3
- package/lib/module/components/typography/Chip.js.map +1 -1
- package/lib/module/components/typography/Factory.js +4 -2
- package/lib/module/components/typography/Factory.js.map +1 -1
- package/lib/module/components/typography/H1.js +4 -3
- package/lib/module/components/typography/H1.js.map +1 -1
- package/lib/module/components/typography/H2.js +4 -3
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H3.js +4 -3
- package/lib/module/components/typography/H3.js.map +1 -1
- package/lib/module/components/typography/H4.js +4 -3
- package/lib/module/components/typography/H4.js.map +1 -1
- package/lib/module/components/typography/H5.js +4 -3
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/H6.js +4 -3
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/Hero.js +4 -3
- package/lib/module/components/typography/Hero.js.map +1 -1
- package/lib/module/components/typography/Label.js +4 -3
- package/lib/module/components/typography/Label.js.map +1 -1
- package/lib/module/components/typography/LabelHeader.js +4 -3
- package/lib/module/components/typography/LabelHeader.js.map +1 -1
- package/lib/module/components/typography/LabelLink.js +4 -3
- package/lib/module/components/typography/LabelLink.js.map +1 -1
- package/lib/module/components/typography/LabelSmall.js +4 -3
- package/lib/module/components/typography/LabelSmall.js.map +1 -1
- package/lib/module/components/typography/LabelSmallAlt.js +4 -3
- package/lib/module/components/typography/LabelSmallAlt.js.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts +5 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/components/typography/BaseTypography.d.ts +2 -2
- package/lib/typescript/components/typography/BaseTypography.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts +6 -4
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/BodyMonospace.d.ts +6 -6
- package/lib/typescript/components/typography/BodyMonospace.d.ts.map +1 -1
- package/lib/typescript/components/typography/ButtonText.d.ts +6 -4
- package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
- package/lib/typescript/components/typography/Caption.d.ts +6 -9
- package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
- package/lib/typescript/components/typography/Chip.d.ts +6 -6
- package/lib/typescript/components/typography/Chip.d.ts.map +1 -1
- package/lib/typescript/components/typography/Factory.d.ts +2 -1
- package/lib/typescript/components/typography/Factory.d.ts.map +1 -1
- package/lib/typescript/components/typography/H1.d.ts +6 -6
- package/lib/typescript/components/typography/H1.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts +6 -6
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H3.d.ts +6 -6
- package/lib/typescript/components/typography/H3.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts +6 -6
- package/lib/typescript/components/typography/H4.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts +6 -9
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts +6 -4
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Hero.d.ts +6 -6
- package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
- package/lib/typescript/components/typography/Label.d.ts +3 -2
- package/lib/typescript/components/typography/Label.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelHeader.d.ts +6 -4
- package/lib/typescript/components/typography/LabelHeader.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelLink.d.ts +3 -2
- package/lib/typescript/components/typography/LabelLink.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts +3 -2
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelSmallAlt.d.ts +6 -4
- package/lib/typescript/components/typography/LabelSmallAlt.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/listitems/ListItemNav.tsx +9 -2
- package/src/components/typography/BaseTypography.tsx +4 -4
- package/src/components/typography/Body.tsx +14 -9
- package/src/components/typography/BodyMonospace.tsx +15 -8
- package/src/components/typography/ButtonText.tsx +21 -14
- package/src/components/typography/Caption.tsx +17 -12
- package/src/components/typography/Chip.tsx +14 -9
- package/src/components/typography/Factory.tsx +6 -2
- package/src/components/typography/H1.tsx +17 -12
- package/src/components/typography/H2.tsx +17 -12
- package/src/components/typography/H3.tsx +17 -12
- package/src/components/typography/H4.tsx +17 -12
- package/src/components/typography/H5.tsx +19 -14
- package/src/components/typography/H6.tsx +17 -12
- package/src/components/typography/Hero.tsx +17 -12
- package/src/components/typography/Label.tsx +24 -15
- package/src/components/typography/LabelHeader.tsx +25 -18
- package/src/components/typography/LabelLink.tsx +23 -18
- package/src/components/typography/LabelSmall.tsx +24 -17
- package/src/components/typography/LabelSmallAlt.tsx +20 -13
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOColors, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -20,14 +22,17 @@ const legacyFont: FontFamily = "TitilliumWeb";
|
|
|
20
22
|
/**
|
|
21
23
|
* `Chip` typographic style
|
|
22
24
|
*/
|
|
23
|
-
export const Chip = (props
|
|
25
|
+
export const Chip = React.forwardRef<View, ChipProps>((props, ref) => {
|
|
24
26
|
const { isExperimental } = useIOExperimentalDesign();
|
|
25
27
|
|
|
26
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
28
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
29
|
+
{
|
|
30
|
+
...props,
|
|
31
|
+
defaultWeight,
|
|
32
|
+
defaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFont,
|
|
34
|
+
fontStyle: { fontSize: chipFontSize }
|
|
35
|
+
},
|
|
36
|
+
ref
|
|
37
|
+
);
|
|
38
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useMemo } from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
2
3
|
import { IOColors } from "../../core";
|
|
3
4
|
import { IOFontWeight } from "../../utils/fonts";
|
|
4
5
|
import { XOR } from "../../utils/types";
|
|
@@ -74,7 +75,10 @@ function isDefaultFactoryProps<WeightPropsType, ColorsPropsType>(
|
|
|
74
75
|
export function useTypographyFactory<
|
|
75
76
|
WeightPropsType extends IOFontWeight,
|
|
76
77
|
ColorsPropsType extends IOColors
|
|
77
|
-
>(
|
|
78
|
+
>(
|
|
79
|
+
props: FactoryProps<WeightPropsType, ColorsPropsType>,
|
|
80
|
+
ref?: React.ForwardedRef<View>
|
|
81
|
+
) {
|
|
78
82
|
// Use different strategy to calculate the default values, based on DefaultProps
|
|
79
83
|
const { weight, color } = useMemo(
|
|
80
84
|
() =>
|
|
@@ -89,5 +93,5 @@ export function useTypographyFactory<
|
|
|
89
93
|
[props]
|
|
90
94
|
);
|
|
91
95
|
|
|
92
|
-
return <BaseTypography weight={weight} color={color} {...props} />;
|
|
96
|
+
return <BaseTypography weight={weight} color={color} {...props} ref={ref} />;
|
|
93
97
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -25,17 +27,20 @@ const legacyH1LineHeight = 43;
|
|
|
25
27
|
/**
|
|
26
28
|
* `H1` typographic style
|
|
27
29
|
*/
|
|
28
|
-
export const H1 = (props
|
|
30
|
+
export const H1 = React.forwardRef<View, H1Props>((props, ref) => {
|
|
29
31
|
const { isExperimental } = useIOExperimentalDesign();
|
|
30
32
|
|
|
31
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
33
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
34
|
+
{
|
|
35
|
+
...props,
|
|
36
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
37
|
+
defaultColor,
|
|
38
|
+
font: isExperimental ? font : legacyFont,
|
|
39
|
+
fontStyle: {
|
|
40
|
+
fontSize: isExperimental ? h1FontSize : legacyH1FontSize,
|
|
41
|
+
lineHeight: isExperimental ? h1LineHeight : legacyH1LineHeight
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
ref
|
|
45
|
+
);
|
|
46
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -25,17 +27,20 @@ const legacyH2LineHeight = 40;
|
|
|
25
27
|
/**
|
|
26
28
|
* `H2` typographic style
|
|
27
29
|
*/
|
|
28
|
-
export const H2 = (props
|
|
30
|
+
export const H2 = React.forwardRef<View, H2Props>((props, ref) => {
|
|
29
31
|
const { isExperimental } = useIOExperimentalDesign();
|
|
30
32
|
|
|
31
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
33
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
34
|
+
{
|
|
35
|
+
...props,
|
|
36
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
37
|
+
defaultColor,
|
|
38
|
+
font: isExperimental ? font : legacyFont,
|
|
39
|
+
fontStyle: {
|
|
40
|
+
fontSize: isExperimental ? h2FontSize : legacyH2FontSize,
|
|
41
|
+
lineHeight: isExperimental ? h2LineHeight : legacyH2LineHeight
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
ref
|
|
45
|
+
);
|
|
46
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -26,17 +28,20 @@ const legacyH3LineHeight = 34;
|
|
|
26
28
|
/**
|
|
27
29
|
* `H3` typographic style
|
|
28
30
|
*/
|
|
29
|
-
export const H3 = (props
|
|
31
|
+
export const H3 = React.forwardRef<View, H3Props>((props, ref) => {
|
|
30
32
|
const { isExperimental } = useIOExperimentalDesign();
|
|
31
33
|
|
|
32
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
34
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
35
|
+
{
|
|
36
|
+
...props,
|
|
37
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
38
|
+
defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
|
|
39
|
+
font: isExperimental ? font : legacyFontName,
|
|
40
|
+
fontStyle: {
|
|
41
|
+
fontSize: isExperimental ? h3FontSize : legacyH3FontSize,
|
|
42
|
+
lineHeight: isExperimental ? h3LineHeight : legacyH3LineHeight
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
ref
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -25,16 +27,19 @@ const legacyH4FontSize = 22;
|
|
|
25
27
|
/**
|
|
26
28
|
* `H4` typographic style
|
|
27
29
|
*/
|
|
28
|
-
export const H4 = (props
|
|
30
|
+
export const H4 = React.forwardRef<View, H4Props>((props, ref) => {
|
|
29
31
|
const { isExperimental } = useIOExperimentalDesign();
|
|
30
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
32
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
36
|
+
defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
|
|
37
|
+
font: isExperimental ? font : legacyFontName,
|
|
38
|
+
fontStyle: {
|
|
39
|
+
fontSize: isExperimental ? h4FontSize : legacyH4FontSize,
|
|
40
|
+
lineHeight: h4LineHeight
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
ref
|
|
44
|
+
);
|
|
45
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -20,19 +22,22 @@ const defaultWeight: AllowedWeight = "SemiBold";
|
|
|
20
22
|
/**
|
|
21
23
|
* `H5` typographic style
|
|
22
24
|
*/
|
|
23
|
-
export const H5 = (props
|
|
25
|
+
export const H5 = React.forwardRef<View, H5Props>((props, ref) => {
|
|
24
26
|
const { isExperimental } = useIOExperimentalDesign();
|
|
25
27
|
|
|
26
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
28
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
29
|
+
{
|
|
30
|
+
...props,
|
|
31
|
+
defaultWeight,
|
|
32
|
+
defaultColor,
|
|
33
|
+
font: isExperimental ? font : legacyFont,
|
|
34
|
+
fontStyle: {
|
|
35
|
+
fontSize: h5FontSize,
|
|
36
|
+
lineHeight: h5LineHeight,
|
|
37
|
+
textTransform: "uppercase",
|
|
38
|
+
letterSpacing: 0.5
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
ref
|
|
42
|
+
);
|
|
43
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOTheme, IOThemeLight, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -26,17 +28,20 @@ const legacyDefaultWeight: AllowedWeight = "SemiBold";
|
|
|
26
28
|
/**
|
|
27
29
|
* `H6` typographic style
|
|
28
30
|
*/
|
|
29
|
-
export const H6 = (props
|
|
31
|
+
export const H6 = React.forwardRef<View, H6Props>((props, ref) => {
|
|
30
32
|
const { isExperimental } = useIOExperimentalDesign();
|
|
31
33
|
|
|
32
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
34
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
35
|
+
{
|
|
36
|
+
...props,
|
|
37
|
+
defaultWeight: isExperimental ? h6DefaultWeight : legacyDefaultWeight,
|
|
38
|
+
defaultColor: h6DefaultColor,
|
|
39
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
40
|
+
fontStyle: {
|
|
41
|
+
fontSize: isExperimental ? h6FontSize : legacyFontSize,
|
|
42
|
+
lineHeight: isExperimental ? h6LineHeight : legacyLineHeight
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
ref
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { useIOExperimentalDesign, IOTheme } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -25,17 +27,20 @@ const legacyHeroLineHeight = 49;
|
|
|
25
27
|
/**
|
|
26
28
|
* `Hero` typographic style
|
|
27
29
|
*/
|
|
28
|
-
export const Hero = (props
|
|
30
|
+
export const Hero = React.forwardRef<View, HeroProps>((props, ref) => {
|
|
29
31
|
const { isExperimental } = useIOExperimentalDesign();
|
|
30
32
|
|
|
31
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
33
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
34
|
+
{
|
|
35
|
+
...props,
|
|
36
|
+
defaultWeight: isExperimental ? defaultWeight : legacyWeight,
|
|
37
|
+
defaultColor,
|
|
38
|
+
font: isExperimental ? font : legacyFont,
|
|
39
|
+
fontStyle: {
|
|
40
|
+
fontSize: isExperimental ? heroFontSize : legacyHeroFontSize,
|
|
41
|
+
lineHeight: isExperimental ? heroLineHeight : legacyHeroLineHeight
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
ref
|
|
45
|
+
);
|
|
46
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import {
|
|
2
4
|
IOColors,
|
|
3
5
|
IOColorsStatusForeground,
|
|
@@ -28,19 +30,26 @@ const labelDefaultcolor = "black";
|
|
|
28
30
|
/**
|
|
29
31
|
* `Label` typographic style
|
|
30
32
|
*/
|
|
31
|
-
export const Label =
|
|
32
|
-
|
|
33
|
+
export const Label = React.forwardRef<View, LabelProps>(
|
|
34
|
+
({ fontSize, ...props }, ref) => {
|
|
35
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
38
|
+
{
|
|
39
|
+
...props,
|
|
40
|
+
defaultWeight: labelDefaultWeight,
|
|
41
|
+
defaultColor: labelDefaultcolor,
|
|
42
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
43
|
+
fontStyle: {
|
|
44
|
+
fontSize: fontSize
|
|
45
|
+
? fontSizeMapping[fontSize]
|
|
46
|
+
: fontSizeMapping.regular,
|
|
47
|
+
lineHeight: fontSize
|
|
48
|
+
? lineHeightMapping[fontSize]
|
|
49
|
+
: lineHeightMapping.regular
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
ref
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { View } from "react-native";
|
|
2
|
+
import React from "react";
|
|
1
3
|
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
2
4
|
import { IOTheme, IOThemeLight, useIOExperimentalDesign } from "../../core";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -29,21 +31,26 @@ const legacyLabelHeaderLineHeight = 20;
|
|
|
29
31
|
/**
|
|
30
32
|
* `LabelHeader` typographic style
|
|
31
33
|
*/
|
|
32
|
-
export const LabelHeader =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
34
|
+
export const LabelHeader = React.forwardRef<View, LabelHeaderProps>(
|
|
35
|
+
(props, ref) => {
|
|
36
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
37
|
+
// console.log("isExperimental", isExperimental);
|
|
38
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
39
|
+
{
|
|
40
|
+
...props,
|
|
41
|
+
defaultWeight: isExperimental
|
|
42
|
+
? labelHeaderDefaultWeight
|
|
43
|
+
: legacyLabelHeaderWeight,
|
|
44
|
+
defaultColor: labelHeaderDefaultColor,
|
|
45
|
+
font: isExperimental ? labelHeaderFontName : legacyLabelHeaderFontName,
|
|
46
|
+
fontStyle: {
|
|
47
|
+
fontSize: labelHeaderFontSize,
|
|
48
|
+
lineHeight: isExperimental
|
|
49
|
+
? labelHeaderLineHeight
|
|
50
|
+
: legacyLabelHeaderLineHeight
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
ref
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { useIOExperimentalDesign, type IOColors } from "../../core";
|
|
2
4
|
import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -29,23 +31,26 @@ export const linkDefaultWeight: AllowedWeight = "SemiBold";
|
|
|
29
31
|
/**
|
|
30
32
|
* `Link` typographic style
|
|
31
33
|
*/
|
|
32
|
-
export const LabelLink = (props
|
|
34
|
+
export const LabelLink = React.forwardRef<View, LinkProps>((props, ref) => {
|
|
33
35
|
const { isExperimental } = useIOExperimentalDesign();
|
|
34
36
|
|
|
35
|
-
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
37
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
38
|
+
{
|
|
39
|
+
accessibilityRole: props.onPress ? "link" : undefined,
|
|
40
|
+
...props,
|
|
41
|
+
defaultWeight: linkDefaultWeight,
|
|
42
|
+
defaultColor: isExperimental ? linkDefaultColor : linkLegacyDefaultColor,
|
|
43
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
44
|
+
fontStyle: {
|
|
45
|
+
fontSize: props.fontSize
|
|
46
|
+
? fontSizeMapping[props.fontSize]
|
|
47
|
+
: fontSizeMapping.regular,
|
|
48
|
+
lineHeight: props.fontSize
|
|
49
|
+
? lineHeightMapping[props.fontSize]
|
|
50
|
+
: lineHeightMapping.regular,
|
|
51
|
+
textDecorationLine: "underline"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
ref
|
|
55
|
+
);
|
|
56
|
+
});
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { IOColors, IOTheme, useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
3
5
|
import { useTypographyFactory } from "./Factory";
|
|
@@ -41,21 +43,26 @@ const labelDefaultcolor = "blue";
|
|
|
41
43
|
/**
|
|
42
44
|
* `LabelSmall` typographic style
|
|
43
45
|
*/
|
|
44
|
-
export const LabelSmall =
|
|
45
|
-
|
|
46
|
+
export const LabelSmall = React.forwardRef<View, LabelSmallProps>(
|
|
47
|
+
(props, ref) => {
|
|
48
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
46
49
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
50
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
51
|
+
{
|
|
52
|
+
...props,
|
|
53
|
+
defaultWeight: labelDefaultWeight,
|
|
54
|
+
defaultColor: labelDefaultcolor,
|
|
55
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
56
|
+
fontStyle: {
|
|
57
|
+
fontSize: props.fontSize
|
|
58
|
+
? fontSizeMapping[props.fontSize]
|
|
59
|
+
: fontSizeMapping.regular,
|
|
60
|
+
lineHeight: props.fontSize
|
|
61
|
+
? lineHeightMapping[props.fontSize]
|
|
62
|
+
: lineHeightMapping.regular
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
ref
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { View } from "react-native";
|
|
1
3
|
import { useIOExperimentalDesign } from "../../core";
|
|
2
4
|
import type { IOColors, IOTheme } from "../../core/IOColors";
|
|
3
5
|
import { FontFamily, IOFontWeight } from "../../utils/fonts";
|
|
@@ -35,17 +37,22 @@ const legacyDefaultWeight: AllowedWeight = "SemiBold";
|
|
|
35
37
|
/**
|
|
36
38
|
* `LabelSmallAlt` typographic style. It's referenced as `LabelSmallReadex` in the design projects.
|
|
37
39
|
*/
|
|
38
|
-
export const LabelSmallAlt =
|
|
39
|
-
|
|
40
|
+
export const LabelSmallAlt = React.forwardRef<View, LabelSmallAltProps>(
|
|
41
|
+
(props, ref) => {
|
|
42
|
+
const { isExperimental } = useIOExperimentalDesign();
|
|
40
43
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
44
|
+
return useTypographyFactory<AllowedWeight, AllowedColors>(
|
|
45
|
+
{
|
|
46
|
+
...props,
|
|
47
|
+
defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
|
|
48
|
+
defaultColor,
|
|
49
|
+
font: isExperimental ? fontName : legacyFontName,
|
|
50
|
+
fontStyle: {
|
|
51
|
+
fontSize: isExperimental ? labelFontSize : legacyLabelFontSize,
|
|
52
|
+
lineHeight: labelLineHeight
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
ref
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|