@telus-uds/components-web 2.33.2 → 2.34.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 -3
- package/lib/Badge/Badge.js +4 -2
- package/lib/BlockQuote/BlockQuote.js +4 -2
- package/lib/Breadcrumbs/Breadcrumbs.js +7 -5
- package/lib/Breadcrumbs/Item/Item.js +2 -13
- package/lib/Callout/Callout.js +4 -2
- package/lib/Card/Card.js +3 -5
- package/lib/Card/CardContent.js +4 -2
- package/lib/Countdown/Countdown.js +2 -6
- package/lib/Countdown/Segment.js +4 -2
- package/lib/DatePicker/CalendarContainer.js +2 -2
- package/lib/DatePicker/DatePicker.js +21 -35
- package/lib/Disclaimer/Disclaimer.js +4 -2
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +5 -11
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +4 -2
- package/lib/Footnote/Footnote.js +32 -37
- package/lib/Footnote/FootnoteLink.js +9 -6
- package/lib/IconButton/IconButton.js +4 -11
- package/lib/Image/Image.js +5 -3
- package/lib/List/ListItem.js +2 -7
- package/lib/NavigationBar/NavigationBar.js +8 -18
- package/lib/NavigationBar/NavigationItem.js +4 -9
- package/lib/NavigationBar/NavigationSubMenu.js +8 -7
- package/lib/NavigationBar/index.js +2 -0
- package/lib/OptimizeImage/OptimizeImage.js +8 -8
- package/lib/OrderedList/Item.js +3 -9
- package/lib/OrderedList/OrderedList.js +5 -13
- package/lib/OrderedList/OrderedListBase.js +3 -8
- package/lib/Paragraph/Paragraph.js +5 -3
- package/lib/PreviewCard/PreviewCard.js +3 -5
- package/lib/PriceLockup/PriceLockup.js +4 -2
- package/lib/Progress/ProgressBar.js +4 -2
- package/lib/QuantitySelector/QuantitySelector.js +21 -24
- package/lib/QuantitySelector/SideButton.js +12 -20
- package/lib/ResponsiveImage/ResponsiveImage.js +4 -2
- package/lib/Ribbon/Ribbon.js +4 -2
- package/lib/SkeletonProvider/SkeletonImage.js +5 -3
- package/lib/SkeletonProvider/SkeletonProvider.js +3 -5
- package/lib/SkeletonProvider/SkeletonTypography.js +5 -3
- package/lib/Span/Span.js +5 -3
- package/lib/Spinner/Spinner.js +4 -2
- package/lib/Spinner/SpinnerContent.js +4 -2
- package/lib/StoryCard/StoryCard.js +3 -5
- package/lib/Table/Body.js +4 -2
- package/lib/Table/Cell.js +5 -3
- package/lib/Table/Header.js +6 -6
- package/lib/Table/Row.js +6 -6
- package/lib/Table/SubHeading.js +6 -6
- package/lib/Table/Table.js +6 -8
- package/lib/TermsAndConditions/ExpandCollapse.js +2 -7
- package/lib/TermsAndConditions/TermsAndConditions.js +5 -14
- package/lib/Testimonial/Testimonial.js +4 -2
- package/lib/Toast/Toast.js +4 -2
- package/lib/Video/Video.js +19 -55
- package/lib/VideoPicker/VideoPicker.js +38 -9
- package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib/VideoPicker/VideoPickerThumbnail.js +4 -2
- package/lib/VideoPicker/VideoSlider.js +7 -7
- package/lib/WaffleGrid/WaffleGrid.js +4 -2
- package/lib/WebVideo/WebVideo.js +51 -13
- package/lib/WebVideo/utils/index.js +58 -0
- package/lib/baseExports.js +6 -0
- package/lib/utils/theming/with-client-theme.js +1 -1
- package/lib/utils/theming/with-server-theme.js +1 -1
- package/lib-module/Badge/Badge.js +4 -2
- package/lib-module/BlockQuote/BlockQuote.js +4 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +7 -5
- package/lib-module/Breadcrumbs/Item/Item.js +2 -11
- package/lib-module/Callout/Callout.js +4 -2
- package/lib-module/Card/Card.js +2 -3
- package/lib-module/Card/CardContent.js +4 -2
- package/lib-module/Countdown/Countdown.js +2 -3
- package/lib-module/Countdown/Segment.js +4 -2
- package/lib-module/DatePicker/CalendarContainer.js +2 -2
- package/lib-module/DatePicker/DatePicker.js +21 -33
- package/lib-module/Disclaimer/Disclaimer.js +4 -2
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +5 -9
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +4 -2
- package/lib-module/Footnote/Footnote.js +31 -36
- package/lib-module/Footnote/FootnoteLink.js +9 -7
- package/lib-module/IconButton/IconButton.js +4 -9
- package/lib-module/Image/Image.js +5 -3
- package/lib-module/List/ListItem.js +2 -5
- package/lib-module/NavigationBar/NavigationBar.js +9 -17
- package/lib-module/NavigationBar/NavigationItem.js +5 -8
- package/lib-module/NavigationBar/NavigationSubMenu.js +9 -6
- package/lib-module/NavigationBar/index.js +2 -0
- package/lib-module/OptimizeImage/OptimizeImage.js +8 -6
- package/lib-module/OrderedList/Item.js +3 -7
- package/lib-module/OrderedList/OrderedList.js +6 -12
- package/lib-module/OrderedList/OrderedListBase.js +3 -6
- package/lib-module/Paragraph/Paragraph.js +6 -4
- package/lib-module/PreviewCard/PreviewCard.js +2 -3
- package/lib-module/PriceLockup/PriceLockup.js +4 -2
- package/lib-module/Progress/ProgressBar.js +4 -2
- package/lib-module/QuantitySelector/QuantitySelector.js +22 -23
- package/lib-module/QuantitySelector/SideButton.js +13 -21
- package/lib-module/ResponsiveImage/ResponsiveImage.js +4 -2
- package/lib-module/Ribbon/Ribbon.js +4 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +5 -3
- package/lib-module/SkeletonProvider/SkeletonProvider.js +3 -3
- package/lib-module/SkeletonProvider/SkeletonTypography.js +5 -3
- package/lib-module/Span/Span.js +6 -4
- package/lib-module/Spinner/Spinner.js +4 -2
- package/lib-module/Spinner/SpinnerContent.js +4 -2
- package/lib-module/StoryCard/StoryCard.js +2 -3
- package/lib-module/Table/Body.js +4 -2
- package/lib-module/Table/Cell.js +5 -3
- package/lib-module/Table/Header.js +6 -4
- package/lib-module/Table/Row.js +6 -4
- package/lib-module/Table/SubHeading.js +6 -4
- package/lib-module/Table/Table.js +6 -6
- package/lib-module/TermsAndConditions/ExpandCollapse.js +2 -5
- package/lib-module/TermsAndConditions/TermsAndConditions.js +5 -12
- package/lib-module/Testimonial/Testimonial.js +4 -2
- package/lib-module/Toast/Toast.js +4 -2
- package/lib-module/Video/Video.js +19 -53
- package/lib-module/VideoPicker/VideoPicker.js +37 -8
- package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +4 -2
- package/lib-module/VideoPicker/VideoSlider.js +7 -5
- package/lib-module/WaffleGrid/WaffleGrid.js +4 -2
- package/lib-module/WebVideo/WebVideo.js +51 -11
- package/lib-module/WebVideo/utils/index.js +50 -0
- package/lib-module/baseExports.js +1 -1
- package/lib-module/utils/theming/with-client-theme.js +2 -2
- package/lib-module/utils/theming/with-server-theme.js +2 -2
- package/package.json +3 -3
- package/src/Badge/Badge.jsx +5 -2
- package/src/BlockQuote/BlockQuote.jsx +120 -112
- package/src/Breadcrumbs/Breadcrumbs.jsx +84 -77
- package/src/Breadcrumbs/Item/Item.jsx +2 -9
- package/src/Callout/Callout.jsx +37 -40
- package/src/Card/Card.jsx +2 -3
- package/src/Card/CardContent.jsx +19 -14
- package/src/Countdown/Countdown.jsx +72 -71
- package/src/Countdown/Segment.jsx +40 -28
- package/src/DatePicker/CalendarContainer.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +21 -34
- package/src/Disclaimer/Disclaimer.jsx +5 -3
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +37 -40
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +52 -44
- package/src/Footnote/Footnote.jsx +32 -38
- package/src/Footnote/FootnoteLink.jsx +45 -49
- package/src/IconButton/IconButton.jsx +19 -20
- package/src/Image/Image.jsx +40 -43
- package/src/List/ListItem.jsx +3 -5
- package/src/NavigationBar/NavigationBar.jsx +9 -18
- package/src/NavigationBar/NavigationItem.jsx +6 -5
- package/src/NavigationBar/NavigationSubMenu.jsx +104 -88
- package/src/NavigationBar/index.js +3 -0
- package/src/OptimizeImage/OptimizeImage.jsx +48 -41
- package/src/OrderedList/Item.jsx +34 -35
- package/src/OrderedList/OrderedList.jsx +4 -6
- package/src/OrderedList/OrderedListBase.jsx +2 -3
- package/src/Paragraph/Paragraph.jsx +21 -16
- package/src/PreviewCard/PreviewCard.jsx +2 -3
- package/src/PriceLockup/PriceLockup.jsx +143 -136
- package/src/Progress/ProgressBar.jsx +11 -3
- package/src/QuantitySelector/QuantitySelector.jsx +162 -154
- package/src/QuantitySelector/SideButton.jsx +52 -56
- package/src/ResponsiveImage/ResponsiveImage.jsx +16 -22
- package/src/Ribbon/Ribbon.jsx +85 -83
- package/src/SkeletonProvider/SkeletonImage.jsx +24 -15
- package/src/SkeletonProvider/SkeletonProvider.jsx +3 -3
- package/src/SkeletonProvider/SkeletonTypography.jsx +18 -13
- package/src/Span/Span.jsx +7 -5
- package/src/Spinner/Spinner.jsx +86 -79
- package/src/Spinner/SpinnerContent.jsx +31 -33
- package/src/StoryCard/StoryCard.jsx +2 -3
- package/src/Table/Body.jsx +5 -3
- package/src/Table/Cell.jsx +77 -67
- package/src/Table/Header.jsx +7 -5
- package/src/Table/Row.jsx +7 -5
- package/src/Table/SubHeading.jsx +7 -5
- package/src/Table/Table.jsx +6 -6
- package/src/TermsAndConditions/ExpandCollapse.jsx +2 -6
- package/src/TermsAndConditions/TermsAndConditions.jsx +5 -13
- package/src/Testimonial/Testimonial.jsx +148 -137
- package/src/Toast/Toast.jsx +68 -63
- package/src/Video/Video.jsx +25 -45
- package/src/VideoPicker/VideoPicker.jsx +114 -75
- package/src/VideoPicker/VideoPickerPlayer.jsx +13 -9
- package/src/VideoPicker/VideoPickerThumbnail.jsx +102 -94
- package/src/VideoPicker/VideoSlider.jsx +8 -6
- package/src/WaffleGrid/WaffleGrid.jsx +36 -40
- package/src/WebVideo/WebVideo.jsx +114 -60
- package/src/WebVideo/utils/index.js +56 -0
- package/src/baseExports.js +1 -0
- package/src/utils/theming/with-client-theme.jsx +2 -2
- package/src/utils/theming/with-server-theme.jsx +2 -2
- package/types/WebVideo.d.ts +2 -1
package/src/Ribbon/Ribbon.jsx
CHANGED
|
@@ -49,92 +49,94 @@ const RibbonCurve = styled.div`
|
|
|
49
49
|
}
|
|
50
50
|
`
|
|
51
51
|
|
|
52
|
-
const Ribbon = (
|
|
53
|
-
children,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
borderRadiusBottomLeft,
|
|
84
|
-
borderRadiusBottomRight,
|
|
85
|
-
fontName,
|
|
86
|
-
fontWeight,
|
|
87
|
-
fontSize,
|
|
88
|
-
lineHeight
|
|
89
|
-
} = useThemeTokens('Ribbon', tokens, { ...variant, wrap: shouldWrap })
|
|
52
|
+
const Ribbon = React.forwardRef(
|
|
53
|
+
({ children, tokens, wrap: shouldWrap = false, left, top, variant = {}, ...rest }, ref) => {
|
|
54
|
+
const {
|
|
55
|
+
backgroundColor,
|
|
56
|
+
borderRadius,
|
|
57
|
+
boxShadowPaddingBottom,
|
|
58
|
+
boxShadowPaddingLeft,
|
|
59
|
+
boxShadowPaddingRight,
|
|
60
|
+
boxShadowPaddingTop,
|
|
61
|
+
boxShadowColor,
|
|
62
|
+
curveAfterBackgroundColor,
|
|
63
|
+
curveAfterHeight,
|
|
64
|
+
curveAfterWidth,
|
|
65
|
+
curveBackgroundColor,
|
|
66
|
+
curveHeight,
|
|
67
|
+
curveAfterRadius,
|
|
68
|
+
curveWidth,
|
|
69
|
+
curveMarginTop,
|
|
70
|
+
paddingBottom,
|
|
71
|
+
paddingLeft,
|
|
72
|
+
paddingRight,
|
|
73
|
+
paddingTop,
|
|
74
|
+
gradient,
|
|
75
|
+
fontColor,
|
|
76
|
+
borderRadiusBottomLeft,
|
|
77
|
+
borderRadiusBottomRight,
|
|
78
|
+
fontName,
|
|
79
|
+
fontWeight,
|
|
80
|
+
fontSize,
|
|
81
|
+
lineHeight
|
|
82
|
+
} = useThemeTokens('Ribbon', tokens, { ...variant, wrap: shouldWrap })
|
|
90
83
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
boxShadow={`${boxShadowPaddingTop}px ${boxShadowPaddingRight}px ${boxShadowPaddingBottom}px ${boxShadowPaddingLeft}px ${boxShadowColor}`}
|
|
105
|
-
borderRadiusBottomLeft={`${borderRadiusBottomLeft}px`}
|
|
106
|
-
borderRadiusBottomRight={`${borderRadiusBottomRight}px`}
|
|
84
|
+
let background = backgroundColor
|
|
85
|
+
if (gradient) {
|
|
86
|
+
const { type: gradientType, angle: gradientAngle, stops: gradientColors } = gradient
|
|
87
|
+
const gradientBackground = `${gradientType}-gradient(${gradientAngle}deg, ${gradientColors[0].color}, ${gradientColors[1].color})`
|
|
88
|
+
background = gradientBackground
|
|
89
|
+
}
|
|
90
|
+
return (
|
|
91
|
+
<RibbonWrapper
|
|
92
|
+
left={left}
|
|
93
|
+
top={top}
|
|
94
|
+
data-testid="ribbon-wrapper"
|
|
95
|
+
ref={ref}
|
|
96
|
+
{...selectProps(rest)}
|
|
107
97
|
>
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}}
|
|
98
|
+
<RibbonContainer
|
|
99
|
+
shouldWrap={shouldWrap}
|
|
100
|
+
backgroundColor={background}
|
|
101
|
+
padding={`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`}
|
|
102
|
+
borderRadius={`${borderRadius}px`}
|
|
103
|
+
boxShadow={`${boxShadowPaddingTop}px ${boxShadowPaddingRight}px ${boxShadowPaddingBottom}px ${boxShadowPaddingLeft}px ${boxShadowColor}`}
|
|
104
|
+
borderRadiusBottomLeft={`${borderRadiusBottomLeft}px`}
|
|
105
|
+
borderRadiusBottomRight={`${borderRadiusBottomRight}px`}
|
|
117
106
|
>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
107
|
+
<Typography
|
|
108
|
+
variant={{ bold: true, inverse: true }}
|
|
109
|
+
tokens={{
|
|
110
|
+
color: fontColor,
|
|
111
|
+
fontName,
|
|
112
|
+
fontWeight,
|
|
113
|
+
fontSize,
|
|
114
|
+
lineHeight
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
{children}
|
|
118
|
+
</Typography>
|
|
119
|
+
</RibbonContainer>
|
|
120
|
+
{shouldWrap && (
|
|
121
|
+
<RibbonCurve
|
|
122
|
+
data-testid="ribbon-curve"
|
|
123
|
+
backgroundColor={backgroundColor}
|
|
124
|
+
curveMarginTop={`${curveMarginTop}px`}
|
|
125
|
+
curveWidth={`${curveWidth}px`}
|
|
126
|
+
curveHeight={`${curveHeight}px`}
|
|
127
|
+
curveBackgroundColor={curveBackgroundColor}
|
|
128
|
+
curveAfterRadius={`${curveAfterRadius}px`}
|
|
129
|
+
curveAfterWidth={`${curveAfterWidth}px`}
|
|
130
|
+
curveAfterHeight={`${curveAfterHeight}px`}
|
|
131
|
+
curveAfterBackgroundColor={curveAfterBackgroundColor}
|
|
132
|
+
/>
|
|
133
|
+
)}
|
|
134
|
+
</RibbonWrapper>
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
Ribbon.displayName = 'Ribbon'
|
|
138
140
|
|
|
139
141
|
Ribbon.propTypes = {
|
|
140
142
|
...selectedSystemPropTypes,
|
|
@@ -2,23 +2,32 @@ import React from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { Skeleton } from '@telus-uds/components-base'
|
|
4
4
|
|
|
5
|
-
const SkeletonImage = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
5
|
+
const SkeletonImage = React.forwardRef(
|
|
6
|
+
(
|
|
7
|
+
{
|
|
8
|
+
rounded,
|
|
9
|
+
imgHeight,
|
|
10
|
+
size,
|
|
11
|
+
sizeIndex,
|
|
12
|
+
// Size automatically from image height, unless any size prop is passed in
|
|
13
|
+
sizePixels = !(size || sizeIndex) ? imgHeight : undefined,
|
|
14
|
+
show,
|
|
15
|
+
children
|
|
16
|
+
},
|
|
17
|
+
ref
|
|
18
|
+
) => {
|
|
19
|
+
if (!show) {
|
|
20
|
+
return children
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const shape = rounded !== 'circle' ? 'box' : rounded
|
|
24
|
+
return (
|
|
25
|
+
<Skeleton size={size} sizePixels={sizePixels} sizeIndex={sizeIndex} shape={shape} ref={ref} />
|
|
26
|
+
)
|
|
17
27
|
}
|
|
28
|
+
)
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
return <Skeleton size={size} sizePixels={sizePixels} sizeIndex={sizeIndex} shape={shape} />
|
|
21
|
-
}
|
|
30
|
+
SkeletonImage.displayName = 'SkeletonImage'
|
|
22
31
|
|
|
23
32
|
SkeletonImage.propTypes = {
|
|
24
33
|
imgHeight: PropTypes.number,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { Typography } from '@telus-uds/components-base'
|
|
4
4
|
import Image from '../Image'
|
|
@@ -22,7 +22,7 @@ const SkeletonProvider = ({ children, show }) => {
|
|
|
22
22
|
const mappedChildren = Array.isArray(elementChildren)
|
|
23
23
|
? elementChildren.map(mapChild)
|
|
24
24
|
: mapChild(elementChildren)
|
|
25
|
-
childElement = cloneElement(childElement, {
|
|
25
|
+
childElement = React.cloneElement(childElement, {
|
|
26
26
|
children: mappedChildren
|
|
27
27
|
})
|
|
28
28
|
}
|
|
@@ -51,7 +51,7 @@ const SkeletonProvider = ({ children, show }) => {
|
|
|
51
51
|
return childElement
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
return <>{Children.map(children, mapChild)}</>
|
|
54
|
+
return <>{React.Children.map(children, mapChild)}</>
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
SkeletonProvider.propTypes = {
|
|
@@ -2,21 +2,26 @@ import React from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { Skeleton } from '@telus-uds/components-base'
|
|
4
4
|
|
|
5
|
-
const SkeletonTypography = (
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const SkeletonTypography = React.forwardRef(
|
|
6
|
+
({ show, size, sizeIndex, sizePixels, characters, lines, children }, ref) => {
|
|
7
|
+
if (!show) {
|
|
8
|
+
return children
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Skeleton
|
|
13
|
+
size={size}
|
|
14
|
+
sizeIndex={sizeIndex}
|
|
15
|
+
sizePixels={sizePixels}
|
|
16
|
+
characters={characters}
|
|
17
|
+
lines={lines}
|
|
18
|
+
ref={ref}
|
|
19
|
+
/>
|
|
20
|
+
)
|
|
8
21
|
}
|
|
22
|
+
)
|
|
9
23
|
|
|
10
|
-
|
|
11
|
-
<Skeleton
|
|
12
|
-
size={size}
|
|
13
|
-
sizeIndex={sizeIndex}
|
|
14
|
-
sizePixels={sizePixels}
|
|
15
|
-
characters={characters}
|
|
16
|
-
lines={lines}
|
|
17
|
-
/>
|
|
18
|
-
)
|
|
19
|
-
}
|
|
24
|
+
SkeletonTypography.displayName = 'SkeletonTypography'
|
|
20
25
|
|
|
21
26
|
SkeletonTypography.propTypes = {
|
|
22
27
|
show: PropTypes.bool.isRequired,
|
package/src/Span/Span.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
|
-
import { selectSystemProps } from '@telus-uds/components-base'
|
|
4
|
+
import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base'
|
|
5
5
|
|
|
6
6
|
import { htmlAttrs, useTypographyTheme } from '../utils'
|
|
7
7
|
|
|
@@ -15,14 +15,16 @@ const StyledSpan = styled.span`${({ flex }) => (flex ? 'display: inline-flex' :
|
|
|
15
15
|
* Span may be used in cases where an inline span or direct access to HTML attributes is required.
|
|
16
16
|
* In most cases, `Typography` should be used for text, or Paragraph for body text.
|
|
17
17
|
*/
|
|
18
|
-
const Span = ({ children, variant, tokens, testID, flex, ...rest }) => {
|
|
18
|
+
const Span = React.forwardRef(({ children, variant, tokens, testID, flex, ...rest }, ref) => {
|
|
19
19
|
const style = useTypographyTheme(variant, tokens)
|
|
20
20
|
return (
|
|
21
|
-
<StyledSpan data-testid={testID} flex={flex} style={style} {...selectProps(rest)}>
|
|
21
|
+
<StyledSpan data-testid={testID} flex={flex} style={style} ref={ref} {...selectProps(rest)}>
|
|
22
22
|
{children}
|
|
23
23
|
</StyledSpan>
|
|
24
24
|
)
|
|
25
|
-
}
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
Span.displayName = 'Span'
|
|
26
28
|
|
|
27
29
|
Span.propTypes = {
|
|
28
30
|
...selectedSystemPropTypes,
|
|
@@ -39,7 +41,7 @@ Span.propTypes = {
|
|
|
39
41
|
/**
|
|
40
42
|
* Span takes the same tokens overrides as Typography
|
|
41
43
|
*/
|
|
42
|
-
tokens:
|
|
44
|
+
tokens: getTokensPropType('Typography'),
|
|
43
45
|
/**
|
|
44
46
|
* Span can take any of Typography's theme variants
|
|
45
47
|
*/
|
package/src/Spinner/Spinner.jsx
CHANGED
|
@@ -64,100 +64,107 @@ const recursiveMap = (children, fn) =>
|
|
|
64
64
|
/**
|
|
65
65
|
* Loading indicator.
|
|
66
66
|
*/
|
|
67
|
-
const Spinner = (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
useScrollBlocking([fullScreen, show])
|
|
88
|
-
|
|
89
|
-
if (!show) {
|
|
90
|
-
return children ?? null
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Full screen spinner
|
|
94
|
-
if (fullScreen) {
|
|
95
|
-
return (
|
|
96
|
-
<Portal>
|
|
97
|
-
<FullscreenOverlay fullScreenOverLayBackground={fullScreenOverLayBackground}>
|
|
98
|
-
<SpinnerContainer
|
|
99
|
-
inline={inline}
|
|
100
|
-
fullScreen={fullScreen}
|
|
101
|
-
aria-live="assertive"
|
|
102
|
-
{...selectProps(rest)}
|
|
103
|
-
>
|
|
104
|
-
<SpinnerContent
|
|
105
|
-
label={label}
|
|
106
|
-
labelPosition={labelPosition}
|
|
107
|
-
overlay={true}
|
|
108
|
-
size={size}
|
|
109
|
-
thickness={thickness}
|
|
110
|
-
sizeVariant={sizeVariant}
|
|
111
|
-
isStatic={isStatic}
|
|
112
|
-
/>
|
|
113
|
-
</SpinnerContainer>
|
|
114
|
-
</FullscreenOverlay>
|
|
115
|
-
</Portal>
|
|
67
|
+
const Spinner = React.forwardRef(
|
|
68
|
+
(
|
|
69
|
+
{
|
|
70
|
+
children,
|
|
71
|
+
fullScreen = false,
|
|
72
|
+
inline = false,
|
|
73
|
+
label,
|
|
74
|
+
labelPosition,
|
|
75
|
+
show = false,
|
|
76
|
+
isStatic = false,
|
|
77
|
+
tokens,
|
|
78
|
+
variant = {},
|
|
79
|
+
...rest
|
|
80
|
+
},
|
|
81
|
+
ref
|
|
82
|
+
) => {
|
|
83
|
+
const { fullScreenOverLayBackground, size, thickness } = useThemeTokens(
|
|
84
|
+
'Spinner',
|
|
85
|
+
tokens,
|
|
86
|
+
variant
|
|
116
87
|
)
|
|
117
|
-
}
|
|
118
88
|
|
|
119
|
-
|
|
120
|
-
|
|
89
|
+
const { size: sizeVariant = 'large' } = variant
|
|
90
|
+
|
|
91
|
+
useScrollBlocking([fullScreen, show])
|
|
92
|
+
|
|
93
|
+
if (!show) {
|
|
94
|
+
return children ?? null
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Full screen spinner
|
|
98
|
+
if (fullScreen) {
|
|
99
|
+
return (
|
|
100
|
+
<Portal>
|
|
101
|
+
<FullscreenOverlay fullScreenOverLayBackground={fullScreenOverLayBackground}>
|
|
102
|
+
<SpinnerContainer
|
|
103
|
+
inline={inline}
|
|
104
|
+
fullScreen={fullScreen}
|
|
105
|
+
aria-live="assertive"
|
|
106
|
+
{...selectProps(rest)}
|
|
107
|
+
>
|
|
108
|
+
<SpinnerContent
|
|
109
|
+
label={label}
|
|
110
|
+
labelPosition={labelPosition}
|
|
111
|
+
overlay={true}
|
|
112
|
+
size={size}
|
|
113
|
+
thickness={thickness}
|
|
114
|
+
sizeVariant={sizeVariant}
|
|
115
|
+
isStatic={isStatic}
|
|
116
|
+
/>
|
|
117
|
+
</SpinnerContainer>
|
|
118
|
+
</FullscreenOverlay>
|
|
119
|
+
</Portal>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Overlay spinner
|
|
124
|
+
if (children) {
|
|
125
|
+
return (
|
|
126
|
+
<SpinnerContainer inline={inline} aria-live="assertive" {...selectProps(rest)}>
|
|
127
|
+
<SpinnerContent
|
|
128
|
+
label={label}
|
|
129
|
+
labelPosition={labelPosition}
|
|
130
|
+
overlay={true}
|
|
131
|
+
size={size}
|
|
132
|
+
thickness={thickness}
|
|
133
|
+
sizeVariant={sizeVariant}
|
|
134
|
+
isStatic={isStatic}
|
|
135
|
+
/>
|
|
136
|
+
|
|
137
|
+
<ContentOverlay />
|
|
138
|
+
|
|
139
|
+
<OpaqueContainer inert="true">
|
|
140
|
+
{recursiveMap(children, (c) => {
|
|
141
|
+
if (c) {
|
|
142
|
+
return React.cloneElement(c, { tabIndex: '-1', 'aria-hidden': 'true' })
|
|
143
|
+
}
|
|
144
|
+
return undefined
|
|
145
|
+
})}
|
|
146
|
+
</OpaqueContainer>
|
|
147
|
+
</SpinnerContainer>
|
|
148
|
+
)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Standalone spinner
|
|
121
152
|
return (
|
|
122
|
-
<SpinnerContainer
|
|
153
|
+
<SpinnerContainer ref={ref} {...selectProps(rest)}>
|
|
123
154
|
<SpinnerContent
|
|
124
155
|
label={label}
|
|
125
156
|
labelPosition={labelPosition}
|
|
126
|
-
overlay={true}
|
|
127
157
|
size={size}
|
|
128
158
|
thickness={thickness}
|
|
129
159
|
sizeVariant={sizeVariant}
|
|
130
160
|
isStatic={isStatic}
|
|
131
161
|
/>
|
|
132
|
-
|
|
133
|
-
<ContentOverlay />
|
|
134
|
-
|
|
135
|
-
<OpaqueContainer inert="true">
|
|
136
|
-
{recursiveMap(children, (c) => {
|
|
137
|
-
if (c) {
|
|
138
|
-
return React.cloneElement(c, { tabIndex: '-1', 'aria-hidden': 'true' })
|
|
139
|
-
}
|
|
140
|
-
return undefined
|
|
141
|
-
})}
|
|
142
|
-
</OpaqueContainer>
|
|
143
162
|
</SpinnerContainer>
|
|
144
163
|
)
|
|
145
164
|
}
|
|
165
|
+
)
|
|
146
166
|
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<SpinnerContainer {...selectProps(rest)}>
|
|
150
|
-
<SpinnerContent
|
|
151
|
-
label={label}
|
|
152
|
-
labelPosition={labelPosition}
|
|
153
|
-
size={size}
|
|
154
|
-
thickness={thickness}
|
|
155
|
-
sizeVariant={sizeVariant}
|
|
156
|
-
isStatic={isStatic}
|
|
157
|
-
/>
|
|
158
|
-
</SpinnerContainer>
|
|
159
|
-
)
|
|
160
|
-
}
|
|
167
|
+
Spinner.displayName = 'Spinner'
|
|
161
168
|
|
|
162
169
|
Spinner.propTypes = {
|
|
163
170
|
...selectedSystemPropTypes,
|
|
@@ -25,41 +25,39 @@ const Container = styled.div(({ overlay }) => ({
|
|
|
25
25
|
})
|
|
26
26
|
}))
|
|
27
27
|
|
|
28
|
-
const SpinnerContent = (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
const SpinnerContent = React.forwardRef(
|
|
29
|
+
(
|
|
30
|
+
{ label, labelPosition, overlay = false, sizeVariant, size, thickness, isStatic, ...rest },
|
|
31
|
+
ref
|
|
32
|
+
) => {
|
|
33
|
+
const labelMapping = {
|
|
34
|
+
top: 'column-reverse',
|
|
35
|
+
bottom: 'column',
|
|
36
|
+
left: 'row-reverse',
|
|
37
|
+
right: 'row'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Container overlay={overlay} ref={ref}>
|
|
42
|
+
<StackView
|
|
43
|
+
space={3}
|
|
44
|
+
tokens={{ alignItems: 'center' }}
|
|
45
|
+
direction={labelMapping[labelPosition]}
|
|
46
|
+
>
|
|
47
|
+
<ActivityIndicator
|
|
48
|
+
label={label}
|
|
49
|
+
tokens={{ size, thickness }}
|
|
50
|
+
isStatic={isStatic}
|
|
51
|
+
{...selectProps(rest)}
|
|
52
|
+
/>
|
|
53
|
+
{sizeVariant === LARGE && <Typography>{label}</Typography>}
|
|
54
|
+
</StackView>
|
|
55
|
+
</Container>
|
|
56
|
+
)
|
|
43
57
|
}
|
|
58
|
+
)
|
|
44
59
|
|
|
45
|
-
|
|
46
|
-
<Container overlay={overlay}>
|
|
47
|
-
<StackView
|
|
48
|
-
space={3}
|
|
49
|
-
tokens={{ alignItems: 'center' }}
|
|
50
|
-
direction={labelMapping[labelPosition]}
|
|
51
|
-
>
|
|
52
|
-
<ActivityIndicator
|
|
53
|
-
label={label}
|
|
54
|
-
tokens={{ size, thickness }}
|
|
55
|
-
isStatic={isStatic}
|
|
56
|
-
{...selectProps(rest)}
|
|
57
|
-
/>
|
|
58
|
-
{sizeVariant === LARGE && <Typography>{label}</Typography>}
|
|
59
|
-
</StackView>
|
|
60
|
-
</Container>
|
|
61
|
-
)
|
|
62
|
-
}
|
|
60
|
+
SpinnerContent.displayName = 'SpinnerContent'
|
|
63
61
|
|
|
64
62
|
SpinnerContent.propTypes = {
|
|
65
63
|
...selectedSystemPropTypes,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
1
|
+
import React from 'react'
|
|
3
2
|
import PropTypes from 'prop-types'
|
|
4
3
|
import {
|
|
5
4
|
Box,
|
|
@@ -54,7 +53,7 @@ const FullBleedOffsetInner = styled.div(({ borderOffset }) => ({
|
|
|
54
53
|
* - Use `href` to set the target URL
|
|
55
54
|
* - Use `fullBleedContent` to set the thumbnail image
|
|
56
55
|
*/
|
|
57
|
-
const StoryCard = forwardRef(
|
|
56
|
+
const StoryCard = React.forwardRef(
|
|
58
57
|
(
|
|
59
58
|
{
|
|
60
59
|
tag,
|
package/src/Table/Body.jsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
|
|
4
|
-
const Body = ({ children }) => {
|
|
5
|
-
return <tbody>{children}</tbody>
|
|
6
|
-
}
|
|
4
|
+
const Body = React.forwardRef(({ children }, ref) => {
|
|
5
|
+
return <tbody ref={ref}>{children}</tbody>
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
Body.displayName = 'Body'
|
|
7
9
|
|
|
8
10
|
Body.propTypes = {
|
|
9
11
|
children: PropTypes.node
|