@telus-uds/components-web 2.2.0 → 2.3.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,26 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Wed, 24 May 2023 23:40:09 GMT and should not be manually modified.
3
+ This log was last generated on Sat, 27 May 2023 00:37:34 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.3.0
8
+
9
+ Sat, 27 May 2023 00:37:34 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - chore: test update for list (samuraix221@hotmail.com)
14
+ - Bump @telus-uds/components-base to v1.45.0
15
+ - Bump @telus-uds/system-theme-tokens to v2.28.0
16
+
17
+ ### Patches
18
+
19
+ - Fix an issue where some tokens might not work on `Card` (shahzaibkhalidmalik@outlook.com)
20
+
7
21
  ## 2.2.0
8
22
 
9
- Wed, 24 May 2023 23:40:09 GMT
23
+ Wed, 24 May 2023 23:46:34 GMT
10
24
 
11
25
  ### Minor changes
12
26
 
@@ -10106,7 +10106,14 @@
10106
10106
  "name": "custom",
10107
10107
  "raw": {
10108
10108
  "space": "integer",
10109
- "fieldSpace": "integer"
10109
+ "fieldSpace": "integer",
10110
+ "showIcon": "show",
10111
+ "outlineWidth": "border",
10112
+ "borderBottomLeftRadius": "radius",
10113
+ "borderBottomRightRadius": "radius",
10114
+ "borderTopLeftRadius": "radius",
10115
+ "borderTopRightRadius": "radius",
10116
+ "outlineOffset": "size"
10110
10117
  }
10111
10118
  },
10112
10119
  "required": false,
package/lib/Card/Card.js CHANGED
@@ -26,7 +26,26 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
26
26
  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; }
27
27
 
28
28
  /* eslint-disable react/require-default-props */
29
- // Passes React Native-oriented system props through UDS Card
29
+ const selectCardBaseTokens = _ref => {
30
+ let {
31
+ backgroundColor,
32
+ borderColor,
33
+ borderWidth,
34
+ borderRadius,
35
+ shadow,
36
+ minWidth
37
+ } = _ref;
38
+ return {
39
+ backgroundColor,
40
+ borderColor,
41
+ borderWidth,
42
+ borderRadius,
43
+ shadow,
44
+ minWidth
45
+ };
46
+ }; // Passes React Native-oriented system props through UDS Card
47
+
48
+
30
49
  const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
31
50
  /**
32
51
  * A basic card component, unstyled by default.
@@ -81,11 +100,9 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
81
100
  } = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent); // If the card has rounded corners and a full bleed image, we need to apply
82
101
  // those corners on the image as well, but partially
83
102
 
84
- const {
85
- borderRadius
86
- } = (0, _componentsBase.useThemeTokens)('Card', tokens, variant);
103
+ const cardTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, variant);
87
104
  const hasFooter = Boolean(footer);
88
- const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(borderRadius, fullBleedContentPosition, hasFooter); // Make multiple cards in a row have equal heights with even space between content items
105
+ const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter); // Make multiple cards in a row have equal heights with even space between content items
89
106
 
90
107
  const columnFlex = {
91
108
  flexGrow: 1,
@@ -97,6 +114,7 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
97
114
  variant: { ...variant,
98
115
  padding: 'custom'
99
116
  },
117
+ tokens: selectCardBaseTokens(cardTokens),
100
118
  ...selectProps(rest),
101
119
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
102
120
  space: 0,
@@ -26,20 +26,18 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
26
26
  componentId: "components-web__sc-1k2501q-0"
27
27
  })(_ref => {
28
28
  let {
29
- backgroundColor,
30
29
  borderRadius,
31
30
  paddingBottom,
32
31
  paddingLeft,
33
32
  paddingRight,
34
33
  paddingTop,
35
34
  withFooter,
36
- contentAlignItem: alignItem,
35
+ contentAlignItems: alignItems,
37
36
  contentFlexGrow: flexGrow,
38
37
  contentFlexShrink: flexShrink,
39
38
  contentJustifyContent: justifyContent
40
39
  } = _ref;
41
40
  return {
42
- backgroundColor,
43
41
  // We need to make sure to have sharp corners on the bottom
44
42
  // if the card has a footer
45
43
  borderBottomLeftRadius: withFooter ? 0 : borderRadius,
@@ -52,7 +50,7 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
52
50
  paddingTop,
53
51
  display: 'flex',
54
52
  flexDirection: 'column',
55
- alignItem,
53
+ alignItems,
56
54
  flexGrow,
57
55
  flexShrink,
58
56
  justifyContent
@@ -4,10 +4,30 @@ import PropTypes from 'prop-types';
4
4
  import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, variantProp, a11yProps, viewProps } from '@telus-uds/components-base';
5
5
  import CardContent from './CardContent';
6
6
  import CardFooter from './CardFooter';
7
- import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent'; // Passes React Native-oriented system props through UDS Card
8
-
7
+ import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
9
8
  import { jsx as _jsx } from "react/jsx-runtime";
10
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
+
11
+ const selectCardBaseTokens = _ref => {
12
+ let {
13
+ backgroundColor,
14
+ borderColor,
15
+ borderWidth,
16
+ borderRadius,
17
+ shadow,
18
+ minWidth
19
+ } = _ref;
20
+ return {
21
+ backgroundColor,
22
+ borderColor,
23
+ borderWidth,
24
+ borderRadius,
25
+ shadow,
26
+ minWidth
27
+ };
28
+ }; // Passes React Native-oriented system props through UDS Card
29
+
30
+
11
31
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
12
32
  /**
13
33
  * A basic card component, unstyled by default.
@@ -62,11 +82,9 @@ const Card = /*#__PURE__*/forwardRef(function () {
62
82
  } = useFullBleedContentProps(fullBleedContent); // If the card has rounded corners and a full bleed image, we need to apply
63
83
  // those corners on the image as well, but partially
64
84
 
65
- const {
66
- borderRadius
67
- } = useThemeTokens('Card', tokens, variant);
85
+ const cardTokens = useThemeTokens('Card', tokens, variant);
68
86
  const hasFooter = Boolean(footer);
69
- const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter); // Make multiple cards in a row have equal heights with even space between content items
87
+ const fullBleedBorderRadius = getFullBleedBorderRadius(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter); // Make multiple cards in a row have equal heights with even space between content items
70
88
 
71
89
  const columnFlex = {
72
90
  flexGrow: 1,
@@ -78,6 +96,7 @@ const Card = /*#__PURE__*/forwardRef(function () {
78
96
  variant: { ...variant,
79
97
  padding: 'custom'
80
98
  },
99
+ tokens: selectCardBaseTokens(cardTokens),
81
100
  ...selectProps(rest),
82
101
  children: /*#__PURE__*/_jsxs(StackView, {
83
102
  space: 0,
@@ -10,20 +10,18 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
10
10
  componentId: "components-web__sc-1k2501q-0"
11
11
  })(_ref => {
12
12
  let {
13
- backgroundColor,
14
13
  borderRadius,
15
14
  paddingBottom,
16
15
  paddingLeft,
17
16
  paddingRight,
18
17
  paddingTop,
19
18
  withFooter,
20
- contentAlignItem: alignItem,
19
+ contentAlignItems: alignItems,
21
20
  contentFlexGrow: flexGrow,
22
21
  contentFlexShrink: flexShrink,
23
22
  contentJustifyContent: justifyContent
24
23
  } = _ref;
25
24
  return {
26
- backgroundColor,
27
25
  // We need to make sure to have sharp corners on the bottom
28
26
  // if the card has a footer
29
27
  borderBottomLeftRadius: withFooter ? 0 : borderRadius,
@@ -36,7 +34,7 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
36
34
  paddingTop,
37
35
  display: 'flex',
38
36
  flexDirection: 'column',
39
- alignItem,
37
+ alignItems,
40
38
  flexGrow,
41
39
  flexShrink,
42
40
  justifyContent
package/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.44.0",
8
+ "@telus-uds/components-base": "1.45.0",
9
9
  "@telus-uds/system-constants": "^1.2.1",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
12
12
  "react-dates": "^21.8.0",
13
13
  "react-helmet-async": "^1.3.0",
14
14
  "react-moment-proptypes": "^1.8.1",
15
- "@telus-uds/system-theme-tokens": "^2.27.0",
15
+ "@telus-uds/system-theme-tokens": "^2.28.0",
16
16
  "prop-types": "^15.7.2",
17
17
  "lodash.throttle": "^4.1.1",
18
18
  "react-youtube": "^10.1.0"
@@ -62,5 +62,5 @@
62
62
  "skip": true
63
63
  },
64
64
  "types": "types/index.d.ts",
65
- "version": "2.2.0"
65
+ "version": "2.3.0"
66
66
  }
package/src/Card/Card.jsx CHANGED
@@ -20,6 +20,22 @@ import FullBleedContent, {
20
20
  useFullBleedContentProps
21
21
  } from '../shared/FullBleedContent'
22
22
 
23
+ const selectCardBaseTokens = ({
24
+ backgroundColor,
25
+ borderColor,
26
+ borderWidth,
27
+ borderRadius,
28
+ shadow,
29
+ minWidth
30
+ }) => ({
31
+ backgroundColor,
32
+ borderColor,
33
+ borderWidth,
34
+ borderRadius,
35
+ shadow,
36
+ minWidth
37
+ })
38
+
23
39
  // Passes React Native-oriented system props through UDS Card
24
40
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
25
41
 
@@ -76,10 +92,10 @@ const Card = forwardRef(
76
92
 
77
93
  // If the card has rounded corners and a full bleed image, we need to apply
78
94
  // those corners on the image as well, but partially
79
- const { borderRadius } = useThemeTokens('Card', tokens, variant)
95
+ const cardTokens = useThemeTokens('Card', tokens, variant)
80
96
  const hasFooter = Boolean(footer)
81
97
  const fullBleedBorderRadius = getFullBleedBorderRadius(
82
- borderRadius,
98
+ cardTokens?.borderRadius,
83
99
  fullBleedContentPosition,
84
100
  hasFooter
85
101
  )
@@ -92,7 +108,12 @@ const Card = forwardRef(
92
108
  }
93
109
 
94
110
  return (
95
- <CardBase ref={ref} variant={{ ...variant, padding: 'custom' }} {...selectProps(rest)}>
111
+ <CardBase
112
+ ref={ref}
113
+ variant={{ ...variant, padding: 'custom' }}
114
+ tokens={selectCardBaseTokens(cardTokens)}
115
+ {...selectProps(rest)}
116
+ >
96
117
  <StackView space={0} tokens={columnFlex}>
97
118
  <StackView
98
119
  direction={contentStackDirection}
@@ -14,19 +14,17 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
14
14
 
15
15
  const CardContentContainer = styled.div(
16
16
  ({
17
- backgroundColor,
18
17
  borderRadius,
19
18
  paddingBottom,
20
19
  paddingLeft,
21
20
  paddingRight,
22
21
  paddingTop,
23
22
  withFooter,
24
- contentAlignItem: alignItem,
23
+ contentAlignItems: alignItems,
25
24
  contentFlexGrow: flexGrow,
26
25
  contentFlexShrink: flexShrink,
27
26
  contentJustifyContent: justifyContent
28
27
  }) => ({
29
- backgroundColor,
30
28
  // We need to make sure to have sharp corners on the bottom
31
29
  // if the card has a footer
32
30
  borderBottomLeftRadius: withFooter ? 0 : borderRadius,
@@ -39,7 +37,7 @@ const CardContentContainer = styled.div(
39
37
  paddingTop,
40
38
  display: 'flex',
41
39
  flexDirection: 'column',
42
- alignItem,
40
+ alignItems,
43
41
  flexGrow,
44
42
  flexShrink,
45
43
  justifyContent