@pagopa/io-app-design-system 3.1.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (278) hide show
  1. package/lib/commonjs/components/alert/Alert.js +1 -2
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/alert/AlertEdgeToEdge.js +2 -2
  4. package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
  5. package/lib/commonjs/components/badge/Badge.js +95 -14
  6. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  7. package/lib/commonjs/components/banner/Banner.js +1 -1
  8. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  9. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  10. package/lib/commonjs/components/buttons/ButtonLink.js +1 -1
  11. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonOutline.js +1 -1
  13. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  14. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  15. package/lib/commonjs/components/featureInfo/FeatureInfo.js +3 -2
  16. package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
  17. package/lib/commonjs/components/layout/HeaderFirstLevel.js +1 -0
  18. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  19. package/lib/commonjs/components/listitems/ListItemCheckbox.js +1 -1
  20. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  21. package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
  22. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  23. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +1 -1
  24. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  25. package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
  26. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  27. package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -1
  28. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  29. package/lib/commonjs/components/listitems/ListItemRadio.js +1 -1
  30. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  31. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -2
  32. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  33. package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -1
  34. package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
  35. package/lib/commonjs/components/listitems/ListItemTransaction.js +2 -2
  36. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  37. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  38. package/lib/commonjs/components/modules/ModuleAttachment.js +1 -1
  39. package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
  40. package/lib/commonjs/components/modules/ModuleCheckout.js +1 -1
  41. package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
  42. package/lib/commonjs/components/modules/ModuleCredential.js +1 -1
  43. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  44. package/lib/commonjs/components/modules/ModuleNavigation.js +3 -2
  45. package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
  46. package/lib/commonjs/components/modules/ModulePaymentNotice.js +2 -2
  47. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  48. package/lib/commonjs/components/modules/ModuleSummary.js +1 -1
  49. package/lib/commonjs/components/modules/ModuleSummary.js.map +1 -1
  50. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
  51. package/lib/commonjs/components/otpInput/BoxedInput.js +4 -6
  52. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  53. package/lib/commonjs/components/otpInput/OTPInput.js +5 -4
  54. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  55. package/lib/commonjs/components/stack/Stack.js +2 -2
  56. package/lib/commonjs/components/stack/Stack.js.map +1 -1
  57. package/lib/commonjs/components/tabs/TabItem.js +1 -1
  58. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  59. package/lib/commonjs/components/tag/Tag.js +40 -26
  60. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  61. package/lib/commonjs/components/textInput/TextInputBase.js +2 -2
  62. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  63. package/lib/commonjs/components/typography/{LabelSmall.js → BodySmall.js} +8 -10
  64. package/lib/commonjs/components/typography/BodySmall.js.map +1 -0
  65. package/lib/commonjs/components/typography/ButtonText.js +1 -3
  66. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  67. package/lib/commonjs/components/typography/H3.js +3 -6
  68. package/lib/commonjs/components/typography/H3.js.map +1 -1
  69. package/lib/commonjs/components/typography/H6.js +4 -5
  70. package/lib/commonjs/components/typography/H6.js.map +1 -1
  71. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  72. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  73. package/lib/commonjs/components/typography/__test__/typography.test.js +6 -18
  74. package/lib/commonjs/components/typography/__test__/typography.test.js.map +1 -1
  75. package/lib/commonjs/components/typography/index.js +28 -72
  76. package/lib/commonjs/components/typography/index.js.map +1 -1
  77. package/lib/commonjs/core/IOColors.js +9 -1
  78. package/lib/commonjs/core/IOColors.js.map +1 -1
  79. package/lib/commonjs/utils/fonts.js.map +1 -1
  80. package/lib/module/components/alert/Alert.js +2 -3
  81. package/lib/module/components/alert/Alert.js.map +1 -1
  82. package/lib/module/components/alert/AlertEdgeToEdge.js +2 -2
  83. package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
  84. package/lib/module/components/badge/Badge.js +96 -15
  85. package/lib/module/components/badge/Badge.js.map +1 -1
  86. package/lib/module/components/banner/Banner.js +2 -2
  87. package/lib/module/components/banner/Banner.js.map +1 -1
  88. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  89. package/lib/module/components/buttons/ButtonLink.js +1 -1
  90. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  91. package/lib/module/components/buttons/ButtonOutline.js +1 -1
  92. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  93. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  94. package/lib/module/components/featureInfo/FeatureInfo.js +4 -3
  95. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  96. package/lib/module/components/layout/HeaderFirstLevel.js +1 -0
  97. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  98. package/lib/module/components/listitems/ListItemCheckbox.js +2 -2
  99. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  100. package/lib/module/components/listitems/ListItemInfo.js +2 -2
  101. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  102. package/lib/module/components/listitems/ListItemInfoCopy.js +2 -2
  103. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  104. package/lib/module/components/listitems/ListItemNav.js +2 -2
  105. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  106. package/lib/module/components/listitems/ListItemNavAlert.js +2 -2
  107. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  108. package/lib/module/components/listitems/ListItemRadio.js +2 -2
  109. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  110. package/lib/module/components/listitems/ListItemRadioWithAmount.js +3 -3
  111. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  112. package/lib/module/components/listitems/ListItemSwitch.js +2 -2
  113. package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
  114. package/lib/module/components/listitems/ListItemTransaction.js +3 -3
  115. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  116. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  117. package/lib/module/components/modules/ModuleAttachment.js +2 -2
  118. package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
  119. package/lib/module/components/modules/ModuleCheckout.js +2 -2
  120. package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
  121. package/lib/module/components/modules/ModuleCredential.js +2 -2
  122. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  123. package/lib/module/components/modules/ModuleNavigation.js +4 -3
  124. package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
  125. package/lib/module/components/modules/ModulePaymentNotice.js +3 -3
  126. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  127. package/lib/module/components/modules/ModuleSummary.js +2 -2
  128. package/lib/module/components/modules/ModuleSummary.js.map +1 -1
  129. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
  130. package/lib/module/components/otpInput/BoxedInput.js +5 -7
  131. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  132. package/lib/module/components/otpInput/OTPInput.js +5 -4
  133. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  134. package/lib/module/components/stack/Stack.js +2 -2
  135. package/lib/module/components/stack/Stack.js.map +1 -1
  136. package/lib/module/components/tabs/TabItem.js +2 -2
  137. package/lib/module/components/tabs/TabItem.js.map +1 -1
  138. package/lib/module/components/tag/Tag.js +41 -27
  139. package/lib/module/components/tag/Tag.js.map +1 -1
  140. package/lib/module/components/textInput/TextInputBase.js +3 -3
  141. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  142. package/lib/module/components/typography/{LabelSmall.js → BodySmall.js} +6 -8
  143. package/lib/module/components/typography/BodySmall.js.map +1 -0
  144. package/lib/module/components/typography/ButtonText.js +1 -3
  145. package/lib/module/components/typography/ButtonText.js.map +1 -1
  146. package/lib/module/components/typography/H3.js +3 -6
  147. package/lib/module/components/typography/H3.js.map +1 -1
  148. package/lib/module/components/typography/H6.js +4 -5
  149. package/lib/module/components/typography/H6.js.map +1 -1
  150. package/lib/module/components/typography/IOText.js.map +1 -1
  151. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  152. package/lib/module/components/typography/__test__/typography.test.js +6 -18
  153. package/lib/module/components/typography/__test__/typography.test.js.map +1 -1
  154. package/lib/module/components/typography/index.js +6 -10
  155. package/lib/module/components/typography/index.js.map +1 -1
  156. package/lib/module/core/IOColors.js +9 -1
  157. package/lib/module/core/IOColors.js.map +1 -1
  158. package/lib/module/utils/fonts.js.map +1 -1
  159. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  160. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  161. package/lib/typescript/components/banner/Banner.d.ts +1 -1
  162. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  163. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  164. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  165. package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
  166. package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
  167. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  168. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  169. package/lib/typescript/components/tag/Tag.d.ts +13 -8
  170. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  171. package/lib/typescript/components/typography/Body.d.ts +1 -1
  172. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  173. package/lib/typescript/components/typography/BodyMonospace.d.ts +1 -1
  174. package/lib/typescript/components/typography/BodySmall.d.ts +13 -0
  175. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -0
  176. package/lib/typescript/components/typography/ButtonText.d.ts +1 -1
  177. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  178. package/lib/typescript/components/typography/Caption.d.ts +1 -1
  179. package/lib/typescript/components/typography/H1.d.ts +1 -1
  180. package/lib/typescript/components/typography/H2.d.ts +1 -1
  181. package/lib/typescript/components/typography/H3.d.ts +3 -1
  182. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  183. package/lib/typescript/components/typography/H4.d.ts +1 -1
  184. package/lib/typescript/components/typography/H5.d.ts +1 -1
  185. package/lib/typescript/components/typography/H6.d.ts +1 -1
  186. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  187. package/lib/typescript/components/typography/Hero.d.ts +1 -1
  188. package/lib/typescript/components/typography/IOText.d.ts +2 -2
  189. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  190. package/lib/typescript/components/typography/LabelMini.d.ts +1 -1
  191. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  192. package/lib/typescript/components/typography/index.d.ts +6 -10
  193. package/lib/typescript/components/typography/index.d.ts.map +1 -1
  194. package/lib/typescript/components/typography/markdown/MdH1.d.ts +1 -1
  195. package/lib/typescript/components/typography/markdown/MdH2.d.ts +1 -1
  196. package/lib/typescript/components/typography/markdown/MdH3.d.ts +1 -1
  197. package/lib/typescript/core/IOColors.d.ts +2 -1
  198. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  199. package/lib/typescript/utils/fonts.d.ts +3 -3
  200. package/lib/typescript/utils/fonts.d.ts.map +1 -1
  201. package/package.json +1 -1
  202. package/src/components/alert/Alert.tsx +3 -4
  203. package/src/components/alert/AlertEdgeToEdge.tsx +3 -3
  204. package/src/components/badge/Badge.tsx +109 -19
  205. package/src/components/banner/Banner.tsx +7 -5
  206. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +2 -2
  207. package/src/components/buttons/ButtonLink.tsx +1 -1
  208. package/src/components/buttons/ButtonOutline.tsx +1 -1
  209. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +3 -3
  210. package/src/components/featureInfo/FeatureInfo.tsx +6 -6
  211. package/src/components/layout/HeaderFirstLevel.tsx +1 -0
  212. package/src/components/listitems/ListItemCheckbox.tsx +3 -3
  213. package/src/components/listitems/ListItemInfo.tsx +3 -3
  214. package/src/components/listitems/ListItemInfoCopy.tsx +3 -3
  215. package/src/components/listitems/ListItemNav.tsx +3 -3
  216. package/src/components/listitems/ListItemNavAlert.tsx +3 -3
  217. package/src/components/listitems/ListItemRadio.tsx +3 -3
  218. package/src/components/listitems/ListItemRadioWithAmount.tsx +5 -5
  219. package/src/components/listitems/ListItemSwitch.tsx +4 -4
  220. package/src/components/listitems/ListItemTransaction.tsx +5 -5
  221. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +7 -7
  222. package/src/components/modules/ModuleAttachment.tsx +3 -3
  223. package/src/components/modules/ModuleCheckout.tsx +3 -3
  224. package/src/components/modules/ModuleCredential.tsx +3 -3
  225. package/src/components/modules/ModuleNavigation.tsx +6 -4
  226. package/src/components/modules/ModulePaymentNotice.tsx +5 -5
  227. package/src/components/modules/ModuleSummary.tsx +3 -3
  228. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +1 -1
  229. package/src/components/otpInput/BoxedInput.tsx +6 -5
  230. package/src/components/otpInput/OTPInput.tsx +23 -8
  231. package/src/components/stack/Stack.tsx +2 -2
  232. package/src/components/tabs/TabItem.tsx +3 -3
  233. package/src/components/tag/Tag.tsx +66 -33
  234. package/src/components/textInput/TextInputBase.tsx +5 -5
  235. package/src/components/typography/Body.tsx +1 -1
  236. package/src/components/typography/{LabelSmall.tsx → BodySmall.tsx} +7 -14
  237. package/src/components/typography/ButtonText.tsx +2 -4
  238. package/src/components/typography/H3.tsx +11 -8
  239. package/src/components/typography/H6.tsx +5 -6
  240. package/src/components/typography/IOText.tsx +1 -2
  241. package/src/components/typography/LabelMini.tsx +1 -1
  242. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +118 -161
  243. package/src/components/typography/__test__/typography.test.tsx +8 -24
  244. package/src/components/typography/index.tsx +6 -10
  245. package/src/core/IOColors.ts +11 -0
  246. package/src/utils/fonts.ts +2 -2
  247. package/lib/commonjs/components/typography/BaseTypography.js +0 -52
  248. package/lib/commonjs/components/typography/BaseTypography.js.map +0 -1
  249. package/lib/commonjs/components/typography/Chip.js +0 -41
  250. package/lib/commonjs/components/typography/Chip.js.map +0 -1
  251. package/lib/commonjs/components/typography/Factory.js +0 -62
  252. package/lib/commonjs/components/typography/Factory.js.map +0 -1
  253. package/lib/commonjs/components/typography/Label.js +0 -51
  254. package/lib/commonjs/components/typography/Label.js.map +0 -1
  255. package/lib/commonjs/components/typography/LabelSmall.js.map +0 -1
  256. package/lib/module/components/typography/BaseTypography.js +0 -44
  257. package/lib/module/components/typography/BaseTypography.js.map +0 -1
  258. package/lib/module/components/typography/Chip.js +0 -32
  259. package/lib/module/components/typography/Chip.js.map +0 -1
  260. package/lib/module/components/typography/Factory.js +0 -55
  261. package/lib/module/components/typography/Factory.js.map +0 -1
  262. package/lib/module/components/typography/Label.js +0 -42
  263. package/lib/module/components/typography/Label.js.map +0 -1
  264. package/lib/module/components/typography/LabelSmall.js.map +0 -1
  265. package/lib/typescript/components/typography/BaseTypography.d.ts +0 -29
  266. package/lib/typescript/components/typography/BaseTypography.d.ts.map +0 -1
  267. package/lib/typescript/components/typography/Chip.d.ts +0 -13
  268. package/lib/typescript/components/typography/Chip.d.ts.map +0 -1
  269. package/lib/typescript/components/typography/Factory.d.ts +0 -43
  270. package/lib/typescript/components/typography/Factory.d.ts.map +0 -1
  271. package/lib/typescript/components/typography/Label.d.ts +0 -13
  272. package/lib/typescript/components/typography/Label.d.ts.map +0 -1
  273. package/lib/typescript/components/typography/LabelSmall.d.ts +0 -13
  274. package/lib/typescript/components/typography/LabelSmall.d.ts.map +0 -1
  275. package/src/components/typography/BaseTypography.tsx +0 -71
  276. package/src/components/typography/Chip.tsx +0 -33
  277. package/src/components/typography/Factory.tsx +0 -98
  278. package/src/components/typography/Label.tsx +0 -62
@@ -1,12 +1,14 @@
1
1
  import React from "react";
2
- import { Platform, StyleSheet, View } from "react-native";
2
+ import { ColorValue, Platform, StyleSheet, View } from "react-native";
3
3
  import {
4
+ hexToRgba,
4
5
  IOBadgeHSpacing,
5
6
  IOBadgeRadius,
6
7
  IOBadgeVSpacing,
7
8
  IOColors,
8
9
  useIOExperimentalDesign,
9
- useIOTheme
10
+ useIOTheme,
11
+ useIOThemeContext
10
12
  } from "../../core";
11
13
  import { WithTestID } from "../../utils/types";
12
14
  import { IOText } from "../typography";
@@ -28,7 +30,7 @@ export type Badge = WithTestID<{
28
30
  }>;
29
31
 
30
32
  type SolidVariantProps = {
31
- background: IOColors;
33
+ background: ColorValue;
32
34
  foreground: IOColors;
33
35
  };
34
36
 
@@ -60,54 +62,103 @@ const styles = StyleSheet.create({
60
62
  export const Badge = ({ text, outline = false, variant, testID }: Badge) => {
61
63
  const { isExperimental } = useIOExperimentalDesign();
62
64
  const theme = useIOTheme();
65
+ const { themeType } = useIOThemeContext();
63
66
 
64
- const mapVariants: Record<
67
+ const bgOpacityDarkMode = 0.2;
68
+
69
+ const mapVariantsLightMode: Record<
65
70
  NonNullable<Badge["variant"]>,
66
71
  SolidVariantProps
67
72
  > = {
68
73
  default: {
69
74
  foreground: "grey-700",
70
- background: "grey-50"
75
+ background: IOColors["grey-50"]
71
76
  },
72
77
  info: {
73
78
  foreground: "info-850",
74
- background: "info-100"
79
+ background: IOColors["info-100"]
75
80
  },
76
81
  warning: {
77
82
  foreground: "warning-850",
78
- background: "warning-100"
83
+ background: IOColors["warning-100"]
79
84
  },
80
85
  success: {
81
86
  foreground: "success-850",
82
- background: "success-100"
87
+ background: IOColors["success-100"]
83
88
  },
84
89
  error: {
85
90
  foreground: "error-850",
86
- background: "error-100"
91
+ background: IOColors["error-100"]
87
92
  },
88
93
  purple: {
89
94
  foreground: "hanPurple-500",
90
- background: "hanPurple-100"
95
+ background: IOColors["hanPurple-100"]
91
96
  },
92
97
  lightBlue: {
93
98
  foreground: "blueIO-850",
94
- background: "blueIO-50"
99
+ background: IOColors["blueIO-50"]
95
100
  },
96
101
  blue: {
97
102
  foreground: "white",
98
- background: theme["interactiveElem-default"]
103
+ background: IOColors[theme["interactiveElem-default"]]
99
104
  },
100
105
  turquoise: {
101
106
  foreground: "turquoise-850",
102
- background: "turquoise-50"
107
+ background: IOColors["turquoise-50"]
108
+ },
109
+ contrast: {
110
+ foreground: "grey-700",
111
+ background: IOColors.white
112
+ }
113
+ };
114
+
115
+ const mapVariantsDarkMode: Record<
116
+ NonNullable<Badge["variant"]>,
117
+ SolidVariantProps
118
+ > = {
119
+ default: {
120
+ foreground: "grey-50",
121
+ background: hexToRgba(IOColors["grey-50"], bgOpacityDarkMode)
122
+ },
123
+ info: {
124
+ foreground: "info-400",
125
+ background: hexToRgba(IOColors["info-400"], bgOpacityDarkMode)
126
+ },
127
+ warning: {
128
+ foreground: "warning-400",
129
+ background: hexToRgba(IOColors["warning-400"], bgOpacityDarkMode)
130
+ },
131
+ success: {
132
+ foreground: "success-400",
133
+ background: hexToRgba(IOColors["success-400"], bgOpacityDarkMode)
134
+ },
135
+ error: {
136
+ foreground: "error-400",
137
+ background: hexToRgba(IOColors["error-400"], bgOpacityDarkMode)
138
+ },
139
+ purple: {
140
+ foreground: "hanPurple-250",
141
+ background: hexToRgba(IOColors["hanPurple-250"], bgOpacityDarkMode)
142
+ },
143
+ lightBlue: {
144
+ foreground: "blueIO-200",
145
+ background: hexToRgba(IOColors["blueIO-600"], bgOpacityDarkMode)
146
+ },
147
+ blue: {
148
+ foreground: "white",
149
+ background: IOColors[theme["interactiveElem-default"]]
150
+ },
151
+ turquoise: {
152
+ foreground: "turquoise-300",
153
+ background: hexToRgba(IOColors["turquoise-300"], bgOpacityDarkMode)
103
154
  },
104
155
  contrast: {
105
156
  foreground: "grey-700",
106
- background: "white"
157
+ background: IOColors.white
107
158
  }
108
159
  };
109
160
 
110
- const mapOutlineVariants: Record<
161
+ const mapOutlineVariantsLightMode: Record<
111
162
  NonNullable<Badge["variant"]>,
112
163
  OutlinedVariantProps
113
164
  > = {
@@ -143,9 +194,48 @@ export const Badge = ({ text, outline = false, variant, testID }: Badge) => {
143
194
  }
144
195
  };
145
196
 
146
- const { background, foreground } = (
147
- outline ? mapOutlineVariants : mapVariants
148
- )[variant];
197
+ const mapOutlineVariantsDarkMode: Record<
198
+ NonNullable<Badge["variant"]>,
199
+ OutlinedVariantProps
200
+ > = {
201
+ default: {
202
+ foreground: "grey-100"
203
+ },
204
+ info: {
205
+ foreground: "info-400"
206
+ },
207
+ warning: {
208
+ foreground: "warning-400"
209
+ },
210
+ success: {
211
+ foreground: "success-400"
212
+ },
213
+ error: {
214
+ foreground: "error-400"
215
+ },
216
+ purple: {
217
+ foreground: "hanPurple-250"
218
+ },
219
+ lightBlue: {
220
+ foreground: "blueIO-150"
221
+ },
222
+ blue: {
223
+ foreground: theme["interactiveElem-default"]
224
+ },
225
+ turquoise: {
226
+ foreground: "turquoise-300"
227
+ },
228
+ contrast: {
229
+ foreground: "grey-100"
230
+ }
231
+ };
232
+
233
+ // prettier-ignore
234
+ const variantMap = themeType === "light"
235
+ ? (outline ? mapOutlineVariantsLightMode : mapVariantsLightMode)
236
+ : (outline ? mapOutlineVariantsDarkMode : mapVariantsDarkMode);
237
+
238
+ const { background, foreground } = variantMap[variant];
149
239
 
150
240
  return (
151
241
  <View
@@ -159,7 +249,7 @@ export const Badge = ({ text, outline = false, variant, testID }: Badge) => {
159
249
  borderColor: IOColors[foreground]
160
250
  }
161
251
  : {
162
- backgroundColor: background ? IOColors[background] : undefined
252
+ backgroundColor: background ?? undefined
163
253
  }
164
254
  ]}
165
255
  >
@@ -33,7 +33,7 @@ import {
33
33
  PictogramBleed
34
34
  } from "../pictograms";
35
35
  import { VSpacer } from "../spacer";
36
- import { H6, LabelSmall } from "../typography";
36
+ import { H6, BodySmall } from "../typography";
37
37
 
38
38
  /* Styles */
39
39
  const colorTitle: IOColors = "blueIO-850";
@@ -157,7 +157,7 @@ export const Banner = ({
157
157
  onClose,
158
158
  accessibilityHint,
159
159
  accessibilityLabel,
160
- testID,
160
+ testID
161
161
  }: Banner) => {
162
162
  const isPressed: Animated.SharedValue<number> = useSharedValue(0);
163
163
 
@@ -197,7 +197,9 @@ export const Banner = ({
197
197
 
198
198
  /* Generates a complete fallbackAccessibilityLabel by concatenating the title, content, and action
199
199
  if they are present. */
200
- const fallbackAccessibilityLabel = [title, content, action].filter(Boolean).join(" ");
200
+ const fallbackAccessibilityLabel = [title, content, action]
201
+ .filter(Boolean)
202
+ .join(" ");
201
203
 
202
204
  const renderMainBlock = () => (
203
205
  <>
@@ -219,9 +221,9 @@ export const Banner = ({
219
221
  )}
220
222
  {content && (
221
223
  <>
222
- <LabelSmall color={colorContent} weight={"Regular"}>
224
+ <BodySmall color={colorContent} weight={"Regular"}>
223
225
  {content}
224
- </LabelSmall>
226
+ </BodySmall>
225
227
  {action && <VSpacer size={8} />}
226
228
  </>
227
229
  )}
@@ -82,7 +82,7 @@ exports[`Test Banner Components - Experimental Enabled Banner Snapshot 1`] = `
82
82
  {
83
83
  "color": "#031344",
84
84
  "fontFamily": "Titillio",
85
- "fontSize": 18,
85
+ "fontSize": 16,
86
86
  "fontStyle": "normal",
87
87
  "fontWeight": "600",
88
88
  "lineHeight": 24,
@@ -546,7 +546,7 @@ exports[`Test Banner Components Banner Snapshot 1`] = `
546
546
  "fontFamily": "Titillium Sans Pro",
547
547
  "fontSize": 16,
548
548
  "fontStyle": "normal",
549
- "fontWeight": "700",
549
+ "fontWeight": "600",
550
550
  "lineHeight": undefined,
551
551
  },
552
552
  {
@@ -238,7 +238,7 @@ export const ButtonLink = React.forwardRef<View, ButtonLinkProps>(
238
238
  accessibilityElementsHidden
239
239
  importantForAccessibility="no-hide-descendants"
240
240
  font={isExperimental ? "Titillio" : "TitilliumSansPro"}
241
- weight={isExperimental ? "Semibold" : "Bold"}
241
+ weight={"Semibold"}
242
242
  size={buttonTextFontSize}
243
243
  style={
244
244
  disabled
@@ -375,7 +375,7 @@ export const ButtonOutline = React.forwardRef<View, ButtonOutline>(
375
375
  )}
376
376
  <AnimatedIOText
377
377
  font={isExperimental ? "Titillio" : "TitilliumSansPro"}
378
- weight={isExperimental ? "Semibold" : "Bold"}
378
+ weight={"Semibold"}
379
379
  size={buttonTextFontSize}
380
380
  accessible={false}
381
381
  accessibilityElementsHidden
@@ -805,7 +805,7 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
805
805
  "fontFamily": "Titillium Sans Pro",
806
806
  "fontSize": 16,
807
807
  "fontStyle": "normal",
808
- "fontWeight": "700",
808
+ "fontWeight": "600",
809
809
  "lineHeight": undefined,
810
810
  },
811
811
  {
@@ -911,7 +911,7 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
911
911
  "fontFamily": "Titillium Sans Pro",
912
912
  "fontSize": 16,
913
913
  "fontStyle": "normal",
914
- "fontWeight": "700",
914
+ "fontWeight": "600",
915
915
  "lineHeight": undefined,
916
916
  },
917
917
  [
@@ -1031,7 +1031,7 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
1031
1031
  "fontFamily": "Titillium Sans Pro",
1032
1032
  "fontSize": 16,
1033
1033
  "fontStyle": "normal",
1034
- "fontWeight": "700",
1034
+ "fontWeight": "600",
1035
1035
  "lineHeight": 20,
1036
1036
  },
1037
1037
  {
@@ -1,14 +1,13 @@
1
1
  import React, { ReactNode } from "react";
2
2
  import { GestureResponderEvent, View } from "react-native";
3
3
  import {
4
- Body,
4
+ BodySmall,
5
5
  HSpacer,
6
6
  IOIconSizeScale,
7
7
  IOIcons,
8
8
  IOPictogramSizeScale,
9
9
  IOPictograms,
10
10
  Icon,
11
- Label,
12
11
  Pictogram,
13
12
  VSpacer
14
13
  } from "../../components";
@@ -44,9 +43,9 @@ const DEFAULT_PICTOGRAM_SIZE: IOPictogramSizeScale = 48;
44
43
  const renderNode = (body: FeatureInfoProps["body"]) => {
45
44
  if (typeof body === "string") {
46
45
  return (
47
- <Body color="grey-700" testID="infoScreenBody">
46
+ <BodySmall color="grey-700" testID="infoScreenBody">
48
47
  {body}
49
- </Body>
48
+ </BodySmall>
50
49
  );
51
50
  }
52
51
 
@@ -75,7 +74,8 @@ export const FeatureInfo = ({
75
74
  This verbose code could be deleted once we got "gap"
76
75
  property support */}
77
76
  {body && <VSpacer size={4} />}
78
- <Label
77
+ <BodySmall
78
+ weight="Semibold"
79
79
  asLink
80
80
  onPress={action.onPress}
81
81
  accessible
@@ -83,7 +83,7 @@ export const FeatureInfo = ({
83
83
  accessibilityElementsHidden={false}
84
84
  >
85
85
  {action.label}
86
- </Label>
86
+ </BodySmall>
87
87
  </>
88
88
  )}
89
89
  </View>
@@ -126,6 +126,7 @@ export const HeaderFirstLevel = ({
126
126
  <View style={styles.headerInner}>
127
127
  <View ref={titleRef} accessible accessibilityRole="header">
128
128
  <H3
129
+ weight="Bold"
129
130
  style={{ flexShrink: 1 }}
130
131
  numberOfLines={1}
131
132
  color={
@@ -24,7 +24,7 @@ import {
24
24
  import { AnimatedCheckbox } from "../checkbox/AnimatedCheckbox";
25
25
  import { IOIcons, Icon } from "../icons";
26
26
  import { HSpacer, VSpacer } from "../spacer";
27
- import { H6, LabelSmall } from "../typography";
27
+ import { H6, BodySmall } from "../typography";
28
28
 
29
29
  type Props = {
30
30
  value: string;
@@ -188,9 +188,9 @@ export const ListItemCheckbox = ({
188
188
  <VSpacer
189
189
  size={IOSelectionListItemVisualParams.descriptionMargin}
190
190
  />
191
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
191
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
192
192
  {description}
193
- </LabelSmall>
193
+ </BodySmall>
194
194
  </View>
195
195
  )}
196
196
  </Animated.View>
@@ -12,7 +12,7 @@ import { ButtonLink, IconButton } from "../buttons";
12
12
  import { LogoPaymentWithFallback } from "../common/LogoPaymentWithFallback";
13
13
  import { IOIconSizeScale, IOIcons, Icon } from "../icons";
14
14
  import { IOLogoPaymentType } from "../logos";
15
- import { H6, LabelSmall } from "../typography";
15
+ import { H6, BodySmall } from "../typography";
16
16
 
17
17
  type ButtonLinkActionProps = {
18
18
  type: "buttonLink";
@@ -84,9 +84,9 @@ export const ListItemInfo = ({
84
84
  const itemInfoTextComponent = useMemo(
85
85
  () => (
86
86
  <View accessible={Platform.OS === "ios"}>
87
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
87
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
88
88
  {label}
89
- </LabelSmall>
89
+ </BodySmall>
90
90
  {typeof value === "string" ? (
91
91
  <H6 color={theme["textBody-default"]} numberOfLines={numberOfLines}>
92
92
  {value}
@@ -22,7 +22,7 @@ import {
22
22
  } from "../../core";
23
23
  import { WithTestID } from "../../utils/types";
24
24
  import { IOIcons, Icon } from "../icons";
25
- import { H6, LabelSmall } from "../typography";
25
+ import { BodySmall, H6 } from "../typography";
26
26
 
27
27
  export type ListItemInfoCopy = WithTestID<{
28
28
  label: string;
@@ -69,9 +69,9 @@ export const ListItemInfoCopy = ({
69
69
 
70
70
  const listItemInfoCopyContent = (
71
71
  <>
72
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
72
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
73
73
  {label}
74
- </LabelSmall>
74
+ </BodySmall>
75
75
  {/* Let developer using a custom component (e.g: skeleton) */}
76
76
  {typeof value === "string" ? (
77
77
  <H6 color={foregroundColor} numberOfLines={numberOfLines}>
@@ -33,7 +33,7 @@ import { Badge } from "../badge";
33
33
  import { IOIcons, Icon } from "../icons";
34
34
  import { LoadingSpinner } from "../loadingSpinner";
35
35
  import { HSpacer, VSpacer } from "../spacer";
36
- import { Caption, H6, LabelSmall } from "../typography";
36
+ import { Caption, H6, BodySmall } from "../typography";
37
37
 
38
38
  type ListItemTopElementProps =
39
39
  | {
@@ -161,9 +161,9 @@ export const ListItemNav = ({
161
161
  {description && (
162
162
  <>
163
163
  {typeof description === "string" ? (
164
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
164
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
165
165
  {description}
166
- </LabelSmall>
166
+ </BodySmall>
167
167
  ) : (
168
168
  description
169
169
  )}
@@ -22,7 +22,7 @@ import {
22
22
  } from "../../core";
23
23
  import { WithTestID } from "../../utils/types";
24
24
  import { Icon } from "../icons";
25
- import { H6, LabelSmall } from "../typography";
25
+ import { H6, BodySmall } from "../typography";
26
26
 
27
27
  export type ListItemNavAlert = WithTestID<{
28
28
  value: string | React.ReactNode;
@@ -82,9 +82,9 @@ export const ListItemNavAlert = ({
82
82
  {description && (
83
83
  <>
84
84
  {typeof description === "string" ? (
85
- <LabelSmall weight="Semibold" color={theme.errorText}>
85
+ <BodySmall weight="Semibold" color={theme.errorText}>
86
86
  {description}
87
- </LabelSmall>
87
+ </BodySmall>
88
88
  ) : (
89
89
  description
90
90
  )}
@@ -27,7 +27,7 @@ import { IOIcons, Icon } from "../icons";
27
27
  import { IOLogoPaymentType, LogoPayment } from "../logos";
28
28
  import { AnimatedRadio } from "../radio/AnimatedRadio";
29
29
  import { HSpacer, VSpacer } from "../spacer";
30
- import { H6, LabelSmall } from "../typography";
30
+ import { H6, BodySmall } from "../typography";
31
31
 
32
32
  type ListItemRadioGraphicProps =
33
33
  | { icon?: never; paymentLogo: IOLogoPaymentType; uri?: never }
@@ -287,9 +287,9 @@ export const ListItemRadio = ({
287
287
  <VSpacer
288
288
  size={IOSelectionListItemVisualParams.descriptionMargin}
289
289
  />
290
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
290
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
291
291
  {description}
292
- </LabelSmall>
292
+ </BodySmall>
293
293
  </View>
294
294
  )}
295
295
  </Animated.View>
@@ -5,7 +5,7 @@ import { IOColors, useIOTheme } from "../../core";
5
5
  import { Icon } from "../icons";
6
6
  import { AnimatedRadio } from "../radio/AnimatedRadio";
7
7
  import { HSpacer, VSpacer } from "../spacer";
8
- import { H6, LabelSmall } from "../typography";
8
+ import { H6, BodySmall } from "../typography";
9
9
  import { PressableListItemBase } from "./PressableListItemsBase";
10
10
 
11
11
  export type ListItemRadioWithAmountProps = {
@@ -55,22 +55,22 @@ export const ListItemRadioWithAmount = ({
55
55
  }}
56
56
  >
57
57
  <View style={{ flexShrink: 1 }}>
58
- <LabelSmall
58
+ <BodySmall
59
59
  weight="Semibold"
60
60
  numberOfLines={1}
61
61
  color={theme["textBody-default"]}
62
62
  >
63
63
  {label}
64
- </LabelSmall>
64
+ </BodySmall>
65
65
  {isSuggested && (
66
66
  <>
67
67
  <VSpacer size={4} />
68
68
  <View style={styles.rowCenter}>
69
69
  <Icon name="sparkles" size={16} color={suggestColor} />
70
70
  <HSpacer size={4} />
71
- <LabelSmall weight="Regular" color={suggestColor}>
71
+ <BodySmall weight="Regular" color={suggestColor}>
72
72
  {suggestReason}
73
- </LabelSmall>
73
+ </BodySmall>
74
74
  </View>
75
75
  </>
76
76
  )}
@@ -1,18 +1,18 @@
1
1
  import React, { useMemo } from "react";
2
2
  import { GestureResponderEvent, Platform, Switch, View } from "react-native";
3
- import { WithTestID } from "../../utils/types";
4
3
  import {
5
4
  IOSelectionListItemStyles,
6
5
  IOSelectionListItemVisualParams,
7
6
  useIOTheme
8
7
  } from "../../core";
8
+ import { WithTestID } from "../../utils/types";
9
9
  import { Badge } from "../badge";
10
10
  import { IOIcons, Icon } from "../icons";
11
11
  import { LoadingSpinner } from "../loadingSpinner";
12
12
  import { IOLogoPaymentType, LogoPayment } from "../logos";
13
13
  import { HSpacer, VSpacer } from "../spacer";
14
14
  import { NativeSwitch } from "../switch/NativeSwitch";
15
- import { H6, LabelMini, LabelSmall } from "../typography";
15
+ import { BodySmall, H6, LabelMini } from "../typography";
16
16
 
17
17
  type PartialProps = WithTestID<{
18
18
  label: string;
@@ -178,9 +178,9 @@ export const ListItemSwitch = React.memo(
178
178
  {description && (
179
179
  <>
180
180
  <VSpacer size={IOSelectionListItemVisualParams.descriptionMargin} />
181
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
181
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
182
182
  {description}
183
- </LabelSmall>
183
+ </BodySmall>
184
184
  </>
185
185
  )}
186
186
  {action && (
@@ -21,7 +21,7 @@ import { IOIconSizeScale, Icon } from "../icons";
21
21
  import { IOLogoPaymentType } from "../logos";
22
22
  import { VSpacer } from "../spacer";
23
23
  import { HStack } from "../stack";
24
- import { H6, LabelSmall } from "../typography";
24
+ import { H6, BodySmall } from "../typography";
25
25
  import {
26
26
  PressableBaseProps,
27
27
  PressableListItemBase
@@ -146,16 +146,16 @@ export const ListItemTransaction = ({
146
146
  </View>
147
147
  )}
148
148
  <View style={{ flexShrink: 1 }}>
149
- <LabelSmall
149
+ <BodySmall
150
150
  numberOfLines={numberOfLines}
151
151
  color={theme["textBody-default"]}
152
152
  weight="Semibold"
153
153
  >
154
154
  {title}
155
- </LabelSmall>
156
- <LabelSmall weight="Regular" color={theme["textBody-tertiary"]}>
155
+ </BodySmall>
156
+ <BodySmall weight="Regular" color={theme["textBody-tertiary"]}>
157
157
  {subtitle}
158
- </LabelSmall>
158
+ </BodySmall>
159
159
  </View>
160
160
  </HStack>
161
161
  <HStack style={{ alignItems: "center" }}>
@@ -262,7 +262,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfo Snapshot
262
262
  {
263
263
  "color": "#0E0F13",
264
264
  "fontFamily": "Titillio",
265
- "fontSize": 18,
265
+ "fontSize": 16,
266
266
  "fontStyle": "normal",
267
267
  "fontWeight": "600",
268
268
  "lineHeight": 24,
@@ -384,7 +384,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemInfoCopy Snap
384
384
  {
385
385
  "color": "#0B3EE3",
386
386
  "fontFamily": "Titillio",
387
- "fontSize": 18,
387
+ "fontSize": 16,
388
388
  "fontStyle": "normal",
389
389
  "fontWeight": "600",
390
390
  "lineHeight": 24,
@@ -551,7 +551,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNav Snapshot
551
551
  {
552
552
  "color": "#0E0F13",
553
553
  "fontFamily": "Titillio",
554
- "fontSize": 18,
554
+ "fontSize": 16,
555
555
  "fontStyle": "normal",
556
556
  "fontWeight": "600",
557
557
  "lineHeight": 24,
@@ -780,7 +780,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemNavAlert Snap
780
780
  {
781
781
  "color": "#0E0F13",
782
782
  "fontFamily": "Titillio",
783
- "fontSize": 18,
783
+ "fontSize": 16,
784
784
  "fontStyle": "normal",
785
785
  "fontWeight": "600",
786
786
  "lineHeight": 24,
@@ -1082,7 +1082,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
1082
1082
  {
1083
1083
  "color": "#0B3EE3",
1084
1084
  "fontFamily": "Titillio",
1085
- "fontSize": 18,
1085
+ "fontSize": 16,
1086
1086
  "fontStyle": "normal",
1087
1087
  "fontWeight": "600",
1088
1088
  "lineHeight": 24,
@@ -1366,7 +1366,7 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
1366
1366
  {
1367
1367
  "color": "#0B3EE3",
1368
1368
  "fontFamily": "Titillio",
1369
- "fontSize": 18,
1369
+ "fontSize": 16,
1370
1370
  "fontStyle": "normal",
1371
1371
  "fontWeight": "600",
1372
1372
  "lineHeight": 24,
@@ -1774,7 +1774,7 @@ exports[`Test List Item Components ListItemAction Snapshot 1`] = `
1774
1774
  "fontFamily": "Titillium Sans Pro",
1775
1775
  "fontSize": 16,
1776
1776
  "fontStyle": "normal",
1777
- "fontWeight": "700",
1777
+ "fontWeight": "600",
1778
1778
  "lineHeight": 20,
1779
1779
  },
1780
1780
  ]