@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.
Files changed (141) hide show
  1. package/lib/commonjs/components/listitems/ListItemNav.js +4 -2
  2. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  3. package/lib/commonjs/components/typography/BaseTypography.js +3 -2
  4. package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
  5. package/lib/commonjs/components/typography/Body.js +5 -3
  6. package/lib/commonjs/components/typography/Body.js.map +1 -1
  7. package/lib/commonjs/components/typography/BodyMonospace.js +4 -2
  8. package/lib/commonjs/components/typography/BodyMonospace.js.map +1 -1
  9. package/lib/commonjs/components/typography/ButtonText.js +5 -3
  10. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  11. package/lib/commonjs/components/typography/Caption.js +5 -3
  12. package/lib/commonjs/components/typography/Caption.js.map +1 -1
  13. package/lib/commonjs/components/typography/Chip.js +5 -3
  14. package/lib/commonjs/components/typography/Chip.js.map +1 -1
  15. package/lib/commonjs/components/typography/Factory.js +4 -2
  16. package/lib/commonjs/components/typography/Factory.js.map +1 -1
  17. package/lib/commonjs/components/typography/H1.js +5 -3
  18. package/lib/commonjs/components/typography/H1.js.map +1 -1
  19. package/lib/commonjs/components/typography/H2.js +5 -3
  20. package/lib/commonjs/components/typography/H2.js.map +1 -1
  21. package/lib/commonjs/components/typography/H3.js +5 -3
  22. package/lib/commonjs/components/typography/H3.js.map +1 -1
  23. package/lib/commonjs/components/typography/H4.js +5 -3
  24. package/lib/commonjs/components/typography/H4.js.map +1 -1
  25. package/lib/commonjs/components/typography/H5.js +5 -3
  26. package/lib/commonjs/components/typography/H5.js.map +1 -1
  27. package/lib/commonjs/components/typography/H6.js +5 -3
  28. package/lib/commonjs/components/typography/H6.js.map +1 -1
  29. package/lib/commonjs/components/typography/Hero.js +5 -3
  30. package/lib/commonjs/components/typography/Hero.js.map +1 -1
  31. package/lib/commonjs/components/typography/Label.js +5 -3
  32. package/lib/commonjs/components/typography/Label.js.map +1 -1
  33. package/lib/commonjs/components/typography/LabelHeader.js +5 -3
  34. package/lib/commonjs/components/typography/LabelHeader.js.map +1 -1
  35. package/lib/commonjs/components/typography/LabelLink.js +5 -3
  36. package/lib/commonjs/components/typography/LabelLink.js.map +1 -1
  37. package/lib/commonjs/components/typography/LabelSmall.js +5 -3
  38. package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
  39. package/lib/commonjs/components/typography/LabelSmallAlt.js +5 -3
  40. package/lib/commonjs/components/typography/LabelSmallAlt.js.map +1 -1
  41. package/lib/module/components/listitems/ListItemNav.js +4 -2
  42. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  43. package/lib/module/components/typography/BaseTypography.js +3 -2
  44. package/lib/module/components/typography/BaseTypography.js.map +1 -1
  45. package/lib/module/components/typography/Body.js +4 -3
  46. package/lib/module/components/typography/Body.js.map +1 -1
  47. package/lib/module/components/typography/BodyMonospace.js +3 -2
  48. package/lib/module/components/typography/BodyMonospace.js.map +1 -1
  49. package/lib/module/components/typography/ButtonText.js +4 -3
  50. package/lib/module/components/typography/ButtonText.js.map +1 -1
  51. package/lib/module/components/typography/Caption.js +4 -3
  52. package/lib/module/components/typography/Caption.js.map +1 -1
  53. package/lib/module/components/typography/Chip.js +4 -3
  54. package/lib/module/components/typography/Chip.js.map +1 -1
  55. package/lib/module/components/typography/Factory.js +4 -2
  56. package/lib/module/components/typography/Factory.js.map +1 -1
  57. package/lib/module/components/typography/H1.js +4 -3
  58. package/lib/module/components/typography/H1.js.map +1 -1
  59. package/lib/module/components/typography/H2.js +4 -3
  60. package/lib/module/components/typography/H2.js.map +1 -1
  61. package/lib/module/components/typography/H3.js +4 -3
  62. package/lib/module/components/typography/H3.js.map +1 -1
  63. package/lib/module/components/typography/H4.js +4 -3
  64. package/lib/module/components/typography/H4.js.map +1 -1
  65. package/lib/module/components/typography/H5.js +4 -3
  66. package/lib/module/components/typography/H5.js.map +1 -1
  67. package/lib/module/components/typography/H6.js +4 -3
  68. package/lib/module/components/typography/H6.js.map +1 -1
  69. package/lib/module/components/typography/Hero.js +4 -3
  70. package/lib/module/components/typography/Hero.js.map +1 -1
  71. package/lib/module/components/typography/Label.js +4 -3
  72. package/lib/module/components/typography/Label.js.map +1 -1
  73. package/lib/module/components/typography/LabelHeader.js +4 -3
  74. package/lib/module/components/typography/LabelHeader.js.map +1 -1
  75. package/lib/module/components/typography/LabelLink.js +4 -3
  76. package/lib/module/components/typography/LabelLink.js.map +1 -1
  77. package/lib/module/components/typography/LabelSmall.js +4 -3
  78. package/lib/module/components/typography/LabelSmall.js.map +1 -1
  79. package/lib/module/components/typography/LabelSmallAlt.js +4 -3
  80. package/lib/module/components/typography/LabelSmallAlt.js.map +1 -1
  81. package/lib/typescript/components/listitems/ListItemNav.d.ts +5 -1
  82. package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
  83. package/lib/typescript/components/typography/BaseTypography.d.ts +2 -2
  84. package/lib/typescript/components/typography/BaseTypography.d.ts.map +1 -1
  85. package/lib/typescript/components/typography/Body.d.ts +6 -4
  86. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  87. package/lib/typescript/components/typography/BodyMonospace.d.ts +6 -6
  88. package/lib/typescript/components/typography/BodyMonospace.d.ts.map +1 -1
  89. package/lib/typescript/components/typography/ButtonText.d.ts +6 -4
  90. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  91. package/lib/typescript/components/typography/Caption.d.ts +6 -9
  92. package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
  93. package/lib/typescript/components/typography/Chip.d.ts +6 -6
  94. package/lib/typescript/components/typography/Chip.d.ts.map +1 -1
  95. package/lib/typescript/components/typography/Factory.d.ts +2 -1
  96. package/lib/typescript/components/typography/Factory.d.ts.map +1 -1
  97. package/lib/typescript/components/typography/H1.d.ts +6 -6
  98. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  99. package/lib/typescript/components/typography/H2.d.ts +6 -6
  100. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  101. package/lib/typescript/components/typography/H3.d.ts +6 -6
  102. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  103. package/lib/typescript/components/typography/H4.d.ts +6 -6
  104. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  105. package/lib/typescript/components/typography/H5.d.ts +6 -9
  106. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  107. package/lib/typescript/components/typography/H6.d.ts +6 -4
  108. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  109. package/lib/typescript/components/typography/Hero.d.ts +6 -6
  110. package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
  111. package/lib/typescript/components/typography/Label.d.ts +3 -2
  112. package/lib/typescript/components/typography/Label.d.ts.map +1 -1
  113. package/lib/typescript/components/typography/LabelHeader.d.ts +6 -4
  114. package/lib/typescript/components/typography/LabelHeader.d.ts.map +1 -1
  115. package/lib/typescript/components/typography/LabelLink.d.ts +3 -2
  116. package/lib/typescript/components/typography/LabelLink.d.ts.map +1 -1
  117. package/lib/typescript/components/typography/LabelSmall.d.ts +3 -2
  118. package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
  119. package/lib/typescript/components/typography/LabelSmallAlt.d.ts +6 -4
  120. package/lib/typescript/components/typography/LabelSmallAlt.d.ts.map +1 -1
  121. package/package.json +1 -1
  122. package/src/components/listitems/ListItemNav.tsx +9 -2
  123. package/src/components/typography/BaseTypography.tsx +4 -4
  124. package/src/components/typography/Body.tsx +14 -9
  125. package/src/components/typography/BodyMonospace.tsx +15 -8
  126. package/src/components/typography/ButtonText.tsx +21 -14
  127. package/src/components/typography/Caption.tsx +17 -12
  128. package/src/components/typography/Chip.tsx +14 -9
  129. package/src/components/typography/Factory.tsx +6 -2
  130. package/src/components/typography/H1.tsx +17 -12
  131. package/src/components/typography/H2.tsx +17 -12
  132. package/src/components/typography/H3.tsx +17 -12
  133. package/src/components/typography/H4.tsx +17 -12
  134. package/src/components/typography/H5.tsx +19 -14
  135. package/src/components/typography/H6.tsx +17 -12
  136. package/src/components/typography/Hero.tsx +17 -12
  137. package/src/components/typography/Label.tsx +24 -15
  138. package/src/components/typography/LabelHeader.tsx +25 -18
  139. package/src/components/typography/LabelLink.tsx +23 -18
  140. package/src/components/typography/LabelSmall.tsx +24 -17
  141. 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: ChipProps) => {
25
+ export const Chip = React.forwardRef<View, ChipProps>((props, ref) => {
24
26
  const { isExperimental } = useIOExperimentalDesign();
25
27
 
26
- return useTypographyFactory<AllowedWeight, AllowedColors>({
27
- ...props,
28
- defaultWeight,
29
- defaultColor,
30
- font: isExperimental ? font : legacyFont,
31
- fontStyle: { fontSize: chipFontSize }
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
- >(props: FactoryProps<WeightPropsType, ColorsPropsType>) {
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: H1Props) => {
30
+ export const H1 = React.forwardRef<View, H1Props>((props, ref) => {
29
31
  const { isExperimental } = useIOExperimentalDesign();
30
32
 
31
- return useTypographyFactory<AllowedWeight, AllowedColors>({
32
- ...props,
33
- defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
34
- defaultColor,
35
- font: isExperimental ? font : legacyFont,
36
- fontStyle: {
37
- fontSize: isExperimental ? h1FontSize : legacyH1FontSize,
38
- lineHeight: isExperimental ? h1LineHeight : legacyH1LineHeight
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: H2Props) => {
30
+ export const H2 = React.forwardRef<View, H2Props>((props, ref) => {
29
31
  const { isExperimental } = useIOExperimentalDesign();
30
32
 
31
- return useTypographyFactory<AllowedWeight, AllowedColors>({
32
- ...props,
33
- defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
34
- defaultColor,
35
- font: isExperimental ? font : legacyFont,
36
- fontStyle: {
37
- fontSize: isExperimental ? h2FontSize : legacyH2FontSize,
38
- lineHeight: isExperimental ? h2LineHeight : legacyH2LineHeight
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: H3Props) => {
31
+ export const H3 = React.forwardRef<View, H3Props>((props, ref) => {
30
32
  const { isExperimental } = useIOExperimentalDesign();
31
33
 
32
- return useTypographyFactory<AllowedWeight, AllowedColors>({
33
- ...props,
34
- defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
35
- defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
36
- font: isExperimental ? font : legacyFontName,
37
- fontStyle: {
38
- fontSize: isExperimental ? h3FontSize : legacyH3FontSize,
39
- lineHeight: isExperimental ? h3LineHeight : legacyH3LineHeight
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: H4Props) => {
30
+ export const H4 = React.forwardRef<View, H4Props>((props, ref) => {
29
31
  const { isExperimental } = useIOExperimentalDesign();
30
- return useTypographyFactory<AllowedWeight, AllowedColors>({
31
- ...props,
32
- defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
33
- defaultColor: isExperimental ? defaultColor : legacyDefaultColor,
34
- font: isExperimental ? font : legacyFontName,
35
- fontStyle: {
36
- fontSize: isExperimental ? h4FontSize : legacyH4FontSize,
37
- lineHeight: h4LineHeight
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: H5Props) => {
25
+ export const H5 = React.forwardRef<View, H5Props>((props, ref) => {
24
26
  const { isExperimental } = useIOExperimentalDesign();
25
27
 
26
- return useTypographyFactory<AllowedWeight, AllowedColors>({
27
- ...props,
28
- defaultWeight,
29
- defaultColor,
30
- font: isExperimental ? font : legacyFont,
31
- fontStyle: {
32
- fontSize: h5FontSize,
33
- lineHeight: h5LineHeight,
34
- textTransform: "uppercase",
35
- letterSpacing: 0.5
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: H6Props) => {
31
+ export const H6 = React.forwardRef<View, H6Props>((props, ref) => {
30
32
  const { isExperimental } = useIOExperimentalDesign();
31
33
 
32
- return useTypographyFactory<AllowedWeight, AllowedColors>({
33
- ...props,
34
- defaultWeight: isExperimental ? h6DefaultWeight : legacyDefaultWeight,
35
- defaultColor: h6DefaultColor,
36
- font: isExperimental ? fontName : legacyFontName,
37
- fontStyle: {
38
- fontSize: isExperimental ? h6FontSize : legacyFontSize,
39
- lineHeight: isExperimental ? h6LineHeight : legacyLineHeight
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: HeroProps) => {
30
+ export const Hero = React.forwardRef<View, HeroProps>((props, ref) => {
29
31
  const { isExperimental } = useIOExperimentalDesign();
30
32
 
31
- return useTypographyFactory<AllowedWeight, AllowedColors>({
32
- ...props,
33
- defaultWeight: isExperimental ? defaultWeight : legacyWeight,
34
- defaultColor,
35
- font: isExperimental ? font : legacyFont,
36
- fontStyle: {
37
- fontSize: isExperimental ? heroFontSize : legacyHeroFontSize,
38
- lineHeight: isExperimental ? heroLineHeight : legacyHeroLineHeight
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 = ({ fontSize, ...props }: LabelProps) => {
32
- const { isExperimental } = useIOExperimentalDesign();
33
+ export const Label = React.forwardRef<View, LabelProps>(
34
+ ({ fontSize, ...props }, ref) => {
35
+ const { isExperimental } = useIOExperimentalDesign();
33
36
 
34
- return useTypographyFactory<AllowedWeight, AllowedColors>({
35
- ...props,
36
- defaultWeight: labelDefaultWeight,
37
- defaultColor: labelDefaultcolor,
38
- font: isExperimental ? fontName : legacyFontName,
39
- fontStyle: {
40
- fontSize: fontSize ? fontSizeMapping[fontSize] : fontSizeMapping.regular,
41
- lineHeight: fontSize
42
- ? lineHeightMapping[fontSize]
43
- : lineHeightMapping.regular
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 = (props: LabelHeaderProps) => {
33
- const { isExperimental } = useIOExperimentalDesign();
34
- // console.log("isExperimental", isExperimental);
35
- return useTypographyFactory<AllowedWeight, AllowedColors>({
36
- ...props,
37
- defaultWeight: isExperimental
38
- ? labelHeaderDefaultWeight
39
- : legacyLabelHeaderWeight,
40
- defaultColor: labelHeaderDefaultColor,
41
- font: isExperimental ? labelHeaderFontName : legacyLabelHeaderFontName,
42
- fontStyle: {
43
- fontSize: labelHeaderFontSize,
44
- lineHeight: isExperimental
45
- ? labelHeaderLineHeight
46
- : legacyLabelHeaderLineHeight
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: LinkProps) => {
34
+ export const LabelLink = React.forwardRef<View, LinkProps>((props, ref) => {
33
35
  const { isExperimental } = useIOExperimentalDesign();
34
36
 
35
- return useTypographyFactory<AllowedWeight, AllowedColors>({
36
- accessibilityRole: props.onPress ? "link" : undefined,
37
- ...props,
38
- defaultWeight: linkDefaultWeight,
39
- defaultColor: isExperimental ? linkDefaultColor : linkLegacyDefaultColor,
40
- font: isExperimental ? fontName : legacyFontName,
41
- fontStyle: {
42
- fontSize: props.fontSize
43
- ? fontSizeMapping[props.fontSize]
44
- : fontSizeMapping.regular,
45
- lineHeight: props.fontSize
46
- ? lineHeightMapping[props.fontSize]
47
- : lineHeightMapping.regular,
48
- textDecorationLine: "underline"
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 = (props: LabelSmallProps) => {
45
- const { isExperimental } = useIOExperimentalDesign();
46
+ export const LabelSmall = React.forwardRef<View, LabelSmallProps>(
47
+ (props, ref) => {
48
+ const { isExperimental } = useIOExperimentalDesign();
46
49
 
47
- return useTypographyFactory<AllowedWeight, AllowedColors>({
48
- ...props,
49
- defaultWeight: labelDefaultWeight,
50
- defaultColor: labelDefaultcolor,
51
- font: isExperimental ? fontName : legacyFontName,
52
- fontStyle: {
53
- fontSize: props.fontSize
54
- ? fontSizeMapping[props.fontSize]
55
- : fontSizeMapping.regular,
56
- lineHeight: props.fontSize
57
- ? lineHeightMapping[props.fontSize]
58
- : lineHeightMapping.regular
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 = (props: LabelSmallAltProps) => {
39
- const { isExperimental } = useIOExperimentalDesign();
40
+ export const LabelSmallAlt = React.forwardRef<View, LabelSmallAltProps>(
41
+ (props, ref) => {
42
+ const { isExperimental } = useIOExperimentalDesign();
40
43
 
41
- return useTypographyFactory<AllowedWeight, AllowedColors>({
42
- ...props,
43
- defaultWeight: isExperimental ? defaultWeight : legacyDefaultWeight,
44
- defaultColor,
45
- font: isExperimental ? fontName : legacyFontName,
46
- fontStyle: {
47
- fontSize: isExperimental ? labelFontSize : legacyLabelFontSize,
48
- lineHeight: labelLineHeight
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
+ );