@pagopa/io-app-design-system 5.1.2 → 5.1.4

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/banner/Banner.js +3 -5
  2. package/lib/commonjs/components/banner/Banner.js.map +1 -1
  3. package/lib/commonjs/components/buttons/ButtonLink.js +2 -1
  4. package/lib/commonjs/components/buttons/ButtonLink.js.map +1 -1
  5. package/lib/commonjs/components/featureInfo/FeatureInfo.js +6 -1
  6. package/lib/commonjs/components/featureInfo/FeatureInfo.js.map +1 -1
  7. package/lib/commonjs/components/layout/HeaderFirstLevel.js +2 -1
  8. package/lib/commonjs/components/layout/HeaderFirstLevel.js.map +1 -1
  9. package/lib/commonjs/components/layout/HeaderSecondLevel.js +2 -1
  10. package/lib/commonjs/components/layout/HeaderSecondLevel.js.map +1 -1
  11. package/lib/commonjs/components/layout/ModalBSHeader.js +2 -1
  12. package/lib/commonjs/components/layout/ModalBSHeader.js.map +1 -1
  13. package/lib/commonjs/components/listitems/ListItemRadio.js +12 -3
  14. package/lib/commonjs/components/listitems/ListItemRadio.js.map +1 -1
  15. package/lib/commonjs/components/listitems/ListItemTransaction.js +12 -3
  16. package/lib/commonjs/components/listitems/ListItemTransaction.js.map +1 -1
  17. package/lib/commonjs/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +12 -2
  18. package/lib/commonjs/components/modules/ModuleAttachment.js +13 -2
  19. package/lib/commonjs/components/modules/ModuleAttachment.js.map +1 -1
  20. package/lib/commonjs/components/modules/ModuleCheckout.js +11 -2
  21. package/lib/commonjs/components/modules/ModuleCheckout.js.map +1 -1
  22. package/lib/commonjs/components/modules/ModuleCredential.js +11 -2
  23. package/lib/commonjs/components/modules/ModuleCredential.js.map +1 -1
  24. package/lib/commonjs/components/modules/ModuleNavigation.js +11 -2
  25. package/lib/commonjs/components/modules/ModuleNavigation.js.map +1 -1
  26. package/lib/commonjs/components/modules/ModulePaymentNotice.js +12 -2
  27. package/lib/commonjs/components/modules/ModulePaymentNotice.js.map +1 -1
  28. package/lib/commonjs/components/modules/ModuleStatic.js +7 -2
  29. package/lib/commonjs/components/modules/ModuleStatic.js.map +1 -1
  30. package/lib/commonjs/components/typography/Body.js +2 -1
  31. package/lib/commonjs/components/typography/Body.js.map +1 -1
  32. package/lib/commonjs/components/typography/BodySmall.js +2 -1
  33. package/lib/commonjs/components/typography/BodySmall.js.map +1 -1
  34. package/lib/commonjs/components/typography/IOText.js.map +1 -1
  35. package/lib/commonjs/components/typography/LabelMini.js +2 -1
  36. package/lib/commonjs/components/typography/LabelMini.js.map +1 -1
  37. package/lib/module/components/banner/Banner.js +3 -5
  38. package/lib/module/components/banner/Banner.js.map +1 -1
  39. package/lib/module/components/buttons/ButtonLink.js +2 -1
  40. package/lib/module/components/buttons/ButtonLink.js.map +1 -1
  41. package/lib/module/components/featureInfo/FeatureInfo.js +6 -1
  42. package/lib/module/components/featureInfo/FeatureInfo.js.map +1 -1
  43. package/lib/module/components/layout/HeaderFirstLevel.js +2 -1
  44. package/lib/module/components/layout/HeaderFirstLevel.js.map +1 -1
  45. package/lib/module/components/layout/HeaderSecondLevel.js +2 -1
  46. package/lib/module/components/layout/HeaderSecondLevel.js.map +1 -1
  47. package/lib/module/components/layout/ModalBSHeader.js +2 -1
  48. package/lib/module/components/layout/ModalBSHeader.js.map +1 -1
  49. package/lib/module/components/listitems/ListItemRadio.js +12 -3
  50. package/lib/module/components/listitems/ListItemRadio.js.map +1 -1
  51. package/lib/module/components/listitems/ListItemTransaction.js +12 -3
  52. package/lib/module/components/listitems/ListItemTransaction.js.map +1 -1
  53. package/lib/module/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +12 -2
  54. package/lib/module/components/modules/ModuleAttachment.js +13 -2
  55. package/lib/module/components/modules/ModuleAttachment.js.map +1 -1
  56. package/lib/module/components/modules/ModuleCheckout.js +11 -2
  57. package/lib/module/components/modules/ModuleCheckout.js.map +1 -1
  58. package/lib/module/components/modules/ModuleCredential.js +11 -2
  59. package/lib/module/components/modules/ModuleCredential.js.map +1 -1
  60. package/lib/module/components/modules/ModuleNavigation.js +11 -2
  61. package/lib/module/components/modules/ModuleNavigation.js.map +1 -1
  62. package/lib/module/components/modules/ModulePaymentNotice.js +12 -2
  63. package/lib/module/components/modules/ModulePaymentNotice.js.map +1 -1
  64. package/lib/module/components/modules/ModuleStatic.js +7 -2
  65. package/lib/module/components/modules/ModuleStatic.js.map +1 -1
  66. package/lib/module/components/typography/Body.js +2 -1
  67. package/lib/module/components/typography/Body.js.map +1 -1
  68. package/lib/module/components/typography/BodySmall.js +2 -1
  69. package/lib/module/components/typography/BodySmall.js.map +1 -1
  70. package/lib/module/components/typography/IOText.js.map +1 -1
  71. package/lib/module/components/typography/LabelMini.js +2 -1
  72. package/lib/module/components/typography/LabelMini.js.map +1 -1
  73. package/lib/typescript/components/banner/Banner.d.ts +3 -3
  74. package/lib/typescript/components/banner/Banner.d.ts.map +1 -1
  75. package/lib/typescript/components/buttons/ButtonLink.d.ts +3 -1
  76. package/lib/typescript/components/buttons/ButtonLink.d.ts.map +1 -1
  77. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts +2 -1
  78. package/lib/typescript/components/featureInfo/FeatureInfo.d.ts.map +1 -1
  79. package/lib/typescript/components/layout/HeaderFirstLevel.d.ts.map +1 -1
  80. package/lib/typescript/components/layout/HeaderSecondLevel.d.ts.map +1 -1
  81. package/lib/typescript/components/layout/ModalBSHeader.d.ts.map +1 -1
  82. package/lib/typescript/components/listitems/ListItemRadio.d.ts +2 -0
  83. package/lib/typescript/components/listitems/ListItemRadio.d.ts.map +1 -1
  84. package/lib/typescript/components/listitems/ListItemTransaction.d.ts +2 -1
  85. package/lib/typescript/components/listitems/ListItemTransaction.d.ts.map +1 -1
  86. package/lib/typescript/components/modules/ModuleAttachment.d.ts +3 -1
  87. package/lib/typescript/components/modules/ModuleAttachment.d.ts.map +1 -1
  88. package/lib/typescript/components/modules/ModuleCheckout.d.ts +1 -0
  89. package/lib/typescript/components/modules/ModuleCheckout.d.ts.map +1 -1
  90. package/lib/typescript/components/modules/ModuleCredential.d.ts +1 -0
  91. package/lib/typescript/components/modules/ModuleCredential.d.ts.map +1 -1
  92. package/lib/typescript/components/modules/ModuleNavigation.d.ts +1 -0
  93. package/lib/typescript/components/modules/ModuleNavigation.d.ts.map +1 -1
  94. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts +2 -1
  95. package/lib/typescript/components/modules/ModulePaymentNotice.d.ts.map +1 -1
  96. package/lib/typescript/components/modules/ModuleStatic.d.ts +3 -3
  97. package/lib/typescript/components/modules/ModuleStatic.d.ts.map +1 -1
  98. package/lib/typescript/components/typography/Body.d.ts.map +1 -1
  99. package/lib/typescript/components/typography/BodySmall.d.ts.map +1 -1
  100. package/lib/typescript/components/typography/IOText.d.ts +2 -1
  101. package/lib/typescript/components/typography/IOText.d.ts.map +1 -1
  102. package/lib/typescript/components/typography/LabelMini.d.ts.map +1 -1
  103. package/package.json +1 -1
  104. package/src/components/banner/Banner.tsx +4 -6
  105. package/src/components/buttons/ButtonLink.tsx +4 -1
  106. package/src/components/featureInfo/FeatureInfo.tsx +7 -1
  107. package/src/components/layout/HeaderFirstLevel.tsx +2 -1
  108. package/src/components/layout/HeaderSecondLevel.tsx +2 -1
  109. package/src/components/layout/ModalBSHeader.tsx +2 -1
  110. package/src/components/listitems/ListItemRadio.tsx +14 -3
  111. package/src/components/listitems/ListItemTransaction.tsx +16 -3
  112. package/src/components/listitems/__test__/__snapshots__/listitem.test.tsx.snap +12 -2
  113. package/src/components/modules/ModuleAttachment.tsx +14 -2
  114. package/src/components/modules/ModuleCheckout.tsx +12 -2
  115. package/src/components/modules/ModuleCredential.tsx +10 -2
  116. package/src/components/modules/ModuleNavigation.tsx +12 -2
  117. package/src/components/modules/ModulePaymentNotice.tsx +13 -2
  118. package/src/components/modules/ModuleStatic.tsx +13 -6
  119. package/src/components/typography/Body.tsx +8 -2
  120. package/src/components/typography/BodySmall.tsx +8 -2
  121. package/src/components/typography/IOText.tsx +2 -0
  122. package/src/components/typography/LabelMini.tsx +8 -2
@@ -1,5 +1,6 @@
1
1
  import React, { forwardRef } from "react";
2
2
  import {
3
+ AccessibilityRole,
3
4
  GestureResponderEvent,
4
5
  Pressable,
5
6
  TextStyle,
@@ -44,6 +45,7 @@ export type ButtonLinkProps = WithTestID<{
44
45
  iconPosition?: "start" | "end";
45
46
  // Accessibility
46
47
  accessibilityLabel?: string;
48
+ accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
47
49
  accessibilityHint?: string;
48
50
  numberOfLines?: number;
49
51
  textAlign?: TextStyle["textAlign"];
@@ -72,6 +74,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
72
74
  iconPosition = "start",
73
75
  onPress,
74
76
  accessibilityLabel,
77
+ accessibilityRole = "button",
75
78
  accessibilityHint,
76
79
  numberOfLines = 1,
77
80
  textAlign = "auto",
@@ -151,7 +154,7 @@ export const ButtonLink = forwardRef<View, ButtonLinkProps>(
151
154
  ref={ref}
152
155
  accessibilityLabel={accessibilityLabel || label}
153
156
  accessibilityHint={accessibilityHint}
154
- accessibilityRole={"button"}
157
+ accessibilityRole={accessibilityRole}
155
158
  accessibilityState={{ disabled }}
156
159
  testID={testID}
157
160
  onPress={onPress}
@@ -1,5 +1,5 @@
1
1
  import React, { ReactNode } from "react";
2
- import { GestureResponderEvent } from "react-native";
2
+ import { AccessibilityRole, GestureResponderEvent } from "react-native";
3
3
  import {
4
4
  BodySmall,
5
5
  HStack,
@@ -23,6 +23,7 @@ type FeatureInfoActionProps =
23
23
  action: {
24
24
  label: string;
25
25
  onPress: (event: GestureResponderEvent) => void;
26
+ accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
26
27
  };
27
28
  }
28
29
  | {
@@ -56,6 +57,10 @@ export const FeatureInfo = ({
56
57
  }: FeatureInfoProps) => {
57
58
  const theme = useIOTheme();
58
59
 
60
+ /* Already defined in the `BodySmall` component as a fallback value,
61
+ but I keep it here to avoid possible future inconsistencies. */
62
+ const accessibilityRole = action?.accessibilityRole ?? "link";
63
+
59
64
  return (
60
65
  <HStack style={{ alignItems: "center" }} space={24}>
61
66
  {iconName && (
@@ -83,6 +88,7 @@ export const FeatureInfo = ({
83
88
  accessible
84
89
  importantForAccessibility={"yes"}
85
90
  accessibilityElementsHidden={false}
91
+ accessibilityRole={accessibilityRole}
86
92
  >
87
93
  {action.label}
88
94
  </BodySmall>
@@ -77,7 +77,8 @@ export const HeaderFirstLevel = ({
77
77
  if (reactNode !== null) {
78
78
  AccessibilityInfo.setAccessibilityFocus(reactNode);
79
79
  }
80
- });
80
+ // eslint-disable-next-line react-hooks/exhaustive-deps
81
+ }, []);
81
82
 
82
83
  /* We show the divider only when the header is scrolled down */
83
84
  const offset = useScrollViewOffset(
@@ -212,7 +212,8 @@ export const HeaderSecondLevel = ({
212
212
  AccessibilityInfo.setAccessibilityFocus(reactNode);
213
213
  }
214
214
  }
215
- });
215
+ // eslint-disable-next-line react-hooks/exhaustive-deps
216
+ }, []);
216
217
 
217
218
  const bgColorDiscreteTransition = useDerivedValue(() =>
218
219
  withSpring(scrollOffset.value > 0 ? 1 : 0, IOSpringValues.header)
@@ -47,7 +47,8 @@ export const ModalBSHeader = ({
47
47
  if (reactNode !== null) {
48
48
  AccessibilityInfo.setAccessibilityFocus(reactNode);
49
49
  }
50
- });
50
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51
+ }, []);
51
52
 
52
53
  return (
53
54
  <View style={styles.container} ref={headerRef}>
@@ -31,11 +31,13 @@ type ListItemRadioLoadingProps =
31
31
  state: true;
32
32
  skeletonDescription?: boolean;
33
33
  skeletonIcon?: boolean;
34
+ loadingAccessibilityLabel?: string;
34
35
  }
35
36
  | {
36
37
  state?: false;
37
38
  skeletonDescription?: never;
38
39
  skeletonIcon?: never;
40
+ loadingAccessibilityLabel?: never;
39
41
  };
40
42
 
41
43
  type Props = WithTestID<{
@@ -122,8 +124,15 @@ export const ListItemRadio = ({
122
124
  </View>
123
125
  );
124
126
 
125
- const SkeletonComponent = () => (
126
- <View style={[IOSelectionListItemStyles.listItem, { rowGap: 8 }]}>
127
+ const ListItemRadioSkeleton = ({
128
+ loadingAccessibilityLabel
129
+ }: Pick<ListItemRadioLoadingProps, "loadingAccessibilityLabel">) => (
130
+ <View
131
+ style={[IOSelectionListItemStyles.listItem, { rowGap: 8 }]}
132
+ accessible={true}
133
+ accessibilityLabel={loadingAccessibilityLabel}
134
+ accessibilityState={{ busy: true }}
135
+ >
127
136
  <View style={IOSelectionListItemStyles.listItemInner}>
128
137
  <View
129
138
  style={[
@@ -155,7 +164,9 @@ export const ListItemRadio = ({
155
164
  );
156
165
 
157
166
  return loadingProps?.state ? (
158
- <SkeletonComponent />
167
+ <ListItemRadioSkeleton
168
+ loadingAccessibilityLabel={loadingProps?.loadingAccessibilityLabel}
169
+ />
159
170
  ) : (
160
171
  <Pressable
161
172
  accessibilityRole="radio"
@@ -41,6 +41,7 @@ export type ListItemTransaction = WithTestID<
41
41
  PressableBaseProps & {
42
42
  showChevron?: boolean;
43
43
  isLoading?: boolean;
44
+ loadingAccessibilityLabel?: string;
44
45
  /**
45
46
  * A logo that will be displayed on the left of the list item.
46
47
  *
@@ -102,6 +103,7 @@ const StartComponent = ({
102
103
 
103
104
  export const ListItemTransaction = ({
104
105
  accessibilityLabel,
106
+ loadingAccessibilityLabel,
105
107
  showChevron = false,
106
108
  isLoading = false,
107
109
  paymentLogoIcon,
@@ -116,7 +118,11 @@ export const ListItemTransaction = ({
116
118
  const theme = useIOTheme();
117
119
 
118
120
  if (isLoading) {
119
- return <SkeletonComponent />;
121
+ return (
122
+ <ListItemTransactionSkeleton
123
+ loadingAccessibilityLabel={loadingAccessibilityLabel}
124
+ />
125
+ );
120
126
  }
121
127
 
122
128
  const interactiveColor: IOColors = theme["interactiveElem-default"];
@@ -207,8 +213,15 @@ export const ListItemTransaction = ({
207
213
  }
208
214
  };
209
215
 
210
- const SkeletonComponent = () => (
211
- <View style={IOListItemStyles.listItem} accessible={false}>
216
+ const ListItemTransactionSkeleton = ({
217
+ loadingAccessibilityLabel
218
+ }: Pick<ListItemTransaction, "loadingAccessibilityLabel">) => (
219
+ <View
220
+ style={IOListItemStyles.listItem}
221
+ accessible={true}
222
+ accessibilityLabel={loadingAccessibilityLabel}
223
+ accessibilityState={{ busy: true }}
224
+ >
212
225
  <View style={IOListItemStyles.listItemInner}>
213
226
  <View style={{ marginRight: IOListItemVisualParams.iconMargin }}>
214
227
  <Placeholder.Box
@@ -1364,7 +1364,12 @@ exports[`Test List Item Components - Experimental Enabled ListItemRadioWithAmou
1364
1364
 
1365
1365
  exports[`Test List Item Components - Experimental Enabled ListItemTransaction Snapshot 1`] = `
1366
1366
  <View
1367
- accessible={false}
1367
+ accessibilityState={
1368
+ {
1369
+ "busy": true,
1370
+ }
1371
+ }
1372
+ accessible={true}
1368
1373
  style={
1369
1374
  {
1370
1375
  "marginHorizontal": -24,
@@ -2942,7 +2947,12 @@ exports[`Test List Item Components ListItemRadioWithAmount Snapshot 2`] = `
2942
2947
 
2943
2948
  exports[`Test List Item Components ListItemTransaction Snapshot 1`] = `
2944
2949
  <View
2945
- accessible={false}
2950
+ accessibilityState={
2951
+ {
2952
+ "busy": true,
2953
+ }
2954
+ }
2955
+ accessible={true}
2946
2956
  style={
2947
2957
  {
2948
2958
  "marginHorizontal": -24,
@@ -16,6 +16,7 @@ type PartialProps = WithTestID<{
16
16
  format: "doc" | "pdf";
17
17
  isLoading?: boolean;
18
18
  isFetching?: boolean;
19
+ loadingAccessibilityLabel?: string;
19
20
  fetchingAccessibilityLabel?: string;
20
21
  onPress: (event: GestureResponderEvent) => void;
21
22
  }>;
@@ -87,6 +88,7 @@ const ModuleAttachmentContent = ({
87
88
  * @param {string} accessibilityLabel - Optional accessibility label.
88
89
  * @param {boolean} disabled - If true, the button is disabled.
89
90
  * @param {string} fetchingAccessibilityLabel - Optional accessibility label to use during fetching.
91
+ * @param {string} loadingAccessibilityLabel - Optional accessibility label to use during loading.
90
92
  * @param {string} format - Badge content. PDF or DOC.
91
93
  * @param {boolean} isLoading - If true, displays a skeleton loading component.
92
94
  * @param {boolean} isFetching - If true, displays an activity indicator.
@@ -99,6 +101,7 @@ export const ModuleAttachment = ({
99
101
  accessibilityLabel,
100
102
  disabled = false,
101
103
  fetchingAccessibilityLabel,
104
+ loadingAccessibilityLabel,
102
105
  format,
103
106
  isLoading = false,
104
107
  isFetching = false,
@@ -117,7 +120,11 @@ export const ModuleAttachment = ({
117
120
  );
118
121
 
119
122
  if (isLoading) {
120
- return <ModuleAttachmentSkeleton />;
123
+ return (
124
+ <ModuleAttachmentSkeleton
125
+ loadingAccessibilityLabel={loadingAccessibilityLabel}
126
+ />
127
+ );
121
128
  }
122
129
 
123
130
  const pressableAccessibilityLabel =
@@ -149,8 +156,13 @@ export const ModuleAttachment = ({
149
156
  );
150
157
  };
151
158
 
152
- const ModuleAttachmentSkeleton = () => (
159
+ const ModuleAttachmentSkeleton = ({
160
+ loadingAccessibilityLabel
161
+ }: Pick<ModuleAttachmentProps, "loadingAccessibilityLabel">) => (
153
162
  <ModuleStatic
163
+ accessible={true}
164
+ accessibilityLabel={loadingAccessibilityLabel}
165
+ accessibilityState={{ busy: true }}
154
166
  startBlock={
155
167
  <VStack space={4}>
156
168
  <Placeholder.Box animate="fade" radius={8} width={114} height={16} />
@@ -21,6 +21,7 @@ import { PressableModuleBase } from "./PressableModuleBase";
21
21
 
22
22
  type LoadingProps = {
23
23
  isLoading: true;
24
+ loadingAccessibilityLabel?: string;
24
25
  };
25
26
 
26
27
  type ImageProps =
@@ -45,7 +46,11 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
45
46
  const imageMargin: IOSpacingScale = 12;
46
47
 
47
48
  if (props.isLoading) {
48
- return <ModuleCheckoutSkeleton />;
49
+ return (
50
+ <ModuleCheckoutSkeleton
51
+ loadingAccessibilityLabel={props.loadingAccessibilityLabel}
52
+ />
53
+ );
49
54
  }
50
55
 
51
56
  const { paymentLogo, image, title, subtitle, ctaText, onPress } = props;
@@ -98,8 +103,13 @@ export const ModuleCheckout = (props: ModuleCheckoutProps) => {
98
103
  );
99
104
  };
100
105
 
101
- const ModuleCheckoutSkeleton = () => (
106
+ const ModuleCheckoutSkeleton = ({
107
+ loadingAccessibilityLabel
108
+ }: Pick<LoadingProps, "loadingAccessibilityLabel">) => (
102
109
  <ModuleStatic
110
+ accessible={true}
111
+ accessibilityLabel={loadingAccessibilityLabel}
112
+ accessibilityState={{ busy: true }}
103
113
  startBlock={
104
114
  <HStack space={8} style={{ alignItems: "center" }}>
105
115
  <Placeholder.Box animate="fade" radius={8} height={24} width={24} />
@@ -32,6 +32,7 @@ type ImageProps =
32
32
 
33
33
  type LoadingModuleProps = {
34
34
  isLoading: true;
35
+ loadingAccessibilityLabel?: string;
35
36
  };
36
37
 
37
38
  type BaseModuleProps = {
@@ -48,7 +49,9 @@ const ModuleCredential = (
48
49
  props: WithTestID<LoadingModuleProps | ModuleCredentialProps>
49
50
  ) =>
50
51
  props.isLoading ? (
51
- <ModuleCredentialSkeleton />
52
+ <ModuleCredentialSkeleton
53
+ loadingAccessibilityLabel={props.loadingAccessibilityLabel}
54
+ />
52
55
  ) : (
53
56
  <ModuleCredentialContent {...props} />
54
57
  );
@@ -144,8 +147,13 @@ const ModuleCredentialContent = ({
144
147
  );
145
148
  };
146
149
 
147
- const ModuleCredentialSkeleton = () => (
150
+ const ModuleCredentialSkeleton = ({
151
+ loadingAccessibilityLabel
152
+ }: Pick<LoadingModuleProps, "loadingAccessibilityLabel">) => (
148
153
  <ModuleStatic
154
+ accessible={true}
155
+ accessibilityLabel={loadingAccessibilityLabel}
156
+ accessibilityState={{ busy: true }}
149
157
  startBlock={
150
158
  <HStack
151
159
  style={{ alignItems: "center" }}
@@ -28,6 +28,7 @@ import {
28
28
 
29
29
  type LoadingProps = {
30
30
  isLoading: true;
31
+ loadingAccessibilityLabel?: string;
31
32
  };
32
33
 
33
34
  type ImageProps =
@@ -49,7 +50,11 @@ export const ModuleNavigation = (props: WithTestID<ModuleNavigationProps>) => {
49
50
  const { hugeFontEnabled } = useIOFontDynamicScale();
50
51
 
51
52
  if (props.isLoading) {
52
- return <ModuleNavigationSkeleton />;
53
+ return (
54
+ <ModuleNavigationSkeleton
55
+ loadingAccessibilityLabel={props.loadingAccessibilityLabel}
56
+ />
57
+ );
53
58
  }
54
59
 
55
60
  const { icon, image, title, subtitle, onPress, badge, ...pressableProps } =
@@ -111,8 +116,13 @@ export const ModuleNavigation = (props: WithTestID<ModuleNavigationProps>) => {
111
116
  );
112
117
  };
113
118
 
114
- const ModuleNavigationSkeleton = () => (
119
+ const ModuleNavigationSkeleton = ({
120
+ loadingAccessibilityLabel
121
+ }: Pick<LoadingProps, "loadingAccessibilityLabel">) => (
115
122
  <ModuleStatic
123
+ accessible={true}
124
+ accessibilityLabel={loadingAccessibilityLabel}
125
+ accessibilityState={{ busy: true }}
116
126
  startBlock={
117
127
  <HStack
118
128
  style={{ alignItems: "center" }}
@@ -23,6 +23,7 @@ export type ModulePaymentNoticeProps = WithTestID<
23
23
  {
24
24
  isLoading?: boolean;
25
25
  accessibilityLabel?: string;
26
+ loadingAccessibilityLabel?: string;
26
27
  title?: string;
27
28
  subtitle: string;
28
29
  onPress: (event: GestureResponderEvent) => void;
@@ -140,10 +141,15 @@ export const ModulePaymentNotice = ({
140
141
  testID,
141
142
  accessibilityLabel,
142
143
  onPress,
144
+ loadingAccessibilityLabel,
143
145
  ...rest
144
146
  }: ModulePaymentNoticeProps) => {
145
147
  if (isLoading) {
146
- return <ModulePaymentNoticeSkeleton />;
148
+ return (
149
+ <ModulePaymentNoticeSkeleton
150
+ loadingAccessibilityLabel={loadingAccessibilityLabel}
151
+ />
152
+ );
147
153
  }
148
154
 
149
155
  return (
@@ -157,8 +163,13 @@ export const ModulePaymentNotice = ({
157
163
  );
158
164
  };
159
165
 
160
- const ModulePaymentNoticeSkeleton = () => (
166
+ const ModulePaymentNoticeSkeleton = ({
167
+ loadingAccessibilityLabel
168
+ }: Pick<ModulePaymentNoticeProps, "loadingAccessibilityLabel">) => (
161
169
  <ModuleStatic
170
+ accessible={true}
171
+ accessibilityLabel={loadingAccessibilityLabel}
172
+ accessibilityState={{ busy: true }}
162
173
  startBlock={
163
174
  <VStack space={4}>
164
175
  <Placeholder.Box animate="fade" radius={8} width={120} height={12} />
@@ -1,11 +1,13 @@
1
1
  import * as React from "react";
2
- import { PressableProps, View } from "react-native";
2
+ import { PressableProps, View, ViewProps } from "react-native";
3
3
  import { IOColors, IOModuleStyles, useIOTheme } from "../../core";
4
4
  import { HStack } from "../stack";
5
5
 
6
- type ModuleStaticProps =
7
- | ModuleStaticSingleBlockProps
8
- | ModuleStaticMultipleBlockProps;
6
+ type ModuleStaticProps = Pick<
7
+ ViewProps,
8
+ "accessible" | "accessibilityLabel" | "accessibilityState"
9
+ > &
10
+ (ModuleStaticSingleBlockProps | ModuleStaticMultipleBlockProps);
9
11
 
10
12
  type ModuleStaticMultipleBlockProps = {
11
13
  startBlock: React.ReactNode;
@@ -27,7 +29,10 @@ export const ModuleStatic = ({
27
29
  disabled = false,
28
30
  startBlock,
29
31
  endBlock,
30
- children
32
+ children,
33
+ accessible = false,
34
+ accessibilityLabel,
35
+ accessibilityState
31
36
  }: ModuleStaticProps) => {
32
37
  const theme = useIOTheme();
33
38
 
@@ -40,7 +45,9 @@ export const ModuleStatic = ({
40
45
  opacity: disabled ? DISABLED_OPACITY : 1
41
46
  }
42
47
  ]}
43
- accessible={false}
48
+ accessible={accessible}
49
+ accessibilityLabel={accessibilityLabel}
50
+ accessibilityState={accessibilityState}
44
51
  >
45
52
  {startBlock && (
46
53
  <HStack space={8} style={{ alignItems: "center" }}>
@@ -24,7 +24,13 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
24
24
  */
25
25
  export const Body = forwardRef<View, BodyStyleProps>(
26
26
  (
27
- { weight: customWeight, color: customColor, asLink, ...props },
27
+ {
28
+ weight: customWeight,
29
+ color: customColor,
30
+ asLink,
31
+ accessibilityRole = "link",
32
+ ...props
33
+ },
28
34
  ref?: ForwardedRef<View>
29
35
  ) => {
30
36
  const theme = useIOTheme();
@@ -44,7 +50,7 @@ export const Body = forwardRef<View, BodyStyleProps>(
44
50
  color: customColor ?? defaultColor,
45
51
  ...(asLink
46
52
  ? {
47
- accessibilityRole: "link",
53
+ accessibilityRole,
48
54
  textStyle: { textDecorationLine: "underline" }
49
55
  }
50
56
  : {})
@@ -21,7 +21,13 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
21
21
  */
22
22
  export const BodySmall = forwardRef<View, BodySmallProps>(
23
23
  (
24
- { weight: customWeight, color: customColor, asLink, ...props },
24
+ {
25
+ weight: customWeight,
26
+ color: customColor,
27
+ asLink,
28
+ accessibilityRole = "link",
29
+ ...props
30
+ },
25
31
  ref?: ForwardedRef<View>
26
32
  ) => {
27
33
  const theme = useIOTheme();
@@ -41,7 +47,7 @@ export const BodySmall = forwardRef<View, BodySmallProps>(
41
47
  color: customColor ?? defaultColor,
42
48
  ...(asLink
43
49
  ? {
44
- accessibilityRole: "link",
50
+ accessibilityRole,
45
51
  textStyle: { textDecorationLine: "underline" }
46
52
  }
47
53
  : {})
@@ -1,5 +1,6 @@
1
1
  import React, { ComponentProps, forwardRef, useMemo } from "react";
2
2
  import {
3
+ AccessibilityRole,
3
4
  ColorValue,
4
5
  GestureResponderEvent,
5
6
  Text,
@@ -60,6 +61,7 @@ export type TypographicStyleAsLinkProps =
60
61
  color?: never;
61
62
  asLink: true;
62
63
  onPress: (event: GestureResponderEvent) => void;
64
+ accessibilityRole?: Extract<AccessibilityRole, "button" | "link">;
63
65
  }
64
66
  | { color?: IOColors; asLink?: false };
65
67
 
@@ -21,7 +21,13 @@ const legacyFontName: IOFontFamily = "TitilliumSansPro";
21
21
  */
22
22
  export const LabelMini = forwardRef<View, LabelMiniProps>(
23
23
  (
24
- { weight: customWeight, color: customColor, asLink, ...props },
24
+ {
25
+ weight: customWeight,
26
+ color: customColor,
27
+ asLink,
28
+ accessibilityRole = "link",
29
+ ...props
30
+ },
25
31
  ref?: ForwardedRef<View>
26
32
  ) => {
27
33
  const theme = useIOTheme();
@@ -41,7 +47,7 @@ export const LabelMini = forwardRef<View, LabelMiniProps>(
41
47
  color: customColor ?? defaultColor,
42
48
  ...(asLink
43
49
  ? {
44
- accessibilityRole: "link",
50
+ accessibilityRole,
45
51
  textStyle: { textDecorationLine: "underline" }
46
52
  }
47
53
  : {})