@telus-uds/components-web 4.5.1 → 4.6.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,27 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Mon, 05 May 2025 21:28:44 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 23 May 2025 15:12:18 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 4.6.0
8
+
9
+ Fri, 23 May 2025 15:12:18 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Spinner`: missing attributes added (35577399+JoshHC@users.noreply.github.com)
14
+ - Bump @telus-uds/components-base to v3.8.0
15
+ - Bump @telus-uds/system-theme-tokens to v4.6.0
16
+
17
+ ### Patches
18
+
19
+ - `Card`: The inability to activate radio selection in `InteractiveCard` has been fixed (35577399+JoshHC@users.noreply.github.com)
20
+ - `List`: update snapshot (guillermo.peitzner@telus.com)
21
+
7
22
  ## 4.5.1
8
23
 
9
- Mon, 05 May 2025 21:28:44 GMT
24
+ Mon, 05 May 2025 21:30:13 GMT
10
25
 
11
26
  ### Patches
12
27
 
@@ -130,25 +130,20 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
130
130
  flexShrink: 1,
131
131
  justifyContent: 'space-between'
132
132
  };
133
- // When interactive area is present, spacing tokens should only be applied
134
- // to individual Card sections, not Card as a whole
135
- const {
136
- paddingTop,
137
- paddingBottom,
138
- paddingLeft,
139
- paddingRight,
140
- ...restOfTokens
141
- } = tokens;
142
133
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Card, {
143
134
  ref: ref,
144
135
  variant: {
145
136
  ...variant,
146
137
  padding: 'custom'
147
138
  },
148
- tokens: restOfTokens,
139
+ tokens: tokens,
149
140
  backgroundImage: backgroundImage,
141
+ onPress: onPress,
142
+ ...(interactiveCard?.selectionType && {
143
+ interactiveCard
144
+ }),
150
145
  ...selectProps(rest),
151
- children: [interactiveCard?.body ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.PressableCardBase, {
146
+ children: [interactiveCard?.body && !interactiveCard.selectionType ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.PressableCardBase, {
152
147
  ref: ref,
153
148
  tokens: getThemeTokens,
154
149
  dataSet: dataSet,
@@ -156,7 +151,9 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
156
151
  href: interactiveCard?.href,
157
152
  hrefAttrs: interactiveCard?.hrefAttrs,
158
153
  ...selectProps(rest),
159
- children: typeof interactiveCard?.body === 'function' ? interactiveCard.body() : interactiveCard.body
154
+ children: cardState => /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
155
+ children: typeof interactiveCard?.body === 'function' ? interactiveCard.body(cardState) : interactiveCard.body
156
+ })
160
157
  }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
161
158
  direction: contentStackDirection,
162
159
  tokens: {
@@ -249,6 +246,7 @@ Card.propTypes = {
249
246
  interactiveCard: _propTypes.default.shape({
250
247
  body: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
251
248
  tokens: (0, _componentsBase.getTokensPropType)('Card'),
249
+ selectionType: _propTypes.default.oneOf(['checkbox', 'radiogroup']),
252
250
  variant: _componentsBase.variantProp.propType,
253
251
  href: _propTypes.default.string,
254
252
  hrefAttrs: _propTypes.default.shape(_componentsBase.hrefAttrsProp.types)
@@ -42,34 +42,27 @@ const SpinnerContent = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
42
42
  size,
43
43
  thickness,
44
44
  isStatic,
45
+ showLabel = sizeVariant === _constants.LARGE,
45
46
  ...rest
46
47
  } = _ref2;
47
- const labelMapping = {
48
- top: 'column-reverse',
49
- bottom: 'column',
50
- left: 'row-reverse',
51
- right: 'row'
52
- };
53
48
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Container, {
54
49
  overlay: overlay,
55
50
  ref: ref,
56
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
57
- space: 3,
51
+ "aria-label": label,
52
+ role: "status",
53
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ActivityIndicator, {
54
+ role: "progressbar",
55
+ "aria-busy": "true",
56
+ "aria-valuetext": label,
57
+ label: label,
58
+ labelPosition: labelPosition,
59
+ showLabel: showLabel,
58
60
  tokens: {
59
- alignItems: 'center'
61
+ size,
62
+ thickness
60
63
  },
61
- direction: labelMapping[labelPosition],
62
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ActivityIndicator, {
63
- label: label,
64
- tokens: {
65
- size,
66
- thickness
67
- },
68
- isStatic: isStatic,
69
- ...selectProps(rest)
70
- }), sizeVariant === _constants.LARGE && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
71
- children: label
72
- })]
64
+ isStatic: isStatic,
65
+ ...selectProps(rest)
73
66
  })
74
67
  });
75
68
  });
@@ -8,7 +8,7 @@ import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps }
8
8
  import ConditionalWrapper from '../shared/ConditionalWrapper';
9
9
 
10
10
  // Passes React Native-oriented system props through UDS Card
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
13
13
 
14
14
  /**
@@ -122,25 +122,20 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
122
122
  flexShrink: 1,
123
123
  justifyContent: 'space-between'
124
124
  };
125
- // When interactive area is present, spacing tokens should only be applied
126
- // to individual Card sections, not Card as a whole
127
- const {
128
- paddingTop,
129
- paddingBottom,
130
- paddingLeft,
131
- paddingRight,
132
- ...restOfTokens
133
- } = tokens;
134
125
  return /*#__PURE__*/_jsxs(CardBase, {
135
126
  ref: ref,
136
127
  variant: {
137
128
  ...variant,
138
129
  padding: 'custom'
139
130
  },
140
- tokens: restOfTokens,
131
+ tokens: tokens,
141
132
  backgroundImage: backgroundImage,
133
+ onPress: onPress,
134
+ ...(interactiveCard?.selectionType && {
135
+ interactiveCard
136
+ }),
142
137
  ...selectProps(rest),
143
- children: [interactiveCard?.body ? /*#__PURE__*/_jsx(PressableCardBase, {
138
+ children: [interactiveCard?.body && !interactiveCard.selectionType ? /*#__PURE__*/_jsx(PressableCardBase, {
144
139
  ref: ref,
145
140
  tokens: getThemeTokens,
146
141
  dataSet: dataSet,
@@ -148,7 +143,9 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
148
143
  href: interactiveCard?.href,
149
144
  hrefAttrs: interactiveCard?.hrefAttrs,
150
145
  ...selectProps(rest),
151
- children: typeof interactiveCard?.body === 'function' ? interactiveCard.body() : interactiveCard.body
146
+ children: cardState => /*#__PURE__*/_jsx(_Fragment, {
147
+ children: typeof interactiveCard?.body === 'function' ? interactiveCard.body(cardState) : interactiveCard.body
148
+ })
152
149
  }) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
153
150
  direction: contentStackDirection,
154
151
  tokens: {
@@ -241,6 +238,7 @@ Card.propTypes = {
241
238
  interactiveCard: PropTypes.shape({
242
239
  body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
243
240
  tokens: getTokensPropType('Card'),
241
+ selectionType: PropTypes.oneOf(['checkbox', 'radiogroup']),
244
242
  variant: variantProp.propType,
245
243
  href: PropTypes.string,
246
244
  hrefAttrs: PropTypes.shape(hrefAttrsProp.types)
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { ActivityIndicator, StackView, Typography, selectSystemProps } from '@telus-uds/components-base';
3
+ import { ActivityIndicator, selectSystemProps } from '@telus-uds/components-base';
4
4
  import styled from 'styled-components';
5
5
  import { htmlAttrs } from '../utils';
6
6
  import { BACKDROP_Z_INDEX, LARGE } from './constants';
7
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
9
9
  const Container = /*#__PURE__*/styled.div.withConfig({
10
10
  displayName: "SpinnerContent__Container",
@@ -35,34 +35,27 @@ const SpinnerContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
35
35
  size,
36
36
  thickness,
37
37
  isStatic,
38
+ showLabel = sizeVariant === LARGE,
38
39
  ...rest
39
40
  } = _ref2;
40
- const labelMapping = {
41
- top: 'column-reverse',
42
- bottom: 'column',
43
- left: 'row-reverse',
44
- right: 'row'
45
- };
46
41
  return /*#__PURE__*/_jsx(Container, {
47
42
  overlay: overlay,
48
43
  ref: ref,
49
- children: /*#__PURE__*/_jsxs(StackView, {
50
- space: 3,
44
+ "aria-label": label,
45
+ role: "status",
46
+ children: /*#__PURE__*/_jsx(ActivityIndicator, {
47
+ role: "progressbar",
48
+ "aria-busy": "true",
49
+ "aria-valuetext": label,
50
+ label: label,
51
+ labelPosition: labelPosition,
52
+ showLabel: showLabel,
51
53
  tokens: {
52
- alignItems: 'center'
54
+ size,
55
+ thickness
53
56
  },
54
- direction: labelMapping[labelPosition],
55
- children: [/*#__PURE__*/_jsx(ActivityIndicator, {
56
- label: label,
57
- tokens: {
58
- size,
59
- thickness
60
- },
61
- isStatic: isStatic,
62
- ...selectProps(rest)
63
- }), sizeVariant === LARGE && /*#__PURE__*/_jsx(Typography, {
64
- children: label
65
- })]
57
+ isStatic: isStatic,
58
+ ...selectProps(rest)
66
59
  })
67
60
  });
68
61
  });
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "^3.7.1",
8
+ "@telus-uds/components-base": "^3.8.0",
9
9
  "@telus-uds/system-constants": "^3.0.0",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
@@ -13,7 +13,7 @@
13
13
  "react-dates": "^21.8.0",
14
14
  "react-helmet-async": "^1.3.0",
15
15
  "react-moment-proptypes": "^1.8.1",
16
- "@telus-uds/system-theme-tokens": "^4.5.0",
16
+ "@telus-uds/system-theme-tokens": "^4.6.0",
17
17
  "prop-types": "^15.7.2",
18
18
  "lodash.throttle": "^4.1.1",
19
19
  "react-youtube": "^10.1.0",
@@ -82,5 +82,5 @@
82
82
  "skip": true
83
83
  },
84
84
  "types": "types/index.d.ts",
85
- "version": "4.5.1"
85
+ "version": "4.6.0"
86
86
  }
package/src/Card/Card.jsx CHANGED
@@ -135,19 +135,18 @@ const Card = React.forwardRef(
135
135
  flexShrink: 1,
136
136
  justifyContent: 'space-between'
137
137
  }
138
- // When interactive area is present, spacing tokens should only be applied
139
- // to individual Card sections, not Card as a whole
140
- const { paddingTop, paddingBottom, paddingLeft, paddingRight, ...restOfTokens } = tokens
141
138
 
142
139
  return (
143
140
  <CardBase
144
141
  ref={ref}
145
142
  variant={{ ...variant, padding: 'custom' }}
146
- tokens={restOfTokens}
143
+ tokens={tokens}
147
144
  backgroundImage={backgroundImage}
145
+ onPress={onPress}
146
+ {...(interactiveCard?.selectionType && { interactiveCard })}
148
147
  {...selectProps(rest)}
149
148
  >
150
- {interactiveCard?.body ? (
149
+ {interactiveCard?.body && !interactiveCard.selectionType ? (
151
150
  <PressableCardBase
152
151
  ref={ref}
153
152
  tokens={getThemeTokens}
@@ -157,9 +156,13 @@ const Card = React.forwardRef(
157
156
  hrefAttrs={interactiveCard?.hrefAttrs}
158
157
  {...selectProps(rest)}
159
158
  >
160
- {typeof interactiveCard?.body === 'function'
161
- ? interactiveCard.body()
162
- : interactiveCard.body}
159
+ {(cardState) => (
160
+ <>
161
+ {typeof interactiveCard?.body === 'function'
162
+ ? interactiveCard.body(cardState)
163
+ : interactiveCard.body}
164
+ </>
165
+ )}
163
166
  </PressableCardBase>
164
167
  ) : null}
165
168
  {children || fullBleedContentPosition !== 'none' ? (
@@ -263,6 +266,7 @@ Card.propTypes = {
263
266
  interactiveCard: PropTypes.shape({
264
267
  body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
265
268
  tokens: getTokensPropType('Card'),
269
+ selectionType: PropTypes.oneOf(['checkbox', 'radiogroup']),
266
270
  variant: variantProp.propType,
267
271
  href: PropTypes.string,
268
272
  hrefAttrs: PropTypes.shape(hrefAttrsProp.types)
@@ -1,11 +1,6 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import {
4
- ActivityIndicator,
5
- StackView,
6
- Typography,
7
- selectSystemProps
8
- } from '@telus-uds/components-base'
3
+ import { ActivityIndicator, selectSystemProps } from '@telus-uds/components-base'
9
4
  import styled from 'styled-components'
10
5
  import { htmlAttrs } from '../utils'
11
6
  import { BACKDROP_Z_INDEX, LARGE } from './constants'
@@ -27,31 +22,32 @@ const Container = styled.div(({ overlay }) => ({
27
22
 
28
23
  const SpinnerContent = React.forwardRef(
29
24
  (
30
- { label, labelPosition, overlay = false, sizeVariant, size, thickness, isStatic, ...rest },
25
+ {
26
+ label,
27
+ labelPosition,
28
+ overlay = false,
29
+ sizeVariant,
30
+ size,
31
+ thickness,
32
+ isStatic,
33
+ showLabel = sizeVariant === LARGE,
34
+ ...rest
35
+ },
31
36
  ref
32
37
  ) => {
33
- const labelMapping = {
34
- top: 'column-reverse',
35
- bottom: 'column',
36
- left: 'row-reverse',
37
- right: 'row'
38
- }
39
-
40
38
  return (
41
- <Container overlay={overlay} ref={ref}>
42
- <StackView
43
- space={3}
44
- tokens={{ alignItems: 'center' }}
45
- direction={labelMapping[labelPosition]}
46
- >
47
- <ActivityIndicator
48
- label={label}
49
- tokens={{ size, thickness }}
50
- isStatic={isStatic}
51
- {...selectProps(rest)}
52
- />
53
- {sizeVariant === LARGE && <Typography>{label}</Typography>}
54
- </StackView>
39
+ <Container overlay={overlay} ref={ref} aria-label={label} role="status">
40
+ <ActivityIndicator
41
+ role="progressbar"
42
+ aria-busy="true"
43
+ aria-valuetext={label}
44
+ label={label}
45
+ labelPosition={labelPosition}
46
+ showLabel={showLabel}
47
+ tokens={{ size, thickness }}
48
+ isStatic={isStatic}
49
+ {...selectProps(rest)}
50
+ />
55
51
  </Container>
56
52
  )
57
53
  }