@pagopa/io-app-design-system 4.2.1 → 4.3.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 (248) hide show
  1. package/lib/commonjs/components/alert/Alert.js +10 -31
  2. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  3. package/lib/commonjs/components/alert/AlertEdgeToEdge.js +9 -29
  4. package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
  5. package/lib/commonjs/components/banner/Banner.js +10 -34
  6. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  7. package/lib/commonjs/components/buttons/ButtonLink.js +20 -53
  8. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  9. package/lib/commonjs/components/buttons/ButtonOutline.js +24 -44
  10. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  11. package/lib/commonjs/components/buttons/ButtonSolid.js +14 -39
  12. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  13. package/lib/commonjs/components/buttons/IconButton.js +13 -32
  14. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  15. package/lib/commonjs/components/buttons/IconButtonContained.js +19 -42
  16. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  17. package/lib/commonjs/components/buttons/IconButtonSolid.js +15 -31
  18. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  19. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  20. package/lib/commonjs/components/layout/index.js +0 -11
  21. package/lib/commonjs/components/layout/index.js.map +1 -1
  22. package/lib/commonjs/components/listitems/ListItemAction.js +14 -40
  23. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  24. package/lib/commonjs/components/listitems/ListItemCheckbox.js +13 -41
  25. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  26. package/lib/commonjs/components/listitems/ListItemHeader.js +2 -2
  27. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  28. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +15 -43
  29. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  30. package/lib/commonjs/components/listitems/ListItemNav.js +17 -48
  31. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  32. package/lib/commonjs/components/listitems/ListItemNavAlert.js +19 -50
  33. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  34. package/lib/commonjs/components/listitems/ListItemRadio.js +20 -50
  35. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  36. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -2
  37. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemTransaction.js +2 -2
  39. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  40. package/lib/commonjs/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
  41. package/lib/commonjs/components/listitems/PressableListItemBase.js.map +1 -0
  42. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +13 -7
  43. package/lib/commonjs/components/listitems/__test__/listitem.test.js +3 -3
  44. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  45. package/lib/commonjs/components/listitems/index.js +11 -11
  46. package/lib/commonjs/components/listitems/index.js.map +1 -1
  47. package/lib/commonjs/components/modules/PressableModuleBase.js +17 -11
  48. package/lib/commonjs/components/modules/PressableModuleBase.js.map +1 -1
  49. package/lib/commonjs/components/modules/index.js +8 -8
  50. package/lib/commonjs/components/modules/index.js.map +1 -1
  51. package/lib/commonjs/components/numberpad/NumberButton.js +12 -28
  52. package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
  53. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  54. package/lib/commonjs/components/otpInput/OTPInput.js +2 -1
  55. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  56. package/lib/commonjs/components/tabs/TabItem.js +15 -21
  57. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  58. package/lib/commonjs/core/IOAnimations.js +6 -12
  59. package/lib/commonjs/core/IOAnimations.js.map +1 -1
  60. package/lib/commonjs/hooks/index.js +28 -0
  61. package/lib/commonjs/hooks/index.js.map +1 -0
  62. package/lib/commonjs/hooks/useListItemAnimation.js +40 -0
  63. package/lib/commonjs/hooks/useListItemAnimation.js.map +1 -0
  64. package/lib/commonjs/hooks/useScaleAnimation.js +36 -0
  65. package/lib/commonjs/hooks/useScaleAnimation.js.map +1 -0
  66. package/lib/commonjs/index.js +11 -0
  67. package/lib/commonjs/index.js.map +1 -1
  68. package/lib/commonjs/utils/hooks/index.js +28 -0
  69. package/lib/commonjs/utils/hooks/index.js.map +1 -0
  70. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js +5 -7
  71. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js.map +1 -1
  72. package/lib/module/components/alert/Alert.js +10 -32
  73. package/lib/module/components/alert/Alert.js.map +1 -1
  74. package/lib/module/components/alert/AlertEdgeToEdge.js +10 -31
  75. package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
  76. package/lib/module/components/banner/Banner.js +10 -33
  77. package/lib/module/components/banner/Banner.js.map +1 -1
  78. package/lib/module/components/buttons/ButtonLink.js +23 -56
  79. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  80. package/lib/module/components/buttons/ButtonOutline.js +27 -47
  81. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  82. package/lib/module/components/buttons/ButtonSolid.js +17 -42
  83. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  84. package/lib/module/components/buttons/IconButton.js +16 -35
  85. package/lib/module/components/buttons/IconButton.js.map +1 -1
  86. package/lib/module/components/buttons/IconButtonContained.js +21 -45
  87. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  88. package/lib/module/components/buttons/IconButtonSolid.js +17 -34
  89. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  90. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  91. package/lib/module/components/layout/index.js +0 -1
  92. package/lib/module/components/layout/index.js.map +1 -1
  93. package/lib/module/components/listitems/ListItemAction.js +15 -42
  94. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  95. package/lib/module/components/listitems/ListItemCheckbox.js +15 -43
  96. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  97. package/lib/module/components/listitems/ListItemHeader.js +2 -2
  98. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  99. package/lib/module/components/listitems/ListItemInfoCopy.js +16 -45
  100. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  101. package/lib/module/components/listitems/ListItemNav.js +17 -47
  102. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  103. package/lib/module/components/listitems/ListItemNavAlert.js +19 -49
  104. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  105. package/lib/module/components/listitems/ListItemRadio.js +22 -52
  106. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  107. package/lib/module/components/listitems/ListItemRadioWithAmount.js +1 -1
  108. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  109. package/lib/module/components/listitems/ListItemTransaction.js +1 -1
  110. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  111. package/lib/module/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
  112. package/lib/module/components/listitems/PressableListItemBase.js.map +1 -0
  113. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +13 -7
  114. package/lib/module/components/listitems/__test__/listitem.test.js +1 -1
  115. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  116. package/lib/module/components/listitems/index.js +1 -1
  117. package/lib/module/components/listitems/index.js.map +1 -1
  118. package/lib/module/components/modules/PressableModuleBase.js +17 -10
  119. package/lib/module/components/modules/PressableModuleBase.js.map +1 -1
  120. package/lib/module/components/modules/index.js +1 -1
  121. package/lib/module/components/modules/index.js.map +1 -1
  122. package/lib/module/components/numberpad/NumberButton.js +14 -30
  123. package/lib/module/components/numberpad/NumberButton.js.map +1 -1
  124. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  125. package/lib/module/components/otpInput/OTPInput.js +2 -1
  126. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  127. package/lib/module/components/tabs/TabItem.js +18 -24
  128. package/lib/module/components/tabs/TabItem.js.map +1 -1
  129. package/lib/module/core/IOAnimations.js +4 -10
  130. package/lib/module/core/IOAnimations.js.map +1 -1
  131. package/lib/module/hooks/index.js +3 -0
  132. package/lib/module/hooks/index.js.map +1 -0
  133. package/lib/module/hooks/useListItemAnimation.js +33 -0
  134. package/lib/module/hooks/useListItemAnimation.js.map +1 -0
  135. package/lib/module/hooks/useScaleAnimation.js +29 -0
  136. package/lib/module/hooks/useScaleAnimation.js.map +1 -0
  137. package/lib/module/index.js +1 -0
  138. package/lib/module/index.js.map +1 -1
  139. package/lib/module/utils/hooks/index.js +3 -0
  140. package/lib/module/utils/hooks/index.js.map +1 -0
  141. package/lib/module/utils/hooks/useSpringPressProgressValue.js +5 -5
  142. package/lib/module/utils/hooks/useSpringPressProgressValue.js.map +1 -1
  143. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  144. package/lib/typescript/components/alert/AlertEdgeToEdge.d.ts.map +1 -1
  145. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  146. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  147. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  148. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  149. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  150. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  151. package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
  152. package/lib/typescript/components/layout/index.d.ts +0 -1
  153. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  154. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  155. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  156. package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
  157. package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
  158. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  159. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  160. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  161. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +1 -1
  162. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  163. package/lib/typescript/components/listitems/{PressableListItemsBase.d.ts → PressableListItemBase.d.ts} +3 -2
  164. package/lib/typescript/components/listitems/PressableListItemBase.d.ts.map +1 -0
  165. package/lib/typescript/components/listitems/index.d.ts +1 -1
  166. package/lib/typescript/components/listitems/index.d.ts.map +1 -1
  167. package/lib/typescript/components/modules/PressableModuleBase.d.ts.map +1 -1
  168. package/lib/typescript/components/modules/index.d.ts +1 -1
  169. package/lib/typescript/components/modules/index.d.ts.map +1 -1
  170. package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
  171. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  172. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  173. package/lib/typescript/core/IOAnimations.d.ts +6 -10
  174. package/lib/typescript/core/IOAnimations.d.ts.map +1 -1
  175. package/lib/typescript/hooks/index.d.ts +3 -0
  176. package/lib/typescript/hooks/index.d.ts.map +1 -0
  177. package/lib/typescript/hooks/useListItemAnimation.d.ts +10 -0
  178. package/lib/typescript/hooks/useListItemAnimation.d.ts.map +1 -0
  179. package/lib/typescript/hooks/useScaleAnimation.d.ts +10 -0
  180. package/lib/typescript/hooks/useScaleAnimation.d.ts.map +1 -0
  181. package/lib/typescript/index.d.ts +1 -0
  182. package/lib/typescript/index.d.ts.map +1 -1
  183. package/lib/typescript/utils/hooks/index.d.ts +3 -0
  184. package/lib/typescript/utils/hooks/index.d.ts.map +1 -0
  185. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts +7 -8
  186. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts.map +1 -1
  187. package/package.json +1 -1
  188. package/src/components/alert/Alert.tsx +7 -46
  189. package/src/components/alert/AlertEdgeToEdge.tsx +6 -46
  190. package/src/components/banner/Banner.tsx +6 -52
  191. package/src/components/buttons/ButtonLink.tsx +32 -89
  192. package/src/components/buttons/ButtonOutline.tsx +26 -60
  193. package/src/components/buttons/ButtonSolid.tsx +11 -58
  194. package/src/components/buttons/IconButton.tsx +10 -47
  195. package/src/components/buttons/IconButtonContained.tsx +21 -57
  196. package/src/components/buttons/IconButtonSolid.tsx +15 -46
  197. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  198. package/src/components/layout/index.tsx +0 -1
  199. package/src/components/listitems/ListItemAction.tsx +10 -66
  200. package/src/components/listitems/ListItemCheckbox.tsx +10 -68
  201. package/src/components/listitems/ListItemHeader.tsx +2 -2
  202. package/src/components/listitems/ListItemInfoCopy.tsx +11 -71
  203. package/src/components/listitems/ListItemNav.tsx +13 -74
  204. package/src/components/listitems/ListItemNavAlert.tsx +18 -92
  205. package/src/components/listitems/ListItemRadio.tsx +14 -75
  206. package/src/components/listitems/ListItemRadioWithAmount.tsx +2 -1
  207. package/src/components/listitems/ListItemTransaction.tsx +1 -1
  208. package/src/components/listitems/{PressableListItemsBase.tsx → PressableListItemBase.tsx} +7 -6
  209. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +13 -7
  210. package/src/components/listitems/__test__/listitem.test.tsx +1 -1
  211. package/src/components/listitems/index.tsx +1 -1
  212. package/src/components/modules/PressableModuleBase.tsx +15 -8
  213. package/src/components/modules/index.tsx +1 -1
  214. package/src/components/numberpad/NumberButton.tsx +12 -43
  215. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  216. package/src/components/otpInput/OTPInput.tsx +1 -0
  217. package/src/components/tabs/TabItem.tsx +15 -29
  218. package/src/core/IOAnimations.ts +8 -10
  219. package/src/hooks/index.tsx +2 -0
  220. package/src/hooks/useListItemAnimation.tsx +59 -0
  221. package/src/hooks/useScaleAnimation.tsx +41 -0
  222. package/src/index.tsx +1 -0
  223. package/src/utils/hooks/index.tsx +2 -0
  224. package/src/utils/hooks/useSpringPressProgressValue.ts +14 -8
  225. package/lib/commonjs/components/layout/FooterWithButtons.js +0 -84
  226. package/lib/commonjs/components/layout/FooterWithButtons.js.map +0 -1
  227. package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +0 -1
  228. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js +0 -56
  229. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
  230. package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js +0 -41
  231. package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
  232. package/lib/module/components/layout/FooterWithButtons.js +0 -75
  233. package/lib/module/components/layout/FooterWithButtons.js.map +0 -1
  234. package/lib/module/components/listitems/PressableListItemsBase.js.map +0 -1
  235. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +0 -47
  236. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
  237. package/lib/module/components/modules/hooks/useModuleSpringAnimation.js +0 -34
  238. package/lib/module/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
  239. package/lib/typescript/components/layout/FooterWithButtons.d.ts +0 -16
  240. package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +0 -1
  241. package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +0 -1
  242. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts +0 -13
  243. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +0 -1
  244. package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts +0 -10
  245. package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts.map +0 -1
  246. package/src/components/layout/FooterWithButtons.tsx +0 -90
  247. package/src/components/listitems/hooks/useListItemSpringAnimation.ts +0 -72
  248. package/src/components/modules/hooks/useModuleSpringAnimation.ts +0 -49
@@ -59,6 +59,9 @@ exports[`Test Buttons Components - Experimental Enabled ButtonLink Snapshot 1`]
59
59
  "textAlignVertical": "center",
60
60
  },
61
61
  false,
62
+ {
63
+ "columnGap": 8,
64
+ },
62
65
  {},
63
66
  {
64
67
  "transform": [
@@ -166,14 +169,16 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
166
169
  "borderColor": "#0B3EE3",
167
170
  },
168
171
  {
169
- "backgroundColor": undefined,
170
- "borderColor": undefined,
171
172
  "transform": [
172
173
  {
173
174
  "scale": undefined,
174
175
  },
175
176
  ],
176
177
  },
178
+ {
179
+ "backgroundColor": undefined,
180
+ "borderColor": undefined,
181
+ },
177
182
  ]
178
183
  }
179
184
  >
@@ -276,17 +281,20 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
276
281
  "backgroundColor": "#0B3EE3",
277
282
  },
278
283
  {
279
- "backgroundColor": undefined,
280
284
  "transform": [
281
285
  {
282
286
  "scale": undefined,
283
287
  },
284
288
  ],
285
289
  },
290
+ {
291
+ "backgroundColor": undefined,
292
+ },
286
293
  ]
287
294
  }
288
295
  >
289
296
  <View
297
+ entering={[Function]}
290
298
  style={
291
299
  [
292
300
  {
@@ -510,13 +518,15 @@ exports[`Test Buttons Components - Experimental Enabled IconButtonContained Snap
510
518
  "width": 48,
511
519
  },
512
520
  {
513
- "backgroundColor": undefined,
514
521
  "transform": [
515
522
  {
516
523
  "scale": undefined,
517
524
  },
518
525
  ],
519
526
  },
527
+ {
528
+ "backgroundColor": undefined,
529
+ },
520
530
  ]
521
531
  }
522
532
  >
@@ -642,13 +652,15 @@ exports[`Test Buttons Components - Experimental Enabled IconButtonSolid Snapshot
642
652
  "width": 56,
643
653
  },
644
654
  {
645
- "backgroundColor": undefined,
646
655
  "transform": [
647
656
  {
648
657
  "scale": undefined,
649
658
  },
650
659
  ],
651
660
  },
661
+ {
662
+ "backgroundColor": undefined,
663
+ },
652
664
  {
653
665
  "backgroundColor": "#0B3EE3",
654
666
  },
@@ -778,6 +790,9 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
778
790
  "textAlignVertical": "center",
779
791
  },
780
792
  false,
793
+ {
794
+ "columnGap": 8,
795
+ },
781
796
  {},
782
797
  {
783
798
  "transform": [
@@ -884,14 +899,16 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
884
899
  "borderColor": "#0073E6",
885
900
  },
886
901
  {
887
- "backgroundColor": undefined,
888
- "borderColor": undefined,
889
902
  "transform": [
890
903
  {
891
904
  "scale": undefined,
892
905
  },
893
906
  ],
894
907
  },
908
+ {
909
+ "backgroundColor": undefined,
910
+ "borderColor": undefined,
911
+ },
895
912
  ]
896
913
  }
897
914
  >
@@ -993,17 +1010,20 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
993
1010
  "backgroundColor": "#0073E6",
994
1011
  },
995
1012
  {
996
- "backgroundColor": undefined,
997
1013
  "transform": [
998
1014
  {
999
1015
  "scale": undefined,
1000
1016
  },
1001
1017
  ],
1002
1018
  },
1019
+ {
1020
+ "backgroundColor": undefined,
1021
+ },
1003
1022
  ]
1004
1023
  }
1005
1024
  >
1006
1025
  <View
1026
+ entering={[Function]}
1007
1027
  style={
1008
1028
  [
1009
1029
  {
@@ -1227,13 +1247,15 @@ exports[`Test Buttons Components IconButtonContained Snapshot 1`] = `
1227
1247
  "width": 48,
1228
1248
  },
1229
1249
  {
1230
- "backgroundColor": undefined,
1231
1250
  "transform": [
1232
1251
  {
1233
1252
  "scale": undefined,
1234
1253
  },
1235
1254
  ],
1236
1255
  },
1256
+ {
1257
+ "backgroundColor": undefined,
1258
+ },
1237
1259
  ]
1238
1260
  }
1239
1261
  >
@@ -1359,13 +1381,15 @@ exports[`Test Buttons Components IconButtonSolid Snapshot 1`] = `
1359
1381
  "width": 56,
1360
1382
  },
1361
1383
  {
1362
- "backgroundColor": undefined,
1363
1384
  "transform": [
1364
1385
  {
1365
1386
  "scale": undefined,
1366
1387
  },
1367
1388
  ],
1368
1389
  },
1390
+ {
1391
+ "backgroundColor": undefined,
1392
+ },
1369
1393
  {
1370
1394
  "backgroundColor": "#0073E6",
1371
1395
  },
@@ -1,6 +1,5 @@
1
1
  export * from "./FooterActions";
2
2
  export * from "./FooterActionsInline";
3
- export * from "./FooterWithButtons";
4
3
  export * from "./ForceScrollDownView";
5
4
  export * from "./GradientBottomActions";
6
5
  export * from "./GradientScrollView";
@@ -1,23 +1,13 @@
1
- import React, { ComponentProps, useCallback, useMemo } from "react";
1
+ import React, { ComponentProps, useMemo } from "react";
2
2
  import { GestureResponderEvent, Pressable, View } from "react-native";
3
- import Animated, {
4
- Extrapolate,
5
- interpolate,
6
- interpolateColor,
7
- useAnimatedStyle,
8
- useDerivedValue,
9
- useSharedValue,
10
- withSpring
11
- } from "react-native-reanimated";
3
+ import Animated from "react-native-reanimated";
12
4
  import {
13
5
  IOColors,
14
6
  IOListItemStyles,
15
7
  IOListItemVisualParams,
16
- IOScaleValues,
17
- IOSpringValues,
18
- hexToRgba,
19
8
  useIOTheme
20
9
  } from "../../core";
10
+ import { useListItemAnimation } from "../../hooks";
21
11
  import { WithTestID } from "../../utils/types";
22
12
  import { AnimatedIcon, IOIcons } from "../icons";
23
13
  import { ButtonText } from "../typography/ButtonText";
@@ -42,7 +32,8 @@ export const ListItemAction = ({
42
32
  accessibilityHint,
43
33
  testID
44
34
  }: ListItemAction) => {
45
- const isPressed = useSharedValue(0);
35
+ const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
36
+ useListItemAnimation();
46
37
 
47
38
  const theme = useIOTheme();
48
39
 
@@ -51,11 +42,6 @@ export const ListItemAction = ({
51
42
  [label, accessibilityLabel]
52
43
  );
53
44
 
54
- const mapBackgroundStates: Record<string, string> = {
55
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
56
- pressed: IOColors[theme["listItem-pressed"]]
57
- };
58
-
59
45
  const mapForegroundColor: Record<
60
46
  NonNullable<ListItemAction["variant"]>,
61
47
  IOColors
@@ -64,54 +50,12 @@ export const ListItemAction = ({
64
50
  danger: theme.errorText
65
51
  };
66
52
 
67
- // Scaling transformation applied when the button is pressed
68
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
69
-
70
- const progressPressed = useDerivedValue(() =>
71
- withSpring(isPressed.value, IOSpringValues.button)
72
- );
73
-
74
- // Interpolate animation values from `isPressed` values
75
- const animatedScaleStyle = useAnimatedStyle(() => {
76
- const scale = interpolate(
77
- progressPressed.value,
78
- [0, 1],
79
- [1, animationScaleValue],
80
- Extrapolate.CLAMP
81
- );
82
-
83
- return {
84
- transform: [{ scale }]
85
- };
86
- });
87
-
88
- const animatedBackgroundStyle = useAnimatedStyle(() => {
89
- const backgroundColor = interpolateColor(
90
- progressPressed.value,
91
- [0, 1],
92
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
93
- );
94
-
95
- return {
96
- backgroundColor
97
- };
98
- });
99
-
100
- const handlePressIn = useCallback(() => {
101
- // eslint-disable-next-line functional/immutable-data
102
- isPressed.value = 1;
103
- }, [isPressed]);
104
- const handlePressOut = useCallback(() => {
105
- // eslint-disable-next-line functional/immutable-data
106
- isPressed.value = 0;
107
- }, [isPressed]);
108
-
109
53
  return (
110
54
  <Pressable
111
55
  onPress={onPress}
112
- onPressIn={handlePressIn}
113
- onPressOut={handlePressOut}
114
- onTouchEnd={handlePressOut}
56
+ onPressIn={onPressIn}
57
+ onPressOut={onPressOut}
58
+ onTouchEnd={onPressOut}
115
59
  accessible={true}
116
60
  accessibilityLabel={listItemAccessibilityLabel}
117
61
  accessibilityHint={accessibilityHint}
@@ -119,12 +63,12 @@ export const ListItemAction = ({
119
63
  testID={testID}
120
64
  >
121
65
  <Animated.View
122
- style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
66
+ style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
123
67
  importantForAccessibility="no-hide-descendants"
124
68
  accessibilityElementsHidden
125
69
  >
126
70
  <Animated.View
127
- style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
71
+ style={[IOListItemStyles.listItemInner, scaleAnimatedStyle]}
128
72
  >
129
73
  {icon && (
130
74
  <View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
@@ -1,26 +1,15 @@
1
1
  import * as React from "react";
2
- import { useCallback, useState } from "react";
2
+ import { useState } from "react";
3
3
  import { Pressable, View } from "react-native";
4
4
  import ReactNativeHapticFeedback from "react-native-haptic-feedback";
5
- import Animated, {
6
- Extrapolate,
7
- interpolate,
8
- interpolateColor,
9
- useAnimatedStyle,
10
- useDerivedValue,
11
- useSharedValue,
12
- withSpring
13
- } from "react-native-reanimated";
5
+ import Animated from "react-native-reanimated";
14
6
  import {
15
- IOColors,
16
- IOScaleValues,
17
7
  IOSelectionListItemStyles,
18
8
  IOSelectionListItemVisualParams,
19
- IOSpringValues,
20
9
  IOStyles,
21
- hexToRgba,
22
10
  useIOTheme
23
11
  } from "../../core";
12
+ import { useListItemAnimation } from "../../hooks";
24
13
  import { AnimatedCheckbox } from "../checkbox/AnimatedCheckbox";
25
14
  import { IOIcons, Icon } from "../icons";
26
15
  import { HSpacer, VSpacer } from "../spacer";
@@ -60,15 +49,8 @@ export const ListItemCheckbox = ({
60
49
  onValueChange
61
50
  }: ListItemCheckboxProps) => {
62
51
  const [toggleValue, setToggleValue] = useState(selected ?? false);
63
- // Animations
64
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
65
-
66
- // Scaling transformation applied when the button is pressed
67
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
68
-
69
- const progressPressed = useDerivedValue(() =>
70
- withSpring(isPressed.value, IOSpringValues.button)
71
- );
52
+ const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
53
+ useListItemAnimation();
72
54
 
73
55
  // Theme
74
56
  const theme = useIOTheme();
@@ -79,46 +61,6 @@ export const ListItemCheckbox = ({
79
61
  ? `${value}, ${description}`
80
62
  : value;
81
63
 
82
- const mapBackgroundStates: Record<string, string> = {
83
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
84
- pressed: IOColors[theme["listItem-pressed"]]
85
- };
86
-
87
- // Interpolate animation values from `isPressed` values
88
- const animatedScaleStyle = useAnimatedStyle(() => {
89
- const scale = interpolate(
90
- progressPressed.value,
91
- [0, 1],
92
- [1, animationScaleValue],
93
- Extrapolate.CLAMP
94
- );
95
-
96
- return {
97
- transform: [{ scale }]
98
- };
99
- });
100
-
101
- const handlePressIn = useCallback(() => {
102
- // eslint-disable-next-line functional/immutable-data
103
- isPressed.value = 1;
104
- }, [isPressed]);
105
- const handlePressOut = useCallback(() => {
106
- // eslint-disable-next-line functional/immutable-data
107
- isPressed.value = 0;
108
- }, [isPressed]);
109
-
110
- const animatedBackgroundStyle = useAnimatedStyle(() => {
111
- const backgroundColor = interpolateColor(
112
- progressPressed.value,
113
- [0, 1],
114
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
115
- );
116
-
117
- return {
118
- backgroundColor
119
- };
120
- });
121
-
122
64
  const toggleCheckbox = () => {
123
65
  ReactNativeHapticFeedback.trigger("impactLight");
124
66
  setToggleValue(!toggleValue);
@@ -130,9 +72,9 @@ export const ListItemCheckbox = ({
130
72
  return (
131
73
  <Pressable
132
74
  onPress={toggleCheckbox}
133
- onPressIn={handlePressIn}
134
- onPressOut={handlePressOut}
135
- onTouchEnd={handlePressOut}
75
+ onPressIn={onPressIn}
76
+ onPressOut={onPressOut}
77
+ onTouchEnd={onPressOut}
136
78
  testID="ListItemCheckbox"
137
79
  accessible={true}
138
80
  accessibilityLabel={accessibilityLabel || fallbackAccessibilityLabel}
@@ -147,14 +89,14 @@ export const ListItemCheckbox = ({
147
89
  <Animated.View
148
90
  style={[
149
91
  IOSelectionListItemStyles.listItem,
150
- animatedBackgroundStyle,
92
+ backgroundAnimatedStyle,
151
93
  { opacity: disabled ? DISABLED_OPACITY : 1 }
152
94
  ]}
153
95
  // This is required to avoid opacity
154
96
  // inheritance on Android
155
97
  needsOffscreenAlphaCompositing={true}
156
98
  >
157
- <Animated.View style={animatedScaleStyle}>
99
+ <Animated.View style={scaleAnimatedStyle}>
158
100
  <View style={IOSelectionListItemStyles.listItemInner}>
159
101
  <View style={[IOStyles.row, { flexShrink: 1 }]}>
160
102
  {icon && (
@@ -87,7 +87,7 @@ export const ListItemHeader = ({
87
87
  [label, theme, endElement]
88
88
  );
89
89
 
90
- const listItemInfoAction = useCallback(() => {
90
+ const listItemAction = useCallback(() => {
91
91
  if (endElement) {
92
92
  const { type, componentProps } = endElement;
93
93
 
@@ -141,7 +141,7 @@ export const ListItemHeader = ({
141
141
  <View style={IOStyles.flex}>{itemInfoTextComponent}</View>
142
142
  {endElement && (
143
143
  <View style={{ marginLeft: IOListItemVisualParams.actionMargin }}>
144
- {listItemInfoAction()}
144
+ {listItemAction()}
145
145
  </View>
146
146
  )}
147
147
  </View>
@@ -1,25 +1,13 @@
1
- import React, { ComponentProps, useCallback, useMemo } from "react";
1
+ import React, { ComponentProps, useMemo } from "react";
2
2
  import { GestureResponderEvent, Pressable, View } from "react-native";
3
- import Animated, {
4
- Extrapolate,
5
- interpolate,
6
- interpolateColor,
7
- useAnimatedStyle,
8
- useDerivedValue,
9
- useSharedValue,
10
- withSpring
11
- } from "react-native-reanimated";
3
+ import Animated from "react-native-reanimated";
12
4
  import {
13
- IOColors,
14
5
  IOListItemStyles,
15
6
  IOListItemVisualParams,
16
- IOScaleValues,
17
- IOSpringValues,
18
7
  IOStyles,
19
- hexToRgba,
20
- useIOExperimentalDesign,
21
8
  useIOTheme
22
9
  } from "../../core";
10
+ import { useListItemAnimation } from "../../hooks";
23
11
  import { WithTestID } from "../../utils/types";
24
12
  import { IOIcons, Icon } from "../icons";
25
13
  import { BodySmall, H6 } from "../typography";
@@ -46,9 +34,9 @@ export const ListItemInfoCopy = ({
46
34
  accessibilityHint,
47
35
  testID
48
36
  }: ListItemInfoCopy) => {
49
- const isPressed = useSharedValue(0);
50
- const { isExperimental } = useIOExperimentalDesign();
51
37
  const theme = useIOTheme();
38
+ const { onPressIn, onPressOut, scaleAnimatedStyle, backgroundAnimatedStyle } =
39
+ useListItemAnimation();
52
40
 
53
41
  const componentValueToAccessibility = useMemo(
54
42
  () => (typeof value === "string" ? value : ""),
@@ -63,9 +51,7 @@ export const ListItemInfoCopy = ({
63
51
  [label, componentValueToAccessibility, accessibilityLabel]
64
52
  );
65
53
 
66
- const foregroundColor = isExperimental
67
- ? theme["interactiveElem-default"]
68
- : "blue";
54
+ const foregroundColor = theme["interactiveElem-default"];
69
55
 
70
56
  const listItemInfoCopyContent = (
71
57
  <>
@@ -83,58 +69,12 @@ export const ListItemInfoCopy = ({
83
69
  </>
84
70
  );
85
71
 
86
- const mapBackgroundStates: Record<string, string> = {
87
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
88
- pressed: IOColors[theme["listItem-pressed"]]
89
- };
90
-
91
- // Scaling transformation applied when the button is pressed
92
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
93
-
94
- const progressPressed = useDerivedValue(() =>
95
- withSpring(isPressed.value, IOSpringValues.button)
96
- );
97
-
98
- // Interpolate animation values from `isPressed` values
99
- const animatedScaleStyle = useAnimatedStyle(() => {
100
- const scale = interpolate(
101
- progressPressed.value,
102
- [0, 1],
103
- [1, animationScaleValue],
104
- Extrapolate.CLAMP
105
- );
106
-
107
- return {
108
- transform: [{ scale }]
109
- };
110
- });
111
-
112
- const animatedBackgroundStyle = useAnimatedStyle(() => {
113
- const backgroundColor = interpolateColor(
114
- progressPressed.value,
115
- [0, 1],
116
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
117
- );
118
-
119
- return {
120
- backgroundColor
121
- };
122
- });
123
-
124
- const handlePressIn = useCallback(() => {
125
- // eslint-disable-next-line functional/immutable-data
126
- isPressed.value = 1;
127
- }, [isPressed]);
128
- const handlePressOut = useCallback(() => {
129
- // eslint-disable-next-line functional/immutable-data
130
- isPressed.value = 0;
131
- }, [isPressed]);
132
-
133
72
  return (
134
73
  <Pressable
135
74
  onPress={onPress}
136
- onPressIn={handlePressIn}
137
- onPressOut={handlePressOut}
75
+ onPressIn={onPressIn}
76
+ onPressOut={onPressOut}
77
+ onTouchEnd={onPressOut}
138
78
  accessible={true}
139
79
  accessibilityLabel={listItemAccessibilityLabel}
140
80
  accessibilityHint={accessibilityHint}
@@ -144,10 +84,10 @@ export const ListItemInfoCopy = ({
144
84
  <Animated.View
145
85
  importantForAccessibility="no-hide-descendants"
146
86
  accessibilityElementsHidden
147
- style={[IOListItemStyles.listItem, animatedBackgroundStyle]}
87
+ style={[IOListItemStyles.listItem, backgroundAnimatedStyle]}
148
88
  >
149
89
  <Animated.View
150
- style={[IOListItemStyles.listItemInner, animatedScaleStyle]}
90
+ style={[IOListItemStyles.listItemInner, scaleAnimatedStyle]}
151
91
  >
152
92
  {icon && (
153
93
  <View style={{ marginRight: IOListItemVisualParams.iconMargin }}>