@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,203 +0,0 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
-
const ProgressBarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
11
|
-
displayName: "VideoProgressBar__ProgressBarContainer",
|
|
12
|
-
componentId: "components-web__sc-d9tm07-0"
|
|
13
|
-
})({
|
|
14
|
-
display: 'flex',
|
|
15
|
-
width: '100%',
|
|
16
|
-
alignItems: 'center'
|
|
17
|
-
});
|
|
18
|
-
const sharedStyles = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
thumbHeight,
|
|
21
|
-
thumbWidth,
|
|
22
|
-
thumbBackground,
|
|
23
|
-
trackGradientStart,
|
|
24
|
-
trackGradientEnd
|
|
25
|
-
} = _ref;
|
|
26
|
-
return {
|
|
27
|
-
thumb: {
|
|
28
|
-
appearance: 'none',
|
|
29
|
-
height: thumbHeight,
|
|
30
|
-
width: thumbWidth,
|
|
31
|
-
borderRadius: '50%',
|
|
32
|
-
background: thumbBackground,
|
|
33
|
-
cursor: 'pointer',
|
|
34
|
-
marginTop: -3,
|
|
35
|
-
'&:hover': {
|
|
36
|
-
transform: 'scale(1.5)'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
track: videoBufferDisplay => ({
|
|
40
|
-
width: '100%',
|
|
41
|
-
height: 2,
|
|
42
|
-
cursor: 'pointer',
|
|
43
|
-
borderRadius: 1.3,
|
|
44
|
-
background: `linear-gradient(to right, ${trackGradientStart} 0%,${trackGradientEnd} ${videoBufferDisplay - 0.01}% ,rgba(255,255,255,0.5) ${videoBufferDisplay}%)` // TODO: replace with opaque white from palette
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
const StyledProgressBar = /*#__PURE__*/styled.input.attrs(_ref2 => {
|
|
50
|
-
let {
|
|
51
|
-
videoCurrentTime
|
|
52
|
-
} = _ref2;
|
|
53
|
-
return {
|
|
54
|
-
value: videoCurrentTime
|
|
55
|
-
};
|
|
56
|
-
}).withConfig({
|
|
57
|
-
displayName: "VideoProgressBar__StyledProgressBar",
|
|
58
|
-
componentId: "components-web__sc-d9tm07-1"
|
|
59
|
-
})(_ref3 => {
|
|
60
|
-
let {
|
|
61
|
-
videoBufferDisplay,
|
|
62
|
-
rangeBackground,
|
|
63
|
-
...sharedProps
|
|
64
|
-
} = _ref3;
|
|
65
|
-
return {
|
|
66
|
-
width: '100%',
|
|
67
|
-
cursor: 'pointer',
|
|
68
|
-
padding: '5px 0',
|
|
69
|
-
'input[type=range]&': {
|
|
70
|
-
appearance: 'none',
|
|
71
|
-
width: '100%',
|
|
72
|
-
background: rangeBackground
|
|
73
|
-
},
|
|
74
|
-
'input[type=range]&:focus': {
|
|
75
|
-
outline: 'none'
|
|
76
|
-
},
|
|
77
|
-
'input[type=range]&::-webkit-slider-thumb': sharedStyles(sharedProps).thumb,
|
|
78
|
-
'input[type=range]&::-moz-range-thumb': {
|
|
79
|
-
...sharedStyles(sharedProps).thumb,
|
|
80
|
-
border: 'none'
|
|
81
|
-
},
|
|
82
|
-
'input[type=range]&::-ms-thumb': {
|
|
83
|
-
...sharedStyles(sharedProps).thumb,
|
|
84
|
-
margin: 0,
|
|
85
|
-
border: 'none'
|
|
86
|
-
},
|
|
87
|
-
'input[type=range]&::-webkit-slider-runnable-track': sharedStyles(sharedProps).track(videoBufferDisplay),
|
|
88
|
-
'input[type=range]&::-moz-range-track': sharedStyles(sharedProps).track(videoBufferDisplay),
|
|
89
|
-
'input[type=range]&::-ms-track': {
|
|
90
|
-
...sharedStyles(sharedProps).track(videoBufferDisplay),
|
|
91
|
-
margin: '6px 0',
|
|
92
|
-
border: 'none'
|
|
93
|
-
},
|
|
94
|
-
'input[type=range]&::-ms-fill-lower': {
|
|
95
|
-
background: rangeBackground
|
|
96
|
-
},
|
|
97
|
-
'input[type=range]&::-ms-tooltip': {
|
|
98
|
-
display: 'none'
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
});
|
|
102
|
-
const StyledTimestamp = /*#__PURE__*/styled.span.withConfig({
|
|
103
|
-
displayName: "VideoProgressBar__StyledTimestamp",
|
|
104
|
-
componentId: "components-web__sc-d9tm07-2"
|
|
105
|
-
})(_ref4 => {
|
|
106
|
-
let {
|
|
107
|
-
margin
|
|
108
|
-
} = _ref4;
|
|
109
|
-
return {
|
|
110
|
-
margin
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
// TODO: unify with the helper from `VideoSplash`
|
|
114
|
-
function getTimestamp(duration) {
|
|
115
|
-
const minutes = Math.floor(duration / 60);
|
|
116
|
-
const seconds = Math.floor(duration - 60 * minutes);
|
|
117
|
-
return `${minutes}:${seconds < 10 ? 0 : ''}${seconds}`;
|
|
118
|
-
}
|
|
119
|
-
const VideoProgressBar = _ref5 => {
|
|
120
|
-
let {
|
|
121
|
-
copy = 'en',
|
|
122
|
-
videoLength,
|
|
123
|
-
videoCurrentTime,
|
|
124
|
-
videoBufferEnd,
|
|
125
|
-
playing,
|
|
126
|
-
setSeek,
|
|
127
|
-
resetInactivityTimer,
|
|
128
|
-
tokens,
|
|
129
|
-
variant,
|
|
130
|
-
...rest
|
|
131
|
-
} = _ref5;
|
|
132
|
-
const {
|
|
133
|
-
thumbHeight,
|
|
134
|
-
thumbWidth,
|
|
135
|
-
thumbBackground,
|
|
136
|
-
timestampMarginLeft,
|
|
137
|
-
timestampMarginRight,
|
|
138
|
-
trackGradientStart,
|
|
139
|
-
trackGradientEnd,
|
|
140
|
-
rangeBackground
|
|
141
|
-
} = useThemeTokens('VideoProgressBar', tokens, variant, {
|
|
142
|
-
playing
|
|
143
|
-
});
|
|
144
|
-
const videoProgressBar = /*#__PURE__*/React.createRef();
|
|
145
|
-
const handleVideoSkip = () => {
|
|
146
|
-
setSeek(videoProgressBar.current.value);
|
|
147
|
-
};
|
|
148
|
-
const videoBufferDisplay = videoBufferEnd / videoLength * 100;
|
|
149
|
-
const isVideoUnplayed = videoCurrentTime === -1;
|
|
150
|
-
const currentTime = isVideoUnplayed ? 0 : videoCurrentTime;
|
|
151
|
-
const remainingTime = isVideoUnplayed ? videoLength : videoLength - videoCurrentTime;
|
|
152
|
-
const currentTimestamp = getTimestamp(currentTime);
|
|
153
|
-
const remainingTimestamp = getTimestamp(remainingTime);
|
|
154
|
-
const sharedProps = {
|
|
155
|
-
thumbWidth,
|
|
156
|
-
thumbHeight,
|
|
157
|
-
thumbBackground,
|
|
158
|
-
trackGradientStart,
|
|
159
|
-
trackGradientEnd,
|
|
160
|
-
rangeBackground
|
|
161
|
-
};
|
|
162
|
-
return /*#__PURE__*/_jsxs(ProgressBarContainer, {
|
|
163
|
-
...selectProps(rest),
|
|
164
|
-
children: [/*#__PURE__*/_jsx(StyledTimestamp, {
|
|
165
|
-
margin: `0 ${timestampMarginRight}px 0 ${timestampMarginLeft}px`,
|
|
166
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
167
|
-
variant: {
|
|
168
|
-
inverse: true
|
|
169
|
-
},
|
|
170
|
-
children: currentTimestamp
|
|
171
|
-
})
|
|
172
|
-
}), /*#__PURE__*/_jsx(StyledProgressBar, {
|
|
173
|
-
"aria-label": videoText[copy].videoProgressBarLabel,
|
|
174
|
-
type: "range",
|
|
175
|
-
step: "any",
|
|
176
|
-
max: videoLength,
|
|
177
|
-
videoCurrentTime: videoCurrentTime,
|
|
178
|
-
onChange: handleVideoSkip,
|
|
179
|
-
onFocus: resetInactivityTimer,
|
|
180
|
-
videoBufferDisplay: videoBufferDisplay,
|
|
181
|
-
ref: videoProgressBar,
|
|
182
|
-
tabIndex: "-1",
|
|
183
|
-
...sharedProps
|
|
184
|
-
}), /*#__PURE__*/_jsx(StyledTimestamp, {
|
|
185
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
186
|
-
variant: {
|
|
187
|
-
inverse: true
|
|
188
|
-
},
|
|
189
|
-
children: remainingTimestamp
|
|
190
|
-
})
|
|
191
|
-
})]
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
VideoProgressBar.propTypes = {
|
|
195
|
-
...selectedSystemPropTypes,
|
|
196
|
-
copy: PropTypes.oneOf(['en', 'fr']),
|
|
197
|
-
videoLength: PropTypes.number.isRequired,
|
|
198
|
-
videoCurrentTime: PropTypes.number.isRequired,
|
|
199
|
-
videoBufferEnd: PropTypes.number.isRequired,
|
|
200
|
-
setSeek: PropTypes.func.isRequired,
|
|
201
|
-
resetInactivityTimer: PropTypes.func.isRequired
|
|
202
|
-
};
|
|
203
|
-
export default VideoProgressBar;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Icon, useThemeTokens, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
-
import VideoButton from '../VideoButton/VideoButton';
|
|
6
|
-
import videoText from '../../../videoText';
|
|
7
|
-
import { htmlAttrs } from '../../../../utils';
|
|
8
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const VolumeSliderContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
-
displayName: "VolumeSlider__VolumeSliderContainer",
|
|
13
|
-
componentId: "components-web__sc-apixz4-0"
|
|
14
|
-
})(_ref => {
|
|
15
|
-
let {
|
|
16
|
-
videoPlayerWidth,
|
|
17
|
-
compactModeThreshold,
|
|
18
|
-
margin
|
|
19
|
-
} = _ref;
|
|
20
|
-
return {
|
|
21
|
-
display: 'flex',
|
|
22
|
-
width: videoPlayerWidth > compactModeThreshold ? '12%' : '20%',
|
|
23
|
-
maxWidth: 120,
|
|
24
|
-
margin,
|
|
25
|
-
alignItems: 'center'
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
const sharedStyles = _ref2 => {
|
|
29
|
-
let {
|
|
30
|
-
thumbHeight,
|
|
31
|
-
thumbWidth,
|
|
32
|
-
thumbBackground,
|
|
33
|
-
trackGradientStart,
|
|
34
|
-
trackGradientEnd
|
|
35
|
-
} = _ref2;
|
|
36
|
-
return {
|
|
37
|
-
thumb: {
|
|
38
|
-
appearance: 'none',
|
|
39
|
-
height: thumbHeight,
|
|
40
|
-
width: thumbWidth,
|
|
41
|
-
borderRadius: '50%',
|
|
42
|
-
background: thumbBackground,
|
|
43
|
-
cursor: 'pointer',
|
|
44
|
-
marginTop: -3,
|
|
45
|
-
'&:hover': {
|
|
46
|
-
transform: 'scale(1.5)'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
track: videoCurrentVolume => ({
|
|
50
|
-
width: '100%',
|
|
51
|
-
height: 2,
|
|
52
|
-
cursor: 'pointer',
|
|
53
|
-
borderRadius: 1.3,
|
|
54
|
-
background: `linear-gradient(to right, ${trackGradientStart} 0%, ${trackGradientEnd} ${videoCurrentVolume * 100 - 0.01}%, rgba(255,255,255,0.5) ${videoCurrentVolume * 100}%)`
|
|
55
|
-
})
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
const StyledVolumeSlider = /*#__PURE__*/styled.input.attrs(_ref3 => {
|
|
59
|
-
let {
|
|
60
|
-
videoCurrentVolume
|
|
61
|
-
} = _ref3;
|
|
62
|
-
return {
|
|
63
|
-
value: videoCurrentVolume
|
|
64
|
-
};
|
|
65
|
-
}).withConfig({
|
|
66
|
-
displayName: "VolumeSlider__StyledVolumeSlider",
|
|
67
|
-
componentId: "components-web__sc-apixz4-1"
|
|
68
|
-
})(_ref4 => {
|
|
69
|
-
let {
|
|
70
|
-
videoCurrentVolume,
|
|
71
|
-
rangeBackground,
|
|
72
|
-
...sharedProps
|
|
73
|
-
} = _ref4;
|
|
74
|
-
return {
|
|
75
|
-
width: '100%',
|
|
76
|
-
cursor: 'pointer',
|
|
77
|
-
padding: '5px 0',
|
|
78
|
-
'input[type=range]&': {
|
|
79
|
-
appearance: 'none',
|
|
80
|
-
width: '100%',
|
|
81
|
-
background: rangeBackground
|
|
82
|
-
},
|
|
83
|
-
'input[type=range]&:focus': {
|
|
84
|
-
outline: 'none'
|
|
85
|
-
},
|
|
86
|
-
'input[type=range]&::-webkit-slider-thumb': sharedStyles(sharedProps).thumb,
|
|
87
|
-
'input[type=range]&::-moz-range-thumb': {
|
|
88
|
-
...sharedStyles.thumb,
|
|
89
|
-
border: 'none'
|
|
90
|
-
},
|
|
91
|
-
'input[type=range]&::-ms-thumb': {
|
|
92
|
-
...sharedStyles.thumb,
|
|
93
|
-
margin: 0,
|
|
94
|
-
border: 'none'
|
|
95
|
-
},
|
|
96
|
-
'input[type=range]&::-webkit-slider-runnable-track': sharedStyles(sharedProps).track(videoCurrentVolume),
|
|
97
|
-
'input[type=range]&::-moz-range-track': sharedStyles(sharedProps).track(videoCurrentVolume),
|
|
98
|
-
'input[type=range]&::-ms-track': {
|
|
99
|
-
...sharedStyles(sharedProps).track(videoCurrentVolume),
|
|
100
|
-
margin: '6px 0',
|
|
101
|
-
border: 'none'
|
|
102
|
-
},
|
|
103
|
-
'input[type=range]&::-ms-fill-lower': {
|
|
104
|
-
background: 'transparent'
|
|
105
|
-
},
|
|
106
|
-
'input[type=range]&::-ms-tooltip': {
|
|
107
|
-
display: 'none'
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
const VolumeSlider = _ref5 => {
|
|
112
|
-
let {
|
|
113
|
-
setVolume,
|
|
114
|
-
compactModeThreshold,
|
|
115
|
-
disableFocus,
|
|
116
|
-
videoPlayerWidth,
|
|
117
|
-
videoIsMuted,
|
|
118
|
-
videoCurrentVolume,
|
|
119
|
-
copy,
|
|
120
|
-
toggleMute,
|
|
121
|
-
resetInactivityTimer,
|
|
122
|
-
tokens,
|
|
123
|
-
variant,
|
|
124
|
-
...rest
|
|
125
|
-
} = _ref5;
|
|
126
|
-
const refVolumeSlider = React.useRef();
|
|
127
|
-
const {
|
|
128
|
-
marginLeft,
|
|
129
|
-
marginRight,
|
|
130
|
-
thumbHeight,
|
|
131
|
-
thumbWidth,
|
|
132
|
-
thumbBackground,
|
|
133
|
-
trackGradientStart,
|
|
134
|
-
trackGradientEnd,
|
|
135
|
-
rangeBackground,
|
|
136
|
-
mutedIcon,
|
|
137
|
-
unmutedIcon
|
|
138
|
-
} = useThemeTokens('VideoVolumeSlider', tokens, variant);
|
|
139
|
-
const sharedProps = {
|
|
140
|
-
thumbHeight,
|
|
141
|
-
thumbWidth,
|
|
142
|
-
thumbBackground,
|
|
143
|
-
trackGradientStart,
|
|
144
|
-
trackGradientEnd,
|
|
145
|
-
rangeBackground
|
|
146
|
-
};
|
|
147
|
-
const handleVolumeChange = () => setVolume(refVolumeSlider.current.value);
|
|
148
|
-
return /*#__PURE__*/_jsxs(VolumeSliderContainer, {
|
|
149
|
-
compactModeThreshold: compactModeThreshold,
|
|
150
|
-
videoPlayerWidth: videoPlayerWidth,
|
|
151
|
-
margin: `0 ${marginRight}px 0 ${marginLeft}px`,
|
|
152
|
-
...selectProps(rest),
|
|
153
|
-
children: [/*#__PURE__*/_jsx(VideoButton, {
|
|
154
|
-
icon: videoIsMuted ? /*#__PURE__*/_jsx(Icon, {
|
|
155
|
-
icon: mutedIcon
|
|
156
|
-
}) : /*#__PURE__*/_jsx(Icon, {
|
|
157
|
-
icon: unmutedIcon
|
|
158
|
-
}),
|
|
159
|
-
label: videoIsMuted ? videoText[copy].unmute : videoText[copy].mute,
|
|
160
|
-
disableFocus: disableFocus,
|
|
161
|
-
onClick: toggleMute,
|
|
162
|
-
onFocus: resetInactivityTimer
|
|
163
|
-
}), /*#__PURE__*/_jsx(StyledVolumeSlider, {
|
|
164
|
-
type: "range",
|
|
165
|
-
min: "0",
|
|
166
|
-
max: "1",
|
|
167
|
-
step: "any",
|
|
168
|
-
value: videoCurrentVolume,
|
|
169
|
-
videoCurrentVolume: videoCurrentVolume,
|
|
170
|
-
ref: refVolumeSlider,
|
|
171
|
-
onChange: handleVolumeChange,
|
|
172
|
-
onFocus: resetInactivityTimer,
|
|
173
|
-
tabIndex: "-1",
|
|
174
|
-
"aria-label": videoText[copy].volumeSliderLabel,
|
|
175
|
-
...sharedProps
|
|
176
|
-
})]
|
|
177
|
-
});
|
|
178
|
-
};
|
|
179
|
-
VolumeSlider.propTypes = {
|
|
180
|
-
...selectedSystemPropTypes,
|
|
181
|
-
videoCurrentVolume: PropTypes.number.isRequired,
|
|
182
|
-
setVolume: PropTypes.func.isRequired,
|
|
183
|
-
videoIsMuted: PropTypes.bool.isRequired,
|
|
184
|
-
toggleMute: PropTypes.func.isRequired,
|
|
185
|
-
resetInactivityTimer: PropTypes.func.isRequired,
|
|
186
|
-
copy: PropTypes.oneOf(['en', 'fr']).isRequired,
|
|
187
|
-
compactModeThreshold: PropTypes.number.isRequired,
|
|
188
|
-
videoPlayerWidth: PropTypes.number.isRequired,
|
|
189
|
-
disableFocus: PropTypes.bool.isRequired
|
|
190
|
-
};
|
|
191
|
-
export default VolumeSlider;
|
|
@@ -1,71 +0,0 @@
|
|
|
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 { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const StyledMiddleControlButton = /*#__PURE__*/styled.button.withConfig({
|
|
9
|
-
displayName: "MiddleControlButton__StyledMiddleControlButton",
|
|
10
|
-
componentId: "components-web__sc-1um2s37-0"
|
|
11
|
-
})(_ref => {
|
|
12
|
-
let {
|
|
13
|
-
isHidden,
|
|
14
|
-
width,
|
|
15
|
-
height,
|
|
16
|
-
background
|
|
17
|
-
} = _ref;
|
|
18
|
-
return {
|
|
19
|
-
width,
|
|
20
|
-
height,
|
|
21
|
-
borderRadius: '50%',
|
|
22
|
-
transition: 'opacity 0.4s',
|
|
23
|
-
opacity: isHidden ? 0 : 1,
|
|
24
|
-
background,
|
|
25
|
-
display: 'flex',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
border: 'none',
|
|
28
|
-
padding: 0,
|
|
29
|
-
font: 'inherit',
|
|
30
|
-
cursor: 'pointer',
|
|
31
|
-
alignItems: 'center'
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
const MiddleControlButton = _ref2 => {
|
|
35
|
-
let {
|
|
36
|
-
icon: Icon,
|
|
37
|
-
isHidden = false,
|
|
38
|
-
onClick,
|
|
39
|
-
onFocus,
|
|
40
|
-
tokens,
|
|
41
|
-
variant,
|
|
42
|
-
...rest
|
|
43
|
-
} = _ref2;
|
|
44
|
-
const {
|
|
45
|
-
width,
|
|
46
|
-
height,
|
|
47
|
-
background,
|
|
48
|
-
iconColor
|
|
49
|
-
} = useThemeTokens('VideoMiddleControlButton', tokens, variant);
|
|
50
|
-
return /*#__PURE__*/_jsx(StyledMiddleControlButton, {
|
|
51
|
-
isHidden: isHidden,
|
|
52
|
-
onClick: onClick,
|
|
53
|
-
onFocus: onFocus,
|
|
54
|
-
width: width,
|
|
55
|
-
height: height,
|
|
56
|
-
background: background,
|
|
57
|
-
...selectProps(rest),
|
|
58
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
59
|
-
color: iconColor,
|
|
60
|
-
size: 24
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
};
|
|
64
|
-
MiddleControlButton.propTypes = {
|
|
65
|
-
...selectedSystemPropTypes,
|
|
66
|
-
icon: PropTypes.elementType.isRequired,
|
|
67
|
-
isHidden: PropTypes.bool,
|
|
68
|
-
onClick: PropTypes.func,
|
|
69
|
-
onFocus: PropTypes.func
|
|
70
|
-
};
|
|
71
|
-
export default MiddleControlButton;
|