@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
@@ -102,91 +102,98 @@ const getStructuredData = (items, baseUrl) => {
102
102
  /**
103
103
  * Display a hierarchy of links, commonly used for navigation.
104
104
  */
105
- const Breadcrumbs = ({
106
- baseUrl,
107
- children,
108
- linkRouterProps,
109
- params = {},
110
- tokens,
111
- routes,
112
- variant,
113
- LinkRouter,
114
- ...rest
115
- }) => {
116
- // React Helmet can cause a memory leak in SSR if not properly configured.
117
- // Only run it in SSR if theme options tells us to.
118
- /* const {
105
+ const Breadcrumbs = React.forwardRef(
106
+ (
107
+ {
108
+ baseUrl,
109
+ children,
110
+ linkRouterProps,
111
+ params = {},
112
+ tokens,
113
+ routes,
114
+ variant,
115
+ LinkRouter,
116
+ ...rest
117
+ },
118
+ ref
119
+ ) => {
120
+ // React Helmet can cause a memory leak in SSR if not properly configured.
121
+ // Only run it in SSR if theme options tells us to.
122
+ /* const {
119
123
  themeOptions: { enableHelmetSSR }
120
124
  } = useTheme() */
121
- // const isHydrating = useHydrationContext()
122
- // const isSSR = typeof window === 'undefined' || isHydrating
123
- // const hasMetadata = isSSR ? enableHelmetSSR : true
124
- const helmetContext = {}
125
-
126
- const activeRoutes = children
127
- ? React.Children.map(
128
- unpackFragment(children),
129
- ({ props: { href, children: breadcrumbName, ...itemRest }, ref }) => ({
130
- path: href,
131
- breadcrumbName,
132
- ref,
133
- ...itemRest
134
- })
135
- )
136
- : routes.filter((route) => route.path && route.breadcrumbName)
137
-
138
- const items = getItems(activeRoutes, params, !children)
139
- const themeTokens = useThemeTokens('Breadcrumbs', tokens, variant)
140
-
141
- const metadata = (
142
- <HelmetProvider context={helmetContext}>
143
- <Helmet>
144
- <script type="application/ld+json">
145
- {`
125
+ // const isHydrating = useHydrationContext()
126
+ // const isSSR = typeof window === 'undefined' || isHydrating
127
+ // const hasMetadata = isSSR ? enableHelmetSSR : true
128
+ const helmetContext = {}
129
+
130
+ const activeRoutes = children
131
+ ? React.Children.map(
132
+ unpackFragment(children),
133
+ ({ props: { href, children: breadcrumbName, ...itemRest }, ref: routeRef }) => ({
134
+ path: href,
135
+ breadcrumbName,
136
+ routeRef,
137
+ ...itemRest
138
+ })
139
+ )
140
+ : routes.filter((route) => route.path && route.breadcrumbName)
141
+
142
+ const items = getItems(activeRoutes, params, !children)
143
+ const themeTokens = useThemeTokens('Breadcrumbs', tokens, variant)
144
+
145
+ const metadata = (
146
+ <HelmetProvider context={helmetContext}>
147
+ <Helmet>
148
+ <script type="application/ld+json">
149
+ {`
146
150
  {
147
151
  "@context": "http://schema.org",
148
152
  "@type": "BreadcrumbList",
149
153
  "itemListElement": ${JSON.stringify(getStructuredData(items, baseUrl))}
150
154
  }
151
155
  `}
152
- </script>
153
- </Helmet>
154
- </HelmetProvider>
155
- )
156
-
157
- return (
158
- <nav aria-label="Breadcrumb" {...selectProps(rest)}>
159
- <StyledList iconContainerSize={themeTokens.iconContainerSize}>
160
- {items.map(
161
- ({
162
- href,
163
- current,
164
- breadcrumbName,
165
- LinkRouter: ItemLinkRouter = LinkRouter,
166
- linkRouterProps: itemLinkRouterProps,
167
- ...itemRest
168
- }) => {
169
- return (
170
- <Item
171
- {...itemRest}
172
- current={current}
173
- href={href}
174
- tokens={tokens}
175
- key={href}
176
- linkRouterProps={{ ...linkRouterProps, ...itemLinkRouterProps }}
177
- variant={{ ...variant, size: 'micro' }}
178
- LinkRouter={ItemLinkRouter}
179
- >
180
- {breadcrumbName}
181
- </Item>
182
- )
183
- }
184
- )}
185
- </StyledList>
186
- {metadata}
187
- </nav>
188
- )
189
- }
156
+ </script>
157
+ </Helmet>
158
+ </HelmetProvider>
159
+ )
160
+
161
+ return (
162
+ <nav aria-label="Breadcrumb" ref={ref} {...selectProps(rest)}>
163
+ <StyledList iconContainerSize={themeTokens.iconContainerSize}>
164
+ {items.map(
165
+ ({
166
+ href,
167
+ current,
168
+ breadcrumbName,
169
+ LinkRouter: ItemLinkRouter = LinkRouter,
170
+ linkRouterProps: itemLinkRouterProps,
171
+ ...itemRest
172
+ }) => {
173
+ return (
174
+ <Item
175
+ {...itemRest}
176
+ current={current}
177
+ href={href}
178
+ tokens={tokens}
179
+ key={href}
180
+ linkRouterProps={{ ...linkRouterProps, ...itemLinkRouterProps }}
181
+ variant={{ ...variant, size: 'micro' }}
182
+ LinkRouter={ItemLinkRouter}
183
+ >
184
+ {breadcrumbName}
185
+ </Item>
186
+ )
187
+ }
188
+ )}
189
+ </StyledList>
190
+ {metadata}
191
+ </nav>
192
+ )
193
+ }
194
+ )
195
+
196
+ Breadcrumbs.displayName = 'Breadcrumbs'
190
197
 
191
198
  Breadcrumbs.propTypes = {
192
199
  ...selectedSystemPropTypes,
@@ -1,4 +1,4 @@
1
- import React, { forwardRef } from 'react'
1
+ import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styled from 'styled-components'
4
4
  import {
@@ -32,7 +32,7 @@ const IconContainer = styled.span({
32
32
  width: ({ iconContainerSize, iconPadding }) => `${iconContainerSize + iconPadding * 2}px`
33
33
  })
34
34
 
35
- const Item = forwardRef(
35
+ const Item = React.forwardRef(
36
36
  (
37
37
  {
38
38
  href,
@@ -134,11 +134,4 @@ Item.propTypes = {
134
134
  variant: PropTypes.shape({ inverse: PropTypes.bool })
135
135
  }
136
136
 
137
- // Since react/require-default-props eslint rule doesn't pick up default arguments as default props when combined with `forwardRef`
138
- // - probably related https://github.com/yannickcr/eslint-plugin-react/issues/2760
139
- Item.defaultProps = {
140
- current: false,
141
- variant: { light: true }
142
- }
143
-
144
137
  export default Item
@@ -52,48 +52,45 @@ const CalloutContainer = styled.div(
52
52
  })
53
53
  )
54
54
 
55
- const Callout = ({
56
- icon,
57
- children,
58
- verticalAlign,
59
- textAlignToFlex,
60
- tokens,
61
- variant = {},
62
- ...rest
63
- }) => {
64
- const {
65
- background,
66
- gap,
67
- borderRadius,
68
- paddingLeft,
69
- paddingRight,
70
- paddingTop,
71
- paddingBottom,
72
- color
73
- } = useThemeTokens('Callout', tokens, variant)
55
+ const Callout = React.forwardRef(
56
+ ({ icon, children, verticalAlign, textAlignToFlex, tokens, variant = {}, ...rest }, ref) => {
57
+ const {
58
+ background,
59
+ gap,
60
+ borderRadius,
61
+ paddingLeft,
62
+ paddingRight,
63
+ paddingTop,
64
+ paddingBottom,
65
+ color
66
+ } = useThemeTokens('Callout', tokens, variant)
74
67
 
75
- const { rounded = false, size = 'medium' } = variant
68
+ const { rounded = false, size = 'medium' } = variant
76
69
 
77
- return (
78
- <CalloutContainer
79
- size={size}
80
- rounded={rounded}
81
- data-testid="callout-container"
82
- verticalAlign={verticalAlign}
83
- textAlignToFlex={textAlignToFlex}
84
- background={background}
85
- gap={gap}
86
- borderRadius={borderRadius}
87
- padding={`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`}
88
- {...selectProps(rest)}
89
- >
90
- {icon && <Icon tokens={{ color }} icon={icon} variant={{ rank: 'primary', size }} />}
91
- <Typography variant={{ size, compact: size === 'small' }} tokens={{ color }}>
92
- {children}
93
- </Typography>
94
- </CalloutContainer>
95
- )
96
- }
70
+ return (
71
+ <CalloutContainer
72
+ size={size}
73
+ rounded={rounded}
74
+ data-testid="callout-container"
75
+ verticalAlign={verticalAlign}
76
+ textAlignToFlex={textAlignToFlex}
77
+ background={background}
78
+ gap={gap}
79
+ borderRadius={borderRadius}
80
+ padding={`${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`}
81
+ ref={ref}
82
+ {...selectProps(rest)}
83
+ >
84
+ {icon && <Icon tokens={{ color }} icon={icon} variant={{ rank: 'primary', size }} />}
85
+ <Typography variant={{ size, compact: size === 'small' }} tokens={{ color }}>
86
+ {children}
87
+ </Typography>
88
+ </CalloutContainer>
89
+ )
90
+ }
91
+ )
92
+
93
+ Callout.displayName = 'Callout'
97
94
 
98
95
  Callout.propTypes = {
99
96
  ...selectedSystemPropTypes,
package/src/Card/Card.jsx CHANGED
@@ -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
  Card as CardBase,
@@ -53,7 +52,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
53
52
  * ## Accessibility
54
53
  * `Card` component accepts all the standard accessibility props.
55
54
  */
56
- const Card = forwardRef(
55
+ const Card = React.forwardRef(
57
56
  (
58
57
  {
59
58
  children,
@@ -48,21 +48,26 @@ const CardContentContainer = styled.div(
48
48
  /**
49
49
  * Card content, applying the card tokens as per the theme used.
50
50
  */
51
- const CardContent = ({ children, flexContent, tokens, variant, withFooter = false, ...rest }) => {
52
- const viewport = useViewport()
53
- const themeTokens = useThemeTokens('Card', tokens, variant, { viewport })
51
+ const CardContent = React.forwardRef(
52
+ ({ children, flexContent, tokens, variant, withFooter = false, ...rest }, ref) => {
53
+ const viewport = useViewport()
54
+ const themeTokens = useThemeTokens('Card', tokens, variant, { viewport })
54
55
 
55
- return (
56
- <CardContentContainer
57
- {...themeTokens}
58
- flexContent={flexContent}
59
- withFooter={withFooter}
60
- {...selectProps(rest)}
61
- >
62
- {children}
63
- </CardContentContainer>
64
- )
65
- }
56
+ return (
57
+ <CardContentContainer
58
+ {...themeTokens}
59
+ flexContent={flexContent}
60
+ withFooter={withFooter}
61
+ ref={ref}
62
+ {...selectProps(rest)}
63
+ >
64
+ {children}
65
+ </CardContentContainer>
66
+ )
67
+ }
68
+ )
69
+
70
+ CardContent.displayName = 'CardContent'
66
71
 
67
72
  CardContent.propTypes = {
68
73
  ...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
  Spacer,
@@ -64,78 +63,80 @@ const getMainTextTokens = ({
64
63
  fontName: textTimerFontName
65
64
  })
66
65
 
67
- const Countdown = forwardRef(({ copy = 'en', targetTime, tokens, variant = {}, ...rest }, ref) => {
68
- const [days, hours, minutes, seconds] = useCountdown(targetTime)
69
- const viewport = useViewport()
70
- const { feature, large, label, noDivider } = variant
71
- if (noDivider && !label) {
72
- throw new Error('`noDivider` variant can only be used with `label` enabled!')
73
- }
74
- const themeTokens = useThemeTokens('Countdown', tokens, variant, { viewport })
75
- const segmentFontSize = themeTokens.textFontSize
76
- const semanticGradient =
77
- themeTokens.containerGradient && transformGradient(themeTokens.containerGradient)
78
- const mainTextTokens = getMainTextTokens(themeTokens)
66
+ const Countdown = React.forwardRef(
67
+ ({ copy = 'en', targetTime, tokens, variant = {}, ...rest }, ref) => {
68
+ const [days, hours, minutes, seconds] = useCountdown(targetTime)
69
+ const viewport = useViewport()
70
+ const { feature, large, label, noDivider } = variant
71
+ if (noDivider && !label) {
72
+ throw new Error('`noDivider` variant can only be used with `label` enabled!')
73
+ }
74
+ const themeTokens = useThemeTokens('Countdown', tokens, variant, { viewport })
75
+ const segmentFontSize = themeTokens.textFontSize
76
+ const semanticGradient =
77
+ themeTokens.containerGradient && transformGradient(themeTokens.containerGradient)
78
+ const mainTextTokens = getMainTextTokens(themeTokens)
79
79
 
80
- const divider =
81
- noDivider === true ? (
82
- // StackView-based subcontainer adds a 1-step space on the each side of the divider
83
- <Spacer direction="row" space={(feature || large) && viewport !== viewports.xs ? 4 : 1} />
84
- ) : (
85
- <Typography tokens={mainTextTokens}>:</Typography>
86
- )
87
- const labelTokens = getLabelTokens(themeTokens)
80
+ const divider =
81
+ noDivider === true ? (
82
+ // StackView-based subcontainer adds a 1-step space on the each side of the divider
83
+ <Spacer direction="row" space={(feature || large) && viewport !== viewports.xs ? 4 : 1} />
84
+ ) : (
85
+ <Typography tokens={mainTextTokens}>:</Typography>
86
+ )
87
+ const labelTokens = getLabelTokens(themeTokens)
88
88
 
89
- const segmentProps = {
90
- copy,
91
- labelTokens,
92
- numberTokens: mainTextTokens,
93
- segmentFontSize,
94
- variant
95
- }
89
+ const segmentProps = {
90
+ copy,
91
+ labelTokens,
92
+ numberTokens: mainTextTokens,
93
+ segmentFontSize,
94
+ variant
95
+ }
96
96
 
97
- return (
98
- // Making it focusable for accessibility purposes
99
- <Container
100
- ref={ref}
101
- variant={variant}
102
- {...selectProps(rest)}
103
- tabIndex={0}
104
- themeTokens={themeTokens}
105
- gradient={semanticGradient}
106
- >
107
- <StackView direction="row" space={1}>
108
- <Segment
109
- labelKey="day"
110
- number={days}
111
- segmentWidth={String(days).length}
112
- {...segmentProps}
113
- />
114
- {divider}
115
- <Segment
116
- labelKey="hour"
117
- number={hours}
118
- {...segmentProps}
119
- {...applyTextStyles(themeTokens)}
120
- />
121
- {divider}
122
- <Segment
123
- labelKey="minute"
124
- number={minutes}
125
- {...segmentProps}
126
- {...applyTextStyles(themeTokens)}
127
- />
128
- {divider}
129
- <Segment
130
- labelKey="second"
131
- number={seconds}
132
- {...segmentProps}
133
- {...applyTextStyles(themeTokens)}
134
- />
135
- </StackView>
136
- </Container>
137
- )
138
- })
97
+ return (
98
+ // Making it focusable for accessibility purposes
99
+ <Container
100
+ ref={ref}
101
+ variant={variant}
102
+ {...selectProps(rest)}
103
+ tabIndex={0}
104
+ themeTokens={themeTokens}
105
+ gradient={semanticGradient}
106
+ >
107
+ <StackView direction="row" space={1}>
108
+ <Segment
109
+ labelKey="day"
110
+ number={days}
111
+ segmentWidth={String(days).length}
112
+ {...segmentProps}
113
+ />
114
+ {divider}
115
+ <Segment
116
+ labelKey="hour"
117
+ number={hours}
118
+ {...segmentProps}
119
+ {...applyTextStyles(themeTokens)}
120
+ />
121
+ {divider}
122
+ <Segment
123
+ labelKey="minute"
124
+ number={minutes}
125
+ {...segmentProps}
126
+ {...applyTextStyles(themeTokens)}
127
+ />
128
+ {divider}
129
+ <Segment
130
+ labelKey="second"
131
+ number={seconds}
132
+ {...segmentProps}
133
+ {...applyTextStyles(themeTokens)}
134
+ />
135
+ </StackView>
136
+ </Container>
137
+ )
138
+ }
139
+ )
139
140
  Countdown.displayName = 'Countdown'
140
141
 
141
142
  Countdown.propTypes = {
@@ -22,36 +22,48 @@ const Container = styled.div(({ segmentFontSize, segmentWidth = 2, variant: { fe
22
22
  // A segment of the countdown string: we need to make sure it
23
23
  // keeps its width constant to prevent the whole component from
24
24
  // being automatically resized while using variable size fonts
25
- const Segment = ({
26
- copy = 'en',
27
- segmentFontSize,
28
- labelKey,
29
- labelTokens,
30
- number,
31
- numberTokens,
32
- segmentWidth = 2,
33
- variant = {}
34
- }) => {
35
- const getCopy = useCopy({ dictionary, copy })
36
- const { label, large, feature } = variant
25
+ const Segment = React.forwardRef(
26
+ (
27
+ {
28
+ copy = 'en',
29
+ segmentFontSize,
30
+ labelKey,
31
+ labelTokens,
32
+ number,
33
+ numberTokens,
34
+ segmentWidth = 2,
35
+ variant = {}
36
+ },
37
+ ref
38
+ ) => {
39
+ const getCopy = useCopy({ dictionary, copy })
40
+ const { label, large, feature } = variant
37
41
 
38
- return (
39
- <Container segmentFontSize={segmentFontSize} segmentWidth={segmentWidth} variant={variant}>
40
- <StackView
41
- direction={large || feature ? 'column' : 'row'}
42
- space={large || feature ? 0 : 1}
43
- tokens={{ alignItems: 'center' }}
42
+ return (
43
+ <Container
44
+ segmentFontSize={segmentFontSize}
45
+ segmentWidth={segmentWidth}
46
+ variant={variant}
47
+ ref={ref}
44
48
  >
45
- <Typography tokens={numberTokens}>{pad(number, segmentWidth)}</Typography>
46
- {label && (
47
- <Typography tokens={labelTokens}>
48
- {getCopy(number === 1 ? labelKey : `${labelKey}s`)}
49
- </Typography>
50
- )}
51
- </StackView>
52
- </Container>
53
- )
54
- }
49
+ <StackView
50
+ direction={large || feature ? 'column' : 'row'}
51
+ space={large || feature ? 0 : 1}
52
+ tokens={{ alignItems: 'center' }}
53
+ >
54
+ <Typography tokens={numberTokens}>{pad(number, segmentWidth)}</Typography>
55
+ {label && (
56
+ <Typography tokens={labelTokens}>
57
+ {getCopy(number === 1 ? labelKey : `${labelKey}s`)}
58
+ </Typography>
59
+ )}
60
+ </StackView>
61
+ </Container>
62
+ )
63
+ }
64
+ )
65
+
66
+ Segment.displayName = 'Segment'
55
67
 
56
68
  Segment.propTypes = {
57
69
  /**
@@ -16,7 +16,7 @@ const CalendarContainer = styled.div(
16
16
  }) => `
17
17
  ${defaultReactDatesCss}
18
18
  > div {
19
- z-index: 3;
19
+ z-index: 1000;
20
20
  }
21
21
  .SingleDatePicker,
22
22
  .SingleDatePickerInput {
@@ -30,7 +30,7 @@ const CalendarContainer = styled.div(
30
30
  padding: ${remainingTokens.singleDatePickerPaddingTopBottom}px ${
31
31
  remainingTokens.singleDatePickerLeftRight
32
32
  }px;
33
- z-index: 3;
33
+ z-index: 1000;
34
34
  }
35
35
  .DateInput {
36
36
  width: 100%;