@telus-uds/components-web 2.12.0 → 2.14.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 (65) hide show
  1. package/CHANGELOG.md +40 -2
  2. package/component-docs.json +105 -43
  3. package/lib/Autocomplete/Loading.js +5 -10
  4. package/lib/Autocomplete/dictionary.js +2 -2
  5. package/lib/Badge/Badge.js +10 -1
  6. package/lib/DatePicker/DatePicker.js +13 -0
  7. package/lib/NavigationBar/NavigationSubMenu.js +4 -8
  8. package/lib/QuantitySelector/QuantitySelector.js +67 -66
  9. package/lib/QuantitySelector/SideButton.js +93 -0
  10. package/lib/QuantitySelector/styles.js +4 -20
  11. package/lib/Spinner/Spinner.js +10 -1
  12. package/lib/Spinner/SpinnerContent.js +8 -0
  13. package/lib/Table/Cell.js +62 -91
  14. package/lib/Table/Header.js +4 -1
  15. package/lib/Table/SubHeading.js +4 -1
  16. package/lib/Table/Table.js +2 -1
  17. package/lib/TermsAndConditions/ExpandCollapse.js +31 -13
  18. package/lib/TermsAndConditions/TermsAndConditions.js +42 -10
  19. package/lib/Testimonial/Testimonial.js +48 -12
  20. package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
  21. package/lib/VideoPicker/VideoPickerThumbnail.js +103 -60
  22. package/lib/VideoPicker/VideoSlider.js +2 -2
  23. package/lib-module/Autocomplete/Loading.js +6 -12
  24. package/lib-module/Autocomplete/dictionary.js +2 -2
  25. package/lib-module/Badge/Badge.js +10 -1
  26. package/lib-module/DatePicker/DatePicker.js +13 -1
  27. package/lib-module/NavigationBar/NavigationSubMenu.js +5 -9
  28. package/lib-module/QuantitySelector/QuantitySelector.js +68 -67
  29. package/lib-module/QuantitySelector/SideButton.js +80 -0
  30. package/lib-module/QuantitySelector/styles.js +3 -15
  31. package/lib-module/Spinner/Spinner.js +10 -1
  32. package/lib-module/Spinner/SpinnerContent.js +8 -0
  33. package/lib-module/Table/Cell.js +65 -90
  34. package/lib-module/Table/Header.js +4 -1
  35. package/lib-module/Table/SubHeading.js +4 -1
  36. package/lib-module/Table/Table.js +2 -1
  37. package/lib-module/TermsAndConditions/ExpandCollapse.js +33 -15
  38. package/lib-module/TermsAndConditions/TermsAndConditions.js +42 -11
  39. package/lib-module/Testimonial/Testimonial.js +49 -13
  40. package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
  41. package/lib-module/VideoPicker/VideoPickerThumbnail.js +103 -61
  42. package/lib-module/VideoPicker/VideoSlider.js +2 -2
  43. package/package.json +4 -4
  44. package/src/Autocomplete/Loading.jsx +2 -5
  45. package/src/Autocomplete/dictionary.js +2 -2
  46. package/src/Badge/Badge.jsx +14 -2
  47. package/src/DatePicker/DatePicker.jsx +14 -1
  48. package/src/NavigationBar/NavigationSubMenu.jsx +3 -4
  49. package/src/QuantitySelector/QuantitySelector.jsx +60 -76
  50. package/src/QuantitySelector/SideButton.jsx +74 -0
  51. package/src/QuantitySelector/styles.js +4 -70
  52. package/src/Spinner/Spinner.jsx +9 -1
  53. package/src/Spinner/SpinnerContent.jsx +13 -1
  54. package/src/Table/Cell.jsx +58 -78
  55. package/src/Table/Header.jsx +6 -1
  56. package/src/Table/SubHeading.jsx +4 -1
  57. package/src/Table/Table.jsx +10 -2
  58. package/src/TermsAndConditions/ExpandCollapse.jsx +36 -14
  59. package/src/TermsAndConditions/TermsAndConditions.jsx +48 -10
  60. package/src/Testimonial/Testimonial.jsx +73 -11
  61. package/src/VideoPicker/VideoPickerPlayer.jsx +2 -2
  62. package/src/VideoPicker/VideoPickerThumbnail.jsx +51 -30
  63. package/src/VideoPicker/VideoSlider.jsx +2 -2
  64. package/types/BaseProvider.d.ts +25 -0
  65. package/types/index.d.ts +1 -1
@@ -1,93 +1,80 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled, { css } from 'styled-components';
4
- import { Typography, useThemeTokens } from '@telus-uds/components-base';
4
+ import { Typography, useThemeTokens, applyShadowToken } from '@telus-uds/components-base';
5
5
  import { useTableContext } from './Table';
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
- const stickyStyles = /*#__PURE__*/css(["position:sticky;left:0;z-index:2;clip-path:inset(0 -8px 0 0);&::before{content:'';box-shadow:", ";position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;}"], _ref => {
7
+ const HEADER_TYPE = {
8
+ HEADING: 'heading',
9
+ SUBHEADING: 'subHeading',
10
+ ROWHEADING: 'rowHeading'
11
+ };
12
+
13
+ const stickyStyles = _ref => {
8
14
  let {
9
- cellStickyShadow
15
+ cellStickyShadow,
16
+ stickyBackgroundColor,
17
+ type
10
18
  } = _ref;
11
- return cellStickyShadow;
12
- });
19
+ return css(["position:sticky;left:0;z-index:2;clip-path:inset(0 -8px 0 0);", " &::before{content:'';box-shadow:", ";position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;}"], type !== HEADER_TYPE.SUBHEADING && type !== HEADER_TYPE.HEADING ? `background-color: ${stickyBackgroundColor};` : undefined, cellStickyShadow);
20
+ };
21
+
13
22
  const sharedStyles = /*#__PURE__*/css(["", ""], _ref2 => {
14
23
  let {
15
24
  isSticky,
16
- cellBoxShadowColor,
17
25
  align,
18
26
  cellPaddingTop,
19
27
  cellPaddingRight,
20
28
  cellPaddingBottom,
21
29
  cellPaddingLeft,
22
- cellMinWidth
30
+ cellMinWidth,
31
+ cellBackground,
32
+ cellStickyShadow,
33
+ stickyBackgroundColor,
34
+ type
23
35
  } = _ref2;
24
- return css(["", ";box-shadow:inset 0 -1px 0 ", ";text-align:", ";min-width:", "px;padding:", "px ", "px ", "px ", "px;"], isSticky ? stickyStyles : undefined, cellBoxShadowColor, align, cellMinWidth, cellPaddingTop, cellPaddingRight, cellPaddingBottom, cellPaddingLeft);
36
+ return css(["text-align:", ";min-width:", "px;padding:", "px ", "px ", "px ", "px;background-color:", ";", ";"], align, cellMinWidth, cellPaddingTop, cellPaddingRight, cellPaddingBottom, cellPaddingLeft, cellBackground, isSticky && stickyStyles({
37
+ type,
38
+ cellStickyShadow,
39
+ stickyBackgroundColor
40
+ }));
25
41
  });
26
- const StyledHeading = /*#__PURE__*/styled.th.withConfig({
27
- displayName: "Cell__StyledHeading",
42
+
43
+ const createStyledCell = htmlElement => styled[htmlElement].withConfig({
44
+ displayName: "Cell__createStyledCell",
28
45
  componentId: "components-web__sc-ltgfic-0"
29
- })(["", ";", ""], sharedStyles, _ref3 => {
46
+ })(["", ";box-shadow:", ";"], sharedStyles, _ref3 => {
30
47
  let {
31
- cellHeadingBackground,
32
- cellHeadingBoxShadowColor
48
+ cellBoxShadowColor,
49
+ type
33
50
  } = _ref3;
34
- return `
35
- background-color: ${cellHeadingBackground};
36
- box-shadow: inset 0 1px 0 ${cellHeadingBoxShadowColor}, inset 0 -1px 0 ${cellHeadingBoxShadowColor};`;
37
- });
38
- const StyledSubHeading = /*#__PURE__*/styled.th.withConfig({
39
- displayName: "Cell__StyledSubHeading",
40
- componentId: "components-web__sc-ltgfic-1"
41
- })(["", ";background-color:", ";"], sharedStyles, _ref4 => {
42
- let {
43
- cellSubheadingBackground
44
- } = _ref4;
45
- return cellSubheadingBackground;
46
- });
47
- const StyledCell = /*#__PURE__*/styled.td.withConfig({
48
- displayName: "Cell__StyledCell",
49
- componentId: "components-web__sc-ltgfic-2"
50
- })(["", ";background-color:", ";"], sharedStyles, _ref5 => {
51
- let {
52
- cellBackground
53
- } = _ref5;
54
- return cellBackground;
55
- });
56
- const StyledRowHeading = /*#__PURE__*/styled.th.withConfig({
57
- displayName: "Cell__StyledRowHeading",
58
- componentId: "components-web__sc-ltgfic-3"
59
- })(["", ";background-color:", ";"], sharedStyles, _ref6 => {
60
- let {
61
- cellRowHeadingBackground
62
- } = _ref6;
63
- return cellRowHeadingBackground;
51
+ return type === HEADER_TYPE.HEADING ? `inset 0 1px 0 ${cellBoxShadowColor}, inset 0 -1px 0 ${cellBoxShadowColor}` : `inset 0 1px 0 ${cellBoxShadowColor}`;
64
52
  });
65
53
 
66
- const Cell = _ref7 => {
54
+ const StyledHeaderCell = createStyledCell('th');
55
+ const StyledDataCell = createStyledCell('td');
56
+
57
+ const Cell = _ref4 => {
67
58
  let {
68
59
  children,
69
- type = 'default',
70
60
  isFirstInRow,
71
61
  align = 'left',
72
- tokens: cellTokens
73
- } = _ref7;
62
+ tokens: cellTokens,
63
+ type
64
+ } = _ref4;
74
65
  const {
75
66
  text,
76
67
  isScrollable: isTableScrollable,
77
- variant,
78
- tokens: tableTokens
68
+ tokens: tableTokens,
69
+ spacing
79
70
  } = useTableContext();
80
71
  const themeTokens = { ...tableTokens,
81
72
  ...cellTokens
82
73
  };
83
74
  const {
84
75
  cellMinWidth,
85
- cellHeadingBackground,
86
- cellHeadingBoxShadowColor,
87
76
  cellBoxShadowColor,
88
- cellSubheadingBackground,
89
77
  cellBackground,
90
- cellRowHeadingBackground,
91
78
  cellStickyShadow,
92
79
  cellPaddingTop,
93
80
  cellPaddingRight,
@@ -95,80 +82,72 @@ const Cell = _ref7 => {
95
82
  cellPaddingBottom,
96
83
  fontName,
97
84
  fontWeight,
98
- fontSize
99
- } = useThemeTokens('Table', themeTokens, variant);
85
+ fontSize,
86
+ lineHeight,
87
+ stickyBackgroundColor
88
+ } = useThemeTokens('Table', themeTokens, {
89
+ spacing,
90
+ type,
91
+ text
92
+ });
100
93
  const sharedProps = {
101
94
  align,
102
95
  isSticky: isTableScrollable && isFirstInRow,
96
+ cellBackground,
103
97
  cellMinWidth,
104
- cellStickyShadow,
98
+ cellStickyShadow: applyShadowToken(cellStickyShadow).boxShadow,
105
99
  cellPaddingTop,
106
100
  cellPaddingRight,
107
101
  cellPaddingLeft,
108
102
  cellPaddingBottom,
103
+ stickyBackgroundColor,
109
104
  cellBoxShadowColor
110
105
  };
111
106
  const typographyTokens = {
112
107
  fontName,
113
108
  fontWeight,
114
- fontSize
109
+ fontSize,
110
+ lineHeight
115
111
  };
116
112
 
117
113
  switch (type) {
118
- case 'heading':
119
- return /*#__PURE__*/_jsx(StyledHeading, {
114
+ case HEADER_TYPE.HEADING:
115
+ return /*#__PURE__*/_jsx(StyledHeaderCell, {
120
116
  scope: "col",
121
- cellHeadingBackground: cellHeadingBackground,
122
- cellHeadingBoxShadowColor: cellHeadingBoxShadowColor,
123
117
  ...sharedProps,
118
+ type: type,
124
119
  children: /*#__PURE__*/_jsx(Typography, {
125
120
  tokens: typographyTokens,
126
- variant: {
127
- size: 'h4'
128
- },
129
121
  children: children
130
122
  })
131
123
  });
132
124
 
133
- case 'subHeading':
134
- return /*#__PURE__*/_jsx(StyledSubHeading, {
125
+ case HEADER_TYPE.SUBHEADING:
126
+ return /*#__PURE__*/_jsx(StyledHeaderCell, {
135
127
  scope: "col",
136
- cellSubheadingBackground: cellSubheadingBackground,
137
128
  ...sharedProps,
129
+ type: type,
138
130
  children: /*#__PURE__*/_jsx(Typography, {
139
131
  tokens: typographyTokens,
140
- variant: {
141
- size: 'h5'
142
- },
143
132
  children: children
144
133
  })
145
134
  });
146
135
 
147
- case 'rowHeading':
148
- return /*#__PURE__*/_jsx(StyledRowHeading, {
136
+ case HEADER_TYPE.ROWHEADING:
137
+ return /*#__PURE__*/_jsx(StyledHeaderCell, {
149
138
  scope: "row",
150
- cellRowHeadingBackground: cellRowHeadingBackground,
151
139
  ...sharedProps,
140
+ type: type,
152
141
  children: /*#__PURE__*/_jsx(Typography, {
153
142
  tokens: typographyTokens,
154
- variant: {
155
- size: text === 'small' ? 'h5' : 'h4'
156
- },
157
143
  children: children
158
144
  })
159
145
  });
160
146
 
161
147
  default:
162
- return /*#__PURE__*/_jsx(StyledCell, {
163
- cellBackground: cellBackground,
164
- ...sharedProps,
148
+ return /*#__PURE__*/_jsx(StyledDataCell, { ...sharedProps,
165
149
  children: /*#__PURE__*/_jsx(Typography, {
166
- tokens: {
167
- fontSize
168
- },
169
- variant: {
170
- size: text
171
- },
150
+ tokens: typographyTokens,
172
151
  children: children
173
152
  })
174
153
  });
@@ -176,14 +155,10 @@ const Cell = _ref7 => {
176
155
  };
177
156
 
178
157
  Cell.propTypes = {
158
+ type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
179
159
  tokens: PropTypes.object,
180
160
  children: PropTypes.node,
181
161
 
182
- /**
183
- * Defines the visual styles of a cell, and whether it should be a `td` or `th` element
184
- */
185
- type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
186
-
187
162
  /**
188
163
  * @ignore
189
164
  * Used internally for making the first column sticky
@@ -9,7 +9,10 @@ const Header = _ref => {
9
9
  } = _ref;
10
10
  return /*#__PURE__*/_jsx("thead", {
11
11
  children: /*#__PURE__*/_jsx(Row, {
12
- children: React.Children.map(children, child => /*#__PURE__*/cloneElement(child, {
12
+ children: React.Children.map(children, child =>
13
+ /*#__PURE__*/
14
+ // TO DO: pass type as a variant instead of prop
15
+ cloneElement(child, {
13
16
  type: 'heading'
14
17
  }))
15
18
  })
@@ -8,7 +8,10 @@ const Header = _ref => {
8
8
  children
9
9
  } = _ref;
10
10
  return /*#__PURE__*/_jsx(Row, {
11
- children: React.Children.map(children, child => /*#__PURE__*/cloneElement(child, {
11
+ children: React.Children.map(children, child =>
12
+ /*#__PURE__*/
13
+ // TO DO: pass type as a variant instead of prop
14
+ cloneElement(child, {
12
15
  type: 'subHeading'
13
16
  }))
14
17
  });
@@ -39,6 +39,7 @@ export const useTableContext = () => useContext(TableContext);
39
39
  const Table = _ref2 => {
40
40
  let {
41
41
  children,
42
+ spacing = 'default',
42
43
  fullWidth = true,
43
44
  text = 'medium',
44
45
  tokens,
@@ -83,7 +84,7 @@ const Table = _ref2 => {
83
84
  text,
84
85
  isScrollable,
85
86
  tokens,
86
- variant
87
+ spacing
87
88
  },
88
89
  children: /*#__PURE__*/_jsx(StyledTable, {
89
90
  tableWidth: tableWidth,
@@ -1,6 +1,6 @@
1
- import React, { forwardRef } from 'react';
1
+ import React, { forwardRef, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { ExpandCollapse as ExpandCollapseBase, Icon, useThemeTokensCallback } from '@telus-uds/components-base';
3
+ import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
4
4
  import styled from 'styled-components';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,12 +23,9 @@ const ExpandCollapseIconContainer = /*#__PURE__*/styled.div.withConfig({
23
23
  } = _ref;
24
24
  return {
25
25
  alignItems: tokens.expandIconContainerAlignItems,
26
- border: `${tokens.expandIconContainerBorder}px solid ${tokens.expandIconContainerBorderColor}`,
27
- borderRadius: '50%',
28
- display: 'flex',
29
- height: tokens.expandIconContainerHeight,
30
26
  justifyContent: tokens.expandIconContainerJustifyContent,
31
- margin: `${tokens.expandIconContainerMarginX}px ${tokens.expandIconContainerMarginY}px`,
27
+ marginLeft: `${tokens.expandIconContainerMarginY}px`,
28
+ marginRight: `${tokens.expandIconContainerMarginY}px`,
32
29
  width: tokens.expandIconContainerWidth
33
30
  };
34
31
  });
@@ -41,7 +38,7 @@ const ExpandCollapseTitle = /*#__PURE__*/styled.h4.withConfig({
41
38
  } = _ref2;
42
39
  return {
43
40
  color: tokens.expandTitleColor,
44
- fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
41
+ fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
45
42
  fontSize: tokens.expandTitleFontSize,
46
43
  lineHeight: tokens.expandTitleLineHeight,
47
44
  margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
@@ -59,8 +56,21 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
59
56
  expandContentPaddingBottom,
60
57
  expandContentPaddingLeft,
61
58
  expandContentPaddingRight,
62
- expandContentPaddingTop
59
+ expandContentPaddingTop,
60
+ contentBorderColor,
61
+ contentMarginBottom,
62
+ expandTitlePaddingLeft,
63
+ expandTitleBorder,
64
+ expandTitleBorderColor,
65
+ expandTitleUnderline
63
66
  } = getTokens();
67
+ const [expand, setExpand] = useState(false);
68
+
69
+ const handleExpandToggle = (expandProps, event, expanded) => {
70
+ expandProps.onToggle('ExpandCollapsePanel', event);
71
+ setExpand(!expanded);
72
+ };
73
+
64
74
  return /*#__PURE__*/_jsx(ExpandCollapseBase, {
65
75
  tokens: {
66
76
  borderWidth: expandBaseBorderWidth
@@ -68,7 +78,12 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
68
78
  children: expandProps => /*#__PURE__*/_jsx(ExpandCollapseBase.Panel, { ...expandProps,
69
79
  panelId: "ExpandCollapsePanel",
70
80
  controlTokens: {
71
- icon: null
81
+ icon: null,
82
+ backgroundColor: 'transparent',
83
+ paddingLeft: expandTitlePaddingLeft,
84
+ borderColor: expandTitleBorderColor,
85
+ borderWidth: expandTitleBorder,
86
+ textLine: expandTitleUnderline
72
87
  } // TODO refactor
73
88
  // eslint-disable-next-line react/no-unstable-nested-components
74
89
  ,
@@ -82,15 +97,16 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
82
97
  expanded
83
98
  });
84
99
  return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
85
- onClick: event => expandProps.onToggle('ExpandCollapsePanel', event),
100
+ onClick: event => handleExpandToggle(expandProps, event, expanded),
86
101
  ref: ref,
87
102
  children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
88
103
  tokens: getTokens(),
89
- children: /*#__PURE__*/_jsx(Icon, {
104
+ children: /*#__PURE__*/_jsx(IconButton, {
90
105
  icon: icon,
91
106
  variant: {
92
107
  size: 'small'
93
- }
108
+ },
109
+ onClick: event => handleExpandToggle(expandProps, event, expanded)
94
110
  })
95
111
  }), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
96
112
  tokens: getTokens(),
@@ -102,9 +118,11 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
102
118
  contentPaddingBottom: expandContentPaddingBottom,
103
119
  contentPaddingLeft: expandContentPaddingLeft,
104
120
  contentPaddingRight: expandContentPaddingRight,
105
- contentPaddingTop: expandContentPaddingTop
121
+ contentPaddingTop: expandContentPaddingTop,
122
+ borderColor: contentBorderColor,
123
+ marginBottom: contentMarginBottom
106
124
  },
107
- children: children
125
+ children: expand ? children : null
108
126
  })
109
127
  });
110
128
  });
@@ -1,11 +1,11 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens } from '@telus-uds/components-base';
4
+ import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport } from '@telus-uds/components-base';
5
5
  import ExpandCollapse from './ExpandCollapse';
6
6
  import OrderedListBase from '../OrderedList/OrderedListBase';
7
7
  import { htmlAttrs, media, renderStructuredContent } from '../utils';
8
- import dictionary from './dictionary';
8
+ import defaultDictionary from './dictionary';
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
@@ -47,7 +47,8 @@ const Unordered = /*#__PURE__*/styled.ul.withConfig({
47
47
  return {
48
48
  listStyleType: 'none',
49
49
  margin: 0,
50
- padding: tokens.unorderedPadding
50
+ padding: 0,
51
+ paddingTop: tokens.unorderedPadding
51
52
  };
52
53
  });
53
54
  const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
@@ -105,6 +106,7 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
105
106
  nonIndexedContent,
106
107
  tokens,
107
108
  variant = {},
109
+ dictionary = defaultDictionary,
108
110
  ...rest
109
111
  } = _ref6;
110
112
  const getCopy = useCopy({
@@ -113,9 +115,16 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
113
115
  });
114
116
  const hasIndexedContent = indexedContent.length > 0;
115
117
  const hasNonIndexedContent = nonIndexedContent.length > 0;
116
- const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant);
118
+ const viewport = useViewport();
119
+ const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant, {
120
+ viewport
121
+ });
117
122
  return /*#__PURE__*/_jsxs("div", { ...selectProps(rest),
118
- children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(ExpandCollapse, {
123
+ children: [/*#__PURE__*/_jsx(Divider, {
124
+ tokens: {
125
+ color: themeTokens.dividerColor
126
+ }
127
+ }), /*#__PURE__*/_jsx(ExpandCollapse, {
119
128
  collapseTitle: getCopy('headingView'),
120
129
  expandTitle: getCopy('headingHide'),
121
130
  ref: ref,
@@ -137,8 +146,11 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
137
146
  children: /*#__PURE__*/_jsx(Typography, {
138
147
  block: true,
139
148
  heading: true,
140
- variant: {
141
- size: 'h4'
149
+ tokens: {
150
+ fontName: themeTokens.expandTitleFontName,
151
+ fontWeight: themeTokens.expandTitleFontWeight,
152
+ fontSize: themeTokens.titleFontSize,
153
+ lineHeight: themeTokens.titleLineHeight
142
154
  },
143
155
  children: getCopy('nonIndexedTitle')
144
156
  })
@@ -154,10 +166,20 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
154
166
  })]
155
167
  })]
156
168
  })
157
- }), /*#__PURE__*/_jsx(Divider, {})]
169
+ }), /*#__PURE__*/_jsx(Divider, {
170
+ tokens: {
171
+ color: themeTokens.dividerColor
172
+ }
173
+ })]
158
174
  });
159
175
  });
160
- TermsAndConditions.displayName = 'TermsAndConditions';
176
+ TermsAndConditions.displayName = 'TermsAndConditions'; // If a language dictionary entry is provided, it must contain every key
177
+
178
+ const dictionaryContentShape = PropTypes.shape({
179
+ headingHide: PropTypes.string.isRequired,
180
+ headingView: PropTypes.string.isRequired,
181
+ nonIndexedTitle: PropTypes.string.isRequired
182
+ });
161
183
  TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
162
184
 
163
185
  /**
@@ -183,11 +205,20 @@ TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
183
205
  *
184
206
  * nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
185
207
  */
186
- nonIndexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string]))
208
+ nonIndexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string])),
209
+
210
+ /**
211
+ * Custom dictionary containing the labels to use for `TermsAndConditions`
212
+ */
213
+ dictionary: PropTypes.shape({
214
+ en: dictionaryContentShape,
215
+ fr: dictionaryContentShape
216
+ })
187
217
  };
188
218
  TermsAndConditions.defaultProps = {
189
219
  copy: 'en',
190
220
  indexedContent: [],
191
- nonIndexedContent: []
221
+ nonIndexedContent: [],
222
+ dictionary: defaultDictionary
192
223
  };
193
224
  export default TermsAndConditions;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { Icon, selectSystemProps, Typography, useThemeTokens } from '@telus-uds/components-base';
4
+ import { Icon, selectSystemProps, Typography, useThemeTokens, useViewport } from '@telus-uds/components-base';
5
5
  import Image from '../Image';
6
6
  import { htmlAttrs } from '../utils';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -83,11 +83,13 @@ const Testimonial = _ref5 => {
83
83
  imageSrc,
84
84
  image = imageSrc,
85
85
  additionalInfo,
86
- testimonialStyle = 'heading',
86
+ testimonialStyle = 'large',
87
87
  tokens,
88
+ copy = 'en',
88
89
  variant = {},
89
90
  ...rest
90
91
  } = _ref5;
92
+ const viewport = useViewport();
91
93
  const {
92
94
  testimonialContainerGap,
93
95
  quoteContainerGap,
@@ -96,9 +98,34 @@ const Testimonial = _ref5 => {
96
98
  figcaptionGap,
97
99
  textColor,
98
100
  icon,
101
+ iconFr,
99
102
  iconColor,
100
- imageSize
101
- } = useThemeTokens('Testimonial', tokens, variant);
103
+ imageSize,
104
+ testimonialFontSizeLarge,
105
+ testimonialLineHeightLarge,
106
+ testimonialFontWeightLarge,
107
+ testimonialFontSizeHeading,
108
+ testimonialLineHeightHeading,
109
+ testimonialFontNameHeading,
110
+ testimonialFontWeightHeading,
111
+ authorFontSize,
112
+ authorLineHeight,
113
+ authorFontName,
114
+ authorFontWeight,
115
+ additionalFontSize,
116
+ additionalLineHeight,
117
+ additionalFontName,
118
+ additionalFontWeight
119
+ } = useThemeTokens('Testimonial', tokens, variant, {
120
+ viewport
121
+ });
122
+
123
+ const getQuoteTestimonial = open => {
124
+ let quote = '';
125
+ if (copy === 'en') quote = open ? '\u201C' : '\u201D';else quote = open ? '\u00AB ' : ' \u00BB';
126
+ return quote;
127
+ };
128
+
102
129
  return /*#__PURE__*/_jsxs(TestimonialContainer, {
103
130
  testimonialContainerGap: testimonialContainerGap,
104
131
  ...selectProps(rest),
@@ -111,7 +138,7 @@ const Testimonial = _ref5 => {
111
138
  variant: {
112
139
  size: 'micro'
113
140
  },
114
- icon: icon
141
+ icon: copy === 'en' ? icon : iconFr
115
142
  }), showDivider && /*#__PURE__*/_jsx(Divider, {
116
143
  dividerBackgroundColor: dividerBackgroundColor,
117
144
  dividerBorder: dividerBorder,
@@ -124,9 +151,12 @@ const Testimonial = _ref5 => {
124
151
  },
125
152
  tokens: {
126
153
  color: textColor,
127
- fontWeight: '400'
154
+ fontSize: testimonialStyle === 'heading' ? testimonialFontSizeHeading : testimonialFontSizeLarge,
155
+ lineHeight: testimonialStyle === 'heading' ? testimonialLineHeightHeading : testimonialLineHeightLarge,
156
+ fontName: testimonialFontNameHeading,
157
+ fontWeight: testimonialStyle === 'heading' ? testimonialFontWeightHeading : testimonialFontWeightLarge
128
158
  },
129
- children: `\u201C${testimonial}\u201D`
159
+ children: `${getQuoteTestimonial(true)}${testimonial}${getQuoteTestimonial()}`
130
160
  })
131
161
  }), (image || title || additionalInfo) && /*#__PURE__*/_jsxs(Figcaption, {
132
162
  figcaptionGap: figcaptionGap,
@@ -139,20 +169,26 @@ const Testimonial = _ref5 => {
139
169
  }) : image), (title || additionalInfo) && /*#__PURE__*/_jsxs(AuthorInfoContainer, {
140
170
  children: [title && /*#__PURE__*/_jsx(Typography, {
141
171
  variant: {
142
- size: 'small',
143
- colour: 'secondary'
172
+ size: 'small'
144
173
  },
145
174
  tokens: {
146
- fontWeight: '500'
175
+ color: textColor,
176
+ fontSize: authorFontSize,
177
+ lineHeight: authorLineHeight,
178
+ fontName: authorFontName,
179
+ fontWeight: authorFontWeight
147
180
  },
148
181
  children: title
149
182
  }), additionalInfo && /*#__PURE__*/_jsx(Typography, {
150
183
  variant: {
151
- size: 'micro',
152
- colour: 'secondary'
184
+ size: 'small'
153
185
  },
154
186
  tokens: {
155
- fontWeight: '400'
187
+ color: textColor,
188
+ fontSize: additionalFontSize,
189
+ lineHeight: additionalLineHeight,
190
+ fontName: additionalFontName,
191
+ fontWeight: additionalFontWeight
156
192
  },
157
193
  children: additionalInfo
158
194
  })]
@@ -26,11 +26,13 @@ const VideoPickerPlayer = _ref => {
26
26
  space: 2,
27
27
  children: [/*#__PURE__*/_jsx(Typography, {
28
28
  variant: {
29
- size: 'h2',
30
- colour: 'secondary'
29
+ size: 'h3'
31
30
  },
32
31
  children: video.title
33
32
  }), /*#__PURE__*/_jsx(Typography, {
33
+ variant: {
34
+ colour: 'default'
35
+ },
34
36
  children: video.description
35
37
  })]
36
38
  })]