@pagopa/io-app-design-system 5.3.9 → 5.4.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 (253) hide show
  1. package/README.md +3 -2
  2. package/lib/commonjs/components/accordion/AccordionItem.js +4 -2
  3. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
  4. package/lib/commonjs/components/alert/Alert.js +5 -11
  5. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  6. package/lib/commonjs/components/alert/AlertEdgeToEdge.js +3 -2
  7. package/lib/commonjs/components/alert/AlertEdgeToEdge.js.map +1 -1
  8. package/lib/commonjs/components/alert/AlertEdgeToEdgeWrapper.js +3 -2
  9. package/lib/commonjs/components/alert/AlertEdgeToEdgeWrapper.js.map +1 -1
  10. package/lib/commonjs/components/buttons/ButtonLink.js +5 -2
  11. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  12. package/lib/commonjs/components/buttons/ButtonOutline.js +20 -15
  13. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  14. package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
  15. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  16. package/lib/commonjs/components/buttons/IOButton/IOButton.js +230 -0
  17. package/lib/commonjs/components/buttons/IOButton/IOButton.js.map +1 -0
  18. package/lib/commonjs/components/buttons/IOButton/__test__/IOButton.test.js +43 -0
  19. package/lib/commonjs/components/buttons/IOButton/__test__/IOButton.test.js.map +1 -0
  20. package/lib/commonjs/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
  21. package/lib/commonjs/components/buttons/IOButton/index.js +17 -0
  22. package/lib/commonjs/components/buttons/IOButton/index.js.map +1 -0
  23. package/lib/commonjs/components/buttons/IOButton/styles.js +166 -0
  24. package/lib/commonjs/components/buttons/IOButton/styles.js.map +1 -0
  25. package/lib/commonjs/components/buttons/IconButton.js +2 -3
  26. package/lib/commonjs/components/buttons/IconButton.js.map +1 -1
  27. package/lib/commonjs/components/buttons/IconButtonContained.js +1 -2
  28. package/lib/commonjs/components/buttons/IconButtonContained.js.map +1 -1
  29. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
  30. package/lib/commonjs/components/buttons/__test__/button.test.js +0 -24
  31. package/lib/commonjs/components/buttons/__test__/button.test.js.map +1 -1
  32. package/lib/commonjs/components/buttons/index.js +11 -0
  33. package/lib/commonjs/components/buttons/index.js.map +1 -1
  34. package/lib/commonjs/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
  35. package/lib/commonjs/components/icons/Icon.js +11 -9
  36. package/lib/commonjs/components/icons/Icon.js.map +1 -1
  37. package/lib/commonjs/components/layout/FooterActions.js +10 -9
  38. package/lib/commonjs/components/layout/FooterActions.js.map +1 -1
  39. package/lib/commonjs/components/layout/FooterActionsInline.js +8 -8
  40. package/lib/commonjs/components/layout/FooterActionsInline.js.map +1 -1
  41. package/lib/commonjs/components/layout/GradientBottomActions.js +8 -8
  42. package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
  43. package/lib/commonjs/components/layout/GradientScrollView.js.map +1 -1
  44. package/lib/commonjs/components/layout/ModalBSHeader.js +3 -1
  45. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
  46. package/lib/commonjs/components/listitems/ListItemAmount.js +3 -1
  47. package/lib/commonjs/components/listitems/ListItemAmount.js.map +1 -1
  48. package/lib/commonjs/components/listitems/ListItemCheckbox.js +3 -2
  49. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  50. package/lib/commonjs/components/listitems/ListItemHeader.js +4 -2
  51. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  52. package/lib/commonjs/components/listitems/ListItemInfo.js +3 -1
  53. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  54. package/lib/commonjs/components/listitems/ListItemInfoCopy.js +3 -1
  55. package/lib/commonjs/components/listitems/ListItemInfoCopy.js.map +1 -1
  56. package/lib/commonjs/components/listitems/ListItemNav.js +1 -1
  57. package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
  58. package/lib/commonjs/components/listitems/ListItemNavAlert.js +3 -1
  59. package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
  60. package/lib/commonjs/components/listitems/ListItemRadio.js +10 -2
  61. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  62. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
  63. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js +6 -6
  64. package/lib/commonjs/components/loadingSpinner/LoadingSpinner.js.map +1 -1
  65. package/lib/commonjs/components/numberpad/NumberButton.js +15 -2
  66. package/lib/commonjs/components/numberpad/NumberButton.js.map +1 -1
  67. package/lib/commonjs/components/numberpad/NumberPad.js +9 -6
  68. package/lib/commonjs/components/numberpad/NumberPad.js.map +1 -1
  69. package/lib/commonjs/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
  70. package/lib/commonjs/components/otpInput/OTPInput.js +3 -3
  71. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  72. package/lib/commonjs/components/radio/RadioButtonLabel.js +3 -3
  73. package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
  74. package/lib/commonjs/components/stepper/Stepper.js +5 -2
  75. package/lib/commonjs/components/stepper/Stepper.js.map +1 -1
  76. package/lib/commonjs/components/typography/IOText.js +4 -1
  77. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  78. package/lib/commonjs/core/IOStyles.js +3 -53
  79. package/lib/commonjs/core/IOStyles.js.map +1 -1
  80. package/lib/module/components/accordion/AccordionItem.js +5 -3
  81. package/lib/module/components/accordion/AccordionItem.js.map +1 -1
  82. package/lib/module/components/alert/Alert.js +6 -12
  83. package/lib/module/components/alert/Alert.js.map +1 -1
  84. package/lib/module/components/alert/AlertEdgeToEdge.js +3 -2
  85. package/lib/module/components/alert/AlertEdgeToEdge.js.map +1 -1
  86. package/lib/module/components/alert/AlertEdgeToEdgeWrapper.js +3 -2
  87. package/lib/module/components/alert/AlertEdgeToEdgeWrapper.js.map +1 -1
  88. package/lib/module/components/buttons/ButtonLink.js +6 -3
  89. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  90. package/lib/module/components/buttons/ButtonOutline.js +21 -16
  91. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  92. package/lib/module/components/buttons/ButtonSolid.js +4 -1
  93. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  94. package/lib/module/components/buttons/IOButton/IOButton.js +223 -0
  95. package/lib/module/components/buttons/IOButton/IOButton.js.map +1 -0
  96. package/lib/module/components/buttons/IOButton/__test__/IOButton.test.js +40 -0
  97. package/lib/module/components/buttons/IOButton/__test__/IOButton.test.js.map +1 -0
  98. package/lib/module/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
  99. package/lib/module/components/buttons/IOButton/index.js +4 -0
  100. package/lib/module/components/buttons/IOButton/index.js.map +1 -0
  101. package/lib/module/components/buttons/IOButton/styles.js +160 -0
  102. package/lib/module/components/buttons/IOButton/styles.js.map +1 -0
  103. package/lib/module/components/buttons/IconButton.js +4 -5
  104. package/lib/module/components/buttons/IconButton.js.map +1 -1
  105. package/lib/module/components/buttons/IconButtonContained.js +2 -3
  106. package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
  107. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
  108. package/lib/module/components/buttons/__test__/button.test.js +0 -24
  109. package/lib/module/components/buttons/__test__/button.test.js.map +1 -1
  110. package/lib/module/components/buttons/index.js +1 -0
  111. package/lib/module/components/buttons/index.js.map +1 -1
  112. package/lib/module/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
  113. package/lib/module/components/icons/Icon.js +10 -7
  114. package/lib/module/components/icons/Icon.js.map +1 -1
  115. package/lib/module/components/layout/FooterActions.js +11 -10
  116. package/lib/module/components/layout/FooterActions.js.map +1 -1
  117. package/lib/module/components/layout/FooterActionsInline.js +9 -9
  118. package/lib/module/components/layout/FooterActionsInline.js.map +1 -1
  119. package/lib/module/components/layout/GradientBottomActions.js +9 -9
  120. package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
  121. package/lib/module/components/layout/GradientScrollView.js.map +1 -1
  122. package/lib/module/components/layout/ModalBSHeader.js +4 -2
  123. package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
  124. package/lib/module/components/listitems/ListItemAmount.js +4 -2
  125. package/lib/module/components/listitems/ListItemAmount.js.map +1 -1
  126. package/lib/module/components/listitems/ListItemCheckbox.js +4 -3
  127. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  128. package/lib/module/components/listitems/ListItemHeader.js +5 -3
  129. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  130. package/lib/module/components/listitems/ListItemInfo.js +4 -2
  131. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  132. package/lib/module/components/listitems/ListItemInfoCopy.js +4 -2
  133. package/lib/module/components/listitems/ListItemInfoCopy.js.map +1 -1
  134. package/lib/module/components/listitems/ListItemNav.js +2 -2
  135. package/lib/module/components/listitems/ListItemNav.js.map +1 -1
  136. package/lib/module/components/listitems/ListItemNavAlert.js +4 -2
  137. package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
  138. package/lib/module/components/listitems/ListItemRadio.js +11 -3
  139. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  140. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
  141. package/lib/module/components/loadingSpinner/LoadingSpinner.js +6 -6
  142. package/lib/module/components/loadingSpinner/LoadingSpinner.js.map +1 -1
  143. package/lib/module/components/numberpad/NumberButton.js +16 -3
  144. package/lib/module/components/numberpad/NumberButton.js.map +1 -1
  145. package/lib/module/components/numberpad/NumberPad.js +10 -7
  146. package/lib/module/components/numberpad/NumberPad.js.map +1 -1
  147. package/lib/module/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
  148. package/lib/module/components/otpInput/OTPInput.js +3 -3
  149. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  150. package/lib/module/components/radio/RadioButtonLabel.js +3 -3
  151. package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
  152. package/lib/module/components/stepper/Stepper.js +6 -3
  153. package/lib/module/components/stepper/Stepper.js.map +1 -1
  154. package/lib/module/components/typography/IOText.js +2 -0
  155. package/lib/module/components/typography/IOText.js.map +1 -1
  156. package/lib/module/core/IOStyles.js +3 -53
  157. package/lib/module/core/IOStyles.js.map +1 -1
  158. package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -1
  159. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  160. package/lib/typescript/components/alert/AlertEdgeToEdge.d.ts.map +1 -1
  161. package/lib/typescript/components/alert/AlertEdgeToEdgeWrapper.d.ts.map +1 -1
  162. package/lib/typescript/components/buttons/ButtonLink.d.ts +3 -0
  163. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  164. package/lib/typescript/components/buttons/ButtonOutline.d.ts +3 -0
  165. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  166. package/lib/typescript/components/buttons/ButtonSolid.d.ts +3 -0
  167. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  168. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts +57 -0
  169. package/lib/typescript/components/buttons/IOButton/IOButton.d.ts.map +1 -0
  170. package/lib/typescript/components/buttons/IOButton/__test__/IOButton.test.d.ts +2 -0
  171. package/lib/typescript/components/buttons/IOButton/__test__/IOButton.test.d.ts.map +1 -0
  172. package/lib/typescript/components/buttons/IOButton/index.d.ts +2 -0
  173. package/lib/typescript/components/buttons/IOButton/index.d.ts.map +1 -0
  174. package/lib/typescript/components/buttons/IOButton/styles.d.ts +35 -0
  175. package/lib/typescript/components/buttons/IOButton/styles.d.ts.map +1 -0
  176. package/lib/typescript/components/buttons/IconButton.d.ts.map +1 -1
  177. package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
  178. package/lib/typescript/components/buttons/index.d.ts +1 -0
  179. package/lib/typescript/components/buttons/index.d.ts.map +1 -1
  180. package/lib/typescript/components/icons/Icon.d.ts +1 -4
  181. package/lib/typescript/components/icons/Icon.d.ts.map +1 -1
  182. package/lib/typescript/components/icons/types.d.ts +3 -2
  183. package/lib/typescript/components/icons/types.d.ts.map +1 -1
  184. package/lib/typescript/components/layout/FooterActions.d.ts +10 -8
  185. package/lib/typescript/components/layout/FooterActions.d.ts.map +1 -1
  186. package/lib/typescript/components/layout/FooterActionsInline.d.ts +5 -4
  187. package/lib/typescript/components/layout/FooterActionsInline.d.ts.map +1 -1
  188. package/lib/typescript/components/layout/GradientBottomActions.d.ts +12 -6
  189. package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
  190. package/lib/typescript/components/layout/GradientScrollView.d.ts.map +1 -1
  191. package/lib/typescript/components/listitems/ListItemAmount.d.ts.map +1 -1
  192. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  193. package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
  194. package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
  195. package/lib/typescript/components/listitems/ListItemInfoCopy.d.ts.map +1 -1
  196. package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
  197. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  198. package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts +2 -2
  199. package/lib/typescript/components/loadingSpinner/LoadingSpinner.d.ts.map +1 -1
  200. package/lib/typescript/components/numberpad/NumberButton.d.ts +11 -0
  201. package/lib/typescript/components/numberpad/NumberButton.d.ts.map +1 -1
  202. package/lib/typescript/components/numberpad/NumberPad.d.ts.map +1 -1
  203. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  204. package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
  205. package/lib/typescript/components/stepper/Stepper.d.ts.map +1 -1
  206. package/lib/typescript/components/typography/IOText.d.ts +1 -0
  207. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  208. package/lib/typescript/core/IOStyles.d.ts +0 -47
  209. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  210. package/package.json +1 -1
  211. package/src/components/accordion/AccordionItem.tsx +7 -14
  212. package/src/components/alert/Alert.tsx +7 -21
  213. package/src/components/alert/AlertEdgeToEdge.tsx +1 -2
  214. package/src/components/alert/AlertEdgeToEdgeWrapper.tsx +1 -2
  215. package/src/components/buttons/ButtonLink.tsx +6 -6
  216. package/src/components/buttons/ButtonOutline.tsx +21 -21
  217. package/src/components/buttons/ButtonSolid.tsx +4 -1
  218. package/src/components/buttons/IOButton/IOButton.tsx +363 -0
  219. package/src/components/buttons/IOButton/__test__/IOButton.test.tsx +46 -0
  220. package/src/components/buttons/IOButton/__test__/__snapshots__/IOButton.test.tsx.snap +391 -0
  221. package/src/components/buttons/IOButton/index.tsx +1 -0
  222. package/src/components/buttons/IOButton/styles.tsx +228 -0
  223. package/src/components/buttons/IconButton.tsx +4 -9
  224. package/src/components/buttons/IconButtonContained.tsx +3 -6
  225. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +6 -402
  226. package/src/components/buttons/__test__/button.test.tsx +1 -33
  227. package/src/components/buttons/index.tsx +1 -0
  228. package/src/components/claimsSelector/__test__/__snapshots__/ClaimsSelector.test.tsx.snap +13 -30
  229. package/src/components/icons/Icon.tsx +12 -3
  230. package/src/components/icons/types.ts +3 -2
  231. package/src/components/layout/FooterActions.tsx +26 -14
  232. package/src/components/layout/FooterActionsInline.tsx +19 -12
  233. package/src/components/layout/GradientBottomActions.tsx +17 -18
  234. package/src/components/layout/GradientScrollView.tsx +2 -1
  235. package/src/components/layout/ModalBSHeader.tsx +2 -2
  236. package/src/components/listitems/ListItemAmount.tsx +1 -2
  237. package/src/components/listitems/ListItemCheckbox.tsx +8 -11
  238. package/src/components/listitems/ListItemHeader.tsx +2 -3
  239. package/src/components/listitems/ListItemInfo.tsx +1 -2
  240. package/src/components/listitems/ListItemInfoCopy.tsx +1 -2
  241. package/src/components/listitems/ListItemNav.tsx +1 -1
  242. package/src/components/listitems/ListItemNavAlert.tsx +1 -2
  243. package/src/components/listitems/ListItemRadio.tsx +7 -7
  244. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +10 -40
  245. package/src/components/loadingSpinner/LoadingSpinner.tsx +8 -8
  246. package/src/components/numberpad/NumberButton.tsx +18 -11
  247. package/src/components/numberpad/NumberPad.tsx +8 -10
  248. package/src/components/numberpad/__test__/__snapshots__/NumberPad.test.tsx.snap +42 -96
  249. package/src/components/otpInput/OTPInput.tsx +1 -2
  250. package/src/components/radio/RadioButtonLabel.tsx +7 -10
  251. package/src/components/stepper/Stepper.tsx +7 -12
  252. package/src/components/typography/IOText.tsx +3 -0
  253. package/src/core/IOStyles.ts +3 -55
@@ -0,0 +1,391 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`Test Buttons Components IOButton Snapshot · Link variant 1`] = `
4
+ <View
5
+ accessibilityLabel="accessibilityLabel"
6
+ accessibilityRole="button"
7
+ accessibilityState={
8
+ {
9
+ "busy": false,
10
+ "checked": undefined,
11
+ "disabled": false,
12
+ "expanded": undefined,
13
+ "selected": undefined,
14
+ }
15
+ }
16
+ accessibilityValue={
17
+ {
18
+ "max": undefined,
19
+ "min": undefined,
20
+ "now": undefined,
21
+ "text": undefined,
22
+ }
23
+ }
24
+ accessible={true}
25
+ collapsable={false}
26
+ focusable={true}
27
+ hitSlop={
28
+ {
29
+ "bottom": 14,
30
+ "left": 24,
31
+ "right": 24,
32
+ "top": 14,
33
+ }
34
+ }
35
+ onBlur={[Function]}
36
+ onClick={[Function]}
37
+ onFocus={[Function]}
38
+ onResponderGrant={[Function]}
39
+ onResponderMove={[Function]}
40
+ onResponderRelease={[Function]}
41
+ onResponderTerminate={[Function]}
42
+ onResponderTerminationRequest={[Function]}
43
+ onStartShouldSetResponder={[Function]}
44
+ style={
45
+ {
46
+ "alignSelf": "flex-start",
47
+ }
48
+ }
49
+ >
50
+ <View
51
+ style={
52
+ [
53
+ {
54
+ "alignItems": "center",
55
+ "borderCurve": "continuous",
56
+ "elevation": 0,
57
+ "flexDirection": "row",
58
+ "justifyContent": "center",
59
+ "overflow": "hidden",
60
+ "textAlignVertical": "center",
61
+ },
62
+ {
63
+ "paddingHorizontal": 0,
64
+ },
65
+ {
66
+ "backgroundColor": "transparent",
67
+ "borderColor": "#0B3EE3",
68
+ "borderRadius": 8,
69
+ "borderWidth": 0,
70
+ "height": undefined,
71
+ },
72
+ {},
73
+ {
74
+ "transform": [
75
+ {
76
+ "scale": undefined,
77
+ },
78
+ ],
79
+ },
80
+ {},
81
+ ]
82
+ }
83
+ >
84
+ <View
85
+ style={
86
+ [
87
+ {
88
+ "alignItems": "center",
89
+ "flexDirection": "row",
90
+ "justifyContent": "center",
91
+ },
92
+ {
93
+ "columnGap": 8,
94
+ },
95
+ false,
96
+ ]
97
+ }
98
+ >
99
+ <Text
100
+ accessibilityElementsHidden={true}
101
+ accessible={false}
102
+ allowFontScaling={true}
103
+ ellipsizeMode="tail"
104
+ importantForAccessibility="no-hide-descendants"
105
+ maxFontSizeMultiplier={1.5}
106
+ numberOfLines={1}
107
+ style={
108
+ [
109
+ {},
110
+ {
111
+ "color": "#0E0F13",
112
+ "fontFamily": "Titillio",
113
+ "fontSize": 16,
114
+ "fontStyle": "normal",
115
+ "fontWeight": "600",
116
+ "lineHeight": 20,
117
+ },
118
+ [
119
+ {
120
+ "textAlign": "auto",
121
+ },
122
+ {
123
+ "color": undefined,
124
+ },
125
+ ],
126
+ ]
127
+ }
128
+ >
129
+ label
130
+ </Text>
131
+ </View>
132
+ </View>
133
+ </View>
134
+ `;
135
+
136
+ exports[`Test Buttons Components IOButton Snapshot · Outline variant 1`] = `
137
+ <View
138
+ accessibilityLabel="accessibilityLabel"
139
+ accessibilityRole="button"
140
+ accessibilityState={
141
+ {
142
+ "busy": false,
143
+ "checked": undefined,
144
+ "disabled": false,
145
+ "expanded": undefined,
146
+ "selected": undefined,
147
+ }
148
+ }
149
+ accessibilityValue={
150
+ {
151
+ "max": undefined,
152
+ "min": undefined,
153
+ "now": undefined,
154
+ "text": undefined,
155
+ }
156
+ }
157
+ accessible={true}
158
+ collapsable={false}
159
+ focusable={true}
160
+ onBlur={[Function]}
161
+ onClick={[Function]}
162
+ onFocus={[Function]}
163
+ onResponderGrant={[Function]}
164
+ onResponderMove={[Function]}
165
+ onResponderRelease={[Function]}
166
+ onResponderTerminate={[Function]}
167
+ onResponderTerminationRequest={[Function]}
168
+ onStartShouldSetResponder={[Function]}
169
+ style={
170
+ {
171
+ "alignSelf": "auto",
172
+ "flexShrink": 1,
173
+ }
174
+ }
175
+ >
176
+ <View
177
+ style={
178
+ [
179
+ {
180
+ "alignItems": "center",
181
+ "borderCurve": "continuous",
182
+ "elevation": 0,
183
+ "flexDirection": "row",
184
+ "justifyContent": "center",
185
+ "overflow": "hidden",
186
+ "textAlignVertical": "center",
187
+ },
188
+ {
189
+ "paddingHorizontal": 24,
190
+ },
191
+ {
192
+ "backgroundColor": "rgba(9,50,182,0)",
193
+ "borderColor": "#0B3EE3",
194
+ "borderRadius": 8,
195
+ "borderWidth": 2,
196
+ "height": 48,
197
+ },
198
+ {},
199
+ {
200
+ "transform": [
201
+ {
202
+ "scale": undefined,
203
+ },
204
+ ],
205
+ },
206
+ {
207
+ "backgroundColor": undefined,
208
+ "borderColor": undefined,
209
+ },
210
+ ]
211
+ }
212
+ >
213
+ <View
214
+ style={
215
+ [
216
+ {
217
+ "alignItems": "center",
218
+ "flexDirection": "row",
219
+ "justifyContent": "center",
220
+ },
221
+ {
222
+ "columnGap": 8,
223
+ },
224
+ false,
225
+ ]
226
+ }
227
+ >
228
+ <Text
229
+ accessibilityElementsHidden={true}
230
+ accessible={false}
231
+ allowFontScaling={true}
232
+ ellipsizeMode="tail"
233
+ importantForAccessibility="no-hide-descendants"
234
+ maxFontSizeMultiplier={1.5}
235
+ numberOfLines={1}
236
+ style={
237
+ [
238
+ {},
239
+ {
240
+ "color": "#0E0F13",
241
+ "fontFamily": "Titillio",
242
+ "fontSize": 16,
243
+ "fontStyle": "normal",
244
+ "fontWeight": "600",
245
+ "lineHeight": undefined,
246
+ },
247
+ [
248
+ {
249
+ "textAlign": "auto",
250
+ },
251
+ {
252
+ "color": undefined,
253
+ },
254
+ ],
255
+ ]
256
+ }
257
+ >
258
+ label
259
+ </Text>
260
+ </View>
261
+ </View>
262
+ </View>
263
+ `;
264
+
265
+ exports[`Test Buttons Components IOButton Snapshot · Solid variant 1`] = `
266
+ <View
267
+ accessibilityLabel="accessibilityLabel"
268
+ accessibilityRole="button"
269
+ accessibilityState={
270
+ {
271
+ "busy": false,
272
+ "checked": undefined,
273
+ "disabled": false,
274
+ "expanded": undefined,
275
+ "selected": undefined,
276
+ }
277
+ }
278
+ accessibilityValue={
279
+ {
280
+ "max": undefined,
281
+ "min": undefined,
282
+ "now": undefined,
283
+ "text": undefined,
284
+ }
285
+ }
286
+ accessible={true}
287
+ collapsable={false}
288
+ focusable={true}
289
+ onBlur={[Function]}
290
+ onClick={[Function]}
291
+ onFocus={[Function]}
292
+ onResponderGrant={[Function]}
293
+ onResponderMove={[Function]}
294
+ onResponderRelease={[Function]}
295
+ onResponderTerminate={[Function]}
296
+ onResponderTerminationRequest={[Function]}
297
+ onStartShouldSetResponder={[Function]}
298
+ style={
299
+ {
300
+ "alignSelf": "auto",
301
+ "flexShrink": 1,
302
+ }
303
+ }
304
+ >
305
+ <View
306
+ style={
307
+ [
308
+ {
309
+ "alignItems": "center",
310
+ "borderCurve": "continuous",
311
+ "elevation": 0,
312
+ "flexDirection": "row",
313
+ "justifyContent": "center",
314
+ "overflow": "hidden",
315
+ "textAlignVertical": "center",
316
+ },
317
+ {
318
+ "paddingHorizontal": 24,
319
+ },
320
+ {
321
+ "backgroundColor": "#0B3EE3",
322
+ "borderColor": "#FFFFFF",
323
+ "borderRadius": 8,
324
+ "borderWidth": 0,
325
+ "height": 48,
326
+ },
327
+ {},
328
+ {
329
+ "transform": [
330
+ {
331
+ "scale": undefined,
332
+ },
333
+ ],
334
+ },
335
+ {
336
+ "backgroundColor": undefined,
337
+ },
338
+ ]
339
+ }
340
+ >
341
+ <View
342
+ style={
343
+ [
344
+ {
345
+ "alignItems": "center",
346
+ "flexDirection": "row",
347
+ "justifyContent": "center",
348
+ },
349
+ {
350
+ "columnGap": 8,
351
+ },
352
+ false,
353
+ ]
354
+ }
355
+ >
356
+ <Text
357
+ accessibilityElementsHidden={true}
358
+ accessible={false}
359
+ allowFontScaling={true}
360
+ ellipsizeMode="tail"
361
+ importantForAccessibility="no-hide-descendants"
362
+ maxFontSizeMultiplier={1.5}
363
+ numberOfLines={1}
364
+ style={
365
+ [
366
+ {},
367
+ {
368
+ "color": "#0E0F13",
369
+ "fontFamily": "Titillio",
370
+ "fontSize": 16,
371
+ "fontStyle": "normal",
372
+ "fontWeight": "600",
373
+ "lineHeight": undefined,
374
+ },
375
+ [
376
+ {
377
+ "textAlign": "auto",
378
+ },
379
+ {
380
+ "color": undefined,
381
+ },
382
+ ],
383
+ ]
384
+ }
385
+ >
386
+ label
387
+ </Text>
388
+ </View>
389
+ </View>
390
+ </View>
391
+ `;
@@ -0,0 +1 @@
1
+ export * from "./IOButton";
@@ -0,0 +1,228 @@
1
+ import {
2
+ interpolateColor,
3
+ SharedValue,
4
+ useAnimatedProps,
5
+ useAnimatedStyle
6
+ } from "react-native-reanimated";
7
+ import { IOColors, hexToRgba, useIOTheme } from "../../../core";
8
+ import { IOButtonColor, IOButtonProps, IOButtonVariant } from "./IOButton";
9
+
10
+ type ColorStates = {
11
+ background: {
12
+ default: string;
13
+ pressed: string;
14
+ disabled: string;
15
+ };
16
+ foreground: {
17
+ default: string;
18
+ pressed: string;
19
+ disabled: string;
20
+ };
21
+ };
22
+
23
+ export const useButtonColorMap = (variant: IOButtonVariant) => {
24
+ const theme = useIOTheme();
25
+
26
+ const mapColorStatesVariantSolid: Record<
27
+ NonNullable<IOButtonProps["color"]>,
28
+ ColorStates
29
+ > = {
30
+ // Primary
31
+ primary: {
32
+ background: {
33
+ default: IOColors[theme["interactiveElem-default"]],
34
+ pressed: IOColors[theme["interactiveElem-pressed"]],
35
+ disabled: IOColors[theme["interactiveElem-disabled"]]
36
+ },
37
+ foreground: {
38
+ default: IOColors[theme["buttonText-default"]],
39
+ pressed: IOColors[theme["buttonText-default"]],
40
+ disabled: IOColors[theme["buttonText-disabled"]]
41
+ }
42
+ },
43
+ // Danger
44
+ danger: {
45
+ background: {
46
+ default: IOColors["error-600"],
47
+ pressed: IOColors["error-500"],
48
+ disabled: IOColors[theme["interactiveElem-disabled"]]
49
+ },
50
+ foreground: {
51
+ default: IOColors[theme["buttonText-danger"]],
52
+ pressed: IOColors[theme["buttonText-danger"]],
53
+ disabled: IOColors[theme["buttonText-disabled"]]
54
+ }
55
+ },
56
+ // Contrast
57
+ contrast: {
58
+ background: {
59
+ default: IOColors.white,
60
+ pressed: IOColors["blueIO-50"],
61
+ disabled: IOColors["blueIO-50"]
62
+ },
63
+ foreground: {
64
+ default: IOColors["blueIO-500"],
65
+ pressed: IOColors["blueIO-500"],
66
+ disabled: IOColors["blueIO-500"]
67
+ }
68
+ }
69
+ };
70
+
71
+ const mapColorStatesVariantOutline: Record<
72
+ NonNullable<IOButtonProps["color"]>,
73
+ ColorStates
74
+ > = {
75
+ // Primary
76
+ primary: {
77
+ background: {
78
+ default: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0),
79
+ pressed: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0.1),
80
+ disabled: "transparent"
81
+ },
82
+ foreground: {
83
+ default: IOColors[theme["interactiveElem-default"]],
84
+ pressed: IOColors[theme["interactiveElem-pressed"]],
85
+ disabled: IOColors[theme["interactiveOutline-disabled"]]
86
+ }
87
+ },
88
+ // Danger
89
+ danger: {
90
+ background: {
91
+ default: hexToRgba(IOColors["error-600"], 0),
92
+ pressed: hexToRgba(IOColors["error-600"], 0.1),
93
+ disabled: "transparent"
94
+ },
95
+ foreground: {
96
+ default: IOColors[theme.errorText],
97
+ pressed: IOColors[theme.errorText],
98
+ disabled: IOColors[theme["buttonText-disabled"]]
99
+ }
100
+ },
101
+ // Contrast
102
+ contrast: {
103
+ background: {
104
+ default: hexToRgba(IOColors["blueIO-600"], 0),
105
+ pressed: hexToRgba(IOColors["blueIO-600"], 0.5),
106
+ disabled: "transparent"
107
+ },
108
+ foreground: {
109
+ default: IOColors.white,
110
+ pressed: IOColors.white,
111
+ disabled: IOColors["blueIO-200"]
112
+ }
113
+ }
114
+ };
115
+
116
+ const transparentLinkBackground: ColorStates["background"] = {
117
+ default: "transparent",
118
+ pressed: "transparent",
119
+ disabled: "transparent"
120
+ };
121
+
122
+ const mapColorStatesVariantLink: Record<
123
+ NonNullable<IOButtonProps["color"]>,
124
+ ColorStates
125
+ > = {
126
+ // Primary
127
+ primary: {
128
+ foreground: {
129
+ default: IOColors[theme["interactiveElem-default"]],
130
+ pressed: IOColors[theme["interactiveElem-pressed"]],
131
+ disabled: hexToRgba(IOColors[theme["interactiveElem-default"]], 0.85)
132
+ },
133
+ background: transparentLinkBackground
134
+ },
135
+ // Danger
136
+ danger: {
137
+ foreground: {
138
+ default: IOColors[theme.errorText],
139
+ pressed: IOColors[theme.errorText],
140
+ disabled: hexToRgba(IOColors[theme.errorText], 0.85)
141
+ },
142
+ background: transparentLinkBackground
143
+ },
144
+ // Contrast
145
+ contrast: {
146
+ foreground: {
147
+ default: IOColors.white,
148
+ pressed: hexToRgba(IOColors.white, 0.85),
149
+ disabled: hexToRgba(IOColors.white, 0.5)
150
+ },
151
+ background: transparentLinkBackground
152
+ }
153
+ };
154
+
155
+ const colorMap = {
156
+ solid: mapColorStatesVariantSolid,
157
+ outline: mapColorStatesVariantOutline,
158
+ link: mapColorStatesVariantLink
159
+ };
160
+
161
+ return colorMap[variant];
162
+ };
163
+
164
+ export const useButtonAnimatedStyles = (
165
+ variant: IOButtonVariant,
166
+ color: IOButtonColor,
167
+ progress: SharedValue<number>
168
+ ) => {
169
+ const mapColorStates = useButtonColorMap(variant);
170
+
171
+ // Interpolate animation values from `isPressed` values
172
+ const pressedAnimationStyle = useAnimatedStyle(() => {
173
+ // `link` variant doesn't need this animated style
174
+ if (variant === "link") {
175
+ return {};
176
+ }
177
+
178
+ const backgroundColor = interpolateColor(
179
+ progress.value,
180
+ [0, 1],
181
+ [
182
+ mapColorStates[color].background.default,
183
+ mapColorStates[color].background.pressed
184
+ ]
185
+ );
186
+
187
+ const borderColor = interpolateColor(
188
+ progress.value,
189
+ [0, 1],
190
+ [
191
+ mapColorStates[color].foreground.default,
192
+ mapColorStates[color].foreground.pressed
193
+ ]
194
+ );
195
+
196
+ return variant === "outline"
197
+ ? { backgroundColor, borderColor }
198
+ : { backgroundColor };
199
+ });
200
+
201
+ const pressedColorLabelAnimationStyle = useAnimatedStyle(() => ({
202
+ color: interpolateColor(
203
+ progress.value,
204
+ [0, 1],
205
+ [
206
+ mapColorStates[color].foreground.default,
207
+ mapColorStates[color].foreground.pressed
208
+ ]
209
+ )
210
+ }));
211
+
212
+ const iconColorAnimatedStyle = useAnimatedProps(() => ({
213
+ color: interpolateColor(
214
+ progress.value,
215
+ [0, 1],
216
+ [
217
+ mapColorStates[color]?.foreground?.default,
218
+ mapColorStates[color]?.foreground?.pressed
219
+ ]
220
+ )
221
+ }));
222
+
223
+ return {
224
+ buttonAnimatedStyle: pressedAnimationStyle,
225
+ labelAnimatedStyle: pressedColorLabelAnimationStyle,
226
+ iconColorAnimatedStyle
227
+ };
228
+ };
@@ -8,7 +8,6 @@ import Animated, {
8
8
  import {
9
9
  IOColors,
10
10
  IOIconButtonStyles,
11
- IOStyles,
12
11
  IOThemeLight,
13
12
  hexToRgba,
14
13
  useIOTheme
@@ -17,9 +16,9 @@ import { useScaleAnimation } from "../../hooks";
17
16
  import { WithTestID } from "../../utils/types";
18
17
  import {
19
18
  AnimatedIcon,
19
+ AnimatedIconWithColorTransition,
20
20
  IOIconSizeScale,
21
- IOIcons,
22
- IconClassComponent
21
+ IOIcons
23
22
  } from "../icons";
24
23
 
25
24
  export type IconButton = WithTestID<{
@@ -41,9 +40,6 @@ type ColorStates = {
41
40
  };
42
41
  };
43
42
 
44
- const AnimatedIconClassComponent =
45
- Animated.createAnimatedComponent(IconClassComponent);
46
-
47
43
  export const IconButton = ({
48
44
  color = "primary",
49
45
  persistentColorMode = false,
@@ -127,14 +123,13 @@ export const IconButton = ({
127
123
  >
128
124
  <Animated.View
129
125
  style={[
126
+ IOIconButtonStyles.button,
130
127
  IOIconButtonStyles.buttonSizeSmall,
131
- IOStyles.alignCenter,
132
- IOStyles.centerJustified,
133
128
  !disabled && !reducedMotion && scaleAnimatedStyle
134
129
  ]}
135
130
  >
136
131
  {!disabled ? (
137
- <AnimatedIconClassComponent
132
+ <AnimatedIconWithColorTransition
138
133
  allowFontScaling
139
134
  name={icon}
140
135
  size={iconSize}
@@ -8,8 +8,8 @@ import Animated, {
8
8
  } from "react-native-reanimated";
9
9
  import {
10
10
  AnimatedIcon,
11
- IOIcons,
12
- IconClassComponent
11
+ AnimatedIconWithColorTransition,
12
+ IOIcons
13
13
  } from "../../components/icons";
14
14
  import { IOColors, IOIconButtonStyles, hexToRgba } from "../../core";
15
15
  import { useScaleAnimation } from "../../hooks";
@@ -82,9 +82,6 @@ const mapColorStates: Record<
82
82
  }
83
83
  };
84
84
 
85
- const AnimatedIconClassComponent =
86
- Animated.createAnimatedComponent(IconClassComponent);
87
-
88
85
  export const IconButtonContained = ({
89
86
  icon,
90
87
  color = "primary",
@@ -141,7 +138,7 @@ export const IconButtonContained = ({
141
138
  ]}
142
139
  >
143
140
  {!disabled ? (
144
- <AnimatedIconClassComponent
141
+ <AnimatedIconWithColorTransition
145
142
  name={icon}
146
143
  animatedProps={iconColorAnimationStyle}
147
144
  color={mapColorStates[color]?.icon?.default}