@telus-uds/components-web 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -2
- package/lib/Badge/Badge.js +19 -11
- package/lib/BlockQuote/BlockQuote.js +31 -17
- package/lib/Breadcrumbs/Breadcrumbs.js +23 -17
- package/lib/Breadcrumbs/Item/Item.js +6 -10
- package/lib/Callout/Callout.js +5 -6
- package/lib/Card/Card.js +5 -5
- package/lib/Card/CardContent.js +5 -6
- package/lib/Card/CardFooter.js +5 -6
- package/lib/Countdown/Countdown.js +5 -6
- package/lib/Countdown/Segment.js +6 -6
- package/lib/DatePicker/CalendarContainer.js +5 -5
- package/lib/DatePicker/DatePicker.js +26 -28
- package/lib/DatePicker/reactDatesCss.js +829 -2
- package/lib/Disclaimer/Disclaimer.js +5 -6
- package/lib/Footnote/Footnote.js +15 -39
- package/lib/Footnote/FootnoteLink.js +5 -6
- package/lib/NavigationBar/NavigationBar.js +5 -6
- package/lib/NavigationBar/NavigationItem.js +5 -6
- package/lib/OrderedList/Item.js +7 -11
- package/lib/OrderedList/ItemBase.js +5 -5
- package/lib/OrderedList/OrderedList.js +5 -6
- package/lib/OrderedList/OrderedListBase.js +5 -5
- package/lib/Paragraph/Paragraph.js +16 -8
- package/lib/PreviewCard/PreviewCard.js +7 -10
- package/lib/PriceLockup/PriceLockup.js +90 -64
- package/lib/PriceLockup/tokens.js +6 -2
- package/lib/Progress/ProgressBar.js +6 -6
- package/lib/QuantitySelector/styles.js +18 -9
- package/lib/Ribbon/Ribbon.js +57 -31
- package/lib/Span/Span.js +6 -7
- package/lib/Spinner/Spinner.js +8 -18
- package/lib/Spinner/SpinnerContent.js +5 -6
- package/lib/StoryCard/StoryCard.js +7 -10
- package/lib/Table/Cell.js +43 -12
- package/lib/Table/Table.js +15 -11
- package/lib/TermsAndConditions/ExpandCollapse.js +7 -13
- package/lib/TermsAndConditions/TermsAndConditions.js +9 -22
- package/lib/Testimonial/Testimonial.js +10 -26
- package/lib/Toast/Toast.js +64 -13
- package/lib/Video/ControlBar/ControlBar.js +8 -18
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +5 -6
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +7 -14
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +7 -14
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +6 -10
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +5 -6
- package/lib/Video/Video.js +10 -26
- package/lib/VideoPicker/VideoPicker.js +44 -20
- package/lib/VideoPicker/VideoPickerThumbnail.js +52 -18
- package/lib/WaffleGrid/WaffleGrid.js +7 -14
- package/lib/WebVideo/WebVideo.js +9 -14
- package/lib/index.js +1 -1
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -5
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +6 -9
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +8 -17
- package/lib/shared/VideoSplash/VideoSplash.js +5 -6
- package/lib/utils/index.js +2 -1
- package/lib/utils/ssr.js +4 -1
- package/lib/utils/theming/styled-components.js +26 -0
- package/package.json +3 -3
- package/src/Badge/Badge.jsx +3 -2
- package/src/BlockQuote/BlockQuote.jsx +3 -2
- package/src/Breadcrumbs/Breadcrumbs.jsx +23 -13
- package/src/Breadcrumbs/Item/Item.jsx +3 -2
- package/src/Callout/Callout.jsx +3 -2
- package/src/Card/Card.jsx +3 -1
- package/src/Card/CardContent.jsx +3 -2
- package/src/Card/CardFooter.jsx +3 -2
- package/src/Countdown/Countdown.jsx +3 -2
- package/src/Countdown/Segment.jsx +3 -1
- package/src/DatePicker/CalendarContainer.jsx +3 -1
- package/src/DatePicker/DatePicker.jsx +22 -13
- package/src/DatePicker/reactDatesCss.js +3 -1
- package/src/Disclaimer/Disclaimer.jsx +3 -2
- package/src/Footnote/Footnote.jsx +9 -2
- package/src/Footnote/FootnoteLink.jsx +3 -2
- package/src/NavigationBar/NavigationBar.jsx +3 -2
- package/src/NavigationBar/NavigationItem.jsx +3 -2
- package/src/OrderedList/Item.jsx +4 -3
- package/src/OrderedList/ItemBase.jsx +3 -1
- package/src/OrderedList/OrderedList.jsx +3 -2
- package/src/OrderedList/OrderedListBase.jsx +3 -1
- package/src/Paragraph/Paragraph.jsx +3 -2
- package/src/PreviewCard/PreviewCard.jsx +3 -1
- package/src/PriceLockup/PriceLockup.jsx +15 -4
- package/src/PriceLockup/tokens.js +15 -3
- package/src/Progress/ProgressBar.jsx +3 -1
- package/src/QuantitySelector/styles.js +3 -1
- package/src/Ribbon/Ribbon.jsx +3 -2
- package/src/Span/Span.jsx +3 -2
- package/src/Spinner/Spinner.jsx +3 -2
- package/src/Spinner/SpinnerContent.jsx +3 -2
- package/src/StoryCard/StoryCard.jsx +3 -1
- package/src/Table/Cell.jsx +3 -1
- package/src/Table/Table.jsx +3 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +3 -1
- package/src/TermsAndConditions/TermsAndConditions.jsx +3 -2
- package/src/Testimonial/Testimonial.jsx +3 -2
- package/src/Toast/Toast.jsx +3 -2
- package/src/Video/ControlBar/ControlBar.jsx +3 -3
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +4 -3
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +3 -3
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +3 -3
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +3 -3
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +4 -3
- package/src/Video/Video.jsx +3 -2
- package/src/VideoPicker/VideoPicker.jsx +3 -2
- package/src/VideoPicker/VideoPickerThumbnail.jsx +3 -1
- package/src/WaffleGrid/WaffleGrid.jsx +3 -2
- package/src/WebVideo/WebVideo.jsx +4 -3
- package/src/index.js +1 -1
- package/src/shared/FullBleedContent/FullBleedContent.jsx +3 -2
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +3 -1
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +4 -2
- package/src/shared/VideoSplash/VideoSplash.jsx +3 -2
- package/src/utils/index.js +3 -1
- package/src/utils/ssr.js +2 -1
- package/src/utils/theming/styled-components.js +23 -0
- package/types/common.d.ts +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { styledComponents } from '../utils'
|
|
2
2
|
import defaultReactDatesCss from './reactDatesCss'
|
|
3
3
|
|
|
4
4
|
// calendarDayDefaultHeight and calendarDayDefaultWidth
|
|
5
5
|
// refer to circle size when selected, focused, or hovered and is passed with getResponsiveCircleSize in DatePicker
|
|
6
6
|
|
|
7
|
+
const { styled } = styledComponents
|
|
8
|
+
|
|
7
9
|
const CalendarContainer = styled.div(
|
|
8
10
|
({
|
|
9
11
|
daySize,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import momentPropTypes from 'react-moment-proptypes'
|
|
5
4
|
import 'react-dates/initialize'
|
|
6
5
|
import { SingleDatePicker, DayPickerSingleDateController } from 'react-dates'
|
|
@@ -20,11 +19,12 @@ import moment from 'moment'
|
|
|
20
19
|
import { isUndefined, throttle } from 'lodash'
|
|
21
20
|
import CalendarContainer from './CalendarContainer'
|
|
22
21
|
import dictionary from './dictionary'
|
|
23
|
-
import { htmlAttrs } from '../utils'
|
|
22
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
23
|
+
|
|
24
|
+
const { styled } = styledComponents
|
|
24
25
|
|
|
25
26
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
26
|
-
|
|
27
|
-
const dateFormatWithoutSpaces = 'DD/MM/YYYY'
|
|
27
|
+
|
|
28
28
|
const getResponsiveDaySize = (inline = false, viewport = 'md') => {
|
|
29
29
|
if (viewport === 'xs') {
|
|
30
30
|
return inline ? undefined : 36
|
|
@@ -55,8 +55,6 @@ const PortalPositionedContainer = styled.div({
|
|
|
55
55
|
top: ({ top }) => `${top}px`
|
|
56
56
|
})
|
|
57
57
|
|
|
58
|
-
const validDatePattern = /^([0-2][0-9]|3[0-1])(\/)(0[1-9]|1[0-2])\2(\d{4})$/
|
|
59
|
-
|
|
60
58
|
const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
61
59
|
if (initialVisibleMonth === '' || inputDate instanceof moment) {
|
|
62
60
|
return null
|
|
@@ -91,6 +89,7 @@ const DatePicker = React.forwardRef(
|
|
|
91
89
|
copy = 'en',
|
|
92
90
|
id,
|
|
93
91
|
date,
|
|
92
|
+
dateFormat = 'DD / MM / YYYY',
|
|
94
93
|
feedback,
|
|
95
94
|
inline = false,
|
|
96
95
|
isDayDisabled,
|
|
@@ -105,16 +104,20 @@ const DatePicker = React.forwardRef(
|
|
|
105
104
|
disabled = false,
|
|
106
105
|
prevTestID = '',
|
|
107
106
|
nextTestID = '',
|
|
108
|
-
placeholder =
|
|
107
|
+
placeholder = dateFormat,
|
|
108
|
+
|
|
109
109
|
initialVisibleMonth = '',
|
|
110
110
|
...rest
|
|
111
111
|
},
|
|
112
112
|
ref
|
|
113
113
|
) => {
|
|
114
114
|
const [inputDate, setInputDate] = React.useState(date instanceof moment ? date : undefined)
|
|
115
|
+
|
|
115
116
|
const [inputText, setInputText] = React.useState(
|
|
116
117
|
date instanceof moment ? date.format(dateFormat) : ''
|
|
117
118
|
)
|
|
119
|
+
const dateFormatWithoutSpaces = dateFormat.replace(/\s/g, '')
|
|
120
|
+
|
|
118
121
|
const textInputRef = React.useRef()
|
|
119
122
|
const prevButtonRef = React.useRef()
|
|
120
123
|
const [datePickerPosition, setDatePickerPosition] = React.useState({ left: 0, top: 0 })
|
|
@@ -135,7 +138,7 @@ const DatePicker = React.forwardRef(
|
|
|
135
138
|
const throttledUpdate = throttle(updateDatePickerPosition, 100, { leading: false })
|
|
136
139
|
|
|
137
140
|
// Initial call to set the position
|
|
138
|
-
|
|
141
|
+
throttledUpdate()
|
|
139
142
|
|
|
140
143
|
// Register event listeners
|
|
141
144
|
window.addEventListener('resize', throttledUpdate)
|
|
@@ -160,7 +163,7 @@ const DatePicker = React.forwardRef(
|
|
|
160
163
|
setInputDate(date)
|
|
161
164
|
setInputText(date instanceof moment ? date.format(dateFormat) : '')
|
|
162
165
|
}
|
|
163
|
-
}, [date, inputDate])
|
|
166
|
+
}, [date, inputDate, dateFormat])
|
|
164
167
|
|
|
165
168
|
React.useEffect(() => {
|
|
166
169
|
let timeoutId
|
|
@@ -240,7 +243,10 @@ const DatePicker = React.forwardRef(
|
|
|
240
243
|
}
|
|
241
244
|
|
|
242
245
|
const handleValidation = (inputValidation) => {
|
|
243
|
-
|
|
246
|
+
const momentDate = moment(inputText, dateFormat, true)
|
|
247
|
+
const isValidDate = momentDate.isValid()
|
|
248
|
+
|
|
249
|
+
if (!isValidDate && inputText !== '') {
|
|
244
250
|
return 'error'
|
|
245
251
|
}
|
|
246
252
|
|
|
@@ -466,8 +472,11 @@ DatePicker.propTypes = {
|
|
|
466
472
|
*/
|
|
467
473
|
date: momentPropTypes.momentObj,
|
|
468
474
|
/**
|
|
469
|
-
* A
|
|
470
|
-
|
|
475
|
+
* A Moment instance representing the currently selected date, i.e. `moment()`
|
|
476
|
+
*/
|
|
477
|
+
dateFormat: PropTypes.string,
|
|
478
|
+
/**
|
|
479
|
+
* Optional date format for the date input. If not set, the default value will be `DD / MM / YYYY`
|
|
471
480
|
*/
|
|
472
481
|
feedback: PropTypes.string,
|
|
473
482
|
/**
|
|
@@ -523,7 +532,7 @@ DatePicker.propTypes = {
|
|
|
523
532
|
*/
|
|
524
533
|
nextTestID: PropTypes.string,
|
|
525
534
|
/**
|
|
526
|
-
* Optional placeholder for the date input. If not set the default value will be
|
|
535
|
+
* Optional placeholder for the date input. If not set, the default value will be equal to the `dateFormat` prop
|
|
527
536
|
*/
|
|
528
537
|
placeholder: PropTypes.string,
|
|
529
538
|
/**
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
applyTextStyles,
|
|
6
5
|
selectSystemProps,
|
|
7
6
|
useThemeTokens,
|
|
8
7
|
getTokensPropType
|
|
9
8
|
} from '@telus-uds/components-base'
|
|
10
|
-
import { htmlAttrs } from '../utils'
|
|
9
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
10
|
+
|
|
11
|
+
const { styled } = styledComponents
|
|
11
12
|
|
|
12
13
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
13
14
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled, { createGlobalStyle } from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
Icon,
|
|
6
5
|
Portal,
|
|
@@ -15,12 +14,20 @@ import {
|
|
|
15
14
|
} from '@telus-uds/components-base'
|
|
16
15
|
|
|
17
16
|
import OrderedListBase from '../OrderedList/OrderedListBase'
|
|
18
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
htmlAttrs,
|
|
19
|
+
media,
|
|
20
|
+
renderStructuredContent,
|
|
21
|
+
isElementFocusable,
|
|
22
|
+
styledComponents
|
|
23
|
+
} from '../utils'
|
|
19
24
|
import defaultDictionary from './dictionary'
|
|
20
25
|
|
|
21
26
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
22
27
|
const viewportBreakpoint = 1440
|
|
23
28
|
|
|
29
|
+
const { styled, createGlobalStyle } = styledComponents
|
|
30
|
+
|
|
24
31
|
const GlobalBodyScrollLock = createGlobalStyle({
|
|
25
32
|
'html, body': media().until('md').css({ overflow: 'hidden' })
|
|
26
33
|
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
applyTextStyles,
|
|
6
5
|
selectSystemProps,
|
|
@@ -9,7 +8,9 @@ import {
|
|
|
9
8
|
variantProp
|
|
10
9
|
} from '@telus-uds/components-base'
|
|
11
10
|
import dictionary from './dictionary'
|
|
12
|
-
import { htmlAttrs } from '../utils'
|
|
11
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
12
|
+
|
|
13
|
+
const { styled } = styledComponents
|
|
13
14
|
|
|
14
15
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
15
16
|
|
|
@@ -9,12 +9,13 @@ import {
|
|
|
9
9
|
useResponsiveProp,
|
|
10
10
|
withLinkRouter
|
|
11
11
|
} from '@telus-uds/components-base'
|
|
12
|
-
import
|
|
13
|
-
import { htmlAttrs, scrollToAnchor } from '../utils'
|
|
12
|
+
import { htmlAttrs, scrollToAnchor, styledComponents } from '../utils'
|
|
14
13
|
import NavigationItem from './NavigationItem'
|
|
15
14
|
import NavigationSubMenu from './NavigationSubMenu'
|
|
16
15
|
import collapseItems from './collapseItems'
|
|
17
16
|
|
|
17
|
+
const { styled } = styledComponents
|
|
18
|
+
|
|
18
19
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
19
20
|
|
|
20
21
|
const Heading = styled.div({
|
|
@@ -8,8 +8,9 @@ import {
|
|
|
8
8
|
useThemeTokensCallback,
|
|
9
9
|
getTokensPropType
|
|
10
10
|
} from '@telus-uds/components-base'
|
|
11
|
-
import
|
|
12
|
-
|
|
11
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
12
|
+
|
|
13
|
+
const { styled } = styledComponents
|
|
13
14
|
|
|
14
15
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
15
16
|
|
package/src/OrderedList/Item.jsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
applyTextStyles,
|
|
6
5
|
getTokensPropType,
|
|
@@ -12,9 +11,11 @@ import {
|
|
|
12
11
|
wrapStringsInText
|
|
13
12
|
} from '@telus-uds/components-base'
|
|
14
13
|
import ItemBase from './ItemBase'
|
|
15
|
-
import { htmlAttrs } from '../utils'
|
|
14
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
16
15
|
import { OL_COUNTER_NAME } from './constants'
|
|
17
16
|
|
|
17
|
+
const { styled } = styledComponents
|
|
18
|
+
|
|
18
19
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
19
20
|
|
|
20
21
|
const selectItemTextStyles = (
|
|
@@ -70,7 +71,7 @@ const StyledItemBase = styled(ItemBase)(
|
|
|
70
71
|
const ItemContent = styled.div({
|
|
71
72
|
display: 'flex',
|
|
72
73
|
flexDirection: 'column',
|
|
73
|
-
gap:
|
|
74
|
+
gap: 0
|
|
74
75
|
})
|
|
75
76
|
|
|
76
77
|
const Item = React.forwardRef(
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import { getTokensPropType, selectSystemProps, variantProp } from '@telus-uds/components-base'
|
|
5
|
-
import { htmlAttrs } from '../utils'
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
6
5
|
import OrderedListBase from './OrderedListBase'
|
|
7
6
|
import Item from './Item'
|
|
8
7
|
import { OL_COUNTER_NAME } from './constants'
|
|
9
8
|
|
|
9
|
+
const { styled } = styledComponents
|
|
10
|
+
|
|
10
11
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
11
12
|
|
|
12
13
|
const StyledOrderedListBase = styled(OrderedListBase)(({ start }) => ({
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import
|
|
3
|
+
import { styledComponents } from '../utils'
|
|
4
4
|
import ItemBase from './ItemBase'
|
|
5
5
|
|
|
6
|
+
const { styled } = styledComponents
|
|
7
|
+
|
|
6
8
|
const StyledList = styled.ol({
|
|
7
9
|
display: 'flex',
|
|
8
10
|
flexDirection: 'column',
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base'
|
|
5
4
|
|
|
6
|
-
import { htmlAttrs, useTypographyTheme } from '../utils'
|
|
5
|
+
import { htmlAttrs, useTypographyTheme, styledComponents } from '../utils'
|
|
6
|
+
|
|
7
|
+
const { styled } = styledComponents
|
|
7
8
|
|
|
8
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
9
10
|
|
|
@@ -17,13 +17,15 @@ import {
|
|
|
17
17
|
useTheme,
|
|
18
18
|
getTokensPropType
|
|
19
19
|
} from '@telus-uds/components-base'
|
|
20
|
-
import
|
|
20
|
+
import { styledComponents } from '../utils'
|
|
21
21
|
import FullBleedContent, {
|
|
22
22
|
getFullBleedBorderRadius,
|
|
23
23
|
useFullBleedContentProps
|
|
24
24
|
} from '../shared/FullBleedContent'
|
|
25
25
|
import AuthorDate from './AuthorDate'
|
|
26
26
|
|
|
27
|
+
const { styled } = styledComponents
|
|
28
|
+
|
|
27
29
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
28
30
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
29
31
|
a11yProps,
|
|
@@ -9,10 +9,11 @@ import {
|
|
|
9
9
|
useViewport,
|
|
10
10
|
getTokensPropType
|
|
11
11
|
} from '@telus-uds/components-base'
|
|
12
|
-
import styled from 'styled-components'
|
|
13
12
|
import FootnoteLink from '../Footnote/FootnoteLink'
|
|
14
13
|
import getTypographyTokens from './tokens'
|
|
15
|
-
import { htmlAttrs, warn } from '../utils'
|
|
14
|
+
import { htmlAttrs, warn, styledComponents } from '../utils'
|
|
15
|
+
|
|
16
|
+
const { styled } = styledComponents
|
|
16
17
|
|
|
17
18
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
18
19
|
|
|
@@ -73,6 +74,10 @@ const StrikeThroughContainer = styled.div`
|
|
|
73
74
|
position: absolute;
|
|
74
75
|
}
|
|
75
76
|
`
|
|
77
|
+
const TypographyContainer = styled.div`
|
|
78
|
+
display: flex;
|
|
79
|
+
padding-top: ${({ paddingTop }) => `${paddingTop || 0}px`};
|
|
80
|
+
`
|
|
76
81
|
|
|
77
82
|
const selectFootnoteLinkStyles = ({
|
|
78
83
|
footnoteLinkColor,
|
|
@@ -153,11 +158,17 @@ const PriceLockup = React.forwardRef(
|
|
|
153
158
|
const cents = hasCents ? priceString.substring(separatorPosition + 1) : null
|
|
154
159
|
|
|
155
160
|
const renderTypography = (value, tokens, position) => {
|
|
161
|
+
const { paddingTop, ...restOfTokens } = tokens
|
|
156
162
|
const customProps =
|
|
157
163
|
position === 'bottom'
|
|
158
164
|
? { variant: { size: 'micro' }, tokens: { color: fontColor } }
|
|
159
|
-
: { tokens: { ...
|
|
160
|
-
|
|
165
|
+
: { tokens: { ...restOfTokens, color: fontColor } }
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<TypographyContainer paddingTop={paddingTop}>
|
|
169
|
+
<Typography {...customProps}>{value}</Typography>
|
|
170
|
+
</TypographyContainer>
|
|
171
|
+
)
|
|
161
172
|
}
|
|
162
173
|
|
|
163
174
|
const renderCurrencySymbol = () =>
|
|
@@ -6,12 +6,14 @@ export default ({
|
|
|
6
6
|
currencySymbolFontSize,
|
|
7
7
|
currencySymbolLineHeight,
|
|
8
8
|
currencySymbolFontWeight,
|
|
9
|
+
currencySymbolPaddingTop,
|
|
9
10
|
amountFontSize,
|
|
10
11
|
amountLineHeight,
|
|
11
12
|
amountLetterSpacing,
|
|
12
13
|
amountFontWeight,
|
|
13
14
|
centsFontSize,
|
|
14
15
|
centsLineHeight,
|
|
16
|
+
centsPaddingTop,
|
|
15
17
|
rateFontSize,
|
|
16
18
|
rateLineHeight,
|
|
17
19
|
bottomTextFontSize,
|
|
@@ -23,7 +25,8 @@ export default ({
|
|
|
23
25
|
dollarSign: {
|
|
24
26
|
fontSize: currencySymbolFontSize,
|
|
25
27
|
lineHeight: currencySymbolLineHeight,
|
|
26
|
-
fontWeight: currencySymbolFontWeight
|
|
28
|
+
fontWeight: currencySymbolFontWeight,
|
|
29
|
+
paddingTop: currencySymbolPaddingTop
|
|
27
30
|
},
|
|
28
31
|
amount: {
|
|
29
32
|
color: fontColor,
|
|
@@ -32,7 +35,16 @@ export default ({
|
|
|
32
35
|
letterSpacing: amountLetterSpacing,
|
|
33
36
|
fontWeight: amountFontWeight
|
|
34
37
|
},
|
|
35
|
-
cents: {
|
|
36
|
-
|
|
38
|
+
cents: {
|
|
39
|
+
fontSize: centsFontSize,
|
|
40
|
+
lineHeight: centsLineHeight,
|
|
41
|
+
fontWeight: centsFontWeight,
|
|
42
|
+
paddingTop: centsPaddingTop
|
|
43
|
+
},
|
|
44
|
+
rate: {
|
|
45
|
+
fontSize: rateFontSize,
|
|
46
|
+
lineHeight: rateLineHeight,
|
|
47
|
+
fontWeight: rateFontWeight
|
|
48
|
+
},
|
|
37
49
|
bottomText: { fontSize: bottomTextFontSize, lineHeight: bottomTextLineHeight }
|
|
38
50
|
})
|
|
@@ -10,7 +10,9 @@ import {
|
|
|
10
10
|
variantProp,
|
|
11
11
|
applyShadowToken
|
|
12
12
|
} from '@telus-uds/components-base'
|
|
13
|
-
import
|
|
13
|
+
import { styledComponents } from '../utils'
|
|
14
|
+
|
|
15
|
+
const { styled } = styledComponents
|
|
14
16
|
|
|
15
17
|
// Passes React Native-oriented system props through UDS Progress
|
|
16
18
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
|
package/src/Ribbon/Ribbon.jsx
CHANGED
|
@@ -6,8 +6,9 @@ import {
|
|
|
6
6
|
useThemeTokens,
|
|
7
7
|
getTokensPropType
|
|
8
8
|
} from '@telus-uds/components-base'
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
10
|
+
|
|
11
|
+
const { styled } = styledComponents
|
|
11
12
|
|
|
12
13
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
13
14
|
|
package/src/Span/Span.jsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base'
|
|
5
4
|
|
|
6
|
-
import { htmlAttrs, useTypographyTheme } from '../utils'
|
|
5
|
+
import { htmlAttrs, useTypographyTheme, styledComponents } from '../utils'
|
|
6
|
+
|
|
7
|
+
const { styled } = styledComponents
|
|
7
8
|
|
|
8
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
9
10
|
|
package/src/Spinner/Spinner.jsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
selectSystemProps,
|
|
6
5
|
useScrollBlocking,
|
|
@@ -9,9 +8,11 @@ import {
|
|
|
9
8
|
} from '@telus-uds/components-base'
|
|
10
9
|
import { Portal } from '@gorhom/portal'
|
|
11
10
|
import SpinnerContent from './SpinnerContent'
|
|
12
|
-
import { htmlAttrs, media } from '../utils'
|
|
11
|
+
import { htmlAttrs, media, styledComponents } from '../utils'
|
|
13
12
|
import { BACKDROP_OPACITY, BACKDROP_Z_INDEX } from './constants'
|
|
14
13
|
|
|
14
|
+
const { styled } = styledComponents
|
|
15
|
+
|
|
15
16
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
16
17
|
|
|
17
18
|
const SpinnerContainer = styled.div(({ inline, fullScreen }) => ({
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
ActivityIndicator,
|
|
6
5
|
StackView,
|
|
7
6
|
Typography,
|
|
8
7
|
selectSystemProps
|
|
9
8
|
} from '@telus-uds/components-base'
|
|
10
|
-
import { htmlAttrs } from '../utils'
|
|
9
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
11
10
|
import { BACKDROP_Z_INDEX, LARGE } from './constants'
|
|
12
11
|
|
|
12
|
+
const { styled } = styledComponents
|
|
13
|
+
|
|
13
14
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
14
15
|
|
|
15
16
|
const Container = styled.div(({ overlay }) => ({
|
|
@@ -18,12 +18,14 @@ import {
|
|
|
18
18
|
useThemeTokensCallback,
|
|
19
19
|
getTokensPropType
|
|
20
20
|
} from '@telus-uds/components-base'
|
|
21
|
-
import
|
|
21
|
+
import { styledComponents } from '../utils'
|
|
22
22
|
import FullBleedContent, {
|
|
23
23
|
getFullBleedBorderRadius,
|
|
24
24
|
useFullBleedContentProps
|
|
25
25
|
} from '../shared/FullBleedContent'
|
|
26
26
|
|
|
27
|
+
const { styled } = styledComponents
|
|
28
|
+
|
|
27
29
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
28
30
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
29
31
|
a11yProps,
|
package/src/Table/Cell.jsx
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled, { css } from 'styled-components'
|
|
4
3
|
import { Typography, useThemeTokens, applyShadowToken } from '@telus-uds/components-base'
|
|
4
|
+
import { styledComponents } from '../utils'
|
|
5
5
|
import { useTableContext } from './Table'
|
|
6
6
|
|
|
7
|
+
const { styled, css } = styledComponents
|
|
8
|
+
|
|
7
9
|
const HEADER_TYPE = {
|
|
8
10
|
HEADING: 'heading',
|
|
9
11
|
SUBHEADING: 'subHeading',
|
package/src/Table/Table.jsx
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
selectSystemProps,
|
|
6
5
|
useSafeLayoutEffect,
|
|
@@ -8,7 +7,9 @@ import {
|
|
|
8
7
|
getTokensPropType
|
|
9
8
|
} from '@telus-uds/components-base'
|
|
10
9
|
import throttle from 'lodash.throttle'
|
|
11
|
-
import { htmlAttrs } from '../utils'
|
|
10
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
11
|
+
|
|
12
|
+
const { styled } = styledComponents
|
|
12
13
|
|
|
13
14
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
14
15
|
|
|
@@ -5,7 +5,9 @@ import {
|
|
|
5
5
|
IconButton,
|
|
6
6
|
useThemeTokensCallback
|
|
7
7
|
} from '@telus-uds/components-base'
|
|
8
|
-
import
|
|
8
|
+
import { styledComponents } from '../utils'
|
|
9
|
+
|
|
10
|
+
const { styled } = styledComponents
|
|
9
11
|
|
|
10
12
|
const ExpandCollapseControl = styled.div({
|
|
11
13
|
alignItems: 'center',
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
Box,
|
|
6
5
|
Divider,
|
|
@@ -17,9 +16,11 @@ import {
|
|
|
17
16
|
} from '@telus-uds/components-base'
|
|
18
17
|
import ExpandCollapse from './ExpandCollapse'
|
|
19
18
|
import OrderedListBase from '../OrderedList/OrderedListBase'
|
|
20
|
-
import { htmlAttrs, media, renderStructuredContent } from '../utils'
|
|
19
|
+
import { htmlAttrs, media, renderStructuredContent, styledComponents } from '../utils'
|
|
21
20
|
import defaultDictionary from './dictionary'
|
|
22
21
|
|
|
22
|
+
const { styled } = styledComponents
|
|
23
|
+
|
|
23
24
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
24
25
|
|
|
25
26
|
const ContentContainer = styled.div(({ tokens }) => ({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
3
|
import {
|
|
5
4
|
Icon,
|
|
6
5
|
selectSystemProps,
|
|
@@ -10,7 +9,9 @@ import {
|
|
|
10
9
|
getTokensPropType
|
|
11
10
|
} from '@telus-uds/components-base'
|
|
12
11
|
import Image from '../Image'
|
|
13
|
-
import { htmlAttrs } from '../utils'
|
|
12
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
13
|
+
|
|
14
|
+
const { styled } = styledComponents
|
|
14
15
|
|
|
15
16
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
16
17
|
|
package/src/Toast/Toast.jsx
CHANGED
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
useViewport,
|
|
11
11
|
getTokensPropType
|
|
12
12
|
} from '@telus-uds/components-base'
|
|
13
|
-
import
|
|
14
|
-
|
|
13
|
+
import { htmlAttrs, styledComponents } from '../utils'
|
|
14
|
+
|
|
15
|
+
const { styled, css, keyframes } = styledComponents
|
|
15
16
|
|
|
16
17
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
17
18
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
StackView,
|
|
7
5
|
useThemeTokens,
|
|
@@ -16,7 +14,9 @@ import VideoButton from './Controls/VideoButton/VideoButton'
|
|
|
16
14
|
import VideoMenu from './Controls/VideoMenu/VideoMenu'
|
|
17
15
|
|
|
18
16
|
import videoText from '../videoText'
|
|
19
|
-
import { htmlAttrs } from '../../utils'
|
|
17
|
+
import { htmlAttrs, styledComponents } from '../../utils'
|
|
18
|
+
|
|
19
|
+
const { styled } = styledComponents
|
|
20
20
|
|
|
21
21
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
22
22
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
|
-
|
|
5
3
|
import { useThemeTokens, selectSystemProps } from '@telus-uds/components-base'
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
import { htmlAttrs, styledComponents } from '../../../../utils'
|
|
6
|
+
|
|
7
|
+
const { styled } = styledComponents
|
|
7
8
|
|
|
8
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
9
10
|
|