@pagopa/io-app-design-system 1.29.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/Advice/__test__/__snapshots__/advice.test.tsx.snap +24 -12
- 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/banner/__test__/__snapshots__/banner.test.tsx.snap +92 -18
- 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 +96 -50
- 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 +154 -68
- 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 +17 -12
- 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/Advice/__test__/__snapshots__/advice.test.tsx.snap +24 -12
- 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/banner/__test__/__snapshots__/banner.test.tsx.snap +92 -18
- 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 +96 -50
- 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 +154 -68
- 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 +18 -13
- 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 +2 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/components/Advice/__test__/__snapshots__/advice.test.tsx.snap +24 -12
- package/src/components/avatar/Avatar.tsx +2 -0
- package/src/components/avatar/__test__/__snapshots__/avatar.test.tsx.snap +4 -0
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +92 -18
- package/src/components/buttons/ButtonSolid.tsx +3 -1
- package/src/components/buttons/__test__/__snapshots__/button.test.tsx.snap +96 -50
- 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 +154 -68
- 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 +20 -14
- package/src/core/IOStyles.ts +1 -1
|
@@ -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";
|
|
@@ -45,6 +47,7 @@ type InputTextProps = WithTestID<{
|
|
|
45
47
|
isPassword?: boolean;
|
|
46
48
|
onBlur?: () => void;
|
|
47
49
|
onFocus?: () => void;
|
|
50
|
+
autoFocus?: boolean;
|
|
48
51
|
}>;
|
|
49
52
|
|
|
50
53
|
const inputMarginTop: IOSpacingScale = 8;
|
|
@@ -157,8 +160,11 @@ export const TextInputBase = ({
|
|
|
157
160
|
bottomMessageColor,
|
|
158
161
|
onBlur,
|
|
159
162
|
onFocus,
|
|
160
|
-
isPassword
|
|
163
|
+
isPassword,
|
|
164
|
+
autoFocus
|
|
161
165
|
}: InputTextProps) => {
|
|
166
|
+
const theme = useIOTheme();
|
|
167
|
+
|
|
162
168
|
const labelSharedValue = useSharedValue<boolean>(false);
|
|
163
169
|
const [inputStatus, setInputStatus] = React.useState<InputStatus>(
|
|
164
170
|
disabled ? "disabled" : "initial"
|
|
@@ -175,7 +181,7 @@ export const TextInputBase = ({
|
|
|
175
181
|
const boxStyle: ViewStyle = useMemo(() => {
|
|
176
182
|
if (inputStatus === "focused") {
|
|
177
183
|
return {
|
|
178
|
-
borderColor: IOColors["
|
|
184
|
+
borderColor: IOColors[theme["interactiveElem-default"]],
|
|
179
185
|
borderWidth: 2
|
|
180
186
|
};
|
|
181
187
|
}
|
|
@@ -189,20 +195,17 @@ export const TextInputBase = ({
|
|
|
189
195
|
borderColor: IOColors["grey-200"],
|
|
190
196
|
borderWidth: 1
|
|
191
197
|
};
|
|
192
|
-
}, [inputStatus]);
|
|
198
|
+
}, [inputStatus, theme]);
|
|
199
|
+
|
|
200
|
+
const easingConf: WithTimingConfig = {
|
|
201
|
+
duration: 300,
|
|
202
|
+
easing: Easing.elastic(0.85)
|
|
203
|
+
};
|
|
193
204
|
|
|
194
205
|
const animatedLabelProps = useAnimatedStyle(() => ({
|
|
195
|
-
fontSize: withTiming(labelSharedValue.value ? 12 : 16,
|
|
196
|
-
duration: 300,
|
|
197
|
-
easing: Easing.elastic(0.85)
|
|
198
|
-
}),
|
|
206
|
+
fontSize: withTiming(labelSharedValue.value ? 12 : 16, easingConf),
|
|
199
207
|
transform: [
|
|
200
|
-
{
|
|
201
|
-
translateY: withTiming(labelSharedValue.value ? -14 : 0, {
|
|
202
|
-
duration: 300,
|
|
203
|
-
easing: Easing.elastic(0.85)
|
|
204
|
-
})
|
|
205
|
-
}
|
|
208
|
+
{ translateY: withTiming(labelSharedValue.value ? -14 : 0, easingConf) }
|
|
206
209
|
]
|
|
207
210
|
}));
|
|
208
211
|
|
|
@@ -292,6 +295,8 @@ export const TextInputBase = ({
|
|
|
292
295
|
labelSharedValue.value = true;
|
|
293
296
|
onFocus?.();
|
|
294
297
|
}}
|
|
298
|
+
selectionColor={IOColors[theme["interactiveElem-default"]]} // Caret iOS
|
|
299
|
+
cursorColor={IOColors[theme["interactiveElem-default"]]} // Caret Android
|
|
295
300
|
maxLength={counterLimit}
|
|
296
301
|
onBlur={onBlurHandler}
|
|
297
302
|
value={inputValue}
|
|
@@ -302,6 +307,7 @@ export const TextInputBase = ({
|
|
|
302
307
|
? styles.textInputStyleFont
|
|
303
308
|
: styles.textInputStyleLegacyFont
|
|
304
309
|
]}
|
|
310
|
+
autoFocus={autoFocus}
|
|
305
311
|
/>
|
|
306
312
|
{/** Left value is due to the absolute position of the label in order to let it
|
|
307
313
|
* translate to top on focus
|
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
|
|