@telus-uds/components-web 2.33.2 → 2.34.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 +20 -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 +5 -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 +5 -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 +41 -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/lib-module/Table/Body.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const Body = _ref => {
|
|
4
|
+
const Body = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
6
6
|
children
|
|
7
7
|
} = _ref;
|
|
8
8
|
return /*#__PURE__*/_jsx("tbody", {
|
|
9
|
+
ref: ref,
|
|
9
10
|
children: children
|
|
10
11
|
});
|
|
11
|
-
};
|
|
12
|
+
});
|
|
13
|
+
Body.displayName = 'Body';
|
|
12
14
|
Body.propTypes = {
|
|
13
15
|
children: PropTypes.node
|
|
14
16
|
};
|
package/lib-module/Table/Cell.js
CHANGED
|
@@ -56,7 +56,7 @@ const createStyledCell = htmlElement => styled[htmlElement].withConfig({
|
|
|
56
56
|
});
|
|
57
57
|
const StyledHeaderCell = createStyledCell('th');
|
|
58
58
|
const StyledDataCell = createStyledCell('td');
|
|
59
|
-
const Cell = _ref5 => {
|
|
59
|
+
const Cell = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
60
60
|
let {
|
|
61
61
|
children,
|
|
62
62
|
isFirstInRow,
|
|
@@ -107,7 +107,8 @@ const Cell = _ref5 => {
|
|
|
107
107
|
cellPaddingBottom,
|
|
108
108
|
stickyBackgroundColor,
|
|
109
109
|
cellBoxShadowColor,
|
|
110
|
-
display
|
|
110
|
+
display,
|
|
111
|
+
ref
|
|
111
112
|
};
|
|
112
113
|
const typographyTokens = {
|
|
113
114
|
fontName,
|
|
@@ -156,7 +157,8 @@ const Cell = _ref5 => {
|
|
|
156
157
|
})
|
|
157
158
|
});
|
|
158
159
|
}
|
|
159
|
-
};
|
|
160
|
+
});
|
|
161
|
+
Cell.displayName = 'Cell';
|
|
160
162
|
Cell.propTypes = {
|
|
161
163
|
type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
162
164
|
tokens: PropTypes.object,
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Row from './Row';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const Header = _ref => {
|
|
5
|
+
const Header = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
6
6
|
let {
|
|
7
7
|
children
|
|
8
8
|
} = _ref;
|
|
9
9
|
return /*#__PURE__*/_jsx("thead", {
|
|
10
|
+
ref: ref,
|
|
10
11
|
children: /*#__PURE__*/_jsx(Row, {
|
|
11
12
|
children: React.Children.map(children, child =>
|
|
12
13
|
/*#__PURE__*/
|
|
13
14
|
// TO DO: pass type as a variant instead of prop
|
|
14
|
-
cloneElement(child, {
|
|
15
|
+
React.cloneElement(child, {
|
|
15
16
|
type: 'heading'
|
|
16
17
|
}))
|
|
17
18
|
})
|
|
18
19
|
});
|
|
19
|
-
};
|
|
20
|
+
});
|
|
21
|
+
Header.displayName = 'Header';
|
|
20
22
|
Header.propTypes = {
|
|
21
23
|
children: PropTypes.node
|
|
22
24
|
};
|
package/lib-module/Table/Row.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const Row = _ref => {
|
|
4
|
+
const Row = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
5
5
|
let {
|
|
6
6
|
children
|
|
7
7
|
} = _ref;
|
|
8
8
|
return /*#__PURE__*/_jsx("tr", {
|
|
9
|
-
|
|
9
|
+
ref: ref,
|
|
10
|
+
children: React.Children.map(children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
|
|
10
11
|
isFirstInRow: index === 0
|
|
11
12
|
}))
|
|
12
13
|
});
|
|
13
|
-
};
|
|
14
|
+
});
|
|
15
|
+
Row.displayName = 'Row';
|
|
14
16
|
Row.propTypes = {
|
|
15
17
|
children: PropTypes.node
|
|
16
18
|
};
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Row from './Row';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
const Header = _ref => {
|
|
5
|
+
const Header = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
6
6
|
let {
|
|
7
7
|
children
|
|
8
8
|
} = _ref;
|
|
9
9
|
return /*#__PURE__*/_jsx(Row, {
|
|
10
|
+
ref: ref,
|
|
10
11
|
children: React.Children.map(children, child =>
|
|
11
12
|
/*#__PURE__*/
|
|
12
13
|
// TO DO: pass type as a variant instead of prop
|
|
13
|
-
cloneElement(child, {
|
|
14
|
+
React.cloneElement(child, {
|
|
14
15
|
type: 'subHeading'
|
|
15
16
|
}))
|
|
16
17
|
});
|
|
17
|
-
};
|
|
18
|
+
});
|
|
19
|
+
Header.displayName = 'Header';
|
|
18
20
|
Header.propTypes = {
|
|
19
21
|
children: PropTypes.node
|
|
20
22
|
};
|
|
@@ -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 { selectSystemProps, useSafeLayoutEffect, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
@@ -20,7 +20,7 @@ const StyledTable = /*#__PURE__*/styled.table.withConfig({
|
|
|
20
20
|
return `${tableWidth}px`;
|
|
21
21
|
}, props => `${props.borderWidth}px solid ${props.borderColor}`);
|
|
22
22
|
const TableContext = /*#__PURE__*/React.createContext({});
|
|
23
|
-
export const useTableContext = () => useContext(TableContext);
|
|
23
|
+
export const useTableContext = () => React.useContext(TableContext);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Use `Table` to display tabular data.
|
|
@@ -51,10 +51,10 @@ const Table = _ref2 => {
|
|
|
51
51
|
borderColor,
|
|
52
52
|
borderWidth
|
|
53
53
|
} = useThemeTokens('Table', tokens, variant);
|
|
54
|
-
const containerRef = useRef();
|
|
55
|
-
const tableRef = useRef();
|
|
56
|
-
const [containerWidth, setContainerWidth] = useState(0);
|
|
57
|
-
const [tableWidth, setTableWidth] = useState(0);
|
|
54
|
+
const containerRef = React.useRef();
|
|
55
|
+
const tableRef = React.useRef();
|
|
56
|
+
const [containerWidth, setContainerWidth] = React.useState(0);
|
|
57
|
+
const [tableWidth, setTableWidth] = React.useState(0);
|
|
58
58
|
useSafeLayoutEffect(() => {
|
|
59
59
|
const updateDimensions = () => {
|
|
60
60
|
const containerClientWidth = containerRef.current.clientWidth;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
@@ -64,7 +64,7 @@ const getIconButtonTokens = _ref3 => {
|
|
|
64
64
|
outerBorderWidth: iconOuterBorderWidth
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
const ExpandCollapse = /*#__PURE__*/forwardRef((_ref4, ref) => {
|
|
67
|
+
const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
68
68
|
let {
|
|
69
69
|
children,
|
|
70
70
|
collapseTitle,
|
|
@@ -144,7 +144,4 @@ ExpandCollapse.propTypes = {
|
|
|
144
144
|
collapseTitle: PropTypes.string.isRequired,
|
|
145
145
|
expandTitle: PropTypes.string
|
|
146
146
|
};
|
|
147
|
-
ExpandCollapse.defaultProps = {
|
|
148
|
-
expandTitle: undefined
|
|
149
|
-
};
|
|
150
147
|
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 { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
@@ -103,12 +103,12 @@ const MainContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
103
103
|
* - Responsive display based on breakpoints
|
|
104
104
|
* - Use `copy` to set language, ‘en’ for English or ‘fr’ for French
|
|
105
105
|
*/
|
|
106
|
-
const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
106
|
+
const TermsAndConditions = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
107
107
|
let {
|
|
108
108
|
copy = 'en',
|
|
109
|
-
indexedContent,
|
|
110
|
-
nonIndexedContent,
|
|
111
|
-
tokens,
|
|
109
|
+
indexedContent = [],
|
|
110
|
+
nonIndexedContent = [],
|
|
111
|
+
tokens = {},
|
|
112
112
|
variant = {},
|
|
113
113
|
dictionary = defaultDictionary,
|
|
114
114
|
...rest
|
|
@@ -222,11 +222,4 @@ TermsAndConditions.propTypes = {
|
|
|
222
222
|
fr: dictionaryContentShape
|
|
223
223
|
})
|
|
224
224
|
};
|
|
225
|
-
TermsAndConditions.defaultProps = {
|
|
226
|
-
copy: 'en',
|
|
227
|
-
indexedContent: [],
|
|
228
|
-
nonIndexedContent: [],
|
|
229
|
-
dictionary: defaultDictionary,
|
|
230
|
-
tokens: {}
|
|
231
|
-
};
|
|
232
225
|
export default TermsAndConditions;
|
|
@@ -74,7 +74,7 @@ const Figcaption = /*#__PURE__*/styled.figcaption.withConfig({
|
|
|
74
74
|
gap: figcaptionGap
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
|
-
const Testimonial = _ref5 => {
|
|
77
|
+
const Testimonial = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
78
78
|
let {
|
|
79
79
|
showDivider,
|
|
80
80
|
testimonial,
|
|
@@ -125,6 +125,7 @@ const Testimonial = _ref5 => {
|
|
|
125
125
|
};
|
|
126
126
|
return /*#__PURE__*/_jsxs(TestimonialContainer, {
|
|
127
127
|
testimonialContainerGap: testimonialContainerGap,
|
|
128
|
+
ref: ref,
|
|
128
129
|
...selectProps(rest),
|
|
129
130
|
children: [/*#__PURE__*/_jsxs(QuoteContainer, {
|
|
130
131
|
quoteContainerGap: quoteContainerGap,
|
|
@@ -196,7 +197,8 @@ const Testimonial = _ref5 => {
|
|
|
196
197
|
role: "separator"
|
|
197
198
|
})]
|
|
198
199
|
});
|
|
199
|
-
};
|
|
200
|
+
});
|
|
201
|
+
Testimonial.displayName = 'Testimonial';
|
|
200
202
|
Testimonial.propTypes = {
|
|
201
203
|
...selectedSystemPropTypes,
|
|
202
204
|
tokens: getTokensPropType('Testimonial'),
|
|
@@ -37,7 +37,7 @@ const ToastContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
37
37
|
} = _ref4;
|
|
38
38
|
return containerGap;
|
|
39
39
|
}, animation);
|
|
40
|
-
const Toast = _ref5 => {
|
|
40
|
+
const Toast = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
41
41
|
let {
|
|
42
42
|
toast,
|
|
43
43
|
copy,
|
|
@@ -95,6 +95,7 @@ const Toast = _ref5 => {
|
|
|
95
95
|
animationColorAfter: animationColorAfter,
|
|
96
96
|
animationFillColorBefore: chevronInverseColor,
|
|
97
97
|
animationFillColorAfter: chevronDefaultColor,
|
|
98
|
+
ref: ref,
|
|
98
99
|
...extraTokens,
|
|
99
100
|
...selectProps(rest),
|
|
100
101
|
children: [headline && /*#__PURE__*/_jsx(Typography, {
|
|
@@ -127,7 +128,8 @@ const Toast = _ref5 => {
|
|
|
127
128
|
children: link.text
|
|
128
129
|
})]
|
|
129
130
|
});
|
|
130
|
-
};
|
|
131
|
+
});
|
|
132
|
+
Toast.displayName = 'Toast';
|
|
131
133
|
Toast.propTypes = {
|
|
132
134
|
...selectedSystemPropTypes,
|
|
133
135
|
tokens: getTokensPropType('Toast'),
|
|
@@ -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 fscreen from 'fscreen';
|
|
@@ -80,25 +80,29 @@ const VideoOverlayElementContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
80
80
|
width: '100%',
|
|
81
81
|
height: '100%'
|
|
82
82
|
});
|
|
83
|
-
const Video =
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
videoBorder,
|
|
90
|
-
simpleMode,
|
|
83
|
+
const Video = _ref3 => {
|
|
84
|
+
let {
|
|
85
|
+
analyticsTracking,
|
|
86
|
+
videoTitle,
|
|
87
|
+
videoBorder = false,
|
|
88
|
+
simpleMode = false,
|
|
91
89
|
copy,
|
|
92
90
|
posterSrc,
|
|
93
91
|
crossOrigin,
|
|
94
|
-
defaultVolume,
|
|
92
|
+
defaultVolume = 100,
|
|
93
|
+
beginMuted = false,
|
|
95
94
|
sources,
|
|
96
95
|
tracks,
|
|
97
|
-
defaultDesktopQuality,
|
|
96
|
+
defaultDesktopQuality = 1,
|
|
97
|
+
defaultMobileQuality = 1,
|
|
98
98
|
tokens,
|
|
99
99
|
variant = {},
|
|
100
100
|
...rest
|
|
101
|
-
} =
|
|
101
|
+
} = _ref3;
|
|
102
|
+
const refVideoPlayer = React.useRef({});
|
|
103
|
+
const refVideoPlayerContainer = React.useRef({});
|
|
104
|
+
const refKeyboardInstructions = React.useRef({});
|
|
105
|
+
let inactivityTimer = null;
|
|
102
106
|
const {
|
|
103
107
|
borderColor,
|
|
104
108
|
pauseIcon,
|
|
@@ -115,7 +119,7 @@ const Video = props => {
|
|
|
115
119
|
compactModeThreshold: 700 // in px
|
|
116
120
|
};
|
|
117
121
|
|
|
118
|
-
const [videoPlayerState, setVideoPlayerState] = useState({
|
|
122
|
+
const [videoPlayerState, setVideoPlayerState] = React.useState({
|
|
119
123
|
loadedSources: null,
|
|
120
124
|
loadedTracks: null,
|
|
121
125
|
videoLength: 0,
|
|
@@ -164,9 +168,6 @@ const Video = props => {
|
|
|
164
168
|
});
|
|
165
169
|
};
|
|
166
170
|
const refreshMedia = () => {
|
|
167
|
-
const {
|
|
168
|
-
defaultMobileQuality
|
|
169
|
-
} = props;
|
|
170
171
|
const {
|
|
171
172
|
videoUnplayed
|
|
172
173
|
} = videoPlayerState;
|
|
@@ -254,10 +255,6 @@ const Video = props => {
|
|
|
254
255
|
videoLength,
|
|
255
256
|
percentageWatched
|
|
256
257
|
} = videoPlayerState;
|
|
257
|
-
const {
|
|
258
|
-
videoTitle,
|
|
259
|
-
analyticsTracking
|
|
260
|
-
} = props;
|
|
261
258
|
let percentValue = videoCurrentTime / videoLength * 100;
|
|
262
259
|
percentValue = Math.round(percentValue);
|
|
263
260
|
const previousValue = percentageWatched;
|
|
@@ -273,10 +270,6 @@ const Video = props => {
|
|
|
273
270
|
};
|
|
274
271
|
const setPlaying = async isPlaying => {
|
|
275
272
|
const videoPlayer = refVideoPlayer.current;
|
|
276
|
-
const {
|
|
277
|
-
analyticsTracking,
|
|
278
|
-
videoTitle
|
|
279
|
-
} = props;
|
|
280
273
|
if (isPlaying) {
|
|
281
274
|
await videoPlayer.play();
|
|
282
275
|
if (analyticsTracking !== undefined && videoTitle) {
|
|
@@ -295,10 +288,6 @@ const Video = props => {
|
|
|
295
288
|
}
|
|
296
289
|
};
|
|
297
290
|
const updateAnalyticsData = () => {
|
|
298
|
-
const {
|
|
299
|
-
videoTitle,
|
|
300
|
-
analyticsTracking
|
|
301
|
-
} = props;
|
|
302
291
|
const {
|
|
303
292
|
videoIsPlaying,
|
|
304
293
|
percentageWatched
|
|
@@ -416,9 +405,6 @@ const Video = props => {
|
|
|
416
405
|
videoUnplayed: false,
|
|
417
406
|
videoQualityChanged: false
|
|
418
407
|
}));
|
|
419
|
-
const {
|
|
420
|
-
analyticsTracking
|
|
421
|
-
} = props;
|
|
422
408
|
if (analyticsTracking) {
|
|
423
409
|
updateAnalyticsData();
|
|
424
410
|
}
|
|
@@ -430,9 +416,6 @@ const Video = props => {
|
|
|
430
416
|
...prevState,
|
|
431
417
|
videoIsPlaying: false
|
|
432
418
|
}));
|
|
433
|
-
const {
|
|
434
|
-
analyticsTracking
|
|
435
|
-
} = props;
|
|
436
419
|
if (analyticsTracking) {
|
|
437
420
|
updateAnalyticsData();
|
|
438
421
|
}
|
|
@@ -689,23 +672,18 @@ const Video = props => {
|
|
|
689
672
|
};
|
|
690
673
|
|
|
691
674
|
// Prepares video and caption files
|
|
692
|
-
useEffect(() => {
|
|
675
|
+
React.useEffect(() => {
|
|
693
676
|
refreshMedia();
|
|
694
677
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
695
678
|
}, []);
|
|
696
679
|
|
|
697
680
|
// Initial Setup after loading sources
|
|
698
|
-
useEffect(() => {
|
|
681
|
+
React.useEffect(() => {
|
|
699
682
|
const {
|
|
700
683
|
loadedSources,
|
|
701
684
|
loadedTracks
|
|
702
685
|
} = videoPlayerState;
|
|
703
686
|
if (loadedSources && loadedTracks) {
|
|
704
|
-
const {
|
|
705
|
-
beginMuted,
|
|
706
|
-
analyticsTracking,
|
|
707
|
-
videoTitle
|
|
708
|
-
} = props;
|
|
709
687
|
const videoPlayer = refVideoPlayer.current;
|
|
710
688
|
|
|
711
689
|
// Initializes Settings
|
|
@@ -978,16 +956,4 @@ Video.propTypes = {
|
|
|
978
956
|
tokens: getTokensPropType('Video'),
|
|
979
957
|
variant: variantProp.propType
|
|
980
958
|
};
|
|
981
|
-
Video.defaultProps = {
|
|
982
|
-
tracks: undefined,
|
|
983
|
-
defaultVolume: 100,
|
|
984
|
-
beginMuted: false,
|
|
985
|
-
defaultMobileQuality: 1,
|
|
986
|
-
defaultDesktopQuality: 1,
|
|
987
|
-
crossOrigin: undefined,
|
|
988
|
-
simpleMode: false,
|
|
989
|
-
videoBorder: false,
|
|
990
|
-
analyticsTracking: undefined,
|
|
991
|
-
videoTitle: undefined
|
|
992
|
-
};
|
|
993
959
|
export default Video;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { viewports } from '@telus-uds/system-constants';
|
|
4
4
|
import { selectSystemProps, StackView, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
@@ -58,7 +58,7 @@ const VideoListContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
58
58
|
displayName: "VideoPicker__VideoListContainer",
|
|
59
59
|
componentId: "components-web__sc-x6lxp0-2"
|
|
60
60
|
})(["display:flex;justify-content:flex-start;position:relative;flex-grow:1;flex-direction:column;", ""], props => props.isFramed && framedVideoListContainerStyle);
|
|
61
|
-
const VideoPicker = _ref6 => {
|
|
61
|
+
const VideoPicker = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
62
62
|
var _videoList$;
|
|
63
63
|
let {
|
|
64
64
|
videoList = [],
|
|
@@ -66,6 +66,9 @@ const VideoPicker = _ref6 => {
|
|
|
66
66
|
frame,
|
|
67
67
|
onStartVideo = () => {},
|
|
68
68
|
onSelectVideo = () => {},
|
|
69
|
+
onPlay = () => {},
|
|
70
|
+
onPause = () => {},
|
|
71
|
+
onProgress = () => {},
|
|
69
72
|
...rest
|
|
70
73
|
} = _ref6;
|
|
71
74
|
const viewport = useViewport();
|
|
@@ -73,13 +76,22 @@ const VideoPicker = _ref6 => {
|
|
|
73
76
|
stackViewDividerColor,
|
|
74
77
|
...themeTokens
|
|
75
78
|
} = useThemeTokens('VideoPicker');
|
|
76
|
-
const [currentVideoId, setCurrentVideoId] = useState(selectedVideo);
|
|
77
|
-
const videoPlayerRef = useRef(null);
|
|
79
|
+
const [currentVideoId, setCurrentVideoId] = React.useState(selectedVideo);
|
|
80
|
+
const videoPlayerRef = React.useRef(null);
|
|
78
81
|
const currentVideo = videoList.find(video => video.videoId === currentVideoId);
|
|
79
|
-
useEffect(() => {
|
|
82
|
+
React.useEffect(() => {
|
|
80
83
|
// Update current video if parent changes which video id it passes down
|
|
81
84
|
setCurrentVideoId(selectedVideo);
|
|
82
85
|
}, [selectedVideo]);
|
|
86
|
+
const addVideoEventHandlers = video => {
|
|
87
|
+
if (!video) return {};
|
|
88
|
+
return {
|
|
89
|
+
...video,
|
|
90
|
+
onPlay: video.onPlay || onPlay,
|
|
91
|
+
onPause: video.onPause || onPause,
|
|
92
|
+
onProgress: video.onProgress || onProgress
|
|
93
|
+
};
|
|
94
|
+
};
|
|
83
95
|
|
|
84
96
|
// `frame` variant should only work on larger screens
|
|
85
97
|
const isFramed = frame && [viewports.lg, viewports.xl].includes(viewport);
|
|
@@ -97,6 +109,7 @@ const VideoPicker = _ref6 => {
|
|
|
97
109
|
isFramed: isFramed
|
|
98
110
|
}, video.videoId));
|
|
99
111
|
return /*#__PURE__*/_jsx(VideoPickerContainer, {
|
|
112
|
+
ref: ref,
|
|
100
113
|
isFramed: isFramed,
|
|
101
114
|
...selectProps(rest),
|
|
102
115
|
...themeTokens,
|
|
@@ -117,7 +130,7 @@ const VideoPicker = _ref6 => {
|
|
|
117
130
|
...themeTokens,
|
|
118
131
|
isFramed: isFramed,
|
|
119
132
|
children: /*#__PURE__*/_jsx(VideoPickerPlayer, {
|
|
120
|
-
video: currentVideo,
|
|
133
|
+
video: addVideoEventHandlers(currentVideo, onPlay, onPause, onProgress),
|
|
121
134
|
videoPlayerRef: videoPlayerRef,
|
|
122
135
|
onStartVideo: onStartVideo
|
|
123
136
|
})
|
|
@@ -131,7 +144,8 @@ const VideoPicker = _ref6 => {
|
|
|
131
144
|
})]
|
|
132
145
|
})
|
|
133
146
|
});
|
|
134
|
-
};
|
|
147
|
+
});
|
|
148
|
+
VideoPicker.displayName = 'VideoPicker';
|
|
135
149
|
VideoPicker.propTypes = {
|
|
136
150
|
...selectedSystemPropTypes,
|
|
137
151
|
tokens: getTokensPropType('VideoPicker'),
|
|
@@ -156,6 +170,21 @@ VideoPicker.propTypes = {
|
|
|
156
170
|
* Callback function trigerred when a video is selected from the thumbnail list.
|
|
157
171
|
* @param {object} video - The video object that is selected.
|
|
158
172
|
*/
|
|
159
|
-
onSelectVideo: PropTypes.func
|
|
173
|
+
onSelectVideo: PropTypes.func,
|
|
174
|
+
/**
|
|
175
|
+
* Callback function trigerred during progress milestones 10% 25% 50% 75% 100%.
|
|
176
|
+
* @param {object} event - The event object.
|
|
177
|
+
*/
|
|
178
|
+
onProgress: PropTypes.func,
|
|
179
|
+
/**
|
|
180
|
+
* Callback function trigerred when the video player starts playing video.
|
|
181
|
+
* @param {object} event - The event object.
|
|
182
|
+
*/
|
|
183
|
+
onPlay: PropTypes.func,
|
|
184
|
+
/**
|
|
185
|
+
* Callback function trigerred when the video gets paused.
|
|
186
|
+
* @param {object} event - The event object.
|
|
187
|
+
*/
|
|
188
|
+
onPause: PropTypes.func
|
|
160
189
|
};
|
|
161
190
|
export default VideoPicker;
|
|
@@ -5,7 +5,7 @@ import WebVideo from '../WebVideo/WebVideo';
|
|
|
5
5
|
import { VideoPropType, RefPropType } from './videoPropType';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const VideoPickerPlayer = _ref => {
|
|
8
|
+
const VideoPickerPlayer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
9
9
|
let {
|
|
10
10
|
video = {},
|
|
11
11
|
videoPlayerRef,
|
|
@@ -16,6 +16,7 @@ const VideoPickerPlayer = _ref => {
|
|
|
16
16
|
tokens: {
|
|
17
17
|
flexShrink: 1
|
|
18
18
|
},
|
|
19
|
+
ref: ref,
|
|
19
20
|
children: [/*#__PURE__*/_jsx("div", {
|
|
20
21
|
ref: videoPlayerRef,
|
|
21
22
|
children: video.videoId && /*#__PURE__*/_jsx(WebVideo, {
|
|
@@ -37,7 +38,8 @@ const VideoPickerPlayer = _ref => {
|
|
|
37
38
|
})]
|
|
38
39
|
})]
|
|
39
40
|
});
|
|
40
|
-
};
|
|
41
|
+
});
|
|
42
|
+
VideoPickerPlayer.displayName = 'VideoPickerPlayer';
|
|
41
43
|
VideoPickerPlayer.propTypes = {
|
|
42
44
|
video: VideoPropType,
|
|
43
45
|
videoPlayerRef: RefPropType,
|
|
@@ -79,7 +79,7 @@ const ThumbnailTitleContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
79
79
|
displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
|
|
80
80
|
componentId: "components-web__sc-1glxurq-2"
|
|
81
81
|
})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
|
|
82
|
-
const VideoPickerThumbnail = _ref7 => {
|
|
82
|
+
const VideoPickerThumbnail = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
83
83
|
let {
|
|
84
84
|
videoPlayerRef,
|
|
85
85
|
selectedVideoId,
|
|
@@ -179,6 +179,7 @@ const VideoPickerThumbnail = _ref7 => {
|
|
|
179
179
|
outline: 'none'
|
|
180
180
|
}];
|
|
181
181
|
},
|
|
182
|
+
ref: ref,
|
|
182
183
|
children: _ref10 => {
|
|
183
184
|
let {
|
|
184
185
|
hovered: hover,
|
|
@@ -201,7 +202,8 @@ const VideoPickerThumbnail = _ref7 => {
|
|
|
201
202
|
});
|
|
202
203
|
}
|
|
203
204
|
}, video.videoId);
|
|
204
|
-
};
|
|
205
|
+
});
|
|
206
|
+
VideoPickerThumbnail.displayName = 'VideoPickerThumbnail';
|
|
205
207
|
VideoPickerThumbnail.propTypes = {
|
|
206
208
|
selectedVideoId: PropTypes.string,
|
|
207
209
|
onSelectVideo: PropTypes.func,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { HorizontalScroll, HorizontalScrollButton, horizontalScrollUtils, StackView, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
3
3
|
import View from "react-native-web/dist/exports/View";
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
@@ -6,13 +6,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
const {
|
|
7
7
|
useItemPositions
|
|
8
8
|
} = horizontalScrollUtils;
|
|
9
|
-
const VideoSlider = _ref => {
|
|
9
|
+
const VideoSlider = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
10
10
|
let {
|
|
11
11
|
children
|
|
12
12
|
} = _ref;
|
|
13
13
|
const viewport = useViewport();
|
|
14
14
|
const [itemPositions] = useItemPositions();
|
|
15
|
-
const [containerWidth, setContainerWidth] = useState(null);
|
|
15
|
+
const [containerWidth, setContainerWidth] = React.useState(null);
|
|
16
16
|
const {
|
|
17
17
|
previousIcon: PreviousIcon,
|
|
18
18
|
nextIcon: NextIcon
|
|
@@ -44,7 +44,7 @@ const VideoSlider = _ref => {
|
|
|
44
44
|
tokens: {
|
|
45
45
|
flexGrow: 1
|
|
46
46
|
},
|
|
47
|
-
children: React.Children.map(children, (child, index) => /*#__PURE__*/cloneElement(child, {
|
|
47
|
+
children: React.Children.map(children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
|
|
48
48
|
index,
|
|
49
49
|
itemPositions,
|
|
50
50
|
width: itemWidth
|
|
@@ -64,6 +64,7 @@ const VideoSlider = _ref => {
|
|
|
64
64
|
return /*#__PURE__*/_jsx(View, {
|
|
65
65
|
onLayout: onLayout,
|
|
66
66
|
style: overflow,
|
|
67
|
+
ref: ref,
|
|
67
68
|
children: containerWidth === null ?
|
|
68
69
|
// Use a 100% width non-scrollable parent until containerWidth is known, to avoid flicker
|
|
69
70
|
content : /*#__PURE__*/_jsx(HorizontalScroll, {
|
|
@@ -73,7 +74,8 @@ const VideoSlider = _ref => {
|
|
|
73
74
|
children: content
|
|
74
75
|
})
|
|
75
76
|
});
|
|
76
|
-
};
|
|
77
|
+
});
|
|
78
|
+
VideoSlider.displayName = 'VideoSlider';
|
|
77
79
|
VideoSlider.propTypes = {
|
|
78
80
|
children: PropTypes.node
|
|
79
81
|
};
|
|
@@ -69,7 +69,7 @@ const Center = /*#__PURE__*/styled('div').withConfig({
|
|
|
69
69
|
/**
|
|
70
70
|
* The WaffleGrid is used to show items in a waffle like manner with borders surrounding the element
|
|
71
71
|
*/
|
|
72
|
-
const WaffleGrid = _ref2 => {
|
|
72
|
+
const WaffleGrid = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
73
73
|
let {
|
|
74
74
|
items,
|
|
75
75
|
rowSize = null,
|
|
@@ -85,6 +85,7 @@ const WaffleGrid = _ref2 => {
|
|
|
85
85
|
});
|
|
86
86
|
const currentRowSize = useResponsiveProp(rowSize);
|
|
87
87
|
return /*#__PURE__*/_jsx(Container, {
|
|
88
|
+
ref: ref,
|
|
88
89
|
...selectProps(rest),
|
|
89
90
|
children: items.map(child => /*#__PURE__*/_createElement(Item, {
|
|
90
91
|
...themeTokens,
|
|
@@ -116,7 +117,8 @@ const WaffleGrid = _ref2 => {
|
|
|
116
117
|
})
|
|
117
118
|
})))
|
|
118
119
|
});
|
|
119
|
-
};
|
|
120
|
+
});
|
|
121
|
+
WaffleGrid.displayName = 'WaffleGrid';
|
|
120
122
|
WaffleGrid.propTypes = {
|
|
121
123
|
...selectedSystemPropTypes,
|
|
122
124
|
/**
|