@pagopa/io-app-design-system 1.30.0 → 1.31.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.
- package/lib/commonjs/components/avatar/Avatar.js +2 -0
- package/lib/commonjs/components/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
- package/lib/commonjs/components/buttons/ButtonSolid.js +4 -2
- package/lib/commonjs/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/commonjs/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js +3 -2
- package/lib/commonjs/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js +11 -7
- package/lib/commonjs/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/commonjs/components/checkbox/CheckboxLabel.js +5 -0
- package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/commonjs/components/image/Image.js +3 -1
- package/lib/commonjs/components/image/Image.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemNav.js +2 -1
- package/lib/commonjs/components/listitems/ListItemNav.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +6 -0
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
- package/lib/commonjs/components/logos/LogoPaymentCard.js +7 -2
- package/lib/commonjs/components/logos/LogoPaymentCard.js.map +1 -1
- package/lib/commonjs/components/modules/ModuleIDP.js +1 -0
- package/lib/commonjs/components/modules/ModuleIDP.js.map +1 -1
- package/lib/commonjs/components/radio/AnimatedRadio.js +1 -0
- package/lib/commonjs/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js +8 -3
- package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/commonjs/components/switch/AnimatedSwitch.js +3 -2
- package/lib/commonjs/components/switch/AnimatedSwitch.js.map +1 -1
- package/lib/commonjs/components/switch/SwitchLabel.js +7 -2
- package/lib/commonjs/components/switch/SwitchLabel.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +13 -10
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/core/IOStyles.js +1 -1
- package/lib/commonjs/core/IOStyles.js.map +1 -1
- package/lib/module/components/avatar/Avatar.js +2 -0
- package/lib/module/components/avatar/Avatar.js.map +1 -1
- package/lib/module/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
- package/lib/module/components/buttons/ButtonSolid.js +4 -2
- package/lib/module/components/buttons/ButtonSolid.js.map +1 -1
- package/lib/module/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
- package/lib/module/components/checkbox/AnimatedCheckbox.js +3 -2
- package/lib/module/components/checkbox/AnimatedCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js +11 -7
- package/lib/module/components/checkbox/AnimatedMessageCheckbox.js.map +1 -1
- package/lib/module/components/checkbox/CheckboxLabel.js +5 -0
- package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/module/components/image/Image.js +3 -1
- package/lib/module/components/image/Image.js.map +1 -1
- package/lib/module/components/listitems/ListItemNav.js +2 -1
- package/lib/module/components/listitems/ListItemNav.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +6 -0
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
- package/lib/module/components/logos/LogoPaymentCard.js +9 -4
- package/lib/module/components/logos/LogoPaymentCard.js.map +1 -1
- package/lib/module/components/modules/ModuleIDP.js +1 -0
- package/lib/module/components/modules/ModuleIDP.js.map +1 -1
- package/lib/module/components/radio/AnimatedRadio.js +1 -0
- package/lib/module/components/radio/AnimatedRadio.js.map +1 -1
- package/lib/module/components/radio/RadioButtonLabel.js +8 -3
- package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/module/components/switch/AnimatedSwitch.js +5 -4
- package/lib/module/components/switch/AnimatedSwitch.js.map +1 -1
- package/lib/module/components/switch/SwitchLabel.js +7 -2
- package/lib/module/components/switch/SwitchLabel.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +14 -11
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/core/IOStyles.js +1 -1
- package/lib/module/core/IOStyles.js.map +1 -1
- package/lib/typescript/components/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/components/buttons/ButtonSolid.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/AnimatedMessageCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
- package/lib/typescript/components/image/Image.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemNav.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts +5 -3
- package/lib/typescript/components/logos/LogoPaymentCard.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleIDP.d.ts.map +1 -1
- package/lib/typescript/components/radio/AnimatedRadio.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
- package/lib/typescript/components/switch/AnimatedSwitch.d.ts.map +1 -1
- package/lib/typescript/components/switch/SwitchLabel.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/components/avatar/Avatar.tsx +2 -0
- package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
- package/src/components/buttons/ButtonSolid.tsx +3 -1
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +0 -2
- package/src/components/checkbox/AnimatedCheckbox.tsx +2 -1
- package/src/components/checkbox/AnimatedMessageCheckbox.tsx +9 -7
- package/src/components/checkbox/CheckboxLabel.tsx +5 -0
- package/src/components/image/Image.tsx +6 -1
- package/src/components/listitems/ListItemNav.tsx +2 -1
- package/src/components/listitems/ListItemRadio.tsx +10 -1
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +6 -4
- package/src/components/logos/LogoPaymentCard.tsx +15 -6
- package/src/components/modules/ModuleIDP.tsx +5 -1
- package/src/components/radio/AnimatedRadio.tsx +1 -0
- package/src/components/radio/RadioButtonLabel.tsx +7 -2
- package/src/components/switch/AnimatedSwitch.tsx +9 -8
- package/src/components/switch/SwitchLabel.tsx +6 -1
- package/src/components/textInput/TextInputBase.tsx +16 -13
- package/src/core/IOStyles.ts +1 -1
|
@@ -49,13 +49,18 @@ export const RadioButtonLabel = ({
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Pressable
|
|
52
|
-
|
|
52
|
+
accessibilityRole="radio"
|
|
53
|
+
accessibilityState={{
|
|
54
|
+
checked: checked ?? toggleValue,
|
|
55
|
+
disabled: !!disabled
|
|
56
|
+
}}
|
|
53
57
|
onPress={toggleRadioButton}
|
|
54
|
-
testID="AnimatedRadioButton"
|
|
55
58
|
style={{
|
|
56
59
|
alignSelf: "flex-start",
|
|
57
60
|
opacity: disabled ? DISABLED_OPACITY : 1
|
|
58
61
|
}}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
testID="AnimatedRadioButton"
|
|
59
64
|
>
|
|
60
65
|
<View
|
|
61
66
|
style={[
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { useEffect } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Pressable, PressableProps, StyleSheet } from "react-native";
|
|
3
3
|
import Animated, {
|
|
4
|
-
|
|
5
|
-
useAnimatedStyle,
|
|
4
|
+
Easing,
|
|
6
5
|
interpolate,
|
|
6
|
+
interpolateColor,
|
|
7
|
+
useAnimatedStyle,
|
|
8
|
+
useSharedValue,
|
|
7
9
|
withSpring,
|
|
8
|
-
withTiming
|
|
9
|
-
Easing,
|
|
10
|
-
interpolateColor
|
|
10
|
+
withTiming
|
|
11
11
|
} from "react-native-reanimated";
|
|
12
|
-
import { IOColors } from "../../core/IOColors";
|
|
13
12
|
import { IOSpringValues } from "../../core/IOAnimations";
|
|
14
|
-
import {
|
|
13
|
+
import { IOColors } from "../../core/IOColors";
|
|
15
14
|
import { IOSwitchVisualParams } from "../../core/IOStyles";
|
|
15
|
+
import { AnimatedTick } from "../common/AnimatedTick";
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
18
18
|
checked?: boolean;
|
|
@@ -106,6 +106,7 @@ export const AnimatedSwitch = ({ checked, onPress, disabled }: OwnProps) => {
|
|
|
106
106
|
|
|
107
107
|
return (
|
|
108
108
|
<Pressable
|
|
109
|
+
accessibilityRole="switch"
|
|
109
110
|
disabled={disabled}
|
|
110
111
|
testID="AnimatedSwitch"
|
|
111
112
|
onPress={onPress}
|
|
@@ -78,11 +78,16 @@ export const SwitchLabel = ({
|
|
|
78
78
|
<Pressable
|
|
79
79
|
disabled={disabled}
|
|
80
80
|
onPress={toggleCheckbox}
|
|
81
|
-
|
|
81
|
+
accessibilityRole="switch"
|
|
82
|
+
accessibilityState={{
|
|
83
|
+
checked: checked ?? toggleValue,
|
|
84
|
+
disabled: !!disabled
|
|
85
|
+
}}
|
|
82
86
|
style={{
|
|
83
87
|
alignSelf: "flex-start",
|
|
84
88
|
opacity: disabled ? DISABLED_OPACITY : 1
|
|
85
89
|
}}
|
|
90
|
+
testID="SwitchLabel"
|
|
86
91
|
>
|
|
87
92
|
<View
|
|
88
93
|
style={[
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
} from "react-native";
|
|
10
10
|
import Animated, {
|
|
11
11
|
Easing,
|
|
12
|
+
WithTimingConfig,
|
|
12
13
|
useAnimatedStyle,
|
|
13
14
|
useSharedValue,
|
|
14
15
|
withTiming
|
|
@@ -17,7 +18,8 @@ import {
|
|
|
17
18
|
IOColors,
|
|
18
19
|
IOSpacingScale,
|
|
19
20
|
IOStyles,
|
|
20
|
-
useIOExperimentalDesign
|
|
21
|
+
useIOExperimentalDesign,
|
|
22
|
+
useIOTheme
|
|
21
23
|
} from "../../core";
|
|
22
24
|
import { makeFontStyleObject } from "../../utils/fonts";
|
|
23
25
|
import { RNTextInputProps, getInputPropsByType } from "../../utils/textInput";
|
|
@@ -161,6 +163,8 @@ export const TextInputBase = ({
|
|
|
161
163
|
isPassword,
|
|
162
164
|
autoFocus
|
|
163
165
|
}: InputTextProps) => {
|
|
166
|
+
const theme = useIOTheme();
|
|
167
|
+
|
|
164
168
|
const labelSharedValue = useSharedValue<boolean>(false);
|
|
165
169
|
const [inputStatus, setInputStatus] = React.useState<InputStatus>(
|
|
166
170
|
disabled ? "disabled" : "initial"
|
|
@@ -177,7 +181,7 @@ export const TextInputBase = ({
|
|
|
177
181
|
const boxStyle: ViewStyle = useMemo(() => {
|
|
178
182
|
if (inputStatus === "focused") {
|
|
179
183
|
return {
|
|
180
|
-
borderColor: IOColors["
|
|
184
|
+
borderColor: IOColors[theme["interactiveElem-default"]],
|
|
181
185
|
borderWidth: 2
|
|
182
186
|
};
|
|
183
187
|
}
|
|
@@ -191,20 +195,17 @@ export const TextInputBase = ({
|
|
|
191
195
|
borderColor: IOColors["grey-200"],
|
|
192
196
|
borderWidth: 1
|
|
193
197
|
};
|
|
194
|
-
}, [inputStatus]);
|
|
198
|
+
}, [inputStatus, theme]);
|
|
199
|
+
|
|
200
|
+
const easingConf: WithTimingConfig = {
|
|
201
|
+
duration: 300,
|
|
202
|
+
easing: Easing.elastic(0.85)
|
|
203
|
+
};
|
|
195
204
|
|
|
196
205
|
const animatedLabelProps = useAnimatedStyle(() => ({
|
|
197
|
-
fontSize: withTiming(labelSharedValue.value ? 12 : 16,
|
|
198
|
-
duration: 300,
|
|
199
|
-
easing: Easing.elastic(0.85)
|
|
200
|
-
}),
|
|
206
|
+
fontSize: withTiming(labelSharedValue.value ? 12 : 16, easingConf),
|
|
201
207
|
transform: [
|
|
202
|
-
{
|
|
203
|
-
translateY: withTiming(labelSharedValue.value ? -14 : 0, {
|
|
204
|
-
duration: 300,
|
|
205
|
-
easing: Easing.elastic(0.85)
|
|
206
|
-
})
|
|
207
|
-
}
|
|
208
|
+
{ translateY: withTiming(labelSharedValue.value ? -14 : 0, easingConf) }
|
|
208
209
|
]
|
|
209
210
|
}));
|
|
210
211
|
|
|
@@ -294,6 +295,8 @@ export const TextInputBase = ({
|
|
|
294
295
|
labelSharedValue.value = true;
|
|
295
296
|
onFocus?.();
|
|
296
297
|
}}
|
|
298
|
+
selectionColor={IOColors[theme["interactiveElem-default"]]} // Caret iOS
|
|
299
|
+
cursorColor={IOColors[theme["interactiveElem-default"]]} // Caret Android
|
|
297
300
|
maxLength={counterLimit}
|
|
298
301
|
onBlur={onBlurHandler}
|
|
299
302
|
value={inputValue}
|
package/src/core/IOStyles.ts
CHANGED
|
@@ -370,7 +370,7 @@ export const IOSelectionListItemVisualParams: IOSelectionListItemVisualParams =
|
|
|
370
370
|
paddingHorizontal: IOVisualCostants.appMarginDefault,
|
|
371
371
|
iconMargin: 8,
|
|
372
372
|
iconSize: 24,
|
|
373
|
-
actionMargin:
|
|
373
|
+
actionMargin: 8,
|
|
374
374
|
descriptionMargin: 4
|
|
375
375
|
};
|
|
376
376
|
|