@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/Table/Cell.jsx
CHANGED
|
@@ -68,81 +68,91 @@ const createStyledCell = (htmlElement) => styled[htmlElement]`
|
|
|
68
68
|
const StyledHeaderCell = createStyledCell('th')
|
|
69
69
|
const StyledDataCell = createStyledCell('td')
|
|
70
70
|
|
|
71
|
-
const Cell = (
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
const Cell = React.forwardRef(
|
|
72
|
+
({ children, isFirstInRow, align = 'left', tokens: cellTokens, type = 'default' }, ref) => {
|
|
73
|
+
const {
|
|
74
|
+
text,
|
|
75
|
+
isScrollable: isTableScrollable,
|
|
76
|
+
tokens: tableTokens,
|
|
77
|
+
spacing
|
|
78
|
+
} = useTableContext()
|
|
79
|
+
const themeTokens = { ...tableTokens, ...cellTokens }
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
const {
|
|
82
|
+
cellMinWidth,
|
|
83
|
+
cellBoxShadowColor,
|
|
84
|
+
cellBackground,
|
|
85
|
+
cellStickyShadow,
|
|
86
|
+
cellPaddingTop,
|
|
87
|
+
cellPaddingRight,
|
|
88
|
+
cellPaddingLeft,
|
|
89
|
+
cellPaddingBottom,
|
|
90
|
+
fontName,
|
|
91
|
+
fontWeight,
|
|
92
|
+
fontSize,
|
|
93
|
+
lineHeight,
|
|
94
|
+
stickyBackgroundColor,
|
|
95
|
+
fontColor,
|
|
96
|
+
display
|
|
97
|
+
} = useThemeTokens('Table', themeTokens, { spacing, type, text })
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
99
|
+
const sharedProps = {
|
|
100
|
+
align,
|
|
101
|
+
isSticky: isTableScrollable && isFirstInRow,
|
|
102
|
+
cellBackground,
|
|
103
|
+
cellMinWidth,
|
|
104
|
+
cellStickyShadow: applyShadowToken(cellStickyShadow).boxShadow,
|
|
105
|
+
cellPaddingTop,
|
|
106
|
+
cellPaddingRight,
|
|
107
|
+
cellPaddingLeft,
|
|
108
|
+
cellPaddingBottom,
|
|
109
|
+
stickyBackgroundColor,
|
|
110
|
+
cellBoxShadowColor,
|
|
111
|
+
display,
|
|
112
|
+
ref
|
|
113
|
+
}
|
|
107
114
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
const typographyTokens = {
|
|
116
|
+
fontName,
|
|
117
|
+
fontWeight,
|
|
118
|
+
fontSize,
|
|
119
|
+
lineHeight,
|
|
120
|
+
color: fontColor
|
|
121
|
+
}
|
|
115
122
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
switch (type) {
|
|
124
|
+
case HEADER_TYPE.HEADING:
|
|
125
|
+
return (
|
|
126
|
+
<StyledHeaderCell scope="col" {...sharedProps} type={type}>
|
|
127
|
+
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
128
|
+
</StyledHeaderCell>
|
|
129
|
+
)
|
|
123
130
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
case HEADER_TYPE.SUBHEADING:
|
|
132
|
+
return (
|
|
133
|
+
<StyledHeaderCell scope="col" {...sharedProps} type={type}>
|
|
134
|
+
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
135
|
+
</StyledHeaderCell>
|
|
136
|
+
)
|
|
130
137
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
case HEADER_TYPE.ROWHEADING:
|
|
139
|
+
return (
|
|
140
|
+
<StyledHeaderCell scope="row" {...sharedProps} type={type}>
|
|
141
|
+
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
142
|
+
</StyledHeaderCell>
|
|
143
|
+
)
|
|
137
144
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
default:
|
|
146
|
+
return (
|
|
147
|
+
<StyledDataCell {...sharedProps}>
|
|
148
|
+
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
149
|
+
</StyledDataCell>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
144
152
|
}
|
|
145
|
-
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
Cell.displayName = 'Cell'
|
|
146
156
|
|
|
147
157
|
Cell.propTypes = {
|
|
148
158
|
type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
package/src/Table/Header.jsx
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import Row from './Row'
|
|
4
4
|
|
|
5
|
-
const Header = ({ children }) => {
|
|
5
|
+
const Header = React.forwardRef(({ children }, ref) => {
|
|
6
6
|
return (
|
|
7
|
-
<thead>
|
|
7
|
+
<thead ref={ref}>
|
|
8
8
|
<Row>
|
|
9
9
|
{React.Children.map(children, (child) =>
|
|
10
10
|
// TO DO: pass type as a variant instead of prop
|
|
11
|
-
cloneElement(child, { type: 'heading' })
|
|
11
|
+
React.cloneElement(child, { type: 'heading' })
|
|
12
12
|
)}
|
|
13
13
|
</Row>
|
|
14
14
|
</thead>
|
|
15
15
|
)
|
|
16
|
-
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
Header.displayName = 'Header'
|
|
17
19
|
|
|
18
20
|
Header.propTypes = {
|
|
19
21
|
children: PropTypes.node
|
package/src/Table/Row.jsx
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
|
|
4
|
-
const Row = ({ children }) => {
|
|
4
|
+
const Row = React.forwardRef(({ children }, ref) => {
|
|
5
5
|
return (
|
|
6
|
-
<tr>
|
|
6
|
+
<tr ref={ref}>
|
|
7
7
|
{React.Children.map(children, (child, index) =>
|
|
8
|
-
cloneElement(child, { isFirstInRow: index === 0 })
|
|
8
|
+
React.cloneElement(child, { isFirstInRow: index === 0 })
|
|
9
9
|
)}
|
|
10
10
|
</tr>
|
|
11
11
|
)
|
|
12
|
-
}
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
Row.displayName = 'Row'
|
|
13
15
|
|
|
14
16
|
Row.propTypes = {
|
|
15
17
|
children: PropTypes.node
|
package/src/Table/SubHeading.jsx
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import Row from './Row'
|
|
4
4
|
|
|
5
|
-
const Header = ({ children }) => {
|
|
5
|
+
const Header = React.forwardRef(({ children }, ref) => {
|
|
6
6
|
return (
|
|
7
|
-
<Row>
|
|
7
|
+
<Row ref={ref}>
|
|
8
8
|
{React.Children.map(children, (child) =>
|
|
9
9
|
// TO DO: pass type as a variant instead of prop
|
|
10
|
-
cloneElement(child, { type: 'subHeading' })
|
|
10
|
+
React.cloneElement(child, { type: 'subHeading' })
|
|
11
11
|
)}
|
|
12
12
|
</Row>
|
|
13
13
|
)
|
|
14
|
-
}
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
Header.displayName = 'Header'
|
|
15
17
|
|
|
16
18
|
Header.propTypes = {
|
|
17
19
|
children: PropTypes.node
|
package/src/Table/Table.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
import {
|
|
@@ -26,7 +26,7 @@ const StyledTable = styled.table`
|
|
|
26
26
|
|
|
27
27
|
const TableContext = React.createContext({})
|
|
28
28
|
|
|
29
|
-
export const useTableContext = () => useContext(TableContext)
|
|
29
|
+
export const useTableContext = () => React.useContext(TableContext)
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Use `Table` to display tabular data.
|
|
@@ -52,11 +52,11 @@ const Table = ({
|
|
|
52
52
|
...rest
|
|
53
53
|
}) => {
|
|
54
54
|
const { tablePaddingBottom, borderColor, borderWidth } = useThemeTokens('Table', tokens, variant)
|
|
55
|
-
const containerRef = useRef()
|
|
56
|
-
const tableRef = useRef()
|
|
55
|
+
const containerRef = React.useRef()
|
|
56
|
+
const tableRef = React.useRef()
|
|
57
57
|
|
|
58
|
-
const [containerWidth, setContainerWidth] = useState(0)
|
|
59
|
-
const [tableWidth, setTableWidth] = useState(0)
|
|
58
|
+
const [containerWidth, setContainerWidth] = React.useState(0)
|
|
59
|
+
const [tableWidth, setTableWidth] = React.useState(0)
|
|
60
60
|
|
|
61
61
|
useSafeLayoutEffect(() => {
|
|
62
62
|
const updateDimensions = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import {
|
|
4
4
|
ExpandCollapse as ExpandCollapseBase,
|
|
@@ -49,7 +49,7 @@ const getIconButtonTokens = ({
|
|
|
49
49
|
outerBorderWidth: iconOuterBorderWidth
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
const ExpandCollapse = forwardRef(
|
|
52
|
+
const ExpandCollapse = React.forwardRef(
|
|
53
53
|
({ children, collapseTitle, expandTitle = collapseTitle }, ref) => {
|
|
54
54
|
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {})
|
|
55
55
|
const {
|
|
@@ -128,8 +128,4 @@ ExpandCollapse.propTypes = {
|
|
|
128
128
|
expandTitle: PropTypes.string
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
ExpandCollapse.defaultProps = {
|
|
132
|
-
expandTitle: undefined
|
|
133
|
-
}
|
|
134
|
-
|
|
135
131
|
export default ExpandCollapse
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
import {
|
|
@@ -76,13 +76,13 @@ const MainContainer = styled.div`
|
|
|
76
76
|
* - Responsive display based on breakpoints
|
|
77
77
|
* - Use `copy` to set language, ‘en’ for English or ‘fr’ for French
|
|
78
78
|
*/
|
|
79
|
-
const TermsAndConditions = forwardRef(
|
|
79
|
+
const TermsAndConditions = React.forwardRef(
|
|
80
80
|
(
|
|
81
81
|
{
|
|
82
82
|
copy = 'en',
|
|
83
|
-
indexedContent,
|
|
84
|
-
nonIndexedContent,
|
|
85
|
-
tokens,
|
|
83
|
+
indexedContent = [],
|
|
84
|
+
nonIndexedContent = [],
|
|
85
|
+
tokens = {},
|
|
86
86
|
variant = {},
|
|
87
87
|
dictionary = defaultDictionary,
|
|
88
88
|
...rest
|
|
@@ -198,12 +198,4 @@ TermsAndConditions.propTypes = {
|
|
|
198
198
|
})
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
TermsAndConditions.defaultProps = {
|
|
202
|
-
copy: 'en',
|
|
203
|
-
indexedContent: [],
|
|
204
|
-
nonIndexedContent: [],
|
|
205
|
-
dictionary: defaultDictionary,
|
|
206
|
-
tokens: {}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
201
|
export default TermsAndConditions
|
|
@@ -48,65 +48,152 @@ const Figcaption = styled.figcaption(({ figcaptionGap }) => ({
|
|
|
48
48
|
gap: figcaptionGap
|
|
49
49
|
}))
|
|
50
50
|
|
|
51
|
-
const Testimonial = (
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
51
|
+
const Testimonial = React.forwardRef(
|
|
52
|
+
(
|
|
53
|
+
{
|
|
54
|
+
showDivider,
|
|
55
|
+
testimonial,
|
|
56
|
+
title,
|
|
57
|
+
imageSrc,
|
|
58
|
+
image = imageSrc,
|
|
59
|
+
additionalInfo,
|
|
60
|
+
testimonialStyle = 'large',
|
|
61
|
+
tokens,
|
|
62
|
+
copy = 'en',
|
|
63
|
+
variant = {},
|
|
64
|
+
...rest
|
|
65
|
+
},
|
|
66
|
+
ref
|
|
67
|
+
) => {
|
|
68
|
+
const viewport = useViewport()
|
|
69
|
+
const {
|
|
70
|
+
testimonialContainerGap,
|
|
71
|
+
quoteContainerGap,
|
|
72
|
+
dividerBorder,
|
|
73
|
+
dividerBackgroundColor,
|
|
74
|
+
figcaptionGap,
|
|
75
|
+
textColor,
|
|
76
|
+
icon,
|
|
77
|
+
iconFr,
|
|
78
|
+
iconColor,
|
|
79
|
+
imageSize,
|
|
80
|
+
testimonialFontSizeLarge,
|
|
81
|
+
testimonialLineHeightLarge,
|
|
82
|
+
testimonialFontWeightLarge,
|
|
83
|
+
testimonialFontSizeHeading,
|
|
84
|
+
testimonialLineHeightHeading,
|
|
85
|
+
testimonialFontNameHeading,
|
|
86
|
+
testimonialFontWeightHeading,
|
|
87
|
+
authorFontSize,
|
|
88
|
+
authorLineHeight,
|
|
89
|
+
authorFontName,
|
|
90
|
+
authorFontWeight,
|
|
91
|
+
additionalFontSize,
|
|
92
|
+
additionalLineHeight,
|
|
93
|
+
additionalFontName,
|
|
94
|
+
additionalFontWeight
|
|
95
|
+
} = useThemeTokens('Testimonial', tokens, variant, { viewport })
|
|
92
96
|
|
|
93
|
-
|
|
94
|
-
|
|
97
|
+
const getQuoteTestimonial = (open) => {
|
|
98
|
+
let quote = ''
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
|
|
100
|
+
if (copy === 'en') quote = open ? '\u201C' : '\u201D'
|
|
101
|
+
else quote = open ? '\u00AB ' : ' \u00BB'
|
|
98
102
|
|
|
99
|
-
|
|
100
|
-
|
|
103
|
+
return quote
|
|
104
|
+
}
|
|
101
105
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
return (
|
|
107
|
+
<TestimonialContainer
|
|
108
|
+
testimonialContainerGap={testimonialContainerGap}
|
|
109
|
+
ref={ref}
|
|
110
|
+
{...selectProps(rest)}
|
|
111
|
+
>
|
|
112
|
+
<QuoteContainer quoteContainerGap={quoteContainerGap}>
|
|
113
|
+
<Icon
|
|
114
|
+
tokens={{ color: iconColor }}
|
|
115
|
+
variant={{ size: 'micro' }}
|
|
116
|
+
icon={copy === 'en' ? icon : iconFr}
|
|
117
|
+
/>
|
|
118
|
+
{showDivider && (
|
|
119
|
+
<Divider
|
|
120
|
+
dividerBackgroundColor={dividerBackgroundColor}
|
|
121
|
+
dividerBorder={dividerBorder}
|
|
122
|
+
role="separator"
|
|
123
|
+
/>
|
|
124
|
+
)}
|
|
125
|
+
</QuoteContainer>
|
|
126
|
+
<BlockQuote>
|
|
127
|
+
<Typography
|
|
128
|
+
variant={{ size: testimonialStyle === 'large' ? 'large' : 'h3' }}
|
|
129
|
+
tokens={{
|
|
130
|
+
color: textColor,
|
|
131
|
+
fontSize:
|
|
132
|
+
testimonialStyle === 'heading'
|
|
133
|
+
? testimonialFontSizeHeading
|
|
134
|
+
: testimonialFontSizeLarge,
|
|
135
|
+
lineHeight:
|
|
136
|
+
testimonialStyle === 'heading'
|
|
137
|
+
? testimonialLineHeightHeading
|
|
138
|
+
: testimonialLineHeightLarge,
|
|
139
|
+
fontName: testimonialFontNameHeading,
|
|
140
|
+
fontWeight:
|
|
141
|
+
testimonialStyle === 'heading'
|
|
142
|
+
? testimonialFontWeightHeading
|
|
143
|
+
: testimonialFontWeightLarge
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
{`${getQuoteTestimonial(true)}${testimonial}${getQuoteTestimonial()}`}
|
|
147
|
+
</Typography>
|
|
148
|
+
</BlockQuote>
|
|
149
|
+
{(image || title || additionalInfo) && (
|
|
150
|
+
<Figcaption figcaptionGap={figcaptionGap}>
|
|
151
|
+
{image &&
|
|
152
|
+
(typeof image === 'string' ? (
|
|
153
|
+
<Image
|
|
154
|
+
rounded="circle"
|
|
155
|
+
src={image}
|
|
156
|
+
alt={title}
|
|
157
|
+
width={imageSize}
|
|
158
|
+
height={imageSize}
|
|
159
|
+
/>
|
|
160
|
+
) : (
|
|
161
|
+
image
|
|
162
|
+
))}
|
|
163
|
+
{(title || additionalInfo) && (
|
|
164
|
+
<AuthorInfoContainer>
|
|
165
|
+
{title && (
|
|
166
|
+
<Typography
|
|
167
|
+
variant={{ size: 'small' }}
|
|
168
|
+
tokens={{
|
|
169
|
+
color: textColor,
|
|
170
|
+
fontSize: authorFontSize,
|
|
171
|
+
lineHeight: authorLineHeight,
|
|
172
|
+
fontName: authorFontName,
|
|
173
|
+
fontWeight: authorFontWeight
|
|
174
|
+
}}
|
|
175
|
+
>
|
|
176
|
+
{title}
|
|
177
|
+
</Typography>
|
|
178
|
+
)}
|
|
179
|
+
{additionalInfo && (
|
|
180
|
+
<Typography
|
|
181
|
+
variant={{ size: 'small' }}
|
|
182
|
+
tokens={{
|
|
183
|
+
color: textColor,
|
|
184
|
+
fontSize: additionalFontSize,
|
|
185
|
+
lineHeight: additionalLineHeight,
|
|
186
|
+
fontName: additionalFontName,
|
|
187
|
+
fontWeight: additionalFontWeight
|
|
188
|
+
}}
|
|
189
|
+
>
|
|
190
|
+
{additionalInfo}
|
|
191
|
+
</Typography>
|
|
192
|
+
)}
|
|
193
|
+
</AuthorInfoContainer>
|
|
194
|
+
)}
|
|
195
|
+
</Figcaption>
|
|
196
|
+
)}
|
|
110
197
|
{showDivider && (
|
|
111
198
|
<Divider
|
|
112
199
|
dividerBackgroundColor={dividerBackgroundColor}
|
|
@@ -114,88 +201,12 @@ const Testimonial = ({
|
|
|
114
201
|
role="separator"
|
|
115
202
|
/>
|
|
116
203
|
)}
|
|
117
|
-
</
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
fontSize:
|
|
124
|
-
testimonialStyle === 'heading'
|
|
125
|
-
? testimonialFontSizeHeading
|
|
126
|
-
: testimonialFontSizeLarge,
|
|
127
|
-
lineHeight:
|
|
128
|
-
testimonialStyle === 'heading'
|
|
129
|
-
? testimonialLineHeightHeading
|
|
130
|
-
: testimonialLineHeightLarge,
|
|
131
|
-
fontName: testimonialFontNameHeading,
|
|
132
|
-
fontWeight:
|
|
133
|
-
testimonialStyle === 'heading'
|
|
134
|
-
? testimonialFontWeightHeading
|
|
135
|
-
: testimonialFontWeightLarge
|
|
136
|
-
}}
|
|
137
|
-
>
|
|
138
|
-
{`${getQuoteTestimonial(true)}${testimonial}${getQuoteTestimonial()}`}
|
|
139
|
-
</Typography>
|
|
140
|
-
</BlockQuote>
|
|
141
|
-
{(image || title || additionalInfo) && (
|
|
142
|
-
<Figcaption figcaptionGap={figcaptionGap}>
|
|
143
|
-
{image &&
|
|
144
|
-
(typeof image === 'string' ? (
|
|
145
|
-
<Image
|
|
146
|
-
rounded="circle"
|
|
147
|
-
src={image}
|
|
148
|
-
alt={title}
|
|
149
|
-
width={imageSize}
|
|
150
|
-
height={imageSize}
|
|
151
|
-
/>
|
|
152
|
-
) : (
|
|
153
|
-
image
|
|
154
|
-
))}
|
|
155
|
-
{(title || additionalInfo) && (
|
|
156
|
-
<AuthorInfoContainer>
|
|
157
|
-
{title && (
|
|
158
|
-
<Typography
|
|
159
|
-
variant={{ size: 'small' }}
|
|
160
|
-
tokens={{
|
|
161
|
-
color: textColor,
|
|
162
|
-
fontSize: authorFontSize,
|
|
163
|
-
lineHeight: authorLineHeight,
|
|
164
|
-
fontName: authorFontName,
|
|
165
|
-
fontWeight: authorFontWeight
|
|
166
|
-
}}
|
|
167
|
-
>
|
|
168
|
-
{title}
|
|
169
|
-
</Typography>
|
|
170
|
-
)}
|
|
171
|
-
{additionalInfo && (
|
|
172
|
-
<Typography
|
|
173
|
-
variant={{ size: 'small' }}
|
|
174
|
-
tokens={{
|
|
175
|
-
color: textColor,
|
|
176
|
-
fontSize: additionalFontSize,
|
|
177
|
-
lineHeight: additionalLineHeight,
|
|
178
|
-
fontName: additionalFontName,
|
|
179
|
-
fontWeight: additionalFontWeight
|
|
180
|
-
}}
|
|
181
|
-
>
|
|
182
|
-
{additionalInfo}
|
|
183
|
-
</Typography>
|
|
184
|
-
)}
|
|
185
|
-
</AuthorInfoContainer>
|
|
186
|
-
)}
|
|
187
|
-
</Figcaption>
|
|
188
|
-
)}
|
|
189
|
-
{showDivider && (
|
|
190
|
-
<Divider
|
|
191
|
-
dividerBackgroundColor={dividerBackgroundColor}
|
|
192
|
-
dividerBorder={dividerBorder}
|
|
193
|
-
role="separator"
|
|
194
|
-
/>
|
|
195
|
-
)}
|
|
196
|
-
</TestimonialContainer>
|
|
197
|
-
)
|
|
198
|
-
}
|
|
204
|
+
</TestimonialContainer>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
Testimonial.displayName = 'Testimonial'
|
|
199
210
|
|
|
200
211
|
Testimonial.propTypes = {
|
|
201
212
|
...selectedSystemPropTypes,
|