@pagopa/io-app-design-system 5.11.13-0 → 5.11.14

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 (94) hide show
  1. package/lib/commonjs/components/banner/BannerErrorState.js +3 -2
  2. package/lib/commonjs/components/banner/BannerErrorState.js.map +1 -1
  3. package/lib/commonjs/components/buttons/__test__/button.test.js +13 -9
  4. package/lib/commonjs/components/buttons/__test__/button.test.js.map +1 -1
  5. package/lib/commonjs/components/buttons/index.js +0 -33
  6. package/lib/commonjs/components/buttons/index.js.map +1 -1
  7. package/lib/commonjs/components/listitems/ListItemHeader.js +2 -1
  8. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  9. package/lib/commonjs/components/listitems/ListItemInfo.js +2 -1
  10. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  11. package/lib/commonjs/components/modules/ModuleCheckout.js +2 -1
  12. package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
  13. package/lib/commonjs/components/otpInput/BoxedInput.js +6 -2
  14. package/lib/commonjs/components/otpInput/BoxedInput.js.map +1 -1
  15. package/lib/commonjs/components/otpInput/OTPInput.js +3 -1
  16. package/lib/commonjs/components/otpInput/OTPInput.js.map +1 -1
  17. package/lib/commonjs/components/pictograms/Pictogram.js +2 -0
  18. package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
  19. package/lib/commonjs/components/pictograms/svg/PictogramPinSecurity.js +64 -0
  20. package/lib/commonjs/components/pictograms/svg/PictogramPinSecurity.js.map +1 -0
  21. package/lib/commonjs/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
  22. package/lib/commonjs/components/toast/ToastProvider.js +1 -5
  23. package/lib/commonjs/components/toast/ToastProvider.js.map +1 -1
  24. package/lib/module/components/banner/BannerErrorState.js +3 -2
  25. package/lib/module/components/banner/BannerErrorState.js.map +1 -1
  26. package/lib/module/components/buttons/__test__/button.test.js +13 -9
  27. package/lib/module/components/buttons/__test__/button.test.js.map +1 -1
  28. package/lib/module/components/buttons/index.js +0 -3
  29. package/lib/module/components/buttons/index.js.map +1 -1
  30. package/lib/module/components/listitems/ListItemHeader.js +3 -2
  31. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  32. package/lib/module/components/listitems/ListItemInfo.js +3 -2
  33. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  34. package/lib/module/components/modules/ModuleCheckout.js +3 -2
  35. package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
  36. package/lib/module/components/otpInput/BoxedInput.js +6 -2
  37. package/lib/module/components/otpInput/BoxedInput.js.map +1 -1
  38. package/lib/module/components/otpInput/OTPInput.js +3 -1
  39. package/lib/module/components/otpInput/OTPInput.js.map +1 -1
  40. package/lib/module/components/pictograms/Pictogram.js +2 -0
  41. package/lib/module/components/pictograms/Pictogram.js.map +1 -1
  42. package/lib/module/components/pictograms/svg/PictogramPinSecurity.js +59 -0
  43. package/lib/module/components/pictograms/svg/PictogramPinSecurity.js.map +1 -0
  44. package/lib/module/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
  45. package/lib/module/components/toast/ToastProvider.js +2 -6
  46. package/lib/module/components/toast/ToastProvider.js.map +1 -1
  47. package/lib/typescript/components/banner/BannerErrorState.d.ts.map +1 -1
  48. package/lib/typescript/components/buttons/index.d.ts +0 -3
  49. package/lib/typescript/components/buttons/index.d.ts.map +1 -1
  50. package/lib/typescript/components/listitems/ListItemHeader.d.ts +2 -2
  51. package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
  52. package/lib/typescript/components/listitems/ListItemInfo.d.ts +2 -2
  53. package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
  54. package/lib/typescript/components/otpInput/BoxedInput.d.ts.map +1 -1
  55. package/lib/typescript/components/otpInput/OTPInput.d.ts.map +1 -1
  56. package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -0
  57. package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
  58. package/lib/typescript/components/pictograms/svg/PictogramPinSecurity.d.ts +5 -0
  59. package/lib/typescript/components/pictograms/svg/PictogramPinSecurity.d.ts.map +1 -0
  60. package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -1
  61. package/package.json +1 -1
  62. package/src/components/banner/BannerErrorState.tsx +7 -2
  63. package/src/components/buttons/__test__/button.test.tsx +15 -13
  64. package/src/components/buttons/index.tsx +0 -3
  65. package/src/components/listitems/ListItemHeader.tsx +3 -3
  66. package/src/components/listitems/ListItemInfo.tsx +4 -3
  67. package/src/components/modules/ModuleCheckout.tsx +2 -2
  68. package/src/components/otpInput/BoxedInput.tsx +7 -2
  69. package/src/components/otpInput/OTPInput.tsx +7 -1
  70. package/src/components/pictograms/Pictogram.tsx +2 -0
  71. package/src/components/pictograms/svg/PictogramPinSecurity.tsx +44 -0
  72. package/src/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
  73. package/src/components/toast/ToastProvider.tsx +1 -13
  74. package/lib/commonjs/components/buttons/ButtonLink.js +0 -157
  75. package/lib/commonjs/components/buttons/ButtonLink.js.map +0 -1
  76. package/lib/commonjs/components/buttons/ButtonOutline.js +0 -173
  77. package/lib/commonjs/components/buttons/ButtonOutline.js.map +0 -1
  78. package/lib/commonjs/components/buttons/ButtonSolid.js +0 -194
  79. package/lib/commonjs/components/buttons/ButtonSolid.js.map +0 -1
  80. package/lib/module/components/buttons/ButtonLink.js +0 -152
  81. package/lib/module/components/buttons/ButtonLink.js.map +0 -1
  82. package/lib/module/components/buttons/ButtonOutline.js +0 -168
  83. package/lib/module/components/buttons/ButtonOutline.js.map +0 -1
  84. package/lib/module/components/buttons/ButtonSolid.js +0 -188
  85. package/lib/module/components/buttons/ButtonSolid.js.map +0 -1
  86. package/lib/typescript/components/buttons/ButtonLink.d.ts +0 -36
  87. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +0 -1
  88. package/lib/typescript/components/buttons/ButtonOutline.d.ts +0 -26
  89. package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +0 -1
  90. package/lib/typescript/components/buttons/ButtonSolid.d.ts +0 -52
  91. package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +0 -1
  92. package/src/components/buttons/ButtonLink.tsx +0 -222
  93. package/src/components/buttons/ButtonOutline.tsx +0 -261
  94. package/src/components/buttons/ButtonSolid.tsx +0 -285
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { Svg, Path, Circle, Rect } from "react-native-svg";
3
+ import { SVGPictogramProps } from "../types";
4
+
5
+ const PictogramPinSecurity = ({
6
+ size,
7
+ colorValues,
8
+ ...props
9
+ }: SVGPictogramProps) => (
10
+ <Svg width={size} height={size} viewBox="0 0 240 240" {...props}>
11
+ <Path
12
+ fill={colorValues.main}
13
+ d="M154 155a27 27 0 1 1 0 54H45a27 27 0 1 1 0-54h81v6l3 3 8-2 6-7z"
14
+ />
15
+ <Circle cx="44" cy="181" r="14" fill={colorValues.secondary} />
16
+ <Circle cx="81" cy="181" r="14" fill={colorValues.secondary} />
17
+ <Circle cx="118" cy="181" r="14" fill={colorValues.secondary} />
18
+ <Circle cx="155" cy="181" r="14" fill={colorValues.secondary} />
19
+ <Path
20
+ fill={colorValues.main}
21
+ d="M115 56a17 17 0 0 0-35 0v16H68V56a29 29 0 0 1 59 0v16h-12z"
22
+ />
23
+ <Path
24
+ fill={colorValues.main}
25
+ d="M120 68c20 0 37 17 37 38l-10 3-9 7-1 5 6 7-9 12q-6 3-14 3H77a37 37 0 1 1 0-75z"
26
+ />
27
+ <Rect
28
+ width="13"
29
+ height="29"
30
+ x="90"
31
+ y="90"
32
+ fill={colorValues.secondary}
33
+ rx="6.5"
34
+ />
35
+ <Path
36
+ fill={colorValues.hands}
37
+ fillRule="evenodd"
38
+ d="M206 74c-1 0-15 17-50 43-2 2-25 24-29 40q-1 4 1 4h4c7-5 17-15 21-35l4 1-4 15q-1 3 3 7l3 1c-1-8 6-16 6-16l3 2s-6 8-5 14q1 4 6 7 13 4 16-2 2-4-3-9l-7 3-1-4s45-13 61-44l4 2q-6 15-39 35l-14 7q5 6 3 12-1 3-6 5-6 2-16-2-5-2-7-7-4 1-7-1l-3-5a51 51 0 0 1-17 18q-4 2-7-1-5-2-3-8 6-15 17-28-4-1-6-6-1-3 2-7c7-9 37-17 38-17q29-26 28-27zm-40 30c-10 4-23 9-27 13l-1 4q1 3 5 3l10-10z"
39
+ clipRule="evenodd"
40
+ />
41
+ </Svg>
42
+ );
43
+
44
+ export default PictogramPinSecurity;
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 240 240"><g clip-path="url(#a)"><path fill="#aaeeef" d="M154 155a27 27 0 1 1 0 54H45a27 27 0 1 1 0-54h81v6l3 3 8-2 6-7z"/><circle cx="44" cy="181" r="14" fill="#00c5ca"/><circle cx="81" cy="181" r="14" fill="#00c5ca"/><circle cx="118" cy="181" r="14" fill="#00c5ca"/><circle cx="155" cy="181" r="14" fill="#00c5ca"/><path fill="#aaeeef" d="M115 56a17 17 0 0 0-35 0v16H68V56a29 29 0 0 1 59 0v16h-12z"/><path fill="#aaeeef" d="M120 68c20 0 37 17 37 38l-10 3-9 7-1 5 6 7-9 12q-6 3-14 3H77a37 37 0 1 1 0-75z"/><rect width="13" height="29" x="90" y="90" fill="#00c5ca" rx="6.5"/><path fill="#0b3ee3" fill-rule="evenodd" d="M206 74c-1 0-15 17-50 43-2 2-25 24-29 40q-1 4 1 4h4c7-5 17-15 21-35l4 1-4 15q-1 3 3 7l3 1c-1-8 6-16 6-16l3 2s-6 8-5 14q1 4 6 7 13 4 16-2 2-4-3-9l-7 3-1-4s45-13 61-44l4 2q-6 15-39 35l-14 7q5 6 3 12-1 3-6 5-6 2-16-2-5-2-7-7-4 1-7-1l-3-5a51 51 0 0 1-17 18q-4 2-7-1-5-2-3-8 6-15 17-28-4-1-6-6-1-3 2-7c7-9 37-17 38-17q29-26 28-27zm-40 30c-10 4-23 9-27 13l-1 4q1 3 5 3l10-10z" clip-rule="evenodd"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h240v240H0z"/></clipPath></defs></svg>
@@ -2,7 +2,6 @@ import { throttle } from "lodash";
2
2
  import React from "react";
3
3
  import {
4
4
  AccessibilityInfo,
5
- Platform,
6
5
  SafeAreaView,
7
6
  StyleSheet,
8
7
  View
@@ -13,7 +12,6 @@ import Animated, {
13
12
  SlideInUp,
14
13
  SlideOutUp
15
14
  } from "react-native-reanimated";
16
- import { useSafeAreaInsets } from "react-native-safe-area-context";
17
15
  import { IOVisualCostants } from "../../core";
18
16
  import { triggerHaptic } from "../../functions";
19
17
  import { Dismissable } from "../templates";
@@ -118,20 +116,10 @@ export const ToastProvider = ({ children }: ToastProviderProps) => {
118
116
  [addToast, removeToast, removeAllToasts]
119
117
  );
120
118
 
121
- const insets = useSafeAreaInsets();
122
-
123
119
  return (
124
120
  <ToastContext.Provider value={contextValue as ToastContext}>
125
121
  <InitializeToastRef />
126
- <SafeAreaView
127
- style={[
128
- styles.container,
129
- {
130
- paddingTop: Platform.OS === "android" ? insets.top : 0
131
- }
132
- ]}
133
- pointerEvents="box-none"
134
- >
122
+ <SafeAreaView style={styles.container} pointerEvents="box-none">
135
123
  <View
136
124
  style={{ padding: IOVisualCostants.appMarginDefault }}
137
125
  pointerEvents="box-none"
@@ -1,157 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ButtonLink = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
- var _context = require("../../context");
11
- var _core = require("../../core");
12
- var _hooks = require("../../hooks");
13
- var _icons = require("../icons");
14
- var _typography = require("../typography");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
- const DISABLED_OPACITY = 0.5;
18
- const ICON_MARGIN = 8;
19
-
20
- /**
21
- * @deprecated Use `Button` with variant `link` instead
22
- */
23
- const ButtonLink = exports.ButtonLink = /*#__PURE__*/(0, _react.forwardRef)(({
24
- color = "primary",
25
- label,
26
- disabled = false,
27
- icon,
28
- iconPosition = "start",
29
- onPress,
30
- accessibilityLabel,
31
- accessibilityRole = "button",
32
- accessibilityHint,
33
- numberOfLines = 1,
34
- textAlign = "auto",
35
- testID
36
- }, ref) => {
37
- const theme = (0, _context.useIOTheme)();
38
- const {
39
- newTypefaceEnabled
40
- } = (0, _context.useIONewTypeface)();
41
- const {
42
- progress,
43
- onPressIn,
44
- onPressOut,
45
- scaleAnimatedStyle
46
- } = (0, _hooks.useScaleAnimation)();
47
- const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
48
- const mapColorStates = {
49
- // Primary button
50
- primary: {
51
- foreground: {
52
- default: _core.IOColors[theme["interactiveElem-default"]],
53
- pressed: _core.IOColors[theme["interactiveElem-pressed"]],
54
- disabled: (0, _core.hexToRgba)(_core.IOColors[theme["interactiveElem-default"]], 0.85)
55
- }
56
- },
57
- contrast: {
58
- foreground: {
59
- default: _core.IOColors.white,
60
- pressed: (0, _core.hexToRgba)(_core.IOColors.white, 0.85),
61
- disabled: (0, _core.hexToRgba)(_core.IOColors.white, 0.5)
62
- }
63
- }
64
- };
65
- const AnimatedIOText = _reactNativeReanimated.default.createAnimatedComponent(_typography.IOText);
66
- const pressedColorLabelAnimationStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
67
- // Link color states to the pressed states
68
-
69
- const labelColor = (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed]);
70
- return {
71
- color: labelColor
72
- };
73
- });
74
-
75
- // Animate the <Icon> color prop
76
- const pressedColorIconAnimationStyle = (0, _reactNativeReanimated.useAnimatedProps)(() => {
77
- const iconColor = (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed]);
78
- return {
79
- color: iconColor
80
- };
81
- });
82
-
83
- // Icon size
84
- const iconSize = 24;
85
- const iconMargin = 8;
86
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
87
- ref: ref,
88
- accessibilityLabel: accessibilityLabel || label,
89
- accessibilityHint: accessibilityHint,
90
- accessibilityRole: accessibilityRole,
91
- accessibilityState: {
92
- disabled
93
- },
94
- testID: testID,
95
- onPress: onPress,
96
- onPressIn: onPressIn,
97
- onPressOut: onPressOut,
98
- onTouchEnd: onPressOut,
99
- accessible: true,
100
- disabled: disabled,
101
- hitSlop: {
102
- top: 14,
103
- right: 24,
104
- bottom: 14,
105
- left: 24
106
- },
107
- style: {
108
- alignSelf: "flex-start"
109
- },
110
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
111
- style: [_core.IOButtonStyles.buttonLink, iconPosition === "end" && {
112
- flexDirection: "row-reverse"
113
- }, {
114
- columnGap: iconMargin
115
- }, disabled ? {
116
- opacity: DISABLED_OPACITY
117
- } : {}, {
118
- columnGap: ICON_MARGIN
119
- },
120
- /* Prevent Reanimated from overriding background colors
121
- if button is disabled */
122
- !disabled && !reducedMotion && scaleAnimatedStyle],
123
- children: [icon && (!disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AnimatedIconWithColorTransition, {
124
- allowFontScaling: true,
125
- name: icon,
126
- animatedProps: pressedColorIconAnimationStyle,
127
- color: mapColorStates[color]?.foreground?.default,
128
- size: iconSize
129
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AnimatedIcon, {
130
- allowFontScaling: true,
131
- name: icon,
132
- color: mapColorStates[color]?.foreground?.disabled,
133
- size: iconSize
134
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedIOText, {
135
- accessible: false,
136
- accessibilityElementsHidden: true,
137
- importantForAccessibility: "no-hide-descendants",
138
- font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
139
- weight: "Semibold",
140
- size: _typography.buttonTextFontSize,
141
- lineHeight: _typography.buttonTextLineHeight,
142
- style: [disabled ? {
143
- color: mapColorStates[color]?.foreground?.disabled
144
- } : {
145
- ...pressedColorLabelAnimationStyle
146
- }, {
147
- textAlign
148
- }],
149
- numberOfLines: numberOfLines,
150
- ellipsizeMode: "tail",
151
- children: label
152
- })]
153
- })
154
- });
155
- });
156
- var _default = exports.default = ButtonLink;
157
- //# sourceMappingURL=ButtonLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_context","_core","_hooks","_icons","_typography","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DISABLED_OPACITY","ICON_MARGIN","ButtonLink","exports","forwardRef","color","label","disabled","icon","iconPosition","onPress","accessibilityLabel","accessibilityRole","accessibilityHint","numberOfLines","textAlign","testID","ref","theme","useIOTheme","newTypefaceEnabled","useIONewTypeface","progress","onPressIn","onPressOut","scaleAnimatedStyle","useScaleAnimation","reducedMotion","useReducedMotion","mapColorStates","primary","foreground","IOColors","pressed","hexToRgba","contrast","white","AnimatedIOText","Animated","createAnimatedComponent","IOText","pressedColorLabelAnimationStyle","useAnimatedStyle","labelColor","interpolateColor","value","pressedColorIconAnimationStyle","useAnimatedProps","iconColor","iconSize","iconMargin","jsx","Pressable","accessibilityState","onTouchEnd","accessible","hitSlop","top","right","bottom","left","style","alignSelf","children","jsxs","View","IOButtonStyles","buttonLink","flexDirection","columnGap","opacity","AnimatedIconWithColorTransition","allowFontScaling","name","animatedProps","size","AnimatedIcon","accessibilityElementsHidden","importantForAccessibility","font","weight","buttonTextFontSize","lineHeight","buttonTextLineHeight","ellipsizeMode","_default"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonLink.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAOA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAMA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAMA,IAAAK,MAAA,GAAAL,OAAA;AAEA,IAAAM,MAAA,GAAAN,OAAA;AAMA,IAAAO,WAAA,GAAAP,OAAA;AAIuB,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAD,wBAAAU,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAZ,uBAAA,YAAAA,CAAAU,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAA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AAK,EAAEwB,cAAc,CAACxB,KAAK,CAAC,EAAE0B,UAAU,EAAExC,OAAQ;QAClDoF,IAAI,EAAE1B;MAAS,CAChB,CAAC,gBAEF,IAAArE,WAAA,CAAAuE,GAAA,EAACzE,MAAA,CAAAkG,YAAY;QACXJ,gBAAgB;QAChBC,IAAI,EAAEjE,IAAK;QACXH,KAAK,EAAEwB,cAAc,CAACxB,KAAK,CAAC,EAAE0B,UAAU,EAAExB,QAAS;QACnDoE,IAAI,EAAE1B;MAAS,CAChB,CACF,CAAC,eACJ,IAAArE,WAAA,CAAAuE,GAAA,EAACd,cAAc;QACbkB,UAAU,EAAE,KAAM;QAClBsB,2BAA2B;QAC3BC,yBAAyB,EAAC,qBAAqB;QAC/CC,IAAI,EAAE3D,kBAAkB,GAAG,UAAU,GAAG,kBAAmB;QAC3D4D,MAAM,EAAE,UAAW;QACnBL,IAAI,EAAEM,8BAAmB;QACzBC,UAAU,EAAEC,gCAAqB;QACjCtB,KAAK,EAAE,CACLtD,QAAQ,GACJ;UAAEF,KAAK,EAAEwB,cAAc,CAACxB,KAAK,CAAC,EAAE0B,UAAU,EAAExB;QAAS,CAAC,GACtD;UAAE,GAAGkC;QAAgC,CAAC,EAC1C;UAAE1B;QAAU,CAAC,CACb;QACFD,aAAa,EAAEA,aAAc;QAC7BsE,aAAa,EAAC,MAAM;QAAArB,QAAA,EAEnBzD;MAAK,CACQ,CAAC;IAAA,CACJ;EAAC,CACP,CAAC;AAEhB,CACF,CAAC;AAAC,IAAA+E,QAAA,GAAAlF,OAAA,CAAAZ,OAAA,GAEaW,UAAU","ignoreList":[]}
@@ -1,173 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ButtonOutline = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
- var _context = require("../../context");
11
- var _core = require("../../core/");
12
- var _hooks = require("../../hooks");
13
- var _icons = require("../icons");
14
- var _typography = require("../typography");
15
- var _jsxRuntime = require("react/jsx-runtime");
16
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
17
- // Icon size
18
- const iconSize = 20;
19
- const DISABLED_OPACITY = 0.5;
20
- const ICON_MARGIN = 8;
21
- const IOButtonStylesLocal = _reactNative.StyleSheet.create({
22
- buttonWithBorder: {
23
- borderWidth: 2
24
- }
25
- });
26
-
27
- /**
28
- * @deprecated Use `Button` with variant `outline` instead
29
- */
30
- const ButtonOutline = exports.ButtonOutline = /*#__PURE__*/(0, _react.forwardRef)(({
31
- color = "primary",
32
- label,
33
- fullWidth = false,
34
- disabled = false,
35
- icon,
36
- iconPosition = "start",
37
- onPress,
38
- accessibilityLabel,
39
- accessibilityHint,
40
- testID
41
- }, ref) => {
42
- const theme = (0, _context.useIOTheme)();
43
- const {
44
- newTypefaceEnabled
45
- } = (0, _context.useIONewTypeface)();
46
- const {
47
- progress,
48
- onPressIn,
49
- onPressOut,
50
- scaleAnimatedStyle
51
- } = (0, _hooks.useScaleAnimation)();
52
- const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
53
- const AnimatedIOText = _reactNativeReanimated.default.createAnimatedComponent(_typography.IOText);
54
- const mapColorStates = {
55
- // Primary button
56
- primary: {
57
- background: {
58
- default: (0, _core.hexToRgba)(_core.IOColors[theme["interactiveElem-pressed"]], 0),
59
- pressed: (0, _core.hexToRgba)(_core.IOColors[theme["interactiveElem-pressed"]], 0.1),
60
- disabled: "transparent"
61
- },
62
- foreground: {
63
- default: _core.IOColors[theme["interactiveElem-default"]],
64
- pressed: _core.IOColors[theme["interactiveElem-pressed"]],
65
- disabled: _core.IOColors[theme["interactiveOutline-disabled"]]
66
- }
67
- },
68
- // Contrast button
69
- contrast: {
70
- background: {
71
- default: (0, _core.hexToRgba)(_core.IOColors["blueIO-600"], 0),
72
- pressed: (0, _core.hexToRgba)(_core.IOColors["blueIO-600"], 0.5),
73
- disabled: "transparent"
74
- },
75
- foreground: {
76
- default: _core.IOColors.white,
77
- pressed: _core.IOColors.white,
78
- disabled: _core.IOColors["blueIO-200"]
79
- }
80
- }
81
- };
82
-
83
- // Interpolate animation values from `isPressed` values
84
- const pressedAnimationStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
85
- // Link color states to the pressed states
86
- const backgroundColor = (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].background.default, mapColorStates[color].background.pressed]);
87
- const borderColor = (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed]);
88
- return {
89
- borderColor,
90
- backgroundColor
91
- };
92
- });
93
- const pressedColorLabelAnimationStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
94
- color: (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed])
95
- }));
96
-
97
- // Animate the <Icon> color prop
98
- const pressedColorIconAnimationStyle = (0, _reactNativeReanimated.useAnimatedProps)(() => ({
99
- color: (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed])
100
- }));
101
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
102
- ref: ref,
103
- accessible: true,
104
- accessibilityLabel: accessibilityLabel || label,
105
- accessibilityHint: accessibilityHint,
106
- accessibilityRole: "button",
107
- accessibilityState: {
108
- disabled: disabled || false
109
- },
110
- onPress: onPress,
111
- onPressIn: onPressIn,
112
- onPressOut: onPressOut,
113
- disabled: disabled,
114
- style: fullWidth ? {
115
- flexShrink: 0,
116
- alignSelf: "stretch"
117
- } : {
118
- flexShrink: 1,
119
- alignSelf: "auto"
120
- },
121
- testID: testID,
122
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
123
- style: [_core.IOButtonStyles.button, _core.IOButtonStyles.buttonSizeDefault, IOButtonStylesLocal.buttonWithBorder, fullWidth && {
124
- paddingHorizontal: 16
125
- }, {
126
- columnGap: ICON_MARGIN
127
- }, iconPosition === "end" && {
128
- flexDirection: "row-reverse"
129
- }, disabled ? {
130
- backgroundColor: mapColorStates[color]?.background?.disabled,
131
- borderColor: mapColorStates[color]?.foreground?.disabled,
132
- opacity: DISABLED_OPACITY
133
- } : {
134
- backgroundColor: mapColorStates[color]?.background?.default,
135
- borderColor: mapColorStates[color]?.foreground.default
136
- },
137
- /* Prevent Reanimated from overriding background colors
138
- if button is disabled */
139
- !reducedMotion && !disabled && scaleAnimatedStyle, !disabled && pressedAnimationStyle],
140
- children: [icon && (!disabled ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AnimatedIconWithColorTransition, {
141
- allowFontScaling: true,
142
- name: icon,
143
- animatedProps: pressedColorIconAnimationStyle,
144
- color: mapColorStates[color]?.foreground?.default,
145
- size: iconSize
146
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AnimatedIcon, {
147
- allowFontScaling: true,
148
- name: icon,
149
- color: mapColorStates[color]?.foreground?.disabled,
150
- size: iconSize
151
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedIOText, {
152
- font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
153
- weight: "Semibold",
154
- size: _typography.buttonTextFontSize,
155
- accessible: false,
156
- accessibilityElementsHidden: true,
157
- importantForAccessibility: "no-hide-descendants",
158
- numberOfLines: 1,
159
- ellipsizeMode: "tail",
160
- style: [{
161
- alignSelf: "center"
162
- }, disabled ? {
163
- color: mapColorStates[color]?.foreground?.disabled
164
- } : {
165
- ...pressedColorLabelAnimationStyle
166
- }],
167
- children: label
168
- })]
169
- })
170
- });
171
- });
172
- var _default = exports.default = ButtonOutline;
173
- //# sourceMappingURL=ButtonOutline.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_context","_core","_hooks","_icons","_typography","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","iconSize","DISABLED_OPACITY","ICON_MARGIN","IOButtonStylesLocal","StyleSheet","create","buttonWithBorder","borderWidth","ButtonOutline","exports","forwardRef","color","label","fullWidth","disabled","icon","iconPosition","onPress","accessibilityLabel","accessibilityHint","testID","ref","theme","useIOTheme","newTypefaceEnabled","useIONewTypeface","progress","onPressIn","onPressOut","scaleAnimatedStyle","useScaleAnimation","reducedMotion","useReducedMotion","AnimatedIOText","Animated","createAnimatedComponent","IOText","mapColorStates","primary","background","hexToRgba","IOColors","pressed","foreground","contrast","white","pressedAnimationStyle","useAnimatedStyle","backgroundColor","interpolateColor","value","borderColor","pressedColorLabelAnimationStyle","pressedColorIconAnimationStyle","useAnimatedProps","jsx","Pressable","accessible","accessibilityRole","accessibilityState","style","flexShrink","alignSelf","children","jsxs","View","IOButtonStyles","button","buttonSizeDefault","paddingHorizontal","columnGap","flexDirection","opacity","AnimatedIconWithColorTransition","allowFontScaling","name","animatedProps","size","AnimatedIcon","font","weight","buttonTextFontSize","accessibilityElementsHidden","importantForAccessibility","numberOfLines","ellipsizeMode","_default"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonOutline.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;A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7B,QAAS;QACnD+D,IAAI,EAAE7E;MAAS,CAChB,CACF,CAAC,eACJ,IAAApB,WAAA,CAAA2E,GAAA,EAACtB,cAAc;QACb8C,IAAI,EAAEvD,kBAAkB,GAAG,UAAU,GAAG,kBAAmB;QAC3DwD,MAAM,EAAE,UAAW;QACnBH,IAAI,EAAEI,8BAAmB;QACzBxB,UAAU,EAAE,KAAM;QAClByB,2BAA2B;QAC3BC,yBAAyB,EAAC,qBAAqB;QAC/CC,aAAa,EAAE,CAAE;QACjBC,aAAa,EAAC,MAAM;QACpBzB,KAAK,EAAE,CACL;UAAEE,SAAS,EAAE;QAAS,CAAC,EACvBhD,QAAQ,GACJ;UAAEH,KAAK,EAAE0B,cAAc,CAAC1B,KAAK,CAAC,EAAEgC,UAAU,EAAE7B;QAAS,CAAC,GACtD;UAAE,GAAGsC;QAAgC,CAAC,CAC1C;QAAAW,QAAA,EAEDnD;MAAK,CACQ,CAAC;IAAA,CACJ;EAAC,CACP,CAAC;AAEhB,CACF,CAAC;AAAC,IAAA0E,QAAA,GAAA7E,OAAA,CAAAlB,OAAA,GAEaiB,aAAa","ignoreList":[]}
@@ -1,194 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ButtonSolid = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _reactNativeHapticFeedback = _interopRequireDefault(require("react-native-haptic-feedback"));
10
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
- var _context = require("../../context");
12
- var _core = require("../../core");
13
- var _hooks = require("../../hooks");
14
- var _icons = require("../icons");
15
- var _loadingSpinner = require("../loadingSpinner");
16
- var _ButtonText = require("../typography/ButtonText");
17
- var _jsxRuntime = require("react/jsx-runtime");
18
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
- const ICON_MARGIN = 8;
21
- const DISABLED_OPACITY = 0.5;
22
-
23
- // Icon size
24
- const iconSize = 20;
25
- /**
26
- * @deprecated Use `Button` with variant `solid` instead
27
- */
28
- const ButtonSolid = exports.ButtonSolid = /*#__PURE__*/(0, _react.forwardRef)(({
29
- color = "primary",
30
- label,
31
- fullWidth = false,
32
- disabled = false,
33
- loading = false,
34
- icon,
35
- iconPosition = "start",
36
- onPress,
37
- accessibilityLabel,
38
- accessibilityHint,
39
- testID
40
- }, ref) => {
41
- const theme = (0, _context.useIOTheme)();
42
- const {
43
- progress,
44
- onPressIn,
45
- onPressOut,
46
- scaleAnimatedStyle
47
- } = (0, _hooks.useScaleAnimation)();
48
- const reducedMotion = (0, _reactNativeReanimated.useReducedMotion)();
49
- const mapColorStates = {
50
- // Primary button
51
- primary: {
52
- background: {
53
- default: _core.IOColors[theme["interactiveElem-default"]],
54
- pressed: _core.IOColors[theme["interactiveElem-pressed"]],
55
- disabled: _core.IOColors[theme["interactiveElem-disabled"]]
56
- },
57
- foreground: {
58
- default: theme["buttonText-default"],
59
- disabled: theme["buttonText-disabled"]
60
- }
61
- },
62
- // Danger button
63
- danger: {
64
- background: {
65
- default: _core.IOColors["error-600"],
66
- pressed: _core.IOColors["error-500"],
67
- disabled: _core.IOColors[theme["interactiveElem-disabled"]]
68
- },
69
- foreground: {
70
- default: theme["buttonText-danger"],
71
- disabled: theme["buttonText-disabled"]
72
- }
73
- },
74
- // Contrast button
75
- contrast: {
76
- background: {
77
- default: _core.IOColors.white,
78
- pressed: _core.IOColors["blueIO-50"],
79
- disabled: _core.IOColors["blueIO-50"]
80
- },
81
- foreground: {
82
- default: "blueIO-500",
83
- disabled: "blueIO-500"
84
- }
85
- }
86
- };
87
-
88
- /* Prevent the component from triggering the `isEntering' transition
89
- on the on the first render. Solution from this discussion:
90
- https://github.com/software-mansion/react-native-reanimated/discussions/2513
91
- */
92
- const isMounted = (0, _react.useRef)(false);
93
- (0, _react.useEffect)(() => {
94
- // eslint-disable-next-line functional/immutable-data
95
- isMounted.current = true;
96
- }, []);
97
-
98
- // Interpolate animation values from `isPressed` values
99
- const pressedAnimationStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
100
- // Link color states to the pressed states
101
- const backgroundColor = (0, _reactNativeReanimated.interpolateColor)(progress.value, [0, 1], [mapColorStates[color].background.default, mapColorStates[color].background.pressed]);
102
- return {
103
- backgroundColor
104
- };
105
- });
106
- const handleOnPress = (0, _react.useCallback)(event => {
107
- /* Don't call `onPress` if the button is
108
- in loading state */
109
- if (loading) {
110
- return;
111
- }
112
- _reactNativeHapticFeedback.default.trigger("impactLight");
113
- onPress(event);
114
- }, [loading, onPress]);
115
-
116
- // Background
117
- const backgroundColor = disabled ? mapColorStates[color]?.background?.disabled : mapColorStates[color]?.background?.default;
118
-
119
- // Label & Icons colors
120
- const foregroundColor = disabled ? mapColorStates[color]?.foreground?.disabled : mapColorStates[color]?.foreground?.default;
121
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
122
- testID: testID,
123
- ref: ref,
124
- accessible: true
125
- // Using || operator because empty string is not an accepted value
126
- ,
127
- accessibilityLabel: accessibilityLabel || label,
128
- accessibilityHint: accessibilityHint,
129
- accessibilityState: {
130
- busy: loading,
131
- disabled: disabled || false
132
- },
133
- accessibilityRole: "button",
134
- onPress: handleOnPress,
135
- onPressIn: onPressIn,
136
- onPressOut: onPressOut,
137
- disabled: disabled,
138
- style: fullWidth ? {
139
- flexShrink: 0,
140
- alignSelf: "stretch"
141
- } : {
142
- flexShrink: 1,
143
- alignSelf: "auto"
144
- },
145
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
146
- style: [_core.IOButtonStyles.button, _core.IOButtonStyles.buttonSizeDefault, {
147
- backgroundColor,
148
- overflow: "hidden"
149
- }, fullWidth && {
150
- paddingHorizontal: 16
151
- }, disabled ? {
152
- opacity: DISABLED_OPACITY
153
- } : {},
154
- /* Prevent Reanimated from overriding background colors
155
- if button is disabled */
156
- !disabled && !reducedMotion && scaleAnimatedStyle, !disabled && pressedAnimationStyle],
157
- children: [loading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
158
- style: _core.IOButtonStyles.buttonInner,
159
- entering: isMounted.current ? _core.enterTransitionInnerContentSmall : undefined,
160
- exiting: _core.exitTransitionInnerContent,
161
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_loadingSpinner.LoadingSpinner, {
162
- color: _core.IOColors[foregroundColor]
163
- })
164
- }), !loading && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
165
- style: [_core.IOButtonStyles.buttonInner, {
166
- columnGap: ICON_MARGIN
167
- },
168
- /* If 'iconPosition' is set to 'end', we use
169
- reverse flex property to invert the position */
170
- iconPosition === "end" && {
171
- flexDirection: "row-reverse"
172
- }],
173
- entering: isMounted.current ? _core.enterTransitionInnerContent : undefined,
174
- children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.Icon, {
175
- allowFontScaling: true,
176
- name: icon,
177
- size: iconSize,
178
- color: foregroundColor
179
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ButtonText.ButtonText, {
180
- color: foregroundColor,
181
- style: _core.IOButtonStyles.label,
182
- numberOfLines: 1,
183
- ellipsizeMode: "tail",
184
- accessible: false,
185
- accessibilityElementsHidden: true,
186
- importantForAccessibility: "no-hide-descendants",
187
- children: label
188
- })]
189
- })]
190
- })
191
- });
192
- });
193
- var _default = exports.default = ButtonSolid;
194
- //# sourceMappingURL=ButtonSolid.js.map