@pagopa/io-app-design-system 4.4.4 → 5.0.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 (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 -5
  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 -6
  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 -6
  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,4 +1,4 @@
1
- import React, { forwardRef, useMemo } from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import {
3
3
  GestureResponderEvent,
4
4
  Pressable,
@@ -7,6 +7,7 @@ import {
7
7
  } from "react-native";
8
8
  import Animated, {
9
9
  interpolateColor,
10
+ useAnimatedProps,
10
11
  useAnimatedStyle,
11
12
  useReducedMotion
12
13
  } from "react-native-reanimated";
@@ -15,7 +16,7 @@ import {
15
16
  IOColors,
16
17
  IOSpacingScale,
17
18
  hexToRgba,
18
- useIOExperimentalDesign
19
+ useIONewTypeface
19
20
  } from "../../core";
20
21
  import { useScaleAnimation } from "../../hooks";
21
22
  import { WithTestID } from "../../utils/types";
@@ -78,28 +79,6 @@ const mapColorStates: Record<
78
79
  }
79
80
  };
80
81
 
81
- // TODO: Remove this when legacy look is deprecated https://pagopa.atlassian.net/browse/IOPLT-153
82
- const mapLegacyColorStates: Record<
83
- NonNullable<ButtonLinkProps["color"]>,
84
- ColorStates
85
- > = {
86
- // Primary button
87
- primary: {
88
- label: {
89
- default: IOColors.blue,
90
- pressed: IOColors["blue-600"],
91
- disabled: IOColors["grey-700"]
92
- }
93
- },
94
- contrast: {
95
- label: {
96
- default: IOColors.white,
97
- pressed: hexToRgba(IOColors.white, 0.85),
98
- disabled: hexToRgba(IOColors.white, 0.5)
99
- }
100
- }
101
- };
102
-
103
82
  const DISABLED_OPACITY = 0.5;
104
83
  const ICON_MARGIN = 8;
105
84
 
@@ -120,25 +99,43 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
120
99
  },
121
100
  ref
122
101
  ) => {
123
- const { isExperimental } = useIOExperimentalDesign();
102
+ const { newTypefaceEnabled } = useIONewTypeface();
124
103
  const { progress, onPressIn, onPressOut, scaleAnimatedStyle } =
125
104
  useScaleAnimation();
126
105
  const reducedMotion = useReducedMotion();
127
106
 
128
- const colorMap = useMemo(
129
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
130
- [isExperimental]
131
- );
132
-
133
107
  const AnimatedIOText = Animated.createAnimatedComponent(IOText);
134
108
 
135
- const pressedColorAnimationStyle = useAnimatedStyle(() => ({
136
- color: interpolateColor(
109
+ const pressedColorLabelAnimationStyle = useAnimatedStyle(() => {
110
+ // Link color states to the pressed states
111
+
112
+ const labelColor = interpolateColor(
113
+ progress.value,
114
+ [0, 1],
115
+ [
116
+ mapColorStates[color].label.default,
117
+ mapColorStates[color].label.pressed
118
+ ]
119
+ );
120
+
121
+ return {
122
+ color: labelColor
123
+ };
124
+ });
125
+
126
+ // Animate the <Icon> color prop
127
+ const pressedColorIconAnimationStyle = useAnimatedProps(() => {
128
+ const iconColor = interpolateColor(
137
129
  progress.value,
138
130
  [0, 1],
139
- [colorMap[color].label.default, colorMap[color].label.pressed]
140
- )
141
- }));
131
+ [
132
+ mapColorStates[color].label.default,
133
+ mapColorStates[color].label.pressed
134
+ ]
135
+ );
136
+
137
+ return { color: iconColor };
138
+ });
142
139
 
143
140
  const AnimatedIconClassComponent =
144
141
  Animated.createAnimatedComponent(IconClassComponent);
@@ -181,15 +178,15 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
181
178
  <AnimatedIconClassComponent
182
179
  allowFontScaling
183
180
  name={icon}
184
- animatedProps={pressedColorAnimationStyle}
185
- color={colorMap[color]?.label?.default}
181
+ animatedProps={pressedColorIconAnimationStyle}
182
+ color={mapColorStates[color]?.label?.default}
186
183
  size={iconSize}
187
184
  />
188
185
  ) : (
189
186
  <AnimatedIcon
190
187
  allowFontScaling
191
188
  name={icon}
192
- color={colorMap[color]?.label?.disabled}
189
+ color={mapColorStates[color]?.label?.disabled}
193
190
  size={iconSize}
194
191
  />
195
192
  ))}
@@ -197,14 +194,14 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
197
194
  accessible={false}
198
195
  accessibilityElementsHidden
199
196
  importantForAccessibility="no-hide-descendants"
200
- font={isExperimental ? "Titillio" : "TitilliumSansPro"}
197
+ font={newTypefaceEnabled ? "Titillio" : "TitilliumSansPro"}
201
198
  weight={"Semibold"}
202
199
  size={buttonTextFontSize}
203
200
  lineHeight={buttonTextLineHeight}
204
201
  style={[
205
202
  disabled
206
- ? { color: colorMap[color]?.label?.disabled }
207
- : { ...pressedColorAnimationStyle },
203
+ ? { color: mapColorStates[color]?.label?.disabled }
204
+ : { ...pressedColorLabelAnimationStyle },
208
205
  { textAlign }
209
206
  ]}
210
207
  numberOfLines={numberOfLines}
@@ -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,21 +126,10 @@ 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
  /* Prevent the component from triggering the `isEntering' transition
190
134
  on the on the first render. Solution from this discussion:
191
135
  https://github.com/software-mansion/react-native-reanimated/discussions/2513
@@ -203,7 +147,7 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
203
147
  const backgroundColor = interpolateColor(
204
148
  progress.value,
205
149
  [0, 1],
206
- [colorMap[color].default, colorMap[color].pressed]
150
+ [mapColorStates[color].default, mapColorStates[color].pressed]
207
151
  );
208
152
 
209
153
  return { backgroundColor };
@@ -224,8 +168,8 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
224
168
 
225
169
  // Label & Icons colors
226
170
  const foregroundColor: IOColors = disabled
227
- ? colorMap[color]?.label?.disabled
228
- : colorMap[color]?.label?.default;
171
+ ? mapColorStates[color]?.label?.disabled
172
+ : mapColorStates[color]?.label?.default;
229
173
 
230
174
  return (
231
175
  <Pressable
@@ -248,15 +192,13 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
248
192
  >
249
193
  <Animated.View
250
194
  style={[
251
- buttonStyles.button,
195
+ IOButtonStyles.button,
196
+ IOButtonStyles.buttonSizeDefault,
252
197
  { overflow: "hidden" },
253
- isExperimental && fullWidth && { paddingHorizontal: 16 },
254
- buttonStyles.buttonSizeDefault,
198
+ fullWidth && { paddingHorizontal: 16 },
255
199
  disabled
256
- ? isExperimental
257
- ? styles.backgroundDisabled
258
- : legacyStyles.backgroundDisabled
259
- : { backgroundColor: colorMap[color]?.default },
200
+ ? styles.backgroundDisabled
201
+ : { backgroundColor: mapColorStates[color]?.default },
260
202
  /* Prevent Reanimated from overriding background colors
261
203
  if button is disabled */
262
204
  !disabled && !reducedMotion && scaleAnimatedStyle,
@@ -265,7 +207,7 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
265
207
  >
266
208
  {loading && (
267
209
  <Animated.View
268
- style={buttonStyles.buttonInner}
210
+ style={IOButtonStyles.buttonInner}
269
211
  entering={
270
212
  isMounted.current ? enterTransitionInnerContentSmall : undefined
271
213
  }
@@ -278,7 +220,7 @@ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
278
220
  {!loading && (
279
221
  <Animated.View
280
222
  style={[
281
- buttonStyles.buttonInner,
223
+ IOButtonStyles.buttonInner,
282
224
  { columnGap: ICON_MARGIN },
283
225
  /* If 'iconPosition' is set to 'end', we use
284
226
  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>