@telus-uds/components-web 2.8.1 → 2.9.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 +17 -2
- package/component-docs.json +24 -3
- package/lib/Countdown/Countdown.js +34 -25
- package/lib/Countdown/Segment.js +2 -0
- package/lib/Countdown/constants.js +3 -3
- package/lib/Footnote/Footnote.js +28 -11
- package/lib/Modal/ModalContent.js +0 -1
- package/lib/PreviewCard/PreviewCard.js +3 -6
- package/lib/Toast/Toast.js +16 -2
- 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/Footnote/Footnote.js +28 -11
- package/lib-module/Modal/ModalContent.js +0 -1
- package/lib-module/PreviewCard/PreviewCard.js +3 -6
- package/lib-module/Toast/Toast.js +17 -3
- package/package.json +3 -3
- package/src/Countdown/Countdown.jsx +34 -23
- package/src/Countdown/Segment.jsx +2 -1
- package/src/Countdown/constants.js +1 -1
- package/src/Footnote/Footnote.jsx +44 -17
- package/src/Modal/ModalContent.jsx +0 -1
- package/src/PreviewCard/PreviewCard.jsx +3 -7
- package/src/Toast/Toast.jsx +15 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Fri, 16 Jun 2023 21:05:00 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 2.9.0
|
|
8
|
+
|
|
9
|
+
Fri, 16 Jun 2023 21:05:00 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- refactored Countdown to take a borderColor for feature variant (kyle.king2@telus.com)
|
|
14
|
+
- Toast component modified due to multibrand standardization, new tokens and validations added (35577399+JoshHC@users.noreply.github.com)
|
|
15
|
+
- Bump @telus-uds/components-base to v1.51.0
|
|
16
|
+
- Bump @telus-uds/system-theme-tokens to v2.33.0
|
|
17
|
+
|
|
18
|
+
### Patches
|
|
19
|
+
|
|
20
|
+
- remove secondary color from typography in preview card (mauricio.batresmontejo@telus.com)
|
|
21
|
+
|
|
7
22
|
## 2.8.1
|
|
8
23
|
|
|
9
|
-
Wed, 14 Jun 2023 19:
|
|
24
|
+
Wed, 14 Jun 2023 19:33:52 GMT
|
|
10
25
|
|
|
11
26
|
### Patches
|
|
12
27
|
|
package/component-docs.json
CHANGED
|
@@ -8429,6 +8429,17 @@
|
|
|
8429
8429
|
"required": false,
|
|
8430
8430
|
"description": "The options a user may select."
|
|
8431
8431
|
},
|
|
8432
|
+
"maxHeight": {
|
|
8433
|
+
"defaultValue": {
|
|
8434
|
+
"value": "false",
|
|
8435
|
+
"computed": false
|
|
8436
|
+
},
|
|
8437
|
+
"type": {
|
|
8438
|
+
"name": "bool"
|
|
8439
|
+
},
|
|
8440
|
+
"required": false,
|
|
8441
|
+
"description": "If provided sets maxHeight to be active"
|
|
8442
|
+
},
|
|
8432
8443
|
"copy": {
|
|
8433
8444
|
"defaultValue": {
|
|
8434
8445
|
"value": "'en'",
|
|
@@ -9374,8 +9385,12 @@
|
|
|
9374
9385
|
"contentDirection": "direction",
|
|
9375
9386
|
"contentSpace": "integer",
|
|
9376
9387
|
"contentAlignItems": "flexAlign",
|
|
9388
|
+
"gap": "size",
|
|
9377
9389
|
"textAlign": "textAlign",
|
|
9378
|
-
"outerBorderColor": "color"
|
|
9390
|
+
"outerBorderColor": "color",
|
|
9391
|
+
"fontWeight": "fontWeight",
|
|
9392
|
+
"fontName": "fontName",
|
|
9393
|
+
"fontSize": "fontSize"
|
|
9379
9394
|
}
|
|
9380
9395
|
},
|
|
9381
9396
|
"required": false,
|
|
@@ -11677,7 +11692,7 @@
|
|
|
11677
11692
|
},
|
|
11678
11693
|
"dictionary": {
|
|
11679
11694
|
"defaultValue": {
|
|
11680
|
-
"value": "{\n en: {\n stepLabel: 'Step %{stepNumber}',\n stepTrackerLabel: 'Step %{stepNumber} of %{stepCount}: %{stepLabel}'\n },\n fr: {\n stepLabel: 'Étape %{stepNumber}',\n stepTrackerLabel: 'Étape %{stepNumber} sur %{stepCount}: %{stepLabel}'\n }\n}",
|
|
11695
|
+
"value": "{\n en: {\n 1: {\n stepLabel: 'Step %{stepNumber}',\n stepTrackerLabel: 'Step %{stepNumber} of %{stepCount}: %{stepLabel}'\n },\n 2: {\n stepLabel: '%{stepNumber}.',\n stepTrackerLabel: 'Step %{stepNumber} of %{stepCount}: %{stepLabel}'\n },\n 3: {\n stepLabel: 'Step %{stepNumber}',\n stepTrackerLabel: 'Step %{stepNumber} of %{stepCount}: %{stepLabel}'\n }\n },\n fr: {\n 1: {\n stepLabel: 'Étape %{stepNumber}',\n stepTrackerLabel: 'Étape %{stepNumber} sur %{stepCount}: %{stepLabel}'\n },\n 2: {\n stepLabel: '%{stepNumber}.',\n stepTrackerLabel: 'Étape %{stepNumber} sur %{stepCount}: %{stepLabel}'\n },\n 3: {\n stepLabel: 'Étape %{stepNumber}',\n stepTrackerLabel: 'Étape %{stepNumber} sur %{stepCount}: %{stepLabel}'\n }\n }\n}",
|
|
11681
11696
|
"computed": false
|
|
11682
11697
|
},
|
|
11683
11698
|
"type": {
|
|
@@ -11758,7 +11773,13 @@
|
|
|
11758
11773
|
"labelPaddingRight": "size",
|
|
11759
11774
|
"showStepLabel": "show",
|
|
11760
11775
|
"showStepName": "show",
|
|
11761
|
-
"showStepTrackerLabel": "show"
|
|
11776
|
+
"showStepTrackerLabel": "show",
|
|
11777
|
+
"textStepTrackerLabel": "integer",
|
|
11778
|
+
"stepLabelColor": "color",
|
|
11779
|
+
"stepLabelFontSize": "fontSize",
|
|
11780
|
+
"stepLabelFontWeight": "fontWeight",
|
|
11781
|
+
"stepLabelFontName": "fontName",
|
|
11782
|
+
"stepLabelLineHeight": "lineHeight"
|
|
11762
11783
|
}
|
|
11763
11784
|
},
|
|
11764
11785
|
"required": false,
|
|
@@ -49,12 +49,15 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
49
49
|
themeTokens,
|
|
50
50
|
gradient
|
|
51
51
|
} = _ref;
|
|
52
|
-
return { ...(large || feature
|
|
52
|
+
return { ...(large || feature ? {
|
|
53
53
|
display: 'flex',
|
|
54
54
|
flex: 0
|
|
55
|
-
}),
|
|
55
|
+
} : {}),
|
|
56
56
|
...(feature && {
|
|
57
57
|
borderRadius: themeTokens.containerBorderRadius,
|
|
58
|
+
borderColor: themeTokens.containerBorderColor,
|
|
59
|
+
borderStyle: 'solid',
|
|
60
|
+
borderWidth: `${themeTokens.containerBorderWidth}px`,
|
|
58
61
|
justifyContent: 'center',
|
|
59
62
|
paddingBottom: `${themeTokens.containerPaddingBottomTop}px`,
|
|
60
63
|
paddingLeft: `${themeTokens.containerPaddingLeftRight}px`,
|
|
@@ -62,38 +65,44 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
62
65
|
paddingTop: `${themeTokens.containerPaddingBottomTop}px`,
|
|
63
66
|
width: 'fit-content'
|
|
64
67
|
}),
|
|
65
|
-
...(feature && !inverse && {
|
|
66
|
-
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box
|
|
67
|
-
border: `${themeTokens.containerInverseBorder}px solid transparent`
|
|
68
|
-
}),
|
|
69
|
-
...(feature && inverse && {
|
|
70
|
-
border: `${themeTokens.containerInverseBorder}px solid ${themeTokens.inverseBorderColor}`
|
|
68
|
+
...(feature && !inverse && gradient && {
|
|
69
|
+
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`
|
|
71
70
|
})
|
|
72
71
|
};
|
|
73
72
|
});
|
|
74
73
|
|
|
75
74
|
const getLabelTokens = themeTokens => ({
|
|
76
75
|
color: themeTokens.labelBorderColor,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
lineHeight:
|
|
76
|
+
fontSize: themeTokens.labelFontSize,
|
|
77
|
+
fontWeight: themeTokens.labelFontWeight,
|
|
78
|
+
lineHeight: themeTokens.labelLineHeight
|
|
80
79
|
});
|
|
81
80
|
|
|
82
|
-
const getMainTextTokens =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
const getMainTextTokens = _ref2 => {
|
|
82
|
+
let {
|
|
83
|
+
labelBorderColor,
|
|
84
|
+
textTimerFontWeight,
|
|
85
|
+
textFontSize,
|
|
86
|
+
textLineHeight,
|
|
87
|
+
textTimerFontName
|
|
88
|
+
} = _ref2;
|
|
89
|
+
return {
|
|
90
|
+
color: labelBorderColor,
|
|
91
|
+
lineHeight: textLineHeight,
|
|
92
|
+
fontWeight: textTimerFontWeight,
|
|
93
|
+
fontSize: textFontSize,
|
|
94
|
+
fontName: textTimerFontName
|
|
95
|
+
};
|
|
96
|
+
};
|
|
88
97
|
|
|
89
|
-
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((
|
|
98
|
+
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
90
99
|
let {
|
|
91
100
|
copy = 'en',
|
|
92
101
|
targetTime,
|
|
93
102
|
tokens,
|
|
94
103
|
variant = {},
|
|
95
104
|
...rest
|
|
96
|
-
} =
|
|
105
|
+
} = _ref3;
|
|
97
106
|
const [days, hours, minutes, seconds] = (0, _useCountdown.default)(targetTime);
|
|
98
107
|
const viewport = (0, _componentsBase.useViewport)();
|
|
99
108
|
const {
|
|
@@ -118,13 +127,13 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
118
127
|
// StackView-based subcontainer adds a 1-step space on the each side of the divider
|
|
119
128
|
(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
120
129
|
direction: "row",
|
|
121
|
-
space: (feature || large) && viewport !== _systemConstants.viewports.xs ?
|
|
130
|
+
space: (feature || large) && viewport !== _systemConstants.viewports.xs ? 4 : 1
|
|
122
131
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
123
132
|
tokens: mainTextTokens,
|
|
124
133
|
children: ":"
|
|
125
134
|
});
|
|
126
135
|
const labelTokens = getLabelTokens(themeTokens);
|
|
127
|
-
const
|
|
136
|
+
const segmentProps = {
|
|
128
137
|
copy,
|
|
129
138
|
labelTokens,
|
|
130
139
|
numberTokens: mainTextTokens,
|
|
@@ -148,21 +157,21 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
148
157
|
labelKey: "day",
|
|
149
158
|
number: days,
|
|
150
159
|
segmentWidth: String(days).length,
|
|
151
|
-
...
|
|
160
|
+
...segmentProps
|
|
152
161
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
153
162
|
labelKey: "hour",
|
|
154
163
|
number: hours,
|
|
155
|
-
...
|
|
164
|
+
...segmentProps,
|
|
156
165
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
157
166
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
158
167
|
labelKey: "minute",
|
|
159
168
|
number: minutes,
|
|
160
|
-
...
|
|
169
|
+
...segmentProps,
|
|
161
170
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
162
171
|
}), divider, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Segment.default, {
|
|
163
172
|
labelKey: "second",
|
|
164
173
|
number: seconds,
|
|
165
|
-
...
|
|
174
|
+
...segmentProps,
|
|
166
175
|
...(0, _componentsBase.applyTextStyles)(themeTokens)
|
|
167
176
|
})]
|
|
168
177
|
})
|
package/lib/Countdown/Segment.js
CHANGED
|
@@ -23,6 +23,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
23
23
|
|
|
24
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
25
|
|
|
26
|
+
// !TODO: put this back
|
|
26
27
|
// Pads with zeros on the left if it's a single digit number
|
|
27
28
|
const pad = function (number) {
|
|
28
29
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
@@ -44,6 +45,7 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
44
45
|
justifyContent: 'space-evenly',
|
|
45
46
|
display: 'inline-flex',
|
|
46
47
|
...(feature && {
|
|
48
|
+
// This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
|
|
47
49
|
width: `${segmentFontSize * _constants.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
|
|
48
50
|
display: 'flex'
|
|
49
51
|
})
|
|
@@ -8,7 +8,7 @@ const DEFAULT_FONT_SIZE = 16;
|
|
|
8
8
|
exports.DEFAULT_FONT_SIZE = DEFAULT_FONT_SIZE;
|
|
9
9
|
const LARGE_FONT_SIZE = 64;
|
|
10
10
|
exports.LARGE_FONT_SIZE = LARGE_FONT_SIZE;
|
|
11
|
-
const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
|
|
12
|
-
exports.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = SEGMENT_WIDTH_TO_FONT_SIZE_RATIO;
|
|
13
11
|
const XS_FONT_SIZE = 28;
|
|
14
|
-
exports.XS_FONT_SIZE = XS_FONT_SIZE;
|
|
12
|
+
exports.XS_FONT_SIZE = XS_FONT_SIZE;
|
|
13
|
+
const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
|
|
14
|
+
exports.SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = SEGMENT_WIDTH_TO_FONT_SIZE_RATIO;
|
package/lib/Footnote/Footnote.js
CHANGED
|
@@ -198,6 +198,7 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
198
198
|
let {
|
|
199
199
|
closeButtonBorder,
|
|
200
200
|
closeButtonHeight,
|
|
201
|
+
closeButtonBackgroundColor,
|
|
201
202
|
closeButtonMargin,
|
|
202
203
|
closeButtonWidth
|
|
203
204
|
} = _ref9;
|
|
@@ -207,7 +208,7 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
207
208
|
cursor: 'pointer',
|
|
208
209
|
display: 'flex',
|
|
209
210
|
justifyContent: 'center',
|
|
210
|
-
backgroundColor:
|
|
211
|
+
backgroundColor: closeButtonBackgroundColor,
|
|
211
212
|
border: closeButtonBorder,
|
|
212
213
|
height: closeButtonHeight,
|
|
213
214
|
margin: closeButtonMargin,
|
|
@@ -237,10 +238,16 @@ const StyledCustomContentContainer = /*#__PURE__*/_styledComponents.default.div.
|
|
|
237
238
|
componentId: "components-web__sc-1563bo5-8"
|
|
238
239
|
})(_ref11 => {
|
|
239
240
|
let {
|
|
240
|
-
|
|
241
|
+
listItemColor,
|
|
242
|
+
listItemFontSize,
|
|
243
|
+
listItemLineHeight,
|
|
244
|
+
listItemPaddingLeft
|
|
241
245
|
} = _ref11;
|
|
242
246
|
return {
|
|
243
|
-
|
|
247
|
+
fontSize: listItemFontSize,
|
|
248
|
+
lineHeight: listItemLineHeight,
|
|
249
|
+
paddingLeft: listItemPaddingLeft,
|
|
250
|
+
color: listItemColor,
|
|
244
251
|
fontFamily: 'HelveticaNow400normal'
|
|
245
252
|
};
|
|
246
253
|
});
|
|
@@ -307,8 +314,6 @@ const Footnote = props => {
|
|
|
307
314
|
footnoteHeaderPaddingBottom,
|
|
308
315
|
headerLineHeight,
|
|
309
316
|
headerFontSize,
|
|
310
|
-
headerFontName,
|
|
311
|
-
headerFontWeight,
|
|
312
317
|
listPaddingLeft,
|
|
313
318
|
listItemMarkerFontSize,
|
|
314
319
|
listItemMarkerLineHeight,
|
|
@@ -318,6 +323,7 @@ const Footnote = props => {
|
|
|
318
323
|
listItemPaddingLeft,
|
|
319
324
|
closeButtonBorderSize,
|
|
320
325
|
closeButtonBorderColor,
|
|
326
|
+
closeButtonBackgroundColor,
|
|
321
327
|
closeButtonHeight,
|
|
322
328
|
closeButtonMarginTop,
|
|
323
329
|
closeButtonMarginLeft,
|
|
@@ -486,6 +492,10 @@ const Footnote = props => {
|
|
|
486
492
|
|
|
487
493
|
if ( /*#__PURE__*/_react.default.isValidElement(data.content)) {
|
|
488
494
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCustomContentContainer, {
|
|
495
|
+
listItemColor: listItemColor,
|
|
496
|
+
listItemFontSize: listItemFontSize,
|
|
497
|
+
listItemLineHeight: listItemLineHeight,
|
|
498
|
+
listItemPaddingLeft: listItemPaddingLeft,
|
|
489
499
|
ref: contentRef,
|
|
490
500
|
children: data.content
|
|
491
501
|
});
|
|
@@ -503,6 +513,10 @@ const Footnote = props => {
|
|
|
503
513
|
listItemLineHeight: listItemLineHeight,
|
|
504
514
|
listItemPaddingLeft: listItemPaddingLeft,
|
|
505
515
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
516
|
+
tokens: {
|
|
517
|
+
fontSize: listItemFontSize,
|
|
518
|
+
lineHeight: listItemLineHeight
|
|
519
|
+
},
|
|
506
520
|
children: (0, _utils.renderStructuredContent)(data.content)
|
|
507
521
|
})
|
|
508
522
|
})
|
|
@@ -529,17 +543,20 @@ const Footnote = props => {
|
|
|
529
543
|
footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
|
|
530
544
|
footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
|
|
531
545
|
headerMargin: headerMargin,
|
|
532
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
533
|
-
|
|
534
|
-
fontSize:
|
|
535
|
-
lineHeight:
|
|
536
|
-
|
|
546
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
547
|
+
tokens: {
|
|
548
|
+
fontSize: headerFontSize,
|
|
549
|
+
lineHeight: headerLineHeight
|
|
550
|
+
},
|
|
551
|
+
variant: {
|
|
552
|
+
size: 'h4'
|
|
537
553
|
},
|
|
538
554
|
children: getCopy('heading')
|
|
539
555
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
540
|
-
closeButtonBorder: `${closeButtonBorderSize}
|
|
556
|
+
closeButtonBorder: `${closeButtonBorderSize} solid ${closeButtonBorderColor}`,
|
|
541
557
|
closeButtonWidth: `${closeButtonWidth}px`,
|
|
542
558
|
closeButtonHeight: `${closeButtonHeight}px`,
|
|
559
|
+
closeButtonBackgroundColor: closeButtonBackgroundColor,
|
|
543
560
|
closeButtonMargin: `${closeButtonMarginTop}px ${closeButtonMarginRight}px ${closeButtonMarginBottom}px ${closeButtonMarginLeft}px`,
|
|
544
561
|
onClick: event => {
|
|
545
562
|
closeFootnote(event, {
|
|
@@ -21,7 +21,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
21
21
|
|
|
22
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
23
|
|
|
24
|
-
/* eslint-disable react/jsx-filename-extension */
|
|
25
24
|
const StyledModalContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
26
25
|
displayName: "ModalContent__StyledModalContent",
|
|
27
26
|
componentId: "components-web__sc-k40cwb-0"
|
|
@@ -149,8 +149,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
149
149
|
children: [Boolean(tag) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
150
150
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
151
151
|
variant: {
|
|
152
|
-
size: 'eyebrow'
|
|
153
|
-
colour: 'secondary'
|
|
152
|
+
size: 'eyebrow'
|
|
154
153
|
},
|
|
155
154
|
children: tag
|
|
156
155
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
@@ -158,8 +157,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
158
157
|
})]
|
|
159
158
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
160
159
|
variant: {
|
|
161
|
-
size: 'h4'
|
|
162
|
-
colour: 'secondary'
|
|
160
|
+
size: 'h4'
|
|
163
161
|
},
|
|
164
162
|
children: title
|
|
165
163
|
}), Boolean(footer) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
@@ -167,8 +165,7 @@ const PreviewCard = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
167
165
|
space: 2
|
|
168
166
|
}), typeof footer === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
169
167
|
variant: {
|
|
170
|
-
size: 'small'
|
|
171
|
-
colour: 'secondary'
|
|
168
|
+
size: 'small'
|
|
172
169
|
},
|
|
173
170
|
children: footer
|
|
174
171
|
}) : footer]
|
package/lib/Toast/Toast.js
CHANGED
|
@@ -61,6 +61,8 @@ const Toast = _ref3 => {
|
|
|
61
61
|
variant = {},
|
|
62
62
|
...rest
|
|
63
63
|
} = _ref3;
|
|
64
|
+
// viewport hook added to work adjust the padding to different sizes
|
|
65
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
64
66
|
const {
|
|
65
67
|
containerBackgroundColor,
|
|
66
68
|
containerGap,
|
|
@@ -73,8 +75,11 @@ const Toast = _ref3 => {
|
|
|
73
75
|
animationBackgroundColorBefore,
|
|
74
76
|
animationBackgroundColorAfter,
|
|
75
77
|
animationColorBefore,
|
|
76
|
-
animationColorAfter
|
|
77
|
-
|
|
78
|
+
animationColorAfter,
|
|
79
|
+
chevronlinkFontWeight
|
|
80
|
+
} = (0, _componentsBase.useThemeTokens)('Toast', tokens, variant, {
|
|
81
|
+
viewport
|
|
82
|
+
}); // inherit ChevronLink tokens for animation colors
|
|
78
83
|
|
|
79
84
|
const {
|
|
80
85
|
color: chevronDefaultColor
|
|
@@ -111,15 +116,24 @@ const Toast = _ref3 => {
|
|
|
111
116
|
inverse: true
|
|
112
117
|
},
|
|
113
118
|
children: headline
|
|
119
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
120
|
+
space: 2,
|
|
121
|
+
direction: "row"
|
|
114
122
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
115
123
|
variant: {
|
|
116
124
|
inverse: true
|
|
117
125
|
},
|
|
118
126
|
children: copy
|
|
127
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
128
|
+
space: 2,
|
|
129
|
+
direction: "row"
|
|
119
130
|
}), link && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ChevronLink, {
|
|
120
131
|
variant: {
|
|
121
132
|
inverse: true
|
|
122
133
|
},
|
|
134
|
+
tokens: {
|
|
135
|
+
blockFontWeight: chevronlinkFontWeight
|
|
136
|
+
},
|
|
123
137
|
href: link.href,
|
|
124
138
|
LinkRouter: link.LinkRouter,
|
|
125
139
|
linkRouterProps: link.linkRouterProps,
|
|
@@ -26,12 +26,15 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
26
26
|
themeTokens,
|
|
27
27
|
gradient
|
|
28
28
|
} = _ref;
|
|
29
|
-
return { ...(large || feature
|
|
29
|
+
return { ...(large || feature ? {
|
|
30
30
|
display: 'flex',
|
|
31
31
|
flex: 0
|
|
32
|
-
}),
|
|
32
|
+
} : {}),
|
|
33
33
|
...(feature && {
|
|
34
34
|
borderRadius: themeTokens.containerBorderRadius,
|
|
35
|
+
borderColor: themeTokens.containerBorderColor,
|
|
36
|
+
borderStyle: 'solid',
|
|
37
|
+
borderWidth: `${themeTokens.containerBorderWidth}px`,
|
|
35
38
|
justifyContent: 'center',
|
|
36
39
|
paddingBottom: `${themeTokens.containerPaddingBottomTop}px`,
|
|
37
40
|
paddingLeft: `${themeTokens.containerPaddingLeftRight}px`,
|
|
@@ -39,38 +42,44 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
39
42
|
paddingTop: `${themeTokens.containerPaddingBottomTop}px`,
|
|
40
43
|
width: 'fit-content'
|
|
41
44
|
}),
|
|
42
|
-
...(feature && !inverse && {
|
|
43
|
-
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box
|
|
44
|
-
border: `${themeTokens.containerInverseBorder}px solid transparent`
|
|
45
|
-
}),
|
|
46
|
-
...(feature && inverse && {
|
|
47
|
-
border: `${themeTokens.containerInverseBorder}px solid ${themeTokens.inverseBorderColor}`
|
|
45
|
+
...(feature && !inverse && gradient && {
|
|
46
|
+
background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`
|
|
48
47
|
})
|
|
49
48
|
};
|
|
50
49
|
});
|
|
51
50
|
|
|
52
51
|
const getLabelTokens = themeTokens => ({
|
|
53
52
|
color: themeTokens.labelBorderColor,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
lineHeight:
|
|
53
|
+
fontSize: themeTokens.labelFontSize,
|
|
54
|
+
fontWeight: themeTokens.labelFontWeight,
|
|
55
|
+
lineHeight: themeTokens.labelLineHeight
|
|
57
56
|
});
|
|
58
57
|
|
|
59
|
-
const getMainTextTokens =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
const getMainTextTokens = _ref2 => {
|
|
59
|
+
let {
|
|
60
|
+
labelBorderColor,
|
|
61
|
+
textTimerFontWeight,
|
|
62
|
+
textFontSize,
|
|
63
|
+
textLineHeight,
|
|
64
|
+
textTimerFontName
|
|
65
|
+
} = _ref2;
|
|
66
|
+
return {
|
|
67
|
+
color: labelBorderColor,
|
|
68
|
+
lineHeight: textLineHeight,
|
|
69
|
+
fontWeight: textTimerFontWeight,
|
|
70
|
+
fontSize: textFontSize,
|
|
71
|
+
fontName: textTimerFontName
|
|
72
|
+
};
|
|
73
|
+
};
|
|
65
74
|
|
|
66
|
-
const Countdown = /*#__PURE__*/forwardRef((
|
|
75
|
+
const Countdown = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
67
76
|
let {
|
|
68
77
|
copy = 'en',
|
|
69
78
|
targetTime,
|
|
70
79
|
tokens,
|
|
71
80
|
variant = {},
|
|
72
81
|
...rest
|
|
73
|
-
} =
|
|
82
|
+
} = _ref3;
|
|
74
83
|
const [days, hours, minutes, seconds] = useCountdown(targetTime);
|
|
75
84
|
const viewport = useViewport();
|
|
76
85
|
const {
|
|
@@ -95,13 +104,13 @@ const Countdown = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
95
104
|
// StackView-based subcontainer adds a 1-step space on the each side of the divider
|
|
96
105
|
_jsx(Spacer, {
|
|
97
106
|
direction: "row",
|
|
98
|
-
space: (feature || large) && viewport !== viewports.xs ?
|
|
107
|
+
space: (feature || large) && viewport !== viewports.xs ? 4 : 1
|
|
99
108
|
}) : /*#__PURE__*/_jsx(Typography, {
|
|
100
109
|
tokens: mainTextTokens,
|
|
101
110
|
children: ":"
|
|
102
111
|
});
|
|
103
112
|
const labelTokens = getLabelTokens(themeTokens);
|
|
104
|
-
const
|
|
113
|
+
const segmentProps = {
|
|
105
114
|
copy,
|
|
106
115
|
labelTokens,
|
|
107
116
|
numberTokens: mainTextTokens,
|
|
@@ -125,21 +134,21 @@ const Countdown = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
125
134
|
labelKey: "day",
|
|
126
135
|
number: days,
|
|
127
136
|
segmentWidth: String(days).length,
|
|
128
|
-
...
|
|
137
|
+
...segmentProps
|
|
129
138
|
}), divider, /*#__PURE__*/_jsx(Segment, {
|
|
130
139
|
labelKey: "hour",
|
|
131
140
|
number: hours,
|
|
132
|
-
...
|
|
141
|
+
...segmentProps,
|
|
133
142
|
...applyTextStyles(themeTokens)
|
|
134
143
|
}), divider, /*#__PURE__*/_jsx(Segment, {
|
|
135
144
|
labelKey: "minute",
|
|
136
145
|
number: minutes,
|
|
137
|
-
...
|
|
146
|
+
...segmentProps,
|
|
138
147
|
...applyTextStyles(themeTokens)
|
|
139
148
|
}), divider, /*#__PURE__*/_jsx(Segment, {
|
|
140
149
|
labelKey: "second",
|
|
141
150
|
number: seconds,
|
|
142
|
-
...
|
|
151
|
+
...segmentProps,
|
|
143
152
|
...applyTextStyles(themeTokens)
|
|
144
153
|
})]
|
|
145
154
|
})
|
|
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { StackView, Typography, useCopy } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import dictionary from './dictionary';
|
|
6
|
-
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
6
|
+
import { countdownVariantPropType, dictionaryContentShape } from './types'; // !TODO: put this back
|
|
7
|
+
|
|
7
8
|
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants'; // Pads with zeros on the left if it's a single digit number
|
|
8
9
|
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -29,6 +30,7 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
29
30
|
justifyContent: 'space-evenly',
|
|
30
31
|
display: 'inline-flex',
|
|
31
32
|
...(feature && {
|
|
33
|
+
// This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
|
|
32
34
|
width: `${segmentFontSize * SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
|
|
33
35
|
display: 'flex'
|
|
34
36
|
})
|
|
@@ -172,6 +172,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
172
172
|
let {
|
|
173
173
|
closeButtonBorder,
|
|
174
174
|
closeButtonHeight,
|
|
175
|
+
closeButtonBackgroundColor,
|
|
175
176
|
closeButtonMargin,
|
|
176
177
|
closeButtonWidth
|
|
177
178
|
} = _ref9;
|
|
@@ -181,7 +182,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
|
181
182
|
cursor: 'pointer',
|
|
182
183
|
display: 'flex',
|
|
183
184
|
justifyContent: 'center',
|
|
184
|
-
backgroundColor:
|
|
185
|
+
backgroundColor: closeButtonBackgroundColor,
|
|
185
186
|
border: closeButtonBorder,
|
|
186
187
|
height: closeButtonHeight,
|
|
187
188
|
margin: closeButtonMargin,
|
|
@@ -209,10 +210,16 @@ const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
209
210
|
componentId: "components-web__sc-1563bo5-8"
|
|
210
211
|
})(_ref11 => {
|
|
211
212
|
let {
|
|
212
|
-
|
|
213
|
+
listItemColor,
|
|
214
|
+
listItemFontSize,
|
|
215
|
+
listItemLineHeight,
|
|
216
|
+
listItemPaddingLeft
|
|
213
217
|
} = _ref11;
|
|
214
218
|
return {
|
|
215
|
-
|
|
219
|
+
fontSize: listItemFontSize,
|
|
220
|
+
lineHeight: listItemLineHeight,
|
|
221
|
+
paddingLeft: listItemPaddingLeft,
|
|
222
|
+
color: listItemColor,
|
|
216
223
|
fontFamily: 'HelveticaNow400normal'
|
|
217
224
|
};
|
|
218
225
|
});
|
|
@@ -279,8 +286,6 @@ const Footnote = props => {
|
|
|
279
286
|
footnoteHeaderPaddingBottom,
|
|
280
287
|
headerLineHeight,
|
|
281
288
|
headerFontSize,
|
|
282
|
-
headerFontName,
|
|
283
|
-
headerFontWeight,
|
|
284
289
|
listPaddingLeft,
|
|
285
290
|
listItemMarkerFontSize,
|
|
286
291
|
listItemMarkerLineHeight,
|
|
@@ -290,6 +295,7 @@ const Footnote = props => {
|
|
|
290
295
|
listItemPaddingLeft,
|
|
291
296
|
closeButtonBorderSize,
|
|
292
297
|
closeButtonBorderColor,
|
|
298
|
+
closeButtonBackgroundColor,
|
|
293
299
|
closeButtonHeight,
|
|
294
300
|
closeButtonMarginTop,
|
|
295
301
|
closeButtonMarginLeft,
|
|
@@ -458,6 +464,10 @@ const Footnote = props => {
|
|
|
458
464
|
|
|
459
465
|
if ( /*#__PURE__*/React.isValidElement(data.content)) {
|
|
460
466
|
return /*#__PURE__*/_jsx(StyledCustomContentContainer, {
|
|
467
|
+
listItemColor: listItemColor,
|
|
468
|
+
listItemFontSize: listItemFontSize,
|
|
469
|
+
listItemLineHeight: listItemLineHeight,
|
|
470
|
+
listItemPaddingLeft: listItemPaddingLeft,
|
|
461
471
|
ref: contentRef,
|
|
462
472
|
children: data.content
|
|
463
473
|
});
|
|
@@ -475,6 +485,10 @@ const Footnote = props => {
|
|
|
475
485
|
listItemLineHeight: listItemLineHeight,
|
|
476
486
|
listItemPaddingLeft: listItemPaddingLeft,
|
|
477
487
|
children: /*#__PURE__*/_jsx(Typography, {
|
|
488
|
+
tokens: {
|
|
489
|
+
fontSize: listItemFontSize,
|
|
490
|
+
lineHeight: listItemLineHeight
|
|
491
|
+
},
|
|
478
492
|
children: renderStructuredContent(data.content)
|
|
479
493
|
})
|
|
480
494
|
})
|
|
@@ -501,17 +515,20 @@ const Footnote = props => {
|
|
|
501
515
|
footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
|
|
502
516
|
footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
|
|
503
517
|
headerMargin: headerMargin,
|
|
504
|
-
children: [/*#__PURE__*/_jsx(
|
|
505
|
-
|
|
506
|
-
fontSize:
|
|
507
|
-
lineHeight:
|
|
508
|
-
|
|
518
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
519
|
+
tokens: {
|
|
520
|
+
fontSize: headerFontSize,
|
|
521
|
+
lineHeight: headerLineHeight
|
|
522
|
+
},
|
|
523
|
+
variant: {
|
|
524
|
+
size: 'h4'
|
|
509
525
|
},
|
|
510
526
|
children: getCopy('heading')
|
|
511
527
|
}), /*#__PURE__*/_jsx(CloseButton, {
|
|
512
|
-
closeButtonBorder: `${closeButtonBorderSize}
|
|
528
|
+
closeButtonBorder: `${closeButtonBorderSize} solid ${closeButtonBorderColor}`,
|
|
513
529
|
closeButtonWidth: `${closeButtonWidth}px`,
|
|
514
530
|
closeButtonHeight: `${closeButtonHeight}px`,
|
|
531
|
+
closeButtonBackgroundColor: closeButtonBackgroundColor,
|
|
515
532
|
closeButtonMargin: `${closeButtonMarginTop}px ${closeButtonMarginRight}px ${closeButtonMarginBottom}px ${closeButtonMarginLeft}px`,
|
|
516
533
|
onClick: event => {
|
|
517
534
|
closeFootnote(event, {
|
|
@@ -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]
|
|
@@ -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,
|
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.0",
|
|
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.33.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.9.0"
|
|
67
67
|
}
|
|
@@ -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
|
|
@@ -137,13 +137,19 @@ const ListItem = styled(OrderedListBase.Item)(
|
|
|
137
137
|
)
|
|
138
138
|
|
|
139
139
|
const CloseButton = styled.button(
|
|
140
|
-
({
|
|
140
|
+
({
|
|
141
|
+
closeButtonBorder,
|
|
142
|
+
closeButtonHeight,
|
|
143
|
+
closeButtonBackgroundColor,
|
|
144
|
+
closeButtonMargin,
|
|
145
|
+
closeButtonWidth
|
|
146
|
+
}) => ({
|
|
141
147
|
alignItems: 'center',
|
|
142
148
|
borderRadius: '50%',
|
|
143
149
|
cursor: 'pointer',
|
|
144
150
|
display: 'flex',
|
|
145
151
|
justifyContent: 'center',
|
|
146
|
-
backgroundColor:
|
|
152
|
+
backgroundColor: closeButtonBackgroundColor,
|
|
147
153
|
border: closeButtonBorder,
|
|
148
154
|
height: closeButtonHeight,
|
|
149
155
|
margin: closeButtonMargin,
|
|
@@ -163,10 +169,16 @@ const ContentContainer = styled.div(
|
|
|
163
169
|
})
|
|
164
170
|
)
|
|
165
171
|
|
|
166
|
-
const StyledCustomContentContainer = styled.div(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
const StyledCustomContentContainer = styled.div(
|
|
173
|
+
({ listItemColor, listItemFontSize, listItemLineHeight, listItemPaddingLeft }) => ({
|
|
174
|
+
fontSize: listItemFontSize,
|
|
175
|
+
lineHeight: listItemLineHeight,
|
|
176
|
+
paddingLeft: listItemPaddingLeft,
|
|
177
|
+
color: listItemColor,
|
|
178
|
+
fontFamily: 'HelveticaNow400normal'
|
|
179
|
+
})
|
|
180
|
+
)
|
|
181
|
+
|
|
170
182
|
const usePrevious = (value) => {
|
|
171
183
|
const ref = useRef()
|
|
172
184
|
useEffect(() => {
|
|
@@ -224,8 +236,6 @@ const Footnote = (props) => {
|
|
|
224
236
|
footnoteHeaderPaddingBottom,
|
|
225
237
|
headerLineHeight,
|
|
226
238
|
headerFontSize,
|
|
227
|
-
headerFontName,
|
|
228
|
-
headerFontWeight,
|
|
229
239
|
listPaddingLeft,
|
|
230
240
|
listItemMarkerFontSize,
|
|
231
241
|
listItemMarkerLineHeight,
|
|
@@ -235,6 +245,7 @@ const Footnote = (props) => {
|
|
|
235
245
|
listItemPaddingLeft,
|
|
236
246
|
closeButtonBorderSize,
|
|
237
247
|
closeButtonBorderColor,
|
|
248
|
+
closeButtonBackgroundColor,
|
|
238
249
|
closeButtonHeight,
|
|
239
250
|
closeButtonMarginTop,
|
|
240
251
|
closeButtonMarginLeft,
|
|
@@ -401,7 +412,15 @@ const Footnote = (props) => {
|
|
|
401
412
|
}
|
|
402
413
|
if (React.isValidElement(data.content)) {
|
|
403
414
|
return (
|
|
404
|
-
<StyledCustomContentContainer
|
|
415
|
+
<StyledCustomContentContainer
|
|
416
|
+
listItemColor={listItemColor}
|
|
417
|
+
listItemFontSize={listItemFontSize}
|
|
418
|
+
listItemLineHeight={listItemLineHeight}
|
|
419
|
+
listItemPaddingLeft={listItemPaddingLeft}
|
|
420
|
+
ref={contentRef}
|
|
421
|
+
>
|
|
422
|
+
{data.content}
|
|
423
|
+
</StyledCustomContentContainer>
|
|
405
424
|
)
|
|
406
425
|
}
|
|
407
426
|
return (
|
|
@@ -414,7 +433,14 @@ const Footnote = (props) => {
|
|
|
414
433
|
listItemLineHeight={listItemLineHeight}
|
|
415
434
|
listItemPaddingLeft={listItemPaddingLeft}
|
|
416
435
|
>
|
|
417
|
-
<Typography
|
|
436
|
+
<Typography
|
|
437
|
+
tokens={{
|
|
438
|
+
fontSize: listItemFontSize,
|
|
439
|
+
lineHeight: listItemLineHeight
|
|
440
|
+
}}
|
|
441
|
+
>
|
|
442
|
+
{renderStructuredContent(data.content)}
|
|
443
|
+
</Typography>
|
|
418
444
|
</ListItem>
|
|
419
445
|
</List>
|
|
420
446
|
)
|
|
@@ -453,19 +479,20 @@ const Footnote = (props) => {
|
|
|
453
479
|
footnoteHeaderPaddingBottom={footnoteHeaderPaddingBottom}
|
|
454
480
|
headerMargin={headerMargin}
|
|
455
481
|
>
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
fontSize:
|
|
459
|
-
lineHeight:
|
|
460
|
-
fontFamily: `${headerFontName}${headerFontWeight}normal`
|
|
482
|
+
<Typography
|
|
483
|
+
tokens={{
|
|
484
|
+
fontSize: headerFontSize,
|
|
485
|
+
lineHeight: headerLineHeight
|
|
461
486
|
}}
|
|
487
|
+
variant={{ size: 'h4' }}
|
|
462
488
|
>
|
|
463
489
|
{getCopy('heading')}
|
|
464
|
-
</
|
|
490
|
+
</Typography>
|
|
465
491
|
<CloseButton
|
|
466
|
-
closeButtonBorder={`${closeButtonBorderSize}
|
|
492
|
+
closeButtonBorder={`${closeButtonBorderSize} solid ${closeButtonBorderColor}`}
|
|
467
493
|
closeButtonWidth={`${closeButtonWidth}px`}
|
|
468
494
|
closeButtonHeight={`${closeButtonHeight}px`}
|
|
495
|
+
closeButtonBackgroundColor={closeButtonBackgroundColor}
|
|
469
496
|
closeButtonMargin={`${closeButtonMarginTop}px ${closeButtonMarginRight}px ${closeButtonMarginBottom}px ${closeButtonMarginLeft}px`}
|
|
470
497
|
onClick={(event) => {
|
|
471
498
|
closeFootnote(event, { returnFocus: true })
|
|
@@ -120,20 +120,16 @@ const PreviewCard = forwardRef(
|
|
|
120
120
|
>
|
|
121
121
|
{Boolean(tag) && (
|
|
122
122
|
<>
|
|
123
|
-
<Typography variant={{ size: 'eyebrow'
|
|
124
|
-
{tag}
|
|
125
|
-
</Typography>
|
|
123
|
+
<Typography variant={{ size: 'eyebrow' }}>{tag}</Typography>
|
|
126
124
|
<Spacer space={2} />
|
|
127
125
|
</>
|
|
128
126
|
)}
|
|
129
|
-
<Typography variant={{ size: 'h4'
|
|
127
|
+
<Typography variant={{ size: 'h4' }}>{title}</Typography>
|
|
130
128
|
{Boolean(footer) && (
|
|
131
129
|
<>
|
|
132
130
|
<Spacer space={2} />
|
|
133
131
|
{typeof footer === 'string' ? (
|
|
134
|
-
<Typography variant={{ size: 'small'
|
|
135
|
-
{footer}
|
|
136
|
-
</Typography>
|
|
132
|
+
<Typography variant={{ size: 'small' }}>{footer}</Typography>
|
|
137
133
|
) : (
|
|
138
134
|
footer
|
|
139
135
|
)}
|
package/src/Toast/Toast.jsx
CHANGED
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
selectSystemProps,
|
|
6
6
|
useThemeTokens,
|
|
7
7
|
Typography,
|
|
8
|
-
withLinkRouter
|
|
8
|
+
withLinkRouter,
|
|
9
|
+
Spacer,
|
|
10
|
+
useViewport
|
|
9
11
|
} from '@telus-uds/components-base'
|
|
10
12
|
import styled, { keyframes, css } from 'styled-components'
|
|
11
13
|
import { htmlAttrs } from '../utils'
|
|
@@ -86,6 +88,9 @@ const ToastContainer = styled.div`
|
|
|
86
88
|
`
|
|
87
89
|
|
|
88
90
|
const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) => {
|
|
91
|
+
// viewport hook added to work adjust the padding to different sizes
|
|
92
|
+
const viewport = useViewport()
|
|
93
|
+
|
|
89
94
|
const {
|
|
90
95
|
containerBackgroundColor,
|
|
91
96
|
containerGap,
|
|
@@ -98,8 +103,9 @@ const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) =
|
|
|
98
103
|
animationBackgroundColorBefore,
|
|
99
104
|
animationBackgroundColorAfter,
|
|
100
105
|
animationColorBefore,
|
|
101
|
-
animationColorAfter
|
|
102
|
-
|
|
106
|
+
animationColorAfter,
|
|
107
|
+
chevronlinkFontWeight
|
|
108
|
+
} = useThemeTokens('Toast', tokens, variant, { viewport })
|
|
103
109
|
|
|
104
110
|
// inherit ChevronLink tokens for animation colors
|
|
105
111
|
const { color: chevronDefaultColor } = useThemeTokens('ChevronLink', {}, {})
|
|
@@ -128,10 +134,15 @@ const Toast = ({ toast, copy, headline, link, tokens, variant = {}, ...rest }) =
|
|
|
128
134
|
{...selectProps(rest)}
|
|
129
135
|
>
|
|
130
136
|
{headline && <Typography variant={{ bold: true, inverse: true }}>{headline}</Typography>}
|
|
137
|
+
<Spacer space={2} direction="row" />
|
|
131
138
|
<Typography variant={{ inverse: true }}>{copy}</Typography>
|
|
139
|
+
<Spacer space={2} direction="row" />
|
|
132
140
|
{link && (
|
|
133
141
|
<ChevronLink
|
|
134
|
-
variant={{
|
|
142
|
+
variant={{
|
|
143
|
+
inverse: true
|
|
144
|
+
}}
|
|
145
|
+
tokens={{ blockFontWeight: chevronlinkFontWeight }}
|
|
135
146
|
href={link.href}
|
|
136
147
|
LinkRouter={link.LinkRouter}
|
|
137
148
|
linkRouterProps={link.linkRouterProps}
|