@pagopa/io-app-design-system 5.11.13-0 → 5.11.13
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.
- package/lib/commonjs/components/banner/BannerErrorState.js +3 -2
- package/lib/commonjs/components/banner/BannerErrorState.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/button.test.js +13 -9
- package/lib/commonjs/components/buttons/__test__/button.test.js.map +1 -1
- package/lib/commonjs/components/buttons/index.js +0 -33
- package/lib/commonjs/components/buttons/index.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +2 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +2 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js +2 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/pictograms/Pictogram.js +2 -0
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/pictograms/svg/PictogramPinSecurity.js +64 -0
- package/lib/commonjs/components/pictograms/svg/PictogramPinSecurity.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
- package/lib/commonjs/components/toast/ToastProvider.js +1 -5
- package/lib/commonjs/components/toast/ToastProvider.js.map +1 -1
- package/lib/module/components/banner/BannerErrorState.js +3 -2
- package/lib/module/components/banner/BannerErrorState.js.map +1 -1
- package/lib/module/components/buttons/__test__/button.test.js +13 -9
- package/lib/module/components/buttons/__test__/button.test.js.map +1 -1
- package/lib/module/components/buttons/index.js +0 -3
- package/lib/module/components/buttons/index.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +3 -2
- package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +3 -2
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/modules/ModuleCheckout.js +3 -2
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/pictograms/Pictogram.js +2 -0
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/pictograms/svg/PictogramPinSecurity.js +59 -0
- package/lib/module/components/pictograms/svg/PictogramPinSecurity.js.map +1 -0
- package/lib/module/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
- package/lib/module/components/toast/ToastProvider.js +2 -6
- package/lib/module/components/toast/ToastProvider.js.map +1 -1
- package/lib/typescript/components/banner/BannerErrorState.d.ts.map +1 -1
- package/lib/typescript/components/buttons/index.d.ts +0 -3
- package/lib/typescript/components/buttons/index.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemHeader.d.ts +2 -2
- package/lib/typescript/components/listitems/ListItemHeader.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemInfo.d.ts +2 -2
- package/lib/typescript/components/listitems/ListItemInfo.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts +1 -0
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/svg/PictogramPinSecurity.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramPinSecurity.d.ts.map +1 -0
- package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/banner/BannerErrorState.tsx +7 -2
- package/src/components/buttons/__test__/button.test.tsx +15 -13
- package/src/components/buttons/index.tsx +0 -3
- package/src/components/listitems/ListItemHeader.tsx +3 -3
- package/src/components/listitems/ListItemInfo.tsx +4 -3
- package/src/components/modules/ModuleCheckout.tsx +2 -2
- package/src/components/pictograms/Pictogram.tsx +2 -0
- package/src/components/pictograms/svg/PictogramPinSecurity.tsx +44 -0
- package/src/components/pictograms/svg/originals/PictogramPinSecurity.svg +1 -0
- package/src/components/toast/ToastProvider.tsx +1 -13
- package/lib/commonjs/components/buttons/ButtonLink.js +0 -157
- package/lib/commonjs/components/buttons/ButtonLink.js.map +0 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +0 -173
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +0 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +0 -194
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +0 -1
- package/lib/module/components/buttons/ButtonLink.js +0 -152
- package/lib/module/components/buttons/ButtonLink.js.map +0 -1
- package/lib/module/components/buttons/ButtonOutline.js +0 -168
- package/lib/module/components/buttons/ButtonOutline.js.map +0 -1
- package/lib/module/components/buttons/ButtonSolid.js +0 -188
- package/lib/module/components/buttons/ButtonSolid.js.map +0 -1
- package/lib/typescript/components/buttons/ButtonLink.d.ts +0 -36
- package/lib/typescript/components/buttons/ButtonLink.d.ts.map +0 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts +0 -26
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +0 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts +0 -52
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +0 -1
- package/src/components/buttons/ButtonLink.tsx +0 -222
- package/src/components/buttons/ButtonOutline.tsx +0 -261
- package/src/components/buttons/ButtonSolid.tsx +0 -285
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { forwardRef } from "react";
|
|
4
|
-
import { Pressable, StyleSheet } from "react-native";
|
|
5
|
-
import Animated, { interpolateColor, useAnimatedProps, useAnimatedStyle, useReducedMotion } from "react-native-reanimated";
|
|
6
|
-
import { useIONewTypeface, useIOTheme } from "../../context";
|
|
7
|
-
import { IOButtonStyles, IOColors, hexToRgba } from "../../core/";
|
|
8
|
-
import { useScaleAnimation } from "../../hooks";
|
|
9
|
-
import { AnimatedIcon, AnimatedIconWithColorTransition } from "../icons";
|
|
10
|
-
import { IOText, buttonTextFontSize } from "../typography";
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
// Icon size
|
|
13
|
-
const iconSize = 20;
|
|
14
|
-
const DISABLED_OPACITY = 0.5;
|
|
15
|
-
const ICON_MARGIN = 8;
|
|
16
|
-
const IOButtonStylesLocal = StyleSheet.create({
|
|
17
|
-
buttonWithBorder: {
|
|
18
|
-
borderWidth: 2
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated Use `Button` with variant `outline` instead
|
|
24
|
-
*/
|
|
25
|
-
export const ButtonOutline = /*#__PURE__*/forwardRef(({
|
|
26
|
-
color = "primary",
|
|
27
|
-
label,
|
|
28
|
-
fullWidth = false,
|
|
29
|
-
disabled = false,
|
|
30
|
-
icon,
|
|
31
|
-
iconPosition = "start",
|
|
32
|
-
onPress,
|
|
33
|
-
accessibilityLabel,
|
|
34
|
-
accessibilityHint,
|
|
35
|
-
testID
|
|
36
|
-
}, ref) => {
|
|
37
|
-
const theme = useIOTheme();
|
|
38
|
-
const {
|
|
39
|
-
newTypefaceEnabled
|
|
40
|
-
} = useIONewTypeface();
|
|
41
|
-
const {
|
|
42
|
-
progress,
|
|
43
|
-
onPressIn,
|
|
44
|
-
onPressOut,
|
|
45
|
-
scaleAnimatedStyle
|
|
46
|
-
} = useScaleAnimation();
|
|
47
|
-
const reducedMotion = useReducedMotion();
|
|
48
|
-
const AnimatedIOText = Animated.createAnimatedComponent(IOText);
|
|
49
|
-
const mapColorStates = {
|
|
50
|
-
// Primary button
|
|
51
|
-
primary: {
|
|
52
|
-
background: {
|
|
53
|
-
default: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0),
|
|
54
|
-
pressed: hexToRgba(IOColors[theme["interactiveElem-pressed"]], 0.1),
|
|
55
|
-
disabled: "transparent"
|
|
56
|
-
},
|
|
57
|
-
foreground: {
|
|
58
|
-
default: IOColors[theme["interactiveElem-default"]],
|
|
59
|
-
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
60
|
-
disabled: IOColors[theme["interactiveOutline-disabled"]]
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
// Contrast button
|
|
64
|
-
contrast: {
|
|
65
|
-
background: {
|
|
66
|
-
default: hexToRgba(IOColors["blueIO-600"], 0),
|
|
67
|
-
pressed: hexToRgba(IOColors["blueIO-600"], 0.5),
|
|
68
|
-
disabled: "transparent"
|
|
69
|
-
},
|
|
70
|
-
foreground: {
|
|
71
|
-
default: IOColors.white,
|
|
72
|
-
pressed: IOColors.white,
|
|
73
|
-
disabled: IOColors["blueIO-200"]
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// Interpolate animation values from `isPressed` values
|
|
79
|
-
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
80
|
-
// Link color states to the pressed states
|
|
81
|
-
const backgroundColor = interpolateColor(progress.value, [0, 1], [mapColorStates[color].background.default, mapColorStates[color].background.pressed]);
|
|
82
|
-
const borderColor = interpolateColor(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed]);
|
|
83
|
-
return {
|
|
84
|
-
borderColor,
|
|
85
|
-
backgroundColor
|
|
86
|
-
};
|
|
87
|
-
});
|
|
88
|
-
const pressedColorLabelAnimationStyle = useAnimatedStyle(() => ({
|
|
89
|
-
color: interpolateColor(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed])
|
|
90
|
-
}));
|
|
91
|
-
|
|
92
|
-
// Animate the <Icon> color prop
|
|
93
|
-
const pressedColorIconAnimationStyle = useAnimatedProps(() => ({
|
|
94
|
-
color: interpolateColor(progress.value, [0, 1], [mapColorStates[color].foreground.default, mapColorStates[color].foreground.pressed])
|
|
95
|
-
}));
|
|
96
|
-
return /*#__PURE__*/_jsx(Pressable, {
|
|
97
|
-
ref: ref,
|
|
98
|
-
accessible: true,
|
|
99
|
-
accessibilityLabel: accessibilityLabel || label,
|
|
100
|
-
accessibilityHint: accessibilityHint,
|
|
101
|
-
accessibilityRole: "button",
|
|
102
|
-
accessibilityState: {
|
|
103
|
-
disabled: disabled || false
|
|
104
|
-
},
|
|
105
|
-
onPress: onPress,
|
|
106
|
-
onPressIn: onPressIn,
|
|
107
|
-
onPressOut: onPressOut,
|
|
108
|
-
disabled: disabled,
|
|
109
|
-
style: fullWidth ? {
|
|
110
|
-
flexShrink: 0,
|
|
111
|
-
alignSelf: "stretch"
|
|
112
|
-
} : {
|
|
113
|
-
flexShrink: 1,
|
|
114
|
-
alignSelf: "auto"
|
|
115
|
-
},
|
|
116
|
-
testID: testID,
|
|
117
|
-
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
118
|
-
style: [IOButtonStyles.button, IOButtonStyles.buttonSizeDefault, IOButtonStylesLocal.buttonWithBorder, fullWidth && {
|
|
119
|
-
paddingHorizontal: 16
|
|
120
|
-
}, {
|
|
121
|
-
columnGap: ICON_MARGIN
|
|
122
|
-
}, iconPosition === "end" && {
|
|
123
|
-
flexDirection: "row-reverse"
|
|
124
|
-
}, disabled ? {
|
|
125
|
-
backgroundColor: mapColorStates[color]?.background?.disabled,
|
|
126
|
-
borderColor: mapColorStates[color]?.foreground?.disabled,
|
|
127
|
-
opacity: DISABLED_OPACITY
|
|
128
|
-
} : {
|
|
129
|
-
backgroundColor: mapColorStates[color]?.background?.default,
|
|
130
|
-
borderColor: mapColorStates[color]?.foreground.default
|
|
131
|
-
},
|
|
132
|
-
/* Prevent Reanimated from overriding background colors
|
|
133
|
-
if button is disabled */
|
|
134
|
-
!reducedMotion && !disabled && scaleAnimatedStyle, !disabled && pressedAnimationStyle],
|
|
135
|
-
children: [icon && (!disabled ? /*#__PURE__*/_jsx(AnimatedIconWithColorTransition, {
|
|
136
|
-
allowFontScaling: true,
|
|
137
|
-
name: icon,
|
|
138
|
-
animatedProps: pressedColorIconAnimationStyle,
|
|
139
|
-
color: mapColorStates[color]?.foreground?.default,
|
|
140
|
-
size: iconSize
|
|
141
|
-
}) : /*#__PURE__*/_jsx(AnimatedIcon, {
|
|
142
|
-
allowFontScaling: true,
|
|
143
|
-
name: icon,
|
|
144
|
-
color: mapColorStates[color]?.foreground?.disabled,
|
|
145
|
-
size: iconSize
|
|
146
|
-
})), /*#__PURE__*/_jsx(AnimatedIOText, {
|
|
147
|
-
font: newTypefaceEnabled ? "Titillio" : "TitilliumSansPro",
|
|
148
|
-
weight: "Semibold",
|
|
149
|
-
size: buttonTextFontSize,
|
|
150
|
-
accessible: false,
|
|
151
|
-
accessibilityElementsHidden: true,
|
|
152
|
-
importantForAccessibility: "no-hide-descendants",
|
|
153
|
-
numberOfLines: 1,
|
|
154
|
-
ellipsizeMode: "tail",
|
|
155
|
-
style: [{
|
|
156
|
-
alignSelf: "center"
|
|
157
|
-
}, disabled ? {
|
|
158
|
-
color: mapColorStates[color]?.foreground?.disabled
|
|
159
|
-
} : {
|
|
160
|
-
...pressedColorLabelAnimationStyle
|
|
161
|
-
}],
|
|
162
|
-
children: label
|
|
163
|
-
})]
|
|
164
|
-
})
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
export default ButtonOutline;
|
|
168
|
-
//# sourceMappingURL=ButtonOutline.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","Pressable","StyleSheet","Animated","interpolateColor","useAnimatedProps","useAnimatedStyle","useReducedMotion","useIONewTypeface","useIOTheme","IOButtonStyles","IOColors","hexToRgba","useScaleAnimation","AnimatedIcon","AnimatedIconWithColorTransition","IOText","buttonTextFontSize","jsx","_jsx","jsxs","_jsxs","iconSize","DISABLED_OPACITY","ICON_MARGIN","IOButtonStylesLocal","create","buttonWithBorder","borderWidth","ButtonOutline","color","label","fullWidth","disabled","icon","iconPosition","onPress","accessibilityLabel","accessibilityHint","testID","ref","theme","newTypefaceEnabled","progress","onPressIn","onPressOut","scaleAnimatedStyle","reducedMotion","AnimatedIOText","createAnimatedComponent","mapColorStates","primary","background","default","pressed","foreground","contrast","white","pressedAnimationStyle","backgroundColor","value","borderColor","pressedColorLabelAnimationStyle","pressedColorIconAnimationStyle","accessible","accessibilityRole","accessibilityState","style","flexShrink","alignSelf","children","View","button","buttonSizeDefault","paddingHorizontal","columnGap","flexDirection","opacity","allowFontScaling","name","animatedProps","size","font","weight","accessibilityElementsHidden","importantForAccessibility","numberOfLines","ellipsizeMode"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonOutline.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAoBC,UAAU,QAAQ,OAAO;AACzD,SAEEC,SAAS,EACTC,UAAU,QAEL,cAAc;AACrB,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAChC,SAASC,gBAAgB,EAAEC,UAAU,QAAQ,eAAe;AAC5D,SAASC,cAAc,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,aAAa;AACjE,SAASC,iBAAiB,QAAQ,aAAa;AAE/C,SACEC,YAAY,EACZC,+BAA+B,QAG1B,UAAU;AACjB,SAASC,MAAM,EAAEC,kBAAkB,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgC3D;AACA,MAAMC,QAAyB,GAAG,EAAE;AAEpC,MAAMC,gBAAgB,GAAG,GAAG;AAC5B,MAAMC,WAAW,GAAG,CAAC;AAErB,MAAMC,mBAAmB,GAAGvB,UAAU,CAACwB,MAAM,CAAC;EAC5CC,gBAAgB,EAAE;IAChBC,WAAW,EAAE;EACf;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA,OAAO,MAAMC,aAAa,gBAAG7B,UAAU,CACrC,CACE;EACE8B,KAAK,GAAG,SAAS;EACjBC,KAAK;EACLC,SAAS,GAAG,KAAK;EACjBC,QAAQ,GAAG,KAAK;EAChBC,IAAI;EACJC,YAAY,GAAG,OAAO;EACtBC,OAAO;EACPC,kBAAkB;EAClBC,iBAAiB;EACjBC;AACF,CAAC,EACDC,GAAG,K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ardRef, useCallback, useEffect, useRef } from "react";
|
|
4
|
-
import { Pressable } from "react-native";
|
|
5
|
-
import ReactNativeHapticFeedback from "react-native-haptic-feedback";
|
|
6
|
-
import Animated, { interpolateColor, useAnimatedStyle, useReducedMotion } from "react-native-reanimated";
|
|
7
|
-
import { useIOTheme } from "../../context";
|
|
8
|
-
import { IOButtonStyles, IOColors, enterTransitionInnerContent, enterTransitionInnerContentSmall, exitTransitionInnerContent } from "../../core";
|
|
9
|
-
import { useScaleAnimation } from "../../hooks";
|
|
10
|
-
import { Icon } from "../icons";
|
|
11
|
-
import { LoadingSpinner } from "../loadingSpinner";
|
|
12
|
-
import { ButtonText } from "../typography/ButtonText";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const ICON_MARGIN = 8;
|
|
15
|
-
const DISABLED_OPACITY = 0.5;
|
|
16
|
-
|
|
17
|
-
// Icon size
|
|
18
|
-
const iconSize = 20;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `Button` with variant `solid` instead
|
|
21
|
-
*/
|
|
22
|
-
export const ButtonSolid = /*#__PURE__*/forwardRef(({
|
|
23
|
-
color = "primary",
|
|
24
|
-
label,
|
|
25
|
-
fullWidth = false,
|
|
26
|
-
disabled = false,
|
|
27
|
-
loading = false,
|
|
28
|
-
icon,
|
|
29
|
-
iconPosition = "start",
|
|
30
|
-
onPress,
|
|
31
|
-
accessibilityLabel,
|
|
32
|
-
accessibilityHint,
|
|
33
|
-
testID
|
|
34
|
-
}, ref) => {
|
|
35
|
-
const theme = useIOTheme();
|
|
36
|
-
const {
|
|
37
|
-
progress,
|
|
38
|
-
onPressIn,
|
|
39
|
-
onPressOut,
|
|
40
|
-
scaleAnimatedStyle
|
|
41
|
-
} = useScaleAnimation();
|
|
42
|
-
const reducedMotion = useReducedMotion();
|
|
43
|
-
const mapColorStates = {
|
|
44
|
-
// Primary button
|
|
45
|
-
primary: {
|
|
46
|
-
background: {
|
|
47
|
-
default: IOColors[theme["interactiveElem-default"]],
|
|
48
|
-
pressed: IOColors[theme["interactiveElem-pressed"]],
|
|
49
|
-
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
50
|
-
},
|
|
51
|
-
foreground: {
|
|
52
|
-
default: theme["buttonText-default"],
|
|
53
|
-
disabled: theme["buttonText-disabled"]
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
// Danger button
|
|
57
|
-
danger: {
|
|
58
|
-
background: {
|
|
59
|
-
default: IOColors["error-600"],
|
|
60
|
-
pressed: IOColors["error-500"],
|
|
61
|
-
disabled: IOColors[theme["interactiveElem-disabled"]]
|
|
62
|
-
},
|
|
63
|
-
foreground: {
|
|
64
|
-
default: theme["buttonText-danger"],
|
|
65
|
-
disabled: theme["buttonText-disabled"]
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
// Contrast button
|
|
69
|
-
contrast: {
|
|
70
|
-
background: {
|
|
71
|
-
default: IOColors.white,
|
|
72
|
-
pressed: IOColors["blueIO-50"],
|
|
73
|
-
disabled: IOColors["blueIO-50"]
|
|
74
|
-
},
|
|
75
|
-
foreground: {
|
|
76
|
-
default: "blueIO-500",
|
|
77
|
-
disabled: "blueIO-500"
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/* Prevent the component from triggering the `isEntering' transition
|
|
83
|
-
on the on the first render. Solution from this discussion:
|
|
84
|
-
https://github.com/software-mansion/react-native-reanimated/discussions/2513
|
|
85
|
-
*/
|
|
86
|
-
const isMounted = useRef(false);
|
|
87
|
-
useEffect(() => {
|
|
88
|
-
// eslint-disable-next-line functional/immutable-data
|
|
89
|
-
isMounted.current = true;
|
|
90
|
-
}, []);
|
|
91
|
-
|
|
92
|
-
// Interpolate animation values from `isPressed` values
|
|
93
|
-
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
94
|
-
// Link color states to the pressed states
|
|
95
|
-
const backgroundColor = interpolateColor(progress.value, [0, 1], [mapColorStates[color].background.default, mapColorStates[color].background.pressed]);
|
|
96
|
-
return {
|
|
97
|
-
backgroundColor
|
|
98
|
-
};
|
|
99
|
-
});
|
|
100
|
-
const handleOnPress = useCallback(event => {
|
|
101
|
-
/* Don't call `onPress` if the button is
|
|
102
|
-
in loading state */
|
|
103
|
-
if (loading) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
ReactNativeHapticFeedback.trigger("impactLight");
|
|
107
|
-
onPress(event);
|
|
108
|
-
}, [loading, onPress]);
|
|
109
|
-
|
|
110
|
-
// Background
|
|
111
|
-
const backgroundColor = disabled ? mapColorStates[color]?.background?.disabled : mapColorStates[color]?.background?.default;
|
|
112
|
-
|
|
113
|
-
// Label & Icons colors
|
|
114
|
-
const foregroundColor = disabled ? mapColorStates[color]?.foreground?.disabled : mapColorStates[color]?.foreground?.default;
|
|
115
|
-
return /*#__PURE__*/_jsx(Pressable, {
|
|
116
|
-
testID: testID,
|
|
117
|
-
ref: ref,
|
|
118
|
-
accessible: true
|
|
119
|
-
// Using || operator because empty string is not an accepted value
|
|
120
|
-
,
|
|
121
|
-
accessibilityLabel: accessibilityLabel || label,
|
|
122
|
-
accessibilityHint: accessibilityHint,
|
|
123
|
-
accessibilityState: {
|
|
124
|
-
busy: loading,
|
|
125
|
-
disabled: disabled || false
|
|
126
|
-
},
|
|
127
|
-
accessibilityRole: "button",
|
|
128
|
-
onPress: handleOnPress,
|
|
129
|
-
onPressIn: onPressIn,
|
|
130
|
-
onPressOut: onPressOut,
|
|
131
|
-
disabled: disabled,
|
|
132
|
-
style: fullWidth ? {
|
|
133
|
-
flexShrink: 0,
|
|
134
|
-
alignSelf: "stretch"
|
|
135
|
-
} : {
|
|
136
|
-
flexShrink: 1,
|
|
137
|
-
alignSelf: "auto"
|
|
138
|
-
},
|
|
139
|
-
children: /*#__PURE__*/_jsxs(Animated.View, {
|
|
140
|
-
style: [IOButtonStyles.button, IOButtonStyles.buttonSizeDefault, {
|
|
141
|
-
backgroundColor,
|
|
142
|
-
overflow: "hidden"
|
|
143
|
-
}, fullWidth && {
|
|
144
|
-
paddingHorizontal: 16
|
|
145
|
-
}, disabled ? {
|
|
146
|
-
opacity: DISABLED_OPACITY
|
|
147
|
-
} : {},
|
|
148
|
-
/* Prevent Reanimated from overriding background colors
|
|
149
|
-
if button is disabled */
|
|
150
|
-
!disabled && !reducedMotion && scaleAnimatedStyle, !disabled && pressedAnimationStyle],
|
|
151
|
-
children: [loading && /*#__PURE__*/_jsx(Animated.View, {
|
|
152
|
-
style: IOButtonStyles.buttonInner,
|
|
153
|
-
entering: isMounted.current ? enterTransitionInnerContentSmall : undefined,
|
|
154
|
-
exiting: exitTransitionInnerContent,
|
|
155
|
-
children: /*#__PURE__*/_jsx(LoadingSpinner, {
|
|
156
|
-
color: IOColors[foregroundColor]
|
|
157
|
-
})
|
|
158
|
-
}), !loading && /*#__PURE__*/_jsxs(Animated.View, {
|
|
159
|
-
style: [IOButtonStyles.buttonInner, {
|
|
160
|
-
columnGap: ICON_MARGIN
|
|
161
|
-
},
|
|
162
|
-
/* If 'iconPosition' is set to 'end', we use
|
|
163
|
-
reverse flex property to invert the position */
|
|
164
|
-
iconPosition === "end" && {
|
|
165
|
-
flexDirection: "row-reverse"
|
|
166
|
-
}],
|
|
167
|
-
entering: isMounted.current ? enterTransitionInnerContent : undefined,
|
|
168
|
-
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
169
|
-
allowFontScaling: true,
|
|
170
|
-
name: icon,
|
|
171
|
-
size: iconSize,
|
|
172
|
-
color: foregroundColor
|
|
173
|
-
}), /*#__PURE__*/_jsx(ButtonText, {
|
|
174
|
-
color: foregroundColor,
|
|
175
|
-
style: IOButtonStyles.label,
|
|
176
|
-
numberOfLines: 1,
|
|
177
|
-
ellipsizeMode: "tail",
|
|
178
|
-
accessible: false,
|
|
179
|
-
accessibilityElementsHidden: true,
|
|
180
|
-
importantForAccessibility: "no-hide-descendants",
|
|
181
|
-
children: label
|
|
182
|
-
})]
|
|
183
|
-
})]
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
export default ButtonSolid;
|
|
188
|
-
//# sourceMappingURL=ButtonSolid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","forwardRef","useCallback","useEffect","useRef","Pressable","ReactNativeHapticFeedback","Animated","interpolateColor","useAnimatedStyle","useReducedMotion","useIOTheme","IOButtonStyles","IOColors","enterTransitionInnerContent","enterTransitionInnerContentSmall","exitTransitionInnerContent","useScaleAnimation","Icon","LoadingSpinner","ButtonText","jsx","_jsx","jsxs","_jsxs","ICON_MARGIN","DISABLED_OPACITY","iconSize","ButtonSolid","color","label","fullWidth","disabled","loading","icon","iconPosition","onPress","accessibilityLabel","accessibilityHint","testID","ref","theme","progress","onPressIn","onPressOut","scaleAnimatedStyle","reducedMotion","mapColorStates","primary","background","default","pressed","foreground","danger","contrast","white","isMounted","current","pressedAnimationStyle","backgroundColor","value","handleOnPress","event","trigger","foregroundColor","accessible","accessibilityState","busy","accessibilityRole","style","flexShrink","alignSelf","children","View","button","buttonSizeDefault","overflow","paddingHorizontal","opacity","buttonInner","entering","undefined","exiting","columnGap","flexDirection","allowFontScaling","name","size","numberOfLines","ellipsizeMode","accessibilityElementsHidden","importantForAccessibility"],"sourceRoot":"../../../../src","sources":["components/buttons/ButtonSolid.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAEVC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,MAAM,QACD,OAAO;AACd,SAGEC,SAAS,QAEJ,cAAc;AACrB,OAAOC,yBAAyB,MAAM,8BAA8B;AACpE,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAChC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SACEC,cAAc,EACdC,QAAQ,EACRC,2BAA2B,EAC3BC,gCAAgC,EAChCC,0BAA0B,QACrB,YAAY;AACnB,SAASC,iBAA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QAAK,CACI,CAAC;MAAA,CACA,CAChB;IAAA,CACY;EAAC,CACP,CAAC;AAEhB,CACF,CAAC;AAED,eAAeF,WAAW","ignoreList":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { AccessibilityRole, GestureResponderEvent, TextStyle, View } from "react-native";
|
|
3
|
-
import { WithTestID } from "../../utils/types";
|
|
4
|
-
import { IOIcons } from "../icons";
|
|
5
|
-
export type ColorButtonLink = "primary" | "contrast";
|
|
6
|
-
export type ButtonLinkProps = WithTestID<{
|
|
7
|
-
color?: ColorButtonLink;
|
|
8
|
-
label: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
icon?: IOIcons;
|
|
11
|
-
iconPosition?: "start" | "end";
|
|
12
|
-
accessibilityLabel?: string;
|
|
13
|
-
accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
|
|
14
|
-
accessibilityHint?: string;
|
|
15
|
-
numberOfLines?: number;
|
|
16
|
-
textAlign?: TextStyle["textAlign"];
|
|
17
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use `Button` with variant `link` instead
|
|
21
|
-
*/
|
|
22
|
-
export declare const ButtonLink: React.ForwardRefExoticComponent<{
|
|
23
|
-
color?: ColorButtonLink;
|
|
24
|
-
label: string;
|
|
25
|
-
disabled?: boolean;
|
|
26
|
-
icon?: IOIcons;
|
|
27
|
-
iconPosition?: "start" | "end";
|
|
28
|
-
accessibilityLabel?: string;
|
|
29
|
-
accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
|
|
30
|
-
accessibilityHint?: string;
|
|
31
|
-
numberOfLines?: number;
|
|
32
|
-
textAlign?: TextStyle["textAlign"];
|
|
33
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
34
|
-
} & import("../../utils/types").TestID & React.RefAttributes<View>>;
|
|
35
|
-
export default ButtonLink;
|
|
36
|
-
//# sourceMappingURL=But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,EAAE,qBAAqB,KAAK,IAAI;mEAwKhD,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps } from "react";
|
|
2
|
-
import { GestureResponderEvent, Pressable, View } from "react-native";
|
|
3
|
-
import { WithTestID } from "../../utils/types";
|
|
4
|
-
import { IOIcons } from "../icons";
|
|
5
|
-
type ColorButtonOutline = "primary" | "contrast";
|
|
6
|
-
export type ButtonOutline = WithTestID<{
|
|
7
|
-
color?: ColorButtonOutline;
|
|
8
|
-
label: string;
|
|
9
|
-
fullWidth?: boolean;
|
|
10
|
-
icon?: IOIcons;
|
|
11
|
-
iconPosition?: "start" | "end";
|
|
12
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
13
|
-
} & Pick<ComponentProps<typeof Pressable>, "disabled" | "accessibilityLabel" | "accessibilityHint">>;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use `Button` with variant `outline` instead
|
|
16
|
-
*/
|
|
17
|
-
export declare const ButtonOutline: React.ForwardRefExoticComponent<{
|
|
18
|
-
color?: ColorButtonOutline;
|
|
19
|
-
label: string;
|
|
20
|
-
fullWidth?: boolean;
|
|
21
|
-
icon?: IOIcons;
|
|
22
|
-
iconPosition?: "start" | "end";
|
|
23
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
24
|
-
} & Pick<import("react-native").PressableProps & React.RefAttributes<View>, "accessibilityLabel" | "accessibilityHint" | "disabled"> & import("../../utils/types").TestID & React.RefAttributes<View>>;
|
|
25
|
-
export default ButtonOutline;
|
|
26
|
-
//# sourceMappingURL=ButtonOutline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonOutline.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/ButtonOutline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAc,MAAM,OAAO,CAAC;AAC1D,OAAO,EACL,qBAAqB,EACrB,SAAS,EAET,IAAI,EACL,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAIL,OAAO,EACR,MAAM,UAAU,CAAC;AAGlB,KAAK,kBAAkB,GAAG,SAAS,GAAG,UAAU,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,UAAU,CACpC;IACE,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAE/B,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,GAAG,IAAI,CACN,cAAc,CAAC,OAAO,SAAS,CAAC,EAChC,UAAU,GAAG,oBAAoB,GAAG,mBAAmB,CACxD,CACF,CAAC;AA2BF;;GAEG;AACH,eAAO,MAAM,aAAa;YA1Cd,kBAAkB;WACnB,MAAM;gBACD,OAAO;WAEZ,OAAO;mBACC,OAAO,GAAG,KAAK;aAErB,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI;sMA+NlD,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React, { ComponentProps } from "react";
|
|
2
|
-
import { GestureResponderEvent, Pressable, View } from "react-native";
|
|
3
|
-
import { WithTestID } from "../../utils/types";
|
|
4
|
-
import { IOIcons } from "../icons";
|
|
5
|
-
export type ButtonSolidColor = "primary" | "danger" | "contrast";
|
|
6
|
-
export type ButtonSolidProps = WithTestID<{
|
|
7
|
-
/**
|
|
8
|
-
* @default primary
|
|
9
|
-
*/
|
|
10
|
-
color?: ButtonSolidColor;
|
|
11
|
-
label: string;
|
|
12
|
-
/**
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
fullWidth?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
loading?: boolean;
|
|
20
|
-
icon?: IOIcons;
|
|
21
|
-
/**
|
|
22
|
-
* @default start
|
|
23
|
-
*/
|
|
24
|
-
iconPosition?: "start" | "end";
|
|
25
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
26
|
-
} & Pick<ComponentProps<typeof Pressable>, "disabled" | "accessibilityLabel" | "accessibilityHint">>;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated Use `Button` with variant `solid` instead
|
|
29
|
-
*/
|
|
30
|
-
export declare const ButtonSolid: React.ForwardRefExoticComponent<{
|
|
31
|
-
/**
|
|
32
|
-
* @default primary
|
|
33
|
-
*/
|
|
34
|
-
color?: ButtonSolidColor;
|
|
35
|
-
label: string;
|
|
36
|
-
/**
|
|
37
|
-
* @default false
|
|
38
|
-
*/
|
|
39
|
-
fullWidth?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
loading?: boolean;
|
|
44
|
-
icon?: IOIcons;
|
|
45
|
-
/**
|
|
46
|
-
* @default start
|
|
47
|
-
*/
|
|
48
|
-
iconPosition?: "start" | "end";
|
|
49
|
-
onPress: (event: GestureResponderEvent) => void;
|
|
50
|
-
} & Pick<import("react-native").PressableProps & React.RefAttributes<View>, "accessibilityLabel" | "accessibilityHint" | "disabled"> & import("../../utils/types").TestID & React.RefAttributes<View>>;
|
|
51
|
-
export default ButtonSolid;
|
|
52
|
-
//# sourceMappingURL=ButtonSolid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSolid.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/ButtonSolid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,cAAc,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,qBAAqB,EACrB,SAAS,EACT,IAAI,EACL,MAAM,cAAc,CAAC;AAgBtB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAmB,OAAO,EAAQ,MAAM,UAAU,CAAC;AAI1D,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,CAAC;AAoBjE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CACvC;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IAC/B,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACjD,GAAG,IAAI,CACN,cAAc,CAAC,OAAO,SAAS,CAAC,EAChC,UAAU,GAAG,oBAAoB,GAAG,mBAAmB,CACxD,CACF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW;IA5BpB;;OAEG;YACK,gBAAgB;WACjB,MAAM;IACb;;OAEG;gBACS,OAAO;IACnB;;OAEG;cACO,OAAO;WACV,OAAO;IACd;;OAEG;mBACY,OAAO,GAAG,KAAK;aACrB,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI;sMAiNlD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|