@pagopa/io-app-design-system 4.4.2 → 5.0.0-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 (310) hide show
  1. package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  2. package/lib/commonjs/components/accordion/index.js +0 -11
  3. package/lib/commonjs/components/accordion/index.js.map +1 -1
  4. package/lib/commonjs/components/badge/Badge.js +4 -4
  5. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  6. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
  7. package/lib/commonjs/components/banner/Banner.js +4 -4
  8. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  9. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
  10. package/lib/commonjs/components/buttons/ButtonLink.js +25 -32
  11. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonOutline.js +18 -86
  13. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  14. package/lib/commonjs/components/buttons/ButtonSolid.js +9 -53
  15. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  16. package/lib/commonjs/components/buttons/IconButton.js +6 -36
  17. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  18. package/lib/commonjs/components/buttons/IconButtonContained.js +5 -50
  19. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  20. package/lib/commonjs/components/buttons/IconButtonSolid.js +5 -36
  21. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  22. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
  23. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +5 -15
  24. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  25. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +2 -9
  26. package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  27. package/lib/commonjs/components/layout/FooterActions.js +1 -5
  28. package/lib/commonjs/components/layout/FooterActions.js.map +1 -1
  29. package/lib/commonjs/components/layout/HeaderSecondLevel.js +3 -3
  30. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  31. package/lib/commonjs/components/layout/ModalBSHeader.js +3 -15
  32. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
  33. package/lib/commonjs/components/listitems/ListItemNavAlert.js +1 -4
  34. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  35. package/lib/commonjs/components/listitems/ListItemTransaction.js +1 -4
  36. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  37. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
  38. package/lib/commonjs/components/modules/ModuleIDP.js +4 -5
  39. package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
  40. package/lib/commonjs/components/numberpad/NumberButton.js +3 -18
  41. package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
  42. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
  43. package/lib/commonjs/components/radio/AnimatedRadio.js +4 -14
  44. package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
  45. package/lib/commonjs/components/searchInput/SearchInput.js +6 -10
  46. package/lib/commonjs/components/searchInput/SearchInput.js.map +1 -1
  47. package/lib/commonjs/components/stepper/Stepper.js +1 -10
  48. package/lib/commonjs/components/stepper/Stepper.js.map +1 -1
  49. package/lib/commonjs/components/switch/NativeSwitch.js +2 -15
  50. package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
  51. package/lib/commonjs/components/tabs/TabItem.js +6 -46
  52. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  53. package/lib/commonjs/components/tag/Tag.js +4 -4
  54. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  55. package/lib/commonjs/components/textInput/TextInputBase.js +10 -20
  56. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  57. package/lib/commonjs/components/typography/Body.js +4 -6
  58. package/lib/commonjs/components/typography/Body.js.map +1 -1
  59. package/lib/commonjs/components/typography/BodySmall.js +3 -3
  60. package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
  61. package/lib/commonjs/components/typography/ButtonText.js +6 -7
  62. package/lib/commonjs/components/typography/ButtonText.js.map +1 -1
  63. package/lib/commonjs/components/typography/Caption.js +6 -12
  64. package/lib/commonjs/components/typography/Caption.js.map +1 -1
  65. package/lib/commonjs/components/typography/H1.js +6 -13
  66. package/lib/commonjs/components/typography/H1.js.map +1 -1
  67. package/lib/commonjs/components/typography/H2.js +8 -17
  68. package/lib/commonjs/components/typography/H2.js.map +1 -1
  69. package/lib/commonjs/components/typography/H3.js +4 -8
  70. package/lib/commonjs/components/typography/H3.js.map +1 -1
  71. package/lib/commonjs/components/typography/H4.js +7 -14
  72. package/lib/commonjs/components/typography/H4.js.map +1 -1
  73. package/lib/commonjs/components/typography/H5.js +5 -10
  74. package/lib/commonjs/components/typography/H5.js.map +1 -1
  75. package/lib/commonjs/components/typography/H6.js +7 -10
  76. package/lib/commonjs/components/typography/H6.js.map +1 -1
  77. package/lib/commonjs/components/typography/Hero.js +8 -17
  78. package/lib/commonjs/components/typography/Hero.js.map +1 -1
  79. package/lib/commonjs/components/typography/LabelMini.js +4 -6
  80. package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
  81. package/lib/commonjs/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
  82. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
  83. package/lib/commonjs/components/typography/markdown/MdH1.js +3 -3
  84. package/lib/commonjs/components/typography/markdown/MdH1.js.map +1 -1
  85. package/lib/commonjs/components/typography/markdown/MdH2.js +3 -3
  86. package/lib/commonjs/components/typography/markdown/MdH2.js.map +1 -1
  87. package/lib/commonjs/components/typography/markdown/MdH3.js +3 -3
  88. package/lib/commonjs/components/typography/markdown/MdH3.js.map +1 -1
  89. package/lib/commonjs/core/IOColors.js +1 -8
  90. package/lib/commonjs/core/IOColors.js.map +1 -1
  91. package/lib/commonjs/core/IODSExperimentalContextProvider.js +4 -3
  92. package/lib/commonjs/core/IODSExperimentalContextProvider.js.map +1 -1
  93. package/lib/commonjs/core/IONewTypefaceContextProvider.js +33 -0
  94. package/lib/commonjs/core/IONewTypefaceContextProvider.js.map +1 -0
  95. package/lib/commonjs/core/IOStyles.js +1 -49
  96. package/lib/commonjs/core/IOStyles.js.map +1 -1
  97. package/lib/commonjs/core/IOThemeContextProvider.js +4 -15
  98. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -1
  99. package/lib/commonjs/core/index.js +11 -0
  100. package/lib/commonjs/core/index.js.map +1 -1
  101. package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  102. package/lib/module/components/accordion/index.js +0 -1
  103. package/lib/module/components/accordion/index.js.map +1 -1
  104. package/lib/module/components/badge/Badge.js +5 -5
  105. package/lib/module/components/badge/Badge.js.map +1 -1
  106. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
  107. package/lib/module/components/banner/Banner.js +5 -5
  108. package/lib/module/components/banner/Banner.js.map +1 -1
  109. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
  110. package/lib/module/components/buttons/ButtonLink.js +28 -35
  111. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  112. package/lib/module/components/buttons/ButtonOutline.js +19 -87
  113. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  114. package/lib/module/components/buttons/ButtonSolid.js +10 -54
  115. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  116. package/lib/module/components/buttons/IconButton.js +6 -37
  117. package/lib/module/components/buttons/IconButton.js.map +1 -1
  118. package/lib/module/components/buttons/IconButtonContained.js +6 -51
  119. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  120. package/lib/module/components/buttons/IconButtonSolid.js +6 -37
  121. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  122. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
  123. package/lib/module/components/checkbox/AnimatedCheckbox.js +6 -16
  124. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  125. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +3 -10
  126. package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
  127. package/lib/module/components/layout/FooterActions.js +2 -6
  128. package/lib/module/components/layout/FooterActions.js.map +1 -1
  129. package/lib/module/components/layout/HeaderSecondLevel.js +4 -4
  130. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  131. package/lib/module/components/layout/ModalBSHeader.js +5 -17
  132. package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
  133. package/lib/module/components/listitems/ListItemNavAlert.js +2 -5
  134. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  135. package/lib/module/components/listitems/ListItemTransaction.js +2 -5
  136. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  137. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
  138. package/lib/module/components/modules/ModuleIDP.js +4 -5
  139. package/lib/module/components/modules/ModuleIDP.js.map +1 -1
  140. package/lib/module/components/numberpad/NumberButton.js +5 -20
  141. package/lib/module/components/numberpad/NumberButton.js.map +1 -1
  142. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
  143. package/lib/module/components/radio/AnimatedRadio.js +5 -15
  144. package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
  145. package/lib/module/components/searchInput/SearchInput.js +7 -11
  146. package/lib/module/components/searchInput/SearchInput.js.map +1 -1
  147. package/lib/module/components/stepper/Stepper.js +2 -11
  148. package/lib/module/components/stepper/Stepper.js.map +1 -1
  149. package/lib/module/components/switch/NativeSwitch.js +3 -16
  150. package/lib/module/components/switch/NativeSwitch.js.map +1 -1
  151. package/lib/module/components/tabs/TabItem.js +7 -47
  152. package/lib/module/components/tabs/TabItem.js.map +1 -1
  153. package/lib/module/components/tag/Tag.js +5 -5
  154. package/lib/module/components/tag/Tag.js.map +1 -1
  155. package/lib/module/components/textInput/TextInputBase.js +11 -21
  156. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  157. package/lib/module/components/typography/Body.js +5 -7
  158. package/lib/module/components/typography/Body.js.map +1 -1
  159. package/lib/module/components/typography/BodySmall.js +4 -4
  160. package/lib/module/components/typography/BodySmall.js.map +1 -1
  161. package/lib/module/components/typography/ButtonText.js +7 -8
  162. package/lib/module/components/typography/ButtonText.js.map +1 -1
  163. package/lib/module/components/typography/Caption.js +6 -12
  164. package/lib/module/components/typography/Caption.js.map +1 -1
  165. package/lib/module/components/typography/H1.js +6 -13
  166. package/lib/module/components/typography/H1.js.map +1 -1
  167. package/lib/module/components/typography/H2.js +8 -17
  168. package/lib/module/components/typography/H2.js.map +1 -1
  169. package/lib/module/components/typography/H3.js +4 -8
  170. package/lib/module/components/typography/H3.js.map +1 -1
  171. package/lib/module/components/typography/H4.js +7 -14
  172. package/lib/module/components/typography/H4.js.map +1 -1
  173. package/lib/module/components/typography/H5.js +6 -11
  174. package/lib/module/components/typography/H5.js.map +1 -1
  175. package/lib/module/components/typography/H6.js +7 -10
  176. package/lib/module/components/typography/H6.js.map +1 -1
  177. package/lib/module/components/typography/Hero.js +8 -17
  178. package/lib/module/components/typography/Hero.js.map +1 -1
  179. package/lib/module/components/typography/LabelMini.js +5 -7
  180. package/lib/module/components/typography/LabelMini.js.map +1 -1
  181. package/lib/module/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
  182. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
  183. package/lib/module/components/typography/markdown/MdH1.js +4 -4
  184. package/lib/module/components/typography/markdown/MdH1.js.map +1 -1
  185. package/lib/module/components/typography/markdown/MdH2.js +4 -4
  186. package/lib/module/components/typography/markdown/MdH2.js.map +1 -1
  187. package/lib/module/components/typography/markdown/MdH3.js +4 -4
  188. package/lib/module/components/typography/markdown/MdH3.js.map +1 -1
  189. package/lib/module/core/IOColors.js +0 -6
  190. package/lib/module/core/IOColors.js.map +1 -1
  191. package/lib/module/core/IODSExperimentalContextProvider.js +2 -2
  192. package/lib/module/core/IODSExperimentalContextProvider.js.map +1 -1
  193. package/lib/module/core/IONewTypefaceContextProvider.js +22 -0
  194. package/lib/module/core/IONewTypefaceContextProvider.js.map +1 -0
  195. package/lib/module/core/IOStyles.js +0 -46
  196. package/lib/module/core/IOStyles.js.map +1 -1
  197. package/lib/module/core/IOThemeContextProvider.js +3 -12
  198. package/lib/module/core/IOThemeContextProvider.js.map +1 -1
  199. package/lib/module/core/index.js +1 -0
  200. package/lib/module/core/index.js.map +1 -1
  201. package/lib/typescript/components/accordion/index.d.ts +0 -1
  202. package/lib/typescript/components/accordion/index.d.ts.map +1 -1
  203. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  204. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  205. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  206. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  207. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  208. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  209. package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
  210. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  211. package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
  212. package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
  213. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  214. package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -1
  215. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  216. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  217. package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
  218. package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
  219. package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
  220. package/lib/typescript/components/searchInput/SearchInput.d.ts.map +1 -1
  221. package/lib/typescript/components/stepper/Stepper.d.ts.map +1 -1
  222. package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
  223. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  224. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  225. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  226. package/lib/typescript/components/typography/ButtonText.d.ts.map +1 -1
  227. package/lib/typescript/components/typography/Caption.d.ts.map +1 -1
  228. package/lib/typescript/components/typography/H1.d.ts.map +1 -1
  229. package/lib/typescript/components/typography/H2.d.ts +0 -3
  230. package/lib/typescript/components/typography/H2.d.ts.map +1 -1
  231. package/lib/typescript/components/typography/H3.d.ts.map +1 -1
  232. package/lib/typescript/components/typography/H4.d.ts.map +1 -1
  233. package/lib/typescript/components/typography/H5.d.ts.map +1 -1
  234. package/lib/typescript/components/typography/H6.d.ts.map +1 -1
  235. package/lib/typescript/components/typography/Hero.d.ts.map +1 -1
  236. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  237. package/lib/typescript/core/IOColors.d.ts +0 -1
  238. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  239. package/lib/typescript/core/IODSExperimentalContextProvider.d.ts.map +1 -1
  240. package/lib/typescript/core/IONewTypefaceContextProvider.d.ts +16 -0
  241. package/lib/typescript/core/IONewTypefaceContextProvider.d.ts.map +1 -0
  242. package/lib/typescript/core/IOStyles.d.ts +2 -32
  243. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  244. package/lib/typescript/core/IOThemeContextProvider.d.ts +0 -4
  245. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -1
  246. package/lib/typescript/core/index.d.ts +1 -0
  247. package/lib/typescript/core/index.d.ts.map +1 -1
  248. package/lib/typescript/utils/fonts.d.ts +1 -1
  249. package/package.json +1 -1
  250. package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -1
  251. package/src/components/accordion/index.tsx +0 -1
  252. package/src/components/badge/Badge.tsx +3 -3
  253. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +1 -1
  254. package/src/components/banner/Banner.tsx +3 -4
  255. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -3
  256. package/src/components/buttons/ButtonLink.tsx +38 -41
  257. package/src/components/buttons/ButtonOutline.tsx +31 -103
  258. package/src/components/buttons/ButtonSolid.tsx +11 -69
  259. package/src/components/buttons/IconButton.tsx +5 -49
  260. package/src/components/buttons/IconButtonContained.tsx +11 -58
  261. package/src/components/buttons/IconButtonSolid.tsx +9 -47
  262. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +29 -27
  263. package/src/components/checkbox/AnimatedCheckbox.tsx +6 -34
  264. package/src/components/checkbox/AnimatedMessageCheckbox.tsx +3 -14
  265. package/src/components/layout/FooterActions.tsx +1 -4
  266. package/src/components/layout/HeaderSecondLevel.tsx +4 -3
  267. package/src/components/layout/ModalBSHeader.tsx +11 -29
  268. package/src/components/listitems/ListItemNavAlert.tsx +1 -4
  269. package/src/components/listitems/ListItemTransaction.tsx +1 -5
  270. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +27 -27
  271. package/src/components/modules/ModuleIDP.tsx +3 -8
  272. package/src/components/numberpad/NumberButton.tsx +4 -27
  273. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +10 -10
  274. package/src/components/radio/AnimatedRadio.tsx +5 -33
  275. package/src/components/searchInput/SearchInput.tsx +11 -20
  276. package/src/components/stepper/Stepper.tsx +2 -20
  277. package/src/components/switch/NativeSwitch.tsx +3 -21
  278. package/src/components/tabs/TabItem.tsx +14 -61
  279. package/src/components/tag/Tag.tsx +3 -3
  280. package/src/components/textInput/TextInputBase.tsx +19 -34
  281. package/src/components/typography/Body.tsx +4 -11
  282. package/src/components/typography/BodySmall.tsx +3 -3
  283. package/src/components/typography/ButtonText.tsx +6 -8
  284. package/src/components/typography/Caption.tsx +6 -13
  285. package/src/components/typography/H1.tsx +6 -14
  286. package/src/components/typography/H2.tsx +8 -18
  287. package/src/components/typography/H3.tsx +4 -8
  288. package/src/components/typography/H4.tsx +7 -15
  289. package/src/components/typography/H5.tsx +6 -14
  290. package/src/components/typography/H6.tsx +7 -11
  291. package/src/components/typography/Hero.tsx +8 -18
  292. package/src/components/typography/LabelMini.tsx +4 -11
  293. package/src/components/typography/__test__/__snapshots__/ComposedBodyFromArray.test.tsx.snap +42 -42
  294. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +26 -26
  295. package/src/components/typography/markdown/MdH1.tsx +3 -3
  296. package/src/components/typography/markdown/MdH2.tsx +3 -3
  297. package/src/components/typography/markdown/MdH3.tsx +3 -3
  298. package/src/core/IOColors.ts +0 -7
  299. package/src/core/IODSExperimentalContextProvider.tsx +2 -2
  300. package/src/core/IONewTypefaceContextProvider.tsx +37 -0
  301. package/src/core/IOStyles.ts +0 -52
  302. package/src/core/IOThemeContextProvider.tsx +3 -16
  303. package/src/core/index.ts +1 -0
  304. package/lib/commonjs/components/accordion/RawAccordion.js +0 -93
  305. package/lib/commonjs/components/accordion/RawAccordion.js.map +0 -1
  306. package/lib/module/components/accordion/RawAccordion.js +0 -86
  307. package/lib/module/components/accordion/RawAccordion.js.map +0 -1
  308. package/lib/typescript/components/accordion/RawAccordion.d.ts +0 -17
  309. package/lib/typescript/components/accordion/RawAccordion.d.ts.map +0 -1
  310. package/src/components/accordion/RawAccordion.tsx +0 -116
@@ -1,7 +1,8 @@
1
- import React, { forwardRef, useMemo } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { GestureResponderEvent, Pressable, View } from "react-native";
3
3
  import Animated, {
4
4
  interpolateColor,
5
+ useAnimatedProps,
5
6
  useAnimatedStyle,
6
7
  useReducedMotion
7
8
  } from "react-native-reanimated";
@@ -10,7 +11,7 @@ import {
10
11
  IOColors,
11
12
  IOSpacingScale,
12
13
  hexToRgba,
13
- useIOExperimentalDesign
14
+ useIONewTypeface
14
15
  } from "../../core";
15
16
  import { useScaleAnimation } from "../../hooks";
16
17
  import { WithTestID } from "../../utils/types";
@@ -67,28 +68,6 @@ const mapColorStates: Record<
67
68
  }
68
69
  };
69
70
 
70
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
71
- const mapLegacyColorStates: Record<
72
- NonNullable<ButtonLinkProps["color"]>,
73
- ColorStates
74
- > = {
75
- // Primary button
76
- primary: {
77
- label: {
78
- default: IOColors.blue,
79
- pressed: IOColors["blue-600"],
80
- disabled: IOColors["grey-700"]
81
- }
82
- },
83
- contrast: {
84
- label: {
85
- default: IOColors.white,
86
- pressed: hexToRgba(IOColors.white, 0.85),
87
- disabled: hexToRgba(IOColors.white, 0.5)
88
- }
89
- }
90
- };
91
-
92
71
  const DISABLED_OPACITY = 0.5;
93
72
  const ICON_MARGIN = 8;
94
73
 
@@ -107,25 +86,43 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
107
86
  },
108
87
  ref
109
88
  ) => {
110
- const { isExperimental } = useIOExperimentalDesign();
89
+ const { newTypefaceEnabled } = useIONewTypeface();
111
90
  const { progress, onPressIn, onPressOut, scaleAnimatedStyle } =
112
91
  useScaleAnimation();
113
92
  const reducedMotion = useReducedMotion();
114
93
 
115
- const colorMap = useMemo(
116
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
117
- [isExperimental]
118
- );
119
-
120
94
  const AnimatedIOText = Animated.createAnimatedComponent(IOText);
121
95
 
122
- const pressedColorAnimationStyle = useAnimatedStyle(() => ({
123
- color: interpolateColor(
96
+ const pressedColorLabelAnimationStyle = useAnimatedStyle(() => {
97
+ // Link color states to the pressed states
98
+
99
+ const labelColor = interpolateColor(
100
+ progress.value,
101
+ [0, 1],
102
+ [
103
+ mapColorStates[color].label.default,
104
+ mapColorStates[color].label.pressed
105
+ ]
106
+ );
107
+
108
+ return {
109
+ color: labelColor
110
+ };
111
+ });
112
+
113
+ // Animate the <Icon> color prop
114
+ const pressedColorIconAnimationStyle = useAnimatedProps(() => {
115
+ const iconColor = interpolateColor(
124
116
  progress.value,
125
117
  [0, 1],
126
- [colorMap[color].label.default, colorMap[color].label.pressed]
127
- )
128
- }));
118
+ [
119
+ mapColorStates[color].label.default,
120
+ mapColorStates[color].label.pressed
121
+ ]
122
+ );
123
+
124
+ return { color: iconColor };
125
+ });
129
126
 
130
127
  const AnimatedIconClassComponent =
131
128
  Animated.createAnimatedComponent(IconClassComponent);
@@ -168,15 +165,15 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
168
165
  <AnimatedIconClassComponent
169
166
  allowFontScaling
170
167
  name={icon}
171
- animatedProps={pressedColorAnimationStyle}
172
- color={colorMap[color]?.label?.default}
168
+ animatedProps={pressedColorIconAnimationStyle}
169
+ color={mapColorStates[color]?.label?.default}
173
170
  size={iconSize}
174
171
  />
175
172
  ) : (
176
173
  <AnimatedIcon
177
174
  allowFontScaling
178
175
  name={icon}
179
- color={colorMap[color]?.label?.disabled}
176
+ color={mapColorStates[color]?.label?.disabled}
180
177
  size={iconSize}
181
178
  />
182
179
  ))}
@@ -184,13 +181,13 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
184
181
  accessible={false}
185
182
  accessibilityElementsHidden
186
183
  importantForAccessibility="no-hide-descendants"
187
- font={isExperimental ? "Titillio" : "TitilliumSansPro"}
184
+ font={newTypefaceEnabled ? "Titillio" : "TitilliumSansPro"}
188
185
  weight={"Semibold"}
189
186
  size={buttonTextFontSize}
190
187
  style={
191
188
  disabled
192
- ? { color: colorMap[color]?.label?.disabled }
193
- : { ...pressedColorAnimationStyle }
189
+ ? { color: mapColorStates[color]?.label?.disabled }
190
+ : { ...pressedColorLabelAnimationStyle }
194
191
  }
195
192
  numberOfLines={1}
196
193
  ellipsizeMode="tail"
@@ -12,11 +12,10 @@ import Animated, {
12
12
  useReducedMotion
13
13
  } from "react-native-reanimated";
14
14
  import {
15
- IOButtonLegacyStyles,
16
15
  IOButtonStyles,
17
16
  IOColors,
18
17
  hexToRgba,
19
- useIOExperimentalDesign
18
+ useIONewTypeface
20
19
  } from "../../core/";
21
20
  import { useScaleAnimation } from "../../hooks";
22
21
  import { WithTestID } from "../../utils/types";
@@ -123,74 +122,6 @@ const mapColorStates: Record<
123
122
  }
124
123
  };
125
124
 
126
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
127
- const mapLegacyColorStates: Record<
128
- NonNullable<ButtonOutline["color"]>,
129
- ColorStates
130
- > = {
131
- // Primary button
132
- primary: {
133
- border: {
134
- default: IOColors.blue,
135
- pressed: IOColors.blue,
136
- disabled: IOColors.bluegreyLight
137
- },
138
- background: {
139
- default: hexToRgba(IOColors.blue, 0),
140
- pressed: hexToRgba(IOColors.blue, 0.15),
141
- disabled: "transparent"
142
- },
143
- label: {
144
- default: IOColors.blue,
145
- pressed: IOColors.blue,
146
- disabled: IOColors.grey
147
- }
148
- },
149
- // Contrast button
150
- contrast: {
151
- border: {
152
- default: IOColors.white,
153
- pressed: IOColors.white,
154
- disabled: hexToRgba(IOColors.white, 0.5)
155
- },
156
- background: {
157
- default: hexToRgba(IOColors.white, 0),
158
- pressed: hexToRgba(IOColors.white, 0.2),
159
- disabled: "transparent"
160
- },
161
- label: {
162
- default: IOColors.white,
163
- pressed: IOColors.white,
164
- disabled: hexToRgba(IOColors.white, 0.5)
165
- }
166
- },
167
- // Danger button
168
- danger: {
169
- border: {
170
- default: IOColors.red,
171
- pressed: IOColors.red,
172
- disabled: IOColors.bluegreyLight
173
- },
174
- background: {
175
- default: hexToRgba(IOColors.red, 0),
176
- pressed: hexToRgba(IOColors.red, 0.15),
177
- disabled: "transparent"
178
- },
179
- label: {
180
- default: IOColors.red,
181
- pressed: IOColors.red,
182
- disabled: IOColors.grey
183
- }
184
- }
185
- };
186
-
187
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
188
- const IOButtonLegacyStylesLocal = StyleSheet.create({
189
- buttonWithBorder: {
190
- borderWidth: 1
191
- }
192
- });
193
-
194
125
  // Icon size
195
126
  const iconSize: IOIconSizeScale = 20;
196
127
 
@@ -219,41 +150,32 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
219
150
  },
220
151
  ref
221
152
  ) => {
222
- const { isExperimental } = useIOExperimentalDesign();
153
+ const { newTypefaceEnabled } = useIONewTypeface();
223
154
  const { progress, onPressIn, onPressOut, scaleAnimatedStyle } =
224
155
  useScaleAnimation();
225
156
  const reducedMotion = useReducedMotion();
226
157
 
227
158
  const AnimatedIOText = Animated.createAnimatedComponent(IOText);
228
159
 
229
- const colorMap = React.useMemo(
230
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
231
- [isExperimental]
232
- );
233
-
234
- const buttonStyles = React.useMemo(
235
- () => (isExperimental ? IOButtonStyles : IOButtonLegacyStyles),
236
- [isExperimental]
237
- );
238
-
239
- const buttonStylesLocal = React.useMemo(
240
- () => (isExperimental ? IOButtonStylesLocal : IOButtonLegacyStylesLocal),
241
- [isExperimental]
242
- );
243
-
244
160
  // Interpolate animation values from `isPressed` values
245
161
  const pressedAnimationStyle = useAnimatedStyle(() => {
246
162
  // Link color states to the pressed states
247
163
  const backgroundColor = interpolateColor(
248
164
  progress.value,
249
165
  [0, 1],
250
- [colorMap[color].background.default, colorMap[color].background.pressed]
166
+ [
167
+ mapColorStates[color].background.default,
168
+ mapColorStates[color].background.pressed
169
+ ]
251
170
  );
252
171
 
253
172
  const borderColor = interpolateColor(
254
173
  progress.value,
255
174
  [0, 1],
256
- [colorMap[color].border.default, colorMap[color].border.pressed]
175
+ [
176
+ mapColorStates[color].border.default,
177
+ mapColorStates[color].border.pressed
178
+ ]
257
179
  );
258
180
 
259
181
  return {
@@ -266,7 +188,10 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
266
188
  color: interpolateColor(
267
189
  progress.value,
268
190
  [0, 1],
269
- [colorMap[color].border.default, colorMap[color].border.pressed]
191
+ [
192
+ mapColorStates[color].border.default,
193
+ mapColorStates[color].border.pressed
194
+ ]
270
195
  )
271
196
  }));
272
197
 
@@ -275,7 +200,10 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
275
200
  color: interpolateColor(
276
201
  progress.value,
277
202
  [0, 1],
278
- [colorMap[color].label.default, colorMap[color].label.pressed]
203
+ [
204
+ mapColorStates[color].label.default,
205
+ mapColorStates[color].label.pressed
206
+ ]
279
207
  )
280
208
  }));
281
209
 
@@ -299,21 +227,21 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
299
227
  >
300
228
  <Animated.View
301
229
  style={[
302
- buttonStyles.button,
303
- isExperimental && fullWidth && { paddingHorizontal: 16 },
304
- buttonStylesLocal.buttonWithBorder,
305
- buttonStyles.buttonSizeDefault,
230
+ IOButtonStyles.button,
231
+ IOButtonStyles.buttonSizeDefault,
232
+ IOButtonStylesLocal.buttonWithBorder,
233
+ fullWidth && { paddingHorizontal: 16 },
306
234
  { columnGap: ICON_MARGIN },
307
235
  iconPosition === "end" && { flexDirection: "row-reverse" },
308
236
  disabled
309
237
  ? {
310
- backgroundColor: colorMap[color]?.background?.disabled,
311
- borderColor: colorMap[color]?.border?.disabled,
238
+ backgroundColor: mapColorStates[color]?.background?.disabled,
239
+ borderColor: mapColorStates[color]?.border?.disabled,
312
240
  opacity: DISABLED_OPACITY
313
241
  }
314
242
  : {
315
- backgroundColor: colorMap[color]?.background?.default,
316
- borderColor: colorMap[color]?.border.default
243
+ backgroundColor: mapColorStates[color]?.background?.default,
244
+ borderColor: mapColorStates[color]?.border.default
317
245
  },
318
246
  /* Prevent Reanimated from overriding background colors
319
247
  if button is disabled */
@@ -327,19 +255,19 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
327
255
  allowFontScaling
328
256
  name={icon}
329
257
  animatedProps={pressedColorIconAnimationStyle}
330
- color={colorMap[color]?.label?.default}
258
+ color={mapColorStates[color]?.label?.default}
331
259
  size={iconSize}
332
260
  />
333
261
  ) : (
334
262
  <AnimatedIcon
335
263
  allowFontScaling
336
264
  name={icon}
337
- color={colorMap[color]?.label?.disabled}
265
+ color={mapColorStates[color]?.label?.disabled}
338
266
  size={iconSize}
339
267
  />
340
268
  ))}
341
269
  <AnimatedIOText
342
- font={isExperimental ? "Titillio" : "TitilliumSansPro"}
270
+ font={newTypefaceEnabled ? "Titillio" : "TitilliumSansPro"}
343
271
  weight={"Semibold"}
344
272
  size={buttonTextFontSize}
345
273
  accessible={false}
@@ -348,9 +276,9 @@ export const ButtonOutline = forwardRef<View, ButtonOutline>(
348
276
  numberOfLines={1}
349
277
  ellipsizeMode="tail"
350
278
  style={[
351
- buttonStyles.label,
279
+ IOButtonStyles.label,
352
280
  disabled
353
- ? { color: colorMap[color]?.label?.disabled }
281
+ ? { color: mapColorStates[color]?.label?.disabled }
354
282
  : { ...pressedColorLabelAnimationStyle }
355
283
  ]}
356
284
  >
@@ -12,13 +12,11 @@ import Animated, {
12
12
  useReducedMotion
13
13
  } from "react-native-reanimated";
14
14
  import {
15
- IOButtonLegacyStyles,
16
15
  IOButtonStyles,
17
16
  IOColors,
18
17
  enterTransitionInnerContent,
19
18
  enterTransitionInnerContentSmall,
20
- exitTransitionInnerContent,
21
- useIOExperimentalDesign
19
+ exitTransitionInnerContent
22
20
  } from "../../core";
23
21
  import { useScaleAnimation } from "../../hooks";
24
22
  import { WithTestID } from "../../utils/types";
@@ -37,15 +35,6 @@ type ColorStates = {
37
35
  };
38
36
  };
39
37
 
40
- // Disabled state
41
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
42
- const colorPrimaryLegacyButtonDisabled: IOColors = "bluegreyLight";
43
- const legacyStyles = StyleSheet.create({
44
- backgroundDisabled: {
45
- backgroundColor: IOColors[colorPrimaryLegacyButtonDisabled]
46
- }
47
- });
48
-
49
38
  const colorPrimaryButtonDisabled: IOColors = "grey-200";
50
39
  const ICON_MARGIN = 8;
51
40
  const DISABLED_OPACITY = 0.5;
@@ -120,40 +109,6 @@ const mapColorStates: Record<
120
109
  }
121
110
  };
122
111
 
123
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
124
- const mapLegacyColorStates: Record<
125
- NonNullable<ButtonSolidProps["color"]>,
126
- ColorStates
127
- > = {
128
- // Primary button
129
- primary: {
130
- default: IOColors.blue,
131
- pressed: IOColors["blue-600"],
132
- label: {
133
- default: "white",
134
- disabled: "white"
135
- }
136
- },
137
- // Danger button
138
- danger: {
139
- default: IOColors["error-600"],
140
- pressed: IOColors["error-500"],
141
- label: {
142
- default: "white",
143
- disabled: "white"
144
- }
145
- },
146
- // Contrast button
147
- contrast: {
148
- default: IOColors.white,
149
- pressed: IOColors["blue-50"],
150
- label: {
151
- default: "blue",
152
- disabled: "white"
153
- }
154
- }
155
- };
156
-
157
112
  export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
158
113
  (
159
114
  {
@@ -171,28 +126,17 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
171
126
  },
172
127
  ref
173
128
  ) => {
174
- const { isExperimental } = useIOExperimentalDesign();
175
129
  const { progress, onPressIn, onPressOut, scaleAnimatedStyle } =
176
130
  useScaleAnimation();
177
131
  const reducedMotion = useReducedMotion();
178
132
 
179
- const colorMap = React.useMemo(
180
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
181
- [isExperimental]
182
- );
183
-
184
- const buttonStyles = React.useMemo(
185
- () => (isExperimental ? IOButtonStyles : IOButtonLegacyStyles),
186
- [isExperimental]
187
- );
188
-
189
133
  // Interpolate animation values from `isPressed` values
190
134
  const pressedAnimationStyle = useAnimatedStyle(() => {
191
135
  // Link color states to the pressed states
192
136
  const backgroundColor = interpolateColor(
193
137
  progress.value,
194
138
  [0, 1],
195
- [colorMap[color].default, colorMap[color].pressed]
139
+ [mapColorStates[color].default, mapColorStates[color].pressed]
196
140
  );
197
141
 
198
142
  return { backgroundColor };
@@ -213,8 +157,8 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
213
157
 
214
158
  // Label & Icons colors
215
159
  const foregroundColor: IOColors = disabled
216
- ? colorMap[color]?.label?.disabled
217
- : colorMap[color]?.label?.default;
160
+ ? mapColorStates[color]?.label?.disabled
161
+ : mapColorStates[color]?.label?.default;
218
162
 
219
163
  return (
220
164
  <Pressable
@@ -237,15 +181,13 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
237
181
  >
238
182
  <Animated.View
239
183
  style={[
240
- buttonStyles.button,
184
+ IOButtonStyles.button,
185
+ IOButtonStyles.buttonSizeDefault,
241
186
  { overflow: "hidden" },
242
- isExperimental && fullWidth && { paddingHorizontal: 16 },
243
- buttonStyles.buttonSizeDefault,
187
+ fullWidth && { paddingHorizontal: 16 },
244
188
  disabled
245
- ? isExperimental
246
- ? styles.backgroundDisabled
247
- : legacyStyles.backgroundDisabled
248
- : { backgroundColor: colorMap[color]?.default },
189
+ ? styles.backgroundDisabled
190
+ : { backgroundColor: mapColorStates[color]?.default },
249
191
  /* Prevent Reanimated from overriding background colors
250
192
  if button is disabled */
251
193
  !disabled && !reducedMotion && scaleAnimatedStyle,
@@ -254,7 +196,7 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
254
196
  >
255
197
  {loading && (
256
198
  <Animated.View
257
- style={buttonStyles.buttonInner}
199
+ style={IOButtonStyles.buttonInner}
258
200
  entering={enterTransitionInnerContentSmall}
259
201
  exiting={exitTransitionInnerContent}
260
202
  >
@@ -265,7 +207,7 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
265
207
  {!loading && (
266
208
  <Animated.View
267
209
  style={[
268
- buttonStyles.buttonInner,
210
+ IOButtonStyles.buttonInner,
269
211
  { columnGap: ICON_MARGIN },
270
212
  /* If 'iconPosition' is set to 'end', we use
271
213
  reverse flex property to invert the position */
@@ -1,17 +1,11 @@
1
- import React, { useMemo } from "react";
1
+ import React from "react";
2
2
  import { GestureResponderEvent, Pressable } from "react-native";
3
3
  import Animated, {
4
4
  interpolateColor,
5
5
  useAnimatedProps,
6
6
  useReducedMotion
7
7
  } from "react-native-reanimated";
8
- import {
9
- IOColors,
10
- IOIconButtonStyles,
11
- IOStyles,
12
- hexToRgba,
13
- useIOExperimentalDesign
14
- } from "../../core";
8
+ import { IOColors, IOIconButtonStyles, IOStyles, hexToRgba } from "../../core";
15
9
  import { useScaleAnimation } from "../../hooks";
16
10
  import { WithTestID } from "../../utils/types";
17
11
  import {
@@ -39,37 +33,6 @@ type ColorStates = {
39
33
  };
40
34
  };
41
35
 
42
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
43
- const mapLegacyColorStates: Record<
44
- NonNullable<IconButton["color"]>,
45
- ColorStates
46
- > = {
47
- // Primary button
48
- primary: {
49
- icon: {
50
- default: IOColors.blue,
51
- pressed: IOColors["blue-600"],
52
- disabled: hexToRgba(IOColors.blue, 0.25)
53
- }
54
- },
55
- // Neutral button
56
- neutral: {
57
- icon: {
58
- default: IOColors.black,
59
- pressed: IOColors.bluegreyDark,
60
- disabled: IOColors.grey
61
- }
62
- },
63
- // Contrast button
64
- contrast: {
65
- icon: {
66
- default: IOColors.white,
67
- pressed: hexToRgba(IOColors.white, 0.85),
68
- disabled: hexToRgba(IOColors.white, 0.25)
69
- }
70
- }
71
- };
72
-
73
36
  const mapColorStates: Record<NonNullable<IconButton["color"]>, ColorStates> = {
74
37
  // Primary button
75
38
  primary: {
@@ -114,19 +77,12 @@ export const IconButton = ({
114
77
  useScaleAnimation("exaggerated");
115
78
  const reducedMotion = useReducedMotion();
116
79
 
117
- const { isExperimental } = useIOExperimentalDesign();
118
-
119
- const colorMap = useMemo(
120
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
121
- [isExperimental]
122
- );
123
-
124
80
  // Animate the <Icon> color prop
125
81
  const animatedColor = useAnimatedProps(() => {
126
82
  const iconColor = interpolateColor(
127
83
  progress.value,
128
84
  [0, 1],
129
- [colorMap[color].icon.default, colorMap[color].icon.pressed]
85
+ [mapColorStates[color].icon.default, mapColorStates[color].icon.pressed]
130
86
  );
131
87
  return { color: iconColor };
132
88
  });
@@ -164,14 +120,14 @@ export const IconButton = ({
164
120
  name={icon}
165
121
  size={iconSize}
166
122
  animatedProps={animatedColor}
167
- color={colorMap[color]?.icon?.default}
123
+ color={mapColorStates[color]?.icon?.default}
168
124
  />
169
125
  ) : (
170
126
  <AnimatedIcon
171
127
  allowFontScaling
172
128
  name={icon}
173
129
  size={iconSize}
174
- color={colorMap[color]?.icon?.disabled}
130
+ color={mapColorStates[color]?.icon?.disabled}
175
131
  />
176
132
  )}
177
133
  </Animated.View>