@pagopa/io-app-design-system 1.11.3 → 1.13.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 (288) hide show
  1. package/lib/commonjs/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
  2. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
  3. package/lib/commonjs/components/buttons/ButtonLink.js +3 -5
  4. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  5. package/lib/commonjs/components/buttons/ButtonOutline.js +6 -6
  6. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  7. package/lib/commonjs/components/buttons/ButtonSolid.js +40 -12
  8. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  9. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
  10. package/lib/commonjs/components/icons/Icon.js +6 -0
  11. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  12. package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js +31 -0
  13. package/lib/commonjs/components/icons/svg/IconDocPaymentCode.js.map +1 -0
  14. package/lib/commonjs/components/icons/svg/IconEntityCode.js +31 -0
  15. package/lib/commonjs/components/icons/svg/IconEntityCode.js.map +1 -0
  16. package/lib/commonjs/components/icons/svg/IconNotes.js +31 -0
  17. package/lib/commonjs/components/icons/svg/IconNotes.js.map +1 -0
  18. package/lib/commonjs/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
  19. package/lib/commonjs/components/icons/svg/originals/IconEntityCode.svg +3 -0
  20. package/lib/commonjs/components/icons/svg/originals/IconNotes.svg +3 -0
  21. package/lib/commonjs/components/index.js +22 -0
  22. package/lib/commonjs/components/index.js.map +1 -1
  23. package/lib/commonjs/components/layout/BlockButtons.js +1 -4
  24. package/lib/commonjs/components/layout/BlockButtons.js.map +1 -1
  25. package/lib/commonjs/components/layout/Dismissable.js +60 -0
  26. package/lib/commonjs/components/layout/Dismissable.js.map +1 -0
  27. package/lib/commonjs/components/layout/FooterWithButtons.js +20 -9
  28. package/lib/commonjs/components/layout/FooterWithButtons.js.map +1 -1
  29. package/lib/commonjs/components/layout/HeaderFirstLevel.js +14 -5
  30. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  31. package/lib/commonjs/components/layout/HeaderSecondLevel.js +15 -12
  32. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  33. package/lib/commonjs/components/layout/common.js +6 -0
  34. package/lib/commonjs/components/layout/common.js.map +1 -0
  35. package/lib/commonjs/components/layout/index.js +11 -0
  36. package/lib/commonjs/components/layout/index.js.map +1 -1
  37. package/lib/commonjs/components/listitems/ListItemTransaction.js +5 -4
  38. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  39. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
  40. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js +94 -0
  41. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js.map +1 -0
  42. package/lib/commonjs/components/loadingSpinner/index.js +17 -0
  43. package/lib/commonjs/components/loadingSpinner/index.js.map +1 -0
  44. package/lib/commonjs/components/logos/LogoPaymentCard.js +50 -0
  45. package/lib/commonjs/components/logos/LogoPaymentCard.js.map +1 -0
  46. package/lib/commonjs/components/logos/LogoPaymentExt.js +1 -1
  47. package/lib/commonjs/components/logos/LogoPaymentExt.js.map +1 -1
  48. package/lib/commonjs/components/logos/README.md +2 -1
  49. package/lib/commonjs/components/logos/index.js +20 -1
  50. package/lib/commonjs/components/logos/index.js.map +1 -1
  51. package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js +33 -0
  52. package/lib/commonjs/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
  53. package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js +42 -0
  54. package/lib/commonjs/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
  55. package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
  56. package/lib/commonjs/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
  57. package/lib/commonjs/components/pictograms/Pictogram.js +5 -1
  58. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  59. package/lib/commonjs/components/pictograms/svg/PictogramBleedNotification.js +47 -0
  60. package/lib/commonjs/components/pictograms/svg/PictogramBleedNotification.js.map +1 -0
  61. package/lib/commonjs/components/pictograms/svg/PictogramNotification.js +47 -0
  62. package/lib/commonjs/components/pictograms/svg/PictogramNotification.js.map +1 -0
  63. package/lib/commonjs/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
  64. package/lib/commonjs/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
  65. package/lib/commonjs/components/toast/ToastNotification.js +73 -0
  66. package/lib/commonjs/components/toast/ToastNotification.js.map +1 -0
  67. package/lib/commonjs/components/toast/ToastProvider.js +135 -0
  68. package/lib/commonjs/components/toast/ToastProvider.js.map +1 -0
  69. package/lib/commonjs/components/toast/context.js +14 -0
  70. package/lib/commonjs/components/toast/context.js.map +1 -0
  71. package/lib/commonjs/components/toast/index.js +39 -0
  72. package/lib/commonjs/components/toast/index.js.map +1 -0
  73. package/lib/commonjs/components/toast/types.js +6 -0
  74. package/lib/commonjs/components/toast/types.js.map +1 -0
  75. package/lib/commonjs/components/toast/useIOToast.js +94 -0
  76. package/lib/commonjs/components/toast/useIOToast.js.map +1 -0
  77. package/lib/commonjs/components/typography/BaseTypography.js +3 -1
  78. package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
  79. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
  80. package/lib/commonjs/core/IOStyles.js +10 -0
  81. package/lib/commonjs/core/IOStyles.js.map +1 -1
  82. package/lib/commonjs/core/IOTransitions.js +106 -0
  83. package/lib/commonjs/core/IOTransitions.js.map +1 -0
  84. package/lib/commonjs/core/index.js +11 -0
  85. package/lib/commonjs/core/index.js.map +1 -1
  86. package/lib/module/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
  87. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
  88. package/lib/module/components/buttons/ButtonLink.js +3 -5
  89. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  90. package/lib/module/components/buttons/ButtonOutline.js +6 -6
  91. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  92. package/lib/module/components/buttons/ButtonSolid.js +40 -13
  93. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  94. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
  95. package/lib/module/components/icons/Icon.js +6 -0
  96. package/lib/module/components/icons/Icon.js.map +1 -1
  97. package/lib/module/components/icons/svg/IconDocPaymentCode.js +23 -0
  98. package/lib/module/components/icons/svg/IconDocPaymentCode.js.map +1 -0
  99. package/lib/module/components/icons/svg/IconEntityCode.js +23 -0
  100. package/lib/module/components/icons/svg/IconEntityCode.js.map +1 -0
  101. package/lib/module/components/icons/svg/IconNotes.js +23 -0
  102. package/lib/module/components/icons/svg/IconNotes.js.map +1 -0
  103. package/lib/module/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
  104. package/lib/module/components/icons/svg/originals/IconEntityCode.svg +3 -0
  105. package/lib/module/components/icons/svg/originals/IconNotes.svg +3 -0
  106. package/lib/module/components/index.js +2 -0
  107. package/lib/module/components/index.js.map +1 -1
  108. package/lib/module/components/layout/BlockButtons.js +1 -4
  109. package/lib/module/components/layout/BlockButtons.js.map +1 -1
  110. package/lib/module/components/layout/Dismissable.js +51 -0
  111. package/lib/module/components/layout/Dismissable.js.map +1 -0
  112. package/lib/module/components/layout/FooterWithButtons.js +20 -10
  113. package/lib/module/components/layout/FooterWithButtons.js.map +1 -1
  114. package/lib/module/components/layout/HeaderFirstLevel.js +14 -5
  115. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  116. package/lib/module/components/layout/HeaderSecondLevel.js +15 -12
  117. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  118. package/lib/module/components/layout/common.js +2 -0
  119. package/lib/module/components/layout/common.js.map +1 -0
  120. package/lib/module/components/layout/index.js +1 -0
  121. package/lib/module/components/layout/index.js.map +1 -1
  122. package/lib/module/components/listitems/ListItemTransaction.js +5 -4
  123. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  124. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
  125. package/lib/module/components/loadingSpinner/LoadingSpinner.js +86 -0
  126. package/lib/module/components/loadingSpinner/LoadingSpinner.js.map +1 -0
  127. package/lib/module/components/loadingSpinner/index.js +2 -0
  128. package/lib/module/components/loadingSpinner/index.js.map +1 -0
  129. package/lib/module/components/logos/LogoPaymentCard.js +43 -0
  130. package/lib/module/components/logos/LogoPaymentCard.js.map +1 -0
  131. package/lib/module/components/logos/LogoPaymentExt.js +1 -1
  132. package/lib/module/components/logos/LogoPaymentExt.js.map +1 -1
  133. package/lib/module/components/logos/README.md +2 -1
  134. package/lib/module/components/logos/index.js +2 -0
  135. package/lib/module/components/logos/index.js.map +1 -1
  136. package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js +25 -0
  137. package/lib/module/components/logos/svg/LogoPaymentCardBancomatPay.js.map +1 -0
  138. package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js +34 -0
  139. package/lib/module/components/logos/svg/LogoPaymentCardPayPal.js.map +1 -0
  140. package/lib/module/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
  141. package/lib/module/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
  142. package/lib/module/components/pictograms/Pictogram.js +5 -1
  143. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  144. package/lib/module/components/pictograms/svg/PictogramBleedNotification.js +39 -0
  145. package/lib/module/components/pictograms/svg/PictogramBleedNotification.js.map +1 -0
  146. package/lib/module/components/pictograms/svg/PictogramNotification.js +39 -0
  147. package/lib/module/components/pictograms/svg/PictogramNotification.js.map +1 -0
  148. package/lib/module/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
  149. package/lib/module/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
  150. package/lib/module/components/toast/ToastNotification.js +66 -0
  151. package/lib/module/components/toast/ToastNotification.js.map +1 -0
  152. package/lib/module/components/toast/ToastProvider.js +123 -0
  153. package/lib/module/components/toast/ToastProvider.js.map +1 -0
  154. package/lib/module/components/toast/context.js +7 -0
  155. package/lib/module/components/toast/context.js.map +1 -0
  156. package/lib/module/components/toast/index.js +4 -0
  157. package/lib/module/components/toast/index.js.map +1 -0
  158. package/lib/module/components/toast/types.js +2 -0
  159. package/lib/module/components/toast/types.js.map +1 -0
  160. package/lib/module/components/toast/useIOToast.js +84 -0
  161. package/lib/module/components/toast/useIOToast.js.map +1 -0
  162. package/lib/module/components/typography/BaseTypography.js +3 -1
  163. package/lib/module/components/typography/BaseTypography.js.map +1 -1
  164. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
  165. package/lib/module/core/IOStyles.js +10 -0
  166. package/lib/module/core/IOStyles.js.map +1 -1
  167. package/lib/module/core/IOTransitions.js +98 -0
  168. package/lib/module/core/IOTransitions.js.map +1 -0
  169. package/lib/module/core/index.js +1 -0
  170. package/lib/module/core/index.js.map +1 -1
  171. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  172. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  173. package/lib/typescript/components/buttons/ButtonSolid.d.ts +5 -1
  174. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  175. package/lib/typescript/components/icons/Icon.d.ts +3 -0
  176. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  177. package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts +5 -0
  178. package/lib/typescript/components/icons/svg/IconDocPaymentCode.d.ts.map +1 -0
  179. package/lib/typescript/components/icons/svg/IconEntityCode.d.ts +5 -0
  180. package/lib/typescript/components/icons/svg/IconEntityCode.d.ts.map +1 -0
  181. package/lib/typescript/components/icons/svg/IconNotes.d.ts +5 -0
  182. package/lib/typescript/components/icons/svg/IconNotes.d.ts.map +1 -0
  183. package/lib/typescript/components/index.d.ts +2 -0
  184. package/lib/typescript/components/index.d.ts.map +1 -1
  185. package/lib/typescript/components/layout/Dismissable.d.ts +18 -0
  186. package/lib/typescript/components/layout/Dismissable.d.ts.map +1 -0
  187. package/lib/typescript/components/layout/FooterWithButtons.d.ts +4 -1
  188. package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +1 -1
  189. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts +28 -5
  190. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  191. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts +8 -3
  192. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  193. package/lib/typescript/components/layout/common.d.ts +4 -0
  194. package/lib/typescript/components/layout/common.d.ts.map +1 -0
  195. package/lib/typescript/components/layout/index.d.ts +1 -0
  196. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  197. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +2 -1
  198. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  199. package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts +17 -0
  200. package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts.map +1 -0
  201. package/lib/typescript/components/loadingSpinner/index.d.ts +2 -0
  202. package/lib/typescript/components/loadingSpinner/index.d.ts.map +1 -0
  203. package/lib/typescript/components/logos/LogoPaymentCard.d.ts +19 -0
  204. package/lib/typescript/components/logos/LogoPaymentCard.d.ts.map +1 -0
  205. package/lib/typescript/components/logos/index.d.ts +2 -0
  206. package/lib/typescript/components/logos/index.d.ts.map +1 -1
  207. package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts +5 -0
  208. package/lib/typescript/components/logos/svg/LogoPaymentCardBancomatPay.d.ts.map +1 -0
  209. package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts +5 -0
  210. package/lib/typescript/components/logos/svg/LogoPaymentCardPayPal.d.ts.map +1 -0
  211. package/lib/typescript/components/pictograms/Pictogram.d.ts +2 -1
  212. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  213. package/lib/typescript/components/pictograms/svg/PictogramBleedNotification.d.ts +5 -0
  214. package/lib/typescript/components/pictograms/svg/PictogramBleedNotification.d.ts.map +1 -0
  215. package/lib/typescript/components/pictograms/svg/PictogramNotification.d.ts +5 -0
  216. package/lib/typescript/components/pictograms/svg/PictogramNotification.d.ts.map +1 -0
  217. package/lib/typescript/components/radio/RadioGroup.d.ts +2 -2
  218. package/lib/typescript/components/radio/RadioGroup.d.ts.map +1 -1
  219. package/lib/typescript/components/toast/ToastNotification.d.ts +6 -0
  220. package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -0
  221. package/lib/typescript/components/toast/ToastProvider.d.ts +22 -0
  222. package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -0
  223. package/lib/typescript/components/toast/context.d.ts +9 -0
  224. package/lib/typescript/components/toast/context.d.ts.map +1 -0
  225. package/lib/typescript/components/toast/index.d.ts +4 -0
  226. package/lib/typescript/components/toast/index.d.ts.map +1 -0
  227. package/lib/typescript/components/toast/types.d.ts +11 -0
  228. package/lib/typescript/components/toast/types.d.ts.map +1 -0
  229. package/lib/typescript/components/toast/useIOToast.d.ts +23 -0
  230. package/lib/typescript/components/toast/useIOToast.d.ts.map +1 -0
  231. package/lib/typescript/core/IOStyles.d.ts +10 -0
  232. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  233. package/lib/typescript/core/IOTransitions.d.ts +58 -0
  234. package/lib/typescript/core/IOTransitions.d.ts.map +1 -0
  235. package/lib/typescript/core/index.d.ts +1 -0
  236. package/lib/typescript/core/index.d.ts.map +1 -1
  237. package/lib/typescript/stories/ButtonDS.stories.d.ts +1 -1
  238. package/package.json +3 -1
  239. package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +1 -0
  240. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +3 -0
  241. package/src/components/buttons/ButtonLink.tsx +2 -4
  242. package/src/components/buttons/ButtonOutline.tsx +3 -4
  243. package/src/components/buttons/ButtonSolid.tsx +68 -24
  244. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +52 -26
  245. package/src/components/icons/Icon.tsx +6 -0
  246. package/src/components/icons/svg/IconDocPaymentCode.tsx +16 -0
  247. package/src/components/icons/svg/IconEntityCode.tsx +16 -0
  248. package/src/components/icons/svg/IconNotes.tsx +16 -0
  249. package/src/components/icons/svg/originals/IconDocPaymentCode.svg +3 -0
  250. package/src/components/icons/svg/originals/IconEntityCode.svg +3 -0
  251. package/src/components/icons/svg/originals/IconNotes.svg +3 -0
  252. package/src/components/index.tsx +2 -0
  253. package/src/components/layout/BlockButtons.tsx +1 -1
  254. package/src/components/layout/Dismissable.tsx +76 -0
  255. package/src/components/layout/FooterWithButtons.tsx +11 -5
  256. package/src/components/layout/HeaderFirstLevel.tsx +41 -13
  257. package/src/components/layout/HeaderSecondLevel.tsx +30 -26
  258. package/src/components/layout/common.ts +7 -0
  259. package/src/components/layout/index.tsx +1 -0
  260. package/src/components/listitems/ListItemTransaction.tsx +7 -5
  261. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +2 -0
  262. package/src/components/loadingSpinner/LoadingSpinner.tsx +121 -0
  263. package/src/components/loadingSpinner/index.tsx +1 -0
  264. package/src/components/logos/LogoPaymentCard.tsx +62 -0
  265. package/src/components/logos/LogoPaymentExt.tsx +1 -1
  266. package/src/components/logos/README.md +2 -1
  267. package/src/components/logos/index.tsx +2 -0
  268. package/src/components/logos/svg/LogoPaymentCardBancomatPay.tsx +28 -0
  269. package/src/components/logos/svg/LogoPaymentCardPayPal.tsx +38 -0
  270. package/src/components/logos/svg/originals/LogoPaymentCardBancomatPay.svg +18 -0
  271. package/src/components/logos/svg/originals/LogoPaymentCardPayPal.svg +30 -0
  272. package/src/components/pictograms/Pictogram.tsx +7 -2
  273. package/src/components/pictograms/svg/PictogramBleedNotification.tsx +42 -0
  274. package/src/components/pictograms/svg/PictogramNotification.tsx +42 -0
  275. package/src/components/pictograms/svg/originals/PictogramBleedNotification.svg +30 -0
  276. package/src/components/pictograms/svg/originals/PictogramNotification.svg +30 -0
  277. package/src/components/radio/RadioGroup.tsx +2 -2
  278. package/src/components/toast/ToastNotification.tsx +76 -0
  279. package/src/components/toast/ToastProvider.tsx +153 -0
  280. package/src/components/toast/context.ts +14 -0
  281. package/src/components/toast/index.ts +3 -0
  282. package/src/components/toast/types.ts +13 -0
  283. package/src/components/toast/useIOToast.ts +88 -0
  284. package/src/components/typography/BaseTypography.tsx +1 -1
  285. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +31 -0
  286. package/src/core/IOStyles.ts +10 -0
  287. package/src/core/IOTransitions.ts +94 -0
  288. package/src/core/index.ts +1 -0
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { Svg, Path } from "react-native-svg";
3
+ import { SVGIconProps } from "../Icon";
4
+
5
+ const IconEntityCode = ({ size, style, ...props }: SVGIconProps) => (
6
+ <Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
7
+ <Path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M4 4H20C21.1046 4 22 4.89543 22 6V18C22 19.1046 21.1046 20 20 20H4C2.89543 20 2 19.1046 2 18V6C2 4.89543 2.89543 4 4 4ZM0 6C0 3.79086 1.79086 2 4 2H20C22.2091 2 24 3.79086 24 6V18C24 20.2091 22.2091 22 20 22H4C1.79086 22 0 20.2091 0 18V6ZM7.20416 8.26887C7.76751 7.91038 8.48744 7.91038 9.05078 8.26887L11.7771 10.0038C12.0747 10.1932 12.2549 10.5215 12.2549 10.8743V11.5286C12.2549 11.7185 12.1009 11.8725 11.911 11.8725H11.567V15.656C11.567 15.846 11.413 16 11.2231 16H9.84725C9.65729 16 9.5033 15.846 9.5033 15.656V11.8725H6.75165V15.656C6.75165 15.846 6.59765 16 6.40769 16H5.03187C4.84191 16 4.68791 15.846 4.68791 15.656V11.8725H4.34396C4.15399 11.8725 4 11.7185 4 11.5286V10.8743C4 10.5215 4.18024 10.1932 4.47788 10.0038L7.20416 8.26887ZM15 9C14.4477 9 14 9.44772 14 10C14 10.5523 14.4477 11 15 11H17C17.5523 11 18 10.5523 18 10C18 9.44772 17.5523 9 17 9H15ZM14 14C14 13.4477 14.4477 13 15 13H19C19.5523 13 20 13.4477 20 14C20 14.5523 19.5523 15 19 15H15C14.4477 15 14 14.5523 14 14Z"
11
+ fill="currentColor"
12
+ />
13
+ </Svg>
14
+ );
15
+
16
+ export default IconEntityCode;
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { Svg, Path } from "react-native-svg";
3
+ import { SVGIconProps } from "../Icon";
4
+
5
+ const IconNotes = ({ size, style, ...props }: SVGIconProps) => (
6
+ <Svg width={size} height={size} viewBox="0 0 24 24" style={style} {...props}>
7
+ <Path
8
+ fillRule="evenodd"
9
+ clipRule="evenodd"
10
+ d="M5 2C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V10H17C15.3431 10 14 8.65685 14 7V2H5ZM16 2.49902V7C16 7.55229 16.4477 8 17 8H21.501C21.3911 7.83409 21.2641 7.67835 21.1213 7.53553L16.4645 2.87868C16.3216 2.73586 16.1659 2.60893 16 2.49902ZM0 5C0 2.23858 2.23858 0 5 0H14.3431C15.6692 0 16.941 0.526784 17.8787 1.46447L22.5355 6.12132C23.4732 7.059 24 8.33077 24 9.65685V19C24 21.7614 21.7614 24 19 24H5C2.23858 24 0 21.7614 0 19V5ZM5 6.5C5 5.67157 5.67157 5 6.5 5H9.5C10.3284 5 11 5.67157 11 6.5C11 7.32843 10.3284 8 9.5 8H6.5C5.67157 8 5 7.32843 5 6.5ZM6 13C5.44772 13 5 13.4477 5 14C5 14.5523 5.44772 15 6 15H18C18.5523 15 19 14.5523 19 14C19 13.4477 18.5523 13 18 13H6ZM5 18C5 17.4477 5.44772 17 6 17H18C18.5523 17 19 17.4477 19 18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18Z"
11
+ fill="currentColor"
12
+ />
13
+ </Svg>
14
+ );
15
+
16
+ export default IconNotes;
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5 2C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V10H17C15.3431 10 14 8.65685 14 7V2H5ZM16 2.49902V7C16 7.55229 16.4477 8 17 8H21.501C21.3911 7.83409 21.2641 7.67835 21.1213 7.53553L16.4645 2.87868C16.3216 2.73586 16.1659 2.60893 16 2.49902ZM0 5C0 2.23858 2.23858 0 5 0H14.3431C15.6692 0 16.941 0.526784 17.8787 1.46447L22.5355 6.12132C23.4732 7.059 24 8.33077 24 9.65685V19C24 21.7614 21.7614 24 19 24H5C2.23858 24 0 21.7614 0 19V5ZM5 17.5C5 16.6716 5.67157 16 6.5 16C7.32843 16 8 16.6716 8 17.5C8 18.3284 7.32843 19 6.5 19C5.67157 19 5 18.3284 5 17.5ZM10 17.5C10 16.6716 10.6716 16 11.5 16H14.5C15.3284 16 16 16.6716 16 17.5C16 18.3284 15.3284 19 14.5 19H11.5C10.6716 19 10 18.3284 10 17.5Z" fill="#BBC2D6"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H20C21.1046 4 22 4.89543 22 6V18C22 19.1046 21.1046 20 20 20H4C2.89543 20 2 19.1046 2 18V6C2 4.89543 2.89543 4 4 4ZM0 6C0 3.79086 1.79086 2 4 2H20C22.2091 2 24 3.79086 24 6V18C24 20.2091 22.2091 22 20 22H4C1.79086 22 0 20.2091 0 18V6ZM7.20416 8.26887C7.76751 7.91038 8.48744 7.91038 9.05078 8.26887L11.7771 10.0038C12.0747 10.1932 12.2549 10.5215 12.2549 10.8743V11.5286C12.2549 11.7185 12.1009 11.8725 11.911 11.8725H11.567V15.656C11.567 15.846 11.413 16 11.2231 16H9.84725C9.65729 16 9.5033 15.846 9.5033 15.656V11.8725H6.75165V15.656C6.75165 15.846 6.59765 16 6.40769 16H5.03187C4.84191 16 4.68791 15.846 4.68791 15.656V11.8725H4.34396C4.15399 11.8725 4 11.7185 4 11.5286V10.8743C4 10.5215 4.18024 10.1932 4.47788 10.0038L7.20416 8.26887ZM15 9C14.4477 9 14 9.44772 14 10C14 10.5523 14.4477 11 15 11H17C17.5523 11 18 10.5523 18 10C18 9.44772 17.5523 9 17 9H15ZM14 14C14 13.4477 14.4477 13 15 13H19C19.5523 13 20 13.4477 20 14C20 14.5523 19.5523 15 19 15H15C14.4477 15 14 14.5523 14 14Z" fill="#2B2E38"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M5 2C3.34315 2 2 3.34315 2 5V19C2 20.6569 3.34315 22 5 22H19C20.6569 22 22 20.6569 22 19V10H17C15.3431 10 14 8.65685 14 7V2H5ZM16 2.49902V7C16 7.55229 16.4477 8 17 8H21.501C21.3911 7.83409 21.2641 7.67835 21.1213 7.53553L16.4645 2.87868C16.3216 2.73586 16.1659 2.60893 16 2.49902ZM0 5C0 2.23858 2.23858 0 5 0H14.3431C15.6692 0 16.941 0.526784 17.8787 1.46447L22.5355 6.12132C23.4732 7.059 24 8.33077 24 9.65685V19C24 21.7614 21.7614 24 19 24H5C2.23858 24 0 21.7614 0 19V5ZM5 6.5C5 5.67157 5.67157 5 6.5 5H9.5C10.3284 5 11 5.67157 11 6.5C11 7.32843 10.3284 8 9.5 8H6.5C5.67157 8 5 7.32843 5 6.5ZM6 13C5.44772 13 5 13.4477 5 14C5 14.5523 5.44772 15 6 15H18C18.5523 15 19 14.5523 19 14C19 13.4477 18.5523 13 18 13H6ZM5 18C5 17.4477 5.44772 17 6 17H18C18.5523 17 19 17.4477 19 18C19 18.5523 18.5523 19 18 19H6C5.44772 19 5 18.5523 5 18Z" fill="#BBC2D6"/>
3
+ </svg>
@@ -10,6 +10,7 @@ export * from "./featureInfo";
10
10
  export * from "./icons";
11
11
  export * from "./listitems";
12
12
  export * from "./logos";
13
+ export * from "./loadingSpinner";
13
14
  export * from "./modules";
14
15
  export * from "./banner";
15
16
  export * from "./pictograms";
@@ -18,6 +19,7 @@ export * from "./spacer";
18
19
  export * from "./switch";
19
20
  export * from "./tag";
20
21
  export * from "./tabs";
22
+ export * from "./toast";
21
23
  export * from "./typography";
22
24
  export * from "./textInput";
23
25
  export * from "./layout";
@@ -133,7 +133,7 @@ export const BlockButtons = (props: Props) => {
133
133
  );
134
134
 
135
135
  return (
136
- <View style={{ ...IOStyles.flex, ...IOStyles.row }}>
136
+ <View style={IOStyles.row}>
137
137
  {renderLeftButton()}
138
138
  {renderMidButton()}
139
139
  {renderRightButton()}
@@ -0,0 +1,76 @@
1
+ import React from "react";
2
+ import { Dimensions } from "react-native";
3
+ import { Gesture, GestureDetector } from "react-native-gesture-handler";
4
+ import Animated, {
5
+ Easing,
6
+ runOnJS,
7
+ useAnimatedStyle,
8
+ useSharedValue,
9
+ withSpring,
10
+ withTiming
11
+ } from "react-native-reanimated";
12
+ import { WithTestID } from "../../utils/types";
13
+
14
+ const windowWidth = Dimensions.get("window").width;
15
+
16
+ type Dismissable = WithTestID<{
17
+ onDismiss?: () => void;
18
+ dismissThreshold?: number;
19
+ children: React.ReactNode;
20
+ }>;
21
+
22
+ /**
23
+ * Component that allows for a dismissable gesture, both left and right.
24
+ * When the threshold is reached, the `onDismiss` callback is called.
25
+ * @param onDismiss Callback to be called when the threshold is reached.
26
+ * @param dismissThreshold Threshold to be reached to call the `onDismiss` callback.
27
+ * @param children Children to be rendered inside the component.
28
+ * @returns A dismissable component.
29
+ */
30
+ const Dismissable = ({
31
+ onDismiss = () => undefined,
32
+ dismissThreshold = windowWidth / 3,
33
+ children,
34
+ testID
35
+ }: Dismissable) => {
36
+ const translateX = useSharedValue(0);
37
+
38
+ const animatedStyle = useAnimatedStyle(() => ({
39
+ transform: [
40
+ {
41
+ translateX: translateX.value
42
+ }
43
+ ]
44
+ }));
45
+
46
+ const pan = Gesture.Pan()
47
+ .onUpdate(event => {
48
+ // eslint-disable-next-line functional/immutable-data
49
+ translateX.value = event.translationX;
50
+ })
51
+ .onEnd(event => {
52
+ if (Math.abs(event.translationX) > dismissThreshold) {
53
+ // eslint-disable-next-line functional/immutable-data
54
+ translateX.value = withTiming(
55
+ windowWidth * Math.sign(event.translationX),
56
+ {
57
+ duration: 300,
58
+ easing: Easing.inOut(Easing.exp)
59
+ },
60
+ runOnJS(onDismiss)
61
+ );
62
+ } else {
63
+ // eslint-disable-next-line functional/immutable-data
64
+ translateX.value = withSpring(0, { mass: 0.5 });
65
+ }
66
+ })
67
+ .withTestId(testID ?? "");
68
+
69
+ return (
70
+ <GestureDetector gesture={pan}>
71
+ <Animated.View style={animatedStyle}>{children}</Animated.View>
72
+ </GestureDetector>
73
+ );
74
+ };
75
+
76
+ export { Dismissable };
@@ -4,6 +4,10 @@ import { StyleSheet, View } from "react-native";
4
4
  import { IOStyles } from "../../core";
5
5
  import { BlockButtons, BlockButtonsProps } from "./BlockButtons";
6
6
 
7
+ type Props = BlockButtonsProps & {
8
+ sticky?: boolean;
9
+ };
10
+
7
11
  // TODO: Refactor with an unique component like `FooterTopShadow` after bonus vacanze
8
12
  const styles = StyleSheet.create({
9
13
  container: {
@@ -11,7 +15,9 @@ const styles = StyleSheet.create({
11
15
  width: "100%",
12
16
  // This Magic number is an heritage of the app code-base, this component should be removed in favor of `GradientBottomAction`
13
17
  marginTop: -50,
14
- paddingTop: 50,
18
+ paddingTop: 50
19
+ },
20
+ sticky: {
15
21
  position: "absolute",
16
22
  bottom: 0
17
23
  }
@@ -21,15 +27,15 @@ const styles = StyleSheet.create({
21
27
  * Implements a component that show buttons as sticky footer
22
28
  * It can include 1, 2 or 3 buttons. If they are 2, they can have the inlineHalf or the inlineOneThird style
23
29
  */
24
- export const FooterWithButtons = (props: BlockButtonsProps) => (
30
+ export const FooterWithButtons = ({ sticky = false, ...rest }: Props) => (
25
31
  <View
26
- style={styles.container}
27
- accessible={props.accessible}
32
+ style={{ ...styles.container, ...(sticky ? styles.sticky : {}) }}
33
+ accessible={rest.accessible}
28
34
  pointerEvents={"box-none"}
29
35
  testID="FooterWithButtons"
30
36
  >
31
37
  <View style={IOStyles.footer}>
32
- <BlockButtons {...props} />
38
+ <BlockButtons {...rest} />
33
39
  </View>
34
40
  </View>
35
41
  );
@@ -5,16 +5,43 @@ import { WithTestID } from "../../utils/types";
5
5
  import { IOStyles, IOVisualCostants, IOColors } from "../../core";
6
6
  import { H3 } from "../typography";
7
7
  import { HSpacer } from "../spacer";
8
+ import { IconButton } from "../buttons";
9
+ import { ActionProp } from "./common";
8
10
 
9
- export type HeaderFirstLevel = WithTestID<{
11
+ type CommonProps = WithTestID<{
10
12
  title: string;
11
- // Accepted components: IconButton
12
- // Don't use any components other than this, please.
13
- firstAction?: React.ReactNode;
14
- secondAction?: React.ReactNode;
15
- thirdAction?: React.ReactNode;
16
13
  }>;
17
14
 
15
+ interface Base extends CommonProps {
16
+ type: "base";
17
+ firstAction?: never;
18
+ secondAction?: never;
19
+ thirdAction?: never;
20
+ }
21
+
22
+ interface OneAction extends CommonProps {
23
+ type: "singleAction";
24
+ firstAction: ActionProp;
25
+ secondAction?: never;
26
+ thirdAction?: never;
27
+ }
28
+
29
+ interface TwoActions extends CommonProps {
30
+ type: "twoActions";
31
+ firstAction: ActionProp;
32
+ secondAction: ActionProp;
33
+ thirdAction?: never;
34
+ }
35
+
36
+ interface ThreeActions extends CommonProps {
37
+ type: "threeActions";
38
+ firstAction: ActionProp;
39
+ secondAction: ActionProp;
40
+ thirdAction: ActionProp;
41
+ }
42
+
43
+ export type HeaderFirstLevel = Base | OneAction | TwoActions | ThreeActions;
44
+
18
45
  const HEADER_BG_COLOR: IOColors = "white";
19
46
 
20
47
  const styles = StyleSheet.create({
@@ -30,10 +57,11 @@ const styles = StyleSheet.create({
30
57
 
31
58
  export const HeaderFirstLevel = ({
32
59
  title,
60
+ type,
61
+ testID,
33
62
  firstAction,
34
63
  secondAction,
35
- thirdAction,
36
- testID
64
+ thirdAction
37
65
  }: HeaderFirstLevel) => {
38
66
  const insets = useSafeAreaInsets();
39
67
 
@@ -51,22 +79,22 @@ export const HeaderFirstLevel = ({
51
79
  {title}
52
80
  </H3>
53
81
  <View style={[IOStyles.row, { flexShrink: 0 }]}>
54
- {firstAction}
55
- {secondAction && (
82
+ {type === "threeActions" && (
56
83
  <>
84
+ <IconButton {...thirdAction} color="neutral" />
57
85
  {/* Ideally, with the "gap" flex property,
58
86
  we can get rid of these ugly constructs */}
59
87
  <HSpacer size={16} />
60
- {secondAction}
61
88
  </>
62
89
  )}
63
- {thirdAction && (
90
+ {(type === "twoActions" || type === "threeActions") && (
64
91
  <>
92
+ <IconButton {...secondAction} color="neutral" />
65
93
  {/* Same as above */}
66
94
  <HSpacer size={16} />
67
- {thirdAction}
68
95
  </>
69
96
  )}
97
+ {type !== "base" && <IconButton {...firstAction} color="neutral" />}
70
98
  </View>
71
99
  </View>
72
100
  </View>
@@ -19,11 +19,7 @@ import type { IOSpacer } from "../../core/IOSpacing";
19
19
  import { WithTestID } from "../../utils/types";
20
20
  import IconButton from "../buttons/IconButton";
21
21
  import { makeFontStyleObject } from "../../utils/fonts";
22
-
23
- type ActionProp = Pick<
24
- React.ComponentProps<typeof IconButton>,
25
- "icon" | "onPress" | "accessibilityLabel" | "accessibilityHint" | "testID"
26
- >;
22
+ import { ActionProp } from "./common";
27
23
 
28
24
  type ScrollValues = {
29
25
  contentOffsetY: Animated.SharedValue<number>;
@@ -41,17 +37,23 @@ type CommonProps = WithTestID<{
41
37
 
42
38
  interface Base extends CommonProps {
43
39
  type: "base";
40
+ firstAction?: never;
41
+ secondAction?: never;
42
+ thirdAction?: never;
44
43
  }
45
44
 
46
45
  interface OneAction extends CommonProps {
47
46
  type: "singleAction";
48
47
  firstAction: ActionProp;
48
+ secondAction?: never;
49
+ thirdAction?: never;
49
50
  }
50
51
 
51
52
  interface TwoActions extends CommonProps {
52
53
  type: "twoActions";
53
54
  firstAction: ActionProp;
54
55
  secondAction: ActionProp;
56
+ thirdAction?: never;
55
57
  }
56
58
 
57
59
  interface ThreeActions extends CommonProps {
@@ -98,16 +100,18 @@ const styles = StyleSheet.create({
98
100
  * @param {HeaderSecondLevel} props - The props of the component
99
101
  * @returns React Element
100
102
  */
101
- export const HeaderSecondLevel = (props: HeaderSecondLevel) => {
102
- const {
103
- scrollValues = undefined,
104
- goBack,
105
- backAccessibilityLabel,
106
- title,
107
- type,
108
- transparent = false,
109
- testID
110
- } = props;
103
+ export const HeaderSecondLevel = ({
104
+ scrollValues = undefined,
105
+ goBack,
106
+ backAccessibilityLabel,
107
+ title,
108
+ type,
109
+ transparent = false,
110
+ testID,
111
+ firstAction,
112
+ secondAction,
113
+ thirdAction
114
+ }: HeaderSecondLevel) => {
111
115
  const { isExperimental } = useIOExperimentalDesign();
112
116
  const insets = useSafeAreaInsets();
113
117
 
@@ -175,25 +179,25 @@ export const HeaderSecondLevel = (props: HeaderSecondLevel) => {
175
179
  {title}
176
180
  </Animated.Text>
177
181
  <View style={[IOStyles.row, { flexShrink: 0 }]}>
178
- {type !== "base" ? (
179
- <IconButton {...props.firstAction} color="neutral" />
180
- ) : (
181
- <HSpacer size={iconBtnSizeSmall as IOSpacer} />
182
+ {type === "threeActions" && (
183
+ <>
184
+ <IconButton {...thirdAction} color="neutral" />
185
+ {/* Same as above */}
186
+ <HSpacer size={16} />
187
+ </>
182
188
  )}
183
189
  {(type === "twoActions" || type === "threeActions") && (
184
190
  <>
191
+ <IconButton {...secondAction} color="neutral" />
185
192
  {/* Ideally, with the "gap" flex property,
186
193
  we can get rid of these ugly constructs */}
187
194
  <HSpacer size={16} />
188
- <IconButton {...props.secondAction} color="neutral" />
189
195
  </>
190
196
  )}
191
- {type === "threeActions" && (
192
- <>
193
- {/* Same as above */}
194
- <HSpacer size={16} />
195
- <IconButton {...props.thirdAction} color="neutral" />
196
- </>
197
+ {type !== "base" ? (
198
+ <IconButton {...firstAction} color="neutral" />
199
+ ) : (
200
+ <HSpacer size={iconBtnSizeSmall as IOSpacer} />
197
201
  )}
198
202
  </View>
199
203
  </Animated.View>
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { IconButton } from "../buttons";
3
+
4
+ export type ActionProp = Pick<
5
+ React.ComponentProps<typeof IconButton>,
6
+ "icon" | "onPress" | "accessibilityLabel" | "accessibilityHint" | "testID"
7
+ >;
@@ -1,3 +1,4 @@
1
+ export * from "./common";
1
2
  export * from "./GradientScrollView";
2
3
  export * from "./GradientBottomActions";
3
4
  export * from "./HeaderFirstLevel";
@@ -14,12 +14,12 @@ import {
14
14
  useIOTheme
15
15
  } from "../../core";
16
16
 
17
- import { LogoPaymentWithFallback } from "../common/LogoPaymentWithFallback";
18
- import { isImageUri } from "../../utils/url";
19
- import { WithTestID } from "../../utils/types";
20
17
  import { getAccessibleAmountText } from "../../utils/accessibility";
18
+ import { WithTestID } from "../../utils/types";
19
+ import { isImageUri } from "../../utils/url";
21
20
  import { Avatar } from "../avatar/Avatar";
22
21
  import { Badge } from "../badge/Badge";
22
+ import { LogoPaymentWithFallback } from "../common/LogoPaymentWithFallback";
23
23
  import { IOIconSizeScale, Icon } from "../icons";
24
24
  import { IOLogoPaymentType } from "../logos";
25
25
  import { VSpacer } from "../spacer";
@@ -64,6 +64,7 @@ export type ListItemTransaction = WithTestID<
64
64
  paymentLogoIcon?: ListItemTransactionLogo;
65
65
  subtitle: string;
66
66
  title: string;
67
+ accessible?: boolean;
67
68
  } & (
68
69
  | {
69
70
  transactionStatus: ListItemTransactionStatusWithoutBadge;
@@ -114,7 +115,8 @@ export const ListItemTransaction = ({
114
115
  title,
115
116
  transactionAmount,
116
117
  badgeText,
117
- transactionStatus = "success"
118
+ transactionStatus = "success",
119
+ accessible
118
120
  }: ListItemTransaction) => {
119
121
  const theme = useIOTheme();
120
122
 
@@ -203,7 +205,7 @@ export const ListItemTransaction = ({
203
205
  <View
204
206
  style={IOListItemStyles.listItem}
205
207
  testID={testID}
206
- accessible={true}
208
+ accessible={accessible}
207
209
  accessibilityLabel={accessibilityLabel}
208
210
  >
209
211
  <View style={IOListItemStyles.listItemInner}>
@@ -224,6 +224,7 @@ exports[`Test List Item Components ListItemInfo Snapshot 1`] = `
224
224
  }
225
225
  >
226
226
  <Text
227
+ allowFontScaling={false}
227
228
  color="bluegrey"
228
229
  defaultColor="bluegrey"
229
230
  defaultWeight="Regular"
@@ -350,6 +351,7 @@ exports[`Test List Item Components ListItemInfoCopy Snapshot 1`] = `
350
351
  }
351
352
  >
352
353
  <Text
354
+ allowFontScaling={false}
353
355
  color="bluegrey"
354
356
  defaultColor="bluegrey"
355
357
  defaultWeight="Regular"
@@ -0,0 +1,121 @@
1
+ import React, { useEffect, useRef } from "react";
2
+ import { View, Animated, Easing } from "react-native";
3
+ import Svg, { Defs, G, LinearGradient, Path, Stop } from "react-native-svg";
4
+ import { WithTestID } from "../../utils/types";
5
+ import { IOColors } from "../../core";
6
+
7
+ type Props = WithTestID<{
8
+ color?: IOColors;
9
+ stroke?: number;
10
+ size?: IOLoadingSpinnerSizeScale;
11
+ durationMs?: number;
12
+ }>;
13
+
14
+ /**
15
+ * Size scale, 76 is kept for backward compatibility with the old design system but 48 is enough for the new one.
16
+ * It will be removed in the future.
17
+ */
18
+ export type IOLoadingSpinnerSizeScale = 24 | 48 | 76;
19
+
20
+ const startRotationAnimation = (
21
+ durationMs: number,
22
+ rotationDegree: Animated.Value
23
+ ): void => {
24
+ Animated.loop(
25
+ Animated.timing(rotationDegree, {
26
+ toValue: 360,
27
+ duration: durationMs,
28
+ easing: Easing.linear,
29
+ useNativeDriver: true
30
+ })
31
+ ).start();
32
+ };
33
+
34
+ export const LoadingSpinner = ({
35
+ color = "blueIO-500",
36
+ stroke = 3,
37
+ size = 24,
38
+ durationMs = 750
39
+ }: Props): React.ReactElement => {
40
+ const rotationDegree = useRef(new Animated.Value(0)).current;
41
+
42
+ useEffect(() => {
43
+ startRotationAnimation(durationMs, rotationDegree);
44
+ }, [durationMs, rotationDegree]);
45
+
46
+ return (
47
+ <>
48
+ <View
49
+ style={{ width: size, height: size }}
50
+ accessibilityRole="progressbar"
51
+ testID={"LoadingSpinnerTestID"}
52
+ >
53
+ <Animated.View
54
+ testID={"LoadingSpinnerAnimatedTestID"}
55
+ style={{
56
+ transform: [
57
+ {
58
+ rotateZ: rotationDegree.interpolate({
59
+ inputRange: [0, 360],
60
+ outputRange: ["0deg", "360deg"]
61
+ })
62
+ }
63
+ ]
64
+ }}
65
+ >
66
+ {/* Thanks to Ben Ilegbodu for the article on how to
67
+ create a a SVG gradient loading spinner. Below is
68
+ a parameterized version of his version of his code.
69
+ Source: https://www.benmvp.com/blog/how-to-create-circle-svg-gradient-loading-spinner/ */}
70
+ <Svg
71
+ width={size}
72
+ height={size}
73
+ viewBox={`0 0 ${size} ${size}`}
74
+ fill="none"
75
+ >
76
+ <Defs>
77
+ <LinearGradient id="spinner-secondHalf">
78
+ <Stop offset="0%" stopOpacity="0" stopColor={IOColors[color]} />
79
+ <Stop
80
+ offset="100%"
81
+ stopOpacity="1"
82
+ stopColor={IOColors[color]}
83
+ />
84
+ </LinearGradient>
85
+ <LinearGradient id="spinner-firstHalf">
86
+ <Stop offset="0%" stopOpacity="1" stopColor={IOColors[color]} />
87
+ <Stop
88
+ offset="100%"
89
+ stopOpacity="1"
90
+ stopColor={IOColors[color]}
91
+ />
92
+ </LinearGradient>
93
+ </Defs>
94
+
95
+ <G strokeWidth={stroke}>
96
+ <Path
97
+ stroke="url(#spinner-secondHalf)"
98
+ d={`M ${stroke / 2} ${size / 2} A ${size / 2 - stroke / 2} ${
99
+ size / 2 - stroke / 2
100
+ } 0 0 1 ${size - stroke / 2} ${size / 2}`}
101
+ />
102
+ <Path
103
+ stroke="url(#spinner-firstHalf)"
104
+ d={`M ${size - stroke / 2} ${size / 2} A ${
105
+ size / 2 - stroke / 2
106
+ } ${size / 2 - stroke / 2} 0 0 1 ${stroke / 2} ${size / 2}`}
107
+ />
108
+ <Path
109
+ stroke={IOColors[color]}
110
+ strokeLinecap="round"
111
+ d={`M ${stroke / 2} ${size / 2} A ${size / 2 - stroke / 2} ${
112
+ size / 2 - stroke / 2
113
+ } 0 0 1 ${stroke / 2} ${size / 2 - stroke / 4}`}
114
+ />
115
+ </G>
116
+ </Svg>
117
+ </Animated.View>
118
+ </View>
119
+ </>
120
+ );
121
+ };
@@ -0,0 +1 @@
1
+ export * from "./LoadingSpinner";
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { View, StyleSheet } from "react-native";
3
+ import { hexToRgba, IOColors } from "../../core";
4
+
5
+ /* Logos */
6
+ import LogoPaymentCardPayPal from "./svg/LogoPaymentCardPayPal";
7
+ import LogoPaymentCardBancomatPay from "./svg/LogoPaymentCardBancomatPay";
8
+
9
+ export const IOPaymentCardLogos = {
10
+ payPal: LogoPaymentCardPayPal,
11
+ bancomatPay: LogoPaymentCardBancomatPay
12
+ } as const;
13
+
14
+ export type IOLogoPaymentCardType = keyof typeof IOPaymentCardLogos;
15
+
16
+ type IOPaymentLogos = {
17
+ name: IOLogoPaymentCardType;
18
+ align: "start" | "center" | "end";
19
+ width?: "100%" | number;
20
+ height?: number;
21
+ debugMode?: boolean;
22
+ };
23
+
24
+ export type SVGCardLogoProps = {
25
+ preserveAspectRatio: "xMinYMin meet" | "xMidYMid meet" | "xMaxYMax meet";
26
+ };
27
+
28
+ const preserveAspectRatioValues: Record<
29
+ IOPaymentLogos["align"],
30
+ SVGCardLogoProps["preserveAspectRatio"]
31
+ > = {
32
+ start: "xMinYMin meet",
33
+ center: "xMidYMid meet",
34
+ end: "xMaxYMax meet"
35
+ };
36
+
37
+ const styles = StyleSheet.create({
38
+ debugMode: {
39
+ backgroundColor: hexToRgba(IOColors["error-500"], 0.2)
40
+ }
41
+ });
42
+
43
+ const LogoPaymentCard = ({
44
+ name,
45
+ width = "100%",
46
+ height = 32,
47
+ align = "center",
48
+ debugMode = false,
49
+ ...props
50
+ }: IOPaymentLogos) => {
51
+ const LogoElement = IOPaymentCardLogos[name];
52
+ return (
53
+ <View style={[{ width, height }, debugMode && styles.debugMode]}>
54
+ <LogoElement
55
+ preserveAspectRatio={preserveAspectRatioValues[align]}
56
+ {...props}
57
+ />
58
+ </View>
59
+ );
60
+ };
61
+
62
+ export default LogoPaymentCard;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import LogoPaymentExtAmex from "./svg/LogoPaymentExtAmex";
3
2
 
4
3
  /* Logos */
5
4
  import LogoPaymentExtMaestro from "./svg/LogoPaymentExtMaestro";
@@ -15,6 +14,7 @@ import LogoPaymentExtBancomatPay from "./svg/LogoPaymentExtBancomatPay";
15
14
  import LogoPaymentExtPostepay from "./svg/LogoPaymentExtPostepay";
16
15
  import LogoPaymentExtPagoBancomat from "./svg/LogoPaymentExtPagoBancomat";
17
16
  import LogoPaymentExtApplePay from "./svg/LogoPaymentExtApplePay";
17
+ import LogoPaymentExtAmex from "./svg/LogoPaymentExtAmex";
18
18
 
19
19
  export const IOPaymentExtLogos = {
20
20
  maestro: LogoPaymentExtMaestro,