@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.
Files changed (192) hide show
  1. package/CHANGELOG.md +29 -3
  2. package/lib/Badge/Badge.js +4 -2
  3. package/lib/BlockQuote/BlockQuote.js +4 -2
  4. package/lib/Breadcrumbs/Breadcrumbs.js +7 -5
  5. package/lib/Breadcrumbs/Item/Item.js +2 -13
  6. package/lib/Callout/Callout.js +4 -2
  7. package/lib/Card/Card.js +3 -5
  8. package/lib/Card/CardContent.js +4 -2
  9. package/lib/Countdown/Countdown.js +2 -6
  10. package/lib/Countdown/Segment.js +4 -2
  11. package/lib/DatePicker/CalendarContainer.js +2 -2
  12. package/lib/DatePicker/DatePicker.js +21 -35
  13. package/lib/Disclaimer/Disclaimer.js +4 -2
  14. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +5 -11
  15. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +4 -2
  16. package/lib/Footnote/Footnote.js +32 -37
  17. package/lib/Footnote/FootnoteLink.js +9 -6
  18. package/lib/IconButton/IconButton.js +4 -11
  19. package/lib/Image/Image.js +5 -3
  20. package/lib/List/ListItem.js +2 -7
  21. package/lib/NavigationBar/NavigationBar.js +8 -18
  22. package/lib/NavigationBar/NavigationItem.js +4 -9
  23. package/lib/NavigationBar/NavigationSubMenu.js +8 -7
  24. package/lib/NavigationBar/index.js +2 -0
  25. package/lib/OptimizeImage/OptimizeImage.js +8 -8
  26. package/lib/OrderedList/Item.js +3 -9
  27. package/lib/OrderedList/OrderedList.js +5 -13
  28. package/lib/OrderedList/OrderedListBase.js +3 -8
  29. package/lib/Paragraph/Paragraph.js +5 -3
  30. package/lib/PreviewCard/PreviewCard.js +3 -5
  31. package/lib/PriceLockup/PriceLockup.js +4 -2
  32. package/lib/Progress/ProgressBar.js +4 -2
  33. package/lib/QuantitySelector/QuantitySelector.js +21 -24
  34. package/lib/QuantitySelector/SideButton.js +12 -20
  35. package/lib/ResponsiveImage/ResponsiveImage.js +4 -2
  36. package/lib/Ribbon/Ribbon.js +4 -2
  37. package/lib/SkeletonProvider/SkeletonImage.js +5 -3
  38. package/lib/SkeletonProvider/SkeletonProvider.js +3 -5
  39. package/lib/SkeletonProvider/SkeletonTypography.js +5 -3
  40. package/lib/Span/Span.js +5 -3
  41. package/lib/Spinner/Spinner.js +4 -2
  42. package/lib/Spinner/SpinnerContent.js +4 -2
  43. package/lib/StoryCard/StoryCard.js +3 -5
  44. package/lib/Table/Body.js +4 -2
  45. package/lib/Table/Cell.js +5 -3
  46. package/lib/Table/Header.js +6 -6
  47. package/lib/Table/Row.js +6 -6
  48. package/lib/Table/SubHeading.js +6 -6
  49. package/lib/Table/Table.js +6 -8
  50. package/lib/TermsAndConditions/ExpandCollapse.js +2 -7
  51. package/lib/TermsAndConditions/TermsAndConditions.js +5 -14
  52. package/lib/Testimonial/Testimonial.js +4 -2
  53. package/lib/Toast/Toast.js +4 -2
  54. package/lib/Video/Video.js +19 -55
  55. package/lib/VideoPicker/VideoPicker.js +38 -9
  56. package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
  57. package/lib/VideoPicker/VideoPickerThumbnail.js +4 -2
  58. package/lib/VideoPicker/VideoSlider.js +7 -7
  59. package/lib/WaffleGrid/WaffleGrid.js +4 -2
  60. package/lib/WebVideo/WebVideo.js +51 -13
  61. package/lib/WebVideo/utils/index.js +58 -0
  62. package/lib/baseExports.js +6 -0
  63. package/lib/utils/theming/with-client-theme.js +1 -1
  64. package/lib/utils/theming/with-server-theme.js +1 -1
  65. package/lib-module/Badge/Badge.js +4 -2
  66. package/lib-module/BlockQuote/BlockQuote.js +4 -2
  67. package/lib-module/Breadcrumbs/Breadcrumbs.js +7 -5
  68. package/lib-module/Breadcrumbs/Item/Item.js +2 -11
  69. package/lib-module/Callout/Callout.js +4 -2
  70. package/lib-module/Card/Card.js +2 -3
  71. package/lib-module/Card/CardContent.js +4 -2
  72. package/lib-module/Countdown/Countdown.js +2 -3
  73. package/lib-module/Countdown/Segment.js +4 -2
  74. package/lib-module/DatePicker/CalendarContainer.js +2 -2
  75. package/lib-module/DatePicker/DatePicker.js +21 -33
  76. package/lib-module/Disclaimer/Disclaimer.js +4 -2
  77. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +5 -9
  78. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +4 -2
  79. package/lib-module/Footnote/Footnote.js +31 -36
  80. package/lib-module/Footnote/FootnoteLink.js +9 -7
  81. package/lib-module/IconButton/IconButton.js +4 -9
  82. package/lib-module/Image/Image.js +5 -3
  83. package/lib-module/List/ListItem.js +2 -5
  84. package/lib-module/NavigationBar/NavigationBar.js +9 -17
  85. package/lib-module/NavigationBar/NavigationItem.js +5 -8
  86. package/lib-module/NavigationBar/NavigationSubMenu.js +9 -6
  87. package/lib-module/NavigationBar/index.js +2 -0
  88. package/lib-module/OptimizeImage/OptimizeImage.js +8 -6
  89. package/lib-module/OrderedList/Item.js +3 -7
  90. package/lib-module/OrderedList/OrderedList.js +6 -12
  91. package/lib-module/OrderedList/OrderedListBase.js +3 -6
  92. package/lib-module/Paragraph/Paragraph.js +6 -4
  93. package/lib-module/PreviewCard/PreviewCard.js +2 -3
  94. package/lib-module/PriceLockup/PriceLockup.js +4 -2
  95. package/lib-module/Progress/ProgressBar.js +4 -2
  96. package/lib-module/QuantitySelector/QuantitySelector.js +22 -23
  97. package/lib-module/QuantitySelector/SideButton.js +13 -21
  98. package/lib-module/ResponsiveImage/ResponsiveImage.js +4 -2
  99. package/lib-module/Ribbon/Ribbon.js +4 -2
  100. package/lib-module/SkeletonProvider/SkeletonImage.js +5 -3
  101. package/lib-module/SkeletonProvider/SkeletonProvider.js +3 -3
  102. package/lib-module/SkeletonProvider/SkeletonTypography.js +5 -3
  103. package/lib-module/Span/Span.js +6 -4
  104. package/lib-module/Spinner/Spinner.js +4 -2
  105. package/lib-module/Spinner/SpinnerContent.js +4 -2
  106. package/lib-module/StoryCard/StoryCard.js +2 -3
  107. package/lib-module/Table/Body.js +4 -2
  108. package/lib-module/Table/Cell.js +5 -3
  109. package/lib-module/Table/Header.js +6 -4
  110. package/lib-module/Table/Row.js +6 -4
  111. package/lib-module/Table/SubHeading.js +6 -4
  112. package/lib-module/Table/Table.js +6 -6
  113. package/lib-module/TermsAndConditions/ExpandCollapse.js +2 -5
  114. package/lib-module/TermsAndConditions/TermsAndConditions.js +5 -12
  115. package/lib-module/Testimonial/Testimonial.js +4 -2
  116. package/lib-module/Toast/Toast.js +4 -2
  117. package/lib-module/Video/Video.js +19 -53
  118. package/lib-module/VideoPicker/VideoPicker.js +37 -8
  119. package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
  120. package/lib-module/VideoPicker/VideoPickerThumbnail.js +4 -2
  121. package/lib-module/VideoPicker/VideoSlider.js +7 -5
  122. package/lib-module/WaffleGrid/WaffleGrid.js +4 -2
  123. package/lib-module/WebVideo/WebVideo.js +51 -11
  124. package/lib-module/WebVideo/utils/index.js +50 -0
  125. package/lib-module/baseExports.js +1 -1
  126. package/lib-module/utils/theming/with-client-theme.js +2 -2
  127. package/lib-module/utils/theming/with-server-theme.js +2 -2
  128. package/package.json +3 -3
  129. package/src/Badge/Badge.jsx +5 -2
  130. package/src/BlockQuote/BlockQuote.jsx +120 -112
  131. package/src/Breadcrumbs/Breadcrumbs.jsx +84 -77
  132. package/src/Breadcrumbs/Item/Item.jsx +2 -9
  133. package/src/Callout/Callout.jsx +37 -40
  134. package/src/Card/Card.jsx +2 -3
  135. package/src/Card/CardContent.jsx +19 -14
  136. package/src/Countdown/Countdown.jsx +72 -71
  137. package/src/Countdown/Segment.jsx +40 -28
  138. package/src/DatePicker/CalendarContainer.jsx +2 -2
  139. package/src/DatePicker/DatePicker.jsx +21 -34
  140. package/src/Disclaimer/Disclaimer.jsx +5 -3
  141. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +37 -40
  142. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +52 -44
  143. package/src/Footnote/Footnote.jsx +32 -38
  144. package/src/Footnote/FootnoteLink.jsx +45 -49
  145. package/src/IconButton/IconButton.jsx +19 -20
  146. package/src/Image/Image.jsx +40 -43
  147. package/src/List/ListItem.jsx +3 -5
  148. package/src/NavigationBar/NavigationBar.jsx +9 -18
  149. package/src/NavigationBar/NavigationItem.jsx +6 -5
  150. package/src/NavigationBar/NavigationSubMenu.jsx +104 -88
  151. package/src/NavigationBar/index.js +3 -0
  152. package/src/OptimizeImage/OptimizeImage.jsx +48 -41
  153. package/src/OrderedList/Item.jsx +34 -35
  154. package/src/OrderedList/OrderedList.jsx +4 -6
  155. package/src/OrderedList/OrderedListBase.jsx +2 -3
  156. package/src/Paragraph/Paragraph.jsx +21 -16
  157. package/src/PreviewCard/PreviewCard.jsx +2 -3
  158. package/src/PriceLockup/PriceLockup.jsx +143 -136
  159. package/src/Progress/ProgressBar.jsx +11 -3
  160. package/src/QuantitySelector/QuantitySelector.jsx +162 -154
  161. package/src/QuantitySelector/SideButton.jsx +52 -56
  162. package/src/ResponsiveImage/ResponsiveImage.jsx +16 -22
  163. package/src/Ribbon/Ribbon.jsx +85 -83
  164. package/src/SkeletonProvider/SkeletonImage.jsx +24 -15
  165. package/src/SkeletonProvider/SkeletonProvider.jsx +3 -3
  166. package/src/SkeletonProvider/SkeletonTypography.jsx +18 -13
  167. package/src/Span/Span.jsx +7 -5
  168. package/src/Spinner/Spinner.jsx +86 -79
  169. package/src/Spinner/SpinnerContent.jsx +31 -33
  170. package/src/StoryCard/StoryCard.jsx +2 -3
  171. package/src/Table/Body.jsx +5 -3
  172. package/src/Table/Cell.jsx +77 -67
  173. package/src/Table/Header.jsx +7 -5
  174. package/src/Table/Row.jsx +7 -5
  175. package/src/Table/SubHeading.jsx +7 -5
  176. package/src/Table/Table.jsx +6 -6
  177. package/src/TermsAndConditions/ExpandCollapse.jsx +2 -6
  178. package/src/TermsAndConditions/TermsAndConditions.jsx +5 -13
  179. package/src/Testimonial/Testimonial.jsx +148 -137
  180. package/src/Toast/Toast.jsx +68 -63
  181. package/src/Video/Video.jsx +25 -45
  182. package/src/VideoPicker/VideoPicker.jsx +114 -75
  183. package/src/VideoPicker/VideoPickerPlayer.jsx +13 -9
  184. package/src/VideoPicker/VideoPickerThumbnail.jsx +102 -94
  185. package/src/VideoPicker/VideoSlider.jsx +8 -6
  186. package/src/WaffleGrid/WaffleGrid.jsx +36 -40
  187. package/src/WebVideo/WebVideo.jsx +114 -60
  188. package/src/WebVideo/utils/index.js +56 -0
  189. package/src/baseExports.js +1 -0
  190. package/src/utils/theming/with-client-theme.jsx +2 -2
  191. package/src/utils/theming/with-server-theme.jsx +2 -2
  192. package/types/WebVideo.d.ts +2 -1
@@ -49,92 +49,94 @@ const RibbonCurve = styled.div`
49
49
  }
50
50
  `
51
51
 
52
- const Ribbon = ({
53
- children,
54
- tokens,
55
- wrap: shouldWrap = false,
56
- left,
57
- top,
58
- variant = {},
59
- ...rest
60
- }) => {
61
- const {
62
- backgroundColor,
63
- borderRadius,
64
- boxShadowPaddingBottom,
65
- boxShadowPaddingLeft,
66
- boxShadowPaddingRight,
67
- boxShadowPaddingTop,
68
- boxShadowColor,
69
- curveAfterBackgroundColor,
70
- curveAfterHeight,
71
- curveAfterWidth,
72
- curveBackgroundColor,
73
- curveHeight,
74
- curveAfterRadius,
75
- curveWidth,
76
- curveMarginTop,
77
- paddingBottom,
78
- paddingLeft,
79
- paddingRight,
80
- paddingTop,
81
- gradient,
82
- fontColor,
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
- let background = backgroundColor
92
- if (gradient) {
93
- const { type: gradientType, angle: gradientAngle, stops: gradientColors } = gradient
94
- const gradientBackground = `${gradientType}-gradient(${gradientAngle}deg, ${gradientColors[0].color}, ${gradientColors[1].color})`
95
- background = gradientBackground
96
- }
97
- return (
98
- <RibbonWrapper left={left} top={top} data-testid="ribbon-wrapper" {...selectProps(rest)}>
99
- <RibbonContainer
100
- shouldWrap={shouldWrap}
101
- backgroundColor={background}
102
- padding={`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`}
103
- borderRadius={`${borderRadius}px`}
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
- <Typography
109
- variant={{ bold: true, inverse: true }}
110
- tokens={{
111
- color: fontColor,
112
- fontName,
113
- fontWeight,
114
- fontSize,
115
- lineHeight
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
- {children}
119
- </Typography>
120
- </RibbonContainer>
121
- {shouldWrap && (
122
- <RibbonCurve
123
- data-testid="ribbon-curve"
124
- backgroundColor={backgroundColor}
125
- curveMarginTop={`${curveMarginTop}px`}
126
- curveWidth={`${curveWidth}px`}
127
- curveHeight={`${curveHeight}px`}
128
- curveBackgroundColor={curveBackgroundColor}
129
- curveAfterRadius={`${curveAfterRadius}px`}
130
- curveAfterWidth={`${curveAfterWidth}px`}
131
- curveAfterHeight={`${curveAfterHeight}px`}
132
- curveAfterBackgroundColor={curveAfterBackgroundColor}
133
- />
134
- )}
135
- </RibbonWrapper>
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
- rounded,
7
- imgHeight,
8
- size,
9
- sizeIndex,
10
- // Size automatically from image height, unless any size prop is passed in
11
- sizePixels = !(size || sizeIndex) ? imgHeight : undefined,
12
- show,
13
- children
14
- }) => {
15
- if (!show) {
16
- return children
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
- const shape = rounded !== 'circle' ? 'box' : rounded
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, { Children, cloneElement } from '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 = ({ show, size, sizeIndex, sizePixels, characters, lines, children }) => {
6
- if (!show) {
7
- return children
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
- return (
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: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
44
+ tokens: getTokensPropType('Typography'),
43
45
  /**
44
46
  * Span can take any of Typography's theme variants
45
47
  */
@@ -64,100 +64,107 @@ const recursiveMap = (children, fn) =>
64
64
  /**
65
65
  * Loading indicator.
66
66
  */
67
- const Spinner = ({
68
- children,
69
- fullScreen = false,
70
- inline = false,
71
- label,
72
- labelPosition,
73
- show = false,
74
- isStatic = false,
75
- tokens,
76
- variant = {},
77
- ...rest
78
- }) => {
79
- const { fullScreenOverLayBackground, size, thickness } = useThemeTokens(
80
- 'Spinner',
81
- tokens,
82
- variant
83
- )
84
-
85
- const { size: sizeVariant = 'large' } = variant
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
- // Overlay spinner
120
- if (children) {
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 inline={inline} aria-live="assertive" {...selectProps(rest)}>
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
- // Standalone spinner
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
- label,
30
- labelPosition,
31
- overlay = false,
32
- sizeVariant,
33
- size,
34
- thickness,
35
- isStatic,
36
- ...rest
37
- }) => {
38
- const labelMapping = {
39
- top: 'column-reverse',
40
- bottom: 'column',
41
- left: 'row-reverse',
42
- right: 'row'
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
- return (
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
- /* eslint-disable react/require-default-props */
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,
@@ -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