@pagopa/io-app-design-system 4.2.0 → 4.3.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 (269) 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/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -1
  8. package/lib/commonjs/components/buttons/ButtonLink.js +20 -53
  9. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonOutline.js +24 -44
  11. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonSolid.js +14 -39
  13. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  14. package/lib/commonjs/components/buttons/IconButton.js +13 -32
  15. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  16. package/lib/commonjs/components/buttons/IconButtonContained.js +19 -42
  17. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  18. package/lib/commonjs/components/buttons/IconButtonSolid.js +15 -31
  19. package/lib/commonjs/components/buttons/IconButtonSolid.js.map +1 -1
  20. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  21. package/lib/commonjs/components/layout/index.js +0 -11
  22. package/lib/commonjs/components/layout/index.js.map +1 -1
  23. package/lib/commonjs/components/listitems/ListItemAction.js +16 -41
  24. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  25. package/lib/commonjs/components/listitems/ListItemCheckbox.js +13 -41
  26. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  27. package/lib/commonjs/components/listitems/ListItemHeader.js +2 -2
  28. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  29. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +15 -43
  30. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  31. package/lib/commonjs/components/listitems/ListItemNav.js +17 -48
  32. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  33. package/lib/commonjs/components/listitems/ListItemNavAlert.js +19 -50
  34. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  35. package/lib/commonjs/components/listitems/ListItemRadio.js +20 -50
  36. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  37. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +13 -25
  38. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  39. package/lib/commonjs/components/listitems/ListItemTransaction.js +4 -5
  40. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  41. package/lib/commonjs/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
  42. package/lib/commonjs/components/listitems/PressableListItemBase.js.map +1 -0
  43. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +45 -81
  44. package/lib/commonjs/components/listitems/__test__/listitem.test.js +3 -3
  45. package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
  46. package/lib/commonjs/components/listitems/index.js +11 -11
  47. package/lib/commonjs/components/listitems/index.js.map +1 -1
  48. package/lib/commonjs/components/modules/ModuleCredential.js +35 -28
  49. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  50. package/lib/commonjs/components/modules/PressableModuleBase.js +17 -11
  51. package/lib/commonjs/components/modules/PressableModuleBase.js.map +1 -1
  52. package/lib/commonjs/components/modules/index.js +8 -8
  53. package/lib/commonjs/components/modules/index.js.map +1 -1
  54. package/lib/commonjs/components/numberpad/NumberButton.js +12 -28
  55. package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
  56. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  57. package/lib/commonjs/components/stack/Stack.js +4 -3
  58. package/lib/commonjs/components/stack/Stack.js.map +1 -1
  59. package/lib/commonjs/components/tabs/TabItem.js +15 -21
  60. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  61. package/lib/commonjs/components/typography/H6.js +1 -1
  62. package/lib/commonjs/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  63. package/lib/commonjs/core/IOAnimations.js +6 -12
  64. package/lib/commonjs/core/IOAnimations.js.map +1 -1
  65. package/lib/commonjs/hooks/index.js +28 -0
  66. package/lib/commonjs/hooks/index.js.map +1 -0
  67. package/lib/commonjs/hooks/useListItemAnimation.js +40 -0
  68. package/lib/commonjs/hooks/useListItemAnimation.js.map +1 -0
  69. package/lib/commonjs/hooks/useScaleAnimation.js +36 -0
  70. package/lib/commonjs/hooks/useScaleAnimation.js.map +1 -0
  71. package/lib/commonjs/index.js +11 -0
  72. package/lib/commonjs/index.js.map +1 -1
  73. package/lib/commonjs/utils/fonts.js +1 -1
  74. package/lib/commonjs/utils/hooks/index.js +28 -0
  75. package/lib/commonjs/utils/hooks/index.js.map +1 -0
  76. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js +5 -7
  77. package/lib/commonjs/utils/hooks/useSpringPressProgressValue.js.map +1 -1
  78. package/lib/module/components/alert/Alert.js +10 -32
  79. package/lib/module/components/alert/Alert.js.map +1 -1
  80. package/lib/module/components/alert/AlertEdgeToEdge.js +10 -31
  81. package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
  82. package/lib/module/components/banner/Banner.js +10 -33
  83. package/lib/module/components/banner/Banner.js.map +1 -1
  84. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -1
  85. package/lib/module/components/buttons/ButtonLink.js +23 -56
  86. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  87. package/lib/module/components/buttons/ButtonOutline.js +27 -47
  88. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  89. package/lib/module/components/buttons/ButtonSolid.js +17 -42
  90. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  91. package/lib/module/components/buttons/IconButton.js +16 -35
  92. package/lib/module/components/buttons/IconButton.js.map +1 -1
  93. package/lib/module/components/buttons/IconButtonContained.js +21 -45
  94. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  95. package/lib/module/components/buttons/IconButtonSolid.js +17 -34
  96. package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
  97. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  98. package/lib/module/components/layout/index.js +0 -1
  99. package/lib/module/components/layout/index.js.map +1 -1
  100. package/lib/module/components/listitems/ListItemAction.js +17 -43
  101. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  102. package/lib/module/components/listitems/ListItemCheckbox.js +15 -43
  103. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  104. package/lib/module/components/listitems/ListItemHeader.js +2 -2
  105. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  106. package/lib/module/components/listitems/ListItemInfoCopy.js +16 -45
  107. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  108. package/lib/module/components/listitems/ListItemNav.js +17 -47
  109. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  110. package/lib/module/components/listitems/ListItemNavAlert.js +19 -49
  111. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  112. package/lib/module/components/listitems/ListItemRadio.js +22 -52
  113. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  114. package/lib/module/components/listitems/ListItemRadioWithAmount.js +14 -26
  115. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  116. package/lib/module/components/listitems/ListItemTransaction.js +3 -4
  117. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  118. package/lib/module/components/listitems/{PressableListItemsBase.js → PressableListItemBase.js} +7 -7
  119. package/lib/module/components/listitems/PressableListItemBase.js.map +1 -0
  120. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +45 -81
  121. package/lib/module/components/listitems/__test__/listitem.test.js +1 -1
  122. package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
  123. package/lib/module/components/listitems/index.js +1 -1
  124. package/lib/module/components/listitems/index.js.map +1 -1
  125. package/lib/module/components/modules/ModuleCredential.js +36 -29
  126. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  127. package/lib/module/components/modules/PressableModuleBase.js +17 -10
  128. package/lib/module/components/modules/PressableModuleBase.js.map +1 -1
  129. package/lib/module/components/modules/index.js +1 -1
  130. package/lib/module/components/modules/index.js.map +1 -1
  131. package/lib/module/components/numberpad/NumberButton.js +14 -30
  132. package/lib/module/components/numberpad/NumberButton.js.map +1 -1
  133. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  134. package/lib/module/components/stack/Stack.js +4 -3
  135. package/lib/module/components/stack/Stack.js.map +1 -1
  136. package/lib/module/components/tabs/TabItem.js +18 -24
  137. package/lib/module/components/tabs/TabItem.js.map +1 -1
  138. package/lib/module/components/typography/H6.js +1 -1
  139. package/lib/module/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  140. package/lib/module/core/IOAnimations.js +4 -10
  141. package/lib/module/core/IOAnimations.js.map +1 -1
  142. package/lib/module/hooks/index.js +3 -0
  143. package/lib/module/hooks/index.js.map +1 -0
  144. package/lib/module/hooks/useListItemAnimation.js +33 -0
  145. package/lib/module/hooks/useListItemAnimation.js.map +1 -0
  146. package/lib/module/hooks/useScaleAnimation.js +29 -0
  147. package/lib/module/hooks/useScaleAnimation.js.map +1 -0
  148. package/lib/module/index.js +1 -0
  149. package/lib/module/index.js.map +1 -1
  150. package/lib/module/utils/fonts.js +1 -1
  151. package/lib/module/utils/hooks/index.js +3 -0
  152. package/lib/module/utils/hooks/index.js.map +1 -0
  153. package/lib/module/utils/hooks/useSpringPressProgressValue.js +5 -5
  154. package/lib/module/utils/hooks/useSpringPressProgressValue.js.map +1 -1
  155. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  156. package/lib/typescript/components/alert/AlertEdgeToEdge.d.ts.map +1 -1
  157. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  158. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  159. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  160. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  161. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  162. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  163. package/lib/typescript/components/buttons/IconButtonSolid.d.ts.map +1 -1
  164. package/lib/typescript/components/layout/index.d.ts +0 -1
  165. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  166. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  167. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  168. package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
  169. package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
  170. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  171. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  172. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  173. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +1 -1
  174. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  175. package/lib/typescript/components/listitems/{PressableListItemsBase.d.ts → PressableListItemBase.d.ts} +3 -2
  176. package/lib/typescript/components/listitems/PressableListItemBase.d.ts.map +1 -0
  177. package/lib/typescript/components/listitems/index.d.ts +1 -1
  178. package/lib/typescript/components/listitems/index.d.ts.map +1 -1
  179. package/lib/typescript/components/modules/ModuleCredential.d.ts +2 -2
  180. package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
  181. package/lib/typescript/components/modules/PressableModuleBase.d.ts.map +1 -1
  182. package/lib/typescript/components/modules/index.d.ts +1 -1
  183. package/lib/typescript/components/modules/index.d.ts.map +1 -1
  184. package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
  185. package/lib/typescript/components/stack/Stack.d.ts +4 -3
  186. package/lib/typescript/components/stack/Stack.d.ts.map +1 -1
  187. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  188. package/lib/typescript/core/IOAnimations.d.ts +6 -10
  189. package/lib/typescript/core/IOAnimations.d.ts.map +1 -1
  190. package/lib/typescript/hooks/index.d.ts +3 -0
  191. package/lib/typescript/hooks/index.d.ts.map +1 -0
  192. package/lib/typescript/hooks/useListItemAnimation.d.ts +10 -0
  193. package/lib/typescript/hooks/useListItemAnimation.d.ts.map +1 -0
  194. package/lib/typescript/hooks/useScaleAnimation.d.ts +10 -0
  195. package/lib/typescript/hooks/useScaleAnimation.d.ts.map +1 -0
  196. package/lib/typescript/index.d.ts +1 -0
  197. package/lib/typescript/index.d.ts.map +1 -1
  198. package/lib/typescript/utils/fonts.d.ts +1 -1
  199. package/lib/typescript/utils/hooks/index.d.ts +3 -0
  200. package/lib/typescript/utils/hooks/index.d.ts.map +1 -0
  201. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts +7 -8
  202. package/lib/typescript/utils/hooks/useSpringPressProgressValue.d.ts.map +1 -1
  203. package/package.json +1 -1
  204. package/src/components/alert/Alert.tsx +7 -46
  205. package/src/components/alert/AlertEdgeToEdge.tsx +6 -46
  206. package/src/components/banner/Banner.tsx +6 -52
  207. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +1 -1
  208. package/src/components/buttons/ButtonLink.tsx +32 -89
  209. package/src/components/buttons/ButtonOutline.tsx +26 -60
  210. package/src/components/buttons/ButtonSolid.tsx +11 -58
  211. package/src/components/buttons/IconButton.tsx +10 -47
  212. package/src/components/buttons/IconButtonContained.tsx +21 -57
  213. package/src/components/buttons/IconButtonSolid.tsx +15 -46
  214. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +34 -10
  215. package/src/components/layout/index.tsx +0 -1
  216. package/src/components/listitems/ListItemAction.tsx +11 -67
  217. package/src/components/listitems/ListItemCheckbox.tsx +10 -68
  218. package/src/components/listitems/ListItemHeader.tsx +2 -2
  219. package/src/components/listitems/ListItemInfoCopy.tsx +11 -71
  220. package/src/components/listitems/ListItemNav.tsx +13 -74
  221. package/src/components/listitems/ListItemNavAlert.tsx +18 -92
  222. package/src/components/listitems/ListItemRadio.tsx +14 -75
  223. package/src/components/listitems/ListItemRadioWithAmount.tsx +16 -31
  224. package/src/components/listitems/ListItemTransaction.tsx +3 -7
  225. package/src/components/listitems/{PressableListItemsBase.tsx → PressableListItemBase.tsx} +7 -6
  226. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +45 -81
  227. package/src/components/listitems/__test__/listitem.test.tsx +1 -1
  228. package/src/components/listitems/index.tsx +1 -1
  229. package/src/components/modules/ModuleCredential.tsx +49 -39
  230. package/src/components/modules/PressableModuleBase.tsx +15 -8
  231. package/src/components/modules/index.tsx +1 -1
  232. package/src/components/numberpad/NumberButton.tsx +12 -43
  233. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +20 -0
  234. package/src/components/stack/Stack.tsx +11 -3
  235. package/src/components/tabs/TabItem.tsx +15 -29
  236. package/src/components/typography/H6.tsx +1 -1
  237. package/src/components/typography/__test__/__snapshots__/typography.test.tsx.snap +1 -1
  238. package/src/core/IOAnimations.ts +8 -10
  239. package/src/hooks/index.tsx +2 -0
  240. package/src/hooks/useListItemAnimation.tsx +59 -0
  241. package/src/hooks/useScaleAnimation.tsx +41 -0
  242. package/src/index.tsx +1 -0
  243. package/src/utils/fonts.ts +1 -1
  244. package/src/utils/hooks/index.tsx +2 -0
  245. package/src/utils/hooks/useSpringPressProgressValue.ts +14 -8
  246. package/lib/commonjs/components/layout/FooterWithButtons.js +0 -84
  247. package/lib/commonjs/components/layout/FooterWithButtons.js.map +0 -1
  248. package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +0 -1
  249. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js +0 -56
  250. package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
  251. package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js +0 -41
  252. package/lib/commonjs/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
  253. package/lib/module/components/layout/FooterWithButtons.js +0 -75
  254. package/lib/module/components/layout/FooterWithButtons.js.map +0 -1
  255. package/lib/module/components/listitems/PressableListItemsBase.js.map +0 -1
  256. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js +0 -47
  257. package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +0 -1
  258. package/lib/module/components/modules/hooks/useModuleSpringAnimation.js +0 -34
  259. package/lib/module/components/modules/hooks/useModuleSpringAnimation.js.map +0 -1
  260. package/lib/typescript/components/layout/FooterWithButtons.d.ts +0 -16
  261. package/lib/typescript/components/layout/FooterWithButtons.d.ts.map +0 -1
  262. package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +0 -1
  263. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts +0 -13
  264. package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +0 -1
  265. package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts +0 -10
  266. package/lib/typescript/components/modules/hooks/useModuleSpringAnimation.d.ts.map +0 -1
  267. package/src/components/layout/FooterWithButtons.tsx +0 -90
  268. package/src/components/listitems/hooks/useListItemSpringAnimation.ts +0 -72
  269. package/src/components/modules/hooks/useModuleSpringAnimation.ts +0 -49
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useListItemSpringAnimation = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _reactNativeReanimated = require("react-native-reanimated");
9
- var _core = require("../../../core");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- const useListItemSpringAnimation = () => {
13
- var _IOScaleValues$basicB;
14
- const theme = (0, _core.useIOTheme)();
15
- const isPressed = (0, _reactNativeReanimated.useSharedValue)(0);
16
- const mapBackgroundStates = {
17
- default: (0, _core.hexToRgba)(_core.IOColors[theme["listItem-pressed"]], 0),
18
- pressed: _core.IOColors[theme["listItem-pressed"]]
19
- };
20
-
21
- // Scaling transformation applied when the button is pressed
22
- const animationScaleValue = _core.IOScaleValues === null || _core.IOScaleValues === void 0 || (_IOScaleValues$basicB = _core.IOScaleValues.basicButton) === null || _IOScaleValues$basicB === void 0 ? void 0 : _IOScaleValues$basicB.pressedState;
23
- const progressPressed = (0, _reactNativeReanimated.useDerivedValue)(() => (0, _reactNativeReanimated.withSpring)(isPressed.value, _core.IOSpringValues.button));
24
-
25
- // Interpolate animation values from `isPressed` values
26
- const animatedScaleStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
27
- const scale = (0, _reactNativeReanimated.interpolate)(progressPressed.value, [0, 1], [1, animationScaleValue], _reactNativeReanimated.Extrapolate.CLAMP);
28
- return {
29
- transform: [{
30
- scale
31
- }]
32
- };
33
- });
34
- const animatedBackgroundStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
35
- const backgroundColor = (0, _reactNativeReanimated.interpolateColor)(progressPressed.value, [0, 1], [mapBackgroundStates.default, mapBackgroundStates.pressed]);
36
- return {
37
- backgroundColor
38
- };
39
- });
40
- const onPressIn = React.useCallback(() => {
41
- // eslint-disable-next-line functional/immutable-data
42
- isPressed.value = 1;
43
- }, [isPressed]);
44
- const onPressOut = React.useCallback(() => {
45
- // eslint-disable-next-line functional/immutable-data
46
- isPressed.value = 0;
47
- }, [isPressed]);
48
- return {
49
- onPressIn,
50
- onPressOut,
51
- animatedScaleStyle,
52
- animatedBackgroundStyle
53
- };
54
- };
55
- exports.useListItemSpringAnimation = useListItemSpringAnimation;
56
- //# sourceMappingURL=useListItemSpringAnimation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_reactNativeReanimated","_core","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","useListItemSpringAnimation","_IOScaleValues$basicB","theme","useIOTheme","isPressed","useSharedValue","mapBackgroundStates","hexToRgba","IOColors","pressed","animationScaleValue","IOScaleValues","basicButton","pressedState","progressPressed","useDerivedValue","withSpring","value","IOSpringValues","button","animatedScaleStyle","useAnimatedStyle","scale","interpolate","Extrapolate","CLAMP","transform","animatedBackgroundStyle","backgroundColor","interpolateColor","onPressIn","useCallback","onPressOut","exports"],"sourceRoot":"../../../../../src","sources":["components/listitems/hooks/useListItemSpringAnimation.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAA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AAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACb,SAAS,CAAC,CAAC;EACf,MAAM4B,UAAU,GAAG3D,KAAK,CAAC0D,WAAW,CAAC,MAAM;IACzC;IACA3B,SAAS,CAACa,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACb,SAAS,CAAC,CAAC;EAEf,OAAO;IAAE0B,SAAS;IAAEE,UAAU;IAAEZ,kBAAkB;IAAEO;EAAwB,CAAC;AAC/E,CAAC;AAACM,OAAA,CAAAjC,0BAAA,GAAAA,0BAAA"}
@@ -1,41 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useModuleSpringAnimation = void 0;
7
- var _reactNativeReanimated = require("react-native-reanimated");
8
- var _react = require("react");
9
- var _core = require("../../../core");
10
- const useModuleSpringAnimation = () => {
11
- var _IOScaleValues$magnif;
12
- const isPressed = (0, _reactNativeReanimated.useSharedValue)(0);
13
- // Scaling transformation applied when the button is pressed
14
- const animationScaleValue = _core.IOScaleValues === null || _core.IOScaleValues === void 0 || (_IOScaleValues$magnif = _core.IOScaleValues.magnifiedButton) === null || _IOScaleValues$magnif === void 0 ? void 0 : _IOScaleValues$magnif.pressedState;
15
- const scaleTraversed = (0, _reactNativeReanimated.useDerivedValue)(() => (0, _reactNativeReanimated.withSpring)(isPressed.value, _core.IOSpringValues.button));
16
-
17
- // Interpolate animation values from `isPressed` values
18
- const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
19
- const scale = (0, _reactNativeReanimated.interpolate)(scaleTraversed.value, [0, 1], [1, animationScaleValue], _reactNativeReanimated.Extrapolate.CLAMP);
20
- return {
21
- transform: [{
22
- scale
23
- }]
24
- };
25
- });
26
- const handlePressIn = (0, _react.useCallback)(() => {
27
- // eslint-disable-next-line functional/immutable-data
28
- isPressed.value = 1;
29
- }, [isPressed]);
30
- const handlePressOut = (0, _react.useCallback)(() => {
31
- // eslint-disable-next-line functional/immutable-data
32
- isPressed.value = 0;
33
- }, [isPressed]);
34
- return {
35
- animatedStyle,
36
- handlePressIn,
37
- handlePressOut
38
- };
39
- };
40
- exports.useModuleSpringAnimation = useModuleSpringAnimation;
41
- //# sourceMappingURL=useModuleSpringAnimation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNativeReanimated","require","_react","_core","useModuleSpringAnimation","_IOScaleValues$magnif","isPressed","useSharedValue","animationScaleValue","IOScaleValues","magnifiedButton","pressedState","scaleTraversed","useDerivedValue","withSpring","value","IOSpringValues","button","animatedStyle","useAnimatedStyle","scale","interpolate","Extrapolate","CLAMP","transform","handlePressIn","useCallback","handlePressOut","exports"],"sourceRoot":"../../../../../src","sources":["components/modules/hooks/useModuleSpringAnimation.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAEO,MAAMG,wBAAwB,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA;EAC5C,MAAMC,SAAS,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EACnC;EACA,MAAMC,mBAAmB,GAAGC,mBAAa,aAAbA,mBAAa,gBAAAJ,qBAAA,GAAbI,mBAAa,CAAEC,eAAe,cAAAL,qBAAA,uBAA9BA,qBAAA,CAAgCM,YAAY;EAExE,MAAMC,cAAc,GAAG,IAAAC,sCAAe,EAAC,MACrC,IAAAC,iCAAU,EAACR,SAAS,CAACS,KAAK,EAAEC,oBAAc,CAACC,MAAM,CACnD,CAAC;;EAED;EACA,MAAMC,aAAa,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAC3C,MAAMC,KAAK,GAAG,IAAAC,kCAAW,EACvBT,cAAc,CAACG,KAAK,EACpB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAEP,mBAAmB,CAAC,EACxBc,kCAAW,CAACC,KACd,CAAC;IAED,OAAO;MACLC,SAAS,EAAE,CAAC;QAAEJ;MAAM,CAAC;IACvB,CAAC;EACH,CAAC,CAAC;EAEF,MAAMK,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACtC;IACApB,SAAS,CAACS,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACT,SAAS,CAAC,CAAC;EACf,MAAMqB,cAAc,GAAG,IAAAD,kBAAW,EAAC,MAAM;IACvC;IACApB,SAAS,CAACS,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACT,SAAS,CAAC,CAAC;EAEf,OAAO;IACLY,aAAa;IACbO,aAAa;IACbE;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAAxB,wBAAA,GAAAA,wBAAA"}
@@ -1,75 +0,0 @@
1
- import * as React from "react";
2
- import { useMemo } from "react";
3
- import { StyleSheet, View } from "react-native";
4
- import { useSafeAreaInsets } from "react-native-safe-area-context";
5
- import { IOColors, IOVisualCostants } from "../../core";
6
- import { BlockButtons } from "./BlockButtons";
7
- // TODO: Refactor with an unique component like `FooterTopShadow` after bonus vacanze
8
- const styles = StyleSheet.create({
9
- container: {
10
- overflow: "hidden",
11
- width: "100%",
12
- // This Magic number is an heritage of the app code-base, this component should be removed in favor of `GradientBottomAction`
13
- marginTop: -50,
14
- paddingTop: 50
15
- },
16
- sticky: {
17
- position: "absolute",
18
- bottom: 0
19
- },
20
- footerShadow: {
21
- backgroundColor: IOColors.white,
22
- paddingHorizontal: IOVisualCostants.appMarginDefault,
23
- // iOS shadow
24
- shadowColor: IOColors.black,
25
- shadowOffset: {
26
- width: 0,
27
- height: 50
28
- },
29
- shadowOpacity: 0.5,
30
- shadowRadius: 37,
31
- elevation: 20 // Prop supported on Android only
32
- }
33
- });
34
-
35
- const verticalSpacing = 16;
36
-
37
- /**
38
- * Implements a component that show buttons as sticky footer
39
- * It can include 1, 2 or 3 buttons. If they are 2, they can have the inlineHalf or the inlineOneThird style
40
- * @deprecated This component is deprecated. Use `FooterActions` or `FooterActionsInline` instead.
41
- * `FooterActionsInline` is the official replacement for `FooterWithButtons`, but use it only
42
- * if explicitly required.
43
- */
44
- export const FooterWithButtons = ({
45
- sticky = false,
46
- onLayoutChange,
47
- ...rest
48
- }) => {
49
- const insets = useSafeAreaInsets();
50
- const onLayout = event => {
51
- onLayoutChange === null || onLayoutChange === void 0 || onLayoutChange(event.nativeEvent.layout.height);
52
- };
53
-
54
- /* Check if the iPhone bottom handle is present.
55
- If not add a default margin to prevent the
56
- button from sticking to the bottom. */
57
- const bottomMargin = useMemo(() => insets.bottom === 0 ? verticalSpacing : insets.bottom, [insets]);
58
- return /*#__PURE__*/React.createElement(View, {
59
- style: {
60
- ...styles.container,
61
- ...(sticky ? styles.sticky : {})
62
- },
63
- accessible: rest.accessible,
64
- pointerEvents: "box-none",
65
- testID: "FooterWithButtons"
66
- }, /*#__PURE__*/React.createElement(View, {
67
- onLayout: onLayout,
68
- style: [styles.footerShadow, {
69
- paddingBottom: bottomMargin,
70
- paddingTop: verticalSpacing
71
- }]
72
- }, /*#__PURE__*/React.createElement(BlockButtons, rest)));
73
- };
74
- export default FooterWithButtons;
75
- //# sourceMappingURL=FooterWithButtons.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","useSafeAreaInsets","IOColors","IOVisualCostants","BlockButtons","styles","create","container","overflow","width","marginTop","paddingTop","sticky","position","bottom","footerShadow","backgroundColor","white","paddingHorizontal","appMarginDefault","shadowColor","black","shadowOffset","height","shadowOpacity","shadowRadius","elevation","verticalSpacing","FooterWithButtons","onLayoutChange","rest","insets","onLayout","event","nativeEvent","layout","bottomMargin","createElement","style","accessible","pointerEvents","testID","paddingBottom"],"sourceRoot":"../../../../src","sources":["components/layout/FooterWithButtons.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,OAAO,QAAQ,OAAO;AAC/B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,iBAAiB,QAAQ,gCAAgC;AACl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,CAAAwC,aAAA,CAACrC,IAAI;IACHsC,KAAK,EAAE;MAAE,GAAGjC,MAAM,CAACE,SAAS;MAAE,IAAIK,MAAM,GAAGP,MAAM,CAACO,MAAM,GAAG,CAAC,CAAC;IAAE,CAAE;IACjE2B,UAAU,EAAET,IAAI,CAACS,UAAW;IAC5BC,aAAa,EAAE,UAAW;IAC1BC,MAAM,EAAC;EAAmB,gBAE1B5C,KAAA,CAAAwC,aAAA,CAACrC,IAAI;IACHgC,QAAQ,EAAEA,QAAS;IACnBM,KAAK,EAAE,CACLjC,MAAM,CAACU,YAAY,EACnB;MAAE2B,aAAa,EAAEN,YAAY;MAAEzB,UAAU,EAAEgB;IAAgB,CAAC;EAC5D,gBAEF9B,KAAA,CAAAwC,aAAA,CAACjC,YAAY,EAAK0B,IAAO,CACrB,CACF,CAAC;AAEX,CAAC;AAED,eAAeF,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Pressable","Animated","IOListItemStyles","IOListItemVisualParams","useListItemSpringAnimation","PressableListItemBase","onPress","testID","children","accessibilityRole","props","onPressIn","onPressOut","animatedScaleStyle","animatedBackgroundStyle","createElement","_extends","accessible","onTouchEnd","View","style","listItem","listItemInner","columnGap","iconMargin"],"sourceRoot":"../../../../src","sources":["components/listitems/PressableListItemsBase.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,QAAQ,cAAc;AACxC,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,gBAAgB,EAAEC,sBAAsB,QAAQ,YAAY;AAErE,SAASC,0BAA0B,QAAQ,oCAAoC;AAa/E,OAAO,MAAMC,qBAAqB,GAAGA,CAAC;EACpCC,OAAO;EACPC,MAAM;EACNC,QAAQ;EACRC,iBAAiB;EACjB,GAAGC;AACwC,CAAC,KAAK;EACjD,MAAM;IAAEC,SAAS;IAAEC,UAAU;IAAEC,kBAAkB;IAAEC;EAAwB,CAAC,GAC1EV,0BAA0B,CAAC,CAAC;EAC9B,oBACEL,KAAA,CAAAgB,aAAA,CAACf,SAAS,EAAAgB,QAAA;IACRV,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfU,UAAU,EAAE,IAAK;IACjBN,SAAS,EAAEA,SAAU;IACrBC,UAAU,EAAEA,UAAW;IACvBM,UAAU,EAAEN,UAAW;IACvBH,iBAAiB,EAAEA,iBAAiB,IAAI;EAAS,GAC7CC,KAAK,gBAETX,KAAA,CAAAgB,aAAA,CAACd,QAAQ,CAACkB,IAAI;IACZC,KAAK,EAAE,CAAClB,gBAAgB,CAACmB,QAAQ,EAAEP,uBAAuB;EAAE,gBAE5Df,KAAA,CAAAgB,aAAA,CAACd,QAAQ,CAACkB,IAAI;IACZC,KAAK,EAAE,CACLlB,gBAAgB,CAACoB,aAAa,EAC9B;MAAEC,SAAS,EAAEpB,sBAAsB,CAACqB;IAAW,CAAC,EAChDX,kBAAkB;EAClB,GAEDL,QACY,CACF,CACN,CAAC;AAEhB,CAAC"}
@@ -1,47 +0,0 @@
1
- import * as React from "react";
2
- import { Extrapolate, interpolate, interpolateColor, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring } from "react-native-reanimated";
3
- import { IOColors, IOScaleValues, IOSpringValues, hexToRgba, useIOTheme } from "../../../core";
4
- export const useListItemSpringAnimation = () => {
5
- var _IOScaleValues$basicB;
6
- const theme = useIOTheme();
7
- const isPressed = useSharedValue(0);
8
- const mapBackgroundStates = {
9
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
10
- pressed: IOColors[theme["listItem-pressed"]]
11
- };
12
-
13
- // Scaling transformation applied when the button is pressed
14
- const animationScaleValue = IOScaleValues === null || IOScaleValues === void 0 || (_IOScaleValues$basicB = IOScaleValues.basicButton) === null || _IOScaleValues$basicB === void 0 ? void 0 : _IOScaleValues$basicB.pressedState;
15
- const progressPressed = useDerivedValue(() => withSpring(isPressed.value, IOSpringValues.button));
16
-
17
- // Interpolate animation values from `isPressed` values
18
- const animatedScaleStyle = useAnimatedStyle(() => {
19
- const scale = interpolate(progressPressed.value, [0, 1], [1, animationScaleValue], Extrapolate.CLAMP);
20
- return {
21
- transform: [{
22
- scale
23
- }]
24
- };
25
- });
26
- const animatedBackgroundStyle = useAnimatedStyle(() => {
27
- const backgroundColor = interpolateColor(progressPressed.value, [0, 1], [mapBackgroundStates.default, mapBackgroundStates.pressed]);
28
- return {
29
- backgroundColor
30
- };
31
- });
32
- const onPressIn = React.useCallback(() => {
33
- // eslint-disable-next-line functional/immutable-data
34
- isPressed.value = 1;
35
- }, [isPressed]);
36
- const onPressOut = React.useCallback(() => {
37
- // eslint-disable-next-line functional/immutable-data
38
- isPressed.value = 0;
39
- }, [isPressed]);
40
- return {
41
- onPressIn,
42
- onPressOut,
43
- animatedScaleStyle,
44
- animatedBackgroundStyle
45
- };
46
- };
47
- //# sourceMappingURL=useListItemSpringAnimation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Extrapolate","interpolate","interpolateColor","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","IOColors","IOScaleValues","IOSpringValues","hexToRgba","useIOTheme","useListItemSpringAnimation","_IOScaleValues$basicB","theme","isPressed","mapBackgroundStates","default","pressed","animationScaleValue","basicButton","pressedState","progressPressed","value","button","animatedScaleStyle","scale","CLAMP","transform","animatedBackgroundStyle","backgroundColor","onPressIn","useCallback","onPressOut"],"sourceRoot":"../../../../../src","sources":["components/listitems/hooks/useListItemSpringAnimation.ts"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SACEC,QAAQ,EACRC,aAAa,EACbC,cAAc,EACdC,SAAS,EACTC,UAAU,QACL,eAAe;AAEtB,OAAO,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA;EAC9C,M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,CAAC,EAAE,CAACR,SAAS,CAAC,CAAC;EACf,MAAMkB,UAAU,GAAGlC,KAAK,CAACiC,WAAW,CAAC,MAAM;IACzC;IACAjB,SAAS,CAACQ,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACR,SAAS,CAAC,CAAC;EAEf,OAAO;IAAEgB,SAAS;IAAEE,UAAU;IAAER,kBAAkB;IAAEI;EAAwB,CAAC;AAC/E,CAAC"}
@@ -1,34 +0,0 @@
1
- import { Extrapolate, interpolate, useAnimatedStyle, useDerivedValue, useSharedValue, withSpring } from "react-native-reanimated";
2
- import { useCallback } from "react";
3
- import { IOScaleValues, IOSpringValues } from "../../../core";
4
- export const useModuleSpringAnimation = () => {
5
- var _IOScaleValues$magnif;
6
- const isPressed = useSharedValue(0);
7
- // Scaling transformation applied when the button is pressed
8
- const animationScaleValue = IOScaleValues === null || IOScaleValues === void 0 || (_IOScaleValues$magnif = IOScaleValues.magnifiedButton) === null || _IOScaleValues$magnif === void 0 ? void 0 : _IOScaleValues$magnif.pressedState;
9
- const scaleTraversed = useDerivedValue(() => withSpring(isPressed.value, IOSpringValues.button));
10
-
11
- // Interpolate animation values from `isPressed` values
12
- const animatedStyle = useAnimatedStyle(() => {
13
- const scale = interpolate(scaleTraversed.value, [0, 1], [1, animationScaleValue], Extrapolate.CLAMP);
14
- return {
15
- transform: [{
16
- scale
17
- }]
18
- };
19
- });
20
- const handlePressIn = useCallback(() => {
21
- // eslint-disable-next-line functional/immutable-data
22
- isPressed.value = 1;
23
- }, [isPressed]);
24
- const handlePressOut = useCallback(() => {
25
- // eslint-disable-next-line functional/immutable-data
26
- isPressed.value = 0;
27
- }, [isPressed]);
28
- return {
29
- animatedStyle,
30
- handlePressIn,
31
- handlePressOut
32
- };
33
- };
34
- //# sourceMappingURL=useModuleSpringAnimation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Extrapolate","interpolate","useAnimatedStyle","useDerivedValue","useSharedValue","withSpring","useCallback","IOScaleValues","IOSpringValues","useModuleSpringAnimation","_IOScaleValues$magnif","isPressed","animationScaleValue","magnifiedButton","pressedState","scaleTraversed","value","button","animatedStyle","scale","CLAMP","transform","handlePressIn","handlePressOut"],"sourceRoot":"../../../../../src","sources":["components/modules/hooks/useModuleSpringAnimation.ts"],"mappings":"AAAA,SACEA,WAAW,EACXC,WAAW,EACXC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,UAAU,QACL,yBAAyB;AAChC,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,aAAa,EAAEC,cAAc,QAAQ,eAAe;AAE7D,OAAO,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EAAA,IAAAC,qBAAA;EAC5C,MAAMC,SAAS,GAAGP,cAAc,CAAC,CAAC,CAAC;EACnC;EACA,MAAMQ,mBAAmB,GAAGL,aAAa,aAAbA,aAAa,gBAAAG,qBAAA,GAAbH,aAAa,CAAEM,eAAe,cAAAH,qBAAA,uBAA9BA,qBAAA,CAAgCI,YAAY;EAExE,MAAMC,cAAc,GAAGZ,eAAe,CAAC,MACrCE,UAAU,CAACM,SAAS,CAACK,KAAK,EAAER,cAAc,CAACS,MAAM,CACnD,CAAC;;EAED;EACA,MAAMC,aAAa,GAAGhB,gBAAgB,CAAC,MAAM;IAC3C,MAAMiB,KAAK,GAAGlB,WAAW,CACvBc,cAAc,CAACC,KAAK,EACpB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAEJ,mBAAmB,CAAC,EACxBZ,WAAW,CAACoB,KACd,CAAC;IAED,OAAO;MACLC,SAAS,EAAE,CAAC;QAAEF;MAAM,CAAC;IACvB,CAAC;EACH,CAAC,CAAC;EAEF,MAAMG,aAAa,GAAGhB,WAAW,CAAC,MAAM;IACtC;IACAK,SAAS,CAACK,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACL,SAAS,CAAC,CAAC;EACf,MAAMY,cAAc,GAAGjB,WAAW,CAAC,MAAM;IACvC;IACAK,SAAS,CAACK,KAAK,GAAG,CAAC;EACrB,CAAC,EAAE,CAACL,SAAS,CAAC,CAAC;EAEf,OAAO;IACLO,aAAa;IACbI,aAAa;IACbC;EACF,CAAC;AACH,CAAC"}
@@ -1,16 +0,0 @@
1
- import * as React from "react";
2
- import { BlockButtonsProps } from "./BlockButtons";
3
- type Props = BlockButtonsProps & {
4
- sticky?: boolean;
5
- onLayoutChange?: (height: number) => void;
6
- };
7
- /**
8
- * Implements a component that show buttons as sticky footer
9
- * It can include 1, 2 or 3 buttons. If they are 2, they can have the inlineHalf or the inlineOneThird style
10
- * @deprecated This component is deprecated. Use `FooterActions` or `FooterActionsInline` instead.
11
- * `FooterActionsInline` is the official replacement for `FooterWithButtons`, but use it only
12
- * if explicitly required.
13
- */
14
- export declare const FooterWithButtons: ({ sticky, onLayoutChange, ...rest }: Props) => React.JSX.Element;
15
- export default FooterWithButtons;
16
- //# sourceMappingURL=FooterWithButtons.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FooterWithButtons.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/FooterWithButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAgB,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjE,KAAK,KAAK,GAAG,iBAAiB,GAAG;IAC/B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AAgCF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,wCAI3B,KAAK,sBAiCP,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"PressableListItemsBase.d.ts","sourceRoot":"","sources":["../../../../src/components/listitems/PressableListItemsBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,MAAM,MAAM,kBAAkB,GAAG,UAAU,CACzC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,EACpC,SAAS,GACT,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,CACtB,CACF,CAAC;AAEF,eAAO,MAAM,qBAAqB,+DAM/B,MAAM,iBAAiB,CAAC,kBAAkB,CAAC,sBA6B7C,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const useListItemSpringAnimation: () => {
2
- onPressIn: () => void;
3
- onPressOut: () => void;
4
- animatedScaleStyle: {
5
- transform: {
6
- scale: number;
7
- }[];
8
- };
9
- animatedBackgroundStyle: {
10
- backgroundColor: string;
11
- };
12
- };
13
- //# sourceMappingURL=useListItemSpringAnimation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useListItemSpringAnimation.d.ts","sourceRoot":"","sources":["../../../../../src/components/listitems/hooks/useListItemSpringAnimation.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,0BAA0B;;;;;;;;;;;CAqDtC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const useModuleSpringAnimation: () => {
2
- animatedStyle: {
3
- transform: {
4
- scale: number;
5
- }[];
6
- };
7
- handlePressIn: () => void;
8
- handlePressOut: () => void;
9
- };
10
- //# sourceMappingURL=useModuleSpringAnimation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useModuleSpringAnimation.d.ts","sourceRoot":"","sources":["../../../../../src/components/modules/hooks/useModuleSpringAnimation.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB;;;;;;;;CAqCpC,CAAC"}
@@ -1,90 +0,0 @@
1
- import * as React from "react";
2
-
3
- import { useMemo } from "react";
4
- import { StyleSheet, View } from "react-native";
5
- import { useSafeAreaInsets } from "react-native-safe-area-context";
6
- import { IOColors, IOSpacingScale, IOVisualCostants } from "../../core";
7
- import { BlockButtons, BlockButtonsProps } from "./BlockButtons";
8
-
9
- type Props = BlockButtonsProps & {
10
- sticky?: boolean;
11
- onLayoutChange?: (height: number) => void;
12
- };
13
-
14
- // TODO: Refactor with an unique component like `FooterTopShadow` after bonus vacanze
15
- const styles = StyleSheet.create({
16
- container: {
17
- overflow: "hidden",
18
- width: "100%",
19
- // This Magic number is an heritage of the app code-base, this component should be removed in favor of `GradientBottomAction`
20
- marginTop: -50,
21
- paddingTop: 50
22
- },
23
- sticky: {
24
- position: "absolute",
25
- bottom: 0
26
- },
27
- footerShadow: {
28
- backgroundColor: IOColors.white,
29
- paddingHorizontal: IOVisualCostants.appMarginDefault,
30
- // iOS shadow
31
- shadowColor: IOColors.black,
32
- shadowOffset: {
33
- width: 0,
34
- height: 50
35
- },
36
- shadowOpacity: 0.5,
37
- shadowRadius: 37,
38
- elevation: 20 // Prop supported on Android only
39
- }
40
- });
41
-
42
- const verticalSpacing: IOSpacingScale = 16;
43
-
44
- /**
45
- * Implements a component that show buttons as sticky footer
46
- * It can include 1, 2 or 3 buttons. If they are 2, they can have the inlineHalf or the inlineOneThird style
47
- * @deprecated This component is deprecated. Use `FooterActions` or `FooterActionsInline` instead.
48
- * `FooterActionsInline` is the official replacement for `FooterWithButtons`, but use it only
49
- * if explicitly required.
50
- */
51
- export const FooterWithButtons = ({
52
- sticky = false,
53
- onLayoutChange,
54
- ...rest
55
- }: Props) => {
56
- const insets = useSafeAreaInsets();
57
-
58
- const onLayout = (event: any) => {
59
- onLayoutChange?.(event.nativeEvent.layout.height);
60
- };
61
-
62
- /* Check if the iPhone bottom handle is present.
63
- If not add a default margin to prevent the
64
- button from sticking to the bottom. */
65
- const bottomMargin: number = useMemo(
66
- () => (insets.bottom === 0 ? verticalSpacing : insets.bottom),
67
- [insets]
68
- );
69
-
70
- return (
71
- <View
72
- style={{ ...styles.container, ...(sticky ? styles.sticky : {}) }}
73
- accessible={rest.accessible}
74
- pointerEvents={"box-none"}
75
- testID="FooterWithButtons"
76
- >
77
- <View
78
- onLayout={onLayout}
79
- style={[
80
- styles.footerShadow,
81
- { paddingBottom: bottomMargin, paddingTop: verticalSpacing }
82
- ]}
83
- >
84
- <BlockButtons {...rest} />
85
- </View>
86
- </View>
87
- );
88
- };
89
-
90
- export default FooterWithButtons;
@@ -1,72 +0,0 @@
1
- import * as React from "react";
2
- import Animated, {
3
- Extrapolate,
4
- interpolate,
5
- interpolateColor,
6
- useAnimatedStyle,
7
- useDerivedValue,
8
- useSharedValue,
9
- withSpring
10
- } from "react-native-reanimated";
11
- import {
12
- IOColors,
13
- IOScaleValues,
14
- IOSpringValues,
15
- hexToRgba,
16
- useIOTheme
17
- } from "../../../core";
18
-
19
- export const useListItemSpringAnimation = () => {
20
- const theme = useIOTheme();
21
-
22
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
23
-
24
- const mapBackgroundStates: Record<string, string> = {
25
- default: hexToRgba(IOColors[theme["listItem-pressed"]], 0),
26
- pressed: IOColors[theme["listItem-pressed"]]
27
- };
28
-
29
- // Scaling transformation applied when the button is pressed
30
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
31
-
32
- const progressPressed = useDerivedValue(() =>
33
- withSpring(isPressed.value, IOSpringValues.button)
34
- );
35
-
36
- // Interpolate animation values from `isPressed` values
37
- const animatedScaleStyle = useAnimatedStyle(() => {
38
- const scale = interpolate(
39
- progressPressed.value,
40
- [0, 1],
41
- [1, animationScaleValue],
42
- Extrapolate.CLAMP
43
- );
44
-
45
- return {
46
- transform: [{ scale }]
47
- };
48
- });
49
-
50
- const animatedBackgroundStyle = useAnimatedStyle(() => {
51
- const backgroundColor = interpolateColor(
52
- progressPressed.value,
53
- [0, 1],
54
- [mapBackgroundStates.default, mapBackgroundStates.pressed]
55
- );
56
-
57
- return {
58
- backgroundColor
59
- };
60
- });
61
-
62
- const onPressIn = React.useCallback(() => {
63
- // eslint-disable-next-line functional/immutable-data
64
- isPressed.value = 1;
65
- }, [isPressed]);
66
- const onPressOut = React.useCallback(() => {
67
- // eslint-disable-next-line functional/immutable-data
68
- isPressed.value = 0;
69
- }, [isPressed]);
70
-
71
- return { onPressIn, onPressOut, animatedScaleStyle, animatedBackgroundStyle };
72
- };
@@ -1,49 +0,0 @@
1
- import {
2
- Extrapolate,
3
- interpolate,
4
- useAnimatedStyle,
5
- useDerivedValue,
6
- useSharedValue,
7
- withSpring
8
- } from "react-native-reanimated";
9
- import { useCallback } from "react";
10
- import { IOScaleValues, IOSpringValues } from "../../../core";
11
-
12
- export const useModuleSpringAnimation = () => {
13
- const isPressed = useSharedValue(0);
14
- // Scaling transformation applied when the button is pressed
15
- const animationScaleValue = IOScaleValues?.magnifiedButton?.pressedState;
16
-
17
- const scaleTraversed = useDerivedValue(() =>
18
- withSpring(isPressed.value, IOSpringValues.button)
19
- );
20
-
21
- // Interpolate animation values from `isPressed` values
22
- const animatedStyle = useAnimatedStyle(() => {
23
- const scale = interpolate(
24
- scaleTraversed.value,
25
- [0, 1],
26
- [1, animationScaleValue],
27
- Extrapolate.CLAMP
28
- );
29
-
30
- return {
31
- transform: [{ scale }]
32
- };
33
- });
34
-
35
- const handlePressIn = useCallback(() => {
36
- // eslint-disable-next-line functional/immutable-data
37
- isPressed.value = 1;
38
- }, [isPressed]);
39
- const handlePressOut = useCallback(() => {
40
- // eslint-disable-next-line functional/immutable-data
41
- isPressed.value = 0;
42
- }, [isPressed]);
43
-
44
- return {
45
- animatedStyle,
46
- handlePressIn,
47
- handlePressOut
48
- };
49
- };