@telus-uds/components-base 1.92.0 → 1.93.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/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Thu, 22 Aug 2024 18:17:39 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 26 Aug 2024 16:19:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.93.0
8
+
9
+ Mon, 26 Aug 2024 16:19:45 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `A11yText`: add role prop (guillermo.peitzner@telus.com)
14
+
7
15
  ## 1.92.0
8
16
 
9
- Thu, 22 Aug 2024 18:17:39 GMT
17
+ Thu, 22 Aug 2024 18:25:10 GMT
10
18
 
11
19
  ### Minor changes
12
20
 
@@ -24,6 +24,7 @@ const A11yText = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
24
24
  let {
25
25
  text,
26
26
  heading,
27
+ role = 'text',
27
28
  ...rest
28
29
  } = _ref;
29
30
  const selectedProps = selectProps({
@@ -33,7 +34,7 @@ const A11yText = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
33
34
  // see https://github.com/facebook/react-native/issues/30851#issuecomment-790165489
34
35
  accessible: _Platform.default.OS === 'ios',
35
36
  accessibilityLabel: text,
36
- accessibilityRole: heading ? 'header' : 'text',
37
+ accessibilityRole: heading ? 'header' : role,
37
38
  ...rest
38
39
  });
39
40
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
@@ -52,7 +53,11 @@ A11yText.propTypes = {
52
53
  /**
53
54
  * Whether text should be rendered as a heading
54
55
  */
55
- heading: _propTypes.default.bool
56
+ heading: _propTypes.default.bool,
57
+ /**
58
+ * Role of the element
59
+ */
60
+ role: _propTypes.default.string
56
61
  };
57
62
  const styles = _StyleSheet.default.create({
58
63
  invisible: {
@@ -17,6 +17,7 @@ const A11yText = /*#__PURE__*/React.forwardRef((_ref, ref) => {
17
17
  let {
18
18
  text,
19
19
  heading,
20
+ role = 'text',
20
21
  ...rest
21
22
  } = _ref;
22
23
  const selectedProps = selectProps({
@@ -26,7 +27,7 @@ const A11yText = /*#__PURE__*/React.forwardRef((_ref, ref) => {
26
27
  // see https://github.com/facebook/react-native/issues/30851#issuecomment-790165489
27
28
  accessible: Platform.OS === 'ios',
28
29
  accessibilityLabel: text,
29
- accessibilityRole: heading ? 'header' : 'text',
30
+ accessibilityRole: heading ? 'header' : role,
30
31
  ...rest
31
32
  });
32
33
  return /*#__PURE__*/_jsx(View, {
@@ -45,7 +46,11 @@ A11yText.propTypes = {
45
46
  /**
46
47
  * Whether text should be rendered as a heading
47
48
  */
48
- heading: PropTypes.bool
49
+ heading: PropTypes.bool,
50
+ /**
51
+ * Role of the element
52
+ */
53
+ role: PropTypes.string
49
54
  };
50
55
  const styles = StyleSheet.create({
51
56
  invisible: {
package/package.json CHANGED
@@ -85,6 +85,6 @@
85
85
  "standard-engine": {
86
86
  "skip": true
87
87
  },
88
- "version": "1.92.0",
88
+ "version": "1.93.0",
89
89
  "types": "types/index.d.ts"
90
90
  }
@@ -12,7 +12,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
12
12
  * It should be used to add selectable screen-reader-only text to the main document flow,
13
13
  * as a sibling to blocks of text like paragraphs and interactive elements like buttons.
14
14
  */
15
- const A11yText = React.forwardRef(({ text, heading, ...rest }, ref) => {
15
+ const A11yText = React.forwardRef(({ text, heading, role = 'text', ...rest }, ref) => {
16
16
  const selectedProps = selectProps({
17
17
  // On iOS, needs `accessible` to be true to be focusable without non-a11y content.
18
18
  // On Web, `accessible` causes RNW to set attributes that may make the element be treated as a group.
@@ -20,7 +20,7 @@ const A11yText = React.forwardRef(({ text, heading, ...rest }, ref) => {
20
20
  // see https://github.com/facebook/react-native/issues/30851#issuecomment-790165489
21
21
  accessible: Platform.OS === 'ios',
22
22
  accessibilityLabel: text,
23
- accessibilityRole: heading ? 'header' : 'text',
23
+ accessibilityRole: heading ? 'header' : role,
24
24
  ...rest
25
25
  })
26
26
 
@@ -38,7 +38,11 @@ A11yText.propTypes = {
38
38
  /**
39
39
  * Whether text should be rendered as a heading
40
40
  */
41
- heading: PropTypes.bool
41
+ heading: PropTypes.bool,
42
+ /**
43
+ * Role of the element
44
+ */
45
+ role: PropTypes.string
42
46
  }
43
47
 
44
48
  const styles = StyleSheet.create({