@pagopa/io-app-design-system 1.2.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/accordion/RawAccordion.js.map +1 -1
- package/lib/commonjs/components/alert/Alert.js.map +1 -1
- package/lib/commonjs/components/avatar/__test__/avatar.test.js.map +1 -1
- package/lib/commonjs/components/badge/Badge.js.map +1 -1
- package/lib/commonjs/components/banner/Banner.js +1 -1
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/banner.test.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonOutline.js +3 -3
- package/lib/commonjs/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/commonjs/components/buttons/ButtonSolid.js +3 -3
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/contentWrapper/ContentWrapper.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemAction.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemIDP.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/commonjs/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/commonjs/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
- package/lib/commonjs/components/pictograms/Pictogram.js +7 -3
- package/lib/commonjs/components/pictograms/Pictogram.js.map +1 -1
- package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js +56 -0
- package/lib/commonjs/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
- package/lib/commonjs/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
- package/lib/commonjs/components/spacer/Spacer.js.map +1 -1
- package/lib/commonjs/components/typography/Body.js.map +1 -1
- package/lib/commonjs/components/typography/Factory.js.map +1 -1
- package/lib/commonjs/components/typography/H1.js.map +1 -1
- package/lib/commonjs/components/typography/H2.js.map +1 -1
- package/lib/commonjs/components/typography/H4.js.map +1 -1
- package/lib/commonjs/components/typography/H5.js.map +1 -1
- package/lib/commonjs/components/typography/H6.js.map +1 -1
- package/lib/commonjs/components/typography/Label.js.map +1 -1
- package/lib/commonjs/components/typography/LabelSmall.js.map +1 -1
- package/lib/commonjs/components/typography/Monospace.js.map +1 -1
- package/lib/commonjs/components/typography/common.js +2 -2
- package/lib/commonjs/components/typography/common.js.map +1 -1
- package/lib/commonjs/utils/image.js.map +1 -1
- package/lib/module/components/accordion/RawAccordion.js.map +1 -1
- package/lib/module/components/alert/Alert.js.map +1 -1
- package/lib/module/components/avatar/__test__/avatar.test.js.map +1 -1
- package/lib/module/components/badge/Badge.js.map +1 -1
- package/lib/module/components/banner/Banner.js +1 -1
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/banner.test.js.map +1 -1
- package/lib/module/components/buttons/ButtonExtendedOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonOutline.js +3 -3
- package/lib/module/components/buttons/ButtonOutline.js.map +1 -1
- package/lib/module/components/buttons/ButtonSolid.js +3 -3
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/IconButtonContained.js.map +1 -1
- package/lib/module/components/buttons/IconButtonSolid.js.map +1 -1
- package/lib/module/components/contentWrapper/ContentWrapper.js.map +1 -1
- package/lib/module/components/listitems/ListItemAction.js.map +1 -1
- package/lib/module/components/listitems/ListItemIDP.js.map +1 -1
- package/lib/module/components/listitems/ListItemNavAlert.js.map +1 -1
- package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
- package/lib/module/components/listitems/PressableListItemsBase.js.map +1 -1
- package/lib/module/components/listitems/__test__/listitem.test.js.map +1 -1
- package/lib/module/components/listitems/hooks/useListItemSpringAnimation.js.map +1 -1
- package/lib/module/components/pictograms/Pictogram.js +7 -3
- package/lib/module/components/pictograms/Pictogram.js.map +1 -1
- package/lib/module/components/pictograms/svg/PictogramFocusOn.js +48 -0
- package/lib/module/components/pictograms/svg/PictogramFocusOn.js.map +1 -0
- package/lib/module/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
- package/lib/module/components/spacer/Spacer.js.map +1 -1
- package/lib/module/components/typography/Body.js.map +1 -1
- package/lib/module/components/typography/Factory.js.map +1 -1
- package/lib/module/components/typography/H1.js.map +1 -1
- package/lib/module/components/typography/H2.js.map +1 -1
- package/lib/module/components/typography/H4.js.map +1 -1
- package/lib/module/components/typography/H5.js.map +1 -1
- package/lib/module/components/typography/H6.js.map +1 -1
- package/lib/module/components/typography/Label.js.map +1 -1
- package/lib/module/components/typography/LabelSmall.js.map +1 -1
- package/lib/module/components/typography/Monospace.js.map +1 -1
- package/lib/module/components/typography/common.js +2 -2
- package/lib/module/components/typography/common.js.map +1 -1
- package/lib/module/utils/image.js.map +1 -1
- package/lib/typescript/components/alert/Alert.d.ts.map +1 -1
- package/lib/typescript/components/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonExtendedOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonOutline.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/buttons/IconButtonContained.d.ts.map +1 -1
- package/lib/typescript/components/contentWrapper/ContentWrapper.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemAction.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemIDP.d.ts +1 -1
- package/lib/typescript/components/listitems/ListItemIDP.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNavAlert.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
- package/lib/typescript/components/listitems/PressableListItemsBase.d.ts.map +1 -1
- package/lib/typescript/components/listitems/hooks/useListItemSpringAnimation.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/Pictogram.d.ts +2 -0
- package/lib/typescript/components/pictograms/Pictogram.d.ts.map +1 -1
- package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts +5 -0
- package/lib/typescript/components/pictograms/svg/PictogramFocusOn.d.ts.map +1 -0
- package/lib/typescript/components/spacer/Spacer.d.ts.map +1 -1
- package/lib/typescript/components/typography/Body.d.ts.map +1 -1
- package/lib/typescript/components/typography/Factory.d.ts.map +1 -1
- package/lib/typescript/components/typography/H1.d.ts.map +1 -1
- package/lib/typescript/components/typography/H2.d.ts.map +1 -1
- package/lib/typescript/components/typography/H4.d.ts.map +1 -1
- package/lib/typescript/components/typography/H5.d.ts.map +1 -1
- package/lib/typescript/components/typography/H6.d.ts.map +1 -1
- package/lib/typescript/components/typography/Label.d.ts.map +1 -1
- package/lib/typescript/components/typography/LabelSmall.d.ts.map +1 -1
- package/lib/typescript/components/typography/Monospace.d.ts.map +1 -1
- package/lib/typescript/components/typography/common.d.ts +2 -2
- package/lib/typescript/components/typography/common.d.ts.map +1 -1
- package/lib/typescript/utils/image.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/Advice/index.tsx +1 -1
- package/src/components/accordion/RawAccordion.tsx +3 -3
- package/src/components/alert/Alert.tsx +4 -1
- package/src/components/avatar/Avatar.tsx +1 -1
- package/src/components/avatar/__test__/avatar.test.tsx +7 -4
- package/src/components/avatar/index.tsx +1 -1
- package/src/components/badge/Badge.tsx +16 -11
- package/src/components/banner/Banner.tsx +206 -195
- package/src/components/banner/__test__/banner.test.tsx +11 -9
- package/src/components/banner/index.tsx +1 -1
- package/src/components/buttons/ButtonExtendedOutline.tsx +80 -80
- package/src/components/buttons/ButtonOutline.tsx +278 -280
- package/src/components/buttons/ButtonSolid.tsx +142 -141
- package/src/components/buttons/IconButtonContained.tsx +17 -17
- package/src/components/buttons/IconButtonSolid.tsx +11 -11
- package/src/components/contentWrapper/ContentWrapper.tsx +12 -12
- package/src/components/contentWrapper/index.tsx +1 -1
- package/src/components/divider/index.tsx +1 -1
- package/src/components/icons/index.tsx +1 -1
- package/src/components/listitems/ListItemAction.tsx +120 -119
- package/src/components/listitems/ListItemIDP.tsx +115 -115
- package/src/components/listitems/ListItemNavAlert.tsx +114 -110
- package/src/components/listitems/ListItemTransaction.tsx +2 -6
- package/src/components/listitems/PressableListItemsBase.tsx +29 -29
- package/src/components/listitems/__test__/listitem.test.tsx +53 -15
- package/src/components/listitems/hooks/useListItemSpringAnimation.ts +54 -52
- package/src/components/pictograms/Pictogram.tsx +6 -3
- package/src/components/pictograms/svg/PictogramFocusOn.tsx +39 -0
- package/src/components/pictograms/svg/originals/PictogramFocusOn.svg +19 -0
- package/src/components/spacer/Spacer.tsx +21 -18
- package/src/components/spacer/index.tsx +1 -1
- package/src/components/typography/Body.tsx +10 -10
- package/src/components/typography/Factory.tsx +38 -38
- package/src/components/typography/H1.tsx +19 -19
- package/src/components/typography/H2.tsx +19 -19
- package/src/components/typography/H4.tsx +12 -12
- package/src/components/typography/H5.tsx +24 -24
- package/src/components/typography/H6.tsx +10 -10
- package/src/components/typography/Label.tsx +16 -16
- package/src/components/typography/LabelSmall.tsx +27 -28
- package/src/components/typography/Monospace.tsx +14 -14
- package/src/components/typography/common.tsx +20 -20
- package/src/components/typography/index.tsx +0 -1
- package/src/index.tsx +0 -1
- package/src/json-import.d.ts +3 -4
- package/src/utils/dates.ts +1 -1
- package/src/utils/image.ts +22 -22
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import React, { useCallback } from "react";
|
|
2
|
-
import {
|
|
3
|
-
GestureResponderEvent,
|
|
4
|
-
Pressable,
|
|
5
|
-
StyleSheet
|
|
6
|
-
} from "react-native";
|
|
2
|
+
import { GestureResponderEvent, Pressable, StyleSheet } from "react-native";
|
|
7
3
|
import Animated, {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
Extrapolate,
|
|
5
|
+
interpolate,
|
|
6
|
+
interpolateColor,
|
|
7
|
+
useAnimatedStyle,
|
|
8
|
+
useDerivedValue,
|
|
9
|
+
useSharedValue,
|
|
10
|
+
withSpring
|
|
15
11
|
} from "react-native-reanimated";
|
|
16
12
|
import { IOScaleValues, IOSpringValues } from "../../core/IOAnimations";
|
|
17
13
|
import { IOColors } from "../../core/IOColors";
|
|
@@ -24,68 +20,72 @@ import { BaseTypography } from "../typography/BaseTypography";
|
|
|
24
20
|
type ButtonSolidColor = "primary" | "danger" | "contrast";
|
|
25
21
|
|
|
26
22
|
type ColorStates = {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
default: string;
|
|
24
|
+
pressed: string;
|
|
25
|
+
label: {
|
|
26
|
+
default: IOColors;
|
|
27
|
+
disabled: IOColors;
|
|
28
|
+
};
|
|
33
29
|
};
|
|
34
30
|
|
|
35
31
|
const colorPrimaryButtonDisabled: IOColors = "grey-200";
|
|
36
32
|
const DISABLED_OPACITY = 0.5;
|
|
37
33
|
|
|
38
34
|
const styles = StyleSheet.create({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
backgroundDisabled: {
|
|
36
|
+
backgroundColor: IOColors[colorPrimaryButtonDisabled],
|
|
37
|
+
opacity: DISABLED_OPACITY
|
|
38
|
+
}
|
|
43
39
|
});
|
|
44
40
|
|
|
45
41
|
export type ButtonSolidProps = WithTestID<{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
color?: ButtonSolidColor;
|
|
43
|
+
label: string;
|
|
44
|
+
small?: boolean;
|
|
45
|
+
fullWidth?: boolean;
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
icon?: IOIcons;
|
|
48
|
+
iconPosition?: "start" | "end";
|
|
49
|
+
accessibilityLabel: string;
|
|
50
|
+
accessibilityHint?: string;
|
|
51
|
+
onPress: (event: GestureResponderEvent) => void;
|
|
56
52
|
}>;
|
|
57
53
|
|
|
58
|
-
const mapColorStates: Record<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
contrast: {
|
|
79
|
-
default: IOColors.white,
|
|
80
|
-
pressed: IOColors["blueIO-50"],
|
|
81
|
-
label: {
|
|
82
|
-
default: "blueIO-500",
|
|
83
|
-
disabled: "grey-700"
|
|
84
|
-
}
|
|
54
|
+
const mapColorStates: Record<
|
|
55
|
+
NonNullable<ButtonSolidProps["color"]>,
|
|
56
|
+
ColorStates
|
|
57
|
+
> = {
|
|
58
|
+
// Primary button
|
|
59
|
+
primary: {
|
|
60
|
+
default: IOColors["blueIO-500"],
|
|
61
|
+
pressed: IOColors["blueIO-600"],
|
|
62
|
+
label: {
|
|
63
|
+
default: "white",
|
|
64
|
+
disabled: "grey-700"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
// Danger button
|
|
68
|
+
danger: {
|
|
69
|
+
default: IOColors["error-850"],
|
|
70
|
+
pressed: IOColors["error-600"],
|
|
71
|
+
label: {
|
|
72
|
+
default: "white",
|
|
73
|
+
disabled: "grey-700"
|
|
85
74
|
}
|
|
75
|
+
},
|
|
76
|
+
// Contrast button
|
|
77
|
+
contrast: {
|
|
78
|
+
default: IOColors.white,
|
|
79
|
+
pressed: IOColors["blueIO-50"],
|
|
80
|
+
label: {
|
|
81
|
+
default: "blueIO-500",
|
|
82
|
+
disabled: "grey-700"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
86
85
|
};
|
|
87
86
|
|
|
88
|
-
export const ButtonSolid = React.memo(
|
|
87
|
+
export const ButtonSolid = React.memo(
|
|
88
|
+
({
|
|
89
89
|
color = "primary",
|
|
90
90
|
label,
|
|
91
91
|
small = false,
|
|
@@ -97,7 +97,7 @@ export const ButtonSolid = React.memo(({
|
|
|
97
97
|
accessibilityLabel,
|
|
98
98
|
accessibilityHint,
|
|
99
99
|
testID
|
|
100
|
-
}: ButtonSolidProps) => {
|
|
100
|
+
}: ButtonSolidProps) => {
|
|
101
101
|
const isPressed = useSharedValue(0);
|
|
102
102
|
|
|
103
103
|
// Scaling transformation applied when the button is pressed
|
|
@@ -105,110 +105,111 @@ export const ButtonSolid = React.memo(({
|
|
|
105
105
|
|
|
106
106
|
// Using a spring-based animation for our interpolations
|
|
107
107
|
const progressPressed = useDerivedValue(() =>
|
|
108
|
-
|
|
108
|
+
withSpring(isPressed.value, IOSpringValues.button)
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
// Interpolate animation values from `isPressed` values
|
|
112
112
|
const pressedAnimationStyle = useAnimatedStyle(() => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
// Link color states to the pressed states
|
|
114
|
+
const bgColor = interpolateColor(
|
|
115
|
+
progressPressed.value,
|
|
116
|
+
[0, 1],
|
|
117
|
+
[mapColorStates[color].default, mapColorStates[color].pressed]
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
// Scale down button slightly when pressed
|
|
121
|
+
const scale = interpolate(
|
|
122
|
+
progressPressed.value,
|
|
123
|
+
[0, 1],
|
|
124
|
+
[1, animationScaleValue],
|
|
125
|
+
Extrapolate.CLAMP
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
backgroundColor: bgColor,
|
|
130
|
+
transform: [{ scale }]
|
|
131
|
+
};
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
const onPressIn = useCallback(() => {
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
// eslint-disable-next-line functional/immutable-data
|
|
136
|
+
isPressed.value = 1;
|
|
137
137
|
}, [isPressed]);
|
|
138
138
|
const onPressOut = useCallback(() => {
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
// eslint-disable-next-line functional/immutable-data
|
|
140
|
+
isPressed.value = 0;
|
|
141
141
|
}, [isPressed]);
|
|
142
142
|
|
|
143
143
|
// Label & Icons colors
|
|
144
144
|
const foregroundColor: IOColors = disabled
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
? mapColorStates[color]?.label?.disabled
|
|
146
|
+
: mapColorStates[color]?.label?.default;
|
|
147
147
|
|
|
148
148
|
// Icon size
|
|
149
149
|
const iconSize = small ? 16 : 20;
|
|
150
150
|
|
|
151
151
|
const Button = () => (
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
152
|
+
<Pressable
|
|
153
|
+
accessibilityLabel={accessibilityLabel}
|
|
154
|
+
accessibilityHint={accessibilityHint}
|
|
155
|
+
accessibilityRole={"button"}
|
|
156
|
+
testID={testID}
|
|
157
|
+
onPress={onPress}
|
|
158
|
+
onPressIn={onPressIn}
|
|
159
|
+
onPressOut={onPressOut}
|
|
160
|
+
accessible={true}
|
|
161
|
+
disabled={disabled}
|
|
162
|
+
style={!fullWidth ? IOButtonStyles.dimensionsDefault : {}}
|
|
163
|
+
>
|
|
164
|
+
<Animated.View
|
|
165
|
+
style={[
|
|
166
|
+
IOButtonStyles.button,
|
|
167
|
+
iconPosition === "end" && { flexDirection: "row-reverse" },
|
|
168
|
+
small
|
|
169
|
+
? IOButtonStyles.buttonSizeSmall
|
|
170
|
+
: IOButtonStyles.buttonSizeDefault,
|
|
171
|
+
disabled
|
|
172
|
+
? styles.backgroundDisabled
|
|
173
|
+
: { backgroundColor: mapColorStates[color]?.default },
|
|
174
|
+
/* Prevent Reanimated from overriding background colors
|
|
175
175
|
if button is disabled */
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
176
|
+
!disabled && pressedAnimationStyle
|
|
177
|
+
]}
|
|
178
|
+
>
|
|
179
|
+
{icon && (
|
|
180
|
+
<>
|
|
181
|
+
{/* If 'iconPosition' is set to 'end', we use
|
|
182
182
|
reverse flex property to invert the position */}
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
<Icon name={icon} size={iconSize} color={foregroundColor} />
|
|
184
|
+
{/* Once we have support for 'gap' property,
|
|
185
185
|
we can get rid of that spacer */}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
<HSpacer size={8} />
|
|
187
|
+
</>
|
|
188
|
+
)}
|
|
189
|
+
<BaseTypography
|
|
190
|
+
font="ReadexPro"
|
|
191
|
+
weight={"Regular"}
|
|
192
|
+
color={foregroundColor}
|
|
193
|
+
style={[
|
|
194
|
+
IOButtonStyles.label,
|
|
195
|
+
small
|
|
196
|
+
? IOButtonStyles.labelSizeSmall
|
|
197
|
+
: IOButtonStyles.labelSizeDefault
|
|
198
|
+
]}
|
|
199
|
+
numberOfLines={1}
|
|
200
|
+
ellipsizeMode="tail"
|
|
201
|
+
/* A11y-related props:
|
|
202
202
|
DON'T UNCOMMENT THEM */
|
|
203
|
-
|
|
203
|
+
/* allowFontScaling
|
|
204
204
|
maxFontSizeMultiplier={1.3} */
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
205
|
+
>
|
|
206
|
+
{label}
|
|
207
|
+
</BaseTypography>
|
|
208
|
+
</Animated.View>
|
|
209
|
+
</Pressable>
|
|
210
210
|
);
|
|
211
211
|
return <Button />;
|
|
212
|
-
}
|
|
212
|
+
}
|
|
213
|
+
);
|
|
213
214
|
|
|
214
215
|
export default ButtonSolid;
|
|
@@ -2,28 +2,28 @@ import * as React from "react";
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { GestureResponderEvent, Pressable } from "react-native";
|
|
4
4
|
import Animated, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
Extrapolate,
|
|
6
|
+
interpolate,
|
|
7
|
+
interpolateColor,
|
|
8
|
+
useAnimatedProps,
|
|
9
|
+
useAnimatedStyle,
|
|
10
|
+
useDerivedValue,
|
|
11
|
+
useSharedValue,
|
|
12
|
+
withSpring
|
|
13
13
|
} from "react-native-reanimated";
|
|
14
14
|
import { WithTestID } from "src/utils/types";
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
AnimatedIcon,
|
|
17
|
+
IOIcons,
|
|
18
|
+
IconClassComponent
|
|
19
19
|
} from "../../components/icons";
|
|
20
20
|
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
IOButtonStyles,
|
|
22
|
+
IOColors,
|
|
23
|
+
IOIconButtonStyles,
|
|
24
|
+
IOScaleValues,
|
|
25
|
+
IOSpringValues,
|
|
26
|
+
hexToRgba
|
|
27
27
|
} from "../../core";
|
|
28
28
|
|
|
29
29
|
export type IconButtonContained = WithTestID<{
|
|
@@ -2,19 +2,19 @@ import * as React from "react";
|
|
|
2
2
|
import { useCallback } from "react";
|
|
3
3
|
import { GestureResponderEvent, Pressable } from "react-native";
|
|
4
4
|
import Animated, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
Extrapolate,
|
|
6
|
+
interpolate,
|
|
7
|
+
interpolateColor,
|
|
8
|
+
useAnimatedStyle,
|
|
9
|
+
useDerivedValue,
|
|
10
|
+
useSharedValue,
|
|
11
|
+
withSpring
|
|
12
12
|
} from "react-native-reanimated";
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
IOButtonStyles,
|
|
15
|
+
IOIconButtonStyles,
|
|
16
|
+
IOScaleValues,
|
|
17
|
+
IOSpringValues
|
|
18
18
|
} from "../../core";
|
|
19
19
|
import { IOColors, hexToRgba } from "../../core/IOColors";
|
|
20
20
|
import { WithTestID } from "../../utils/types";
|
|
@@ -4,8 +4,8 @@ import type { IOAppMargin } from "../../core";
|
|
|
4
4
|
import { IOVisualCostants } from "../../core/IOStyles";
|
|
5
5
|
|
|
6
6
|
type IOContentWrapperProps = {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
margin?: IOAppMargin;
|
|
8
|
+
children: React.ReactNode;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -14,14 +14,14 @@ depending on the size value
|
|
|
14
14
|
@param {IOContentWrapper} margin
|
|
15
15
|
*/
|
|
16
16
|
export const ContentWrapper = ({
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
margin = IOVisualCostants.appMarginDefault,
|
|
18
|
+
children
|
|
19
19
|
}: IOContentWrapperProps) => (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
);
|
|
20
|
+
<View
|
|
21
|
+
style={{
|
|
22
|
+
paddingHorizontal: margin
|
|
23
|
+
}}
|
|
24
|
+
>
|
|
25
|
+
{children}
|
|
26
|
+
</View>
|
|
27
|
+
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./ContentWrapper";
|
|
1
|
+
export * from "./ContentWrapper";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Divider";
|
|
1
|
+
export * from "./Divider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./Icon";
|
|
1
|
+
export * from "./Icon";
|