@pagopa/io-app-design-system 1.40.0 → 1.41.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/accordion/AccordionItem.js +5 -1
- package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/banner/Banner.js +3 -1
- package/lib/commonjs/components/banner/Banner.js.map +1 -1
- package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
- package/lib/commonjs/components/checkbox/CheckboxLabel.js +2 -0
- package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/commonjs/components/featureInfo/FeatureInfo.js +4 -1
- package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js +3 -1
- package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js +1 -1
- package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
- package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadio.js +1 -0
- package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -0
- package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -0
- package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
- package/lib/commonjs/components/modules/ModuleCheckout.js +3 -1
- package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/commonjs/components/progressLoader/ProgressLoader.js +3 -1
- package/lib/commonjs/components/progressLoader/ProgressLoader.js.map +1 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js +3 -1
- package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/commonjs/components/tabs/TabItem.js +3 -0
- package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
- package/lib/commonjs/components/tag/Tag.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputBase.js +9 -1
- package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
- package/lib/commonjs/components/textInput/TextInputValidation.js +4 -1
- package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/commonjs/components/toast/ToastProvider.js +3 -0
- package/lib/commonjs/components/toast/ToastProvider.js.map +1 -1
- package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
- package/lib/module/components/accordion/AccordionItem.js +5 -1
- package/lib/module/components/accordion/AccordionItem.js.map +1 -1
- package/lib/module/components/banner/Banner.js +3 -1
- package/lib/module/components/banner/Banner.js.map +1 -1
- package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
- package/lib/module/components/checkbox/CheckboxLabel.js +2 -0
- package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
- package/lib/module/components/featureInfo/FeatureInfo.js +4 -1
- package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemCheckbox.js +3 -1
- package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
- package/lib/module/components/listitems/ListItemHeader.js +1 -1
- package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
- package/lib/module/components/listitems/ListItemInfo.js +1 -1
- package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadio.js +1 -0
- package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
- package/lib/module/components/listitems/ListItemRadioWithAmount.js +2 -0
- package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
- package/lib/module/components/listitems/ListItemSwitch.js +1 -0
- package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
- package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
- package/lib/module/components/modules/ModuleCheckout.js +3 -1
- package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
- package/lib/module/components/progressLoader/ProgressLoader.js +3 -1
- package/lib/module/components/progressLoader/ProgressLoader.js.map +1 -1
- package/lib/module/components/radio/RadioButtonLabel.js +3 -1
- package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
- package/lib/module/components/tabs/TabItem.js +3 -0
- package/lib/module/components/tabs/TabItem.js.map +1 -1
- package/lib/module/components/tag/Tag.js.map +1 -1
- package/lib/module/components/textInput/TextInputBase.js +9 -1
- package/lib/module/components/textInput/TextInputBase.js.map +1 -1
- package/lib/module/components/textInput/TextInputValidation.js +5 -2
- package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
- package/lib/module/components/toast/ToastProvider.js +4 -1
- package/lib/module/components/toast/ToastProvider.js.map +1 -1
- package/lib/module/components/typography/BaseTypography.js.map +1 -1
- package/lib/typescript/components/accordion/AccordionItem.d.ts +2 -1
- package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -1
- package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
- package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
- package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
- package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
- package/lib/typescript/components/modules/ModuleCheckout.d.ts.map +1 -1
- package/lib/typescript/components/progressLoader/ProgressLoader.d.ts +2 -1
- package/lib/typescript/components/progressLoader/ProgressLoader.d.ts.map +1 -1
- package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
- package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
- package/lib/typescript/components/tag/Tag.d.ts +12 -9
- package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts +1 -1
- package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
- package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -1
- package/lib/typescript/components/typography/BaseTypography.d.ts.map +1 -1
- package/lib/typescript/components/typography/Label.d.ts +1 -1
- package/lib/typescript/components/typography/Label.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/accordion/AccordionItem.tsx +13 -2
- package/src/components/banner/Banner.tsx +5 -1
- package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
- package/src/components/checkbox/CheckboxLabel.tsx +2 -0
- package/src/components/featureInfo/FeatureInfo.tsx +7 -1
- package/src/components/listitems/ListItemCheckbox.tsx +5 -1
- package/src/components/listitems/ListItemHeader.tsx +3 -3
- package/src/components/listitems/ListItemInfo.tsx +3 -3
- package/src/components/listitems/ListItemRadio.tsx +1 -0
- package/src/components/listitems/ListItemRadioWithAmount.tsx +6 -1
- package/src/components/listitems/ListItemSwitch.tsx +1 -0
- package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
- package/src/components/modules/ModuleCheckout.tsx +5 -1
- package/src/components/progressLoader/ProgressLoader.tsx +3 -0
- package/src/components/radio/RadioButtonLabel.tsx +5 -1
- package/src/components/tabs/TabItem.tsx +1 -0
- package/src/components/tag/Tag.tsx +29 -22
- package/src/components/textInput/TextInputBase.tsx +9 -0
- package/src/components/textInput/TextInputValidation.tsx +6 -3
- package/src/components/toast/ToastProvider.tsx +10 -1
- package/src/components/typography/BaseTypography.tsx +1 -0
- package/src/components/typography/Label.tsx +1 -1
|
@@ -73,7 +73,11 @@ export const RadioButtonLabel = ({
|
|
|
73
73
|
{ alignItems: "flex-start", flexShrink: 1, width: "100%" }
|
|
74
74
|
]}
|
|
75
75
|
>
|
|
76
|
-
<View
|
|
76
|
+
<View
|
|
77
|
+
pointerEvents="none"
|
|
78
|
+
accessibilityElementsHidden
|
|
79
|
+
importantForAccessibility="no-hide-descendants"
|
|
80
|
+
>
|
|
77
81
|
<AnimatedRadio checked={checked ?? toggleValue} />
|
|
78
82
|
</View>
|
|
79
83
|
<HSpacer size={8} />
|
|
@@ -12,33 +12,40 @@ import { makeFontStyleObject } from "../../utils/fonts";
|
|
|
12
12
|
import { WithTestID } from "../../utils/types";
|
|
13
13
|
import { IOIconSizeScale, IOIcons, Icon } from "../icons";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type VariantProps = {
|
|
16
|
+
iconColor: IOColors;
|
|
17
|
+
iconName: IOIcons;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type TextProps =
|
|
16
21
|
| {
|
|
17
|
-
text
|
|
18
|
-
variant:
|
|
19
|
-
| "qrCode"
|
|
20
|
-
| "legalMessage"
|
|
21
|
-
| "info"
|
|
22
|
-
| "warning"
|
|
23
|
-
| "error"
|
|
24
|
-
| "success"
|
|
25
|
-
| "attachment"
|
|
26
|
-
| "noIcon";
|
|
22
|
+
text: string;
|
|
27
23
|
iconAccessibilityLabel?: string;
|
|
28
|
-
customIconProps?: never;
|
|
29
24
|
}
|
|
30
25
|
| {
|
|
31
|
-
text?:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
iconAccessibilityLabel?: string;
|
|
35
|
-
}
|
|
36
|
-
>;
|
|
26
|
+
text?: never;
|
|
27
|
+
iconAccessibilityLabel: string;
|
|
28
|
+
};
|
|
37
29
|
|
|
38
|
-
type
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
export type Tag = TextProps &
|
|
31
|
+
WithTestID<
|
|
32
|
+
| {
|
|
33
|
+
variant:
|
|
34
|
+
| "qrCode"
|
|
35
|
+
| "legalMessage"
|
|
36
|
+
| "info"
|
|
37
|
+
| "warning"
|
|
38
|
+
| "error"
|
|
39
|
+
| "success"
|
|
40
|
+
| "attachment"
|
|
41
|
+
| "noIcon";
|
|
42
|
+
customIconProps?: never;
|
|
43
|
+
}
|
|
44
|
+
| {
|
|
45
|
+
variant: "customIcon";
|
|
46
|
+
customIconProps: VariantProps;
|
|
47
|
+
}
|
|
48
|
+
>;
|
|
42
49
|
|
|
43
50
|
const IOTagIconMargin: IOSpacingScale = 6;
|
|
44
51
|
const IOTagIconSize: IOIconSizeScale = 16;
|
|
@@ -170,6 +170,11 @@ const HelperRow = ({
|
|
|
170
170
|
},
|
|
171
171
|
helperRowStyle
|
|
172
172
|
]}
|
|
173
|
+
// in case of error message the element should be ignored by VO or Talkback
|
|
174
|
+
accessibilityElementsHidden={bottomMessageColor === "error-600"}
|
|
175
|
+
importantForAccessibility={
|
|
176
|
+
bottomMessageColor === "error-600" ? "no-hide-descendants" : "auto"
|
|
177
|
+
}
|
|
173
178
|
>
|
|
174
179
|
{bottomMessage && (
|
|
175
180
|
<LabelSmall weight="Regular" color={bottomMessageColor}>
|
|
@@ -350,6 +355,8 @@ export const TextInputBase = ({
|
|
|
350
355
|
]}
|
|
351
356
|
accessible={false}
|
|
352
357
|
accessibilityRole={"none"}
|
|
358
|
+
accessibilityElementsHidden
|
|
359
|
+
importantForAccessibility="no"
|
|
353
360
|
>
|
|
354
361
|
{/* Fake border managed with Animated.View to avoid
|
|
355
362
|
little jumps when the border is animated */}
|
|
@@ -379,6 +386,8 @@ export const TextInputBase = ({
|
|
|
379
386
|
? derivedInputProps.textInputProps
|
|
380
387
|
: textInputProps)}
|
|
381
388
|
accessible
|
|
389
|
+
importantForAccessibility="yes"
|
|
390
|
+
accessibilityElementsHidden={false}
|
|
382
391
|
editable={!disabled}
|
|
383
392
|
secureTextEntry={isSecretInput}
|
|
384
393
|
disableFullscreenUI={true}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useCallback, useMemo, useState } from "react";
|
|
3
|
-
import { View } from "react-native";
|
|
3
|
+
import { AccessibilityInfo, View } from "react-native";
|
|
4
4
|
import Animated from "react-native-reanimated";
|
|
5
5
|
import { IOColors } from "../../core/IOColors";
|
|
6
6
|
import {
|
|
@@ -16,7 +16,7 @@ type TextInputValidationProps = Omit<
|
|
|
16
16
|
"rightElement" | "status" | "bottomMessageColor" | "isPassword"
|
|
17
17
|
> & {
|
|
18
18
|
onValidate: (value: string) => boolean;
|
|
19
|
-
errorMessage
|
|
19
|
+
errorMessage: string;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const feedbackIconSize: IOIconSizeScale = 24;
|
|
@@ -37,11 +37,14 @@ export const TextInputValidation = ({
|
|
|
37
37
|
setIsValid(validation);
|
|
38
38
|
if (!validation) {
|
|
39
39
|
triggerHaptic("notificationError");
|
|
40
|
+
AccessibilityInfo.announceForAccessibilityWithOptions(errorMessage, {
|
|
41
|
+
queue: true
|
|
42
|
+
});
|
|
40
43
|
} else {
|
|
41
44
|
triggerHaptic("notificationSuccess");
|
|
42
45
|
}
|
|
43
46
|
onBlur?.();
|
|
44
|
-
}, [onValidate, value, onBlur]);
|
|
47
|
+
}, [onValidate, value, onBlur, errorMessage]);
|
|
45
48
|
|
|
46
49
|
const onFocusHandler = useCallback(() => {
|
|
47
50
|
setIsValid(undefined);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { throttle } from "lodash";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
AccessibilityInfo,
|
|
5
|
+
SafeAreaView,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
View
|
|
8
|
+
} from "react-native";
|
|
4
9
|
import Animated, {
|
|
5
10
|
Easing,
|
|
6
11
|
SequencedTransition,
|
|
@@ -86,6 +91,10 @@ export const ToastProvider = ({ children }: ToastProviderProps) => {
|
|
|
86
91
|
triggerHaptic(toast.hapticFeedback);
|
|
87
92
|
}
|
|
88
93
|
|
|
94
|
+
AccessibilityInfo.announceForAccessibilityWithOptions(toast.message, {
|
|
95
|
+
queue: true
|
|
96
|
+
});
|
|
97
|
+
|
|
89
98
|
return id;
|
|
90
99
|
}, []);
|
|
91
100
|
|
|
@@ -49,6 +49,7 @@ export const BaseTypography = React.forwardRef<View, OwnProps>((props, ref) => {
|
|
|
49
49
|
calculateTextStyle(props.color, props.weight, props.isItalic, props.font),
|
|
50
50
|
[props.color, props.weight, props.isItalic, props.font]
|
|
51
51
|
);
|
|
52
|
+
|
|
52
53
|
const style = props.style
|
|
53
54
|
? [props.style, props.fontStyle, fontStyle]
|
|
54
55
|
: [props.fontStyle, fontStyle];
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
lineHeightMapping
|
|
17
17
|
} from "./common";
|
|
18
18
|
|
|
19
|
-
type PartialAllowedColors = Extract<IOColors, "black" | "white">;
|
|
19
|
+
type PartialAllowedColors = Extract<IOColors, "black" | "white" | "grey-700">;
|
|
20
20
|
type AllowedColors = PartialAllowedColors | IOColorsStatusForeground;
|
|
21
21
|
type AllowedWeight = Extract<IOFontWeight, "Bold" | "Regular" | "Semibold">;
|
|
22
22
|
type LabelProps = ExternalTypographyProps<
|