@telus-uds/components-web 2.8.1 → 2.10.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 +28 -2
- package/component-docs.json +106 -84
- package/lib/BlockQuote/BlockQuote.js +49 -4
- package/lib/Callout/Callout.js +12 -0
- package/lib/Countdown/Countdown.js +34 -25
- package/lib/Countdown/Segment.js +2 -0
- package/lib/Countdown/constants.js +3 -3
- package/lib/DatePicker/CalendarContainer.js +24 -0
- package/lib/DatePicker/DatePicker.js +8 -2
- package/lib/Disclaimer/Disclaimer.js +0 -4
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
- package/lib/Footnote/Footnote.js +28 -11
- package/lib/IconButton/IconButton.js +8 -0
- package/lib/Listbox/Listbox.js +8 -0
- package/lib/Modal/ModalContent.js +0 -1
- package/lib/NavigationBar/NavigationBar.js +4 -0
- package/lib/OrderedList/Item.js +4 -0
- package/lib/Paragraph/Paragraph.js +4 -0
- package/lib/PreviewCard/AuthorDate.js +7 -0
- package/lib/PreviewCard/PreviewCard.js +3 -6
- package/lib/PriceLockup/PriceLockup.js +48 -0
- package/lib/QuantitySelector/QuantitySelector.js +51 -0
- package/lib/Span/Span.js +4 -0
- package/lib/Table/Table.js +4 -0
- package/lib/Toast/Toast.js +32 -2
- package/lib-module/BlockQuote/BlockQuote.js +50 -5
- package/lib-module/Callout/Callout.js +12 -0
- package/lib-module/Countdown/Countdown.js +34 -25
- package/lib-module/Countdown/Segment.js +3 -1
- package/lib-module/Countdown/constants.js +2 -2
- package/lib-module/DatePicker/CalendarContainer.js +24 -0
- package/lib-module/DatePicker/DatePicker.js +8 -2
- package/lib-module/Disclaimer/Disclaimer.js +0 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
- package/lib-module/Footnote/Footnote.js +28 -11
- package/lib-module/IconButton/IconButton.js +8 -0
- package/lib-module/Listbox/Listbox.js +8 -0
- package/lib-module/Modal/ModalContent.js +0 -1
- package/lib-module/NavigationBar/NavigationBar.js +4 -0
- package/lib-module/OrderedList/Item.js +4 -0
- package/lib-module/Paragraph/Paragraph.js +4 -0
- package/lib-module/PreviewCard/AuthorDate.js +7 -0
- package/lib-module/PreviewCard/PreviewCard.js +3 -6
- package/lib-module/PriceLockup/PriceLockup.js +48 -0
- package/lib-module/QuantitySelector/QuantitySelector.js +51 -0
- package/lib-module/Span/Span.js +4 -0
- package/lib-module/Table/Table.js +4 -0
- package/lib-module/Toast/Toast.js +33 -3
- package/package.json +3 -3
- package/src/BlockQuote/BlockQuote.jsx +53 -6
- package/src/Callout/Callout.jsx +9 -0
- package/src/Countdown/Countdown.jsx +34 -23
- package/src/Countdown/Segment.jsx +2 -1
- package/src/Countdown/constants.js +1 -1
- package/src/DatePicker/CalendarContainer.jsx +24 -0
- package/src/DatePicker/DatePicker.jsx +8 -2
- package/src/Disclaimer/Disclaimer.jsx +0 -3
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +3 -0
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +12 -0
- package/src/Footnote/Footnote.jsx +44 -17
- package/src/IconButton/IconButton.jsx +6 -0
- package/src/Listbox/Listbox.jsx +6 -0
- package/src/Modal/ModalContent.jsx +0 -1
- package/src/NavigationBar/NavigationBar.jsx +3 -0
- package/src/OrderedList/Item.jsx +3 -0
- package/src/Paragraph/Paragraph.jsx +3 -0
- package/src/PreviewCard/AuthorDate.jsx +6 -0
- package/src/PreviewCard/PreviewCard.jsx +3 -7
- package/src/PriceLockup/PriceLockup.jsx +37 -0
- package/src/QuantitySelector/QuantitySelector.jsx +39 -0
- package/src/Span/Span.jsx +3 -0
- package/src/Table/Table.jsx +3 -0
- package/src/Toast/Toast.jsx +27 -4
|
@@ -187,6 +187,10 @@ NavigationBar.propTypes = { ...selectedSystemPropTypes,
|
|
|
187
187
|
* Common navigation bar heading.
|
|
188
188
|
*/
|
|
189
189
|
heading: PropTypes.string,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Sets the `headingLevel` of the `heading`
|
|
193
|
+
*/
|
|
190
194
|
headingLevel: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
|
|
191
195
|
|
|
192
196
|
/**
|
|
@@ -47,7 +47,14 @@ const AuthorDate = _ref => {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
AuthorDate.propTypes = {
|
|
50
|
+
/**
|
|
51
|
+
* Name of the author
|
|
52
|
+
*/
|
|
50
53
|
author: PropTypes.string.isRequired,
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Date of the post
|
|
57
|
+
*/
|
|
51
58
|
date: PropTypes.string.isRequired
|
|
52
59
|
};
|
|
53
60
|
export default AuthorDate;
|
|
@@ -127,8 +127,7 @@ const PreviewCard = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
127
127
|
children: [Boolean(tag) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
128
128
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
129
129
|
variant: {
|
|
130
|
-
size: 'eyebrow'
|
|
131
|
-
colour: 'secondary'
|
|
130
|
+
size: 'eyebrow'
|
|
132
131
|
},
|
|
133
132
|
children: tag
|
|
134
133
|
}), /*#__PURE__*/_jsx(Spacer, {
|
|
@@ -136,8 +135,7 @@ const PreviewCard = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
136
135
|
})]
|
|
137
136
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
138
137
|
variant: {
|
|
139
|
-
size: 'h4'
|
|
140
|
-
colour: 'secondary'
|
|
138
|
+
size: 'h4'
|
|
141
139
|
},
|
|
142
140
|
children: title
|
|
143
141
|
}), Boolean(footer) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -145,8 +143,7 @@ const PreviewCard = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
145
143
|
space: 2
|
|
146
144
|
}), typeof footer === 'string' ? /*#__PURE__*/_jsx(Typography, {
|
|
147
145
|
variant: {
|
|
148
|
-
size: 'small'
|
|
149
|
-
colour: 'secondary'
|
|
146
|
+
size: 'small'
|
|
150
147
|
},
|
|
151
148
|
children: footer
|
|
152
149
|
}) : footer]
|
|
@@ -235,16 +235,64 @@ const PriceLockup = _ref12 => {
|
|
|
235
235
|
};
|
|
236
236
|
|
|
237
237
|
PriceLockup.propTypes = { ...selectedSystemPropTypes,
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Size of the component
|
|
241
|
+
*
|
|
242
|
+
* Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
243
|
+
*/
|
|
238
244
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* If currency symbol other than `$` to be used
|
|
248
|
+
*/
|
|
239
249
|
currencySymbol: PropTypes.string,
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Shows additional info above the price
|
|
253
|
+
*/
|
|
240
254
|
topText: PropTypes.string,
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Monetary value (including decimals separated by ".")
|
|
258
|
+
*/
|
|
241
259
|
price: PropTypes.string.isRequired,
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Shows month/year unit
|
|
263
|
+
*/
|
|
242
264
|
rateText: PropTypes.string,
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Shows additional info below the price with a `Divider`
|
|
268
|
+
*/
|
|
243
269
|
bottomText: PropTypes.string,
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Displays which side the currency should apperar (left, right)
|
|
273
|
+
*/
|
|
244
274
|
signDirection: PropTypes.oneOf(['right', 'left']),
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Shows additional link for context
|
|
278
|
+
*/
|
|
245
279
|
footnoteLinks: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Function to be called when a footnote link is clicked
|
|
283
|
+
*/
|
|
246
284
|
onClickFootnote: PropTypes.func,
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* To show price savings comparison
|
|
288
|
+
*/
|
|
247
289
|
strikeThrough: PropTypes.bool,
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* To provide a11y text for `PriceLockup` component
|
|
293
|
+
*
|
|
294
|
+
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
295
|
+
*/
|
|
248
296
|
a11yText: PropTypes.string
|
|
249
297
|
};
|
|
250
298
|
export default PriceLockup;
|
|
@@ -199,25 +199,76 @@ const dictionaryContentShape = PropTypes.shape({
|
|
|
199
199
|
}).isRequired
|
|
200
200
|
});
|
|
201
201
|
QuantitySelector.propTypes = {
|
|
202
|
+
/**
|
|
203
|
+
* The id of the input field
|
|
204
|
+
*/
|
|
202
205
|
id: PropTypes.string,
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* The minimum number allowed
|
|
209
|
+
*/
|
|
203
210
|
minNumber: PropTypes.number,
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* The maximum number allowed
|
|
214
|
+
*/
|
|
204
215
|
maxNumber: PropTypes.number,
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The callback function that is called when the value of the input field changes
|
|
219
|
+
*/
|
|
205
220
|
onChange: PropTypes.func,
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* The default value of the input field
|
|
224
|
+
*/
|
|
206
225
|
defaultValue: PropTypes.number,
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* The label of the input field
|
|
229
|
+
*/
|
|
207
230
|
label: PropTypes.string,
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* The hint of the input field
|
|
234
|
+
*/
|
|
208
235
|
hint: PropTypes.string,
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* The position of the hint. Could be shown along side the label or below it
|
|
239
|
+
*/
|
|
209
240
|
hintPosition: PropTypes.oneOf(['inline', 'below']),
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Adds a question mark which will display a tooltip when clicked
|
|
244
|
+
*/
|
|
210
245
|
tooltip: PropTypes.string,
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* The accessibility label of the input field
|
|
249
|
+
*/
|
|
211
250
|
accessibilityLabel: PropTypes.string,
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* The dictionary object containing the content for the input field
|
|
254
|
+
*/
|
|
212
255
|
dictionary: PropTypes.shape({
|
|
213
256
|
en: dictionaryContentShape,
|
|
214
257
|
fr: dictionaryContentShape
|
|
215
258
|
}),
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* The language to use for the copy.
|
|
262
|
+
*/
|
|
216
263
|
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr'])]),
|
|
217
264
|
variant: PropTypes.exact({
|
|
218
265
|
alternative: PropTypes.bool
|
|
219
266
|
}),
|
|
220
267
|
tokens: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Sets `data-testid` attribute on the input field for testing purposes.
|
|
271
|
+
*/
|
|
221
272
|
testID: PropTypes.string
|
|
222
273
|
};
|
|
223
274
|
QuantitySelector.defaultProps = {
|
package/lib-module/Span/Span.js
CHANGED
|
@@ -2,7 +2,7 @@ var _withLinkRouter$propT, _withLinkRouter$propT2;
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import { ChevronLink, selectSystemProps, useThemeTokens, Typography, withLinkRouter } from '@telus-uds/components-base';
|
|
5
|
+
import { ChevronLink, selectSystemProps, useThemeTokens, Typography, withLinkRouter, Spacer, useViewport } from '@telus-uds/components-base';
|
|
6
6
|
import styled, { keyframes, css } from 'styled-components';
|
|
7
7
|
import { htmlAttrs } from '../utils';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -43,6 +43,8 @@ const Toast = _ref3 => {
|
|
|
43
43
|
variant = {},
|
|
44
44
|
...rest
|
|
45
45
|
} = _ref3;
|
|
46
|
+
// viewport hook added to work adjust the padding to different sizes
|
|
47
|
+
const viewport = useViewport();
|
|
46
48
|
const {
|
|
47
49
|
containerBackgroundColor,
|
|
48
50
|
containerGap,
|
|
@@ -55,8 +57,11 @@ const Toast = _ref3 => {
|
|
|
55
57
|
animationBackgroundColorBefore,
|
|
56
58
|
animationBackgroundColorAfter,
|
|
57
59
|
animationColorBefore,
|
|
58
|
-
animationColorAfter
|
|
59
|
-
|
|
60
|
+
animationColorAfter,
|
|
61
|
+
chevronlinkFontWeight
|
|
62
|
+
} = useThemeTokens('Toast', tokens, variant, {
|
|
63
|
+
viewport
|
|
64
|
+
}); // inherit ChevronLink tokens for animation colors
|
|
60
65
|
|
|
61
66
|
const {
|
|
62
67
|
color: chevronDefaultColor
|
|
@@ -93,15 +98,24 @@ const Toast = _ref3 => {
|
|
|
93
98
|
inverse: true
|
|
94
99
|
},
|
|
95
100
|
children: headline
|
|
101
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
102
|
+
space: 2,
|
|
103
|
+
direction: "row"
|
|
96
104
|
}), /*#__PURE__*/_jsx(Typography, {
|
|
97
105
|
variant: {
|
|
98
106
|
inverse: true
|
|
99
107
|
},
|
|
100
108
|
children: copy
|
|
109
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
110
|
+
space: 2,
|
|
111
|
+
direction: "row"
|
|
101
112
|
}), link && /*#__PURE__*/_jsx(ChevronLink, {
|
|
102
113
|
variant: {
|
|
103
114
|
inverse: true
|
|
104
115
|
},
|
|
116
|
+
tokens: {
|
|
117
|
+
blockFontWeight: chevronlinkFontWeight
|
|
118
|
+
},
|
|
105
119
|
href: link.href,
|
|
106
120
|
LinkRouter: link.LinkRouter,
|
|
107
121
|
linkRouterProps: link.linkRouterProps,
|
|
@@ -111,9 +125,25 @@ const Toast = _ref3 => {
|
|
|
111
125
|
};
|
|
112
126
|
|
|
113
127
|
Toast.propTypes = { ...selectedSystemPropTypes,
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* If true, the toast will be displayed
|
|
131
|
+
*/
|
|
114
132
|
toast: PropTypes.bool,
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The copy to display in the toast
|
|
136
|
+
*/
|
|
115
137
|
copy: PropTypes.string.isRequired,
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The headline to display in the toast (before copy)
|
|
141
|
+
*/
|
|
116
142
|
headline: PropTypes.string,
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The link to display in the toast (after copy)
|
|
146
|
+
*/
|
|
117
147
|
link: PropTypes.shape({
|
|
118
148
|
href: PropTypes.string.isRequired,
|
|
119
149
|
text: PropTypes.string.isRequired,
|
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.
|
|
8
|
+
"@telus-uds/components-base": "1.51.1",
|
|
9
9
|
"@telus-uds/system-constants": "^1.2.1",
|
|
10
10
|
"fscreen": "^1.2.0",
|
|
11
11
|
"lodash.omit": "^4.5.0",
|
|
12
12
|
"react-dates": "^21.8.0",
|
|
13
13
|
"react-helmet-async": "^1.3.0",
|
|
14
14
|
"react-moment-proptypes": "^1.8.1",
|
|
15
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
15
|
+
"@telus-uds/system-theme-tokens": "^2.34.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.
|
|
66
|
+
"version": "2.10.0"
|
|
67
67
|
}
|
|
@@ -6,7 +6,8 @@ import {
|
|
|
6
6
|
StackView,
|
|
7
7
|
Typography,
|
|
8
8
|
useThemeTokens,
|
|
9
|
-
withLinkRouter
|
|
9
|
+
withLinkRouter,
|
|
10
|
+
useViewport
|
|
10
11
|
} from '@telus-uds/components-base'
|
|
11
12
|
import styled from 'styled-components'
|
|
12
13
|
import { htmlAttrs, transformGradient } from '../utils'
|
|
@@ -48,6 +49,7 @@ const BlockQuote = ({
|
|
|
48
49
|
variant,
|
|
49
50
|
...rest
|
|
50
51
|
}) => {
|
|
52
|
+
const viewport = useViewport()
|
|
51
53
|
const {
|
|
52
54
|
color,
|
|
53
55
|
paddingTop,
|
|
@@ -56,16 +58,49 @@ const BlockQuote = ({
|
|
|
56
58
|
paddingRight,
|
|
57
59
|
marginBottom,
|
|
58
60
|
width,
|
|
59
|
-
backgroundGradient
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
backgroundGradient,
|
|
62
|
+
titleHeadingFontSize,
|
|
63
|
+
titleHeadingFontName,
|
|
64
|
+
titleHeadingFontWeight,
|
|
65
|
+
titleHeadingLineHeight,
|
|
66
|
+
titleFontSize,
|
|
67
|
+
titleFontName,
|
|
68
|
+
titleFontWeight,
|
|
69
|
+
titleLineHeight,
|
|
70
|
+
linkFontSize,
|
|
71
|
+
linkFontName,
|
|
72
|
+
linkFontWeight,
|
|
73
|
+
linkLineHeight
|
|
74
|
+
} = useThemeTokens('BlockQuote', tokens, variant, {
|
|
75
|
+
viewport
|
|
76
|
+
})
|
|
62
77
|
const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle
|
|
78
|
+
const titleTokens =
|
|
79
|
+
textStyle === 'heading'
|
|
80
|
+
? {
|
|
81
|
+
fontSize: titleHeadingFontSize,
|
|
82
|
+
fontName: titleHeadingFontName,
|
|
83
|
+
fontWeight: titleHeadingFontWeight,
|
|
84
|
+
lineHeight: titleHeadingLineHeight
|
|
85
|
+
}
|
|
86
|
+
: {
|
|
87
|
+
fontSize: titleFontSize,
|
|
88
|
+
fontName: titleFontName,
|
|
89
|
+
fontWeight: titleFontWeight,
|
|
90
|
+
lineHeight: titleLineHeight
|
|
91
|
+
}
|
|
63
92
|
const renderLink = () => {
|
|
64
93
|
if (linkHref) {
|
|
65
94
|
return (
|
|
66
95
|
<Link
|
|
67
96
|
href={linkHref}
|
|
68
|
-
tokens={{
|
|
97
|
+
tokens={{
|
|
98
|
+
blockFontSize: linkFontSize,
|
|
99
|
+
blockFontName: linkFontName,
|
|
100
|
+
blockFontWeight: linkFontWeight,
|
|
101
|
+
blockLineHeight: linkLineHeight,
|
|
102
|
+
color
|
|
103
|
+
}}
|
|
69
104
|
variant={{ alternative: true }}
|
|
70
105
|
LinkRouter={LinkRouter}
|
|
71
106
|
linkRouterProps={linkRouterProps}
|
|
@@ -80,7 +115,7 @@ const BlockQuote = ({
|
|
|
80
115
|
|
|
81
116
|
const renderQuote = () => {
|
|
82
117
|
const quote = (
|
|
83
|
-
<Typography tokens={{ color,
|
|
118
|
+
<Typography tokens={{ color, ...titleTokens }} variant={{ size: mappedTextSize }}>
|
|
84
119
|
{children}
|
|
85
120
|
</Typography>
|
|
86
121
|
)
|
|
@@ -121,9 +156,21 @@ BlockQuote.propTypes = {
|
|
|
121
156
|
...selectedSystemPropTypes,
|
|
122
157
|
...withLinkRouter.propTypes,
|
|
123
158
|
children: PropTypes.node.isRequired,
|
|
159
|
+
/**
|
|
160
|
+
* External source's identifier (e.g. author's name)
|
|
161
|
+
*/
|
|
124
162
|
link: PropTypes.string,
|
|
163
|
+
/**
|
|
164
|
+
* External source's URL
|
|
165
|
+
*/
|
|
125
166
|
linkHref: PropTypes.string,
|
|
167
|
+
/**
|
|
168
|
+
* To provide additional information about the source, rendered underneath `link`
|
|
169
|
+
*/
|
|
126
170
|
additionalInfo: PropTypes.string,
|
|
171
|
+
/**
|
|
172
|
+
* Whether to render BlockQuote as a heading size of `h3` or large text size
|
|
173
|
+
*/
|
|
127
174
|
textStyle: PropTypes.oneOf(['large', 'heading'])
|
|
128
175
|
}
|
|
129
176
|
|
package/src/Callout/Callout.jsx
CHANGED
|
@@ -91,9 +91,18 @@ const Callout = ({
|
|
|
91
91
|
|
|
92
92
|
Callout.propTypes = {
|
|
93
93
|
...selectedSystemPropTypes,
|
|
94
|
+
/**
|
|
95
|
+
* Icon to display on the left side of the Callout
|
|
96
|
+
*/
|
|
94
97
|
icon: PropTypes.elementType,
|
|
95
98
|
children: PropTypes.node.isRequired,
|
|
99
|
+
/**
|
|
100
|
+
* To change the horizontal alignment of the Callout's text
|
|
101
|
+
*/
|
|
96
102
|
textAlignToFlex: PropTypes.oneOf(['center', 'left']),
|
|
103
|
+
/**
|
|
104
|
+
* To change the vertical alignment of the Callout's icon
|
|
105
|
+
*/
|
|
97
106
|
verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
|
|
98
107
|
}
|
|
99
108
|
|
|
@@ -22,9 +22,12 @@ import { countdownVariantPropType, dictionaryContentShape } from './types'
|
|
|
22
22
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
23
23
|
|
|
24
24
|
const Container = styled.div(({ variant: { feature, inverse, large }, themeTokens, gradient }) => ({
|
|
25
|
-
...(large ||
|
|
25
|
+
...(large || feature ? { display: 'flex', flex: 0 } : {}),
|
|
26
26
|
...(feature && {
|
|
27
27
|
borderRadius: themeTokens.containerBorderRadius,
|
|
28
|
+
borderColor: themeTokens.containerBorderColor,
|
|
29
|
+
borderStyle: 'solid',
|
|
30
|
+
borderWidth: `${themeTokens.containerBorderWidth}px`,
|
|
28
31
|
justifyContent: 'center',
|
|
29
32
|
paddingBottom: `${themeTokens.containerPaddingBottomTop}px`,
|
|
30
33
|
paddingLeft: `${themeTokens.containerPaddingLeftRight}px`,
|
|
@@ -33,28 +36,31 @@ const Container = styled.div(({ variant: { feature, inverse, large }, themeToken
|
|
|
33
36
|
width: 'fit-content'
|
|
34
37
|
}),
|
|
35
38
|
...(feature &&
|
|
36
|
-
!inverse &&
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}),
|
|
40
|
-
...(feature &&
|
|
41
|
-
inverse && {
|
|
42
|
-
border: `${themeTokens.containerInverseBorder}px solid ${themeTokens.inverseBorderColor}`
|
|
39
|
+
!inverse &&
|
|
40
|
+
gradient && {
|
|
41
|
+
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`
|
|
43
42
|
})
|
|
44
43
|
}))
|
|
45
44
|
|
|
46
45
|
const getLabelTokens = (themeTokens) => ({
|
|
47
46
|
color: themeTokens.labelBorderColor,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
lineHeight:
|
|
47
|
+
fontSize: themeTokens.labelFontSize,
|
|
48
|
+
fontWeight: themeTokens.labelFontWeight,
|
|
49
|
+
lineHeight: themeTokens.labelLineHeight
|
|
51
50
|
})
|
|
52
51
|
|
|
53
|
-
const getMainTextTokens = (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
const getMainTextTokens = ({
|
|
53
|
+
labelBorderColor,
|
|
54
|
+
textTimerFontWeight,
|
|
55
|
+
textFontSize,
|
|
56
|
+
textLineHeight,
|
|
57
|
+
textTimerFontName
|
|
58
|
+
}) => ({
|
|
59
|
+
color: labelBorderColor,
|
|
60
|
+
lineHeight: textLineHeight,
|
|
61
|
+
fontWeight: textTimerFontWeight,
|
|
62
|
+
fontSize: textFontSize,
|
|
63
|
+
fontName: textTimerFontName
|
|
58
64
|
})
|
|
59
65
|
|
|
60
66
|
const Countdown = forwardRef(({ copy = 'en', targetTime, tokens, variant = {}, ...rest }, ref) => {
|
|
@@ -68,18 +74,18 @@ const Countdown = forwardRef(({ copy = 'en', targetTime, tokens, variant = {}, .
|
|
|
68
74
|
const segmentFontSize = themeTokens.textFontSize
|
|
69
75
|
const semanticGradient =
|
|
70
76
|
themeTokens.containerGradient && transformGradient(themeTokens.containerGradient)
|
|
71
|
-
|
|
72
77
|
const mainTextTokens = getMainTextTokens(themeTokens)
|
|
73
78
|
|
|
74
79
|
const divider =
|
|
75
80
|
noDivider === true ? (
|
|
76
81
|
// StackView-based subcontainer adds a 1-step space on the each side of the divider
|
|
77
|
-
<Spacer direction="row" space={(feature || large) && viewport !== viewports.xs ?
|
|
82
|
+
<Spacer direction="row" space={(feature || large) && viewport !== viewports.xs ? 4 : 1} />
|
|
78
83
|
) : (
|
|
79
84
|
<Typography tokens={mainTextTokens}>:</Typography>
|
|
80
85
|
)
|
|
81
86
|
const labelTokens = getLabelTokens(themeTokens)
|
|
82
|
-
|
|
87
|
+
|
|
88
|
+
const segmentProps = {
|
|
83
89
|
copy,
|
|
84
90
|
labelTokens,
|
|
85
91
|
numberTokens: mainTextTokens,
|
|
@@ -98,26 +104,31 @@ const Countdown = forwardRef(({ copy = 'en', targetTime, tokens, variant = {}, .
|
|
|
98
104
|
gradient={semanticGradient}
|
|
99
105
|
>
|
|
100
106
|
<StackView direction="row" space={1}>
|
|
101
|
-
<Segment
|
|
107
|
+
<Segment
|
|
108
|
+
labelKey="day"
|
|
109
|
+
number={days}
|
|
110
|
+
segmentWidth={String(days).length}
|
|
111
|
+
{...segmentProps}
|
|
112
|
+
/>
|
|
102
113
|
{divider}
|
|
103
114
|
<Segment
|
|
104
115
|
labelKey="hour"
|
|
105
116
|
number={hours}
|
|
106
|
-
{...
|
|
117
|
+
{...segmentProps}
|
|
107
118
|
{...applyTextStyles(themeTokens)}
|
|
108
119
|
/>
|
|
109
120
|
{divider}
|
|
110
121
|
<Segment
|
|
111
122
|
labelKey="minute"
|
|
112
123
|
number={minutes}
|
|
113
|
-
{...
|
|
124
|
+
{...segmentProps}
|
|
114
125
|
{...applyTextStyles(themeTokens)}
|
|
115
126
|
/>
|
|
116
127
|
{divider}
|
|
117
128
|
<Segment
|
|
118
129
|
labelKey="second"
|
|
119
130
|
number={seconds}
|
|
120
|
-
{...
|
|
131
|
+
{...segmentProps}
|
|
121
132
|
{...applyTextStyles(themeTokens)}
|
|
122
133
|
/>
|
|
123
134
|
</StackView>
|
|
@@ -4,6 +4,7 @@ import { StackView, Typography, useCopy } from '@telus-uds/components-base'
|
|
|
4
4
|
import styled from 'styled-components'
|
|
5
5
|
import dictionary from './dictionary'
|
|
6
6
|
import { countdownVariantPropType, dictionaryContentShape } from './types'
|
|
7
|
+
// !TODO: put this back
|
|
7
8
|
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants'
|
|
8
9
|
|
|
9
10
|
// Pads with zeros on the left if it's a single digit number
|
|
@@ -13,11 +14,11 @@ const Container = styled.div(({ segmentFontSize, segmentWidth = 2, variant: { fe
|
|
|
13
14
|
justifyContent: 'space-evenly',
|
|
14
15
|
display: 'inline-flex',
|
|
15
16
|
...(feature && {
|
|
17
|
+
// This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
|
|
16
18
|
width: `${segmentFontSize * SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
|
|
17
19
|
display: 'flex'
|
|
18
20
|
})
|
|
19
21
|
}))
|
|
20
|
-
|
|
21
22
|
// A segment of the countdown string: we need to make sure it
|
|
22
23
|
// keeps its width constant to prevent the whole component from
|
|
23
24
|
// being automatically resized while using variable size fonts
|
|
@@ -164,6 +164,30 @@ const CalendarContainer = styled.div(
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
+
.CalendarDay
|
|
168
|
+
.CalendarDay__default
|
|
169
|
+
.CalendarDay__selected
|
|
170
|
+
.CalendarDay__blocked_out_of_range{
|
|
171
|
+
background: ${remainingTokens.calendarDaySelectedDisabledBackground};
|
|
172
|
+
color: ${remainingTokens.calendarDaySelectedDisabledColor};
|
|
173
|
+
text-decoration: none;
|
|
174
|
+
z-index: 0;
|
|
175
|
+
&:before {
|
|
176
|
+
content: '';
|
|
177
|
+
position: absolute;
|
|
178
|
+
top: 50%;
|
|
179
|
+
left: 50%;
|
|
180
|
+
transform: translate(-50%, -50%);
|
|
181
|
+
height: ${calendarDayDefaultHeight}px;
|
|
182
|
+
border: 1px solid ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
183
|
+
width: ${calendarDayDefaultWidth}px;
|
|
184
|
+
border-radius: 50%;
|
|
185
|
+
background: ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
|
|
186
|
+
transition: all 0.3s;
|
|
187
|
+
z-index: -1;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
167
191
|
.CalendarDay__blocked_out_of_range,
|
|
168
192
|
.CalendarDay__blocked_out_of_range:active,
|
|
169
193
|
.CalendarDay__blocked_out_of_range:hover,
|
|
@@ -109,13 +109,19 @@ const DatePicker = forwardRef(
|
|
|
109
109
|
}
|
|
110
110
|
setIsClickedInside(false)
|
|
111
111
|
}
|
|
112
|
-
const handleFocus = () => {
|
|
113
|
-
|
|
112
|
+
const handleFocus = (event) => {
|
|
113
|
+
if (event.target.tagName === 'INPUT') {
|
|
114
|
+
setIsFocused(true)
|
|
115
|
+
}
|
|
114
116
|
}
|
|
115
117
|
const handleMouseDown = (event) => {
|
|
116
118
|
if (event.target.tagName === 'INPUT') {
|
|
117
119
|
setIsClickedInside(true)
|
|
118
120
|
setIsFocused(true)
|
|
121
|
+
} else if (event.target.tagName === 'path') {
|
|
122
|
+
// needed to handle the case where the user clicks on the tooltip icon
|
|
123
|
+
setIsClickedInside(true)
|
|
124
|
+
event.stopPropagation()
|
|
119
125
|
} else {
|
|
120
126
|
event.stopPropagation()
|
|
121
127
|
}
|