@telus-uds/components-web 2.14.0 → 2.16.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,39 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Fri, 14 Jul 2023 19:38:21 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 28 Jul 2023 18:10:45 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.16.0
8
+
9
+ Fri, 28 Jul 2023 18:10:45 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Update Modal story (wlsdud194@hotmail.com)
14
+ - add ability to inherit results color in autocomplete from Search component (kyle.king2@telus.com)
15
+ - Bump @telus-uds/components-base to v1.57.0
16
+ - Bump @telus-uds/system-theme-tokens to v2.40.0
17
+
18
+ ### Patches
19
+
20
+ - verification in type of typography (mauricio.batresmontejo@telus.com)
21
+
22
+ ## 2.15.0
23
+
24
+ Fri, 21 Jul 2023 00:51:24 GMT
25
+
26
+ ### Minor changes
27
+
28
+ - Adjusted CardContent to subtract borderWidth from padding to prevent a shifting issue(border was pushing content) (kyle.king2@telus.com)
29
+ - added padding token to Toast (kyle.king2@telus.com)
30
+ - Adjusted story for Listbox to not have "href" attributes on the children (kyle.king2@telus.com)
31
+ - Bump @telus-uds/components-base to v1.56.0
32
+ - Bump @telus-uds/system-theme-tokens to v2.39.0
33
+
7
34
  ## 2.14.0
8
35
 
9
- Fri, 14 Jul 2023 19:38:21 GMT
36
+ Fri, 14 Jul 2023 19:47:50 GMT
10
37
 
11
38
  ### Minor changes
12
39
 
@@ -6445,7 +6445,8 @@
6445
6445
  "labelFontSize": "fontSize",
6446
6446
  "labelFontWeight": "fontWeight",
6447
6447
  "labelLineHeight": "lineHeight",
6448
- "labelMarginLeft": "size"
6448
+ "labelMarginLeft": "size",
6449
+ "inputOutlineOffset": "size"
6449
6450
  }
6450
6451
  },
6451
6452
  "required": false,
@@ -6541,7 +6542,14 @@
6541
6542
  "name": "custom",
6542
6543
  "raw": {
6543
6544
  "space": "integer",
6544
- "fieldSpace": "integer"
6545
+ "fieldSpace": "integer",
6546
+ "showIcon": "show",
6547
+ "outlineWidth": "border",
6548
+ "borderBottomLeftRadius": "radius",
6549
+ "borderBottomRightRadius": "radius",
6550
+ "borderTopLeftRadius": "radius",
6551
+ "borderTopRightRadius": "radius",
6552
+ "outlineOffset": "size"
6545
6553
  }
6546
6554
  },
6547
6555
  "required": false,
@@ -6573,7 +6581,8 @@
6573
6581
  "labelFontSize": "fontSize",
6574
6582
  "labelFontWeight": "fontWeight",
6575
6583
  "labelLineHeight": "lineHeight",
6576
- "labelMarginLeft": "size"
6584
+ "labelMarginLeft": "size",
6585
+ "inputOutlineOffset": "size"
6577
6586
  }
6578
6587
  },
6579
6588
  "required": false,
@@ -9259,6 +9268,7 @@
9259
9268
  "itemIconSize": "size",
9260
9269
  "itemLineHeight": "lineHeight",
9261
9270
  "listGutter": "size",
9271
+ "itemUnderline": "textLine",
9262
9272
  "backgroundColor": "color",
9263
9273
  "paddingLeft": "size",
9264
9274
  "paddingRight": "size",
@@ -9342,6 +9352,7 @@
9342
9352
  "itemIconSize": "size",
9343
9353
  "itemLineHeight": "lineHeight",
9344
9354
  "listGutter": "size",
9355
+ "itemUnderline": "textLine",
9345
9356
  "backgroundColor": "color",
9346
9357
  "paddingLeft": "size",
9347
9358
  "paddingRight": "size",
@@ -40,6 +40,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
40
40
  const highlightAllMatches = function (str) {
41
41
  let substring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
42
42
  let matchIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
43
+ let resultsTextColor = arguments.length > 3 ? arguments[3] : undefined;
43
44
  return (
44
45
  /*#__PURE__*/
45
46
  // Wrapping all in bold
@@ -47,6 +48,9 @@ const highlightAllMatches = function (str) {
47
48
  variant: {
48
49
  bold: false
49
50
  },
51
+ tokens: {
52
+ color: resultsTextColor
53
+ },
50
54
  children: matchIndexes.reduce((acc, matchIndex, index) => [...acc, // Add a piece of the string up to the first occurrence of the substring
51
55
  index === 0 && (str.slice(0, matchIndex) ?? ''),
52
56
  /*#__PURE__*/
@@ -55,6 +59,9 @@ const highlightAllMatches = function (str) {
55
59
  variant: {
56
60
  bold: true
57
61
  },
62
+ tokens: {
63
+ color: resultsTextColor
64
+ },
58
65
  children: str.slice(matchIndex, matchIndex + substring.length)
59
66
  }, matchIndex), // Add the rest of the string until the next occurrence or the end of it
60
67
  str.slice(matchIndex + substring.length, matchIndexes[index + 1] ?? str.length)], [])
@@ -65,6 +72,7 @@ const highlightAllMatches = function (str) {
65
72
  const highlight = function () {
66
73
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
67
74
  let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
75
+ let color = arguments.length > 2 ? arguments[2] : undefined;
68
76
  return items.reduce((acc, item) => {
69
77
  var _Array$from;
70
78
 
@@ -77,7 +85,7 @@ const highlight = function () {
77
85
 
78
86
  if (matches !== null && matches !== void 0 && matches.length) {
79
87
  return [...acc, { ...item,
80
- label: highlightAllMatches(item.label, text, matches)
88
+ label: highlightAllMatches(item.label, text, matches, color)
81
89
  }];
82
90
  }
83
91
 
@@ -107,11 +115,16 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
107
115
  value,
108
116
  ...rest
109
117
  } = _ref2;
110
- // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
118
+ const {
119
+ color: resultsTextColor
120
+ } = (0, _componentsBase.useThemeTokens)('Search', {}, {
121
+ focus: true
122
+ }); // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
111
123
  // but we also need to adjust suggestions based on the mode:
112
124
  // - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
113
125
  // - in uncontrolled mode we filter the suggestions ourselves based on the `initialItems`
114
126
  // prop and the text entered
127
+
115
128
  const isControlled = value !== undefined; // We need to store current items for uncontrolled usage
116
129
 
117
130
  const [currentItems, setCurrentItems] = (0, _react.useState)(initialItems); // We need to store the current value as well to be able to highlight it
@@ -284,7 +297,7 @@ const Autocomplete = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
284
297
  }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Suggestions.default, {
285
298
  hasResults: getCopy('hasResults'),
286
299
  id: "autocomplete",
287
- items: itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue)),
300
+ items: itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue, resultsTextColor)),
288
301
  noResults: noResults ?? getCopy('noResults'),
289
302
  onClose: handleClose,
290
303
  onSelect: handleSelect,
@@ -35,7 +35,8 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
35
35
  contentAlignItems: alignItems,
36
36
  contentFlexGrow: flexGrow,
37
37
  contentFlexShrink: flexShrink,
38
- contentJustifyContent: justifyContent
38
+ contentJustifyContent: justifyContent,
39
+ borderWidth
39
40
  } = _ref;
40
41
  return {
41
42
  // We need to make sure to have sharp corners on the bottom
@@ -44,10 +45,10 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
44
45
  borderBottomRightRadius: withFooter ? 0 : borderRadius,
45
46
  borderTopLeftRadius: borderRadius,
46
47
  borderTopRightRadius: borderRadius,
47
- paddingBottom,
48
- paddingLeft,
49
- paddingRight,
50
- paddingTop,
48
+ paddingBottom: paddingBottom - borderWidth,
49
+ paddingLeft: paddingLeft - borderWidth,
50
+ paddingRight: paddingRight - borderWidth,
51
+ paddingTop: paddingTop - borderWidth,
51
52
  display: 'flex',
52
53
  flexDirection: 'column',
53
54
  alignItems,
@@ -46,29 +46,23 @@ const dateFormatWithoutSpaces = 'DD/MM/YYYY';
46
46
  const getResponsiveDaySize = function () {
47
47
  let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
48
48
  let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
49
- let responsiveDaySize;
50
49
 
51
50
  if (viewport === 'xs') {
52
- responsiveDaySize = inline ? undefined : 36;
53
- } else {
54
- responsiveDaySize = inline ? 60 : 44;
51
+ return inline ? undefined : 36;
55
52
  }
56
53
 
57
- return responsiveDaySize;
54
+ return inline ? 60 : 44;
58
55
  };
59
56
 
60
57
  const getResponsiveCircleSize = function () {
61
58
  let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
62
59
  let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
63
- let responsiveCircleSize;
64
60
 
65
61
  if (viewport === 'xs') {
66
- responsiveCircleSize = 26;
67
- } else {
68
- responsiveCircleSize = inline ? 44 : 26;
62
+ return 26;
69
63
  }
70
64
 
71
- return responsiveCircleSize;
65
+ return inline ? 44 : 26;
72
66
  };
73
67
 
74
68
  const MonthCenterContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
@@ -156,7 +156,11 @@ const Ribbon = _ref18 => {
156
156
  gradient,
157
157
  fontColor,
158
158
  borderRadiusBottomLeft,
159
- borderRadiusBottomRight
159
+ borderRadiusBottomRight,
160
+ fontName,
161
+ fontWeight,
162
+ fontSize,
163
+ lineHeight
160
164
  } = (0, _componentsBase.useThemeTokens)('Ribbon', tokens, { ...variant,
161
165
  wrap: shouldWrap
162
166
  });
@@ -187,12 +191,15 @@ const Ribbon = _ref18 => {
187
191
  borderRadiusBottomRight: `${borderRadiusBottomRight}px`,
188
192
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
189
193
  variant: {
190
- size: 'micro',
191
194
  bold: true,
192
195
  inverse: true
193
196
  },
194
197
  tokens: {
195
- color: fontColor
198
+ color: fontColor,
199
+ fontName,
200
+ fontWeight,
201
+ fontSize,
202
+ lineHeight
196
203
  },
197
204
  children: children
198
205
  })
@@ -39,19 +39,29 @@ const animation = props => (0, _styledComponents.css)(["", " 1s ease-in-out 2s f
39
39
  const ToastContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
40
40
  displayName: "Toast__ToastContainer",
41
41
  componentId: "components-web__sc-p78jdh-0"
42
- })(["display:flex;justify-content:center;align-items:center;flex-wrap:wrap;background:", ";gap:", ";height:0;overflow:hidden;animation:", ";"], _ref => {
42
+ })(["display:flex;justify-content:center;align-items:center;flex-wrap:wrap;padding-left:", "px;padding-right:", "px;background:", ";gap:", ";height:0;overflow:hidden;animation:", ";"], _ref => {
43
43
  let {
44
- containerBackgroundColor
44
+ padding
45
45
  } = _ref;
46
- return containerBackgroundColor;
46
+ return padding;
47
47
  }, _ref2 => {
48
48
  let {
49
- containerGap
49
+ padding
50
50
  } = _ref2;
51
+ return padding;
52
+ }, _ref3 => {
53
+ let {
54
+ containerBackgroundColor
55
+ } = _ref3;
56
+ return containerBackgroundColor;
57
+ }, _ref4 => {
58
+ let {
59
+ containerGap
60
+ } = _ref4;
51
61
  return containerGap;
52
62
  }, animation);
53
63
 
54
- const Toast = _ref3 => {
64
+ const Toast = _ref5 => {
55
65
  let {
56
66
  toast,
57
67
  copy,
@@ -60,7 +70,7 @@ const Toast = _ref3 => {
60
70
  tokens,
61
71
  variant = {},
62
72
  ...rest
63
- } = _ref3;
73
+ } = _ref5;
64
74
  // viewport hook added to work adjust the padding to different sizes
65
75
  const viewport = (0, _componentsBase.useViewport)();
66
76
  const {
@@ -76,7 +86,8 @@ const Toast = _ref3 => {
76
86
  animationBackgroundColorAfter,
77
87
  animationColorBefore,
78
88
  animationColorAfter,
79
- chevronlinkFontWeight
89
+ chevronlinkFontWeight,
90
+ ...extraTokens
80
91
  } = (0, _componentsBase.useThemeTokens)('Toast', tokens, variant, {
81
92
  viewport
82
93
  }); // inherit ChevronLink tokens for animation colors
@@ -109,6 +120,7 @@ const Toast = _ref3 => {
109
120
  animationColorAfter: animationColorAfter,
110
121
  animationFillColorBefore: chevronInverseColor,
111
122
  animationFillColorAfter: chevronDefaultColor,
123
+ ...extraTokens,
112
124
  ...selectProps(rest),
113
125
  children: [headline && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
114
126
  variant: {
@@ -2,7 +2,7 @@
2
2
  import React, { forwardRef, useRef, useState } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { throttle } from 'lodash';
5
- import { InputSupports, inputSupportsProps, selectSystemProps, TextInput, textInputProps, textInputHandlerProps, Typography, useCopy, useSafeLayoutEffect } from '@telus-uds/components-base';
5
+ import { InputSupports, inputSupportsProps, selectSystemProps, TextInput, textInputProps, textInputHandlerProps, Typography, useCopy, useSafeLayoutEffect, useThemeTokens } from '@telus-uds/components-base';
6
6
  import Listbox from '../Listbox';
7
7
  import { htmlAttrs, useOverlaidPosition } from '../utils';
8
8
  import Loading from './Loading';
@@ -18,6 +18,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, inp
18
18
  const highlightAllMatches = function (str) {
19
19
  let substring = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
20
20
  let matchIndexes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
21
+ let resultsTextColor = arguments.length > 3 ? arguments[3] : undefined;
21
22
  return (
22
23
  /*#__PURE__*/
23
24
  // Wrapping all in bold
@@ -25,6 +26,9 @@ const highlightAllMatches = function (str) {
25
26
  variant: {
26
27
  bold: false
27
28
  },
29
+ tokens: {
30
+ color: resultsTextColor
31
+ },
28
32
  children: matchIndexes.reduce((acc, matchIndex, index) => [...acc, // Add a piece of the string up to the first occurrence of the substring
29
33
  index === 0 && (str.slice(0, matchIndex) ?? ''),
30
34
  /*#__PURE__*/
@@ -33,6 +37,9 @@ const highlightAllMatches = function (str) {
33
37
  variant: {
34
38
  bold: true
35
39
  },
40
+ tokens: {
41
+ color: resultsTextColor
42
+ },
36
43
  children: str.slice(matchIndex, matchIndex + substring.length)
37
44
  }, matchIndex), // Add the rest of the string until the next occurrence or the end of it
38
45
  str.slice(matchIndex + substring.length, matchIndexes[index + 1] ?? str.length)], [])
@@ -43,6 +50,7 @@ const highlightAllMatches = function (str) {
43
50
  const highlight = function () {
44
51
  let items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
45
52
  let text = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
53
+ let color = arguments.length > 2 ? arguments[2] : undefined;
46
54
  return items.reduce((acc, item) => {
47
55
  var _Array$from;
48
56
 
@@ -55,7 +63,7 @@ const highlight = function () {
55
63
 
56
64
  if (matches !== null && matches !== void 0 && matches.length) {
57
65
  return [...acc, { ...item,
58
- label: highlightAllMatches(item.label, text, matches)
66
+ label: highlightAllMatches(item.label, text, matches, color)
59
67
  }];
60
68
  }
61
69
 
@@ -85,11 +93,16 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
85
93
  value,
86
94
  ...rest
87
95
  } = _ref2;
88
- // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
96
+ const {
97
+ color: resultsTextColor
98
+ } = useThemeTokens('Search', {}, {
99
+ focus: true
100
+ }); // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
89
101
  // but we also need to adjust suggestions based on the mode:
90
102
  // - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
91
103
  // - in uncontrolled mode we filter the suggestions ourselves based on the `initialItems`
92
104
  // prop and the text entered
105
+
93
106
  const isControlled = value !== undefined; // We need to store current items for uncontrolled usage
94
107
 
95
108
  const [currentItems, setCurrentItems] = useState(initialItems); // We need to store the current value as well to be able to highlight it
@@ -262,7 +275,7 @@ const Autocomplete = /*#__PURE__*/forwardRef((_ref2, ref) => {
262
275
  }) : /*#__PURE__*/_jsx(Suggestions, {
263
276
  hasResults: getCopy('hasResults'),
264
277
  id: "autocomplete",
265
- items: itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue)),
278
+ items: itemsToSuggest(highlight(isControlled ? items : currentItems, currentValue, resultsTextColor)),
266
279
  noResults: noResults ?? getCopy('noResults'),
267
280
  onClose: handleClose,
268
281
  onSelect: handleSelect,
@@ -19,7 +19,8 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
19
19
  contentAlignItems: alignItems,
20
20
  contentFlexGrow: flexGrow,
21
21
  contentFlexShrink: flexShrink,
22
- contentJustifyContent: justifyContent
22
+ contentJustifyContent: justifyContent,
23
+ borderWidth
23
24
  } = _ref;
24
25
  return {
25
26
  // We need to make sure to have sharp corners on the bottom
@@ -28,10 +29,10 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
28
29
  borderBottomRightRadius: withFooter ? 0 : borderRadius,
29
30
  borderTopLeftRadius: borderRadius,
30
31
  borderTopRightRadius: borderRadius,
31
- paddingBottom,
32
- paddingLeft,
33
- paddingRight,
34
- paddingTop,
32
+ paddingBottom: paddingBottom - borderWidth,
33
+ paddingLeft: paddingLeft - borderWidth,
34
+ paddingRight: paddingRight - borderWidth,
35
+ paddingTop: paddingTop - borderWidth,
35
36
  display: 'flex',
36
37
  flexDirection: 'column',
37
38
  alignItems,
@@ -21,29 +21,23 @@ const dateFormatWithoutSpaces = 'DD/MM/YYYY';
21
21
  const getResponsiveDaySize = function () {
22
22
  let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
23
23
  let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
24
- let responsiveDaySize;
25
24
 
26
25
  if (viewport === 'xs') {
27
- responsiveDaySize = inline ? undefined : 36;
28
- } else {
29
- responsiveDaySize = inline ? 60 : 44;
26
+ return inline ? undefined : 36;
30
27
  }
31
28
 
32
- return responsiveDaySize;
29
+ return inline ? 60 : 44;
33
30
  };
34
31
 
35
32
  const getResponsiveCircleSize = function () {
36
33
  let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
37
34
  let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
38
- let responsiveCircleSize;
39
35
 
40
36
  if (viewport === 'xs') {
41
- responsiveCircleSize = 26;
42
- } else {
43
- responsiveCircleSize = inline ? 44 : 26;
37
+ return 26;
44
38
  }
45
39
 
46
- return responsiveCircleSize;
40
+ return inline ? 44 : 26;
47
41
  };
48
42
 
49
43
  const MonthCenterContainer = /*#__PURE__*/styled.div.withConfig({
@@ -139,7 +139,11 @@ const Ribbon = _ref18 => {
139
139
  gradient,
140
140
  fontColor,
141
141
  borderRadiusBottomLeft,
142
- borderRadiusBottomRight
142
+ borderRadiusBottomRight,
143
+ fontName,
144
+ fontWeight,
145
+ fontSize,
146
+ lineHeight
143
147
  } = useThemeTokens('Ribbon', tokens, { ...variant,
144
148
  wrap: shouldWrap
145
149
  });
@@ -170,12 +174,15 @@ const Ribbon = _ref18 => {
170
174
  borderRadiusBottomRight: `${borderRadiusBottomRight}px`,
171
175
  children: /*#__PURE__*/_jsx(Typography, {
172
176
  variant: {
173
- size: 'micro',
174
177
  bold: true,
175
178
  inverse: true
176
179
  },
177
180
  tokens: {
178
- color: fontColor
181
+ color: fontColor,
182
+ fontName,
183
+ fontWeight,
184
+ fontSize,
185
+ lineHeight
179
186
  },
180
187
  children: children
181
188
  })
@@ -21,19 +21,29 @@ const animation = props => css(["", " 1s ease-in-out 2s forwards,", " 1s ease-in
21
21
  const ToastContainer = /*#__PURE__*/styled.div.withConfig({
22
22
  displayName: "Toast__ToastContainer",
23
23
  componentId: "components-web__sc-p78jdh-0"
24
- })(["display:flex;justify-content:center;align-items:center;flex-wrap:wrap;background:", ";gap:", ";height:0;overflow:hidden;animation:", ";"], _ref => {
24
+ })(["display:flex;justify-content:center;align-items:center;flex-wrap:wrap;padding-left:", "px;padding-right:", "px;background:", ";gap:", ";height:0;overflow:hidden;animation:", ";"], _ref => {
25
25
  let {
26
- containerBackgroundColor
26
+ padding
27
27
  } = _ref;
28
- return containerBackgroundColor;
28
+ return padding;
29
29
  }, _ref2 => {
30
30
  let {
31
- containerGap
31
+ padding
32
32
  } = _ref2;
33
+ return padding;
34
+ }, _ref3 => {
35
+ let {
36
+ containerBackgroundColor
37
+ } = _ref3;
38
+ return containerBackgroundColor;
39
+ }, _ref4 => {
40
+ let {
41
+ containerGap
42
+ } = _ref4;
33
43
  return containerGap;
34
44
  }, animation);
35
45
 
36
- const Toast = _ref3 => {
46
+ const Toast = _ref5 => {
37
47
  let {
38
48
  toast,
39
49
  copy,
@@ -42,7 +52,7 @@ const Toast = _ref3 => {
42
52
  tokens,
43
53
  variant = {},
44
54
  ...rest
45
- } = _ref3;
55
+ } = _ref5;
46
56
  // viewport hook added to work adjust the padding to different sizes
47
57
  const viewport = useViewport();
48
58
  const {
@@ -58,7 +68,8 @@ const Toast = _ref3 => {
58
68
  animationBackgroundColorAfter,
59
69
  animationColorBefore,
60
70
  animationColorAfter,
61
- chevronlinkFontWeight
71
+ chevronlinkFontWeight,
72
+ ...extraTokens
62
73
  } = useThemeTokens('Toast', tokens, variant, {
63
74
  viewport
64
75
  }); // inherit ChevronLink tokens for animation colors
@@ -91,6 +102,7 @@ const Toast = _ref3 => {
91
102
  animationColorAfter: animationColorAfter,
92
103
  animationFillColorBefore: chevronInverseColor,
93
104
  animationFillColorAfter: chevronDefaultColor,
105
+ ...extraTokens,
94
106
  ...selectProps(rest),
95
107
  children: [headline && /*#__PURE__*/_jsx(Typography, {
96
108
  variant: {
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.55.0",
8
+ "@telus-uds/components-base": "1.57.0",
9
9
  "@telus-uds/system-constants": "^1.3.0",
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.38.0",
15
+ "@telus-uds/system-theme-tokens": "^2.40.0",
16
16
  "prop-types": "^15.7.2",
17
17
  "lodash.throttle": "^4.1.1",
18
18
  "react-youtube": "^10.1.0",
@@ -63,5 +63,5 @@
63
63
  "skip": true
64
64
  },
65
65
  "types": "types/index.d.ts",
66
- "version": "2.14.0"
66
+ "version": "2.16.0"
67
67
  }
@@ -11,7 +11,8 @@ import {
11
11
  textInputHandlerProps,
12
12
  Typography,
13
13
  useCopy,
14
- useSafeLayoutEffect
14
+ useSafeLayoutEffect,
15
+ useThemeTokens
15
16
  } from '@telus-uds/components-base'
16
17
  import Listbox from '../Listbox'
17
18
  import { htmlAttrs, useOverlaidPosition } from '../utils'
@@ -34,16 +35,16 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([
34
35
 
35
36
  // Returns JSX to display a bold string `str` with unbolded occurrences of the
36
37
  // `substring` based in the array of `matchIndexes` provided
37
- const highlightAllMatches = (str, substring = '', matchIndexes = []) => (
38
+ const highlightAllMatches = (str, substring = '', matchIndexes = [], resultsTextColor) => (
38
39
  // Wrapping all in bold
39
- <Typography variant={{ bold: false }}>
40
+ <Typography variant={{ bold: false }} tokens={{ color: resultsTextColor }}>
40
41
  {matchIndexes.reduce(
41
42
  (acc, matchIndex, index) => [
42
43
  ...acc,
43
44
  // Add a piece of the string up to the first occurrence of the substring
44
45
  index === 0 && (str.slice(0, matchIndex) ?? ''),
45
46
  // Unbold the occurrence of the substring (while keeping the original casing)
46
- <Typography key={matchIndex} variant={{ bold: true }}>
47
+ <Typography key={matchIndex} variant={{ bold: true }} tokens={{ color: resultsTextColor }}>
47
48
  {str.slice(matchIndex, matchIndex + substring.length)}
48
49
  </Typography>,
49
50
  // Add the rest of the string until the next occurrence or the end of it
@@ -53,14 +54,14 @@ const highlightAllMatches = (str, substring = '', matchIndexes = []) => (
53
54
  )}
54
55
  </Typography>
55
56
  )
56
- const highlight = (items = [], text = '') =>
57
+ const highlight = (items = [], text = '', color) =>
57
58
  items.reduce((acc, item) => {
58
59
  const matches = Array.from(item.label.toLowerCase().matchAll(text.toLowerCase()))?.map(
59
60
  ({ index }) => index
60
61
  )
61
62
 
62
63
  if (matches?.length) {
63
- return [...acc, { ...item, label: highlightAllMatches(item.label, text, matches) }]
64
+ return [...acc, { ...item, label: highlightAllMatches(item.label, text, matches, color) }]
64
65
  }
65
66
 
66
67
  return [...acc, item]
@@ -89,6 +90,7 @@ const Autocomplete = forwardRef(
89
90
  },
90
91
  ref
91
92
  ) => {
93
+ const { color: resultsTextColor } = useThemeTokens('Search', {}, { focus: true })
92
94
  // The wrapped input is mostly responsible for controlled vs uncontrolled handling,
93
95
  // but we also need to adjust suggestions based on the mode:
94
96
  // - in controlled mode we rely entirely on the suggestions passed via the `items` prop,
@@ -254,7 +256,7 @@ const Autocomplete = forwardRef(
254
256
  hasResults={getCopy('hasResults')}
255
257
  id="autocomplete"
256
258
  items={itemsToSuggest(
257
- highlight(isControlled ? items : currentItems, currentValue)
259
+ highlight(isControlled ? items : currentItems, currentValue, resultsTextColor)
258
260
  )}
259
261
  noResults={noResults ?? getCopy('noResults')}
260
262
  onClose={handleClose}
@@ -23,7 +23,8 @@ const CardContentContainer = styled.div(
23
23
  contentAlignItems: alignItems,
24
24
  contentFlexGrow: flexGrow,
25
25
  contentFlexShrink: flexShrink,
26
- contentJustifyContent: justifyContent
26
+ contentJustifyContent: justifyContent,
27
+ borderWidth
27
28
  }) => ({
28
29
  // We need to make sure to have sharp corners on the bottom
29
30
  // if the card has a footer
@@ -31,10 +32,10 @@ const CardContentContainer = styled.div(
31
32
  borderBottomRightRadius: withFooter ? 0 : borderRadius,
32
33
  borderTopLeftRadius: borderRadius,
33
34
  borderTopRightRadius: borderRadius,
34
- paddingBottom,
35
- paddingLeft,
36
- paddingRight,
37
- paddingTop,
35
+ paddingBottom: paddingBottom - borderWidth,
36
+ paddingLeft: paddingLeft - borderWidth,
37
+ paddingRight: paddingRight - borderWidth,
38
+ paddingTop: paddingTop - borderWidth,
38
39
  display: 'flex',
39
40
  flexDirection: 'column',
40
41
  alignItems,
@@ -24,25 +24,17 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
24
24
  const dateFormat = 'DD / MM / YYYY'
25
25
  const dateFormatWithoutSpaces = 'DD/MM/YYYY'
26
26
  const getResponsiveDaySize = (inline = false, viewport = 'md') => {
27
- let responsiveDaySize
28
27
  if (viewport === 'xs') {
29
- responsiveDaySize = inline ? undefined : 36
30
- } else {
31
- responsiveDaySize = inline ? 60 : 44
28
+ return inline ? undefined : 36
32
29
  }
33
-
34
- return responsiveDaySize
30
+ return inline ? 60 : 44
35
31
  }
36
32
 
37
33
  const getResponsiveCircleSize = (inline = false, viewport = 'md') => {
38
- let responsiveCircleSize
39
34
  if (viewport === 'xs') {
40
- responsiveCircleSize = 26
41
- } else {
42
- responsiveCircleSize = inline ? 44 : 26
35
+ return 26
43
36
  }
44
-
45
- return responsiveCircleSize
37
+ return inline ? 44 : 26
46
38
  }
47
39
 
48
40
  const MonthCenterContainer = styled.div({
@@ -76,7 +76,11 @@ const Ribbon = ({
76
76
  gradient,
77
77
  fontColor,
78
78
  borderRadiusBottomLeft,
79
- borderRadiusBottomRight
79
+ borderRadiusBottomRight,
80
+ fontName,
81
+ fontWeight,
82
+ fontSize,
83
+ lineHeight
80
84
  } = useThemeTokens('Ribbon', tokens, { ...variant, wrap: shouldWrap })
81
85
 
82
86
  let background = backgroundColor
@@ -97,8 +101,14 @@ const Ribbon = ({
97
101
  borderRadiusBottomRight={`${borderRadiusBottomRight}px`}
98
102
  >
99
103
  <Typography
100
- variant={{ size: 'micro', bold: true, inverse: true }}
101
- tokens={{ color: fontColor }}
104
+ variant={{ bold: true, inverse: true }}
105
+ tokens={{
106
+ color: fontColor,
107
+ fontName,
108
+ fontWeight,
109
+ fontSize,
110
+ lineHeight
111
+ }}
102
112
  >
103
113
  {children}
104
114
  </Typography>
@@ -80,6 +80,8 @@ const ToastContainer = styled.div`
80
80
  justify-content: center;
81
81
  align-items: center;
82
82
  flex-wrap: wrap;
83
+ padding-left: ${({ padding }) => padding}px;
84
+ padding-right: ${({ padding }) => padding}px;
83
85
  background: ${({ containerBackgroundColor }) => containerBackgroundColor};
84
86
  gap: ${({ containerGap }) => containerGap};
85
87
  height: 0;
@@ -104,7 +106,8 @@ const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) =
104
106
  animationBackgroundColorAfter,
105
107
  animationColorBefore,
106
108
  animationColorAfter,
107
- chevronlinkFontWeight
109
+ chevronlinkFontWeight,
110
+ ...extraTokens
108
111
  } = useThemeTokens('Toast', tokens, variant, { viewport })
109
112
 
110
113
  // inherit ChevronLink tokens for animation colors
@@ -131,6 +134,7 @@ const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) =
131
134
  animationColorAfter={animationColorAfter}
132
135
  animationFillColorBefore={chevronInverseColor}
133
136
  animationFillColorAfter={chevronDefaultColor}
137
+ {...extraTokens}
134
138
  {...selectProps(rest)}
135
139
  >
136
140
  {headline && <Typography variant={{ bold: true, inverse: true }}>{headline}</Typography>}