@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.
- package/CHANGELOG.md +40 -2
- package/component-docs.json +105 -43
- package/lib/Autocomplete/Loading.js +5 -10
- package/lib/Autocomplete/dictionary.js +2 -2
- package/lib/Badge/Badge.js +10 -1
- package/lib/DatePicker/DatePicker.js +13 -0
- package/lib/NavigationBar/NavigationSubMenu.js +4 -8
- package/lib/QuantitySelector/QuantitySelector.js +67 -66
- package/lib/QuantitySelector/SideButton.js +93 -0
- package/lib/QuantitySelector/styles.js +4 -20
- package/lib/Spinner/Spinner.js +10 -1
- package/lib/Spinner/SpinnerContent.js +8 -0
- package/lib/Table/Cell.js +62 -91
- package/lib/Table/Header.js +4 -1
- package/lib/Table/SubHeading.js +4 -1
- package/lib/Table/Table.js +2 -1
- package/lib/TermsAndConditions/ExpandCollapse.js +31 -13
- package/lib/TermsAndConditions/TermsAndConditions.js +42 -10
- package/lib/Testimonial/Testimonial.js +48 -12
- package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib/VideoPicker/VideoPickerThumbnail.js +103 -60
- package/lib/VideoPicker/VideoSlider.js +2 -2
- package/lib-module/Autocomplete/Loading.js +6 -12
- package/lib-module/Autocomplete/dictionary.js +2 -2
- package/lib-module/Badge/Badge.js +10 -1
- package/lib-module/DatePicker/DatePicker.js +13 -1
- package/lib-module/NavigationBar/NavigationSubMenu.js +5 -9
- package/lib-module/QuantitySelector/QuantitySelector.js +68 -67
- package/lib-module/QuantitySelector/SideButton.js +80 -0
- package/lib-module/QuantitySelector/styles.js +3 -15
- package/lib-module/Spinner/Spinner.js +10 -1
- package/lib-module/Spinner/SpinnerContent.js +8 -0
- package/lib-module/Table/Cell.js +65 -90
- package/lib-module/Table/Header.js +4 -1
- package/lib-module/Table/SubHeading.js +4 -1
- package/lib-module/Table/Table.js +2 -1
- package/lib-module/TermsAndConditions/ExpandCollapse.js +33 -15
- package/lib-module/TermsAndConditions/TermsAndConditions.js +42 -11
- package/lib-module/Testimonial/Testimonial.js +49 -13
- package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +103 -61
- package/lib-module/VideoPicker/VideoSlider.js +2 -2
- package/package.json +4 -4
- package/src/Autocomplete/Loading.jsx +2 -5
- package/src/Autocomplete/dictionary.js +2 -2
- package/src/Badge/Badge.jsx +14 -2
- package/src/DatePicker/DatePicker.jsx +14 -1
- package/src/NavigationBar/NavigationSubMenu.jsx +3 -4
- package/src/QuantitySelector/QuantitySelector.jsx +60 -76
- package/src/QuantitySelector/SideButton.jsx +74 -0
- package/src/QuantitySelector/styles.js +4 -70
- package/src/Spinner/Spinner.jsx +9 -1
- package/src/Spinner/SpinnerContent.jsx +13 -1
- package/src/Table/Cell.jsx +58 -78
- package/src/Table/Header.jsx +6 -1
- package/src/Table/SubHeading.jsx +4 -1
- package/src/Table/Table.jsx +10 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +36 -14
- package/src/TermsAndConditions/TermsAndConditions.jsx +48 -10
- package/src/Testimonial/Testimonial.jsx +73 -11
- package/src/VideoPicker/VideoPickerPlayer.jsx +2 -2
- package/src/VideoPicker/VideoPickerThumbnail.jsx +51 -30
- package/src/VideoPicker/VideoSlider.jsx +2 -2
- package/types/BaseProvider.d.ts +25 -0
- package/types/index.d.ts +1 -1
package/lib/Table/SubHeading.js
CHANGED
|
@@ -24,7 +24,10 @@ const Header = _ref => {
|
|
|
24
24
|
children
|
|
25
25
|
} = _ref;
|
|
26
26
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Row.default, {
|
|
27
|
-
children: _react.default.Children.map(children, child =>
|
|
27
|
+
children: _react.default.Children.map(children, child =>
|
|
28
|
+
/*#__PURE__*/
|
|
29
|
+
// TO DO: pass type as a variant instead of prop
|
|
30
|
+
(0, _react.cloneElement)(child, {
|
|
28
31
|
type: 'subHeading'
|
|
29
32
|
}))
|
|
30
33
|
});
|
package/lib/Table/Table.js
CHANGED
|
@@ -66,6 +66,7 @@ exports.useTableContext = useTableContext;
|
|
|
66
66
|
const Table = _ref2 => {
|
|
67
67
|
let {
|
|
68
68
|
children,
|
|
69
|
+
spacing = 'default',
|
|
69
70
|
fullWidth = true,
|
|
70
71
|
text = 'medium',
|
|
71
72
|
tokens,
|
|
@@ -110,7 +111,7 @@ const Table = _ref2 => {
|
|
|
110
111
|
text,
|
|
111
112
|
isScrollable,
|
|
112
113
|
tokens,
|
|
113
|
-
|
|
114
|
+
spacing
|
|
114
115
|
},
|
|
115
116
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
|
|
116
117
|
tableWidth: tableWidth,
|
|
@@ -41,12 +41,9 @@ const ExpandCollapseIconContainer = /*#__PURE__*/_styledComponents.default.div.w
|
|
|
41
41
|
} = _ref;
|
|
42
42
|
return {
|
|
43
43
|
alignItems: tokens.expandIconContainerAlignItems,
|
|
44
|
-
border: `${tokens.expandIconContainerBorder}px solid ${tokens.expandIconContainerBorderColor}`,
|
|
45
|
-
borderRadius: '50%',
|
|
46
|
-
display: 'flex',
|
|
47
|
-
height: tokens.expandIconContainerHeight,
|
|
48
44
|
justifyContent: tokens.expandIconContainerJustifyContent,
|
|
49
|
-
|
|
45
|
+
marginLeft: `${tokens.expandIconContainerMarginY}px`,
|
|
46
|
+
marginRight: `${tokens.expandIconContainerMarginY}px`,
|
|
50
47
|
width: tokens.expandIconContainerWidth
|
|
51
48
|
};
|
|
52
49
|
});
|
|
@@ -60,7 +57,7 @@ const ExpandCollapseTitle = /*#__PURE__*/_styledComponents.default.h4.withConfig
|
|
|
60
57
|
} = _ref2;
|
|
61
58
|
return {
|
|
62
59
|
color: tokens.expandTitleColor,
|
|
63
|
-
fontFamily: `${tokens.
|
|
60
|
+
fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
|
|
64
61
|
fontSize: tokens.expandTitleFontSize,
|
|
65
62
|
lineHeight: tokens.expandTitleLineHeight,
|
|
66
63
|
margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
|
|
@@ -79,8 +76,21 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
79
76
|
expandContentPaddingBottom,
|
|
80
77
|
expandContentPaddingLeft,
|
|
81
78
|
expandContentPaddingRight,
|
|
82
|
-
expandContentPaddingTop
|
|
79
|
+
expandContentPaddingTop,
|
|
80
|
+
contentBorderColor,
|
|
81
|
+
contentMarginBottom,
|
|
82
|
+
expandTitlePaddingLeft,
|
|
83
|
+
expandTitleBorder,
|
|
84
|
+
expandTitleBorderColor,
|
|
85
|
+
expandTitleUnderline
|
|
83
86
|
} = getTokens();
|
|
87
|
+
const [expand, setExpand] = (0, _react.useState)(false);
|
|
88
|
+
|
|
89
|
+
const handleExpandToggle = (expandProps, event, expanded) => {
|
|
90
|
+
expandProps.onToggle('ExpandCollapsePanel', event);
|
|
91
|
+
setExpand(!expanded);
|
|
92
|
+
};
|
|
93
|
+
|
|
84
94
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
|
|
85
95
|
tokens: {
|
|
86
96
|
borderWidth: expandBaseBorderWidth
|
|
@@ -88,7 +98,12 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
88
98
|
children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, { ...expandProps,
|
|
89
99
|
panelId: "ExpandCollapsePanel",
|
|
90
100
|
controlTokens: {
|
|
91
|
-
icon: null
|
|
101
|
+
icon: null,
|
|
102
|
+
backgroundColor: 'transparent',
|
|
103
|
+
paddingLeft: expandTitlePaddingLeft,
|
|
104
|
+
borderColor: expandTitleBorderColor,
|
|
105
|
+
borderWidth: expandTitleBorder,
|
|
106
|
+
textLine: expandTitleUnderline
|
|
92
107
|
} // TODO refactor
|
|
93
108
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
94
109
|
,
|
|
@@ -102,15 +117,16 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
102
117
|
expanded
|
|
103
118
|
});
|
|
104
119
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExpandCollapseControl, {
|
|
105
|
-
onClick: event => expandProps
|
|
120
|
+
onClick: event => handleExpandToggle(expandProps, event, expanded),
|
|
106
121
|
ref: ref,
|
|
107
122
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseIconContainer, {
|
|
108
123
|
tokens: getTokens(),
|
|
109
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.IconButton, {
|
|
110
125
|
icon: icon,
|
|
111
126
|
variant: {
|
|
112
127
|
size: 'small'
|
|
113
|
-
}
|
|
128
|
+
},
|
|
129
|
+
onClick: event => handleExpandToggle(expandProps, event, expanded)
|
|
114
130
|
})
|
|
115
131
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseTitle, {
|
|
116
132
|
tokens: getTokens(),
|
|
@@ -122,9 +138,11 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
122
138
|
contentPaddingBottom: expandContentPaddingBottom,
|
|
123
139
|
contentPaddingLeft: expandContentPaddingLeft,
|
|
124
140
|
contentPaddingRight: expandContentPaddingRight,
|
|
125
|
-
contentPaddingTop: expandContentPaddingTop
|
|
141
|
+
contentPaddingTop: expandContentPaddingTop,
|
|
142
|
+
borderColor: contentBorderColor,
|
|
143
|
+
marginBottom: contentMarginBottom
|
|
126
144
|
},
|
|
127
|
-
children: children
|
|
145
|
+
children: expand ? children : null
|
|
128
146
|
})
|
|
129
147
|
});
|
|
130
148
|
});
|
|
@@ -71,7 +71,8 @@ const Unordered = /*#__PURE__*/_styledComponents.default.ul.withConfig({
|
|
|
71
71
|
return {
|
|
72
72
|
listStyleType: 'none',
|
|
73
73
|
margin: 0,
|
|
74
|
-
padding:
|
|
74
|
+
padding: 0,
|
|
75
|
+
paddingTop: tokens.unorderedPadding
|
|
75
76
|
};
|
|
76
77
|
});
|
|
77
78
|
|
|
@@ -132,17 +133,25 @@ const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
132
133
|
nonIndexedContent,
|
|
133
134
|
tokens,
|
|
134
135
|
variant = {},
|
|
136
|
+
dictionary = _dictionary.default,
|
|
135
137
|
...rest
|
|
136
138
|
} = _ref6;
|
|
137
139
|
const getCopy = (0, _componentsBase.useCopy)({
|
|
138
|
-
dictionary
|
|
140
|
+
dictionary,
|
|
139
141
|
copy
|
|
140
142
|
});
|
|
141
143
|
const hasIndexedContent = indexedContent.length > 0;
|
|
142
144
|
const hasNonIndexedContent = nonIndexedContent.length > 0;
|
|
143
|
-
const
|
|
145
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
146
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('TermsAndConditions', tokens, variant, {
|
|
147
|
+
viewport
|
|
148
|
+
});
|
|
144
149
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { ...selectProps(rest),
|
|
145
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {
|
|
150
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {
|
|
151
|
+
tokens: {
|
|
152
|
+
color: themeTokens.dividerColor
|
|
153
|
+
}
|
|
154
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default, {
|
|
146
155
|
collapseTitle: getCopy('headingView'),
|
|
147
156
|
expandTitle: getCopy('headingHide'),
|
|
148
157
|
ref: ref,
|
|
@@ -164,8 +173,11 @@ const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
164
173
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
165
174
|
block: true,
|
|
166
175
|
heading: true,
|
|
167
|
-
|
|
168
|
-
|
|
176
|
+
tokens: {
|
|
177
|
+
fontName: themeTokens.expandTitleFontName,
|
|
178
|
+
fontWeight: themeTokens.expandTitleFontWeight,
|
|
179
|
+
fontSize: themeTokens.titleFontSize,
|
|
180
|
+
lineHeight: themeTokens.titleLineHeight
|
|
169
181
|
},
|
|
170
182
|
children: getCopy('nonIndexedTitle')
|
|
171
183
|
})
|
|
@@ -181,10 +193,21 @@ const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
181
193
|
})]
|
|
182
194
|
})]
|
|
183
195
|
})
|
|
184
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {
|
|
197
|
+
tokens: {
|
|
198
|
+
color: themeTokens.dividerColor
|
|
199
|
+
}
|
|
200
|
+
})]
|
|
185
201
|
});
|
|
186
202
|
});
|
|
187
|
-
TermsAndConditions.displayName = 'TermsAndConditions';
|
|
203
|
+
TermsAndConditions.displayName = 'TermsAndConditions'; // If a language dictionary entry is provided, it must contain every key
|
|
204
|
+
|
|
205
|
+
const dictionaryContentShape = _propTypes.default.shape({
|
|
206
|
+
headingHide: _propTypes.default.string.isRequired,
|
|
207
|
+
headingView: _propTypes.default.string.isRequired,
|
|
208
|
+
nonIndexedTitle: _propTypes.default.string.isRequired
|
|
209
|
+
});
|
|
210
|
+
|
|
188
211
|
TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
|
|
189
212
|
|
|
190
213
|
/**
|
|
@@ -210,12 +233,21 @@ TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
|
|
|
210
233
|
*
|
|
211
234
|
* nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
|
|
212
235
|
*/
|
|
213
|
-
nonIndexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string]))
|
|
236
|
+
nonIndexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])),
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Custom dictionary containing the labels to use for `TermsAndConditions`
|
|
240
|
+
*/
|
|
241
|
+
dictionary: _propTypes.default.shape({
|
|
242
|
+
en: dictionaryContentShape,
|
|
243
|
+
fr: dictionaryContentShape
|
|
244
|
+
})
|
|
214
245
|
};
|
|
215
246
|
TermsAndConditions.defaultProps = {
|
|
216
247
|
copy: 'en',
|
|
217
248
|
indexedContent: [],
|
|
218
|
-
nonIndexedContent: []
|
|
249
|
+
nonIndexedContent: [],
|
|
250
|
+
dictionary: _dictionary.default
|
|
219
251
|
};
|
|
220
252
|
var _default = TermsAndConditions;
|
|
221
253
|
exports.default = _default;
|
|
@@ -104,11 +104,13 @@ const Testimonial = _ref5 => {
|
|
|
104
104
|
imageSrc,
|
|
105
105
|
image = imageSrc,
|
|
106
106
|
additionalInfo,
|
|
107
|
-
testimonialStyle = '
|
|
107
|
+
testimonialStyle = 'large',
|
|
108
108
|
tokens,
|
|
109
|
+
copy = 'en',
|
|
109
110
|
variant = {},
|
|
110
111
|
...rest
|
|
111
112
|
} = _ref5;
|
|
113
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
112
114
|
const {
|
|
113
115
|
testimonialContainerGap,
|
|
114
116
|
quoteContainerGap,
|
|
@@ -117,9 +119,34 @@ const Testimonial = _ref5 => {
|
|
|
117
119
|
figcaptionGap,
|
|
118
120
|
textColor,
|
|
119
121
|
icon,
|
|
122
|
+
iconFr,
|
|
120
123
|
iconColor,
|
|
121
|
-
imageSize
|
|
122
|
-
|
|
124
|
+
imageSize,
|
|
125
|
+
testimonialFontSizeLarge,
|
|
126
|
+
testimonialLineHeightLarge,
|
|
127
|
+
testimonialFontWeightLarge,
|
|
128
|
+
testimonialFontSizeHeading,
|
|
129
|
+
testimonialLineHeightHeading,
|
|
130
|
+
testimonialFontNameHeading,
|
|
131
|
+
testimonialFontWeightHeading,
|
|
132
|
+
authorFontSize,
|
|
133
|
+
authorLineHeight,
|
|
134
|
+
authorFontName,
|
|
135
|
+
authorFontWeight,
|
|
136
|
+
additionalFontSize,
|
|
137
|
+
additionalLineHeight,
|
|
138
|
+
additionalFontName,
|
|
139
|
+
additionalFontWeight
|
|
140
|
+
} = (0, _componentsBase.useThemeTokens)('Testimonial', tokens, variant, {
|
|
141
|
+
viewport
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const getQuoteTestimonial = open => {
|
|
145
|
+
let quote = '';
|
|
146
|
+
if (copy === 'en') quote = open ? '\u201C' : '\u201D';else quote = open ? '\u00AB ' : ' \u00BB';
|
|
147
|
+
return quote;
|
|
148
|
+
};
|
|
149
|
+
|
|
123
150
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TestimonialContainer, {
|
|
124
151
|
testimonialContainerGap: testimonialContainerGap,
|
|
125
152
|
...selectProps(rest),
|
|
@@ -132,7 +159,7 @@ const Testimonial = _ref5 => {
|
|
|
132
159
|
variant: {
|
|
133
160
|
size: 'micro'
|
|
134
161
|
},
|
|
135
|
-
icon: icon
|
|
162
|
+
icon: copy === 'en' ? icon : iconFr
|
|
136
163
|
}), showDivider && /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
|
|
137
164
|
dividerBackgroundColor: dividerBackgroundColor,
|
|
138
165
|
dividerBorder: dividerBorder,
|
|
@@ -145,9 +172,12 @@ const Testimonial = _ref5 => {
|
|
|
145
172
|
},
|
|
146
173
|
tokens: {
|
|
147
174
|
color: textColor,
|
|
148
|
-
|
|
175
|
+
fontSize: testimonialStyle === 'heading' ? testimonialFontSizeHeading : testimonialFontSizeLarge,
|
|
176
|
+
lineHeight: testimonialStyle === 'heading' ? testimonialLineHeightHeading : testimonialLineHeightLarge,
|
|
177
|
+
fontName: testimonialFontNameHeading,
|
|
178
|
+
fontWeight: testimonialStyle === 'heading' ? testimonialFontWeightHeading : testimonialFontWeightLarge
|
|
149
179
|
},
|
|
150
|
-
children:
|
|
180
|
+
children: `${getQuoteTestimonial(true)}${testimonial}${getQuoteTestimonial()}`
|
|
151
181
|
})
|
|
152
182
|
}), (image || title || additionalInfo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(Figcaption, {
|
|
153
183
|
figcaptionGap: figcaptionGap,
|
|
@@ -160,20 +190,26 @@ const Testimonial = _ref5 => {
|
|
|
160
190
|
}) : image), (title || additionalInfo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(AuthorInfoContainer, {
|
|
161
191
|
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
162
192
|
variant: {
|
|
163
|
-
size: 'small'
|
|
164
|
-
colour: 'secondary'
|
|
193
|
+
size: 'small'
|
|
165
194
|
},
|
|
166
195
|
tokens: {
|
|
167
|
-
|
|
196
|
+
color: textColor,
|
|
197
|
+
fontSize: authorFontSize,
|
|
198
|
+
lineHeight: authorLineHeight,
|
|
199
|
+
fontName: authorFontName,
|
|
200
|
+
fontWeight: authorFontWeight
|
|
168
201
|
},
|
|
169
202
|
children: title
|
|
170
203
|
}), additionalInfo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
171
204
|
variant: {
|
|
172
|
-
size: '
|
|
173
|
-
colour: 'secondary'
|
|
205
|
+
size: 'small'
|
|
174
206
|
},
|
|
175
207
|
tokens: {
|
|
176
|
-
|
|
208
|
+
color: textColor,
|
|
209
|
+
fontSize: additionalFontSize,
|
|
210
|
+
lineHeight: additionalLineHeight,
|
|
211
|
+
fontName: additionalFontName,
|
|
212
|
+
fontWeight: additionalFontWeight
|
|
177
213
|
},
|
|
178
214
|
children: additionalInfo
|
|
179
215
|
})]
|
|
@@ -39,11 +39,13 @@ const VideoPickerPlayer = _ref => {
|
|
|
39
39
|
space: 2,
|
|
40
40
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
41
41
|
variant: {
|
|
42
|
-
size: '
|
|
43
|
-
colour: 'secondary'
|
|
42
|
+
size: 'h3'
|
|
44
43
|
},
|
|
45
44
|
children: video.title
|
|
46
45
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
46
|
+
variant: {
|
|
47
|
+
colour: 'default'
|
|
48
|
+
},
|
|
47
49
|
children: video.description
|
|
48
50
|
})]
|
|
49
51
|
})]
|
|
@@ -61,38 +61,47 @@ const createReactNativeStyles = _ref => {
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
const
|
|
65
|
-
displayName: "
|
|
64
|
+
const ImageContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
65
|
+
displayName: "VideoPickerThumbnail__ImageContainer",
|
|
66
66
|
componentId: "components-web__sc-1glxurq-0"
|
|
67
|
-
})(["
|
|
67
|
+
})(["padding:", ";border:", ";border-radius:", "px;"], props => `${props.outerBorderGap}px`, props => `${props.outerBorderWidth}px solid ${props.outerBorderColor}`, _ref2 => {
|
|
68
68
|
let {
|
|
69
|
-
|
|
69
|
+
outerBorderRadius
|
|
70
70
|
} = _ref2;
|
|
71
|
-
return
|
|
72
|
-
}
|
|
71
|
+
return outerBorderRadius;
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const VideoThumbnail = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
75
|
+
displayName: "VideoPickerThumbnail__VideoThumbnail",
|
|
76
|
+
componentId: "components-web__sc-1glxurq-1"
|
|
77
|
+
})(["position:relative;width:", ";flex-shrink:0;* button{display:none;}&::before{content:'';display:block;padding-bottom:56.25%;}&::after{content:'';border:", "px solid;border-color:", ";border-radius:", "px;position:absolute;top:0;left:0;right:0;bottom:0;}& > div{border-radius:", "px;}"], props => props.layout === 'vertical' ? '100%' : '144px', _ref3 => {
|
|
73
78
|
let {
|
|
74
|
-
|
|
75
|
-
borderColor
|
|
79
|
+
borderWidth
|
|
76
80
|
} = _ref3;
|
|
77
|
-
return
|
|
81
|
+
return borderWidth;
|
|
78
82
|
}, _ref4 => {
|
|
79
83
|
let {
|
|
80
|
-
|
|
84
|
+
borderColor
|
|
81
85
|
} = _ref4;
|
|
82
|
-
return
|
|
86
|
+
return borderColor;
|
|
83
87
|
}, _ref5 => {
|
|
84
88
|
let {
|
|
85
89
|
borderRadius
|
|
86
90
|
} = _ref5;
|
|
87
91
|
return borderRadius;
|
|
92
|
+
}, _ref6 => {
|
|
93
|
+
let {
|
|
94
|
+
borderRadius
|
|
95
|
+
} = _ref6;
|
|
96
|
+
return borderRadius;
|
|
88
97
|
});
|
|
89
98
|
|
|
90
99
|
const ThumbnailTitleContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
91
100
|
displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
|
|
92
|
-
componentId: "components-web__sc-1glxurq-
|
|
101
|
+
componentId: "components-web__sc-1glxurq-2"
|
|
93
102
|
})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
|
|
94
103
|
|
|
95
|
-
const VideoPickerThumbnail =
|
|
104
|
+
const VideoPickerThumbnail = _ref7 => {
|
|
96
105
|
let {
|
|
97
106
|
videoPlayerRef,
|
|
98
107
|
selectedVideoId,
|
|
@@ -103,56 +112,59 @@ const VideoPickerThumbnail = _ref6 => {
|
|
|
103
112
|
itemPositions,
|
|
104
113
|
index,
|
|
105
114
|
width = '100%'
|
|
106
|
-
} =
|
|
115
|
+
} = _ref7;
|
|
107
116
|
const viewport = (0, _componentsBase.useViewport)();
|
|
108
|
-
const {
|
|
109
|
-
titleColor,
|
|
110
|
-
subTitleColor,
|
|
111
|
-
...themeTokens
|
|
112
|
-
} = (0, _componentsBase.useThemeTokens)('VideoPickerThumbnail');
|
|
113
|
-
const rnStyles = createReactNativeStyles(themeTokens);
|
|
117
|
+
const getTokens = (0, _componentsBase.useThemeTokensCallback)('VideoPickerThumbnail', {}, {});
|
|
114
118
|
const {
|
|
115
119
|
timestamp
|
|
116
120
|
} = (0, _helpers.getTimestamp)(video.videoLength, video.copy);
|
|
117
121
|
const isPlaying = selectedVideoId === video.videoId;
|
|
118
122
|
|
|
119
|
-
const renderThumbnailImage =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
const renderThumbnailImage = themeTokens => {
|
|
124
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(VideoThumbnail, { ...themeTokens,
|
|
125
|
+
isPlaying: isPlaying,
|
|
126
|
+
layout: layout,
|
|
127
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoSplash.default, {
|
|
128
|
+
simpleMode: true,
|
|
129
|
+
poster: video.posterSrc || `https://img.youtube.com/vi/${video.videoId}/maxresdefault.jpg`,
|
|
130
|
+
videoLength: video.videoLength,
|
|
131
|
+
copy: video.copy
|
|
132
|
+
})
|
|
133
|
+
});
|
|
134
|
+
};
|
|
129
135
|
|
|
130
|
-
const renderThumbnailInfo =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
const renderThumbnailInfo = _ref8 => {
|
|
137
|
+
let {
|
|
138
|
+
titleColor,
|
|
139
|
+
subTitleColor
|
|
140
|
+
} = _ref8;
|
|
141
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
|
|
142
|
+
space: 2,
|
|
143
|
+
tokens: {
|
|
144
|
+
flexShrink: 1
|
|
145
|
+
},
|
|
146
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ThumbnailTitleContainer, {
|
|
147
|
+
viewport: viewport,
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
149
|
+
variant: {
|
|
150
|
+
bold: true
|
|
151
|
+
},
|
|
152
|
+
tokens: {
|
|
153
|
+
color: titleColor
|
|
154
|
+
},
|
|
155
|
+
children: video.title
|
|
156
|
+
})
|
|
157
|
+
}), viewport !== _systemConstants.viewports.xs && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
138
158
|
variant: {
|
|
139
|
-
|
|
159
|
+
size: 'micro'
|
|
140
160
|
},
|
|
141
161
|
tokens: {
|
|
142
|
-
color:
|
|
162
|
+
color: subTitleColor
|
|
143
163
|
},
|
|
144
|
-
children:
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
|
|
148
|
-
size: 'micro'
|
|
149
|
-
},
|
|
150
|
-
tokens: {
|
|
151
|
-
color: subTitleColor
|
|
152
|
-
},
|
|
153
|
-
children: timestamp
|
|
154
|
-
})]
|
|
155
|
-
});
|
|
164
|
+
children: timestamp
|
|
165
|
+
})]
|
|
166
|
+
});
|
|
167
|
+
};
|
|
156
168
|
|
|
157
169
|
const handleLayout = itemPositions !== undefined ? getItemPositionLayoutHandler(itemPositions.positions, index) : undefined;
|
|
158
170
|
|
|
@@ -175,14 +187,45 @@ const VideoPickerThumbnail = _ref6 => {
|
|
|
175
187
|
accessibilityState: {
|
|
176
188
|
checked: isPlaying
|
|
177
189
|
},
|
|
178
|
-
style:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
style: _ref9 => {
|
|
191
|
+
let {
|
|
192
|
+
hovered: hover,
|
|
193
|
+
focused: focus,
|
|
194
|
+
pressed
|
|
195
|
+
} = _ref9;
|
|
196
|
+
const themeTokens = getTokens({
|
|
197
|
+
hover,
|
|
198
|
+
focus,
|
|
199
|
+
pressed,
|
|
200
|
+
selected: isPlaying
|
|
201
|
+
});
|
|
202
|
+
const rnStyles = createReactNativeStyles(themeTokens);
|
|
203
|
+
return [rnStyles.container, layout === 'horizontal' && rnStyles.horizontal, isFramed && rnStyles.framed, isFramed && index > 0 && rnStyles.framedLine, {
|
|
204
|
+
width
|
|
205
|
+
}, {
|
|
206
|
+
outline: 'none'
|
|
207
|
+
}];
|
|
208
|
+
},
|
|
209
|
+
children: _ref10 => {
|
|
210
|
+
let {
|
|
211
|
+
hovered: hover,
|
|
212
|
+
focused: focus,
|
|
213
|
+
pressed
|
|
214
|
+
} = _ref10;
|
|
215
|
+
const themeTokens = getTokens({
|
|
216
|
+
hover,
|
|
217
|
+
focus,
|
|
218
|
+
pressed,
|
|
219
|
+
selected: isPlaying
|
|
220
|
+
});
|
|
221
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
|
|
222
|
+
space: layout === 'vertical' ? 2 : 3,
|
|
223
|
+
direction: layout === 'vertical' ? 'column' : 'row',
|
|
224
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ImageContainer, { ...themeTokens,
|
|
225
|
+
children: renderThumbnailImage(themeTokens)
|
|
226
|
+
}), renderThumbnailInfo(themeTokens)]
|
|
227
|
+
});
|
|
228
|
+
}
|
|
186
229
|
}, video.videoId);
|
|
187
230
|
};
|
|
188
231
|
|
|
@@ -48,7 +48,7 @@ const VideoSlider = _ref => {
|
|
|
48
48
|
setContainerWidth(width);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
const itemsGap =
|
|
51
|
+
const itemsGap = 32; // '5' on spacing scale
|
|
52
52
|
|
|
53
53
|
const itemsCount = viewport === 'lg' || viewport === 'xl' ? 4 : 3;
|
|
54
54
|
const itemGapPortioned = (itemsCount - 1) * itemsGap / itemsCount;
|
|
@@ -57,7 +57,7 @@ const VideoSlider = _ref => {
|
|
|
57
57
|
Math.max(containerWidth / itemsCount - itemGapPortioned, 0 // Prevent negative width breaking layout on very narrow containers
|
|
58
58
|
);
|
|
59
59
|
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.StackView, {
|
|
60
|
-
space:
|
|
60
|
+
space: 5,
|
|
61
61
|
direction: "row",
|
|
62
62
|
accessibilityRole: "radiogroup",
|
|
63
63
|
tokens: {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Box, StackView
|
|
3
|
+
import { Box, StackView } from '@telus-uds/components-base';
|
|
4
4
|
import Spinner from '../Spinner';
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
|
|
8
7
|
const Loading = _ref => {
|
|
9
8
|
let {
|
|
@@ -11,23 +10,18 @@ const Loading = _ref => {
|
|
|
11
10
|
} = _ref;
|
|
12
11
|
return /*#__PURE__*/_jsx(Box, {
|
|
13
12
|
space: 3,
|
|
14
|
-
children: /*#__PURE__*/
|
|
13
|
+
children: /*#__PURE__*/_jsx(StackView, {
|
|
15
14
|
direction: "row",
|
|
16
15
|
space: 2,
|
|
17
16
|
tokens: {
|
|
18
17
|
alignItems: 'center'
|
|
19
18
|
},
|
|
20
|
-
children:
|
|
19
|
+
children: /*#__PURE__*/_jsx(Spinner, {
|
|
21
20
|
inline: true,
|
|
22
21
|
show: true,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
size: 'small'
|
|
27
|
-
},
|
|
28
|
-
accessibilityLiveRegion: "polite",
|
|
29
|
-
children: label
|
|
30
|
-
})]
|
|
22
|
+
label: label,
|
|
23
|
+
labelPosition: "right"
|
|
24
|
+
})
|
|
31
25
|
})
|
|
32
26
|
});
|
|
33
27
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
en: {
|
|
3
3
|
hasResults: 'Some results are available',
|
|
4
|
-
loading: '
|
|
4
|
+
loading: 'Searching...',
|
|
5
5
|
noResults: 'No results found'
|
|
6
6
|
},
|
|
7
7
|
fr: {
|
|
8
8
|
hasResults: 'Quelques suggestions sont disponible',
|
|
9
|
-
loading: '
|
|
9
|
+
loading: 'Recherche...',
|
|
10
10
|
noResults: 'Aucun résultat trouvé'
|
|
11
11
|
}
|
|
12
12
|
};
|
|
@@ -61,7 +61,8 @@ const Badge = _ref6 => {
|
|
|
61
61
|
paddingTop,
|
|
62
62
|
paddingBottom,
|
|
63
63
|
fontName,
|
|
64
|
-
fontWeight
|
|
64
|
+
fontWeight,
|
|
65
|
+
fontSize
|
|
65
66
|
} = useThemeTokens('Badge', tokens, variant);
|
|
66
67
|
const semanticGradient = gradient && transformGradient(gradient);
|
|
67
68
|
const {
|
|
@@ -78,6 +79,11 @@ const Badge = _ref6 => {
|
|
|
78
79
|
background = semanticGradient;
|
|
79
80
|
}
|
|
80
81
|
|
|
82
|
+
const fontSizeMapping = {
|
|
83
|
+
12: 'micro',
|
|
84
|
+
14: 'small',
|
|
85
|
+
16: 'h6'
|
|
86
|
+
};
|
|
81
87
|
return /*#__PURE__*/_jsx(BadgeContainer, {
|
|
82
88
|
isOutlineOffer: isOutlineOffer,
|
|
83
89
|
isAlternative: alternative,
|
|
@@ -95,6 +101,9 @@ const Badge = _ref6 => {
|
|
|
95
101
|
fontWeight,
|
|
96
102
|
color
|
|
97
103
|
},
|
|
104
|
+
variant: {
|
|
105
|
+
size: fontSizeMapping[fontSize]
|
|
106
|
+
},
|
|
98
107
|
children: children
|
|
99
108
|
})
|
|
100
109
|
});
|