@telus-uds/components-base 1.51.0 → 1.52.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 (75) hide show
  1. package/CHANGELOG.md +22 -3
  2. package/component-docs.json +318 -131
  3. package/lib/A11yText/index.js +8 -0
  4. package/lib/Divider/Divider.js +4 -0
  5. package/lib/IconButton/IconButton.js +16 -0
  6. package/lib/Link/ChevronLink.js +4 -0
  7. package/lib/Listbox/ListboxContext.js +20 -0
  8. package/lib/Listbox/PressableItem.js +170 -0
  9. package/lib/Listbox/index.js +32 -0
  10. package/lib/Modal/Modal.js +17 -2
  11. package/lib/MultiSelectFilter/MultiSelectFilter.js +19 -5
  12. package/lib/Pagination/PageButton.js +12 -0
  13. package/lib/Pagination/Pagination.js +12 -0
  14. package/lib/QuickLinks/QuickLinks.js +12 -0
  15. package/lib/Responsive/Responsive.js +7 -0
  16. package/lib/Select/Group.js +4 -0
  17. package/lib/Select/Group.native.js +4 -0
  18. package/lib/Select/Item.js +4 -0
  19. package/lib/SideNav/ItemsGroup.js +4 -0
  20. package/lib/SideNav/SideNav.js +8 -0
  21. package/lib/StepTracker/StepTracker.js +16 -0
  22. package/lib/Tabs/Tabs.js +20 -0
  23. package/lib/Timeline/Timeline.js +2 -2
  24. package/lib/index.js +14 -0
  25. package/lib/utils/htmlAttrs.js +33 -0
  26. package/lib/utils/index.js +10 -1
  27. package/lib-module/A11yText/index.js +8 -0
  28. package/lib-module/Divider/Divider.js +4 -0
  29. package/lib-module/IconButton/IconButton.js +16 -0
  30. package/lib-module/Link/ChevronLink.js +4 -0
  31. package/lib-module/Listbox/ListboxContext.js +6 -0
  32. package/lib-module/Listbox/PressableItem.js +150 -0
  33. package/lib-module/Listbox/index.js +2 -0
  34. package/lib-module/Modal/Modal.js +18 -3
  35. package/lib-module/MultiSelectFilter/MultiSelectFilter.js +15 -5
  36. package/lib-module/Pagination/PageButton.js +12 -0
  37. package/lib-module/Pagination/Pagination.js +12 -0
  38. package/lib-module/QuickLinks/QuickLinks.js +12 -0
  39. package/lib-module/Responsive/Responsive.js +7 -0
  40. package/lib-module/Select/Group.js +4 -0
  41. package/lib-module/Select/Group.native.js +4 -0
  42. package/lib-module/Select/Item.js +4 -0
  43. package/lib-module/SideNav/ItemsGroup.js +4 -0
  44. package/lib-module/SideNav/SideNav.js +8 -0
  45. package/lib-module/StepTracker/StepTracker.js +16 -0
  46. package/lib-module/Tabs/Tabs.js +20 -0
  47. package/lib-module/Timeline/Timeline.js +2 -2
  48. package/lib-module/index.js +1 -0
  49. package/lib-module/utils/htmlAttrs.js +22 -0
  50. package/lib-module/utils/index.js +2 -1
  51. package/package.json +2 -2
  52. package/src/A11yText/index.jsx +6 -0
  53. package/src/Divider/Divider.jsx +3 -0
  54. package/src/IconButton/IconButton.jsx +12 -0
  55. package/src/Link/ChevronLink.jsx +3 -0
  56. package/src/Listbox/ListboxContext.js +6 -0
  57. package/src/Listbox/PressableItem.jsx +143 -0
  58. package/src/Listbox/index.js +2 -0
  59. package/src/Modal/Modal.jsx +13 -3
  60. package/src/MultiSelectFilter/MultiSelectFilter.jsx +10 -4
  61. package/src/Pagination/PageButton.jsx +9 -0
  62. package/src/Pagination/Pagination.jsx +9 -0
  63. package/src/QuickLinks/QuickLinks.jsx +9 -0
  64. package/src/Responsive/Responsive.jsx +6 -0
  65. package/src/Select/Group.jsx +3 -0
  66. package/src/Select/Group.native.jsx +3 -0
  67. package/src/Select/Item.jsx +3 -0
  68. package/src/SideNav/ItemsGroup.jsx +3 -0
  69. package/src/SideNav/SideNav.jsx +6 -0
  70. package/src/StepTracker/StepTracker.jsx +12 -0
  71. package/src/Tabs/Tabs.jsx +15 -0
  72. package/src/Timeline/Timeline.jsx +2 -2
  73. package/src/index.js +1 -0
  74. package/src/utils/htmlAttrs.js +29 -0
  75. package/src/utils/index.js +1 -0
@@ -15,7 +15,8 @@ var _exportNames = {
15
15
  useUniqueId: true,
16
16
  withLinkRouter: true,
17
17
  containUniqueFields: true,
18
- BaseView: true
18
+ BaseView: true,
19
+ htmlAttrs: true
19
20
  };
20
21
  Object.defineProperty(exports, "BaseView", {
21
22
  enumerable: true,
@@ -29,6 +30,12 @@ Object.defineProperty(exports, "containUniqueFields", {
29
30
  return _containUniqueFields.default;
30
31
  }
31
32
  });
33
+ Object.defineProperty(exports, "htmlAttrs", {
34
+ enumerable: true,
35
+ get: function () {
36
+ return _htmlAttrs.default;
37
+ }
38
+ });
32
39
  Object.defineProperty(exports, "info", {
33
40
  enumerable: true,
34
41
  get: function () {
@@ -224,6 +231,8 @@ var _containUniqueFields = _interopRequireDefault(require("./containUniqueFields
224
231
 
225
232
  var _BaseView = _interopRequireDefault(require("./BaseView"));
226
233
 
234
+ var _htmlAttrs = _interopRequireDefault(require("./htmlAttrs"));
235
+
227
236
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
228
237
 
229
238
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -37,7 +37,15 @@ const A11yText = /*#__PURE__*/forwardRef((_ref, ref) => {
37
37
  });
38
38
  A11yText.displayName = 'A11yText';
39
39
  A11yText.propTypes = { ...selectedSystemPropTypes,
40
+
41
+ /**
42
+ * Text to be read by screen readers
43
+ */
40
44
  text: PropTypes.string.isRequired,
45
+
46
+ /**
47
+ * Whether text should be rendered as a heading
48
+ */
41
49
  heading: PropTypes.bool
42
50
  };
43
51
  const styles = StyleSheet.create({
@@ -110,6 +110,10 @@ const Divider = /*#__PURE__*/forwardRef((_ref, ref) => {
110
110
  Divider.displayName = 'Divider';
111
111
  Divider.propTypes = { ...selectedSystemPropTypes,
112
112
  tokens: getTokensPropType('Divider'),
113
+
114
+ /**
115
+ * A number referring to a position on the space scale to create space on either side of the divider
116
+ */
113
117
  space: spacingProps.types.spacingValue,
114
118
  variant: variantProp.propType,
115
119
 
@@ -120,9 +120,25 @@ IconButton.displayName = 'IconButton';
120
120
  IconButton.propTypes = { ...selectedSystemPropTypes,
121
121
  variant: variantProp.propType,
122
122
  tokens: getTokensPropType('IconButton'),
123
+
124
+ /**
125
+ * Defines the icon to be rendered
126
+ */
123
127
  icon: PropTypes.elementType.isRequired,
128
+
129
+ /**
130
+ * URL to navigate to when the `Iconbutton` is pressed
131
+ */
124
132
  href: PropTypes.string,
133
+
134
+ /**
135
+ * URL options to navigate to when the `Iconbutton` is pressed
136
+ */
125
137
  hrefAttrs: PropTypes.shape(hrefAttrsProp.types),
138
+
139
+ /**
140
+ * Function to execute when the `Iconbutton` is pressed
141
+ */
126
142
  onPress: PropTypes.func
127
143
  };
128
144
  const staticStyles = StyleSheet.create({
@@ -52,6 +52,10 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
52
52
  ChevronLink.displayName = 'ChevronLink';
53
53
  ChevronLink.propTypes = { ...LinkBase.propTypes,
54
54
  tokens: getTokensPropType('ChevronLink', 'Link'),
55
+
56
+ /**
57
+ * Changes direction of chevron icon
58
+ */
55
59
  direction: PropTypes.oneOf(['left', 'right'])
56
60
  };
57
61
  export default ChevronLink;
@@ -0,0 +1,6 @@
1
+ import React, { useContext } from 'react';
2
+ const ListboxContext = /*#__PURE__*/React.createContext({});
3
+
4
+ const useListboxContext = () => useContext(ListboxContext);
5
+
6
+ export { ListboxContext, useListboxContext };
@@ -0,0 +1,150 @@
1
+ /* eslint-disable react/require-default-props */
2
+ import React, { forwardRef } from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import Pressable from "react-native-web/dist/exports/Pressable";
5
+ import Text from "react-native-web/dist/exports/Text";
6
+ import { selectSystemProps, resolvePressableTokens, htmlAttrs } from '../utils';
7
+ import { useListboxContext } from './ListboxContext';
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
11
+
12
+ const getItemStyles = _ref => {
13
+ let {
14
+ groupFontName,
15
+ groupFontWeight,
16
+ itemFontSize,
17
+ itemPaddingTop,
18
+ itemPaddingBottom,
19
+ itemPaddingLeft,
20
+ itemBorderLeftWidth,
21
+ itemPaddingRight,
22
+ itemBackgroundColor,
23
+ itemColor,
24
+ itemDisplay,
25
+ itemOutline,
26
+ itemTextDecoration,
27
+ itemBorderLeftColor,
28
+ itemBorderRightWidth,
29
+ itemBorderRightColor,
30
+ itemBorderTopWidth,
31
+ itemBorderTopColor,
32
+ itemBorderBottomWidth,
33
+ itemBorderBottomColor,
34
+ itemBorderRadius,
35
+ itemHeight
36
+ } = _ref;
37
+ return {
38
+ fontFamily: `${groupFontName}${groupFontWeight}normal`,
39
+ fontSize: itemFontSize,
40
+ paddingTop: itemPaddingTop - itemBorderTopWidth,
41
+ paddingBottom: itemPaddingBottom - itemBorderBottomWidth,
42
+ paddingLeft: itemPaddingLeft - itemBorderLeftWidth,
43
+ paddingRight: itemPaddingRight - itemBorderRightWidth,
44
+ width: '100%',
45
+ backgroundColor: itemBackgroundColor,
46
+ color: itemColor,
47
+ display: itemDisplay,
48
+ outline: itemOutline,
49
+ textDecoration: itemTextDecoration,
50
+ borderLeft: `${itemBorderLeftWidth}px solid ${itemBorderLeftColor}`,
51
+ borderRight: `${itemBorderRightWidth}px solid ${itemBorderRightColor}`,
52
+ borderTop: `${itemBorderTopWidth}px solid ${itemBorderTopColor}`,
53
+ borderBottom: `${itemBorderBottomWidth}px solid ${itemBorderBottomColor}`,
54
+ borderRadius: itemBorderRadius,
55
+ height: itemHeight,
56
+ justifyContent: 'center'
57
+ };
58
+ };
59
+
60
+ const PressableItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
61
+ let {
62
+ children,
63
+ href,
64
+ isChild = false,
65
+ onBlur,
66
+ onPress,
67
+ tabIndex = 0,
68
+ nextItemRef,
69
+ prevItemRef,
70
+ tokens,
71
+ id,
72
+ ...rest
73
+ } = _ref2;
74
+ const {
75
+ selectedId,
76
+ setSelectedId
77
+ } = useListboxContext();
78
+
79
+ const selectTextStyles = _ref3 => {
80
+ let {
81
+ groupFontName,
82
+ groupFontWeight,
83
+ itemFontSize,
84
+ itemColor,
85
+ lineHeight
86
+ } = _ref3;
87
+ return {
88
+ fontFamily: `${groupFontName}${groupFontWeight}normal`,
89
+ fontSize: itemFontSize,
90
+ color: itemColor,
91
+ lineHeight: lineHeight * itemFontSize
92
+ };
93
+ };
94
+
95
+ const resolveButtonTokens = pressableState => {
96
+ const themeTokens = resolvePressableTokens(tokens, pressableState, {
97
+ isChild,
98
+ current: id === selectedId && id !== undefined
99
+ });
100
+ return themeTokens;
101
+ };
102
+
103
+ const handleKeyPress = event => {
104
+ if (['Enter', ' '].includes(event === null || event === void 0 ? void 0 : event.key)) {
105
+ onPress === null || onPress === void 0 ? void 0 : onPress(event);
106
+ } else if ((event === null || event === void 0 ? void 0 : event.key) === 'ArrowDown') {
107
+ nextItemRef.current.focus();
108
+ } else if ((event === null || event === void 0 ? void 0 : event.key) === 'ArrowUp' && prevItemRef !== null && prevItemRef !== void 0 && prevItemRef.current) {
109
+ prevItemRef.current.focus();
110
+ }
111
+ };
112
+
113
+ return /*#__PURE__*/_jsx(Pressable, {
114
+ isChild: isChild,
115
+ style: pressableState => getItemStyles(resolveButtonTokens(pressableState)),
116
+ onBlur: onBlur,
117
+ onClick: onPress,
118
+ onKeyPress: handleKeyPress,
119
+ ref: ref,
120
+ tabIndex: tabIndex,
121
+ ...(href && {
122
+ href
123
+ }),
124
+ ...(onPress && {
125
+ onClick: onPress
126
+ }),
127
+ ...selectProps(rest),
128
+ onPress: () => {
129
+ setSelectedId(id);
130
+ onPress();
131
+ },
132
+ children: pressableState => {
133
+ return /*#__PURE__*/_jsxs(Text, {
134
+ style: selectTextStyles(resolveButtonTokens(pressableState)),
135
+ children: [children, " "]
136
+ });
137
+ }
138
+ });
139
+ });
140
+ PressableItem.displayName = 'PressableItem';
141
+ PressableItem.propTypes = { ...selectedSystemPropTypes,
142
+ href: PropTypes.string,
143
+ isChild: PropTypes.bool,
144
+ children: PropTypes.node.isRequired,
145
+ onBlur: PropTypes.func,
146
+ onPress: PropTypes.func,
147
+ nextItemRef: PropTypes.object,
148
+ prevItemRef: PropTypes.object
149
+ };
150
+ export default PressableItem;
@@ -0,0 +1,2 @@
1
+ export * from './ListboxContext';
2
+ export { default as PressableItem } from './PressableItem';
@@ -6,7 +6,7 @@ import NativeModal from "react-native-web/dist/exports/Modal";
6
6
  import Platform from "react-native-web/dist/exports/Platform";
7
7
  import PropTypes from 'prop-types';
8
8
  import { applyShadowToken, useThemeTokens } from '../ThemeProvider';
9
- import { a11yProps, copyPropTypes, getTokensPropType, selectSystemProps, useCopy, variantProp, viewProps, selectTokens } from '../utils';
9
+ import { a11yProps, copyPropTypes, getTokensPropType, selectSystemProps, useCopy, variantProp, viewProps } from '../utils';
10
10
  import { useViewport } from '../ViewportProvider';
11
11
  import IconButton from '../IconButton';
12
12
  import dictionary from './dictionary';
@@ -157,8 +157,7 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
157
157
  onPress: handleClose,
158
158
  icon: CloseIconComponent,
159
159
  accessibilityRole: "button",
160
- accessibilityLabel: closeLabel,
161
- tokens: selectTokens('IconButton', themeTokens, 'close')
160
+ accessibilityLabel: closeLabel
162
161
  })
163
162
  }), children]
164
163
  })
@@ -174,9 +173,25 @@ const Modal = /*#__PURE__*/forwardRef((_ref5, ref) => {
174
173
  Modal.displayName = 'Modal';
175
174
  Modal.propTypes = { ...selectedSystemPropTypes,
176
175
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
176
+
177
+ /**
178
+ * To define the locale of the copy
179
+ */
177
180
  copy: copyPropTypes,
181
+
182
+ /**
183
+ * Setting this to `true` will open the `Modal`
184
+ */
178
185
  isOpen: PropTypes.bool,
186
+
187
+ /**
188
+ * This function is triggered when the `Modal` is closed
189
+ */
179
190
  onClose: PropTypes.func,
191
+
192
+ /**
193
+ * `max-width` is applied to the `Modal` container
194
+ */
180
195
  maxWidth: PropTypes.bool,
181
196
  tokens: getTokensPropType('Modal'),
182
197
  variant: variantProp.propType,
@@ -1,5 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import View from "react-native-web/dist/exports/View";
4
+ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
3
5
  import { useThemeTokens, useThemeTokensCallback, applyTextStyles } from '../ThemeProvider';
4
6
  import { containUniqueFields, getTokensPropType, getPressHandlersWithArgs, selectTokens, useOverlaidPosition, useCopy, useMultipleInputValues, useResponsiveProp, variantProp } from '../utils';
5
7
  import dictionary from './dictionary';
@@ -282,11 +284,14 @@ const MultiSelectFilter = _ref3 => {
282
284
  isReady: isReady,
283
285
  onLayout: onTargetLayout,
284
286
  children: [/*#__PURE__*/_jsx(Row, {
285
- children: /*#__PURE__*/_jsx(Typography, {
286
- tokens: { ...headerStyles,
287
- lineHeight: headerLineHeight
288
- },
289
- children: getCopy('filterByLabel').replace(/%\{filterCategory\}/g, label.toLowerCase())
287
+ children: /*#__PURE__*/_jsx(View, {
288
+ style: styles.textContainerStyle,
289
+ children: /*#__PURE__*/_jsx(Typography, {
290
+ tokens: { ...headerStyles,
291
+ lineHeight: headerLineHeight
292
+ },
293
+ children: getCopy('filterByLabel').replace(/%\{filterCategory\}/g, label.toLowerCase())
294
+ })
290
295
  })
291
296
  }), subtitle && /*#__PURE__*/_jsxs(_Fragment, {
292
297
  children: [/*#__PURE__*/_jsx(Spacer, {
@@ -355,6 +360,11 @@ const MultiSelectFilter = _ref3 => {
355
360
  };
356
361
 
357
362
  MultiSelectFilter.displayName = 'MultiSelectFilter';
363
+ const styles = StyleSheet.create({
364
+ textContainerStyle: {
365
+ marginRight: 52
366
+ }
367
+ });
358
368
  MultiSelectFilter.propTypes = {
359
369
  /**
360
370
  * The text displayed to the user in a ButtonDropdown.
@@ -57,8 +57,20 @@ const PageButton = /*#__PURE__*/forwardRef((_ref, ref) => {
57
57
  });
58
58
  PageButton.displayName = 'PageButton';
59
59
  PageButton.propTypes = { ...linkProps.types,
60
+
61
+ /**
62
+ * To set custom label for the button
63
+ */
60
64
  label: PropTypes.string,
65
+
66
+ /**
67
+ * To set `PageButton` to active state
68
+ */
61
69
  isActive: PropTypes.bool,
70
+
71
+ /**
72
+ * To change the language for labels
73
+ */
62
74
  copy: copyPropTypes,
63
75
  variant: variantProp.propType,
64
76
  tokens: getTokensPropType('PaginationPageButton')
@@ -183,10 +183,22 @@ Pagination.PageButton = PageButton;
183
183
  Pagination.propTypes = { ...selectedSystemPropTypes,
184
184
  ...withLinkRouter.propTypes,
185
185
  children: componentPropType('PageButton'),
186
+
187
+ /**
188
+ * To change the language for labels
189
+ */
186
190
  copy: copyPropTypes,
187
191
  variant: variantProp.propType,
188
192
  tokens: getTokensPropType('Pagination'),
193
+
194
+ /**
195
+ * When passed as `{{ compact: true }}`, `Pagination` does not render labels along side buttons
196
+ */
189
197
  sideButtonVariant: variantProp.propType,
198
+
199
+ /**
200
+ * Custom tokens for `PaginationSideButton`
201
+ */
190
202
  sideButtonTokens: getTokensPropType('PaginationSideButton')
191
203
  };
192
204
  const staticStyles = StyleSheet.create({
@@ -62,8 +62,20 @@ const QuickLinks = /*#__PURE__*/forwardRef((_ref, ref) => {
62
62
  QuickLinks.displayName = 'QuickLinks';
63
63
  QuickLinks.propTypes = {
64
64
  tokens: getTokensPropType('QuickLinks'),
65
+
66
+ /**
67
+ * Custom tokens override for `Card`
68
+ */
65
69
  cardTokens: getTokensPropType('Card'),
70
+
71
+ /**
72
+ * Custom tokens override for `QuickLinksList`
73
+ */
66
74
  listTokens: getTokensPropType('QuickLinksList'),
75
+
76
+ /**
77
+ * The HTML tag to render the list as
78
+ */
67
79
  tag: PropTypes.string,
68
80
  variant: variantProp.propType,
69
81
  children: PropTypes.node
@@ -38,7 +38,14 @@ const Responsive = _ref => {
38
38
  };
39
39
 
40
40
  Responsive.propTypes = {
41
+ /**
42
+ * To hide children of `Responsive` if the current viewport is smaller than `min`
43
+ */
41
44
  min: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl']),
45
+
46
+ /**
47
+ * To hide children of `Responsive` if the current viewport is larger than `max`
48
+ */
42
49
  max: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
43
50
  children: PropTypes.node.isRequired
44
51
  };
@@ -17,5 +17,9 @@ const Group = _ref => {
17
17
  export default Group;
18
18
  Group.propTypes = {
19
19
  children: componentPropType('Item'),
20
+
21
+ /**
22
+ * The label for the group.
23
+ */
20
24
  label: PropTypes.string.isRequired
21
25
  };
@@ -11,5 +11,9 @@ const Group = _ref => {
11
11
  export default Group;
12
12
  Group.propTypes = {
13
13
  children: componentPropType('Item'),
14
+
15
+ /**
16
+ * The label for the group.
17
+ */
14
18
  label: PropTypes.string.isRequired
15
19
  };
@@ -16,5 +16,9 @@ const Item = _ref => {
16
16
  export default Item;
17
17
  Item.propTypes = {
18
18
  children: PropTypes.string.isRequired,
19
+
20
+ /**
21
+ * The value of the option
22
+ */
19
23
  value: PropTypes.string.isRequired
20
24
  };
@@ -122,6 +122,10 @@ ItemsGroup.propTypes = {
122
122
  isActive: PropTypes.bool,
123
123
  variant: variantProp.propType,
124
124
  tokens: getTokensPropType('SideNavItemsGroup'),
125
+
126
+ /**
127
+ * Custom tokens for `SideNav.Item`
128
+ */
125
129
  itemTokens: getTokensPropType('SideNavItem')
126
130
  };
127
131
  export default ItemsGroup;
@@ -128,7 +128,15 @@ SideNav.propTypes = { ...selectedSystemPropTypes,
128
128
  accordion: PropTypes.bool,
129
129
  variant: variantProp.propType,
130
130
  tokens: getTokensPropType('SideNav'),
131
+
132
+ /**
133
+ * Custom tokens for `SideNav.Item`
134
+ */
131
135
  itemTokens: getTokensPropType('SideNavItem'),
136
+
137
+ /**
138
+ * Custom tokens for `SideNavItemsGroup`
139
+ */
132
140
  groupTokens: getTokensPropType('SideNavItemsGroup')
133
141
  };
134
142
  SideNav.Item = Item;
@@ -168,12 +168,28 @@ const dictionaryContentShape = PropTypes.shape({
168
168
  stepTrackerLabel: PropTypes.string.isRequired
169
169
  });
170
170
  StepTracker.propTypes = { ...selectedSystemPropTypes,
171
+
172
+ /**
173
+ * The current step, 0-based number
174
+ */
171
175
  current: PropTypes.number,
176
+
177
+ /**
178
+ * The language to use for the labels
179
+ */
172
180
  copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), dictionaryContentShape]),
181
+
182
+ /**
183
+ * Custom dictionary containing the labels to use for the steps
184
+ */
173
185
  dictionary: PropTypes.shape({
174
186
  en: dictionaryContentShape,
175
187
  fr: dictionaryContentShape
176
188
  }),
189
+
190
+ /**
191
+ * An array of strings defining the step titles
192
+ */
177
193
  steps: PropTypes.arrayOf(PropTypes.string),
178
194
  tokens: getTokensPropType('StepTracker'),
179
195
  variant: variantProp.propType
@@ -132,6 +132,10 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
132
132
  Tabs.displayName = 'Tabs';
133
133
  Tabs.propTypes = { ...selectedSystemPropTypes,
134
134
  ...withLinkRouter.PropTypes,
135
+
136
+ /**
137
+ * Array of `TabsItem`s
138
+ */
135
139
  items: PropTypes.arrayOf(PropTypes.shape({ ...selectedItemPropTypes,
136
140
  ...withLinkRouter.PropTypes,
137
141
  href: PropTypes.string,
@@ -139,11 +143,27 @@ Tabs.propTypes = { ...selectedSystemPropTypes,
139
143
  id: PropTypes.string,
140
144
  ref: ABBPropTypes.ref()
141
145
  })),
146
+
147
+ /**
148
+ * `id` property of the current tab in the items array
149
+ */
142
150
  value: PropTypes.string,
143
151
  initialValue: PropTypes.string,
152
+
153
+ /**
154
+ * Callback for when the selected tab changes
155
+ */
144
156
  onChange: PropTypes.func,
145
157
  tokens: getTokensPropType('Tabs'),
158
+
159
+ /**
160
+ * Custom tokens for `TabsItem`
161
+ */
146
162
  itemTokens: getTokensPropType('TabsItem'),
163
+
164
+ /**
165
+ * Custom tokens for `HorizontalScrollButton`
166
+ */
147
167
  scrollButtonTokens: getTokensPropType('HorizontalScrollButton'),
148
168
  variant: variantProp.propType
149
169
  };
@@ -26,14 +26,14 @@ const selectDotStyles = _ref => {
26
26
 
27
27
  const selectConnectorStyles = _ref2 => {
28
28
  let {
29
- timelineColor,
29
+ timelineConnectorColor,
30
30
  connectorHeight,
31
31
  connectorWidth
32
32
  } = _ref2;
33
33
  return {
34
34
  width: connectorWidth,
35
35
  height: connectorHeight,
36
- backgroundColor: timelineColor
36
+ backgroundColor: timelineConnectorColor
37
37
  };
38
38
  };
39
39
 
@@ -4,6 +4,7 @@ export { default as Box } from './Box';
4
4
  export * from './Button';
5
5
  export { default as Card, PressableCardBase } from './Card';
6
6
  export * from './Carousel';
7
+ export * from './Listbox';
7
8
  export { default as Checkbox } from './Checkbox';
8
9
  export * from './Checkbox';
9
10
  export { default as Divider } from './Divider';
@@ -0,0 +1,22 @@
1
+ import PropTypes from 'prop-types';
2
+ const htmlAttrTypes = {
3
+ dataSet: PropTypes.object,
4
+ id: PropTypes.string,
5
+ loading: PropTypes.oneOf(['eager', 'lazy']),
6
+ // @todo figure out if we need to enum all the possible roles or maybe use
7
+ // an npm package
8
+ role: PropTypes.string,
9
+ src: PropTypes.string,
10
+ tabIndex: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
11
+ testID: PropTypes.string,
12
+ title: PropTypes.string
13
+ };
14
+ export default {
15
+ types: htmlAttrTypes,
16
+ select: props => Object.entries(props).reduce((items, _ref) => {
17
+ let [key, value] = _ref;
18
+ return Object.keys(htmlAttrTypes).includes(key) || /^(data|aria)-/.test(key) ? { ...items,
19
+ [key]: value
20
+ } : items;
21
+ }, {})
22
+ };
@@ -17,4 +17,5 @@ export { default as useUniqueId } from './useUniqueId';
17
17
  export { default as withLinkRouter } from './withLinkRouter';
18
18
  export * from './ssr';
19
19
  export { default as containUniqueFields } from './containUniqueFields';
20
- export { default as BaseView } from './BaseView';
20
+ export { default as BaseView } from './BaseView';
21
+ export { default as htmlAttrs } from './htmlAttrs';
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@floating-ui/react-native": "^0.8.1",
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@telus-uds/system-constants": "^1.2.1",
14
- "@telus-uds/system-theme-tokens": "^2.33.0",
14
+ "@telus-uds/system-theme-tokens": "^2.35.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "lodash.debounce": "^4.0.8",
17
17
  "lodash.merge": "^4.6.2",
@@ -72,5 +72,5 @@
72
72
  "standard-engine": {
73
73
  "skip": true
74
74
  },
75
- "version": "1.51.0"
75
+ "version": "1.52.0"
76
76
  }
@@ -31,7 +31,13 @@ A11yText.displayName = 'A11yText'
31
31
 
32
32
  A11yText.propTypes = {
33
33
  ...selectedSystemPropTypes,
34
+ /**
35
+ * Text to be read by screen readers
36
+ */
34
37
  text: PropTypes.string.isRequired,
38
+ /**
39
+ * Whether text should be rendered as a heading
40
+ */
35
41
  heading: PropTypes.bool
36
42
  }
37
43
 
@@ -101,6 +101,9 @@ Divider.displayName = 'Divider'
101
101
  Divider.propTypes = {
102
102
  ...selectedSystemPropTypes,
103
103
  tokens: getTokensPropType('Divider'),
104
+ /**
105
+ * A number referring to a position on the space scale to create space on either side of the divider
106
+ */
104
107
  space: spacingProps.types.spacingValue,
105
108
  variant: variantProp.propType,
106
109
  /**