@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.
Files changed (122) hide show
  1. package/lib/commonjs/components/accordion/AccordionItem.js +5 -1
  2. package/lib/commonjs/components/accordion/AccordionItem.js.map +1 -1
  3. package/lib/commonjs/components/banner/Banner.js +3 -1
  4. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  5. package/lib/commonjs/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
  6. package/lib/commonjs/components/checkbox/CheckboxLabel.js +2 -0
  7. package/lib/commonjs/components/checkbox/CheckboxLabel.js.map +1 -1
  8. package/lib/commonjs/components/featureInfo/FeatureInfo.js +4 -1
  9. package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
  10. package/lib/commonjs/components/listitems/ListItemCheckbox.js +3 -1
  11. package/lib/commonjs/components/listitems/ListItemCheckbox.js.map +1 -1
  12. package/lib/commonjs/components/listitems/ListItemHeader.js +1 -1
  13. package/lib/commonjs/components/listitems/ListItemHeader.js.map +1 -1
  14. package/lib/commonjs/components/listitems/ListItemInfo.js +1 -1
  15. package/lib/commonjs/components/listitems/ListItemInfo.js.map +1 -1
  16. package/lib/commonjs/components/listitems/ListItemRadio.js +1 -0
  17. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  18. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js +2 -0
  19. package/lib/commonjs/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  20. package/lib/commonjs/components/listitems/ListItemSwitch.js +1 -0
  21. package/lib/commonjs/components/listitems/ListItemSwitch.js.map +1 -1
  22. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
  23. package/lib/commonjs/components/modules/ModuleCheckout.js +3 -1
  24. package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
  25. package/lib/commonjs/components/progressLoader/ProgressLoader.js +3 -1
  26. package/lib/commonjs/components/progressLoader/ProgressLoader.js.map +1 -1
  27. package/lib/commonjs/components/radio/RadioButtonLabel.js +3 -1
  28. package/lib/commonjs/components/radio/RadioButtonLabel.js.map +1 -1
  29. package/lib/commonjs/components/tabs/TabItem.js +3 -0
  30. package/lib/commonjs/components/tabs/TabItem.js.map +1 -1
  31. package/lib/commonjs/components/tag/Tag.js.map +1 -1
  32. package/lib/commonjs/components/textInput/TextInputBase.js +9 -1
  33. package/lib/commonjs/components/textInput/TextInputBase.js.map +1 -1
  34. package/lib/commonjs/components/textInput/TextInputValidation.js +4 -1
  35. package/lib/commonjs/components/textInput/TextInputValidation.js.map +1 -1
  36. package/lib/commonjs/components/toast/ToastProvider.js +3 -0
  37. package/lib/commonjs/components/toast/ToastProvider.js.map +1 -1
  38. package/lib/commonjs/components/typography/BaseTypography.js.map +1 -1
  39. package/lib/module/components/accordion/AccordionItem.js +5 -1
  40. package/lib/module/components/accordion/AccordionItem.js.map +1 -1
  41. package/lib/module/components/banner/Banner.js +3 -1
  42. package/lib/module/components/banner/Banner.js.map +1 -1
  43. package/lib/module/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
  44. package/lib/module/components/checkbox/CheckboxLabel.js +2 -0
  45. package/lib/module/components/checkbox/CheckboxLabel.js.map +1 -1
  46. package/lib/module/components/featureInfo/FeatureInfo.js +4 -1
  47. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  48. package/lib/module/components/listitems/ListItemCheckbox.js +3 -1
  49. package/lib/module/components/listitems/ListItemCheckbox.js.map +1 -1
  50. package/lib/module/components/listitems/ListItemHeader.js +1 -1
  51. package/lib/module/components/listitems/ListItemHeader.js.map +1 -1
  52. package/lib/module/components/listitems/ListItemInfo.js +1 -1
  53. package/lib/module/components/listitems/ListItemInfo.js.map +1 -1
  54. package/lib/module/components/listitems/ListItemRadio.js +1 -0
  55. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  56. package/lib/module/components/listitems/ListItemRadioWithAmount.js +2 -0
  57. package/lib/module/components/listitems/ListItemRadioWithAmount.js.map +1 -1
  58. package/lib/module/components/listitems/ListItemSwitch.js +1 -0
  59. package/lib/module/components/listitems/ListItemSwitch.js.map +1 -1
  60. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
  61. package/lib/module/components/modules/ModuleCheckout.js +3 -1
  62. package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
  63. package/lib/module/components/progressLoader/ProgressLoader.js +3 -1
  64. package/lib/module/components/progressLoader/ProgressLoader.js.map +1 -1
  65. package/lib/module/components/radio/RadioButtonLabel.js +3 -1
  66. package/lib/module/components/radio/RadioButtonLabel.js.map +1 -1
  67. package/lib/module/components/tabs/TabItem.js +3 -0
  68. package/lib/module/components/tabs/TabItem.js.map +1 -1
  69. package/lib/module/components/tag/Tag.js.map +1 -1
  70. package/lib/module/components/textInput/TextInputBase.js +9 -1
  71. package/lib/module/components/textInput/TextInputBase.js.map +1 -1
  72. package/lib/module/components/textInput/TextInputValidation.js +5 -2
  73. package/lib/module/components/textInput/TextInputValidation.js.map +1 -1
  74. package/lib/module/components/toast/ToastProvider.js +4 -1
  75. package/lib/module/components/toast/ToastProvider.js.map +1 -1
  76. package/lib/module/components/typography/BaseTypography.js.map +1 -1
  77. package/lib/typescript/components/accordion/AccordionItem.d.ts +2 -1
  78. package/lib/typescript/components/accordion/AccordionItem.d.ts.map +1 -1
  79. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  80. package/lib/typescript/components/checkbox/CheckboxLabel.d.ts.map +1 -1
  81. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  82. package/lib/typescript/components/listitems/ListItemCheckbox.d.ts.map +1 -1
  83. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  84. package/lib/typescript/components/listitems/ListItemRadioWithAmount.d.ts.map +1 -1
  85. package/lib/typescript/components/listitems/ListItemSwitch.d.ts.map +1 -1
  86. package/lib/typescript/components/modules/ModuleCheckout.d.ts.map +1 -1
  87. package/lib/typescript/components/progressLoader/ProgressLoader.d.ts +2 -1
  88. package/lib/typescript/components/progressLoader/ProgressLoader.d.ts.map +1 -1
  89. package/lib/typescript/components/radio/RadioButtonLabel.d.ts.map +1 -1
  90. package/lib/typescript/components/tabs/TabItem.d.ts.map +1 -1
  91. package/lib/typescript/components/tag/Tag.d.ts +12 -9
  92. package/lib/typescript/components/tag/Tag.d.ts.map +1 -1
  93. package/lib/typescript/components/textInput/TextInputBase.d.ts.map +1 -1
  94. package/lib/typescript/components/textInput/TextInputValidation.d.ts +1 -1
  95. package/lib/typescript/components/textInput/TextInputValidation.d.ts.map +1 -1
  96. package/lib/typescript/components/toast/ToastProvider.d.ts.map +1 -1
  97. package/lib/typescript/components/typography/BaseTypography.d.ts.map +1 -1
  98. package/lib/typescript/components/typography/Label.d.ts +1 -1
  99. package/lib/typescript/components/typography/Label.d.ts.map +1 -1
  100. package/package.json +1 -1
  101. package/src/components/accordion/AccordionItem.tsx +13 -2
  102. package/src/components/banner/Banner.tsx +5 -1
  103. package/src/components/banner/__test__/__snapshots__/banner.test.tsx.snap +4 -0
  104. package/src/components/checkbox/CheckboxLabel.tsx +2 -0
  105. package/src/components/featureInfo/FeatureInfo.tsx +7 -1
  106. package/src/components/listitems/ListItemCheckbox.tsx +5 -1
  107. package/src/components/listitems/ListItemHeader.tsx +3 -3
  108. package/src/components/listitems/ListItemInfo.tsx +3 -3
  109. package/src/components/listitems/ListItemRadio.tsx +1 -0
  110. package/src/components/listitems/ListItemRadioWithAmount.tsx +6 -1
  111. package/src/components/listitems/ListItemSwitch.tsx +1 -0
  112. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +8 -0
  113. package/src/components/modules/ModuleCheckout.tsx +5 -1
  114. package/src/components/progressLoader/ProgressLoader.tsx +3 -0
  115. package/src/components/radio/RadioButtonLabel.tsx +5 -1
  116. package/src/components/tabs/TabItem.tsx +1 -0
  117. package/src/components/tag/Tag.tsx +29 -22
  118. package/src/components/textInput/TextInputBase.tsx +9 -0
  119. package/src/components/textInput/TextInputValidation.tsx +6 -3
  120. package/src/components/toast/ToastProvider.tsx +10 -1
  121. package/src/components/typography/BaseTypography.tsx +1 -0
  122. 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 pointerEvents="none">
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} />
@@ -235,6 +235,7 @@ const TabItem = ({
235
235
  accessibilityLabel={accessibilityLabel}
236
236
  accessibilityHint={accessibilityHint}
237
237
  accessibilityRole={"button"}
238
+ accessibilityState={{ selected }}
238
239
  testID={testID}
239
240
  onPress={onPress}
240
241
  onPressIn={onPressIn}
@@ -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
- export type Tag = WithTestID<
15
+ type VariantProps = {
16
+ iconColor: IOColors;
17
+ iconName: IOIcons;
18
+ };
19
+
20
+ type TextProps =
16
21
  | {
17
- text?: string;
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?: string;
32
- variant: "customIcon";
33
- customIconProps: VariantProps;
34
- iconAccessibilityLabel?: string;
35
- }
36
- >;
26
+ text?: never;
27
+ iconAccessibilityLabel: string;
28
+ };
37
29
 
38
- type VariantProps = {
39
- iconColor: IOColors;
40
- iconName: IOIcons;
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?: string;
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 { SafeAreaView, StyleSheet, View } from "react-native";
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<