@pagopa/io-app-design-system 7.0.2 → 7.1.0

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 (182) hide show
  1. package/lib/commonjs/components/alert/Alert.js +6 -5
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/banner/Banner.js +7 -6
  4. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  5. package/lib/commonjs/components/buttons/IOButton/IOButton.js +10 -8
  6. package/lib/commonjs/components/buttons/IOButton/IOButton.js.map +1 -1
  7. package/lib/commonjs/components/layout/ContentWrapper.js +5 -4
  8. package/lib/commonjs/components/layout/ContentWrapper.js.map +1 -1
  9. package/lib/commonjs/components/otpInput/OTPInput.js +6 -4
  10. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  11. package/lib/commonjs/components/searchInput/SearchInput.js +8 -6
  12. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  13. package/lib/commonjs/components/tabs/TabItem.js +6 -4
  14. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  15. package/lib/commonjs/components/textInput/TextInputValidation.js +5 -3
  16. package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
  17. package/lib/commonjs/components/typography/Body.js +8 -5
  18. package/lib/commonjs/components/typography/Body.js.map +1 -1
  19. package/lib/commonjs/components/typography/BodyMonospace.js +4 -5
  20. package/lib/commonjs/components/typography/BodyMonospace.js.map +1 -1
  21. package/lib/commonjs/components/typography/BodySmall.js +8 -5
  22. package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
  23. package/lib/commonjs/components/typography/ButtonText.js +4 -5
  24. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  25. package/lib/commonjs/components/typography/Caption.js +4 -5
  26. package/lib/commonjs/components/typography/Caption.js.map +1 -1
  27. package/lib/commonjs/components/typography/H1.js +4 -5
  28. package/lib/commonjs/components/typography/H1.js.map +1 -1
  29. package/lib/commonjs/components/typography/H2.js +4 -5
  30. package/lib/commonjs/components/typography/H2.js.map +1 -1
  31. package/lib/commonjs/components/typography/H3.js +4 -5
  32. package/lib/commonjs/components/typography/H3.js.map +1 -1
  33. package/lib/commonjs/components/typography/H4.js +4 -5
  34. package/lib/commonjs/components/typography/H4.js.map +1 -1
  35. package/lib/commonjs/components/typography/H5.js +4 -5
  36. package/lib/commonjs/components/typography/H5.js.map +1 -1
  37. package/lib/commonjs/components/typography/H6.js +4 -5
  38. package/lib/commonjs/components/typography/H6.js.map +1 -1
  39. package/lib/commonjs/components/typography/Hero.js +4 -5
  40. package/lib/commonjs/components/typography/Hero.js.map +1 -1
  41. package/lib/commonjs/components/typography/IOText.js +16 -14
  42. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  43. package/lib/commonjs/components/typography/LabelMini.js +8 -5
  44. package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
  45. package/lib/commonjs/components/typography/markdown/MdH1.js +4 -5
  46. package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
  47. package/lib/commonjs/components/typography/markdown/MdH2.js +4 -5
  48. package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
  49. package/lib/commonjs/components/typography/markdown/MdH3.js +4 -5
  50. package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
  51. package/lib/commonjs/context/IOThemeContextProvider.js +3 -4
  52. package/lib/commonjs/context/IOThemeContextProvider.js.map +1 -1
  53. package/lib/module/components/alert/Alert.js +5 -5
  54. package/lib/module/components/alert/Alert.js.map +1 -1
  55. package/lib/module/components/banner/Banner.js +6 -6
  56. package/lib/module/components/banner/Banner.js.map +1 -1
  57. package/lib/module/components/buttons/IOButton/IOButton.js +10 -9
  58. package/lib/module/components/buttons/IOButton/IOButton.js.map +1 -1
  59. package/lib/module/components/layout/ContentWrapper.js +4 -4
  60. package/lib/module/components/layout/ContentWrapper.js.map +1 -1
  61. package/lib/module/components/otpInput/OTPInput.js +6 -5
  62. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  63. package/lib/module/components/searchInput/SearchInput.js +8 -7
  64. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  65. package/lib/module/components/tabs/TabItem.js +6 -5
  66. package/lib/module/components/tabs/TabItem.js.map +1 -1
  67. package/lib/module/components/textInput/TextInputValidation.js +5 -4
  68. package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
  69. package/lib/module/components/typography/Body.js +7 -5
  70. package/lib/module/components/typography/Body.js.map +1 -1
  71. package/lib/module/components/typography/BodyMonospace.js +3 -5
  72. package/lib/module/components/typography/BodyMonospace.js.map +1 -1
  73. package/lib/module/components/typography/BodySmall.js +7 -5
  74. package/lib/module/components/typography/BodySmall.js.map +1 -1
  75. package/lib/module/components/typography/ButtonText.js +3 -5
  76. package/lib/module/components/typography/ButtonText.js.map +1 -1
  77. package/lib/module/components/typography/Caption.js +3 -5
  78. package/lib/module/components/typography/Caption.js.map +1 -1
  79. package/lib/module/components/typography/H1.js +3 -5
  80. package/lib/module/components/typography/H1.js.map +1 -1
  81. package/lib/module/components/typography/H2.js +3 -5
  82. package/lib/module/components/typography/H2.js.map +1 -1
  83. package/lib/module/components/typography/H3.js +3 -5
  84. package/lib/module/components/typography/H3.js.map +1 -1
  85. package/lib/module/components/typography/H4.js +3 -5
  86. package/lib/module/components/typography/H4.js.map +1 -1
  87. package/lib/module/components/typography/H5.js +3 -5
  88. package/lib/module/components/typography/H5.js.map +1 -1
  89. package/lib/module/components/typography/H6.js +3 -5
  90. package/lib/module/components/typography/H6.js.map +1 -1
  91. package/lib/module/components/typography/Hero.js +3 -5
  92. package/lib/module/components/typography/Hero.js.map +1 -1
  93. package/lib/module/components/typography/IOText.js +16 -15
  94. package/lib/module/components/typography/IOText.js.map +1 -1
  95. package/lib/module/components/typography/LabelMini.js +7 -5
  96. package/lib/module/components/typography/LabelMini.js.map +1 -1
  97. package/lib/module/components/typography/markdown/MdH1.js +3 -5
  98. package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
  99. package/lib/module/components/typography/markdown/MdH2.js +3 -5
  100. package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
  101. package/lib/module/components/typography/markdown/MdH3.js +3 -5
  102. package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
  103. package/lib/module/context/IOThemeContextProvider.js +3 -4
  104. package/lib/module/context/IOThemeContextProvider.js.map +1 -1
  105. package/lib/typescript/components/alert/Alert.d.ts +3 -1
  106. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  107. package/lib/typescript/components/banner/Banner.d.ts +3 -1
  108. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  109. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts +3 -2
  110. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts.map +1 -1
  111. package/lib/typescript/components/layout/ContentWrapper.d.ts +10 -6
  112. package/lib/typescript/components/layout/ContentWrapper.d.ts.map +1 -1
  113. package/lib/typescript/components/otpInput/OTPInput.d.ts +3 -1
  114. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  115. package/lib/typescript/components/searchInput/SearchInput.d.ts +3 -1
  116. package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
  117. package/lib/typescript/components/tabs/TabItem.d.ts +3 -11
  118. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  119. package/lib/typescript/components/textInput/TextInputValidation.d.ts +7 -24
  120. package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
  121. package/lib/typescript/components/typography/Body.d.ts +4 -2
  122. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  123. package/lib/typescript/components/typography/BodyMonospace.d.ts +2 -8
  124. package/lib/typescript/components/typography/BodyMonospace.d.ts.map +1 -1
  125. package/lib/typescript/components/typography/BodySmall.d.ts +4 -2
  126. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -1
  127. package/lib/typescript/components/typography/ButtonText.d.ts +2 -8
  128. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  129. package/lib/typescript/components/typography/Caption.d.ts +2 -8
  130. package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
  131. package/lib/typescript/components/typography/H1.d.ts +2 -8
  132. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  133. package/lib/typescript/components/typography/H2.d.ts +6 -10
  134. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  135. package/lib/typescript/components/typography/H3.d.ts +2 -8
  136. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  137. package/lib/typescript/components/typography/H4.d.ts +2 -8
  138. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  139. package/lib/typescript/components/typography/H5.d.ts +2 -8
  140. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  141. package/lib/typescript/components/typography/H6.d.ts +2 -8
  142. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  143. package/lib/typescript/components/typography/Hero.d.ts +2 -8
  144. package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
  145. package/lib/typescript/components/typography/IOText.d.ts +5 -5
  146. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  147. package/lib/typescript/components/typography/LabelMini.d.ts +4 -2
  148. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  149. package/lib/typescript/components/typography/markdown/MdH1.d.ts +2 -8
  150. package/lib/typescript/components/typography/markdown/MdH1.d.ts.map +1 -1
  151. package/lib/typescript/components/typography/markdown/MdH2.d.ts +2 -8
  152. package/lib/typescript/components/typography/markdown/MdH2.d.ts.map +1 -1
  153. package/lib/typescript/components/typography/markdown/MdH3.d.ts +2 -8
  154. package/lib/typescript/components/typography/markdown/MdH3.d.ts.map +1 -1
  155. package/lib/typescript/context/IOThemeContextProvider.d.ts.map +1 -1
  156. package/package.json +6 -7
  157. package/src/components/alert/Alert.tsx +108 -112
  158. package/src/components/banner/Banner.tsx +121 -125
  159. package/src/components/buttons/IOButton/IOButton.tsx +204 -216
  160. package/src/components/layout/ContentWrapper.tsx +21 -24
  161. package/src/components/otpInput/OTPInput.tsx +156 -167
  162. package/src/components/searchInput/SearchInput.tsx +208 -217
  163. package/src/components/tabs/TabItem.tsx +143 -146
  164. package/src/components/textInput/TextInputValidation.tsx +116 -122
  165. package/src/components/typography/Body.tsx +51 -52
  166. package/src/components/typography/BodyMonospace.tsx +19 -24
  167. package/src/components/typography/BodySmall.tsx +51 -52
  168. package/src/components/typography/ButtonText.tsx +14 -20
  169. package/src/components/typography/Caption.tsx +18 -23
  170. package/src/components/typography/H1.tsx +12 -20
  171. package/src/components/typography/H2.tsx +16 -23
  172. package/src/components/typography/H3.tsx +12 -20
  173. package/src/components/typography/H4.tsx +12 -20
  174. package/src/components/typography/H5.tsx +16 -24
  175. package/src/components/typography/H6.tsx +13 -21
  176. package/src/components/typography/Hero.tsx +14 -19
  177. package/src/components/typography/IOText.tsx +54 -59
  178. package/src/components/typography/LabelMini.tsx +45 -49
  179. package/src/components/typography/markdown/MdH1.tsx +14 -19
  180. package/src/components/typography/markdown/MdH2.tsx +14 -19
  181. package/src/components/typography/markdown/MdH3.tsx +14 -19
  182. package/src/context/IOThemeContextProvider.tsx +4 -12
@@ -1,4 +1,4 @@
1
- import { ForwardedRef, forwardRef } from "react";
1
+ import { Ref } from "react";
2
2
  import { Pressable, View } from "react-native";
3
3
  import { useIOTheme } from "../../context";
4
4
  import { IOFontWeight } from "../../utils/fonts";
@@ -9,7 +9,8 @@ import {
9
9
  TypographicStyleProps
10
10
  } from "./IOText";
11
11
 
12
- type BodyStyleProps = TypographicStyleProps & {
12
+ type BodyStyleProps = Omit<TypographicStyleProps, "ref"> & {
13
+ ref?: Ref<View>;
13
14
  weight?: Extract<IOFontWeight, "Regular" | "Semibold">;
14
15
  } & TypographicStyleAsLinkProps;
15
16
 
@@ -19,61 +20,59 @@ export const bodyLineHeight = 24;
19
20
  /**
20
21
  * `Body` typographic style
21
22
  */
22
- export const Body = forwardRef<View, BodyStyleProps>(
23
- (
24
- {
25
- weight: customWeight,
26
- color: customColor,
27
- asLink,
28
- avoidPressable,
29
- accessibilityRole = "link",
30
- textStyle: customTextStyle,
31
- onPress,
32
- ...props
33
- },
34
- ref?: ForwardedRef<View>
35
- ) => {
36
- const theme = useIOTheme();
23
+ export const Body = ({
24
+ ref,
25
+ weight: customWeight,
26
+ color: customColor,
27
+ asLink,
28
+ avoidPressable,
29
+ accessibilityRole = "link",
30
+ textStyle: customTextStyle,
31
+ onPress,
32
+ ...props
33
+ }: BodyStyleProps) => {
34
+ const theme = useIOTheme();
37
35
 
38
- const defaultColor = asLink
39
- ? theme["interactiveElem-default"]
40
- : theme["textBody-tertiary"];
36
+ const defaultColor = asLink
37
+ ? theme["interactiveElem-default"]
38
+ : theme["textBody-tertiary"];
41
39
 
42
- const BodyProps: IOTextProps = {
43
- ...props,
44
- dynamicTypeRamp: "body", // iOS only
45
- weight: customWeight || "Regular",
46
- size: bodyFontSize,
47
- lineHeight: bodyLineHeight,
48
- color: customColor ?? defaultColor,
49
- ...(asLink
50
- ? {
51
- accessibilityRole,
52
- textStyle: customTextStyle ?? { textDecorationLine: "underline" }
53
- }
54
- : {})
55
- };
56
-
57
- if (asLink && !avoidPressable) {
58
- return (
59
- <Pressable
60
- onPress={onPress}
61
- ref={ref}
62
- accessibilityRole={accessibilityRole}
63
- >
64
- <IOText {...BodyProps}>{props.children}</IOText>
65
- </Pressable>
66
- );
67
- }
40
+ const BodyProps: IOTextProps = {
41
+ ...props,
42
+ dynamicTypeRamp: "body", // iOS only
43
+ weight: customWeight || "Regular",
44
+ size: bodyFontSize,
45
+ lineHeight: bodyLineHeight,
46
+ color: customColor ?? defaultColor,
47
+ ...(asLink
48
+ ? {
49
+ accessibilityRole,
50
+ textStyle: customTextStyle ?? { textDecorationLine: "underline" }
51
+ }
52
+ : {})
53
+ };
68
54
 
55
+ if (asLink && !avoidPressable) {
56
+ // TODO: If Pressable is replaced with `onPress` on IOText, ref would
57
+ // always point to a Text node and the Ref<View> override in the prop
58
+ // type can be removed entirely.
69
59
  return (
70
- <IOText
60
+ <Pressable
61
+ onPress={onPress}
71
62
  ref={ref}
72
- {...BodyProps}
73
- onPress={asLink && avoidPressable ? onPress : undefined}
63
+ accessibilityRole={accessibilityRole}
74
64
  >
75
- {props.children}
76
- </IOText>
65
+ <IOText {...BodyProps}>{props.children}</IOText>
66
+ </Pressable>
77
67
  );
78
68
  }
79
- );
69
+
70
+ return (
71
+ <IOText
72
+ {...BodyProps}
73
+ onPress={asLink && avoidPressable ? onPress : undefined}
74
+ >
75
+ {props.children}
76
+ </IOText>
77
+ );
78
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { bodyFontSize, bodyLineHeight } from "./Body";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -7,27 +5,24 @@ import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
7
5
  /**
8
6
  * `BodyMonospace` typographic style
9
7
  */
10
- export const BodyMonospace = forwardRef<View, TypographicStyleProps>(
11
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
12
- const theme = useIOTheme();
8
+ export const BodyMonospace = ({
9
+ color: customColor,
10
+ ...props
11
+ }: TypographicStyleProps) => {
12
+ const theme = useIOTheme();
13
13
 
14
- const BodyProps: IOTextProps = {
15
- ...props,
16
- dynamicTypeRamp: "body", // iOS only
17
- font: "FiraCode",
18
- weight: "Medium",
19
- size: bodyFontSize,
20
- lineHeight: bodyLineHeight,
21
- color: customColor ?? theme["textBody-tertiary"],
22
- textStyle: {
23
- letterSpacing: 0.5
24
- }
25
- };
14
+ const BodyProps: IOTextProps = {
15
+ ...props,
16
+ dynamicTypeRamp: "body", // iOS only
17
+ font: "FiraCode",
18
+ weight: "Medium",
19
+ size: bodyFontSize,
20
+ lineHeight: bodyLineHeight,
21
+ color: customColor ?? theme["textBody-tertiary"],
22
+ textStyle: {
23
+ letterSpacing: 0.5
24
+ }
25
+ };
26
26
 
27
- return (
28
- <IOText ref={ref} {...BodyProps}>
29
- {props.children}
30
- </IOText>
31
- );
32
- }
33
- );
27
+ return <IOText {...BodyProps}>{props.children}</IOText>;
28
+ };
@@ -1,4 +1,4 @@
1
- import { ForwardedRef, forwardRef } from "react";
1
+ import { Ref } from "react";
2
2
  import { Pressable, View } from "react-native";
3
3
  import { useIOTheme } from "../../context";
4
4
  import { IOFontWeight } from "../../utils/fonts";
@@ -9,7 +9,8 @@ import {
9
9
  TypographicStyleProps
10
10
  } from "./IOText";
11
11
 
12
- type BodySmallProps = TypographicStyleProps & {
12
+ type BodySmallProps = Omit<TypographicStyleProps, "ref"> & {
13
+ ref?: Ref<View>;
13
14
  weight?: Extract<IOFontWeight, "Regular" | "Semibold">;
14
15
  } & TypographicStyleAsLinkProps;
15
16
 
@@ -19,61 +20,59 @@ export const bodySmallLineHeight = 21;
19
20
  /**
20
21
  * `BodySmall` typographic style
21
22
  */
22
- export const BodySmall = forwardRef<View, BodySmallProps>(
23
- (
24
- {
25
- weight: customWeight,
26
- color: customColor,
27
- asLink,
28
- avoidPressable,
29
- accessibilityRole = "link",
30
- textStyle: customTextStyle,
31
- onPress,
32
- ...props
33
- },
34
- ref?: ForwardedRef<View>
35
- ) => {
36
- const theme = useIOTheme();
23
+ export const BodySmall = ({
24
+ ref,
25
+ weight: customWeight,
26
+ color: customColor,
27
+ asLink,
28
+ avoidPressable,
29
+ accessibilityRole = "link",
30
+ textStyle: customTextStyle,
31
+ onPress,
32
+ ...props
33
+ }: BodySmallProps) => {
34
+ const theme = useIOTheme();
37
35
 
38
- const defaultColor = asLink
39
- ? theme["interactiveElem-default"]
40
- : theme["textBody-tertiary"];
36
+ const defaultColor = asLink
37
+ ? theme["interactiveElem-default"]
38
+ : theme["textBody-tertiary"];
41
39
 
42
- const BodySmallProps: IOTextProps = {
43
- ...props,
44
- dynamicTypeRamp: "footnote" /* iOS only */,
45
- weight: customWeight ?? "Regular",
46
- size: bodySmallFontSize,
47
- lineHeight: bodySmallLineHeight,
48
- color: customColor ?? defaultColor,
49
- ...(asLink
50
- ? {
51
- accessibilityRole,
52
- textStyle: customTextStyle ?? { textDecorationLine: "underline" }
53
- }
54
- : {})
55
- };
56
-
57
- if (asLink && !avoidPressable) {
58
- return (
59
- <Pressable
60
- onPress={onPress}
61
- ref={ref}
62
- accessibilityRole={accessibilityRole}
63
- >
64
- <IOText {...BodySmallProps}>{props.children}</IOText>
65
- </Pressable>
66
- );
67
- }
40
+ const BodySmallProps: IOTextProps = {
41
+ ...props,
42
+ dynamicTypeRamp: "footnote" /* iOS only */,
43
+ weight: customWeight ?? "Regular",
44
+ size: bodySmallFontSize,
45
+ lineHeight: bodySmallLineHeight,
46
+ color: customColor ?? defaultColor,
47
+ ...(asLink
48
+ ? {
49
+ accessibilityRole,
50
+ textStyle: customTextStyle ?? { textDecorationLine: "underline" }
51
+ }
52
+ : {})
53
+ };
68
54
 
55
+ if (asLink && !avoidPressable) {
56
+ // TODO: If Pressable is replaced with `onPress` on IOText, ref would
57
+ // always point to a Text node and the Ref<View> override in the prop
58
+ // type can be removed entirely.
69
59
  return (
70
- <IOText
60
+ <Pressable
61
+ onPress={onPress}
71
62
  ref={ref}
72
- {...BodySmallProps}
73
- onPress={asLink && avoidPressable ? onPress : undefined}
63
+ accessibilityRole={accessibilityRole}
74
64
  >
75
- {props.children}
76
- </IOText>
65
+ <IOText {...BodySmallProps}>{props.children}</IOText>
66
+ </Pressable>
77
67
  );
78
68
  }
79
- );
69
+
70
+ return (
71
+ <IOText
72
+ {...BodySmallProps}
73
+ onPress={asLink && avoidPressable ? onPress : undefined}
74
+ >
75
+ {props.children}
76
+ </IOText>
77
+ );
78
+ };
@@ -1,6 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
-
4
1
  import { IOColors } from "../../core";
5
2
  import { IOFontSize } from "../../utils/fonts";
6
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -15,22 +12,19 @@ const defaultColor: IOColors = "white";
15
12
  /**
16
13
  * `ButtonText` typographic style
17
14
  */
18
- export const ButtonText = forwardRef<View, TypographicStyleProps>(
19
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
20
- const ButtonTextProps: IOTextProps = {
21
- ...props,
22
- weight: "Semibold",
23
- size: buttonTextFontSize,
24
- lineHeight: buttonTextLineHeight,
25
- /* Needed to render `ButtonOutline` and`ButtonLink` because they use
15
+ export const ButtonText = ({
16
+ color: customColor,
17
+ ...props
18
+ }: TypographicStyleProps) => {
19
+ const ButtonTextProps: IOTextProps = {
20
+ ...props,
21
+ weight: "Semibold",
22
+ size: buttonTextFontSize,
23
+ lineHeight: buttonTextLineHeight,
24
+ /* Needed to render `ButtonOutline` and`ButtonLink` because they use
26
25
  `AnimatedText` for color transition through Reanimated */
27
- color: customColor ?? defaultColor
28
- };
26
+ color: customColor ?? defaultColor
27
+ };
29
28
 
30
- return (
31
- <IOText ref={ref} {...ButtonTextProps}>
32
- {props.children}
33
- </IOText>
34
- );
35
- }
36
- );
29
+ return <IOText {...ButtonTextProps}>{props.children}</IOText>;
30
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -9,26 +7,23 @@ export const captionFontSize: IOFontSize = 12;
9
7
  /**
10
8
  * `Caption` typographic style
11
9
  */
12
- export const Caption = forwardRef<View, TypographicStyleProps>(
13
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
14
- const theme = useIOTheme();
10
+ export const Caption = ({
11
+ color: customColor,
12
+ ...props
13
+ }: TypographicStyleProps) => {
14
+ const theme = useIOTheme();
15
15
 
16
- const CaptionProps: IOTextProps = {
17
- ...props,
18
- dynamicTypeRamp: "caption1", // iOS only
19
- weight: "Regular",
20
- size: captionFontSize,
21
- color: customColor ?? theme["textBody-default"],
22
- textStyle: {
23
- textTransform: "uppercase",
24
- letterSpacing: 0.5
25
- }
26
- };
16
+ const CaptionProps: IOTextProps = {
17
+ ...props,
18
+ dynamicTypeRamp: "caption1", // iOS only
19
+ weight: "Regular",
20
+ size: captionFontSize,
21
+ color: customColor ?? theme["textBody-default"],
22
+ textStyle: {
23
+ textTransform: "uppercase",
24
+ letterSpacing: 0.5
25
+ }
26
+ };
27
27
 
28
- return (
29
- <IOText ref={ref} {...CaptionProps}>
30
- {props.children}
31
- </IOText>
32
- );
33
- }
34
- );
28
+ return <IOText {...CaptionProps}>{props.children}</IOText>;
29
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -10,23 +8,17 @@ export const h1LineHeight = 42;
10
8
  /**
11
9
  * `H1` typographic style
12
10
  */
13
- export const H1 = forwardRef<View, TypographicStyleProps>(
14
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
15
- const theme = useIOTheme();
11
+ export const H1 = ({ color: customColor, ...props }: TypographicStyleProps) => {
12
+ const theme = useIOTheme();
16
13
 
17
- const H1Props: IOTextProps = {
18
- ...props,
19
- dynamicTypeRamp: "largeTitle", // iOS only
20
- weight: "Semibold",
21
- size: h1FontSize,
22
- lineHeight: h1LineHeight,
23
- color: customColor ?? theme["textHeading-default"]
24
- };
14
+ const H1Props: IOTextProps = {
15
+ ...props,
16
+ dynamicTypeRamp: "largeTitle", // iOS only
17
+ weight: "Semibold",
18
+ size: h1FontSize,
19
+ lineHeight: h1LineHeight,
20
+ color: customColor ?? theme["textHeading-default"]
21
+ };
25
22
 
26
- return (
27
- <IOText ref={ref} {...H1Props}>
28
- {props.children}
29
- </IOText>
30
- );
31
- }
32
- );
23
+ return <IOText {...H1Props}>{props.children}</IOText>;
24
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize, IOFontWeight } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -14,26 +12,21 @@ export const h2LineHeight = 34;
14
12
  /**
15
13
  * `H2` typographic style
16
14
  */
17
- export const H2 = forwardRef<View, H2StyleProps>(
18
- (
19
- { weight: customWeight, color: customColor, ...props },
20
- ref?: ForwardedRef<View>
21
- ) => {
22
- const theme = useIOTheme();
15
+ export const H2 = ({
16
+ weight: customWeight,
17
+ color: customColor,
18
+ ...props
19
+ }: H2StyleProps) => {
20
+ const theme = useIOTheme();
23
21
 
24
- const H2Props: IOTextProps = {
25
- ...props,
26
- dynamicTypeRamp: "title1", // iOS only
27
- weight: customWeight ?? "Semibold",
28
- size: h2FontSize,
29
- lineHeight: h2LineHeight,
30
- color: customColor ?? theme["textHeading-default"]
31
- };
22
+ const H2Props: IOTextProps = {
23
+ ...props,
24
+ dynamicTypeRamp: "title1", // iOS only
25
+ weight: customWeight ?? "Semibold",
26
+ size: h2FontSize,
27
+ lineHeight: h2LineHeight,
28
+ color: customColor ?? theme["textHeading-default"]
29
+ };
32
30
 
33
- return (
34
- <IOText ref={ref} {...H2Props}>
35
- {props.children}
36
- </IOText>
37
- );
38
- }
39
- );
31
+ return <IOText {...H2Props}>{props.children}</IOText>;
32
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -11,23 +9,17 @@ export const h3LineHeight = 33;
11
9
  /**
12
10
  * `H3` typographic style
13
11
  */
14
- export const H3 = forwardRef<View, TypographicStyleProps>(
15
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
16
- const theme = useIOTheme();
12
+ export const H3 = ({ color: customColor, ...props }: TypographicStyleProps) => {
13
+ const theme = useIOTheme();
17
14
 
18
- const H3Props: IOTextProps = {
19
- ...props,
20
- dynamicTypeRamp: "title2", // iOS only
21
- weight: "Semibold",
22
- size: h3FontSize,
23
- lineHeight: h3LineHeight,
24
- color: customColor ?? theme["textHeading-default"]
25
- };
15
+ const H3Props: IOTextProps = {
16
+ ...props,
17
+ dynamicTypeRamp: "title2", // iOS only
18
+ weight: "Semibold",
19
+ size: h3FontSize,
20
+ lineHeight: h3LineHeight,
21
+ color: customColor ?? theme["textHeading-default"]
22
+ };
26
23
 
27
- return (
28
- <IOText ref={ref} {...H3Props}>
29
- {props.children}
30
- </IOText>
31
- );
32
- }
33
- );
24
+ return <IOText {...H3Props}>{props.children}</IOText>;
25
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -10,23 +8,17 @@ export const h4LineHeight = 24;
10
8
  /**
11
9
  * `H4` typographic style
12
10
  */
13
- export const H4 = forwardRef<View, TypographicStyleProps>(
14
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
15
- const theme = useIOTheme();
11
+ export const H4 = ({ color: customColor, ...props }: TypographicStyleProps) => {
12
+ const theme = useIOTheme();
16
13
 
17
- const H4Props: IOTextProps = {
18
- ...props,
19
- dynamicTypeRamp: "title3", // iOS only
20
- weight: "Semibold",
21
- size: h4FontSize,
22
- lineHeight: h4LineHeight,
23
- color: customColor ?? theme["textHeading-default"]
24
- };
14
+ const H4Props: IOTextProps = {
15
+ ...props,
16
+ dynamicTypeRamp: "title3", // iOS only
17
+ weight: "Semibold",
18
+ size: h4FontSize,
19
+ lineHeight: h4LineHeight,
20
+ color: customColor ?? theme["textHeading-default"]
21
+ };
25
22
 
26
- return (
27
- <IOText ref={ref} {...H4Props}>
28
- {props.children}
29
- </IOText>
30
- );
31
- }
32
- );
23
+ return <IOText {...H4Props}>{props.children}</IOText>;
24
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -10,27 +8,21 @@ export const h5LineHeight = 16;
10
8
  /**
11
9
  * `H5` typographic style
12
10
  */
13
- export const H5 = forwardRef<View, TypographicStyleProps>(
14
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
15
- const theme = useIOTheme();
11
+ export const H5 = ({ color: customColor, ...props }: TypographicStyleProps) => {
12
+ const theme = useIOTheme();
16
13
 
17
- const H5Props: IOTextProps = {
18
- ...props,
19
- dynamicTypeRamp: "subheadline", // iOS only
20
- weight: "Semibold",
21
- size: h5FontSize,
22
- lineHeight: h5LineHeight,
23
- color: customColor ?? theme["textHeading-default"],
24
- textStyle: {
25
- textTransform: "uppercase",
26
- letterSpacing: 0.5
27
- }
28
- };
14
+ const H5Props: IOTextProps = {
15
+ ...props,
16
+ dynamicTypeRamp: "subheadline", // iOS only
17
+ weight: "Semibold",
18
+ size: h5FontSize,
19
+ lineHeight: h5LineHeight,
20
+ color: customColor ?? theme["textHeading-default"],
21
+ textStyle: {
22
+ textTransform: "uppercase",
23
+ letterSpacing: 0.5
24
+ }
25
+ };
29
26
 
30
- return (
31
- <IOText ref={ref} {...H5Props}>
32
- {props.children}
33
- </IOText>
34
- );
35
- }
36
- );
27
+ return <IOText {...H5Props}>{props.children}</IOText>;
28
+ };
@@ -1,5 +1,3 @@
1
- import { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
1
  import { useIONewTypeface, useIOTheme } from "../../context";
4
2
  import { IOFontSize } from "../../utils/fonts";
5
3
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
@@ -13,24 +11,18 @@ const legacyFontSize: IOFontSize = 17;
13
11
  /**
14
12
  * `H6` typographic style
15
13
  */
16
- export const H6 = forwardRef<View, TypographicStyleProps>(
17
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
18
- const theme = useIOTheme();
19
- const { newTypefaceEnabled } = useIONewTypeface();
14
+ export const H6 = ({ color: customColor, ...props }: TypographicStyleProps) => {
15
+ const theme = useIOTheme();
16
+ const { newTypefaceEnabled } = useIONewTypeface();
20
17
 
21
- const H6Props: IOTextProps = {
22
- ...props,
23
- dynamicTypeRamp: "headline", // iOS only
24
- weight: "Semibold",
25
- size: newTypefaceEnabled ? h6FontSize : legacyFontSize,
26
- lineHeight: h6LineHeight,
27
- color: customColor ?? theme["textHeading-default"]
28
- };
18
+ const H6Props: IOTextProps = {
19
+ ...props,
20
+ dynamicTypeRamp: "headline", // iOS only
21
+ weight: "Semibold",
22
+ size: newTypefaceEnabled ? h6FontSize : legacyFontSize,
23
+ lineHeight: h6LineHeight,
24
+ color: customColor ?? theme["textHeading-default"]
25
+ };
29
26
 
30
- return (
31
- <IOText ref={ref} {...H6Props}>
32
- {props.children}
33
- </IOText>
34
- );
35
- }
36
- );
27
+ return <IOText {...H6Props}>{props.children}</IOText>;
28
+ };