@pagopa/io-app-design-system 1.25.0 → 1.26.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 (213) hide show
  1. package/lib/commonjs/components/accordion/AccordionItem.js +1 -0
  2. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
  3. package/lib/commonjs/components/alert/Alert.js +3 -2
  4. package/lib/commonjs/components/alert/Alert.js.map +1 -1
  5. package/lib/commonjs/components/avatar/Avatar.js +2 -1
  6. package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
  7. package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  8. package/lib/commonjs/components/badge/Badge.js +1 -0
  9. package/lib/commonjs/components/badge/Badge.js.map +1 -1
  10. package/lib/commonjs/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  11. package/lib/commonjs/components/banner/Banner.js +2 -2
  12. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  13. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  14. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js +3 -2
  15. package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
  16. package/lib/commonjs/components/buttons/ButtonLink.js +5 -1
  17. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  18. package/lib/commonjs/components/buttons/ButtonOutline.js +6 -3
  19. package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
  20. package/lib/commonjs/components/buttons/ButtonSolid.js +4 -1
  21. package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
  22. package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  23. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +4 -2
  24. package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
  25. package/lib/commonjs/components/divider/Divider.js +1 -1
  26. package/lib/commonjs/components/divider/Divider.js.map +1 -1
  27. package/lib/commonjs/components/layout/GradientBottomActions.js +25 -5
  28. package/lib/commonjs/components/layout/GradientBottomActions.js.map +1 -1
  29. package/lib/commonjs/components/layout/GradientScrollView.js +1 -1
  30. package/lib/commonjs/components/layout/HeaderFirstLevel.js +12 -1
  31. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  32. package/lib/commonjs/components/layout/HeaderSecondLevel.js +21 -6
  33. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  34. package/lib/commonjs/components/layout/ModalBSHeader.js +73 -0
  35. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -0
  36. package/lib/commonjs/components/layout/index.js +11 -0
  37. package/lib/commonjs/components/layout/index.js.map +1 -1
  38. package/lib/commonjs/components/listitems/ListItemAction.js +2 -1
  39. package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
  40. package/lib/commonjs/components/listitems/ListItemCheckbox.js +8 -0
  41. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  42. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  43. package/lib/commonjs/components/otpInput/BoxedInput.js +2 -1
  44. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  45. package/lib/commonjs/components/pictograms/Pictogram.js +15 -15
  46. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  47. package/lib/commonjs/components/switch/NativeSwitch.js +5 -0
  48. package/lib/commonjs/components/switch/NativeSwitch.js.map +1 -1
  49. package/lib/commonjs/components/tabs/TabItem.js +4 -3
  50. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  51. package/lib/commonjs/components/tag/Tag.js +6 -5
  52. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  53. package/lib/commonjs/components/textInput/TextInputBase.js +1 -0
  54. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  55. package/lib/commonjs/components/toast/ToastNotification.js +1 -0
  56. package/lib/commonjs/components/toast/ToastNotification.js.map +1 -1
  57. package/lib/commonjs/core/IOColors.js +1 -18
  58. package/lib/commonjs/core/IOColors.js.map +1 -1
  59. package/lib/commonjs/core/IOSpacing.js.map +1 -1
  60. package/lib/commonjs/core/IOStyles.js +2 -0
  61. package/lib/commonjs/core/IOStyles.js.map +1 -1
  62. package/lib/commonjs/core/IOThemeContextProvider.js +42 -0
  63. package/lib/commonjs/core/IOThemeContextProvider.js.map +1 -0
  64. package/lib/commonjs/core/index.js +11 -0
  65. package/lib/commonjs/core/index.js.map +1 -1
  66. package/lib/module/components/accordion/AccordionItem.js +1 -0
  67. package/lib/module/components/accordion/AccordionItem.js.map +1 -1
  68. package/lib/module/components/alert/Alert.js +3 -2
  69. package/lib/module/components/alert/Alert.js.map +1 -1
  70. package/lib/module/components/avatar/Avatar.js +2 -1
  71. package/lib/module/components/avatar/Avatar.js.map +1 -1
  72. package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  73. package/lib/module/components/badge/Badge.js +1 -0
  74. package/lib/module/components/badge/Badge.js.map +1 -1
  75. package/lib/module/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  76. package/lib/module/components/banner/Banner.js +2 -2
  77. package/lib/module/components/banner/Banner.js.map +1 -1
  78. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  79. package/lib/module/components/buttons/ButtonExtendedOutline.js +3 -2
  80. package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
  81. package/lib/module/components/buttons/ButtonLink.js +5 -1
  82. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  83. package/lib/module/components/buttons/ButtonOutline.js +6 -3
  84. package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
  85. package/lib/module/components/buttons/ButtonSolid.js +4 -1
  86. package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
  87. package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  88. package/lib/module/components/checkbox/AnimatedCheckbox.js +4 -2
  89. package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
  90. package/lib/module/components/divider/Divider.js +2 -2
  91. package/lib/module/components/divider/Divider.js.map +1 -1
  92. package/lib/module/components/layout/BlockButtons.js.map +1 -1
  93. package/lib/module/components/layout/GradientBottomActions.js +26 -6
  94. package/lib/module/components/layout/GradientBottomActions.js.map +1 -1
  95. package/lib/module/components/layout/GradientScrollView.js +1 -1
  96. package/lib/module/components/layout/HeaderFirstLevel.js +13 -2
  97. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  98. package/lib/module/components/layout/HeaderSecondLevel.js +22 -7
  99. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  100. package/lib/module/components/layout/ModalBSHeader.js +65 -0
  101. package/lib/module/components/layout/ModalBSHeader.js.map +1 -0
  102. package/lib/module/components/layout/index.js +1 -0
  103. package/lib/module/components/layout/index.js.map +1 -1
  104. package/lib/module/components/listitems/ListItemAction.js +2 -1
  105. package/lib/module/components/listitems/ListItemAction.js.map +1 -1
  106. package/lib/module/components/listitems/ListItemCheckbox.js +8 -0
  107. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  108. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  109. package/lib/module/components/otpInput/BoxedInput.js +3 -2
  110. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  111. package/lib/module/components/pictograms/Pictogram.js +1 -1
  112. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  113. package/lib/module/components/switch/NativeSwitch.js +5 -0
  114. package/lib/module/components/switch/NativeSwitch.js.map +1 -1
  115. package/lib/module/components/tabs/TabItem.js +4 -3
  116. package/lib/module/components/tabs/TabItem.js.map +1 -1
  117. package/lib/module/components/tag/Tag.js +6 -5
  118. package/lib/module/components/tag/Tag.js.map +1 -1
  119. package/lib/module/components/textInput/TextInputBase.js +1 -0
  120. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  121. package/lib/module/components/toast/ToastNotification.js +1 -0
  122. package/lib/module/components/toast/ToastNotification.js.map +1 -1
  123. package/lib/module/core/IOColors.js +0 -12
  124. package/lib/module/core/IOColors.js.map +1 -1
  125. package/lib/module/core/IOSpacing.js.map +1 -1
  126. package/lib/module/core/IOStyles.js +2 -0
  127. package/lib/module/core/IOStyles.js.map +1 -1
  128. package/lib/module/core/IOThemeContextProvider.js +30 -0
  129. package/lib/module/core/IOThemeContextProvider.js.map +1 -0
  130. package/lib/module/core/index.js +1 -0
  131. package/lib/module/core/index.js.map +1 -1
  132. package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
  133. package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
  134. package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
  135. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  136. package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
  137. package/lib/typescript/components/buttons/ButtonLink.d.ts +11 -2
  138. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  139. package/lib/typescript/components/buttons/ButtonOutline.d.ts +12 -2
  140. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
  141. package/lib/typescript/components/buttons/ButtonSolid.d.ts +28 -2
  142. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
  143. package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
  144. package/lib/typescript/components/layout/BlockButtons.d.ts +2 -2
  145. package/lib/typescript/components/layout/BlockButtons.d.ts.map +1 -1
  146. package/lib/typescript/components/layout/GradientBottomActions.d.ts.map +1 -1
  147. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  148. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  149. package/lib/typescript/components/layout/ModalBSHeader.d.ts +16 -0
  150. package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -0
  151. package/lib/typescript/components/layout/index.d.ts +1 -0
  152. package/lib/typescript/components/layout/index.d.ts.map +1 -1
  153. package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
  154. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts +1 -1
  155. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  156. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  157. package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -1
  158. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  159. package/lib/typescript/components/switch/NativeSwitch.d.ts +1 -1
  160. package/lib/typescript/components/switch/NativeSwitch.d.ts.map +1 -1
  161. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  162. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  163. package/lib/typescript/components/textInput/TextInputBase.d.ts +3 -3
  164. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  165. package/lib/typescript/components/toast/ToastNotification.d.ts.map +1 -1
  166. package/lib/typescript/core/IOColors.d.ts +0 -7
  167. package/lib/typescript/core/IOColors.d.ts.map +1 -1
  168. package/lib/typescript/core/IOSpacing.d.ts +1 -1
  169. package/lib/typescript/core/IOSpacing.d.ts.map +1 -1
  170. package/lib/typescript/core/IOStyles.d.ts +2 -0
  171. package/lib/typescript/core/IOStyles.d.ts.map +1 -1
  172. package/lib/typescript/core/IOThemeContextProvider.d.ts +21 -0
  173. package/lib/typescript/core/IOThemeContextProvider.d.ts.map +1 -0
  174. package/lib/typescript/core/index.d.ts +1 -0
  175. package/lib/typescript/core/index.d.ts.map +1 -1
  176. package/package.json +2 -1
  177. package/src/components/accordion/AccordionItem.tsx +1 -0
  178. package/src/components/alert/Alert.tsx +3 -2
  179. package/src/components/avatar/Avatar.tsx +2 -1
  180. package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +2 -0
  181. package/src/components/badge/Badge.tsx +1 -0
  182. package/src/components/badge/__test__/__snapshots__/badge.test.tsx.snap +2 -0
  183. package/src/components/banner/Banner.tsx +4 -4
  184. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +8 -0
  185. package/src/components/buttons/ButtonExtendedOutline.tsx +3 -2
  186. package/src/components/buttons/ButtonLink.tsx +25 -13
  187. package/src/components/buttons/ButtonOutline.tsx +172 -159
  188. package/src/components/buttons/ButtonSolid.tsx +26 -15
  189. package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +20 -2
  190. package/src/components/checkbox/AnimatedCheckbox.tsx +4 -2
  191. package/src/components/divider/Divider.tsx +2 -2
  192. package/src/components/layout/BlockButtons.tsx +2 -2
  193. package/src/components/layout/GradientBottomActions.tsx +22 -8
  194. package/src/components/layout/GradientScrollView.tsx +1 -1
  195. package/src/components/layout/HeaderFirstLevel.tsx +23 -8
  196. package/src/components/layout/HeaderSecondLevel.tsx +40 -15
  197. package/src/components/layout/ModalBSHeader.tsx +92 -0
  198. package/src/components/layout/index.tsx +1 -0
  199. package/src/components/listitems/ListItemAction.tsx +1 -0
  200. package/src/components/listitems/ListItemCheckbox.tsx +8 -0
  201. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +4 -0
  202. package/src/components/otpInput/BoxedInput.tsx +3 -2
  203. package/src/components/pictograms/Pictogram.tsx +1 -6
  204. package/src/components/switch/NativeSwitch.tsx +10 -1
  205. package/src/components/tabs/TabItem.tsx +4 -3
  206. package/src/components/tag/Tag.tsx +7 -6
  207. package/src/components/textInput/TextInputBase.tsx +4 -3
  208. package/src/components/toast/ToastNotification.tsx +1 -0
  209. package/src/core/IOColors.ts +1 -11
  210. package/src/core/IOSpacing.ts +2 -1
  211. package/src/core/IOStyles.ts +2 -0
  212. package/src/core/IOThemeContextProvider.tsx +50 -0
  213. package/src/core/index.ts +1 -0
@@ -1,5 +1,10 @@
1
1
  import React, { useCallback } from "react";
2
- import { GestureResponderEvent, Pressable, StyleSheet } from "react-native";
2
+ import {
3
+ GestureResponderEvent,
4
+ Pressable,
5
+ StyleSheet,
6
+ View
7
+ } from "react-native";
3
8
  import Animated, {
4
9
  Extrapolate,
5
10
  interpolate,
@@ -213,183 +218,191 @@ const IOButtonStylesLocal = StyleSheet.create({
213
218
  }
214
219
  });
215
220
 
216
- export const ButtonOutline = ({
217
- color = "primary",
218
- label,
219
- fullWidth = false,
220
- disabled = false,
221
- icon,
222
- iconPosition = "start",
223
- onPress,
224
- accessibilityLabel,
225
- accessibilityHint,
226
- testID
227
- }: ButtonOutline) => {
228
- const { isExperimental } = useIOExperimentalDesign();
229
- const isPressed: Animated.SharedValue<number> = useSharedValue(0);
230
-
231
- const colorMap = React.useMemo(
232
- () => (isExperimental ? mapColorStates : mapLegacyColorStates),
233
- [isExperimental]
234
- );
235
-
236
- const buttonStyles = React.useMemo(
237
- () => (isExperimental ? IOButtonStyles : IOButtonLegacyStyles),
238
- [isExperimental]
239
- );
240
-
241
- const buttonStylesLocal = React.useMemo(
242
- () => (isExperimental ? IOButtonStylesLocal : IOButtonLegacyStylesLocal),
243
- [isExperimental]
244
- );
245
- // Scaling transformation applied when the button is pressed
246
- const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
221
+ export const ButtonOutline = React.forwardRef<View, ButtonOutline>(
222
+ (
223
+ {
224
+ color = "primary",
225
+ label,
226
+ fullWidth = false,
227
+ disabled = false,
228
+ icon,
229
+ iconPosition = "start",
230
+ onPress,
231
+ accessibilityLabel,
232
+ accessibilityHint,
233
+ testID
234
+ },
235
+ ref
236
+ ) => {
237
+ const { isExperimental } = useIOExperimentalDesign();
238
+ const isPressed: Animated.SharedValue<number> = useSharedValue(0);
247
239
 
248
- // Using a spring-based animation for our interpolations
249
- const progressPressed = useDerivedValue(() =>
250
- withSpring(isPressed.value, IOSpringValues.button)
251
- );
240
+ const colorMap = React.useMemo(
241
+ () => (isExperimental ? mapColorStates : mapLegacyColorStates),
242
+ [isExperimental]
243
+ );
252
244
 
253
- // Interpolate animation values from `isPressed` values
254
- const pressedAnimationStyle = useAnimatedStyle(() => {
255
- // Link color states to the pressed states
256
- const backgroundColor = interpolateColor(
257
- progressPressed.value,
258
- [0, 1],
259
- [colorMap[color].background.default, colorMap[color].background.pressed]
245
+ const buttonStyles = React.useMemo(
246
+ () => (isExperimental ? IOButtonStyles : IOButtonLegacyStyles),
247
+ [isExperimental]
260
248
  );
261
249
 
262
- const borderColor = interpolateColor(
263
- progressPressed.value,
264
- [0, 1],
265
- [colorMap[color].border.default, colorMap[color].border.pressed]
250
+ const buttonStylesLocal = React.useMemo(
251
+ () => (isExperimental ? IOButtonStylesLocal : IOButtonLegacyStylesLocal),
252
+ [isExperimental]
266
253
  );
254
+ // Scaling transformation applied when the button is pressed
255
+ const animationScaleValue = IOScaleValues?.basicButton?.pressedState;
267
256
 
268
- // Scale down button slightly when pressed
269
- const scale = interpolate(
270
- progressPressed.value,
271
- [0, 1],
272
- [1, animationScaleValue],
273
- Extrapolate.CLAMP
257
+ // Using a spring-based animation for our interpolations
258
+ const progressPressed = useDerivedValue(() =>
259
+ withSpring(isPressed.value, IOSpringValues.button)
274
260
  );
275
261
 
276
- return {
277
- borderColor,
278
- backgroundColor,
279
- transform: [{ scale }]
280
- };
281
- });
262
+ // Interpolate animation values from `isPressed` values
263
+ const pressedAnimationStyle = useAnimatedStyle(() => {
264
+ // Link color states to the pressed states
265
+ const backgroundColor = interpolateColor(
266
+ progressPressed.value,
267
+ [0, 1],
268
+ [colorMap[color].background.default, colorMap[color].background.pressed]
269
+ );
282
270
 
283
- const pressedColorLabelAnimationStyle = useAnimatedStyle(() => {
284
- // Link color states to the pressed states
271
+ const borderColor = interpolateColor(
272
+ progressPressed.value,
273
+ [0, 1],
274
+ [colorMap[color].border.default, colorMap[color].border.pressed]
275
+ );
285
276
 
286
- const labelColor = interpolateColor(
287
- progressPressed.value,
288
- [0, 1],
289
- [colorMap[color].border.default, colorMap[color].border.pressed]
290
- );
277
+ // Scale down button slightly when pressed
278
+ const scale = interpolate(
279
+ progressPressed.value,
280
+ [0, 1],
281
+ [1, animationScaleValue],
282
+ Extrapolate.CLAMP
283
+ );
291
284
 
292
- return {
293
- color: labelColor
294
- };
295
- });
285
+ return {
286
+ borderColor,
287
+ backgroundColor,
288
+ transform: [{ scale }]
289
+ };
290
+ });
296
291
 
297
- // Animate the <Icon> color prop
298
- const pressedColorIconAnimationStyle = useAnimatedProps(() => {
299
- const iconColor = interpolateColor(
300
- progressPressed.value,
301
- [0, 1],
302
- [colorMap[color].label.default, colorMap[color].label.pressed]
303
- );
304
- return { color: iconColor };
305
- });
292
+ const pressedColorLabelAnimationStyle = useAnimatedStyle(() => {
293
+ // Link color states to the pressed states
306
294
 
307
- const AnimatedIconClassComponent =
308
- Animated.createAnimatedComponent(IconClassComponent);
295
+ const labelColor = interpolateColor(
296
+ progressPressed.value,
297
+ [0, 1],
298
+ [colorMap[color].border.default, colorMap[color].border.pressed]
299
+ );
309
300
 
310
- const onPressIn = useCallback(() => {
311
- // eslint-disable-next-line functional/immutable-data
312
- isPressed.value = 1;
313
- }, [isPressed]);
314
- const onPressOut = useCallback(() => {
315
- // eslint-disable-next-line functional/immutable-data
316
- isPressed.value = 0;
317
- }, [isPressed]);
301
+ return {
302
+ color: labelColor
303
+ };
304
+ });
318
305
 
319
- return (
320
- <Pressable
321
- accessibilityLabel={accessibilityLabel}
322
- accessibilityHint={accessibilityHint}
323
- accessibilityRole={"button"}
324
- testID={testID}
325
- onPress={onPress}
326
- onPressIn={onPressIn}
327
- onPressOut={onPressOut}
328
- accessible={true}
329
- disabled={disabled}
330
- style={!fullWidth ? IOButtonStyles.dimensionsDefault : {}}
331
- >
332
- <Animated.View
333
- style={[
334
- buttonStyles.button,
335
- isExperimental && fullWidth && { paddingHorizontal: 16 },
336
- buttonStylesLocal.buttonWithBorder,
337
- buttonStyles.buttonSizeDefault,
338
- iconPosition === "end" && { flexDirection: "row-reverse" },
339
- disabled
340
- ? {
341
- backgroundColor: colorMap[color]?.background?.disabled,
342
- borderColor: colorMap[color]?.border?.disabled,
343
- opacity: DISABLED_OPACITY
344
- }
345
- : {
346
- backgroundColor: colorMap[color]?.background?.default,
347
- borderColor: colorMap[color]?.border.default
348
- },
349
- /* Prevent Reanimated from overriding background colors
350
- if button is disabled */
351
- !disabled && pressedAnimationStyle
352
- ]}
306
+ // Animate the <Icon> color prop
307
+ const pressedColorIconAnimationStyle = useAnimatedProps(() => {
308
+ const iconColor = interpolateColor(
309
+ progressPressed.value,
310
+ [0, 1],
311
+ [colorMap[color].label.default, colorMap[color].label.pressed]
312
+ );
313
+ return { color: iconColor };
314
+ });
315
+
316
+ const AnimatedIconClassComponent =
317
+ Animated.createAnimatedComponent(IconClassComponent);
318
+
319
+ const onPressIn = useCallback(() => {
320
+ // eslint-disable-next-line functional/immutable-data
321
+ isPressed.value = 1;
322
+ }, [isPressed]);
323
+ const onPressOut = useCallback(() => {
324
+ // eslint-disable-next-line functional/immutable-data
325
+ isPressed.value = 0;
326
+ }, [isPressed]);
327
+
328
+ return (
329
+ <Pressable
330
+ ref={ref}
331
+ accessibilityLabel={accessibilityLabel}
332
+ accessibilityHint={accessibilityHint}
333
+ accessibilityRole={"button"}
334
+ testID={testID}
335
+ onPress={onPress}
336
+ onPressIn={onPressIn}
337
+ onPressOut={onPressOut}
338
+ accessible={true}
339
+ disabled={disabled}
340
+ style={!fullWidth ? IOButtonStyles.dimensionsDefault : {}}
353
341
  >
354
- {icon && (
355
- <>
356
- {!disabled ? (
357
- <AnimatedIconClassComponent
358
- name={icon}
359
- animatedProps={pressedColorIconAnimationStyle}
360
- color={colorMap[color]?.label?.default}
361
- size={iconSize}
362
- />
363
- ) : (
364
- <AnimatedIcon
365
- name={icon}
366
- color={colorMap[color]?.label?.disabled}
367
- size={iconSize}
368
- />
369
- )}
370
- <HSpacer size={8} />
371
- </>
372
- )}
373
- <Animated.Text
342
+ <Animated.View
374
343
  style={[
375
- buttonStylesLocal.label,
376
- buttonStyles.label,
344
+ buttonStyles.button,
345
+ isExperimental && fullWidth && { paddingHorizontal: 16 },
346
+ buttonStylesLocal.buttonWithBorder,
347
+ buttonStyles.buttonSizeDefault,
348
+ iconPosition === "end" && { flexDirection: "row-reverse" },
377
349
  disabled
378
- ? { color: colorMap[color]?.label?.disabled }
379
- : { color: colorMap[color]?.label?.default },
380
- !disabled && pressedColorLabelAnimationStyle
350
+ ? {
351
+ backgroundColor: colorMap[color]?.background?.disabled,
352
+ borderColor: colorMap[color]?.border?.disabled,
353
+ opacity: DISABLED_OPACITY
354
+ }
355
+ : {
356
+ backgroundColor: colorMap[color]?.background?.default,
357
+ borderColor: colorMap[color]?.border.default
358
+ },
359
+ /* Prevent Reanimated from overriding background colors
360
+ if button is disabled */
361
+ !disabled && pressedAnimationStyle
381
362
  ]}
382
- numberOfLines={1}
383
- ellipsizeMode="tail"
384
- allowFontScaling={isExperimental}
385
- maxFontSizeMultiplier={1.3}
386
- importantForAccessibility="no-hide-descendants"
387
363
  >
388
- {label}
389
- </Animated.Text>
390
- </Animated.View>
391
- </Pressable>
392
- );
393
- };
364
+ {icon && (
365
+ <>
366
+ {!disabled ? (
367
+ <AnimatedIconClassComponent
368
+ name={icon}
369
+ animatedProps={pressedColorIconAnimationStyle}
370
+ color={colorMap[color]?.label?.default}
371
+ size={iconSize}
372
+ />
373
+ ) : (
374
+ <AnimatedIcon
375
+ name={icon}
376
+ color={colorMap[color]?.label?.disabled}
377
+ size={iconSize}
378
+ />
379
+ )}
380
+ <HSpacer size={8} />
381
+ </>
382
+ )}
383
+ <Animated.Text
384
+ style={[
385
+ buttonStylesLocal.label,
386
+ buttonStyles.label,
387
+ disabled
388
+ ? { color: colorMap[color]?.label?.disabled }
389
+ : { color: colorMap[color]?.label?.default },
390
+ !disabled && pressedColorLabelAnimationStyle
391
+ ]}
392
+ numberOfLines={1}
393
+ ellipsizeMode="tail"
394
+ allowFontScaling={isExperimental}
395
+ maxFontSizeMultiplier={1.3}
396
+ accessible={false}
397
+ accessibilityElementsHidden
398
+ importantForAccessibility="no-hide-descendants"
399
+ >
400
+ {label}
401
+ </Animated.Text>
402
+ </Animated.View>
403
+ </Pressable>
404
+ );
405
+ }
406
+ );
394
407
 
395
408
  export default ButtonOutline;
@@ -1,5 +1,10 @@
1
1
  import React, { useCallback, useEffect, useRef } from "react";
2
- import { GestureResponderEvent, Pressable, StyleSheet } from "react-native";
2
+ import {
3
+ GestureResponderEvent,
4
+ Pressable,
5
+ StyleSheet,
6
+ View
7
+ } from "react-native";
3
8
  import ReactNativeHapticFeedback from "react-native-haptic-feedback";
4
9
  import Animated, {
5
10
  Extrapolate,
@@ -155,20 +160,23 @@ const mapLegacyColorStates: Record<
155
160
  }
156
161
  };
157
162
 
158
- export const ButtonSolid = React.memo(
159
- ({
160
- color = "primary",
161
- label,
162
- fullWidth = false,
163
- disabled = false,
164
- loading = false,
165
- icon,
166
- iconPosition = "start",
167
- onPress,
168
- accessibilityLabel,
169
- accessibilityHint,
170
- testID
171
- }: ButtonSolidProps) => {
163
+ export const ButtonSolid = React.forwardRef<View, ButtonSolidProps>(
164
+ (
165
+ {
166
+ color = "primary",
167
+ label,
168
+ fullWidth = false,
169
+ disabled = false,
170
+ loading = false,
171
+ icon,
172
+ iconPosition = "start",
173
+ onPress,
174
+ accessibilityLabel,
175
+ accessibilityHint,
176
+ testID
177
+ },
178
+ ref
179
+ ) => {
172
180
  const isPressed = useSharedValue(0);
173
181
  const { isExperimental } = useIOExperimentalDesign();
174
182
  // Scaling transformation applied when the button is pressed
@@ -253,6 +261,7 @@ export const ButtonSolid = React.memo(
253
261
  return (
254
262
  <Pressable
255
263
  testID={testID}
264
+ ref={ref}
256
265
  accessible={true}
257
266
  accessibilityLabel={accessibilityLabel}
258
267
  accessibilityHint={accessibilityHint}
@@ -320,6 +329,8 @@ export const ButtonSolid = React.memo(
320
329
  ellipsizeMode="tail"
321
330
  allowFontScaling={isExperimental}
322
331
  maxFontSizeMultiplier={1.3}
332
+ accessible={false}
333
+ accessibilityElementsHidden
323
334
  importantForAccessibility="no-hide-descendants"
324
335
  >
325
336
  {label}
@@ -39,7 +39,8 @@ exports[`Test Buttons Components - Experimental Enabled ButtonExtendedOutline Sn
39
39
  {
40
40
  "alignItems": "center",
41
41
  "backgroundColor": "#FFFFFF",
42
- "borderColor": "#CCD4DC",
42
+ "borderColor": "#E8EBF1",
43
+ "borderCurve": "continuous",
43
44
  "borderRadius": 8,
44
45
  "borderStyle": "solid",
45
46
  "borderWidth": 1,
@@ -233,8 +234,11 @@ exports[`Test Buttons Components - Experimental Enabled ButtonLink Snapshot 1`]
233
234
  }
234
235
  >
235
236
  <Text
237
+ accessibilityElementsHidden={true}
238
+ accessible={false}
236
239
  allowFontScaling={true}
237
240
  ellipsizeMode="tail"
241
+ importantForAccessibility="no-hide-descendants"
238
242
  maxFontSizeMultiplier={1.3}
239
243
  numberOfLines={1}
240
244
  style={
@@ -304,6 +308,7 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
304
308
  [
305
309
  {
306
310
  "alignItems": "center",
311
+ "borderCurve": "continuous",
307
312
  "borderRadius": 8,
308
313
  "elevation": 0,
309
314
  "flexDirection": "row",
@@ -336,6 +341,8 @@ exports[`Test Buttons Components - Experimental Enabled ButtonOutline Snapshot 1
336
341
  }
337
342
  >
338
343
  <Text
344
+ accessibilityElementsHidden={true}
345
+ accessible={false}
339
346
  allowFontScaling={true}
340
347
  ellipsizeMode="tail"
341
348
  importantForAccessibility="no-hide-descendants"
@@ -411,6 +418,7 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
411
418
  [
412
419
  {
413
420
  "alignItems": "center",
421
+ "borderCurve": "continuous",
414
422
  "borderRadius": 8,
415
423
  "elevation": 0,
416
424
  "flexDirection": "row",
@@ -453,6 +461,8 @@ exports[`Test Buttons Components - Experimental Enabled ButtonSolid Snapshot 1`]
453
461
  }
454
462
  >
455
463
  <Text
464
+ accessibilityElementsHidden={true}
465
+ accessible={false}
456
466
  allowFontScaling={true}
457
467
  color="white"
458
468
  defaultColor="white"
@@ -902,7 +912,8 @@ exports[`Test Buttons Components ButtonExtendedOutline Snapshot 1`] = `
902
912
  {
903
913
  "alignItems": "center",
904
914
  "backgroundColor": "#FFFFFF",
905
- "borderColor": "#CCD4DC",
915
+ "borderColor": "#E8EBF1",
916
+ "borderCurve": "continuous",
906
917
  "borderRadius": 8,
907
918
  "borderStyle": "solid",
908
919
  "borderWidth": 1,
@@ -1096,8 +1107,11 @@ exports[`Test Buttons Components ButtonLink Snapshot 1`] = `
1096
1107
  }
1097
1108
  >
1098
1109
  <Text
1110
+ accessibilityElementsHidden={true}
1111
+ accessible={false}
1099
1112
  allowFontScaling={false}
1100
1113
  ellipsizeMode="tail"
1114
+ importantForAccessibility="no-hide-descendants"
1101
1115
  maxFontSizeMultiplier={1.3}
1102
1116
  numberOfLines={1}
1103
1117
  style={
@@ -1199,6 +1213,8 @@ exports[`Test Buttons Components ButtonOutline Snapshot 1`] = `
1199
1213
  }
1200
1214
  >
1201
1215
  <Text
1216
+ accessibilityElementsHidden={true}
1217
+ accessible={false}
1202
1218
  allowFontScaling={false}
1203
1219
  ellipsizeMode="tail"
1204
1220
  importantForAccessibility="no-hide-descendants"
@@ -1315,6 +1331,8 @@ exports[`Test Buttons Components ButtonSolid Snapshot 1`] = `
1315
1331
  }
1316
1332
  >
1317
1333
  <Text
1334
+ accessibilityElementsHidden={true}
1335
+ accessible={false}
1318
1336
  allowFontScaling={false}
1319
1337
  color="white"
1320
1338
  defaultColor="white"
@@ -37,7 +37,8 @@ const styles = StyleSheet.create({
37
37
  width: IOSelectionTickVisualParams.size,
38
38
  height: IOSelectionTickVisualParams.size,
39
39
  borderWidth: IOSelectionTickVisualParams.borderWidth,
40
- borderRadius: checkBoxRadius
40
+ borderRadius: checkBoxRadius,
41
+ borderCurve: "continuous"
41
42
  },
42
43
  checkBoxSquare: {
43
44
  position: "absolute",
@@ -45,7 +46,8 @@ const styles = StyleSheet.create({
45
46
  top: 0,
46
47
  width: IOSelectionTickVisualParams.size,
47
48
  height: IOSelectionTickVisualParams.size,
48
- borderRadius: checkBoxRadius
49
+ borderRadius: checkBoxRadius,
50
+ borderCurve: "continuous"
49
51
  }
50
52
  });
51
53
 
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
- import { IOColors, IOThemeContext } from "../../core";
3
+ import { IOColors, useIOTheme } from "../../core";
4
4
 
5
5
  type DividerOrientation = "vertical" | "horizontal";
6
6
 
@@ -15,7 +15,7 @@ Native `Divider` component
15
15
  @param {DividerOrientation} orientation
16
16
  */
17
17
  const BaseDivider = React.memo(({ orientation }: DividerProps) => {
18
- const theme = React.useContext(IOThemeContext);
18
+ const theme = useIOTheme();
19
19
  const baseStyle = {
20
20
  backgroundColor: IOColors[theme["divider-default"]],
21
21
  ...(orientation === "vertical"
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { View, StyleSheet } from "react-native";
3
3
  import { HSpacer } from "../spacer/Spacer";
4
- import { ButtonOutline, ButtonSolid, ButtonSolidProps } from "../buttons";
4
+ import { ButtonOutline, ButtonSolid } from "../buttons";
5
5
  import { IOStyles } from "../../core";
6
6
 
7
7
  const styles = StyleSheet.create({
@@ -23,7 +23,7 @@ type CommonProps = Readonly<{
23
23
 
24
24
  export type BlockButtonProps = {
25
25
  type: "Solid" | "Outline";
26
- buttonProps: Omit<ButtonSolidProps, "fullWidth">;
26
+ buttonProps: Omit<React.ComponentProps<typeof ButtonSolid>, "fullWidth">;
27
27
  };
28
28
 
29
29
  /**
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
- import { StyleProp, StyleSheet, View, ViewStyle } from "react-native";
2
+ import { Easing, StyleProp, StyleSheet, View, ViewStyle } from "react-native";
3
+ import { easeGradient } from "react-native-easing-gradient";
3
4
  import LinearGradient from "react-native-linear-gradient";
4
5
  import Animated from "react-native-reanimated";
5
6
  import { IOColors, IOSpacer, IOVisualCostants, hexToRgba } from "../../core";
@@ -33,6 +34,15 @@ type GradientBottomActionsDimensions = {
33
34
  // Background color should be app main background (both light and dark themes)
34
35
  const HEADER_BG_COLOR: IOColors = "white";
35
36
 
37
+ const { colors, locations } = easeGradient({
38
+ colorStops: {
39
+ 0: { color: hexToRgba(IOColors[HEADER_BG_COLOR], 0) },
40
+ 1: { color: IOColors[HEADER_BG_COLOR] }
41
+ },
42
+ easing: Easing.ease,
43
+ extraColorStopsPerTransition: 20
44
+ });
45
+
36
46
  const styles = StyleSheet.create({
37
47
  buttonContainer: {
38
48
  paddingHorizontal: IOVisualCostants.appMarginDefault,
@@ -84,14 +94,18 @@ export const GradientBottomActions = ({
84
94
  ]}
85
95
  pointerEvents="none"
86
96
  >
97
+ {/* 100% opacity bg color fills at least 45% of the area */}
87
98
  <LinearGradient
88
- style={{ height: dimensions.gradientAreaHeight }}
89
- // 100% opacity bg color fills at least 50% of the area
90
- locations={[0, 0.5]}
91
- colors={[
92
- hexToRgba(IOColors[HEADER_BG_COLOR], 0),
93
- IOColors[HEADER_BG_COLOR]
94
- ]}
99
+ style={{ height: dimensions.gradientAreaHeight * 0.55 }}
100
+ locations={locations}
101
+ colors={colors}
102
+ />
103
+ <View
104
+ style={{
105
+ bottom: 0,
106
+ height: dimensions.gradientAreaHeight * 0.45,
107
+ backgroundColor: IOColors[HEADER_BG_COLOR]
108
+ }}
95
109
  />
96
110
  </Animated.View>
97
111
 
@@ -28,7 +28,7 @@ export type GradientScrollView = WithTestID<{
28
28
  }>;
29
29
 
30
30
  // Extended gradient area above the actions
31
- export const gradientSafeArea: IOSpacingScale = 80;
31
+ export const gradientSafeArea: IOSpacingScale = 96;
32
32
  // End content margin before the actions
33
33
  const contentEndMargin: IOSpacingScale = 32;
34
34
  // Margin between primary action and secondary one