@proximus/lavender-cards-native 2.1.1-alpha.23 → 2.1.1-alpha.24

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.
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { AccessibilityProps, StyleProp, ViewStyle } from 'react-native';
3
3
  export type PxStatusCardType = 'Information' | 'Success' | 'Warning' | 'Error' | 'Ongoing';
4
- export interface PxStatusCardProps extends Pick<AccessibilityProps, 'accessibilityLabel' | 'accessibilityHint'> {
4
+ export interface PxStatusCardProps extends AccessibilityProps {
5
5
  type?: PxStatusCardType;
6
6
  title: string;
7
7
  body?: string;
@@ -12,6 +12,7 @@ export interface PxStatusCardProps extends Pick<AccessibilityProps, 'accessibili
12
12
  ctaAccessibilityHint?: string;
13
13
  closeAccessibilityLabel?: string;
14
14
  closeAccessibilityHint?: string;
15
+ statusIconAriaLabel?: string;
15
16
  testID?: string;
16
17
  inverted?: boolean;
17
18
  containerStyle?: StyleProp<ViewStyle>;
@@ -1 +1 @@
1
- {"version":3,"file":"PxStatusCard.d.ts","sourceRoot":"","sources":["../src/PxStatusCard.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EACL,kBAAkB,EAClB,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,SAAS,GACT,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,kBAAkB,EAAE,oBAAoB,GAAG,mBAAmB,CAAC;IAC5E,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,I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CACvC;AAmCD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAgIpD"}
@@ -35,7 +35,7 @@ const statusMap = {
35
35
  },
36
36
  };
37
37
  export function PxStatusCard(props) {
38
- const { type = 'Information', title, body, ctaLabel, onPressCTA, onPressClose, ctaAccessibilityLabel, ctaAccessibilityHint, closeAccessibilityLabel, closeAccessibilityHint, testID, inverted = false, containerStyle, accessibilityLabel, accessibilityHint, } = props;
38
+ const { type = 'Information', title, body, ctaLabel, onPressCTA, onPressClose, ctaAccessibilityLabel, ctaAccessibilityHint, closeAccessibilityLabel, closeAccessibilityHint, statusIconAriaLabel, testID, inverted = false, containerStyle, ...accessibilityProps } = props;
39
39
  const { theme } = useTheme();
40
40
  const status = statusMap[type];
41
41
  const invertedSuffix = inverted ? 'Inverted' : 'Default';
@@ -49,11 +49,7 @@ export function PxStatusCard(props) {
49
49
  borderLeftColor: theme.t(status.borderColor),
50
50
  },
51
51
  containerStyle,
52
- ], ...e2eID(testID), ...a11y({
53
- accessibilityLabel: accessibilityLabel || title,
54
- accessibilityHint,
55
- role: 'alert',
56
- }) },
52
+ ], ...e2eID(testID), ...a11y(accessibilityProps) },
57
53
  React.createElement(View, { style: [
58
54
  styles.content,
59
55
  {
@@ -67,7 +63,7 @@ export function PxStatusCard(props) {
67
63
  alignItems: 'center',
68
64
  justifyContent: 'center',
69
65
  } },
70
- React.createElement(PxIcon, { name: status.icon, size: "L", color: status.iconColor, inverted: inverted, ...(testID && e2eID(`${testID}-icon`)) })),
66
+ React.createElement(PxIcon, { name: status.icon, size: "L", color: status.iconColor, inverted: inverted, accessibilityLabel: statusIconAriaLabel, ...(testID && e2eID(`${testID}-icon`)) })),
71
67
  React.createElement(View, { style: [
72
68
  styles.textContainer,
73
69
  { gap: theme.t('SpacingXsMobile').number },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-cards-native",
3
- "version": "2.1.1-alpha.23",
3
+ "version": "2.1.1-alpha.24",
4
4
  "description": "Card component",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",