@telus-uds/components-web 2.37.0 → 2.39.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 (35) hide show
  1. package/CHANGELOG.md +35 -2
  2. package/lib/Card/Card.js +62 -8
  3. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +8 -1
  4. package/lib/Footnote/Footnote.js +3 -3
  5. package/lib/OrderedList/Item.js +8 -6
  6. package/lib/OrderedList/OrderedList.js +17 -10
  7. package/lib/QuantitySelector/dictionary.js +12 -12
  8. package/lib/Ribbon/Ribbon.js +1 -1
  9. package/lib/Table/Table.js +3 -1
  10. package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +30 -0
  11. package/lib/shared/ConditionalWrapper/index.js +10 -0
  12. package/lib/utils/theming/with-client-theme.js +1 -1
  13. package/lib-module/Card/Card.js +62 -8
  14. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +8 -1
  15. package/lib-module/Footnote/Footnote.js +3 -3
  16. package/lib-module/OrderedList/Item.js +8 -6
  17. package/lib-module/OrderedList/OrderedList.js +18 -11
  18. package/lib-module/QuantitySelector/dictionary.js +12 -12
  19. package/lib-module/Ribbon/Ribbon.js +1 -1
  20. package/lib-module/Table/Table.js +3 -1
  21. package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +22 -0
  22. package/lib-module/shared/ConditionalWrapper/index.js +2 -0
  23. package/lib-module/utils/theming/with-client-theme.js +1 -1
  24. package/package.json +3 -3
  25. package/src/Card/Card.jsx +56 -4
  26. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +12 -3
  27. package/src/Footnote/Footnote.jsx +3 -3
  28. package/src/OrderedList/Item.jsx +7 -6
  29. package/src/OrderedList/OrderedList.jsx +32 -29
  30. package/src/QuantitySelector/dictionary.js +14 -12
  31. package/src/Ribbon/Ribbon.jsx +1 -0
  32. package/src/Table/Table.jsx +2 -1
  33. package/src/shared/ConditionalWrapper/ConditionalWrapper.jsx +14 -0
  34. package/src/shared/ConditionalWrapper/index.js +3 -0
  35. package/src/utils/theming/with-client-theme.jsx +1 -1
package/CHANGELOG.md CHANGED
@@ -1,12 +1,45 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Fri, 26 Jul 2024 21:17:56 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 22 Aug 2024 18:17:39 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.39.0
8
+
9
+ Thu, 22 Aug 2024 18:17:39 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `Card`: `plain` variant added (35577399+JoshHC@users.noreply.github.com)
14
+ - `FullBleedContent`: add imgCol and position prop to allow for image size adjustment (<tony.eng@telus.com>)
15
+ - `Card`: use ConditionalWrapper on CardContent and FullBleedContent to dynamically set width of full bleed image (<tony.eng@telus.com>)
16
+ - Bump @telus-uds/components-base to v1.92.0
17
+ - Bump @telus-uds/system-theme-tokens to v2.62.0
18
+
19
+ ### Patches
20
+
21
+ - `Image`: fix border-radius token override and default border-radius (guillermo.peitzner@telus.com)
22
+ - `Table`: fix unexpected horizontal scrolling on table component (jaime.tuyuc@telus.com)
23
+
24
+ ## 2.38.0
25
+
26
+ Mon, 12 Aug 2024 06:35:32 GMT
27
+
28
+ ### Minor changes
29
+
30
+ - `ExpandCollapseMini`: Add `initialOpen` prop to control the expand behavior on first render (jaime.tuyuc@telus.com)
31
+ - OrderedList: add itemTextColor token and pass tokens down to children (jacqui.koroll@telus.com)
32
+ - Bump @telus-uds/components-base to v1.91.0
33
+ - Bump @telus-uds/system-theme-tokens to v2.61.0
34
+
35
+ ### Patches
36
+
37
+ - Ribbon: add overflow hidden to fix sharp ribbon curve (jacqui.koroll@telus.com)
38
+ - QuantitySelector: update default dictionary values (jacqui.koroll@telus.com)
39
+
7
40
  ## 2.37.0
8
41
 
9
- Fri, 26 Jul 2024 21:17:56 GMT
42
+ Fri, 26 Jul 2024 21:24:32 GMT
10
43
 
11
44
  ### Minor changes
12
45
 
package/lib/Card/Card.js CHANGED
@@ -7,9 +7,12 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _componentsBase = require("@telus-uds/components-base");
10
+ var _componentsWeb = require("@telus-uds/components-web");
11
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
10
12
  var _CardContent = _interopRequireDefault(require("./CardContent"));
11
13
  var _CardFooter = _interopRequireDefault(require("./CardFooter"));
12
14
  var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
15
+ var _ConditionalWrapper = _interopRequireDefault(require("../shared/ConditionalWrapper"));
13
16
  var _jsxRuntime = require("react/jsx-runtime");
14
17
  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); }
15
18
  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; }
@@ -34,6 +37,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
34
37
  * - `alt`: alt tag for an image,
35
38
  * - `src`: default image source,
36
39
  * - `position`: `none`, `bottom`, `left`, `right` or `top`, depending on where you would like your full bleed image to be placed,
40
+ * - `imgCol`: set the span of the image per viewport (based on 12 column value for width of card) when `position` of image is on `left` or `right`
37
41
  * - all the props from the `ResponsiveImage` component in case you want that full bleed image to be responsive,
38
42
  * - `content`: pass a custom JSX to be used for rendering of the full bleed content (defaults to `ResponsiveImage`
39
43
  * receiving the other props).
@@ -45,6 +49,23 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
45
49
  * ## Accessibility
46
50
  * `Card` component accepts all the standard accessibility props.
47
51
  */
52
+ const DynamicWidthContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
53
+ displayName: "Card__DynamicWidthContainer",
54
+ componentId: "components-web__sc-1elbtwd-0"
55
+ })(_ref => {
56
+ let {
57
+ width,
58
+ display,
59
+ borderRadius,
60
+ overflow
61
+ } = _ref;
62
+ return {
63
+ width,
64
+ display,
65
+ borderRadius,
66
+ overflow
67
+ };
68
+ });
48
69
  const Card = /*#__PURE__*/_react.default.forwardRef(function () {
49
70
  let {
50
71
  children,
@@ -70,6 +91,9 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
70
91
  fullBleedContentPosition,
71
92
  fullBleedContentProps
72
93
  } = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent);
94
+ const {
95
+ imgCol
96
+ } = fullBleedContentProps;
73
97
 
74
98
  // If the card has rounded corners and a full bleed image, we need to apply
75
99
  // those corners on the image as well, but partially
@@ -82,6 +106,25 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
82
106
  });
83
107
  const hasFooter = Boolean(footer);
84
108
  const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(borderRadius, fullBleedContentPosition, hasFooter);
109
+
110
+ // takes imgCol from fullBleedContent if present, to dynamically set width of image
111
+ // card content will adapt to the size of image to add up to 100% width of card width
112
+ // pass as props to ConditionalWrapper
113
+ const imgColCurrentViewport = (0, _componentsWeb.useResponsiveProp)(imgCol);
114
+ const maxCol = 12;
115
+ const fullBleedImageWidth = `${imgColCurrentViewport / maxCol * 100}%`;
116
+ const adaptiveContentWidth = `${(maxCol - imgColCurrentViewport) / maxCol * 100}%`;
117
+ const isImageWidthAdjustable = imgCol && (fullBleedContentPosition === 'left' || fullBleedContentPosition === 'right');
118
+ const contentWrapperStyleProps = {
119
+ width: adaptiveContentWidth,
120
+ display: imgColCurrentViewport >= maxCol ? 'none' : undefined
121
+ };
122
+ const imageWrapperStyleProps = {
123
+ width: fullBleedImageWidth,
124
+ borderRadius: imgColCurrentViewport >= maxCol ? borderRadius : undefined,
125
+ overflow: imgColCurrentViewport >= maxCol ? 'hidden' : undefined,
126
+ display: imgColCurrentViewport === 0 ? 'none' : undefined
127
+ };
85
128
  const columnFlex = {
86
129
  flexGrow: interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? 0 : 1,
87
130
  flexShrink: 1,
@@ -118,14 +161,25 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
118
161
  alignItems: contentStackAlign
119
162
  },
120
163
  space: 0,
121
- children: [children ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardContent.default, {
122
- tokens: tokens,
123
- variant: variant,
124
- withFooter: hasFooter,
125
- children: children
126
- }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullBleedContent.default, {
127
- borderRadius: fullBleedBorderRadius,
128
- ...fullBleedContentProps
164
+ children: [children ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
165
+ WrapperComponent: DynamicWidthContainer,
166
+ wrapperProps: contentWrapperStyleProps,
167
+ condition: isImageWidthAdjustable,
168
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardContent.default, {
169
+ tokens: tokens,
170
+ variant: variant,
171
+ withFooter: hasFooter,
172
+ children: children
173
+ })
174
+ }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
175
+ WrapperComponent: DynamicWidthContainer,
176
+ wrapperProps: imageWrapperStyleProps,
177
+ condition: isImageWidthAdjustable,
178
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullBleedContent.default, {
179
+ borderRadius: fullBleedBorderRadius,
180
+ ...fullBleedContentProps,
181
+ position: fullBleedContentPosition
182
+ })
129
183
  })]
130
184
  }) : null, footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardFooter.default, {
131
185
  padding: footerPadding,
@@ -16,8 +16,10 @@ const ExpandCollapseMini = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
16
16
  onToggle = () => {},
17
17
  tokens = {},
18
18
  nativeID,
19
+ initialOpen = false,
19
20
  ...rest
20
21
  } = _ref;
22
+ const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel';
21
23
  const handleChange = (openPanels, event) => {
22
24
  if (typeof onToggle === 'function') {
23
25
  const isOpen = openPanels.length > 0;
@@ -27,9 +29,10 @@ const ExpandCollapseMini = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
27
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
28
30
  onChange: handleChange,
29
31
  tokens: tokens,
32
+ initialOpen: initialOpen ? [expandCollapeMiniPanelId] : [],
30
33
  children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, {
31
34
  ...expandProps,
32
- panelId: "ExpandCollapseMiniPanel",
35
+ panelId: expandCollapeMiniPanelId,
33
36
  variant: {
34
37
  mini: true
35
38
  },
@@ -68,6 +71,10 @@ ExpandCollapseMini.propTypes = {
68
71
  * Children nodes that can be added
69
72
  */
70
73
  children: _propTypes.default.node.isRequired,
74
+ /**
75
+ * Controls if the panel and the content is opened by default on the first load
76
+ */
77
+ initialOpen: _propTypes.default.bool,
71
78
  tokens: (0, _componentsBase.getTokensPropType)('ExpandCollapseMini')
72
79
  };
73
80
  var _default = ExpandCollapseMini;
@@ -152,13 +152,13 @@ const ListItem = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.de
152
152
  return {
153
153
  display: 'list-item',
154
154
  '&::marker': {
155
- fontFamily: 'HelveticaNow400normal',
155
+ fontFamily: 'HNforTELUSSA400normal',
156
156
  fontSize: listItemMarkerFontSize,
157
157
  lineHeight: listItemMarkerLineHeight,
158
158
  textAlign: 'end !important'
159
159
  },
160
160
  color: listItemColor,
161
- fontFamily: 'HelveticaNow400normal',
161
+ fontFamily: 'HNforTELUSSA400normal',
162
162
  fontSize: listItemFontSize,
163
163
  lineHeight: listItemLineHeight,
164
164
  paddingLeft: listItemPaddingLeft
@@ -220,7 +220,7 @@ const StyledCustomContentContainer = /*#__PURE__*/_styledComponents.default.div.
220
220
  lineHeight: listItemLineHeight,
221
221
  paddingLeft: listItemPaddingLeft,
222
222
  color: listItemColor,
223
- fontFamily: 'HelveticaNow400normal'
223
+ fontFamily: 'HNforTELUSSA400normal'
224
224
  };
225
225
  });
226
226
  const usePrevious = value => {
@@ -20,13 +20,14 @@ const selectItemTextStyles = (_ref, themeOptions) => {
20
20
  itemFontSize,
21
21
  itemLineHeight,
22
22
  itemFontName,
23
- itemColor
23
+ itemColor,
24
+ itemTextColor
24
25
  } = _ref;
25
26
  return (0, _componentsBase.applyTextStyles)({
26
27
  fontWeight: itemFontWeight,
27
28
  fontSize: itemFontSize,
28
29
  fontName: itemFontName,
29
- color: itemColor,
30
+ color: itemColor || itemTextColor,
30
31
  themeOptions,
31
32
  lineHeight: itemLineHeight
32
33
  });
@@ -45,14 +46,15 @@ const StyledItemBase = /*#__PURE__*/(0, _styledComponents.default)(_ItemBase.def
45
46
  itemLineHeight,
46
47
  themeOptions,
47
48
  listGutter,
48
- itemColor
49
+ itemColor,
50
+ itemTextColor
49
51
  } = _ref2;
50
52
  return {
51
53
  counterIncrement: _constants.OL_COUNTER_NAME,
52
54
  '::before': {
53
55
  content: `counter(${_constants.OL_COUNTER_NAME})'.'`,
54
56
  display: 'inline-flex',
55
- color: itemColor,
57
+ color: itemColor || itemTextColor,
56
58
  width: itemBulletContainerWidth,
57
59
  paddingRight: listGutter,
58
60
  justifyContent: itemBulletTextAlign,
@@ -90,7 +92,7 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
90
92
  const headingTokens = title && {
91
93
  lineHeight: themeTokens.itemLineHeight,
92
94
  fontSize: themeTokens.itemFontSize,
93
- color: themeTokens.itemColor,
95
+ color: themeTokens.itemColor || themeTokens.itemTextColor,
94
96
  fontName: themeTokens.headerFontName,
95
97
  fontWeight: themeTokens.headerFontWeight
96
98
  };
@@ -137,7 +139,7 @@ Item.propTypes = {
137
139
  /**
138
140
  * Item tokens
139
141
  */
140
- tokens: (0, _componentsBase.getTokensPropType)('List')
142
+ tokens: (0, _componentsBase.getTokensPropType)('OrderedList')
141
143
  };
142
144
  var _default = Item;
143
145
  exports.default = _default;
@@ -37,36 +37,42 @@ const OrderedList = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
37
37
  children,
38
38
  start = 1,
39
39
  variant = {},
40
+ tokens = {},
40
41
  ...rest
41
42
  } = _ref2;
42
43
  // Check if children is an array
43
44
  const isChildrenArray = Array.isArray(children);
44
45
 
45
- // Pass any variants "OrderedList" receives down to the individual list items.
46
- const childrenWithParentVariants = _react.default.useMemo(() => {
47
- const addVariantToProps = child => {
48
- var _child$props;
46
+ // Pass any variants and tokens "OrderedList" receives down to the individual list items.
47
+ const childrenWithParentVariantsAndTokens = _react.default.useMemo(() => {
48
+ const addVariantAndTokensToProps = child => {
49
+ var _child$props, _child$props2;
49
50
  const existingChildVariants = ((_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.variant) ?? {};
51
+ const existingChildTokens = ((_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.tokens) ?? {};
50
52
  return /*#__PURE__*/_react.default.cloneElement(child, {
51
53
  variant: {
52
54
  ...existingChildVariants,
53
55
  ...variant
56
+ },
57
+ tokens: {
58
+ ...existingChildTokens,
59
+ ...tokens
54
60
  }
55
61
  });
56
62
  };
57
- if (variant) {
63
+ if (variant || tokens) {
58
64
  if (isChildrenArray) {
59
- return children.map(addVariantToProps);
65
+ return children.map(addVariantAndTokensToProps);
60
66
  }
61
- return [addVariantToProps(children)];
67
+ return [addVariantAndTokensToProps(children)];
62
68
  }
63
69
  return children;
64
- }, [children, variant, isChildrenArray]);
70
+ }, [children, variant, isChildrenArray, tokens]);
65
71
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledOrderedListBase, {
66
72
  ...selectProps(rest),
67
73
  ref: ref,
68
74
  start: start,
69
- children: childrenWithParentVariants
75
+ children: childrenWithParentVariantsAndTokens
70
76
  });
71
77
  });
72
78
  OrderedList.displayName = 'OrderedList';
@@ -80,7 +86,8 @@ OrderedList.propTypes = {
80
86
  * The position to start the list with.
81
87
  */
82
88
  start: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
83
- variant: _componentsBase.variantProp.propType
89
+ variant: _componentsBase.variantProp.propType,
90
+ tokens: (0, _componentsBase.getTokensPropType)('OrderedList')
84
91
  };
85
92
  OrderedList.Item = _Item.default;
86
93
  var _default = OrderedList;
@@ -7,26 +7,26 @@ exports.default = void 0;
7
7
  var _default = {
8
8
  en: {
9
9
  accessibility: {
10
- a11yLabel: 'Quantity Selector control',
11
- increaseButton: 'Increase quantity button',
12
- decreaseButton: 'Decrease quantity button'
10
+ a11yLabel: 'Quantity selector',
11
+ increaseButton: 'Increase quantity',
12
+ decreaseButton: 'Decrease quantity'
13
13
  },
14
14
  errors: {
15
- numberIsTooSmall: minNumber => `Number must be equal or greater than ${minNumber}`,
16
- numberIsTooBig: maxNumber => `Number must be equal or less than ${maxNumber}`,
17
- invalidCharacters: 'This control does not allow alphabetical or symbol characters. Try using numbers only'
15
+ numberIsTooSmall: minNumber => `You can enter a number equal or greater than ${minNumber}.`,
16
+ numberIsTooBig: maxNumber => `You can enter a number equal or less than ${maxNumber}.`,
17
+ invalidCharacters: 'Try using numbers only. Alphabetical or symbols characters are not allowed.'
18
18
  }
19
19
  },
20
20
  fr: {
21
21
  accessibility: {
22
- a11yLabel: 'Contrôleur de sélection de nombre',
23
- increaseButton: `Bouton d'augmentation de quantité`,
24
- decreaseButton: `Bouton de diminution de quantité`
22
+ a11yLabel: 'Sélecteur de quantité',
23
+ increaseButton: `Augmenter la quantité`,
24
+ decreaseButton: `Réduire la quantité`
25
25
  },
26
26
  errors: {
27
- numberIsTooSmall: minNumber => `Le nombre doit être plus grand ou égal que ${minNumber}`,
28
- numberIsTooBig: maxNumber => `Le nombre doit être plus petit ou égal que ${maxNumber}`,
29
- invalidCharacters: `Ce champ ne supporte pas les caractères alphabétiques ni les symboles. Essayez d'utiliser des chiffres uniquement`
27
+ numberIsTooSmall: minNumber => `Vous pouvez saisir un nombre égal ou supérieur à ${minNumber}.`,
28
+ numberIsTooBig: maxNumber => `Vous pouvez saisir un nombre égal ou inférieur à ${maxNumber}.`,
29
+ invalidCharacters: `Essayez d'utiliser seulement des chiffres. Les caractères alphabétiques ou les symboles ne sont pas permis.`
30
30
  }
31
31
  }
32
32
  };
@@ -70,7 +70,7 @@ const RibbonContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
70
70
  const RibbonCurve = /*#__PURE__*/_styledComponents.default.div.withConfig({
71
71
  displayName: "Ribbon__RibbonCurve",
72
72
  componentId: "components-web__sc-186270k-2"
73
- })(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
73
+ })(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;overflow:hidden;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
74
74
  let {
75
75
  curveBackgroundColor
76
76
  } = _ref10;
@@ -22,9 +22,10 @@ const StyledTable = /*#__PURE__*/_styledComponents.default.table.withConfig({
22
22
  componentId: "components-web__sc-10d9q3m-1"
23
23
  })(["margin:0;padding:0;width:", ";border:", ";"], _ref => {
24
24
  let {
25
+ fullWidth,
25
26
  tableWidth
26
27
  } = _ref;
27
- return `${tableWidth}px`;
28
+ return fullWidth ? '100%' : `${tableWidth}px`;
28
29
  }, props => `${props.borderWidth}px solid ${props.borderColor}`);
29
30
  const TableContext = /*#__PURE__*/_react.default.createContext({});
30
31
  const useTableContext = () => _react.default.useContext(TableContext);
@@ -101,6 +102,7 @@ const Table = _ref2 => {
101
102
  tableWidth: tableWidth,
102
103
  cellSpacing: 0,
103
104
  ref: tableRef,
105
+ fullWidth: fullWidth,
104
106
  ...selectProps(rest),
105
107
  children: children
106
108
  })
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const ConditionalWrapper = _ref => {
12
+ let {
13
+ children,
14
+ condition,
15
+ WrapperComponent,
16
+ wrapperProps
17
+ } = _ref;
18
+ return condition ? /*#__PURE__*/(0, _jsxRuntime.jsx)(WrapperComponent, {
19
+ ...wrapperProps,
20
+ children: children
21
+ }) : children;
22
+ };
23
+ ConditionalWrapper.propTypes = {
24
+ children: _propTypes.default.node,
25
+ condition: _propTypes.default.bool,
26
+ WrapperComponent: _propTypes.default.elementType,
27
+ wrapperProps: _propTypes.default.object
28
+ };
29
+ var _default = ConditionalWrapper;
30
+ exports.default = _default;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _ConditionalWrapper = _interopRequireDefault(require("./ConditionalWrapper"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ var _default = _ConditionalWrapper.default;
10
+ exports.default = _default;
@@ -16,7 +16,7 @@ const withClientTheme = Component => {
16
16
  variant,
17
17
  ...props
18
18
  } = _ref;
19
- const theme = (0, _componentsBase.useThemeTokens)(Component.displayName, variant, tokenOverrides);
19
+ const theme = (0, _componentsBase.useThemeTokens)(Component.displayName, tokenOverrides, variant);
20
20
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
21
21
  theme: theme,
22
22
  ...props
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, useThemeTokensCallback, variantProp, a11yProps, viewProps, PressableCardBase } from '@telus-uds/components-base';
4
+ import { useResponsiveProp } from '@telus-uds/components-web';
5
+ import styled from 'styled-components';
4
6
  import CardContent from './CardContent';
5
7
  import CardFooter from './CardFooter';
6
8
  import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
9
+ import ConditionalWrapper from '../shared/ConditionalWrapper';
7
10
 
8
11
  // Passes React Native-oriented system props through UDS Card
9
12
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -27,6 +30,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
27
30
  * - `alt`: alt tag for an image,
28
31
  * - `src`: default image source,
29
32
  * - `position`: `none`, `bottom`, `left`, `right` or `top`, depending on where you would like your full bleed image to be placed,
33
+ * - `imgCol`: set the span of the image per viewport (based on 12 column value for width of card) when `position` of image is on `left` or `right`
30
34
  * - all the props from the `ResponsiveImage` component in case you want that full bleed image to be responsive,
31
35
  * - `content`: pass a custom JSX to be used for rendering of the full bleed content (defaults to `ResponsiveImage`
32
36
  * receiving the other props).
@@ -38,6 +42,23 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
38
42
  * ## Accessibility
39
43
  * `Card` component accepts all the standard accessibility props.
40
44
  */
45
+ const DynamicWidthContainer = /*#__PURE__*/styled.div.withConfig({
46
+ displayName: "Card__DynamicWidthContainer",
47
+ componentId: "components-web__sc-1elbtwd-0"
48
+ })(_ref => {
49
+ let {
50
+ width,
51
+ display,
52
+ borderRadius,
53
+ overflow
54
+ } = _ref;
55
+ return {
56
+ width,
57
+ display,
58
+ borderRadius,
59
+ overflow
60
+ };
61
+ });
41
62
  const Card = /*#__PURE__*/React.forwardRef(function () {
42
63
  let {
43
64
  children,
@@ -63,6 +84,9 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
63
84
  fullBleedContentPosition,
64
85
  fullBleedContentProps
65
86
  } = useFullBleedContentProps(fullBleedContent);
87
+ const {
88
+ imgCol
89
+ } = fullBleedContentProps;
66
90
 
67
91
  // If the card has rounded corners and a full bleed image, we need to apply
68
92
  // those corners on the image as well, but partially
@@ -75,6 +99,25 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
75
99
  });
76
100
  const hasFooter = Boolean(footer);
77
101
  const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter);
102
+
103
+ // takes imgCol from fullBleedContent if present, to dynamically set width of image
104
+ // card content will adapt to the size of image to add up to 100% width of card width
105
+ // pass as props to ConditionalWrapper
106
+ const imgColCurrentViewport = useResponsiveProp(imgCol);
107
+ const maxCol = 12;
108
+ const fullBleedImageWidth = `${imgColCurrentViewport / maxCol * 100}%`;
109
+ const adaptiveContentWidth = `${(maxCol - imgColCurrentViewport) / maxCol * 100}%`;
110
+ const isImageWidthAdjustable = imgCol && (fullBleedContentPosition === 'left' || fullBleedContentPosition === 'right');
111
+ const contentWrapperStyleProps = {
112
+ width: adaptiveContentWidth,
113
+ display: imgColCurrentViewport >= maxCol ? 'none' : undefined
114
+ };
115
+ const imageWrapperStyleProps = {
116
+ width: fullBleedImageWidth,
117
+ borderRadius: imgColCurrentViewport >= maxCol ? borderRadius : undefined,
118
+ overflow: imgColCurrentViewport >= maxCol ? 'hidden' : undefined,
119
+ display: imgColCurrentViewport === 0 ? 'none' : undefined
120
+ };
78
121
  const columnFlex = {
79
122
  flexGrow: interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? 0 : 1,
80
123
  flexShrink: 1,
@@ -111,14 +154,25 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
111
154
  alignItems: contentStackAlign
112
155
  },
113
156
  space: 0,
114
- children: [children ? /*#__PURE__*/_jsx(CardContent, {
115
- tokens: tokens,
116
- variant: variant,
117
- withFooter: hasFooter,
118
- children: children
119
- }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/_jsx(FullBleedContent, {
120
- borderRadius: fullBleedBorderRadius,
121
- ...fullBleedContentProps
157
+ children: [children ? /*#__PURE__*/_jsx(ConditionalWrapper, {
158
+ WrapperComponent: DynamicWidthContainer,
159
+ wrapperProps: contentWrapperStyleProps,
160
+ condition: isImageWidthAdjustable,
161
+ children: /*#__PURE__*/_jsx(CardContent, {
162
+ tokens: tokens,
163
+ variant: variant,
164
+ withFooter: hasFooter,
165
+ children: children
166
+ })
167
+ }) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/_jsx(ConditionalWrapper, {
168
+ WrapperComponent: DynamicWidthContainer,
169
+ wrapperProps: imageWrapperStyleProps,
170
+ condition: isImageWidthAdjustable,
171
+ children: /*#__PURE__*/_jsx(FullBleedContent, {
172
+ borderRadius: fullBleedBorderRadius,
173
+ ...fullBleedContentProps,
174
+ position: fullBleedContentPosition
175
+ })
122
176
  })]
123
177
  }) : null, footer && /*#__PURE__*/_jsx(CardFooter, {
124
178
  padding: footerPadding,
@@ -9,8 +9,10 @@ const ExpandCollapseMini = /*#__PURE__*/React.forwardRef((_ref, ref) => {
9
9
  onToggle = () => {},
10
10
  tokens = {},
11
11
  nativeID,
12
+ initialOpen = false,
12
13
  ...rest
13
14
  } = _ref;
15
+ const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel';
14
16
  const handleChange = (openPanels, event) => {
15
17
  if (typeof onToggle === 'function') {
16
18
  const isOpen = openPanels.length > 0;
@@ -20,9 +22,10 @@ const ExpandCollapseMini = /*#__PURE__*/React.forwardRef((_ref, ref) => {
20
22
  return /*#__PURE__*/_jsx(ExpandCollapse, {
21
23
  onChange: handleChange,
22
24
  tokens: tokens,
25
+ initialOpen: initialOpen ? [expandCollapeMiniPanelId] : [],
23
26
  children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
24
27
  ...expandProps,
25
- panelId: "ExpandCollapseMiniPanel",
28
+ panelId: expandCollapeMiniPanelId,
26
29
  variant: {
27
30
  mini: true
28
31
  },
@@ -61,6 +64,10 @@ ExpandCollapseMini.propTypes = {
61
64
  * Children nodes that can be added
62
65
  */
63
66
  children: PropTypes.node.isRequired,
67
+ /**
68
+ * Controls if the panel and the content is opened by default on the first load
69
+ */
70
+ initialOpen: PropTypes.bool,
64
71
  tokens: getTokensPropType('ExpandCollapseMini')
65
72
  };
66
73
  export default ExpandCollapseMini;
@@ -144,13 +144,13 @@ const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
144
144
  return {
145
145
  display: 'list-item',
146
146
  '&::marker': {
147
- fontFamily: 'HelveticaNow400normal',
147
+ fontFamily: 'HNforTELUSSA400normal',
148
148
  fontSize: listItemMarkerFontSize,
149
149
  lineHeight: listItemMarkerLineHeight,
150
150
  textAlign: 'end !important'
151
151
  },
152
152
  color: listItemColor,
153
- fontFamily: 'HelveticaNow400normal',
153
+ fontFamily: 'HNforTELUSSA400normal',
154
154
  fontSize: listItemFontSize,
155
155
  lineHeight: listItemLineHeight,
156
156
  paddingLeft: listItemPaddingLeft
@@ -212,7 +212,7 @@ const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
212
212
  lineHeight: listItemLineHeight,
213
213
  paddingLeft: listItemPaddingLeft,
214
214
  color: listItemColor,
215
- fontFamily: 'HelveticaNow400normal'
215
+ fontFamily: 'HNforTELUSSA400normal'
216
216
  };
217
217
  });
218
218
  const usePrevious = value => {