@pagopa/io-app-design-system 2.0.3 → 2.1.0-2

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 (210) hide show
  1. package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  2. package/lib/commonjs/components/badge/Badge.js +2 -2
  3. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  4. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -2
  5. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  6. package/lib/commonjs/components/buttons/ButtonLink.js +2 -2
  7. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  8. package/lib/commonjs/components/buttons/ButtonOutline.js +2 -2
  9. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  10. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -6
  11. package/lib/commonjs/components/layout/HeaderSecondLevel.js +2 -2
  12. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  13. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +3 -3
  14. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  15. package/lib/commonjs/components/listitems/ListItemTransaction.js +3 -2
  16. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  17. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +37 -37
  18. package/lib/commonjs/components/modules/ModuleAttachment.js +2 -1
  19. package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
  20. package/lib/commonjs/components/modules/ModuleCredential.js +2 -1
  21. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  22. package/lib/commonjs/components/modules/ModuleIDP.js +2 -2
  23. package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
  24. package/lib/commonjs/components/modules/ModuleNavigation.js +2 -1
  25. package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
  26. package/lib/commonjs/components/modules/ModulePaymentNotice.js +3 -2
  27. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  28. package/lib/commonjs/components/searchInput/SearchInput.js +1 -1
  29. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  30. package/lib/commonjs/components/tag/Tag.js +2 -2
  31. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  32. package/lib/commonjs/components/textInput/TextInputBase.js +1 -1
  33. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  34. package/lib/commonjs/components/typography/Body.js +10 -3
  35. package/lib/commonjs/components/typography/Body.js.map +1 -1
  36. package/lib/commonjs/components/typography/ButtonText.js +2 -2
  37. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  38. package/lib/commonjs/components/typography/Caption.js +1 -1
  39. package/lib/commonjs/components/typography/Caption.js.map +1 -1
  40. package/lib/commonjs/components/typography/Chip.js +1 -1
  41. package/lib/commonjs/components/typography/Chip.js.map +1 -1
  42. package/lib/commonjs/components/typography/H1.js +4 -6
  43. package/lib/commonjs/components/typography/H1.js.map +1 -1
  44. package/lib/commonjs/components/typography/H2.js +2 -2
  45. package/lib/commonjs/components/typography/H2.js.map +1 -1
  46. package/lib/commonjs/components/typography/H3.js +2 -2
  47. package/lib/commonjs/components/typography/H3.js.map +1 -1
  48. package/lib/commonjs/components/typography/H4.js +2 -2
  49. package/lib/commonjs/components/typography/H4.js.map +1 -1
  50. package/lib/commonjs/components/typography/H5.js +9 -2
  51. package/lib/commonjs/components/typography/H5.js.map +1 -1
  52. package/lib/commonjs/components/typography/H6.js +5 -7
  53. package/lib/commonjs/components/typography/H6.js.map +1 -1
  54. package/lib/commonjs/components/typography/Hero.js +2 -2
  55. package/lib/commonjs/components/typography/Hero.js.map +1 -1
  56. package/lib/commonjs/components/typography/Label.js +10 -2
  57. package/lib/commonjs/components/typography/Label.js.map +1 -1
  58. package/lib/commonjs/components/typography/LabelMini.js +10 -2
  59. package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
  60. package/lib/commonjs/components/typography/LabelSmall.js +10 -2
  61. package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
  62. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +5 -5
  63. package/lib/commonjs/components/typography/index.js +0 -11
  64. package/lib/commonjs/components/typography/index.js.map +1 -1
  65. package/lib/commonjs/components/typography/markdown/MdH1.js +2 -2
  66. package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
  67. package/lib/commonjs/components/typography/markdown/MdH2.js +3 -5
  68. package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
  69. package/lib/commonjs/components/typography/markdown/MdH3.js +2 -2
  70. package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
  71. package/lib/commonjs/utils/fonts.js +10 -8
  72. package/lib/commonjs/utils/fonts.js.map +1 -1
  73. package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  74. package/lib/module/components/badge/Badge.js +2 -2
  75. package/lib/module/components/badge/Badge.js.map +1 -1
  76. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -2
  77. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  78. package/lib/module/components/buttons/ButtonLink.js +2 -2
  79. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  80. package/lib/module/components/buttons/ButtonOutline.js +2 -2
  81. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  82. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -6
  83. package/lib/module/components/layout/HeaderSecondLevel.js +2 -2
  84. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  85. package/lib/module/components/listitems/ListItemRadioWithAmount.js +3 -3
  86. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  87. package/lib/module/components/listitems/ListItemTransaction.js +4 -3
  88. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  89. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +37 -37
  90. package/lib/module/components/modules/ModuleAttachment.js +3 -2
  91. package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
  92. package/lib/module/components/modules/ModuleCredential.js +3 -2
  93. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  94. package/lib/module/components/modules/ModuleIDP.js +2 -2
  95. package/lib/module/components/modules/ModuleIDP.js.map +1 -1
  96. package/lib/module/components/modules/ModuleNavigation.js +3 -2
  97. package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
  98. package/lib/module/components/modules/ModulePaymentNotice.js +4 -3
  99. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  100. package/lib/module/components/searchInput/SearchInput.js +1 -1
  101. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  102. package/lib/module/components/tag/Tag.js +2 -2
  103. package/lib/module/components/tag/Tag.js.map +1 -1
  104. package/lib/module/components/textInput/TextInputBase.js +1 -1
  105. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  106. package/lib/module/components/typography/Body.js +10 -3
  107. package/lib/module/components/typography/Body.js.map +1 -1
  108. package/lib/module/components/typography/ButtonText.js +2 -2
  109. package/lib/module/components/typography/ButtonText.js.map +1 -1
  110. package/lib/module/components/typography/Caption.js +1 -1
  111. package/lib/module/components/typography/Caption.js.map +1 -1
  112. package/lib/module/components/typography/Chip.js +1 -1
  113. package/lib/module/components/typography/Chip.js.map +1 -1
  114. package/lib/module/components/typography/H1.js +4 -6
  115. package/lib/module/components/typography/H1.js.map +1 -1
  116. package/lib/module/components/typography/H2.js +2 -2
  117. package/lib/module/components/typography/H2.js.map +1 -1
  118. package/lib/module/components/typography/H3.js +2 -2
  119. package/lib/module/components/typography/H3.js.map +1 -1
  120. package/lib/module/components/typography/H4.js +2 -2
  121. package/lib/module/components/typography/H4.js.map +1 -1
  122. package/lib/module/components/typography/H5.js +10 -3
  123. package/lib/module/components/typography/H5.js.map +1 -1
  124. package/lib/module/components/typography/H6.js +5 -7
  125. package/lib/module/components/typography/H6.js.map +1 -1
  126. package/lib/module/components/typography/Hero.js +2 -2
  127. package/lib/module/components/typography/Hero.js.map +1 -1
  128. package/lib/module/components/typography/Label.js +11 -3
  129. package/lib/module/components/typography/Label.js.map +1 -1
  130. package/lib/module/components/typography/LabelMini.js +11 -3
  131. package/lib/module/components/typography/LabelMini.js.map +1 -1
  132. package/lib/module/components/typography/LabelSmall.js +11 -3
  133. package/lib/module/components/typography/LabelSmall.js.map +1 -1
  134. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +5 -5
  135. package/lib/module/components/typography/index.js +0 -1
  136. package/lib/module/components/typography/index.js.map +1 -1
  137. package/lib/module/components/typography/markdown/MdH1.js +2 -2
  138. package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
  139. package/lib/module/components/typography/markdown/MdH2.js +3 -5
  140. package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
  141. package/lib/module/components/typography/markdown/MdH3.js +2 -2
  142. package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
  143. package/lib/module/utils/fonts.js +10 -8
  144. package/lib/module/utils/fonts.js.map +1 -1
  145. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  146. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  147. package/lib/typescript/components/modules/ModuleAttachment.d.ts.map +1 -1
  148. package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
  149. package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
  150. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
  151. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  152. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  153. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  154. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  155. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  156. package/lib/typescript/components/typography/Label.d.ts.map +1 -1
  157. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  158. package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
  159. package/lib/typescript/components/typography/index.d.ts +0 -1
  160. package/lib/typescript/components/typography/index.d.ts.map +1 -1
  161. package/lib/typescript/components/typography/markdown/MdH2.d.ts.map +1 -1
  162. package/lib/typescript/utils/fonts.d.ts +7 -7
  163. package/lib/typescript/utils/fonts.d.ts.map +1 -1
  164. package/package.json +1 -1
  165. package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  166. package/src/components/badge/Badge.tsx +2 -2
  167. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -2
  168. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +6 -6
  169. package/src/components/buttons/ButtonLink.tsx +2 -2
  170. package/src/components/buttons/ButtonOutline.tsx +2 -2
  171. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -6
  172. package/src/components/layout/HeaderSecondLevel.tsx +2 -2
  173. package/src/components/listitems/ListItemRadioWithAmount.tsx +7 -4
  174. package/src/components/listitems/ListItemTransaction.tsx +4 -3
  175. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +37 -37
  176. package/src/components/modules/ModuleAttachment.tsx +4 -3
  177. package/src/components/modules/ModuleCredential.tsx +4 -3
  178. package/src/components/modules/ModuleIDP.tsx +2 -2
  179. package/src/components/modules/ModuleNavigation.tsx +4 -3
  180. package/src/components/modules/ModulePaymentNotice.tsx +4 -3
  181. package/src/components/searchInput/SearchInput.tsx +1 -1
  182. package/src/components/tag/Tag.tsx +2 -2
  183. package/src/components/textInput/TextInputBase.tsx +1 -6
  184. package/src/components/typography/Body.tsx +15 -4
  185. package/src/components/typography/ButtonText.tsx +2 -2
  186. package/src/components/typography/Caption.tsx +1 -1
  187. package/src/components/typography/Chip.tsx +1 -1
  188. package/src/components/typography/H1.tsx +4 -6
  189. package/src/components/typography/H2.tsx +2 -2
  190. package/src/components/typography/H3.tsx +2 -2
  191. package/src/components/typography/H4.tsx +2 -2
  192. package/src/components/typography/H5.tsx +11 -4
  193. package/src/components/typography/H6.tsx +5 -7
  194. package/src/components/typography/Hero.tsx +2 -2
  195. package/src/components/typography/Label.tsx +15 -4
  196. package/src/components/typography/LabelMini.tsx +15 -4
  197. package/src/components/typography/LabelSmall.tsx +15 -4
  198. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +5 -5
  199. package/src/components/typography/index.tsx +0 -1
  200. package/src/components/typography/markdown/MdH1.tsx +2 -2
  201. package/src/components/typography/markdown/MdH2.tsx +3 -5
  202. package/src/components/typography/markdown/MdH3.tsx +2 -2
  203. package/src/utils/fonts.ts +20 -10
  204. package/lib/commonjs/components/typography/LabelSmallAlt.js +0 -48
  205. package/lib/commonjs/components/typography/LabelSmallAlt.js.map +0 -1
  206. package/lib/module/components/typography/LabelSmallAlt.js +0 -39
  207. package/lib/module/components/typography/LabelSmallAlt.js.map +0 -1
  208. package/lib/typescript/components/typography/LabelSmallAlt.d.ts +0 -13
  209. package/lib/typescript/components/typography/LabelSmallAlt.d.ts.map +0 -1
  210. package/src/components/typography/LabelSmallAlt.tsx +0 -41
@@ -1,11 +1,17 @@
1
1
  import React, { ForwardedRef, forwardRef } from "react";
2
2
  import { View } from "react-native";
3
- import { IOTheme, useIOTheme } from "../../core";
4
- import { IOFontSize } from "../../utils/fonts";
3
+ import { IOTheme, useIOExperimentalDesign, useIOTheme } from "../../core";
4
+ import { IOFontFamily, IOFontSize, IOFontWeight } from "../../utils/fonts";
5
5
  import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
6
6
 
7
7
  const defaultColor: keyof IOTheme = "textHeading-default";
8
8
 
9
+ const fontName: IOFontFamily = "Titillio";
10
+ const fontWeight: IOFontWeight = "Semibold";
11
+
12
+ const legacyFontName: IOFontFamily = "TitilliumSansPro";
13
+ const legacyFontWeight: IOFontWeight = "Semibold";
14
+
9
15
  export const h5FontSize: IOFontSize = 14;
10
16
  export const h5LineHeight = 16;
11
17
 
@@ -15,12 +21,13 @@ export const h5LineHeight = 16;
15
21
  export const H5 = forwardRef<View, TypographicStyleProps>(
16
22
  ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
17
23
  const theme = useIOTheme();
24
+ const { isExperimental } = useIOExperimentalDesign();
18
25
 
19
26
  const H5Props: IOTextProps = {
20
27
  ...props,
21
28
  dynamicTypeRamp: "subheadline", // iOS only
22
- font: "TitilliumSansPro",
23
- weight: "Semibold",
29
+ font: isExperimental ? fontName : legacyFontName,
30
+ weight: isExperimental ? fontWeight : legacyFontWeight,
24
31
  size: h5FontSize,
25
32
  lineHeight: h5LineHeight,
26
33
  color: customColor ?? theme[defaultColor],
@@ -6,14 +6,12 @@ import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
6
6
 
7
7
  const defaultColor: keyof IOTheme = "textHeading-default";
8
8
 
9
- export const h6FontSize: IOFontSize = 16;
9
+ export const h6FontSize: IOFontSize = 18;
10
10
  export const h6LineHeight = 24;
11
- const fontName: IOFontFamily = "ReadexPro";
12
- const fontWeight: IOFontWeight = "Regular";
11
+ const fontName: IOFontFamily = "Titillio";
12
+ const fontWeight: IOFontWeight = "Semibold";
13
13
 
14
14
  // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
15
- const legacyFontSize: IOFontSize = 18;
16
- const legacyLineHeight = 25;
17
15
  const legacyFontName: IOFontFamily = "TitilliumSansPro";
18
16
  const legacyFontWeight: IOFontWeight = "Semibold";
19
17
 
@@ -29,8 +27,8 @@ export const H6 = forwardRef<View, TypographicStyleProps>(
29
27
  ...props,
30
28
  dynamicTypeRamp: "headline", // iOS only
31
29
  font: isExperimental ? fontName : legacyFontName,
32
- size: isExperimental ? h6FontSize : legacyFontSize,
33
- lineHeight: isExperimental ? h6LineHeight : legacyLineHeight,
30
+ size: h6FontSize,
31
+ lineHeight: h6LineHeight,
34
32
  weight: isExperimental ? fontWeight : legacyFontWeight,
35
33
  color: customColor ?? theme[defaultColor]
36
34
  };
@@ -8,8 +8,8 @@ const defaultColor: keyof IOTheme = "textHeading-default";
8
8
 
9
9
  export const heroFontSize: IOFontSize = 32;
10
10
  export const heroLineHeight = 48;
11
- const fontName: IOFontFamily = "ReadexPro";
12
- const fontWeight: IOFontWeight = "Regular";
11
+ const fontName: IOFontFamily = "Titillio";
12
+ const fontWeight: IOFontWeight = "Semibold";
13
13
 
14
14
  // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
15
15
  const legacyHeroFontSize: IOFontSize = 35;
@@ -1,7 +1,7 @@
1
1
  import React, { ForwardedRef, forwardRef } from "react";
2
2
  import { View } from "react-native";
3
- import { useIOTheme } from "../../core";
4
- import { IOFontWeight } from "../../utils/fonts";
3
+ import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
+ import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
5
5
  import {
6
6
  IOText,
7
7
  IOTextProps,
@@ -13,6 +13,12 @@ type LabelProps = TypographicStyleProps & {
13
13
  weight?: Extract<IOFontWeight, "Regular" | "Semibold" | "Bold">;
14
14
  } & TypographicStyleAsLinkProps;
15
15
 
16
+ const fontName: IOFontFamily = "Titillio";
17
+ const fontWeight: IOFontWeight = "Semibold";
18
+
19
+ const legacyFontName: IOFontFamily = "TitilliumSansPro";
20
+ const legacyFontWeight: IOFontWeight = "Semibold";
21
+
16
22
  /**
17
23
  * `LabelSmall` typographic style
18
24
  */
@@ -22,6 +28,7 @@ export const Label = forwardRef<View, LabelProps>(
22
28
  ref?: ForwardedRef<View>
23
29
  ) => {
24
30
  const theme = useIOTheme();
31
+ const { isExperimental } = useIOExperimentalDesign();
25
32
 
26
33
  const defaultColor = asLink
27
34
  ? theme["interactiveElem-default"]
@@ -29,8 +36,12 @@ export const Label = forwardRef<View, LabelProps>(
29
36
 
30
37
  const LabelProps: IOTextProps = {
31
38
  ...props,
32
- font: "TitilliumSansPro",
33
- weight: customWeight ?? "Semibold",
39
+ font: isExperimental ? fontName : legacyFontName,
40
+ weight: customWeight
41
+ ? customWeight
42
+ : isExperimental
43
+ ? fontWeight
44
+ : legacyFontWeight,
34
45
  size: 16,
35
46
  lineHeight: 24,
36
47
  color: customColor ?? defaultColor,
@@ -1,7 +1,7 @@
1
1
  import React, { ForwardedRef, forwardRef } from "react";
2
2
  import { View } from "react-native";
3
- import { useIOTheme } from "../../core";
4
- import { IOFontWeight } from "../../utils/fonts";
3
+ import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
+ import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
5
5
  import {
6
6
  IOText,
7
7
  IOTextProps,
@@ -13,6 +13,12 @@ type LabelMiniProps = TypographicStyleProps & {
13
13
  weight?: Extract<IOFontWeight, "Regular" | "Semibold" | "Bold">;
14
14
  } & TypographicStyleAsLinkProps;
15
15
 
16
+ const fontName: IOFontFamily = "Titillio";
17
+ const fontWeight: IOFontWeight = "Semibold";
18
+
19
+ const legacyFontName: IOFontFamily = "TitilliumSansPro";
20
+ const legacyFontWeight: IOFontWeight = "Semibold";
21
+
16
22
  /**
17
23
  * `LabelMini` typographic style
18
24
  */
@@ -22,6 +28,7 @@ export const LabelMini = forwardRef<View, LabelMiniProps>(
22
28
  ref?: ForwardedRef<View>
23
29
  ) => {
24
30
  const theme = useIOTheme();
31
+ const { isExperimental } = useIOExperimentalDesign();
25
32
 
26
33
  const defaultColor = asLink
27
34
  ? theme["interactiveElem-default"]
@@ -30,8 +37,12 @@ export const LabelMini = forwardRef<View, LabelMiniProps>(
30
37
  const LabelMiniProps: IOTextProps = {
31
38
  ...props,
32
39
  dynamicTypeRamp: "footnote" /* iOS only */,
33
- font: "TitilliumSansPro",
34
- weight: customWeight ?? "Semibold",
40
+ font: isExperimental ? fontName : legacyFontName,
41
+ weight: customWeight
42
+ ? customWeight
43
+ : isExperimental
44
+ ? fontWeight
45
+ : legacyFontWeight,
35
46
  size: 12,
36
47
  lineHeight: 18,
37
48
  color: customColor ?? defaultColor,
@@ -1,7 +1,7 @@
1
1
  import React, { ForwardedRef, forwardRef } from "react";
2
2
  import { View } from "react-native";
3
- import { useIOTheme } from "../../core";
4
- import { IOFontWeight } from "../../utils/fonts";
3
+ import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
+ import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
5
5
  import {
6
6
  IOText,
7
7
  IOTextProps,
@@ -13,6 +13,12 @@ type LabelSmallProps = TypographicStyleProps & {
13
13
  weight?: Extract<IOFontWeight, "Regular" | "Semibold" | "Bold">;
14
14
  } & TypographicStyleAsLinkProps;
15
15
 
16
+ const fontName: IOFontFamily = "Titillio";
17
+ const fontWeight: IOFontWeight = "Semibold";
18
+
19
+ const legacyFontName: IOFontFamily = "TitilliumSansPro";
20
+ const legacyFontWeight: IOFontWeight = "Semibold";
21
+
16
22
  /**
17
23
  * `LabelSmall` typographic style
18
24
  */
@@ -22,6 +28,7 @@ export const LabelSmall = forwardRef<View, LabelSmallProps>(
22
28
  ref?: ForwardedRef<View>
23
29
  ) => {
24
30
  const theme = useIOTheme();
31
+ const { isExperimental } = useIOExperimentalDesign();
25
32
 
26
33
  const defaultColor = asLink
27
34
  ? theme["interactiveElem-default"]
@@ -30,8 +37,12 @@ export const LabelSmall = forwardRef<View, LabelSmallProps>(
30
37
  const LabelSmallProps: IOTextProps = {
31
38
  ...props,
32
39
  dynamicTypeRamp: "footnote" /* iOS only */,
33
- font: "TitilliumSansPro",
34
- weight: customWeight ?? "Semibold",
40
+ font: isExperimental ? fontName : legacyFontName,
41
+ weight: customWeight
42
+ ? customWeight
43
+ : isExperimental
44
+ ? fontWeight
45
+ : legacyFontWeight,
35
46
  size: 14,
36
47
  lineHeight: 21,
37
48
  color: customColor ?? defaultColor,
@@ -81,10 +81,10 @@ exports[`Test Typography Components H1 Snapshot 1`] = `
81
81
  {
82
82
  "color": "#0E0F13",
83
83
  "fontFamily": "Titillium Sans Pro",
84
- "fontSize": 31,
84
+ "fontSize": 28,
85
85
  "fontStyle": "normal",
86
86
  "fontWeight": "600",
87
- "lineHeight": 43,
87
+ "lineHeight": 42,
88
88
  },
89
89
  ]
90
90
  }
@@ -104,10 +104,10 @@ exports[`Test Typography Components H1 Snapshot 2`] = `
104
104
  {
105
105
  "color": "#FFFFFF",
106
106
  "fontFamily": "Titillium Sans Pro",
107
- "fontSize": 31,
107
+ "fontSize": 28,
108
108
  "fontStyle": "normal",
109
109
  "fontWeight": "600",
110
- "lineHeight": 43,
110
+ "lineHeight": 42,
111
111
  },
112
112
  ]
113
113
  }
@@ -441,7 +441,7 @@ exports[`Test Typography Components H6 Snapshot 1`] = `
441
441
  "fontSize": 18,
442
442
  "fontStyle": "normal",
443
443
  "fontWeight": "600",
444
- "lineHeight": 25,
444
+ "lineHeight": 24,
445
445
  },
446
446
  ]
447
447
  }
@@ -14,7 +14,6 @@ export * from "./H6";
14
14
  export * from "./Hero";
15
15
  export * from "./Label";
16
16
  export * from "./LabelSmall";
17
- export * from "./LabelSmallAlt";
18
17
  export * from "./LabelMini";
19
18
  export * from "./BodyMonospace";
20
19
  export * from "./common";
@@ -14,8 +14,8 @@ export const MdH1 = forwardRef<View, TypographicStyleProps>(
14
14
 
15
15
  const MdH1Props: IOTextProps = {
16
16
  ...props,
17
- font: isExperimental ? "ReadexPro" : "TitilliumSansPro",
18
- weight: isExperimental ? "Regular" : "Semibold",
17
+ font: isExperimental ? "Titillio" : "TitilliumSansPro",
18
+ weight: "Semibold",
19
19
  size: 20,
20
20
  lineHeight: 24,
21
21
  color: customColor ?? theme["textHeading-tertiary"]
@@ -13,11 +13,9 @@ export const MdH2 = forwardRef<View, TypographicStyleProps>(
13
13
 
14
14
  const MdH2Props: IOTextProps = {
15
15
  ...props,
16
- font: isExperimental ? "ReadexPro" : "TitilliumSansPro",
17
- weight: isExperimental ? "Regular" : "Semibold",
18
- /* We set 18 instead of 16 to diffrentiate from the H3 typographic style.
19
- It should be 16 with `SemiBold` font weight. */
20
- size: 18,
16
+ font: isExperimental ? "Titillio" : "TitilliumSansPro",
17
+ weight: "Semibold",
18
+ size: 16,
21
19
  lineHeight: 24,
22
20
  color: customColor ?? theme["textHeading-tertiary"]
23
21
  };
@@ -13,8 +13,8 @@ export const MdH3 = forwardRef<View, TypographicStyleProps>(
13
13
 
14
14
  const MdH3Props: IOTextProps = {
15
15
  ...props,
16
- font: isExperimental ? "ReadexPro" : "TitilliumSansPro",
17
- weight: isExperimental ? "Regular" : "Semibold",
16
+ font: isExperimental ? "Titillio" : "TitilliumSansPro",
17
+ weight: "Regular",
18
18
  size: 16,
19
19
  lineHeight: 24,
20
20
  color: customColor ?? theme["textHeading-tertiary"]
@@ -16,11 +16,11 @@ const fonts = {
16
16
  ios: "Titillium Sans Pro",
17
17
  default: "TitilliumSansPro"
18
18
  }),
19
- ReadexPro: Platform.select({
20
- android: "ReadexPro",
21
- web: "ReadexPro",
22
- ios: "Readex Pro",
23
- default: "ReadexPro"
19
+ Titillio: Platform.select({
20
+ android: "Titillio",
21
+ web: "Titillio",
22
+ ios: "Titillio",
23
+ default: "Titillio"
24
24
  }),
25
25
  DMMono: Platform.select({
26
26
  android: "DMMono",
@@ -28,7 +28,7 @@ const fonts = {
28
28
  ios: "DM Mono",
29
29
  default: "DMMono"
30
30
  })
31
- };
31
+ } as const;
32
32
 
33
33
  export type IOFontFamily = keyof typeof fonts;
34
34
 
@@ -44,10 +44,18 @@ export type IOFontSize = (typeof allFontSizes)[number];
44
44
  * Font Weights
45
45
  */
46
46
 
47
- const weights = ["Light", "Regular", "Medium", "Semibold", "Bold"] as const;
47
+ const weights = [
48
+ "Thin",
49
+ "Light",
50
+ "Regular",
51
+ "Medium",
52
+ "Semibold",
53
+ "Bold",
54
+ "Black"
55
+ ] as const;
48
56
  export type IOFontWeight = (typeof weights)[number];
49
57
 
50
- const weightValues = ["300", "400", "500", "600", "700"] as const;
58
+ const weightValues = ["200", "300", "400", "500", "600", "700", "900"] as const;
51
59
  export type IOFontWeightNumeric = (typeof weightValues)[number];
52
60
 
53
61
  /**
@@ -55,11 +63,13 @@ export type IOFontWeightNumeric = (typeof weightValues)[number];
55
63
  * used on iOS
56
64
  */
57
65
  export const fontWeights: Record<IOFontWeight, IOFontWeightNumeric> = {
66
+ Thin: "200",
58
67
  Light: "300",
59
68
  Regular: "400",
60
69
  Medium: "500",
61
70
  Semibold: "600",
62
- Bold: "700"
71
+ Bold: "700",
72
+ Black: "900"
63
73
  };
64
74
 
65
75
  type FontStyleObject = {
@@ -96,7 +106,7 @@ export const makeFontFamilyName = (
96
106
  font: IOFontFamily,
97
107
  weight: IOFontWeight = defaultWeight,
98
108
  fontStyle: TextStyle["fontStyle"] = "normal"
99
- ): FontStyleObject["fontFamily"] =>
109
+ ): string =>
100
110
  Platform.select({
101
111
  web: fonts[font],
102
112
  android: `${fonts[font]}-${weight || "Regular"}${
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.LabelSmallAlt = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _core = require("../../core");
9
- var _IOText = require("./IOText");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- const fontSize = 14;
14
- const lineHeight = 21;
15
- const fontName = "ReadexPro";
16
- const fontWeight = "Regular";
17
-
18
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
19
- const legacyFontSize = 16;
20
- const legacyFontName = "TitilliumSansPro";
21
- const legacyFontWeight = "Semibold";
22
-
23
- /**
24
- * `LabelSmallAlt` typographic style. It's referenced as `LabelSmallReadex` in the design projects.
25
- */
26
- const LabelSmallAlt = /*#__PURE__*/(0, _react.forwardRef)(({
27
- color: customColor,
28
- ...props
29
- }, ref) => {
30
- const theme = (0, _core.useIOTheme)();
31
- const {
32
- isExperimental
33
- } = (0, _core.useIOExperimentalDesign)();
34
- const LabelSmallAltProps = {
35
- ...props,
36
- dynamicTypeRamp: "footnote" /* iOS only */,
37
- font: isExperimental ? fontName : legacyFontName,
38
- weight: isExperimental ? fontWeight : legacyFontWeight,
39
- size: isExperimental ? fontSize : legacyFontSize,
40
- lineHeight,
41
- color: customColor ?? theme["textBody-tertiary"]
42
- };
43
- return /*#__PURE__*/_react.default.createElement(_IOText.IOText, _extends({
44
- ref: ref
45
- }, LabelSmallAltProps), props.children);
46
- });
47
- exports.LabelSmallAlt = LabelSmallAlt;
48
- //# sourceMappingURL=LabelSmallAlt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_core","_IOText","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","fontSize","lineHeight","fontName","fontWeight","legacyFontSize","legacyFontName","legacyFontWeight","LabelSmallAlt","forwardRef","color","customColor","props","ref","theme","useIOTheme","isExperimental","useIOExperimentalDesign","LabelSmallAltProps","dynamicTypeRamp","font","weight","size","createElement","IOText","children","exports"],"sourceRoot":"../../../../src","sources":["components/typography/LabelSmallAlt.tsx"],"mappings":"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"}
@@ -1,39 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import React, { forwardRef } from "react";
3
- import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
- import { IOText } from "./IOText";
5
- const fontSize = 14;
6
- const lineHeight = 21;
7
- const fontName = "ReadexPro";
8
- const fontWeight = "Regular";
9
-
10
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
11
- const legacyFontSize = 16;
12
- const legacyFontName = "TitilliumSansPro";
13
- const legacyFontWeight = "Semibold";
14
-
15
- /**
16
- * `LabelSmallAlt` typographic style. It's referenced as `LabelSmallReadex` in the design projects.
17
- */
18
- export const LabelSmallAlt = /*#__PURE__*/forwardRef(({
19
- color: customColor,
20
- ...props
21
- }, ref) => {
22
- const theme = useIOTheme();
23
- const {
24
- isExperimental
25
- } = useIOExperimentalDesign();
26
- const LabelSmallAltProps = {
27
- ...props,
28
- dynamicTypeRamp: "footnote" /* iOS only */,
29
- font: isExperimental ? fontName : legacyFontName,
30
- weight: isExperimental ? fontWeight : legacyFontWeight,
31
- size: isExperimental ? fontSize : legacyFontSize,
32
- lineHeight,
33
- color: customColor ?? theme["textBody-tertiary"]
34
- };
35
- return /*#__PURE__*/React.createElement(IOText, _extends({
36
- ref: ref
37
- }, LabelSmallAltProps), props.children);
38
- });
39
- //# sourceMappingURL=LabelSmallAlt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","forwardRef","useIOExperimentalDesign","useIOTheme","IOText","fontSize","lineHeight","fontName","fontWeight","legacyFontSize","legacyFontName","legacyFontWeight","LabelSmallAlt","color","customColor","props","ref","theme","isExperimental","LabelSmallAltProps","dynamicTypeRamp","font","weight","size","createElement","_extends","children"],"sourceRoot":"../../../../src","sources":["components/typography/LabelSmallAlt.tsx"],"mappings":";AAAA,OAAOA,KAAK,IAAkBC,UAAU,QAAQ,OAAO;AAEvD,SAASC,uBAAuB,EAAEC,UAAU,QAAQ,YAAY;AAEhE,SAASC,MAAM,QAA4C,UAAU;AAErE,MAAMC,QAAQ,GAAG,EAAE;AACnB,MAAMC,UAAU,GAAG,EAAE;AACrB,MAAMC,QAAsB,GAAG,WAAW;AAC1C,MAAMC,UAAwB,GAAG,SAAS;;AAE1C;AACA,MAAMC,cAAc,GAAG,EAAE;AACzB,MAAMC,cAA4B,GAAG,kBAAkB;AACvD,MAAMC,gBAA8B,GAAG,UAAU;;AAEjD;AACA;AACA;AACA,OAAO,MAAMC,aAAa,gBAAGX,UAAU,CACrC,CAAC;EAAEY,KAAK,EAAEC,WAAW;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAwB,KAAK;EAC9D,MAAMC,KAAK,GAAGd,UAAU,CAAC,CAAC;EAC1B,MAAM;IAAEe;EAAe,CAAC,GAAGhB,uBAAuB,CAAC,CAAC;EAEpD,MAAMiB,kBAA+B,GAAG;IACtC,GAAGJ,KAAK;IACRK,eAAe,EAAE,UAAU,CAAC;IAC5BC,IAAI,EAAEH,cAAc,GAAGX,QAAQ,GAAGG,cAAc;IAChDY,MAAM,EAAEJ,cAAc,GAAGV,UAAU,GAAGG,gBAAgB;IACtDY,IAAI,EAAEL,cAAc,GAAGb,QAAQ,GAAGI,cAAc;IAChDH,UAAU;IACVO,KAAK,EAAEC,WAAW,IAAIG,KAAK,CAAC,mBAAmB;EACjD,CAAC;EAED,oBACEjB,KAAA,CAAAwB,aAAA,CAACpB,MAAM,EAAAqB,QAAA;IAACT,GAAG,EAAEA;EAAI,GAAKG,kBAAkB,GACrCJ,KAAK,CAACW,QACD,CAAC;AAEb,CACF,CAAC"}
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { View } from "react-native";
3
- import { IOTextProps } from "./IOText";
4
- /**
5
- * `LabelSmallAlt` typographic style. It's referenced as `LabelSmallReadex` in the design projects.
6
- */
7
- export declare const LabelSmallAlt: React.ForwardRefExoticComponent<Omit<IOTextProps, "style" | "size" | "color" | "font" | "fontStyle" | "lineHeight" | "weight"> & {
8
- textStyle?: import("./IOText").IOTextStyle | undefined;
9
- style?: import("./IOText").IOTextStyle | undefined;
10
- } & {
11
- color?: "white" | "grey-50" | "grey-100" | "grey-200" | "grey-300" | "grey-450" | "grey-650" | "grey-700" | "grey-850" | "black" | "blueIO-850" | "blueIO-600" | "blueIO-500" | "blueIO-400" | "blueIO-450" | "blueIO-200" | "blueIO-150" | "blueIO-100" | "blueIO-50" | "hanPurple-850" | "hanPurple-500" | "hanPurple-250" | "hanPurple-100" | "hanPurple-50" | "turquoise-850" | "turquoise-500" | "turquoise-450" | "turquoise-150" | "turquoise-100" | "turquoise-50" | "error-850" | "error-600" | "error-500" | "error-400" | "error-100" | "warning-850" | "warning-700" | "warning-500" | "warning-400" | "warning-100" | "success-850" | "success-700" | "success-500" | "success-400" | "success-100" | "info-850" | "info-700" | "info-500" | "info-400" | "info-100" | "blueItalia-850" | "blueItalia-600" | "blueItalia-500" | "blueItalia-100" | "blueItalia-50" | "blue-600" | "blue-50" | "greyUltraLight" | "greyLight" | "bluegreyLight" | "grey" | "bluegrey" | "bluegreyDark" | "blue" | "blueUltraLight" | "aqua" | "aquaUltraLight" | "antiqueFuchsia" | "orange" | "red" | "green" | "greenLight" | undefined;
12
- } & React.RefAttributes<View>>;
13
- //# sourceMappingURL=LabelSmallAlt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LabelSmallAlt.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/LabelSmallAlt.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,OAAO,EAAU,WAAW,EAAyB,MAAM,UAAU,CAAC;AAYtE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;8BAqBzB,CAAC"}
@@ -1,41 +0,0 @@
1
- import React, { ForwardedRef, forwardRef } from "react";
2
- import { View } from "react-native";
3
- import { useIOExperimentalDesign, useIOTheme } from "../../core";
4
- import { IOFontFamily, IOFontWeight } from "../../utils/fonts";
5
- import { IOText, IOTextProps, TypographicStyleProps } from "./IOText";
6
-
7
- const fontSize = 14;
8
- const lineHeight = 21;
9
- const fontName: IOFontFamily = "ReadexPro";
10
- const fontWeight: IOFontWeight = "Regular";
11
-
12
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
13
- const legacyFontSize = 16;
14
- const legacyFontName: IOFontFamily = "TitilliumSansPro";
15
- const legacyFontWeight: IOFontWeight = "Semibold";
16
-
17
- /**
18
- * `LabelSmallAlt` typographic style. It's referenced as `LabelSmallReadex` in the design projects.
19
- */
20
- export const LabelSmallAlt = forwardRef<View, TypographicStyleProps>(
21
- ({ color: customColor, ...props }, ref?: ForwardedRef<View>) => {
22
- const theme = useIOTheme();
23
- const { isExperimental } = useIOExperimentalDesign();
24
-
25
- const LabelSmallAltProps: IOTextProps = {
26
- ...props,
27
- dynamicTypeRamp: "footnote" /* iOS only */,
28
- font: isExperimental ? fontName : legacyFontName,
29
- weight: isExperimental ? fontWeight : legacyFontWeight,
30
- size: isExperimental ? fontSize : legacyFontSize,
31
- lineHeight,
32
- color: customColor ?? theme["textBody-tertiary"]
33
- };
34
-
35
- return (
36
- <IOText ref={ref} {...LabelSmallAltProps}>
37
- {props.children}
38
- </IOText>
39
- );
40
- }
41
- );