@telus-uds/components-web 2.43.0 → 3.0.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/.eslintrc.cjs +26 -0
- package/CHANGELOG.md +21 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +105 -101
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +17 -4
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -506
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _VideoMenu = _interopRequireDefault(require("./Controls/VideoMenu/VideoMenu"));
|
|
15
|
-
var _videoText = _interopRequireDefault(require("../videoText"));
|
|
16
|
-
var _utils = require("../../utils");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
20
|
-
const getIcon = icon => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { StackView, useThemeTokens, selectSystemProps, Icon, useViewport } from '@telus-uds/components-base';
|
|
5
|
+
import VideoProgressBar from './Controls/VideoProgressBar/VideoProgressBar';
|
|
6
|
+
import VolumeSlider from './Controls/VolumeSlider/VolumeSlider';
|
|
7
|
+
import VideoButton from './Controls/VideoButton/VideoButton';
|
|
8
|
+
import VideoMenu from './Controls/VideoMenu/VideoMenu';
|
|
9
|
+
import videoText from '../videoText';
|
|
10
|
+
import { htmlAttrs } from '../../utils';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
13
|
+
const getIcon = icon => /*#__PURE__*/_jsx(Icon, {
|
|
21
14
|
icon: icon
|
|
22
15
|
});
|
|
23
|
-
const ControlBarContainer = /*#__PURE__*/
|
|
16
|
+
const ControlBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
24
17
|
displayName: "ControlBar__ControlBarContainer",
|
|
25
18
|
componentId: "components-web__sc-13y61ky-0"
|
|
26
19
|
})(_ref => {
|
|
@@ -36,7 +29,7 @@ const ControlBarContainer = /*#__PURE__*/_styledComponents.default.div.withConfi
|
|
|
36
29
|
display: isMobile ? 'none' : undefined
|
|
37
30
|
};
|
|
38
31
|
});
|
|
39
|
-
const StyledControlBar = /*#__PURE__*/
|
|
32
|
+
const StyledControlBar = /*#__PURE__*/styled.div.withConfig({
|
|
40
33
|
displayName: "ControlBar__StyledControlBar",
|
|
41
34
|
componentId: "components-web__sc-13y61ky-1"
|
|
42
35
|
})(_ref2 => {
|
|
@@ -59,14 +52,14 @@ const StyledControlBar = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
59
52
|
zIndex: 9
|
|
60
53
|
};
|
|
61
54
|
});
|
|
62
|
-
const VideoProgressBarContainer = /*#__PURE__*/
|
|
55
|
+
const VideoProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
63
56
|
displayName: "ControlBar__VideoProgressBarContainer",
|
|
64
57
|
componentId: "components-web__sc-13y61ky-2"
|
|
65
58
|
})({
|
|
66
59
|
display: 'flex',
|
|
67
60
|
flexGrow: 1
|
|
68
61
|
});
|
|
69
|
-
const MenuContainer = /*#__PURE__*/
|
|
62
|
+
const MenuContainer = /*#__PURE__*/styled.div.withConfig({
|
|
70
63
|
displayName: "ControlBar__MenuContainer",
|
|
71
64
|
componentId: "components-web__sc-13y61ky-3"
|
|
72
65
|
})(_ref3 => {
|
|
@@ -123,7 +116,7 @@ const ControlBar = _ref4 => {
|
|
|
123
116
|
variant,
|
|
124
117
|
...rest
|
|
125
118
|
} = _ref4;
|
|
126
|
-
const viewport =
|
|
119
|
+
const viewport = useViewport();
|
|
127
120
|
const {
|
|
128
121
|
paddingTop,
|
|
129
122
|
paddingBottom,
|
|
@@ -137,7 +130,7 @@ const ControlBar = _ref4 => {
|
|
|
137
130
|
minimizeIcon,
|
|
138
131
|
maximizeIcon,
|
|
139
132
|
height
|
|
140
|
-
} =
|
|
133
|
+
} = useThemeTokens('VideoControlBar', tokens, variant, {
|
|
141
134
|
viewport
|
|
142
135
|
});
|
|
143
136
|
const parseVideoQuality = () => {
|
|
@@ -154,12 +147,12 @@ const ControlBar = _ref4 => {
|
|
|
154
147
|
const parseTracks = () => {
|
|
155
148
|
const parsed = tracks.map((track, trackNumber) => {
|
|
156
149
|
return {
|
|
157
|
-
name:
|
|
150
|
+
name: videoText[copy][track.language],
|
|
158
151
|
value: trackNumber
|
|
159
152
|
};
|
|
160
153
|
});
|
|
161
154
|
parsed.unshift({
|
|
162
|
-
name:
|
|
155
|
+
name: videoText[copy].captionsNone,
|
|
163
156
|
value: -1
|
|
164
157
|
});
|
|
165
158
|
return parsed;
|
|
@@ -169,15 +162,15 @@ const ControlBar = _ref4 => {
|
|
|
169
162
|
menuRight,
|
|
170
163
|
menuMarginLeft
|
|
171
164
|
};
|
|
172
|
-
return /*#__PURE__*/(
|
|
165
|
+
return /*#__PURE__*/_jsx(ControlBarContainer, {
|
|
173
166
|
isHidden: isHidden,
|
|
174
167
|
isMobile: isMobile,
|
|
175
168
|
...selectProps(rest),
|
|
176
|
-
children: /*#__PURE__*/(
|
|
169
|
+
children: /*#__PURE__*/_jsxs(StyledControlBar, {
|
|
177
170
|
padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
|
|
178
171
|
height: `${height}px`,
|
|
179
|
-
children: [/*#__PURE__*/(
|
|
180
|
-
children: /*#__PURE__*/(
|
|
172
|
+
children: [/*#__PURE__*/_jsx(VideoProgressBarContainer, {
|
|
173
|
+
children: /*#__PURE__*/_jsx(VideoProgressBar, {
|
|
181
174
|
copy: copy,
|
|
182
175
|
videoPlayer: videoPlayer,
|
|
183
176
|
playing: videoPlaying,
|
|
@@ -187,7 +180,7 @@ const ControlBar = _ref4 => {
|
|
|
187
180
|
setSeek: setSeek,
|
|
188
181
|
resetInactivityTimer: resetInactivityTimer
|
|
189
182
|
})
|
|
190
|
-
}), /*#__PURE__*/(
|
|
183
|
+
}), /*#__PURE__*/_jsx(VolumeSlider, {
|
|
191
184
|
videoPlayer: videoPlayer,
|
|
192
185
|
videoCurrentVolume: videoCurrentVolume,
|
|
193
186
|
setVolume: setVolume,
|
|
@@ -198,12 +191,12 @@ const ControlBar = _ref4 => {
|
|
|
198
191
|
compactModeThreshold: compactModeThreshold,
|
|
199
192
|
videoPlayerWidth: videoPlayerWidth,
|
|
200
193
|
disableFocus: videoUnplayed
|
|
201
|
-
}), /*#__PURE__*/(
|
|
194
|
+
}), /*#__PURE__*/_jsxs(StackView, {
|
|
202
195
|
space: 3,
|
|
203
196
|
direction: "row",
|
|
204
|
-
children: [tracksAvailable && /*#__PURE__*/(
|
|
197
|
+
children: [tracksAvailable && /*#__PURE__*/_jsx(VideoButton, {
|
|
205
198
|
disableFocus: videoUnplayed,
|
|
206
|
-
label:
|
|
199
|
+
label: videoText[copy].captionsToggle,
|
|
207
200
|
icon: getIcon(captionsIcon),
|
|
208
201
|
onClick: () => {
|
|
209
202
|
setCaptionsMenuOpen(!captionsMenuOpen);
|
|
@@ -212,9 +205,9 @@ const ControlBar = _ref4 => {
|
|
|
212
205
|
},
|
|
213
206
|
onFocus: resetInactivityTimer,
|
|
214
207
|
onBlur: resetInactivityTimer
|
|
215
|
-
}), /*#__PURE__*/(
|
|
208
|
+
}), /*#__PURE__*/_jsx(VideoButton, {
|
|
216
209
|
disableFocus: videoUnplayed,
|
|
217
|
-
label:
|
|
210
|
+
label: videoText[copy].qualityToggle,
|
|
218
211
|
icon: getIcon(settingsIcon),
|
|
219
212
|
onClick: () => {
|
|
220
213
|
setQualityMenuOpen(!qualityMenuOpen);
|
|
@@ -223,29 +216,29 @@ const ControlBar = _ref4 => {
|
|
|
223
216
|
},
|
|
224
217
|
onFocus: resetInactivityTimer,
|
|
225
218
|
onBlur: resetInactivityTimer
|
|
226
|
-
}), /*#__PURE__*/(
|
|
219
|
+
}), /*#__PURE__*/_jsx(VideoButton, {
|
|
227
220
|
disableFocus: videoUnplayed,
|
|
228
|
-
label:
|
|
221
|
+
label: videoText[copy].fullScreenToggle,
|
|
229
222
|
icon: videoIsFullscreen ? getIcon(minimizeIcon) : getIcon(maximizeIcon),
|
|
230
223
|
onClick: toggleFullscreen,
|
|
231
224
|
onFocus: resetInactivityTimer,
|
|
232
225
|
onBlur: resetInactivityTimer
|
|
233
226
|
})]
|
|
234
|
-
}), captionsMenuOpen && /*#__PURE__*/(
|
|
227
|
+
}), captionsMenuOpen && /*#__PURE__*/_jsx(MenuContainer, {
|
|
235
228
|
isOpen: captionsMenuOpen,
|
|
236
229
|
...menuContainerStyleProps,
|
|
237
|
-
children: /*#__PURE__*/(
|
|
238
|
-
menuLabel:
|
|
230
|
+
children: /*#__PURE__*/_jsx(VideoMenu, {
|
|
231
|
+
menuLabel: videoText[copy].captionsDialogue,
|
|
239
232
|
menuOptions: parseTracks(),
|
|
240
233
|
setSelection: setTextTracks,
|
|
241
234
|
selectedItem: selectedTextTrack,
|
|
242
235
|
copy: copy
|
|
243
236
|
})
|
|
244
|
-
}), qualityMenuOpen && /*#__PURE__*/(
|
|
237
|
+
}), qualityMenuOpen && /*#__PURE__*/_jsx(MenuContainer, {
|
|
245
238
|
isOpen: qualityMenuOpen,
|
|
246
239
|
...menuContainerStyleProps,
|
|
247
|
-
children: /*#__PURE__*/(
|
|
248
|
-
menuLabel:
|
|
240
|
+
children: /*#__PURE__*/_jsx(VideoMenu, {
|
|
241
|
+
menuLabel: videoText[copy].qualityDialogue,
|
|
249
242
|
menuOptions: parseVideoQuality(),
|
|
250
243
|
setSelection: setVideoQuality,
|
|
251
244
|
selectedItem: videoQuality,
|
|
@@ -257,39 +250,38 @@ const ControlBar = _ref4 => {
|
|
|
257
250
|
};
|
|
258
251
|
ControlBar.propTypes = {
|
|
259
252
|
...selectedSystemPropTypes,
|
|
260
|
-
videoPlayer:
|
|
261
|
-
videoPlayerContainer:
|
|
262
|
-
sources:
|
|
263
|
-
tracks:
|
|
264
|
-
videoPlaying:
|
|
265
|
-
videoUnplayed:
|
|
266
|
-
videoBufferEnd:
|
|
267
|
-
isHidden:
|
|
268
|
-
videoLength:
|
|
269
|
-
videoCurrentTime:
|
|
270
|
-
videoCurrentVolume:
|
|
271
|
-
videoIsMuted:
|
|
272
|
-
setVolume:
|
|
273
|
-
isMobile:
|
|
274
|
-
tracksAvailable:
|
|
275
|
-
togglePlayPause:
|
|
276
|
-
setSeek:
|
|
277
|
-
toggleMute:
|
|
278
|
-
toggleFullscreen:
|
|
279
|
-
videoIsFullscreen:
|
|
280
|
-
setTextTracks:
|
|
281
|
-
selectedTextTrack:
|
|
282
|
-
resetInactivityTimer:
|
|
283
|
-
videoQuality:
|
|
284
|
-
setVideoQuality:
|
|
285
|
-
captionsMenuOpen:
|
|
286
|
-
setCaptionsMenuOpen:
|
|
287
|
-
qualityMenuOpen:
|
|
288
|
-
setQualityMenuOpen:
|
|
289
|
-
clearInactivityTimer:
|
|
290
|
-
copy:
|
|
291
|
-
compactModeThreshold:
|
|
292
|
-
videoPlayerWidth:
|
|
253
|
+
videoPlayer: PropTypes.object.isRequired,
|
|
254
|
+
videoPlayerContainer: PropTypes.object.isRequired,
|
|
255
|
+
sources: PropTypes.array.isRequired,
|
|
256
|
+
tracks: PropTypes.array,
|
|
257
|
+
videoPlaying: PropTypes.bool.isRequired,
|
|
258
|
+
videoUnplayed: PropTypes.bool.isRequired,
|
|
259
|
+
videoBufferEnd: PropTypes.number.isRequired,
|
|
260
|
+
isHidden: PropTypes.bool,
|
|
261
|
+
videoLength: PropTypes.number.isRequired,
|
|
262
|
+
videoCurrentTime: PropTypes.number.isRequired,
|
|
263
|
+
videoCurrentVolume: PropTypes.number.isRequired,
|
|
264
|
+
videoIsMuted: PropTypes.bool.isRequired,
|
|
265
|
+
setVolume: PropTypes.func.isRequired,
|
|
266
|
+
isMobile: PropTypes.bool.isRequired,
|
|
267
|
+
tracksAvailable: PropTypes.bool.isRequired,
|
|
268
|
+
togglePlayPause: PropTypes.func.isRequired,
|
|
269
|
+
setSeek: PropTypes.func.isRequired,
|
|
270
|
+
toggleMute: PropTypes.func.isRequired,
|
|
271
|
+
toggleFullscreen: PropTypes.func.isRequired,
|
|
272
|
+
videoIsFullscreen: PropTypes.bool.isRequired,
|
|
273
|
+
setTextTracks: PropTypes.func.isRequired,
|
|
274
|
+
selectedTextTrack: PropTypes.number.isRequired,
|
|
275
|
+
resetInactivityTimer: PropTypes.func.isRequired,
|
|
276
|
+
videoQuality: PropTypes.number.isRequired,
|
|
277
|
+
setVideoQuality: PropTypes.func.isRequired,
|
|
278
|
+
captionsMenuOpen: PropTypes.bool.isRequired,
|
|
279
|
+
setCaptionsMenuOpen: PropTypes.func.isRequired,
|
|
280
|
+
qualityMenuOpen: PropTypes.bool.isRequired,
|
|
281
|
+
setQualityMenuOpen: PropTypes.func.isRequired,
|
|
282
|
+
clearInactivityTimer: PropTypes.func.isRequired,
|
|
283
|
+
copy: PropTypes.oneOf(['en', 'fr']).isRequired,
|
|
284
|
+
compactModeThreshold: PropTypes.number.isRequired,
|
|
285
|
+
videoPlayerWidth: PropTypes.number.isRequired
|
|
293
286
|
};
|
|
294
|
-
|
|
295
|
-
exports.default = _default;
|
|
287
|
+
export default ControlBar;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _utils = require("../../../../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
-
const StyledButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { useThemeTokens, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
+
import { htmlAttrs } from '../../../../utils';
|
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
+
const StyledButton = /*#__PURE__*/styled.button.withConfig({
|
|
16
9
|
displayName: "VideoButton__StyledButton",
|
|
17
10
|
componentId: "components-web__sc-kfw0tr-0"
|
|
18
11
|
})(_ref => {
|
|
@@ -43,7 +36,7 @@ const VideoButton = _ref2 => {
|
|
|
43
36
|
} = _ref2;
|
|
44
37
|
const {
|
|
45
38
|
color
|
|
46
|
-
} =
|
|
39
|
+
} = useThemeTokens('VideoButton', tokens, variant);
|
|
47
40
|
const handleOnKeyDown = event => {
|
|
48
41
|
const key = event.key || event.keyCode;
|
|
49
42
|
|
|
@@ -55,9 +48,9 @@ const VideoButton = _ref2 => {
|
|
|
55
48
|
const handleClick = event => {
|
|
56
49
|
var _rest$onClick;
|
|
57
50
|
event.preventDefault();
|
|
58
|
-
(_rest$onClick = rest.onClick) === null || _rest$onClick === void 0
|
|
51
|
+
(_rest$onClick = rest.onClick) === null || _rest$onClick === void 0 || _rest$onClick.call(rest, event);
|
|
59
52
|
};
|
|
60
|
-
return /*#__PURE__*/(
|
|
53
|
+
return /*#__PURE__*/_jsxs(StyledButton, {
|
|
61
54
|
"aria-label": label,
|
|
62
55
|
onKeyDown: handleOnKeyDown,
|
|
63
56
|
tabIndex: disableFocus ? '-1' : undefined,
|
|
@@ -69,10 +62,9 @@ const VideoButton = _ref2 => {
|
|
|
69
62
|
};
|
|
70
63
|
VideoButton.propTypes = {
|
|
71
64
|
...selectedSystemPropTypes,
|
|
72
|
-
icon:
|
|
73
|
-
label:
|
|
74
|
-
disableFocus:
|
|
75
|
-
children:
|
|
65
|
+
icon: PropTypes.element.isRequired,
|
|
66
|
+
label: PropTypes.string.isRequired,
|
|
67
|
+
disableFocus: PropTypes.bool.isRequired,
|
|
68
|
+
children: PropTypes.node
|
|
76
69
|
};
|
|
77
|
-
|
|
78
|
-
exports.default = _default;
|
|
70
|
+
export default VideoButton;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _videoText = _interopRequireDefault(require("../../../videoText"));
|
|
12
|
-
var _utils = require("../../../../utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
16
|
-
const MenuContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { StackView, Typography, useThemeTokens, selectSystemProps, Icon } from '@telus-uds/components-base';
|
|
5
|
+
import videoText from '../../../videoText';
|
|
6
|
+
import { htmlAttrs } from '../../../../utils';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
+
const MenuContainer = /*#__PURE__*/styled.div.withConfig({
|
|
17
10
|
displayName: "VideoMenu__MenuContainer",
|
|
18
11
|
componentId: "components-web__sc-nllbhw-0"
|
|
19
12
|
})(_ref => {
|
|
@@ -28,7 +21,7 @@ const MenuContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
28
21
|
borderRadius: 5
|
|
29
22
|
};
|
|
30
23
|
});
|
|
31
|
-
const MenuButton = /*#__PURE__*/
|
|
24
|
+
const MenuButton = /*#__PURE__*/styled.button.withConfig({
|
|
32
25
|
displayName: "VideoMenu__MenuButton",
|
|
33
26
|
componentId: "components-web__sc-nllbhw-1"
|
|
34
27
|
})({
|
|
@@ -41,7 +34,7 @@ const MenuButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
41
34
|
justifyContent: 'space-between',
|
|
42
35
|
verticalAlign: 'middle'
|
|
43
36
|
});
|
|
44
|
-
const CheckmarkContainer = /*#__PURE__*/
|
|
37
|
+
const CheckmarkContainer = /*#__PURE__*/styled.div.withConfig({
|
|
45
38
|
displayName: "VideoMenu__CheckmarkContainer",
|
|
46
39
|
componentId: "components-web__sc-nllbhw-2"
|
|
47
40
|
})(_ref2 => {
|
|
@@ -91,14 +84,14 @@ const VideoMenu = _ref3 => {
|
|
|
91
84
|
checkMarkFocusColor,
|
|
92
85
|
checkMarkUnselectedColor,
|
|
93
86
|
checkMarkIcon
|
|
94
|
-
} =
|
|
87
|
+
} = useThemeTokens('VideoMenu', tokens, variant);
|
|
95
88
|
const getMenuItems = () => {
|
|
96
89
|
return menuOptions.map(option => {
|
|
97
90
|
if (option.name) {
|
|
98
|
-
return /*#__PURE__*/(
|
|
91
|
+
return /*#__PURE__*/_jsxs(MenuButton, {
|
|
99
92
|
"aria-haspopup": "true",
|
|
100
93
|
role: "menuitem",
|
|
101
|
-
"aria-label": `${option.name} ${menuLabel}. ${selectedItem === option.value ?
|
|
94
|
+
"aria-label": `${option.name} ${menuLabel}. ${selectedItem === option.value ? videoText[copy].itemSelected : videoText[copy].itemUnselected}`,
|
|
102
95
|
selectedItem: selectedItem,
|
|
103
96
|
itemValue: option.value,
|
|
104
97
|
onClick: () => {
|
|
@@ -106,13 +99,13 @@ const VideoMenu = _ref3 => {
|
|
|
106
99
|
setSelection(option.value);
|
|
107
100
|
}
|
|
108
101
|
},
|
|
109
|
-
children: [/*#__PURE__*/(
|
|
102
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
110
103
|
variant: {
|
|
111
104
|
bold: true,
|
|
112
105
|
inverse: true
|
|
113
106
|
},
|
|
114
107
|
children: option.name
|
|
115
|
-
}), /*#__PURE__*/(
|
|
108
|
+
}), /*#__PURE__*/_jsx(CheckmarkContainer, {
|
|
116
109
|
isSelectedItem: option.value === selectedItem,
|
|
117
110
|
checkMarkWidth: checkMarkWidth,
|
|
118
111
|
checkMarkHeight: checkMarkHeight,
|
|
@@ -120,7 +113,7 @@ const VideoMenu = _ref3 => {
|
|
|
120
113
|
checkMarkHoverColor: checkMarkHoverColor,
|
|
121
114
|
checkMarkFocusColor: checkMarkFocusColor,
|
|
122
115
|
checkMarkUnselectedColor: checkMarkUnselectedColor,
|
|
123
|
-
children: /*#__PURE__*/(
|
|
116
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
124
117
|
icon: checkMarkIcon
|
|
125
118
|
})
|
|
126
119
|
})]
|
|
@@ -137,21 +130,21 @@ const VideoMenu = _ref3 => {
|
|
|
137
130
|
event.stopPropagation();
|
|
138
131
|
}
|
|
139
132
|
};
|
|
140
|
-
return /*#__PURE__*/(
|
|
133
|
+
return /*#__PURE__*/_jsx(MenuContainer, {
|
|
141
134
|
onKeyDown: handleOnKeyDown,
|
|
142
135
|
padding: padding,
|
|
143
136
|
background: background,
|
|
144
137
|
...selectProps(rest),
|
|
145
|
-
children: /*#__PURE__*/(
|
|
138
|
+
children: /*#__PURE__*/_jsxs(StackView, {
|
|
146
139
|
space: 2,
|
|
147
140
|
divider: true,
|
|
148
|
-
children: [/*#__PURE__*/(
|
|
141
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
149
142
|
variant: {
|
|
150
143
|
bold: true,
|
|
151
144
|
inverse: true
|
|
152
145
|
},
|
|
153
146
|
children: menuLabel
|
|
154
|
-
}), /*#__PURE__*/(
|
|
147
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
155
148
|
role: "menu",
|
|
156
149
|
children: getMenuItems()
|
|
157
150
|
})]
|
|
@@ -160,11 +153,10 @@ const VideoMenu = _ref3 => {
|
|
|
160
153
|
};
|
|
161
154
|
VideoMenu.propTypes = {
|
|
162
155
|
...selectedSystemPropTypes,
|
|
163
|
-
menuLabel:
|
|
164
|
-
menuOptions:
|
|
165
|
-
setSelection:
|
|
166
|
-
selectedItem:
|
|
167
|
-
copy:
|
|
156
|
+
menuLabel: PropTypes.string.isRequired,
|
|
157
|
+
menuOptions: PropTypes.array.isRequired,
|
|
158
|
+
setSelection: PropTypes.func.isRequired,
|
|
159
|
+
selectedItem: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
|
|
160
|
+
copy: PropTypes.oneOf(['en', 'fr']).isRequired
|
|
168
161
|
};
|
|
169
|
-
|
|
170
|
-
exports.default = _default;
|
|
162
|
+
export default VideoMenu;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _videoText = _interopRequireDefault(require("../../../videoText"));
|
|
12
|
-
var _utils = require("../../../../utils");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
16
|
-
const ProgressBarContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Typography, useThemeTokens, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
+
import videoText from '../../../videoText';
|
|
6
|
+
import { htmlAttrs } from '../../../../utils';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
+
const ProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
17
10
|
displayName: "VideoProgressBar__ProgressBarContainer",
|
|
18
11
|
componentId: "components-web__sc-d9tm07-0"
|
|
19
12
|
})({
|
|
@@ -51,8 +44,7 @@ const sharedStyles = _ref => {
|
|
|
51
44
|
})
|
|
52
45
|
};
|
|
53
46
|
};
|
|
54
|
-
|
|
55
|
-
const StyledProgressBar = /*#__PURE__*/_styledComponents.default.input.attrs(_ref2 => {
|
|
47
|
+
const StyledProgressBar = /*#__PURE__*/styled.input.attrs(_ref2 => {
|
|
56
48
|
let {
|
|
57
49
|
videoCurrentTime
|
|
58
50
|
} = _ref2;
|
|
@@ -105,7 +97,7 @@ const StyledProgressBar = /*#__PURE__*/_styledComponents.default.input.attrs(_re
|
|
|
105
97
|
}
|
|
106
98
|
};
|
|
107
99
|
});
|
|
108
|
-
const StyledTimestamp = /*#__PURE__*/
|
|
100
|
+
const StyledTimestamp = /*#__PURE__*/styled.span.withConfig({
|
|
109
101
|
displayName: "VideoProgressBar__StyledTimestamp",
|
|
110
102
|
componentId: "components-web__sc-d9tm07-2"
|
|
111
103
|
})(_ref4 => {
|
|
@@ -144,10 +136,10 @@ const VideoProgressBar = _ref5 => {
|
|
|
144
136
|
trackGradientStart,
|
|
145
137
|
trackGradientEnd,
|
|
146
138
|
rangeBackground
|
|
147
|
-
} =
|
|
139
|
+
} = useThemeTokens('VideoProgressBar', tokens, variant, {
|
|
148
140
|
playing
|
|
149
141
|
});
|
|
150
|
-
const videoProgressBar = /*#__PURE__*/
|
|
142
|
+
const videoProgressBar = /*#__PURE__*/React.createRef();
|
|
151
143
|
const handleVideoSkip = () => {
|
|
152
144
|
setSeek(videoProgressBar.current.value);
|
|
153
145
|
};
|
|
@@ -165,18 +157,18 @@ const VideoProgressBar = _ref5 => {
|
|
|
165
157
|
trackGradientEnd,
|
|
166
158
|
rangeBackground
|
|
167
159
|
};
|
|
168
|
-
return /*#__PURE__*/(
|
|
160
|
+
return /*#__PURE__*/_jsxs(ProgressBarContainer, {
|
|
169
161
|
...selectProps(rest),
|
|
170
|
-
children: [/*#__PURE__*/(
|
|
162
|
+
children: [/*#__PURE__*/_jsx(StyledTimestamp, {
|
|
171
163
|
margin: `0 ${timestampMarginRight}px 0 ${timestampMarginLeft}px`,
|
|
172
|
-
children: /*#__PURE__*/(
|
|
164
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
173
165
|
variant: {
|
|
174
166
|
inverse: true
|
|
175
167
|
},
|
|
176
168
|
children: currentTimestamp
|
|
177
169
|
})
|
|
178
|
-
}), /*#__PURE__*/(
|
|
179
|
-
"aria-label":
|
|
170
|
+
}), /*#__PURE__*/_jsx(StyledProgressBar, {
|
|
171
|
+
"aria-label": videoText[copy].videoProgressBarLabel,
|
|
180
172
|
type: "range",
|
|
181
173
|
step: "any",
|
|
182
174
|
max: videoLength,
|
|
@@ -187,8 +179,8 @@ const VideoProgressBar = _ref5 => {
|
|
|
187
179
|
ref: videoProgressBar,
|
|
188
180
|
tabIndex: "-1",
|
|
189
181
|
...sharedProps
|
|
190
|
-
}), /*#__PURE__*/(
|
|
191
|
-
children: /*#__PURE__*/(
|
|
182
|
+
}), /*#__PURE__*/_jsx(StyledTimestamp, {
|
|
183
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
192
184
|
variant: {
|
|
193
185
|
inverse: true
|
|
194
186
|
},
|
|
@@ -199,12 +191,11 @@ const VideoProgressBar = _ref5 => {
|
|
|
199
191
|
};
|
|
200
192
|
VideoProgressBar.propTypes = {
|
|
201
193
|
...selectedSystemPropTypes,
|
|
202
|
-
copy:
|
|
203
|
-
videoLength:
|
|
204
|
-
videoCurrentTime:
|
|
205
|
-
videoBufferEnd:
|
|
206
|
-
setSeek:
|
|
207
|
-
resetInactivityTimer:
|
|
194
|
+
copy: PropTypes.oneOf(['en', 'fr']),
|
|
195
|
+
videoLength: PropTypes.number.isRequired,
|
|
196
|
+
videoCurrentTime: PropTypes.number.isRequired,
|
|
197
|
+
videoBufferEnd: PropTypes.number.isRequired,
|
|
198
|
+
setSeek: PropTypes.func.isRequired,
|
|
199
|
+
resetInactivityTimer: PropTypes.func.isRequired
|
|
208
200
|
};
|
|
209
|
-
|
|
210
|
-
exports.default = _default;
|
|
201
|
+
export default VideoProgressBar;
|