@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,24 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var _VideoPickerThumbnail = _interopRequireDefault(require("./VideoPickerThumbnail"));
|
|
14
|
-
var _VideoPickerPlayer = _interopRequireDefault(require("./VideoPickerPlayer"));
|
|
15
|
-
var _VideoSlider = _interopRequireDefault(require("./VideoSlider"));
|
|
16
|
-
var _utils = require("../utils");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { viewports } from '@telus-uds/system-constants';
|
|
4
|
+
import { selectSystemProps, StackView, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
+
import styled, { css } from 'styled-components';
|
|
6
|
+
import { VideoPropType } from './videoPropType';
|
|
7
|
+
import VideoPickerThumbnail from './VideoPickerThumbnail';
|
|
8
|
+
import VideoPickerPlayer from './VideoPickerPlayer';
|
|
9
|
+
import VideoSlider from './VideoSlider';
|
|
10
|
+
import { htmlAttrs } from '../utils';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
22
13
|
const framedContainerStyles = _ref => {
|
|
23
14
|
let {
|
|
24
15
|
framedContainerBackgroundColor,
|
|
@@ -27,9 +18,9 @@ const framedContainerStyles = _ref => {
|
|
|
27
18
|
framedContainerBorderRadius,
|
|
28
19
|
framedMaxHeight
|
|
29
20
|
} = _ref;
|
|
30
|
-
return
|
|
21
|
+
return css(["background-color:", ";border:", "px solid ", ";border-radius:", "px;& > div{max-height:", "px;}"], framedContainerBackgroundColor, framedContainerBorderWidth, framedContainerBorderColor, framedContainerBorderRadius, framedMaxHeight);
|
|
31
22
|
};
|
|
32
|
-
const VideoPickerContainer = /*#__PURE__*/
|
|
23
|
+
const VideoPickerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
33
24
|
displayName: "VideoPicker__VideoPickerContainer",
|
|
34
25
|
componentId: "components-web__sc-x6lxp0-0"
|
|
35
26
|
})(["", ""], _ref2 => {
|
|
@@ -44,9 +35,9 @@ const framedPlayerContainerStyles = _ref3 => {
|
|
|
44
35
|
framedMaxHeight,
|
|
45
36
|
framedContainerPadding
|
|
46
37
|
} = _ref3;
|
|
47
|
-
return
|
|
38
|
+
return css(["width:66.67%;padding:", "px;max-height:", "px;flex-shrink:0;box-sizing:border-box;"], framedContainerPadding, framedMaxHeight);
|
|
48
39
|
};
|
|
49
|
-
const VideoPlayerContainer = /*#__PURE__*/
|
|
40
|
+
const VideoPlayerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
50
41
|
displayName: "VideoPicker__VideoPlayerContainer",
|
|
51
42
|
componentId: "components-web__sc-x6lxp0-1"
|
|
52
43
|
})(["", " overflow:auto;"], _ref4 => {
|
|
@@ -56,17 +47,17 @@ const VideoPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
56
47
|
} = _ref4;
|
|
57
48
|
return isFramed && framedPlayerContainerStyles(tokens);
|
|
58
49
|
});
|
|
59
|
-
const framedVideoListContainerStyle = /*#__PURE__*/
|
|
50
|
+
const framedVideoListContainerStyle = /*#__PURE__*/css(["max-height:", "px;overflow:auto;flex-direction:column;"], _ref5 => {
|
|
60
51
|
let {
|
|
61
52
|
framedMaxHeight
|
|
62
53
|
} = _ref5;
|
|
63
54
|
return framedMaxHeight;
|
|
64
55
|
});
|
|
65
|
-
const VideoListContainer = /*#__PURE__*/
|
|
56
|
+
const VideoListContainer = /*#__PURE__*/styled.div.withConfig({
|
|
66
57
|
displayName: "VideoPicker__VideoListContainer",
|
|
67
58
|
componentId: "components-web__sc-x6lxp0-2"
|
|
68
59
|
})(["display:flex;justify-content:flex-start;position:relative;flex-grow:1;flex-direction:column;", ""], props => props.isFramed && framedVideoListContainerStyle);
|
|
69
|
-
const VideoPicker = /*#__PURE__*/
|
|
60
|
+
const VideoPicker = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
70
61
|
var _videoList$;
|
|
71
62
|
let {
|
|
72
63
|
videoList = [],
|
|
@@ -79,15 +70,15 @@ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
79
70
|
onProgress = () => {},
|
|
80
71
|
...rest
|
|
81
72
|
} = _ref6;
|
|
82
|
-
const viewport =
|
|
73
|
+
const viewport = useViewport();
|
|
83
74
|
const {
|
|
84
75
|
stackViewDividerColor,
|
|
85
76
|
...themeTokens
|
|
86
|
-
} =
|
|
87
|
-
const [currentVideoId, setCurrentVideoId] =
|
|
88
|
-
const videoPlayerRef =
|
|
77
|
+
} = useThemeTokens('VideoPicker');
|
|
78
|
+
const [currentVideoId, setCurrentVideoId] = React.useState(selectedVideo);
|
|
79
|
+
const videoPlayerRef = React.useRef(null);
|
|
89
80
|
const currentVideo = videoList.find(video => video.videoId === currentVideoId);
|
|
90
|
-
|
|
81
|
+
React.useEffect(() => {
|
|
91
82
|
// Update current video if parent changes which video id it passes down
|
|
92
83
|
setCurrentVideoId(selectedVideo);
|
|
93
84
|
}, [selectedVideo]);
|
|
@@ -102,9 +93,9 @@ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
102
93
|
};
|
|
103
94
|
|
|
104
95
|
// `frame` variant should only work on larger screens
|
|
105
|
-
const isFramed = frame && [
|
|
106
|
-
const hasSlider = !frame && [
|
|
107
|
-
const listElements = videoList.map((video, index) => /*#__PURE__*/(
|
|
96
|
+
const isFramed = frame && [viewports.lg, viewports.xl].includes(viewport);
|
|
97
|
+
const hasSlider = !frame && [viewports.md, viewports.lg, viewports.xl].includes(viewport);
|
|
98
|
+
const listElements = videoList.map((video, index) => /*#__PURE__*/_jsx(VideoPickerThumbnail, {
|
|
108
99
|
video: video,
|
|
109
100
|
videoPlayerRef: videoPlayerRef,
|
|
110
101
|
selectedVideoId: currentVideoId,
|
|
@@ -116,12 +107,12 @@ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
116
107
|
index: index,
|
|
117
108
|
isFramed: isFramed
|
|
118
109
|
}, video.videoId));
|
|
119
|
-
return /*#__PURE__*/(
|
|
110
|
+
return /*#__PURE__*/_jsx(VideoPickerContainer, {
|
|
120
111
|
ref: ref,
|
|
121
112
|
isFramed: isFramed,
|
|
122
113
|
...selectProps(rest),
|
|
123
114
|
...themeTokens,
|
|
124
|
-
children: /*#__PURE__*/(
|
|
115
|
+
children: /*#__PURE__*/_jsxs(StackView, {
|
|
125
116
|
divider: isFramed ? {
|
|
126
117
|
tokens: {
|
|
127
118
|
color: stackViewDividerColor
|
|
@@ -134,17 +125,17 @@ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
134
125
|
space: isFramed ? 0 : 4 // everything has internal padding in `frame` variant
|
|
135
126
|
,
|
|
136
127
|
direction: isFramed ? 'row' : 'column',
|
|
137
|
-
children: [/*#__PURE__*/(
|
|
128
|
+
children: [/*#__PURE__*/_jsx(VideoPlayerContainer, {
|
|
138
129
|
...themeTokens,
|
|
139
130
|
isFramed: isFramed,
|
|
140
|
-
children: /*#__PURE__*/(
|
|
131
|
+
children: /*#__PURE__*/_jsx(VideoPickerPlayer, {
|
|
141
132
|
video: addVideoEventHandlers(currentVideo, onPlay, onPause, onProgress),
|
|
142
133
|
videoPlayerRef: videoPlayerRef,
|
|
143
134
|
onStartVideo: onStartVideo
|
|
144
135
|
})
|
|
145
|
-
}), hasSlider ? /*#__PURE__*/(
|
|
136
|
+
}), hasSlider ? /*#__PURE__*/_jsx(VideoSlider, {
|
|
146
137
|
children: listElements
|
|
147
|
-
}) : /*#__PURE__*/(
|
|
138
|
+
}) : /*#__PURE__*/_jsx(VideoListContainer, {
|
|
148
139
|
viewport: viewport,
|
|
149
140
|
"data-testid": "video-list-container",
|
|
150
141
|
isFramed: isFramed,
|
|
@@ -156,44 +147,43 @@ const VideoPicker = /*#__PURE__*/_react.default.forwardRef((_ref6, ref) => {
|
|
|
156
147
|
VideoPicker.displayName = 'VideoPicker';
|
|
157
148
|
VideoPicker.propTypes = {
|
|
158
149
|
...selectedSystemPropTypes,
|
|
159
|
-
tokens:
|
|
150
|
+
tokens: getTokensPropType('VideoPicker'),
|
|
160
151
|
/**
|
|
161
152
|
* Id of the currently selected video (defaults to the first video if not set).
|
|
162
153
|
*/
|
|
163
|
-
selectedVideo:
|
|
154
|
+
selectedVideo: PropTypes.string,
|
|
164
155
|
/**
|
|
165
156
|
* An array of Video objects.
|
|
166
157
|
*/
|
|
167
|
-
videoList:
|
|
158
|
+
videoList: PropTypes.arrayOf(VideoPropType),
|
|
168
159
|
/**
|
|
169
160
|
* Use to display the picker in a container and the playlist as a sidebar (only available for breakpoints LG and larger)
|
|
170
161
|
*/
|
|
171
|
-
frame:
|
|
162
|
+
frame: PropTypes.bool,
|
|
172
163
|
/**
|
|
173
164
|
* Callback function trigerred when the video player starts playing video.
|
|
174
165
|
* @param {object} video - The video object that is playing.
|
|
175
166
|
*/
|
|
176
|
-
onStartVideo:
|
|
167
|
+
onStartVideo: PropTypes.func,
|
|
177
168
|
/**
|
|
178
169
|
* Callback function trigerred when a video is selected from the thumbnail list.
|
|
179
170
|
* @param {object} video - The video object that is selected.
|
|
180
171
|
*/
|
|
181
|
-
onSelectVideo:
|
|
172
|
+
onSelectVideo: PropTypes.func,
|
|
182
173
|
/**
|
|
183
174
|
* Callback function trigerred during progress milestones 10% 25% 50% 75% 100%.
|
|
184
175
|
* @param {object} event - The event object.
|
|
185
176
|
*/
|
|
186
|
-
onProgress:
|
|
177
|
+
onProgress: PropTypes.func,
|
|
187
178
|
/**
|
|
188
179
|
* Callback function trigerred when the video player starts playing video.
|
|
189
180
|
* @param {object} event - The event object.
|
|
190
181
|
*/
|
|
191
|
-
onPlay:
|
|
182
|
+
onPlay: PropTypes.func,
|
|
192
183
|
/**
|
|
193
184
|
* Callback function trigerred when the video gets paused.
|
|
194
185
|
* @param {object} event - The event object.
|
|
195
186
|
*/
|
|
196
|
-
onPause:
|
|
187
|
+
onPause: PropTypes.func
|
|
197
188
|
};
|
|
198
|
-
|
|
199
|
-
exports.default = _default;
|
|
189
|
+
export default VideoPicker;
|
|
@@ -1,42 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
9
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
-
var _WebVideo = _interopRequireDefault(require("../WebVideo/WebVideo"));
|
|
11
|
-
var _videoPropType = require("./videoPropType");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const VideoPickerPlayer = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StackView, Typography } from '@telus-uds/components-base';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import WebVideo from '../WebVideo/WebVideo';
|
|
5
|
+
import { VideoPropType, RefPropType } from './videoPropType';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const VideoPickerPlayer = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
15
8
|
let {
|
|
16
9
|
video = {},
|
|
17
10
|
videoPlayerRef,
|
|
18
11
|
onStartVideo = () => {}
|
|
19
12
|
} = _ref;
|
|
20
|
-
return /*#__PURE__*/(
|
|
13
|
+
return /*#__PURE__*/_jsxs(StackView, {
|
|
21
14
|
space: 3,
|
|
22
15
|
tokens: {
|
|
23
16
|
flexShrink: 1
|
|
24
17
|
},
|
|
25
18
|
ref: ref,
|
|
26
|
-
children: [/*#__PURE__*/(
|
|
19
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
27
20
|
ref: videoPlayerRef,
|
|
28
|
-
children: video.videoId && /*#__PURE__*/(
|
|
21
|
+
children: video.videoId && /*#__PURE__*/_jsx(WebVideo, {
|
|
29
22
|
...video,
|
|
30
23
|
onStart: () => onStartVideo(video)
|
|
31
24
|
})
|
|
32
|
-
}), /*#__PURE__*/(
|
|
25
|
+
}), /*#__PURE__*/_jsxs(StackView, {
|
|
33
26
|
space: 2,
|
|
34
|
-
children: [/*#__PURE__*/(
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
35
28
|
variant: {
|
|
36
29
|
size: 'h3'
|
|
37
30
|
},
|
|
38
31
|
children: video.title
|
|
39
|
-
}), /*#__PURE__*/(
|
|
32
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
40
33
|
variant: {
|
|
41
34
|
colour: 'default'
|
|
42
35
|
},
|
|
@@ -47,9 +40,8 @@ const VideoPickerPlayer = /*#__PURE__*/_react.default.forwardRef((_ref, ref) =>
|
|
|
47
40
|
});
|
|
48
41
|
VideoPickerPlayer.displayName = 'VideoPickerPlayer';
|
|
49
42
|
VideoPickerPlayer.propTypes = {
|
|
50
|
-
video:
|
|
51
|
-
videoPlayerRef:
|
|
52
|
-
onStartVideo:
|
|
43
|
+
video: VideoPropType,
|
|
44
|
+
videoPlayerRef: RefPropType,
|
|
45
|
+
onStartVideo: PropTypes.func
|
|
53
46
|
};
|
|
54
|
-
|
|
55
|
-
exports.default = _default;
|
|
47
|
+
export default VideoPickerPlayer;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
14
|
-
var _helpers = require("../shared/VideoSplash/helpers");
|
|
15
|
-
var _videoPropType = require("./videoPropType");
|
|
16
|
-
var _VideoSplash = _interopRequireDefault(require("../shared/VideoSplash/VideoSplash"));
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Pressable from "react-native-web/dist/exports/Pressable";
|
|
3
|
+
import StyleSheet from "react-native-web/dist/exports/StyleSheet";
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { viewports } from '@telus-uds/system-constants';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
import { StackView, Typography, useViewport, horizontalScrollUtils, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
8
|
+
import { getTimestamp } from '../shared/VideoSplash/helpers';
|
|
9
|
+
import { VideoPropType, RefPropType } from './videoPropType';
|
|
10
|
+
import VideoSplash from '../shared/VideoSplash/VideoSplash';
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
12
|
const {
|
|
20
13
|
getItemPositionLayoutHandler,
|
|
21
14
|
itemPositionsPropType
|
|
22
|
-
} =
|
|
15
|
+
} = horizontalScrollUtils;
|
|
23
16
|
|
|
24
17
|
// Use a React Native (web) outer container so it can take an onLayout callback, to
|
|
25
18
|
// access position in VideoSlider's UDS HorizontalScroll and update its itemPositions
|
|
@@ -31,7 +24,7 @@ const createReactNativeStyles = _ref => {
|
|
|
31
24
|
pressableBorderTopWidth,
|
|
32
25
|
pressableBorderTopColor
|
|
33
26
|
} = _ref;
|
|
34
|
-
return
|
|
27
|
+
return StyleSheet.create({
|
|
35
28
|
container: {
|
|
36
29
|
cursor: 'pointer'
|
|
37
30
|
},
|
|
@@ -48,7 +41,7 @@ const createReactNativeStyles = _ref => {
|
|
|
48
41
|
}
|
|
49
42
|
});
|
|
50
43
|
};
|
|
51
|
-
const ImageContainer = /*#__PURE__*/
|
|
44
|
+
const ImageContainer = /*#__PURE__*/styled.div.withConfig({
|
|
52
45
|
displayName: "VideoPickerThumbnail__ImageContainer",
|
|
53
46
|
componentId: "components-web__sc-1glxurq-0"
|
|
54
47
|
})(["padding:", ";border:", ";border-radius:", "px;"], props => `${props.outerBorderGap}px`, props => `${props.outerBorderWidth}px solid ${props.outerBorderColor}`, _ref2 => {
|
|
@@ -57,7 +50,7 @@ const ImageContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
57
50
|
} = _ref2;
|
|
58
51
|
return outerBorderRadius;
|
|
59
52
|
});
|
|
60
|
-
const VideoThumbnail = /*#__PURE__*/
|
|
53
|
+
const VideoThumbnail = /*#__PURE__*/styled.div.withConfig({
|
|
61
54
|
displayName: "VideoPickerThumbnail__VideoThumbnail",
|
|
62
55
|
componentId: "components-web__sc-1glxurq-1"
|
|
63
56
|
})(["position:relative;width:", ";flex-shrink:0;* button{display:none;}&::before{content:'';display:block;padding-bottom:56.25%;}&::after{content:'';border:", "px solid;border-color:", ";border-radius:", "px;position:absolute;top:0;left:0;right:0;bottom:0;}& > div{border-radius:", "px;}"], props => props.layout === 'vertical' ? '100%' : '144px', _ref3 => {
|
|
@@ -81,11 +74,11 @@ const VideoThumbnail = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
81
74
|
} = _ref6;
|
|
82
75
|
return borderRadius;
|
|
83
76
|
});
|
|
84
|
-
const ThumbnailTitleContainer = /*#__PURE__*/
|
|
77
|
+
const ThumbnailTitleContainer = /*#__PURE__*/styled.div.withConfig({
|
|
85
78
|
displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
|
|
86
79
|
componentId: "components-web__sc-1glxurq-2"
|
|
87
80
|
})(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
|
|
88
|
-
const VideoPickerThumbnail = /*#__PURE__*/
|
|
81
|
+
const VideoPickerThumbnail = /*#__PURE__*/React.forwardRef((_ref7, ref) => {
|
|
89
82
|
let {
|
|
90
83
|
videoPlayerRef,
|
|
91
84
|
selectedVideoId,
|
|
@@ -97,18 +90,18 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
97
90
|
index,
|
|
98
91
|
width = '100%'
|
|
99
92
|
} = _ref7;
|
|
100
|
-
const viewport =
|
|
101
|
-
const getTokens =
|
|
93
|
+
const viewport = useViewport();
|
|
94
|
+
const getTokens = useThemeTokensCallback('VideoPickerThumbnail', {}, {});
|
|
102
95
|
const {
|
|
103
96
|
timestamp
|
|
104
|
-
} =
|
|
97
|
+
} = getTimestamp(video.videoLength, video.copy);
|
|
105
98
|
const isPlaying = selectedVideoId === video.videoId;
|
|
106
99
|
const renderThumbnailImage = themeTokens => {
|
|
107
|
-
return /*#__PURE__*/(
|
|
100
|
+
return /*#__PURE__*/_jsx(VideoThumbnail, {
|
|
108
101
|
...themeTokens,
|
|
109
102
|
isPlaying: isPlaying,
|
|
110
103
|
layout: layout,
|
|
111
|
-
children: /*#__PURE__*/(
|
|
104
|
+
children: /*#__PURE__*/_jsx(VideoSplash, {
|
|
112
105
|
simpleMode: true,
|
|
113
106
|
poster: video.posterSrc || `https://img.youtube.com/vi/${video.videoId}/maxresdefault.jpg`,
|
|
114
107
|
videoLength: video.videoLength,
|
|
@@ -121,14 +114,14 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
121
114
|
titleColor,
|
|
122
115
|
subTitleColor
|
|
123
116
|
} = _ref8;
|
|
124
|
-
return /*#__PURE__*/(
|
|
117
|
+
return /*#__PURE__*/_jsxs(StackView, {
|
|
125
118
|
space: 2,
|
|
126
119
|
tokens: {
|
|
127
120
|
flexShrink: 1
|
|
128
121
|
},
|
|
129
|
-
children: [/*#__PURE__*/(
|
|
122
|
+
children: [/*#__PURE__*/_jsx(ThumbnailTitleContainer, {
|
|
130
123
|
viewport: viewport,
|
|
131
|
-
children: /*#__PURE__*/(
|
|
124
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
132
125
|
variant: {
|
|
133
126
|
bold: true
|
|
134
127
|
},
|
|
@@ -137,7 +130,7 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
137
130
|
},
|
|
138
131
|
children: video.title
|
|
139
132
|
})
|
|
140
|
-
}), viewport !==
|
|
133
|
+
}), viewport !== viewports.xs && /*#__PURE__*/_jsx(Typography, {
|
|
141
134
|
variant: {
|
|
142
135
|
size: 'micro'
|
|
143
136
|
},
|
|
@@ -157,7 +150,7 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
157
150
|
if (splashButton) splashButton.focus();
|
|
158
151
|
}
|
|
159
152
|
};
|
|
160
|
-
return /*#__PURE__*/(
|
|
153
|
+
return /*#__PURE__*/_jsx(Pressable, {
|
|
161
154
|
onLayout: handleLayout,
|
|
162
155
|
onPress: () => onSelectVideo(video),
|
|
163
156
|
testID: `thumbnail-container-${video.videoId}`,
|
|
@@ -198,10 +191,10 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
198
191
|
pressed,
|
|
199
192
|
selected: isPlaying
|
|
200
193
|
});
|
|
201
|
-
return /*#__PURE__*/(
|
|
194
|
+
return /*#__PURE__*/_jsxs(StackView, {
|
|
202
195
|
space: layout === 'vertical' ? 2 : 3,
|
|
203
196
|
direction: layout === 'vertical' ? 'column' : 'row',
|
|
204
|
-
children: [/*#__PURE__*/(
|
|
197
|
+
children: [/*#__PURE__*/_jsx(ImageContainer, {
|
|
205
198
|
...themeTokens,
|
|
206
199
|
children: renderThumbnailImage(themeTokens)
|
|
207
200
|
}), renderThumbnailInfo(themeTokens)]
|
|
@@ -211,15 +204,14 @@ const VideoPickerThumbnail = /*#__PURE__*/_react.default.forwardRef((_ref7, ref)
|
|
|
211
204
|
});
|
|
212
205
|
VideoPickerThumbnail.displayName = 'VideoPickerThumbnail';
|
|
213
206
|
VideoPickerThumbnail.propTypes = {
|
|
214
|
-
selectedVideoId:
|
|
215
|
-
onSelectVideo:
|
|
216
|
-
video:
|
|
217
|
-
videoPlayerRef:
|
|
218
|
-
layout:
|
|
219
|
-
isFramed:
|
|
207
|
+
selectedVideoId: PropTypes.string,
|
|
208
|
+
onSelectVideo: PropTypes.func,
|
|
209
|
+
video: VideoPropType,
|
|
210
|
+
videoPlayerRef: RefPropType,
|
|
211
|
+
layout: PropTypes.oneOf(['vertical', 'horizontal']),
|
|
212
|
+
isFramed: PropTypes.bool,
|
|
220
213
|
itemPositions: itemPositionsPropType,
|
|
221
|
-
index:
|
|
222
|
-
width:
|
|
214
|
+
index: PropTypes.number,
|
|
215
|
+
width: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
223
216
|
};
|
|
224
|
-
|
|
225
|
-
exports.default = _default;
|
|
217
|
+
export default VideoPickerThumbnail;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
9
|
-
var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HorizontalScroll, HorizontalScrollButton, horizontalScrollUtils, StackView, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
3
|
+
import View from "react-native-web/dist/exports/View";
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
6
|
const {
|
|
14
7
|
useItemPositions
|
|
15
|
-
} =
|
|
16
|
-
const VideoSlider = /*#__PURE__*/
|
|
8
|
+
} = horizontalScrollUtils;
|
|
9
|
+
const VideoSlider = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
17
10
|
let {
|
|
18
11
|
children
|
|
19
12
|
} = _ref;
|
|
20
|
-
const viewport =
|
|
13
|
+
const viewport = useViewport();
|
|
21
14
|
const [itemPositions] = useItemPositions();
|
|
22
|
-
const [containerWidth, setContainerWidth] =
|
|
15
|
+
const [containerWidth, setContainerWidth] = React.useState(null);
|
|
23
16
|
const {
|
|
24
17
|
previousIcon: PreviousIcon,
|
|
25
18
|
nextIcon: NextIcon
|
|
26
|
-
} =
|
|
19
|
+
} = useThemeTokens('VideoPickerSlider');
|
|
27
20
|
const onLayout = _ref2 => {
|
|
28
21
|
let {
|
|
29
22
|
nativeEvent: {
|
|
@@ -43,15 +36,14 @@ const VideoSlider = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
43
36
|
// After first render, can't use % widths because parent is > 100% width horizontal scroll area
|
|
44
37
|
Math.max(containerWidth / itemsCount - itemGapPortioned, 0 // Prevent negative width breaking layout on very narrow containers
|
|
45
38
|
);
|
|
46
|
-
|
|
47
|
-
const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.StackView, {
|
|
39
|
+
const content = /*#__PURE__*/_jsx(StackView, {
|
|
48
40
|
space: 5,
|
|
49
41
|
direction: "row",
|
|
50
42
|
accessibilityRole: "radiogroup",
|
|
51
43
|
tokens: {
|
|
52
44
|
flexGrow: 1
|
|
53
45
|
},
|
|
54
|
-
children:
|
|
46
|
+
children: React.Children.map(children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
|
|
55
47
|
index,
|
|
56
48
|
itemPositions,
|
|
57
49
|
width: itemWidth
|
|
@@ -68,14 +60,14 @@ const VideoSlider = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
68
60
|
borderBottomColor: 'transparent',
|
|
69
61
|
buttonClearance: 0
|
|
70
62
|
};
|
|
71
|
-
return /*#__PURE__*/(
|
|
63
|
+
return /*#__PURE__*/_jsx(View, {
|
|
72
64
|
onLayout: onLayout,
|
|
73
65
|
style: overflow,
|
|
74
66
|
ref: ref,
|
|
75
67
|
children: containerWidth === null ?
|
|
76
68
|
// Use a 100% width non-scrollable parent until containerWidth is known, to avoid flicker
|
|
77
|
-
content : /*#__PURE__*/(
|
|
78
|
-
ScrollButton:
|
|
69
|
+
content : /*#__PURE__*/_jsx(HorizontalScroll, {
|
|
70
|
+
ScrollButton: HorizontalScrollButton,
|
|
79
71
|
itemPositions: itemPositions,
|
|
80
72
|
tokens: horizontalScrollTokens,
|
|
81
73
|
children: content
|
|
@@ -84,7 +76,6 @@ const VideoSlider = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
84
76
|
});
|
|
85
77
|
VideoSlider.displayName = 'VideoSlider';
|
|
86
78
|
VideoSlider.propTypes = {
|
|
87
|
-
children:
|
|
79
|
+
children: PropTypes.node
|
|
88
80
|
};
|
|
89
|
-
|
|
90
|
-
exports.default = _default;
|
|
81
|
+
export default VideoSlider;
|
package/lib/VideoPicker/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _VideoPicker = _interopRequireDefault(require("./VideoPicker"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _VideoPicker.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import VideoPicker from './VideoPicker';
|
|
2
|
+
export default VideoPicker;
|
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { VideoProps } from '../WebVideo/WebVideo';
|
|
3
|
+
export const VideoPropType = PropTypes.shape({
|
|
4
|
+
...VideoProps,
|
|
5
|
+
title: PropTypes.string,
|
|
6
|
+
description: PropTypes.string
|
|
5
7
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
const VideoPropType = _propTypes.default.shape({
|
|
11
|
-
..._WebVideo.VideoProps,
|
|
12
|
-
title: _propTypes.default.string,
|
|
13
|
-
description: _propTypes.default.string
|
|
14
|
-
});
|
|
15
|
-
exports.VideoPropType = VideoPropType;
|
|
16
|
-
const RefPropType = _propTypes.default.shape({
|
|
17
|
-
current: _propTypes.default.object
|
|
18
|
-
});
|
|
19
|
-
exports.RefPropType = RefPropType;
|
|
8
|
+
export const RefPropType = PropTypes.shape({
|
|
9
|
+
current: PropTypes.object
|
|
10
|
+
});
|