@telus-uds/components-web 4.1.0 → 4.2.1
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 +29 -2
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/cjs/DatePicker/DatePicker.js +4 -4
- package/lib/cjs/PriceLockup/PriceLockup.js +23 -3
- package/lib/cjs/Spinner/Spinner.js +4 -2
- package/lib/esm/Breadcrumbs/Breadcrumbs.js +1 -1
- package/lib/esm/DatePicker/DatePicker.js +4 -4
- package/lib/esm/PriceLockup/PriceLockup.js +23 -3
- package/lib/esm/Spinner/Spinner.js +4 -2
- package/package.json +3 -3
- package/src/Breadcrumbs/Breadcrumbs.jsx +5 -1
- package/src/DatePicker/DatePicker.jsx +6 -6
- package/src/PriceLockup/PriceLockup.jsx +27 -3
- package/src/Spinner/Spinner.jsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 05 Mar 2025 00:01:06 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 4.2.1
|
|
8
|
+
|
|
9
|
+
Wed, 05 Mar 2025 00:01:06 GMT
|
|
10
|
+
|
|
11
|
+
### Patches
|
|
12
|
+
|
|
13
|
+
- `Alignment`: fix Typography align issue when using `align` (sergio.ramirez@telus.com)
|
|
14
|
+
- `List`: remove textAlign parent value (sergio.ramirez@telus.com)
|
|
15
|
+
- `Breadcrumbs`: fix layout shifts (guillermo.peitzner@telus.com)
|
|
16
|
+
- Bump @telus-uds/components-base to v3.3.0
|
|
17
|
+
|
|
18
|
+
## 4.2.0
|
|
19
|
+
|
|
20
|
+
Fri, 14 Feb 2025 19:03:35 GMT
|
|
21
|
+
|
|
22
|
+
### Minor changes
|
|
23
|
+
|
|
24
|
+
- `PriceLockup`: ability to receive jsx elements in rateText prop added (35577399+JoshHC@users.noreply.github.com)
|
|
25
|
+
- Bump @telus-uds/components-base to v3.2.0
|
|
26
|
+
- Bump @telus-uds/system-theme-tokens to v4.2.0
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- `DatePicker`: remove warnings when opening the component (Mauricio.BatresMontejo@telus.com)
|
|
31
|
+
- `Test`: Update snapshots (sergio.ramirez@telus.com)
|
|
32
|
+
- `Spinner`: fix positioning when overlying a button (guillermo.peitzner@telus.com)
|
|
33
|
+
|
|
7
34
|
## 4.1.0
|
|
8
35
|
|
|
9
|
-
Mon, 10 Feb 2025 17:
|
|
36
|
+
Mon, 10 Feb 2025 17:36:47 GMT
|
|
10
37
|
|
|
11
38
|
### Minor changes
|
|
12
39
|
|
|
@@ -174,7 +174,7 @@ const Breadcrumbs = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
174
174
|
setItemsToBeRendered(activeRoutes);
|
|
175
175
|
}
|
|
176
176
|
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered, newItems]);
|
|
177
|
-
const items = getItems(itemsToBeRendered, params, !children);
|
|
177
|
+
const items = getItems(itemsToBeRendered.length > 0 ? itemsToBeRendered : activeRoutes, params, !children);
|
|
178
178
|
const themeTokens = (0, _componentsBase.useThemeTokens)('Breadcrumbs', tokens, variant);
|
|
179
179
|
const metadata = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHelmetAsync.HelmetProvider, {
|
|
180
180
|
context: helmetContext,
|
|
@@ -73,6 +73,10 @@ const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
|
73
73
|
}
|
|
74
74
|
return () => (0, _moment.default)(initialVisibleMonth);
|
|
75
75
|
};
|
|
76
|
+
const HiddenInputFieldContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
77
|
+
displayName: "DatePicker__HiddenInputFieldContainer",
|
|
78
|
+
componentId: "components-web__sc-mz8fi3-3"
|
|
79
|
+
})(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
|
|
76
80
|
|
|
77
81
|
/**
|
|
78
82
|
* Use DatePicker to select a date on a calendar.
|
|
@@ -258,10 +262,6 @@ const DatePicker = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
258
262
|
const viewport = (0, _componentsBase.useViewport)();
|
|
259
263
|
const daySize = getResponsiveDaySize(inline, viewport);
|
|
260
264
|
const circleSize = getResponsiveCircleSize(inline, viewport);
|
|
261
|
-
const HiddenInputFieldContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
262
|
-
displayName: "DatePicker__HiddenInputFieldContainer",
|
|
263
|
-
componentId: "components-web__sc-mz8fi3-3"
|
|
264
|
-
})(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
|
|
265
265
|
const {
|
|
266
266
|
hiddenInputFieldContainerHeight,
|
|
267
267
|
hiddenInputFieldContainerWidth,
|
|
@@ -284,9 +284,29 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref16, ref) => {
|
|
|
284
284
|
if (strikeThrough && !a11yText) {
|
|
285
285
|
(0, _utils.warn)('PriceLockup', 'a11yText must be provided with strikethrough pricing');
|
|
286
286
|
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Converts rateText to string if rateText is an JSX.
|
|
290
|
+
*/
|
|
291
|
+
function getRateText(rateTextValue) {
|
|
292
|
+
if (!rateTextValue) return '';
|
|
293
|
+
switch (typeof rateTextValue) {
|
|
294
|
+
case 'string':
|
|
295
|
+
return rateTextValue.replace('/', '');
|
|
296
|
+
case 'object':
|
|
297
|
+
if (/*#__PURE__*/_react.default.isValidElement(rateTextValue)) {
|
|
298
|
+
return _react.default.Children.toArray(rateTextValue.props.children).map(getRateText).join('');
|
|
299
|
+
}
|
|
300
|
+
// If it's an object but not a React element, return empty string
|
|
301
|
+
break;
|
|
302
|
+
default:
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
return '';
|
|
306
|
+
}
|
|
287
307
|
const getAriaContent = () => {
|
|
288
308
|
const {
|
|
289
|
-
dictionaryPrice
|
|
309
|
+
price: dictionaryPrice,
|
|
290
310
|
priceWithCents,
|
|
291
311
|
rate
|
|
292
312
|
} = dictionary[copy];
|
|
@@ -295,7 +315,7 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref16, ref) => {
|
|
|
295
315
|
ariaLabel = `${ariaLabel} ${currencySymbol}`;
|
|
296
316
|
}
|
|
297
317
|
if (rateText) {
|
|
298
|
-
ariaLabel += ` ${rate.replace('%{rateText}', rateText
|
|
318
|
+
ariaLabel += ` ${rate.replace('%{rateText}', getRateText(rateText))}`;
|
|
299
319
|
}
|
|
300
320
|
return ariaLabel;
|
|
301
321
|
};
|
|
@@ -349,7 +369,7 @@ PriceLockup.propTypes = {
|
|
|
349
369
|
/**
|
|
350
370
|
* Shows month/year unit
|
|
351
371
|
*/
|
|
352
|
-
rateText: _propTypes.default.string,
|
|
372
|
+
rateText: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
353
373
|
/**
|
|
354
374
|
* Shows additional info below the price with a `Divider`
|
|
355
375
|
*/
|
|
@@ -21,12 +21,13 @@ const SpinnerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
21
21
|
})(_ref => {
|
|
22
22
|
let {
|
|
23
23
|
inline,
|
|
24
|
-
fullScreen
|
|
24
|
+
fullScreen,
|
|
25
|
+
overlay
|
|
25
26
|
} = _ref;
|
|
26
27
|
return {
|
|
27
28
|
position: 'relative',
|
|
28
29
|
...(inline && {
|
|
29
|
-
display: 'block',
|
|
30
|
+
display: overlay ? 'inline-block' : 'block',
|
|
30
31
|
...(0, _utils.media)().from('md').css({
|
|
31
32
|
display: 'inline-block'
|
|
32
33
|
})
|
|
@@ -139,6 +140,7 @@ const Spinner = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
139
140
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(SpinnerContainer, {
|
|
140
141
|
inline: inline,
|
|
141
142
|
"aria-live": "assertive",
|
|
143
|
+
overlay: true,
|
|
142
144
|
...selectProps(rest),
|
|
143
145
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_SpinnerContent.default, {
|
|
144
146
|
label: label,
|
|
@@ -165,7 +165,7 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
165
165
|
setItemsToBeRendered(activeRoutes);
|
|
166
166
|
}
|
|
167
167
|
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered, newItems]);
|
|
168
|
-
const items = getItems(itemsToBeRendered, params, !children);
|
|
168
|
+
const items = getItems(itemsToBeRendered.length > 0 ? itemsToBeRendered : activeRoutes, params, !children);
|
|
169
169
|
const themeTokens = useThemeTokens('Breadcrumbs', tokens, variant);
|
|
170
170
|
const metadata = /*#__PURE__*/_jsx(HelmetProvider, {
|
|
171
171
|
context: helmetContext,
|
|
@@ -66,6 +66,10 @@ const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
|
66
66
|
}
|
|
67
67
|
return () => moment(initialVisibleMonth);
|
|
68
68
|
};
|
|
69
|
+
const HiddenInputFieldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
70
|
+
displayName: "DatePicker__HiddenInputFieldContainer",
|
|
71
|
+
componentId: "components-web__sc-mz8fi3-3"
|
|
72
|
+
})(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
|
|
69
73
|
|
|
70
74
|
/**
|
|
71
75
|
* Use DatePicker to select a date on a calendar.
|
|
@@ -251,10 +255,6 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
251
255
|
const viewport = useViewport();
|
|
252
256
|
const daySize = getResponsiveDaySize(inline, viewport);
|
|
253
257
|
const circleSize = getResponsiveCircleSize(inline, viewport);
|
|
254
|
-
const HiddenInputFieldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
255
|
-
displayName: "DatePicker__HiddenInputFieldContainer",
|
|
256
|
-
componentId: "components-web__sc-mz8fi3-3"
|
|
257
|
-
})(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
|
|
258
258
|
const {
|
|
259
259
|
hiddenInputFieldContainerHeight,
|
|
260
260
|
hiddenInputFieldContainerWidth,
|
|
@@ -277,9 +277,29 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
|
277
277
|
if (strikeThrough && !a11yText) {
|
|
278
278
|
warn('PriceLockup', 'a11yText must be provided with strikethrough pricing');
|
|
279
279
|
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Converts rateText to string if rateText is an JSX.
|
|
283
|
+
*/
|
|
284
|
+
function getRateText(rateTextValue) {
|
|
285
|
+
if (!rateTextValue) return '';
|
|
286
|
+
switch (typeof rateTextValue) {
|
|
287
|
+
case 'string':
|
|
288
|
+
return rateTextValue.replace('/', '');
|
|
289
|
+
case 'object':
|
|
290
|
+
if (/*#__PURE__*/React.isValidElement(rateTextValue)) {
|
|
291
|
+
return React.Children.toArray(rateTextValue.props.children).map(getRateText).join('');
|
|
292
|
+
}
|
|
293
|
+
// If it's an object but not a React element, return empty string
|
|
294
|
+
break;
|
|
295
|
+
default:
|
|
296
|
+
break;
|
|
297
|
+
}
|
|
298
|
+
return '';
|
|
299
|
+
}
|
|
280
300
|
const getAriaContent = () => {
|
|
281
301
|
const {
|
|
282
|
-
dictionaryPrice
|
|
302
|
+
price: dictionaryPrice,
|
|
283
303
|
priceWithCents,
|
|
284
304
|
rate
|
|
285
305
|
} = dictionary[copy];
|
|
@@ -288,7 +308,7 @@ const PriceLockup = /*#__PURE__*/React.forwardRef((_ref16, ref) => {
|
|
|
288
308
|
ariaLabel = `${ariaLabel} ${currencySymbol}`;
|
|
289
309
|
}
|
|
290
310
|
if (rateText) {
|
|
291
|
-
ariaLabel += ` ${rate.replace('%{rateText}', rateText
|
|
311
|
+
ariaLabel += ` ${rate.replace('%{rateText}', getRateText(rateText))}`;
|
|
292
312
|
}
|
|
293
313
|
return ariaLabel;
|
|
294
314
|
};
|
|
@@ -342,7 +362,7 @@ PriceLockup.propTypes = {
|
|
|
342
362
|
/**
|
|
343
363
|
* Shows month/year unit
|
|
344
364
|
*/
|
|
345
|
-
rateText: PropTypes.string,
|
|
365
|
+
rateText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
346
366
|
/**
|
|
347
367
|
* Shows additional info below the price with a `Divider`
|
|
348
368
|
*/
|
|
@@ -14,12 +14,13 @@ const SpinnerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
14
14
|
})(_ref => {
|
|
15
15
|
let {
|
|
16
16
|
inline,
|
|
17
|
-
fullScreen
|
|
17
|
+
fullScreen,
|
|
18
|
+
overlay
|
|
18
19
|
} = _ref;
|
|
19
20
|
return {
|
|
20
21
|
position: 'relative',
|
|
21
22
|
...(inline && {
|
|
22
|
-
display: 'block',
|
|
23
|
+
display: overlay ? 'inline-block' : 'block',
|
|
23
24
|
...media().from('md').css({
|
|
24
25
|
display: 'inline-block'
|
|
25
26
|
})
|
|
@@ -132,6 +133,7 @@ const Spinner = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
132
133
|
return /*#__PURE__*/_jsxs(SpinnerContainer, {
|
|
133
134
|
inline: inline,
|
|
134
135
|
"aria-live": "assertive",
|
|
136
|
+
overlay: true,
|
|
135
137
|
...selectProps(rest),
|
|
136
138
|
children: [/*#__PURE__*/_jsx(SpinnerContent, {
|
|
137
139
|
label: label,
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
],
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@gorhom/portal": "^1.0.14",
|
|
8
|
-
"@telus-uds/components-base": "^3.
|
|
8
|
+
"@telus-uds/components-base": "^3.3.0",
|
|
9
9
|
"@telus-uds/system-constants": "^3.0.0",
|
|
10
10
|
"fscreen": "^1.2.0",
|
|
11
11
|
"lodash.omit": "^4.5.0",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"react-dates": "^21.8.0",
|
|
14
14
|
"react-helmet-async": "^1.3.0",
|
|
15
15
|
"react-moment-proptypes": "^1.8.1",
|
|
16
|
-
"@telus-uds/system-theme-tokens": "^4.
|
|
16
|
+
"@telus-uds/system-theme-tokens": "^4.2.0",
|
|
17
17
|
"prop-types": "^15.7.2",
|
|
18
18
|
"lodash.throttle": "^4.1.1",
|
|
19
19
|
"react-youtube": "^10.1.0",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"skip": true
|
|
83
83
|
},
|
|
84
84
|
"types": "types/index.d.ts",
|
|
85
|
-
"version": "4.1
|
|
85
|
+
"version": "4.2.1"
|
|
86
86
|
}
|
|
@@ -186,7 +186,11 @@ const Breadcrumbs = React.forwardRef(
|
|
|
186
186
|
}
|
|
187
187
|
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered, newItems])
|
|
188
188
|
|
|
189
|
-
const items = getItems(
|
|
189
|
+
const items = getItems(
|
|
190
|
+
itemsToBeRendered.length > 0 ? itemsToBeRendered : activeRoutes,
|
|
191
|
+
params,
|
|
192
|
+
!children
|
|
193
|
+
)
|
|
190
194
|
const themeTokens = useThemeTokens('Breadcrumbs', tokens, variant)
|
|
191
195
|
|
|
192
196
|
const metadata = (
|
|
@@ -61,6 +61,12 @@ const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
|
61
61
|
return () => moment(initialVisibleMonth)
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
const HiddenInputFieldContainer = styled.div`
|
|
65
|
+
height: ${(props) => props.height};
|
|
66
|
+
width: ${(props) => props.width};
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
`
|
|
69
|
+
|
|
64
70
|
/**
|
|
65
71
|
* Use DatePicker to select a date on a calendar.
|
|
66
72
|
*
|
|
@@ -260,12 +266,6 @@ const DatePicker = React.forwardRef(
|
|
|
260
266
|
const daySize = getResponsiveDaySize(inline, viewport)
|
|
261
267
|
const circleSize = getResponsiveCircleSize(inline, viewport)
|
|
262
268
|
|
|
263
|
-
const HiddenInputFieldContainer = styled.div`
|
|
264
|
-
height: ${(props) => props.height};
|
|
265
|
-
width: ${(props) => props.width};
|
|
266
|
-
overflow: hidden;
|
|
267
|
-
`
|
|
268
|
-
|
|
269
269
|
const {
|
|
270
270
|
hiddenInputFieldContainerHeight,
|
|
271
271
|
hiddenInputFieldContainerWidth,
|
|
@@ -251,8 +251,32 @@ const PriceLockup = React.forwardRef(
|
|
|
251
251
|
warn('PriceLockup', 'a11yText must be provided with strikethrough pricing')
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Converts rateText to string if rateText is an JSX.
|
|
256
|
+
*/
|
|
257
|
+
function getRateText(rateTextValue) {
|
|
258
|
+
if (!rateTextValue) return ''
|
|
259
|
+
|
|
260
|
+
switch (typeof rateTextValue) {
|
|
261
|
+
case 'string':
|
|
262
|
+
return rateTextValue.replace('/', '')
|
|
263
|
+
|
|
264
|
+
case 'object':
|
|
265
|
+
if (React.isValidElement(rateTextValue)) {
|
|
266
|
+
return React.Children.toArray(rateTextValue.props.children).map(getRateText).join('')
|
|
267
|
+
}
|
|
268
|
+
// If it's an object but not a React element, return empty string
|
|
269
|
+
break
|
|
270
|
+
|
|
271
|
+
default:
|
|
272
|
+
break
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return ''
|
|
276
|
+
}
|
|
277
|
+
|
|
254
278
|
const getAriaContent = () => {
|
|
255
|
-
const { dictionaryPrice
|
|
279
|
+
const { price: dictionaryPrice, priceWithCents, rate } = dictionary[copy]
|
|
256
280
|
let ariaLabel = hasCents
|
|
257
281
|
? priceWithCents
|
|
258
282
|
.replace('%{amount}', amount)
|
|
@@ -265,7 +289,7 @@ const PriceLockup = React.forwardRef(
|
|
|
265
289
|
}
|
|
266
290
|
|
|
267
291
|
if (rateText) {
|
|
268
|
-
ariaLabel += ` ${rate.replace('%{rateText}', rateText
|
|
292
|
+
ariaLabel += ` ${rate.replace('%{rateText}', getRateText(rateText))}`
|
|
269
293
|
}
|
|
270
294
|
return ariaLabel
|
|
271
295
|
}
|
|
@@ -331,7 +355,7 @@ PriceLockup.propTypes = {
|
|
|
331
355
|
/**
|
|
332
356
|
* Shows month/year unit
|
|
333
357
|
*/
|
|
334
|
-
rateText: PropTypes.string,
|
|
358
|
+
rateText: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
335
359
|
/**
|
|
336
360
|
* Shows additional info below the price with a `Divider`
|
|
337
361
|
*/
|
package/src/Spinner/Spinner.jsx
CHANGED
|
@@ -14,10 +14,10 @@ import { BACKDROP_OPACITY, BACKDROP_Z_INDEX } from './constants'
|
|
|
14
14
|
|
|
15
15
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
16
16
|
|
|
17
|
-
const SpinnerContainer = styled.div(({ inline, fullScreen }) => ({
|
|
17
|
+
const SpinnerContainer = styled.div(({ inline, fullScreen, overlay }) => ({
|
|
18
18
|
position: 'relative',
|
|
19
19
|
...(inline && {
|
|
20
|
-
display: 'block',
|
|
20
|
+
display: overlay ? 'inline-block' : 'block',
|
|
21
21
|
...media().from('md').css({
|
|
22
22
|
display: 'inline-block'
|
|
23
23
|
})
|
|
@@ -123,7 +123,7 @@ const Spinner = React.forwardRef(
|
|
|
123
123
|
// Overlay spinner
|
|
124
124
|
if (children) {
|
|
125
125
|
return (
|
|
126
|
-
<SpinnerContainer inline={inline} aria-live="assertive" {...selectProps(rest)}>
|
|
126
|
+
<SpinnerContainer inline={inline} aria-live="assertive" overlay {...selectProps(rest)}>
|
|
127
127
|
<SpinnerContent
|
|
128
128
|
label={label}
|
|
129
129
|
labelPosition={labelPosition}
|