@telus-uds/components-web 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -2
- package/lib/Autocomplete/Autocomplete.js +393 -0
- package/lib/Autocomplete/Loading.js +51 -0
- package/lib/Autocomplete/Suggestions.js +81 -0
- package/lib/Autocomplete/constants.js +19 -0
- package/lib/Autocomplete/dictionary.js +19 -0
- package/lib/Autocomplete/index.js +13 -0
- package/lib/Callout/Callout.js +3 -0
- package/lib/Card/Card.js +180 -0
- package/lib/Card/CardContent.js +110 -0
- package/lib/Card/CardFooter.js +98 -0
- package/lib/Card/index.js +13 -0
- package/lib/Countdown/Countdown.js +189 -0
- package/lib/Countdown/Segment.js +111 -0
- package/lib/Countdown/constants.js +14 -0
- package/lib/Countdown/dictionary.js +29 -0
- package/lib/Countdown/index.js +13 -0
- package/lib/Countdown/types.js +39 -0
- package/lib/Countdown/useCountdown.js +40 -0
- package/lib/Modal/ModalContent.js +11 -4
- package/lib/OptimizeImage/OptimizeImage.js +127 -0
- package/lib/OptimizeImage/index.js +13 -0
- package/lib/OptimizeImage/utils/getFallbackUrl.js +18 -0
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +32 -0
- package/lib/OptimizeImage/utils/hasWebpSupport.js +38 -0
- package/lib/OptimizeImage/utils/index.js +31 -0
- package/lib/OptimizeImage/utils/isSvgUrl.js +10 -0
- package/lib/QuantitySelector/QuantitySelector.js +253 -0
- package/lib/QuantitySelector/dictionary.js +33 -0
- package/lib/QuantitySelector/index.js +13 -0
- package/lib/QuantitySelector/styles.js +40 -0
- package/lib/StoryCard/StoryCard.js +244 -0
- package/lib/StoryCard/index.js +13 -0
- package/lib/TermsAndConditions/ExpandCollapse.js +141 -0
- package/lib/TermsAndConditions/TermsAndConditions.js +221 -0
- package/lib/TermsAndConditions/dictionary.js +19 -0
- package/lib/TermsAndConditions/index.js +15 -0
- package/lib/Testimonial/Testimonial.js +226 -0
- package/lib/Testimonial/index.js +13 -0
- package/lib/Video/ControlBar/ControlBar.js +315 -0
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +91 -0
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +186 -0
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +221 -0
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +213 -0
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +89 -0
- package/lib/Video/Video.js +1072 -0
- package/lib/Video/index.js +13 -0
- package/lib/Video/videoText.js +62 -0
- package/lib/WebVideo/WebVideo.js +170 -0
- package/lib/WebVideo/index.js +13 -0
- package/lib/baseExports.js +0 -6
- package/lib/index.js +91 -1
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +102 -0
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +234 -0
- package/lib/shared/VideoSplash/VideoSplash.js +86 -0
- package/lib/shared/VideoSplash/helpers.js +38 -0
- package/lib/utils/index.js +8 -0
- package/lib-module/Autocomplete/Autocomplete.js +369 -0
- package/lib-module/Autocomplete/Loading.js +38 -0
- package/lib-module/Autocomplete/Suggestions.js +64 -0
- package/lib-module/Autocomplete/constants.js +5 -0
- package/lib-module/Autocomplete/dictionary.js +12 -0
- package/lib-module/Autocomplete/index.js +2 -0
- package/lib-module/Callout/Callout.js +3 -0
- package/lib-module/Card/Card.js +158 -0
- package/lib-module/Card/CardContent.js +92 -0
- package/lib-module/Card/CardFooter.js +80 -0
- package/lib-module/Card/index.js +2 -0
- package/lib-module/Countdown/Countdown.js +165 -0
- package/lib-module/Countdown/Segment.js +94 -0
- package/lib-module/Countdown/constants.js +4 -0
- package/lib-module/Countdown/dictionary.js +22 -0
- package/lib-module/Countdown/index.js +2 -0
- package/lib-module/Countdown/types.js +23 -0
- package/lib-module/Countdown/useCountdown.js +32 -0
- package/lib-module/Modal/ModalContent.js +10 -4
- package/lib-module/OptimizeImage/OptimizeImage.js +106 -0
- package/lib-module/OptimizeImage/index.js +2 -0
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +8 -0
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +22 -0
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +32 -0
- package/lib-module/OptimizeImage/utils/index.js +4 -0
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +3 -0
- package/lib-module/QuantitySelector/QuantitySelector.js +232 -0
- package/lib-module/QuantitySelector/dictionary.js +26 -0
- package/lib-module/QuantitySelector/index.js +2 -0
- package/lib-module/QuantitySelector/styles.js +21 -0
- package/lib-module/StoryCard/StoryCard.js +220 -0
- package/lib-module/StoryCard/index.js +2 -0
- package/lib-module/TermsAndConditions/ExpandCollapse.js +120 -0
- package/lib-module/TermsAndConditions/TermsAndConditions.js +193 -0
- package/lib-module/TermsAndConditions/dictionary.js +12 -0
- package/lib-module/TermsAndConditions/index.js +1 -0
- package/lib-module/Testimonial/Testimonial.js +204 -0
- package/lib-module/Testimonial/index.js +2 -0
- package/lib-module/Video/ControlBar/ControlBar.js +292 -0
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +74 -0
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +167 -0
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +201 -0
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +193 -0
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +72 -0
- package/lib-module/Video/Video.js +1042 -0
- package/lib-module/Video/index.js +2 -0
- package/lib-module/Video/videoText.js +55 -0
- package/lib-module/WebVideo/WebVideo.js +144 -0
- package/lib-module/WebVideo/index.js +2 -0
- package/lib-module/baseExports.js +1 -1
- package/lib-module/index.js +10 -0
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +85 -0
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +216 -0
- package/lib-module/shared/VideoSplash/VideoSplash.js +65 -0
- package/lib-module/shared/VideoSplash/helpers.js +23 -0
- package/lib-module/utils/index.js +2 -1
- package/package.json +7 -5
- package/src/Autocomplete/Autocomplete.jsx +354 -0
- package/src/Autocomplete/Loading.jsx +18 -0
- package/src/Autocomplete/Suggestions.jsx +52 -0
- package/src/Autocomplete/constants.js +6 -0
- package/src/Autocomplete/dictionary.js +12 -0
- package/src/Autocomplete/index.js +3 -0
- package/src/Callout/Callout.jsx +1 -1
- package/src/Card/Card.jsx +170 -0
- package/src/Card/CardContent.jsx +88 -0
- package/src/Card/CardFooter.jsx +70 -0
- package/src/Card/index.js +3 -0
- package/src/Countdown/Countdown.jsx +144 -0
- package/src/Countdown/Segment.jsx +69 -0
- package/src/Countdown/constants.js +4 -0
- package/src/Countdown/dictionary.js +22 -0
- package/src/Countdown/index.js +3 -0
- package/src/Countdown/types.js +23 -0
- package/src/Countdown/useCountdown.js +34 -0
- package/src/Modal/ModalContent.jsx +8 -4
- package/src/OptimizeImage/OptimizeImage.jsx +131 -0
- package/src/OptimizeImage/index.js +3 -0
- package/src/OptimizeImage/utils/getFallbackUrl.js +9 -0
- package/src/OptimizeImage/utils/getOptimizedUrl.js +30 -0
- package/src/OptimizeImage/utils/hasWebpSupport.js +33 -0
- package/src/OptimizeImage/utils/index.js +5 -0
- package/src/OptimizeImage/utils/isSvgUrl.js +3 -0
- package/src/QuantitySelector/QuantitySelector.jsx +245 -0
- package/src/QuantitySelector/dictionary.js +27 -0
- package/src/QuantitySelector/index.js +3 -0
- package/src/QuantitySelector/styles.js +83 -0
- package/src/StoryCard/StoryCard.jsx +198 -0
- package/src/StoryCard/index.js +3 -0
- package/src/TermsAndConditions/ExpandCollapse.jsx +106 -0
- package/src/TermsAndConditions/TermsAndConditions.jsx +161 -0
- package/src/TermsAndConditions/dictionary.js +12 -0
- package/src/TermsAndConditions/index.js +1 -0
- package/src/Testimonial/Testimonial.jsx +169 -0
- package/src/Testimonial/index.js +3 -0
- package/src/Video/ControlBar/ControlBar.jsx +261 -0
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +61 -0
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +159 -0
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +185 -0
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +184 -0
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +64 -0
- package/src/Video/Video.jsx +988 -0
- package/src/Video/index.js +3 -0
- package/src/Video/videoText.js +58 -0
- package/src/WebVideo/WebVideo.jsx +131 -0
- package/src/WebVideo/index.js +3 -0
- package/src/baseExports.js +0 -1
- package/src/index.js +10 -0
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +64 -0
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +128 -0
- package/src/shared/VideoSplash/VideoSplash.jsx +50 -0
- package/src/shared/VideoSplash/helpers.js +27 -0
- package/src/utils/index.js +10 -1
- package/types/Autocomplete.d.ts +32 -0
- package/types/Card.d.ts +45 -0
- package/types/ControlBar.d.ts +59 -0
- package/types/MiddleControlButton.d.ts +15 -0
- package/types/Video.d.ts +39 -0
- package/types/VideoButton.d.ts +14 -0
- package/types/VideoMenu.d.ts +16 -0
- package/types/VideoProgressBar.d.ts +17 -0
- package/types/VolumeSlider.d.ts +20 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _Video = _interopRequireDefault(require("./Video"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _Video.default;
|
|
13
|
+
exports.default = _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
const videoText = {
|
|
8
|
+
en: {
|
|
9
|
+
videoPlayer: 'Press the space bar or K to toggle play and pause. Use the left and right arrow keys or the comma and period keys to scrub through the video. Use the up and down arrow keys, the dash and equal keys, or the add and subtract number pad keys to increase and decrease volume. Press M to toggle mute. Press F to toggle fullscreen. Press escape to exit instructions and return to video.',
|
|
10
|
+
videoSelected: 'Video selected. Press Q to listen to controls.',
|
|
11
|
+
videoSelectedSimple: 'Video selected. Press the space bar or K to toggle play and pause.',
|
|
12
|
+
mute: 'Mute',
|
|
13
|
+
unmute: 'Unmute',
|
|
14
|
+
watch: 'Watch the video',
|
|
15
|
+
replay: 'Replay the video',
|
|
16
|
+
itemSelected: 'This is the currently selected option.',
|
|
17
|
+
itemUnselected: 'Select to switch to this option.',
|
|
18
|
+
captionsToggle: 'Select captions',
|
|
19
|
+
captionsDialogue: 'Captions',
|
|
20
|
+
captionsNone: 'None',
|
|
21
|
+
qualityToggle: 'Change video quality',
|
|
22
|
+
qualityDialogue: 'Quality',
|
|
23
|
+
fullScreenToggle: 'Toggle fullscreen',
|
|
24
|
+
minute: 'minute',
|
|
25
|
+
minutes: 'minutes',
|
|
26
|
+
second: 'second',
|
|
27
|
+
seconds: 'seconds',
|
|
28
|
+
ariaLabel: 'Play video. Video length is {minutes} and {seconds}.',
|
|
29
|
+
volumeSliderLabel: 'Adjust the volume',
|
|
30
|
+
videoProgressBarLabel: 'Progress bar',
|
|
31
|
+
en: 'English',
|
|
32
|
+
fr: 'French'
|
|
33
|
+
},
|
|
34
|
+
fr: {
|
|
35
|
+
videoPlayer: 'Appuyer sur K pour basculer entre lecture et pause. Utiliser les flèches gauche et droite ou les touches virgule et point pour reculer ou faire une avance rapide dans la vidéo. Utiliser les flèches ascendante et descendante, les touches tiret et égal ou les touches plus et moins du clavier numérique pour contrôler le volume. Appuyer sur la touche M pour désactiver le son. Appuyer sur F pour basculer en mode plein écran. Appuyer sur la touche d’échappement pour quitter les instructions et retourner à la vidéo.',
|
|
36
|
+
videoSelected: 'Vidéo sélectionnée. Appuyer sur Q pour écouter les contrôles',
|
|
37
|
+
videoSelectedSimple: 'Vidéo sélectionnée. Appuyer sur K pour basculer entre lecture et pause.',
|
|
38
|
+
mute: 'Désactiver le son',
|
|
39
|
+
unmute: 'Activer le son',
|
|
40
|
+
watch: 'Voir la vidéo',
|
|
41
|
+
replay: 'Relire la vidéo',
|
|
42
|
+
itemSelected: 'Cette option est déjà sélectionnée.',
|
|
43
|
+
itemUnselected: 'Sélectionner pour basculer à cette option.',
|
|
44
|
+
captionsToggle: 'Sélectionner les sous-titres',
|
|
45
|
+
captionsDialogue: 'Sous-titres',
|
|
46
|
+
captionsNone: 'Aucun',
|
|
47
|
+
qualityToggle: 'Modifier la qualité de la vidéo',
|
|
48
|
+
qualityDialogue: 'Qualité',
|
|
49
|
+
fullScreenToggle: 'Basculer en mode plein écran',
|
|
50
|
+
minute: 'minute',
|
|
51
|
+
minutes: 'minutes',
|
|
52
|
+
second: 'seconde',
|
|
53
|
+
seconds: 'secondes',
|
|
54
|
+
ariaLabel: 'Lire la vidéo. La durée de la vidéo est de {minutes} et {seconds}.',
|
|
55
|
+
volumeSliderLabel: 'Réglez le volume',
|
|
56
|
+
videoProgressBarLabel: 'Barre de progression',
|
|
57
|
+
en: 'Anglais',
|
|
58
|
+
fr: 'Français'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var _default = videoText;
|
|
62
|
+
exports.default = _default;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.VideoProps = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _reactYoutube = _interopRequireDefault(require("react-youtube"));
|
|
15
|
+
|
|
16
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
17
|
+
|
|
18
|
+
var _VideoSplash = _interopRequireDefault(require("../shared/VideoSplash/VideoSplash"));
|
|
19
|
+
|
|
20
|
+
var _utils = require("../utils");
|
|
21
|
+
|
|
22
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
+
|
|
24
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
+
|
|
26
|
+
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); }
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
31
|
+
|
|
32
|
+
const StyledPlayerContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
33
|
+
displayName: "WebVideo__StyledPlayerContainer",
|
|
34
|
+
componentId: "components-web__sc-327a6k-0"
|
|
35
|
+
})({
|
|
36
|
+
width: '100%',
|
|
37
|
+
minWidth: 288,
|
|
38
|
+
outline: 'none'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const StyledYoutubePlayer = /*#__PURE__*/(0, _styledComponents.default)(_reactYoutube.default).withConfig({
|
|
42
|
+
displayName: "WebVideo__StyledYoutubePlayer",
|
|
43
|
+
componentId: "components-web__sc-327a6k-1"
|
|
44
|
+
})({
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
top: 0,
|
|
47
|
+
left: 0,
|
|
48
|
+
bottom: 0,
|
|
49
|
+
right: 0
|
|
50
|
+
});
|
|
51
|
+
const aspectRatios = {
|
|
52
|
+
'16:9': {
|
|
53
|
+
paddingTop: '56.25%'
|
|
54
|
+
},
|
|
55
|
+
'4:3': {
|
|
56
|
+
paddingTop: '75%'
|
|
57
|
+
},
|
|
58
|
+
'1:1': {
|
|
59
|
+
paddingTop: '100%'
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const AspectLimiter = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
64
|
+
displayName: "WebVideo__AspectLimiter",
|
|
65
|
+
componentId: "components-web__sc-327a6k-2"
|
|
66
|
+
})(props => ({ ...aspectRatios[props.aspectRatio],
|
|
67
|
+
position: 'relative'
|
|
68
|
+
}));
|
|
69
|
+
|
|
70
|
+
const WebVideo = _ref => {
|
|
71
|
+
let {
|
|
72
|
+
videoId,
|
|
73
|
+
aspectRatio = '16:9',
|
|
74
|
+
posterSrc,
|
|
75
|
+
defaultVolume = 1,
|
|
76
|
+
beginMuted = false,
|
|
77
|
+
videoLength,
|
|
78
|
+
copy,
|
|
79
|
+
onStart = () => {},
|
|
80
|
+
...rest
|
|
81
|
+
} = _ref;
|
|
82
|
+
const [started, setStarted] = (0, _react.useState)(false);
|
|
83
|
+
|
|
84
|
+
const initializeYoutubePlayer = event => {
|
|
85
|
+
onStart();
|
|
86
|
+
|
|
87
|
+
if (beginMuted) {
|
|
88
|
+
event.target.mute();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
event.target.setVolume(defaultVolume);
|
|
92
|
+
event.target.playVideo(); // This plays the video after passing the splash screen on mobile.
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledPlayerContainer, {
|
|
96
|
+
"data-testid": "web-video-container",
|
|
97
|
+
...selectProps(rest),
|
|
98
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(AspectLimiter, {
|
|
99
|
+
aspectRatio: aspectRatio,
|
|
100
|
+
children: started ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledYoutubePlayer, {
|
|
101
|
+
videoId: videoId,
|
|
102
|
+
opts: {
|
|
103
|
+
width: '100%',
|
|
104
|
+
height: '100%',
|
|
105
|
+
playerVars: {
|
|
106
|
+
autoplay: 1,
|
|
107
|
+
modestbranding: 1,
|
|
108
|
+
playsinline: 1,
|
|
109
|
+
rel: 0
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
onReady: initializeYoutubePlayer
|
|
113
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoSplash.default, {
|
|
114
|
+
poster: posterSrc || `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
|
|
115
|
+
videoLength: videoLength,
|
|
116
|
+
copy: copy,
|
|
117
|
+
onClick: () => {
|
|
118
|
+
setStarted(true);
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const VideoProps = { ...selectedSystemPropTypes,
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The video's ID, typically available via the video's URL.
|
|
129
|
+
*/
|
|
130
|
+
videoId: _propTypes.default.string.isRequired,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The aspect ratio of the player.
|
|
134
|
+
*/
|
|
135
|
+
aspectRatio: _propTypes.default.oneOf(['16:9', '4:3', '1:1']),
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A path of the image that will be displayed on the video's splash screen. If this is undefined, it will pull an image from the defined web video if available.
|
|
139
|
+
*/
|
|
140
|
+
posterSrc: _propTypes.default.string,
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* The video's default volume, defined from 1 to 100. Please use the `beginMuted` prop to have the video start silenced.
|
|
144
|
+
*/
|
|
145
|
+
defaultVolume: _propTypes.default.number,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Defines if the video should start muted.
|
|
149
|
+
*/
|
|
150
|
+
beginMuted: _propTypes.default.bool,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The video's length, which will be displayed on the splash screen. This is defined in seconds.
|
|
154
|
+
*/
|
|
155
|
+
videoLength: _propTypes.default.number.isRequired,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The splash screen UI's language as an ISO language code. It currently supports English and French.
|
|
159
|
+
*/
|
|
160
|
+
copy: _propTypes.default.oneOf(['en', 'fr']).isRequired,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* A function to be run when the play button is pressed on the video splash screen and the video is ready to play.
|
|
164
|
+
*/
|
|
165
|
+
onStart: _propTypes.default.func
|
|
166
|
+
};
|
|
167
|
+
exports.VideoProps = VideoProps;
|
|
168
|
+
WebVideo.propTypes = VideoProps;
|
|
169
|
+
var _default = WebVideo;
|
|
170
|
+
exports.default = _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _WebVideo = _interopRequireDefault(require("./WebVideo"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _WebVideo.default;
|
|
13
|
+
exports.default = _default;
|
package/lib/baseExports.js
CHANGED
|
@@ -57,12 +57,6 @@ Object.defineProperty(exports, "ButtonLink", {
|
|
|
57
57
|
return _componentsBase.ButtonLink;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
Object.defineProperty(exports, "Card", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _componentsBase.Card;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
60
|
Object.defineProperty(exports, "Carousel", {
|
|
67
61
|
enumerable: true,
|
|
68
62
|
get: function () {
|
package/lib/index.js
CHANGED
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
+
Autocomplete: true,
|
|
7
8
|
Badge: true,
|
|
8
9
|
Modal: true,
|
|
9
10
|
OrderedList: true,
|
|
10
11
|
PreviewCard: true,
|
|
11
12
|
ResponsiveImage: true,
|
|
12
13
|
Ribbon: true,
|
|
14
|
+
Countdown: true,
|
|
13
15
|
DatePicker: true,
|
|
14
16
|
Paragraph: true,
|
|
15
17
|
Span: true,
|
|
@@ -17,17 +19,31 @@ var _exportNames = {
|
|
|
17
19
|
Callout: true,
|
|
18
20
|
PriceLockup: true,
|
|
19
21
|
Footnote: true,
|
|
22
|
+
QuantitySelector: true,
|
|
20
23
|
IconButton: true,
|
|
21
24
|
transformGradient: true,
|
|
22
25
|
Breadcrumbs: true,
|
|
23
26
|
BlockQuote: true,
|
|
27
|
+
OptimizeImage: true,
|
|
28
|
+
Testimonial: true,
|
|
24
29
|
Toast: true,
|
|
25
30
|
Table: true,
|
|
26
31
|
Image: true,
|
|
32
|
+
WebVideo: true,
|
|
27
33
|
WaffleGrid: true,
|
|
28
34
|
Spinner: true,
|
|
29
|
-
Listbox: true
|
|
35
|
+
Listbox: true,
|
|
36
|
+
Video: true,
|
|
37
|
+
StoryCard: true,
|
|
38
|
+
Card: true,
|
|
39
|
+
TermsAndConditions: true
|
|
30
40
|
};
|
|
41
|
+
Object.defineProperty(exports, "Autocomplete", {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: function () {
|
|
44
|
+
return _Autocomplete.default;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
31
47
|
Object.defineProperty(exports, "Badge", {
|
|
32
48
|
enumerable: true,
|
|
33
49
|
get: function () {
|
|
@@ -52,6 +68,18 @@ Object.defineProperty(exports, "Callout", {
|
|
|
52
68
|
return _Callout.default;
|
|
53
69
|
}
|
|
54
70
|
});
|
|
71
|
+
Object.defineProperty(exports, "Card", {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function () {
|
|
74
|
+
return _Card.default;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(exports, "Countdown", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return _Countdown.default;
|
|
81
|
+
}
|
|
82
|
+
});
|
|
55
83
|
Object.defineProperty(exports, "DatePicker", {
|
|
56
84
|
enumerable: true,
|
|
57
85
|
get: function () {
|
|
@@ -94,6 +122,12 @@ Object.defineProperty(exports, "Modal", {
|
|
|
94
122
|
return _Modal.default;
|
|
95
123
|
}
|
|
96
124
|
});
|
|
125
|
+
Object.defineProperty(exports, "OptimizeImage", {
|
|
126
|
+
enumerable: true,
|
|
127
|
+
get: function () {
|
|
128
|
+
return _OptimizeImage.default;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
97
131
|
Object.defineProperty(exports, "OrderedList", {
|
|
98
132
|
enumerable: true,
|
|
99
133
|
get: function () {
|
|
@@ -118,6 +152,12 @@ Object.defineProperty(exports, "PriceLockup", {
|
|
|
118
152
|
return _PriceLockup.default;
|
|
119
153
|
}
|
|
120
154
|
});
|
|
155
|
+
Object.defineProperty(exports, "QuantitySelector", {
|
|
156
|
+
enumerable: true,
|
|
157
|
+
get: function () {
|
|
158
|
+
return _QuantitySelector.default;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
121
161
|
Object.defineProperty(exports, "ResponsiveImage", {
|
|
122
162
|
enumerable: true,
|
|
123
163
|
get: function () {
|
|
@@ -142,24 +182,54 @@ Object.defineProperty(exports, "Spinner", {
|
|
|
142
182
|
return _Spinner.default;
|
|
143
183
|
}
|
|
144
184
|
});
|
|
185
|
+
Object.defineProperty(exports, "StoryCard", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
get: function () {
|
|
188
|
+
return _StoryCard.default;
|
|
189
|
+
}
|
|
190
|
+
});
|
|
145
191
|
Object.defineProperty(exports, "Table", {
|
|
146
192
|
enumerable: true,
|
|
147
193
|
get: function () {
|
|
148
194
|
return _Table.default;
|
|
149
195
|
}
|
|
150
196
|
});
|
|
197
|
+
Object.defineProperty(exports, "TermsAndConditions", {
|
|
198
|
+
enumerable: true,
|
|
199
|
+
get: function () {
|
|
200
|
+
return _TermsAndConditions.default;
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
Object.defineProperty(exports, "Testimonial", {
|
|
204
|
+
enumerable: true,
|
|
205
|
+
get: function () {
|
|
206
|
+
return _Testimonial.default;
|
|
207
|
+
}
|
|
208
|
+
});
|
|
151
209
|
Object.defineProperty(exports, "Toast", {
|
|
152
210
|
enumerable: true,
|
|
153
211
|
get: function () {
|
|
154
212
|
return _Toast.default;
|
|
155
213
|
}
|
|
156
214
|
});
|
|
215
|
+
Object.defineProperty(exports, "Video", {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: function () {
|
|
218
|
+
return _Video.default;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
157
221
|
Object.defineProperty(exports, "WaffleGrid", {
|
|
158
222
|
enumerable: true,
|
|
159
223
|
get: function () {
|
|
160
224
|
return _WaffleGrid.default;
|
|
161
225
|
}
|
|
162
226
|
});
|
|
227
|
+
Object.defineProperty(exports, "WebVideo", {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function () {
|
|
230
|
+
return _WebVideo.default;
|
|
231
|
+
}
|
|
232
|
+
});
|
|
163
233
|
Object.defineProperty(exports, "transformGradient", {
|
|
164
234
|
enumerable: true,
|
|
165
235
|
get: function () {
|
|
@@ -167,6 +237,8 @@ Object.defineProperty(exports, "transformGradient", {
|
|
|
167
237
|
}
|
|
168
238
|
});
|
|
169
239
|
|
|
240
|
+
var _Autocomplete = _interopRequireDefault(require("./Autocomplete"));
|
|
241
|
+
|
|
170
242
|
var _Badge = _interopRequireDefault(require("./Badge"));
|
|
171
243
|
|
|
172
244
|
var _Modal = _interopRequireDefault(require("./Modal"));
|
|
@@ -179,6 +251,8 @@ var _ResponsiveImage = _interopRequireDefault(require("./ResponsiveImage"));
|
|
|
179
251
|
|
|
180
252
|
var _Ribbon = _interopRequireDefault(require("./Ribbon"));
|
|
181
253
|
|
|
254
|
+
var _Countdown = _interopRequireDefault(require("./Countdown"));
|
|
255
|
+
|
|
182
256
|
var _DatePicker = _interopRequireDefault(require("./DatePicker"));
|
|
183
257
|
|
|
184
258
|
var _Paragraph = _interopRequireDefault(require("./Paragraph"));
|
|
@@ -193,6 +267,8 @@ var _PriceLockup = _interopRequireDefault(require("./PriceLockup"));
|
|
|
193
267
|
|
|
194
268
|
var _Footnote = _interopRequireDefault(require("./Footnote"));
|
|
195
269
|
|
|
270
|
+
var _QuantitySelector = _interopRequireDefault(require("./QuantitySelector"));
|
|
271
|
+
|
|
196
272
|
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
197
273
|
|
|
198
274
|
var _utils = require("./utils");
|
|
@@ -201,18 +277,32 @@ var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
|
|
|
201
277
|
|
|
202
278
|
var _BlockQuote = _interopRequireDefault(require("./BlockQuote"));
|
|
203
279
|
|
|
280
|
+
var _OptimizeImage = _interopRequireDefault(require("./OptimizeImage"));
|
|
281
|
+
|
|
282
|
+
var _Testimonial = _interopRequireDefault(require("./Testimonial"));
|
|
283
|
+
|
|
204
284
|
var _Toast = _interopRequireDefault(require("./Toast"));
|
|
205
285
|
|
|
206
286
|
var _Table = _interopRequireDefault(require("./Table"));
|
|
207
287
|
|
|
208
288
|
var _Image = _interopRequireDefault(require("./Image"));
|
|
209
289
|
|
|
290
|
+
var _WebVideo = _interopRequireDefault(require("./WebVideo"));
|
|
291
|
+
|
|
210
292
|
var _WaffleGrid = _interopRequireDefault(require("./WaffleGrid"));
|
|
211
293
|
|
|
212
294
|
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
213
295
|
|
|
214
296
|
var _Listbox = _interopRequireDefault(require("./Listbox"));
|
|
215
297
|
|
|
298
|
+
var _Video = _interopRequireDefault(require("./Video"));
|
|
299
|
+
|
|
300
|
+
var _StoryCard = _interopRequireDefault(require("./StoryCard"));
|
|
301
|
+
|
|
302
|
+
var _Card = _interopRequireDefault(require("./Card"));
|
|
303
|
+
|
|
304
|
+
var _TermsAndConditions = _interopRequireDefault(require("./TermsAndConditions"));
|
|
305
|
+
|
|
216
306
|
var _baseExports = require("./baseExports");
|
|
217
307
|
|
|
218
308
|
Object.keys(_baseExports).forEach(function (key) {
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
|
|
14
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
15
|
+
|
|
16
|
+
var _helpers = require("../helpers");
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
const ButtonContainer = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
23
|
+
displayName: "SplashButton__ButtonContainer",
|
|
24
|
+
componentId: "components-web__sc-1oe22fk-0"
|
|
25
|
+
})({
|
|
26
|
+
background: 'none',
|
|
27
|
+
border: 0,
|
|
28
|
+
padding: 0,
|
|
29
|
+
position: 'absolute',
|
|
30
|
+
width: '100%',
|
|
31
|
+
height: '100%',
|
|
32
|
+
display: 'flex',
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
cursor: 'pointer'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const ButtonContent = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
39
|
+
displayName: "SplashButton__ButtonContent",
|
|
40
|
+
componentId: "components-web__sc-1oe22fk-1"
|
|
41
|
+
})({
|
|
42
|
+
display: 'flex',
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
width: 64,
|
|
46
|
+
height: 64,
|
|
47
|
+
background: _ref => {
|
|
48
|
+
let {
|
|
49
|
+
buttonContentBackground
|
|
50
|
+
} = _ref;
|
|
51
|
+
return buttonContentBackground ?? 'none';
|
|
52
|
+
},
|
|
53
|
+
borderRadius: '100%',
|
|
54
|
+
transition: 'background 0.2s ease-in-out',
|
|
55
|
+
[`${ButtonContainer}:hover &`]: {
|
|
56
|
+
background: _ref2 => {
|
|
57
|
+
let {
|
|
58
|
+
buttonContentChildrenBackground
|
|
59
|
+
} = _ref2;
|
|
60
|
+
return buttonContentChildrenBackground;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const SplashButton = _ref3 => {
|
|
66
|
+
let {
|
|
67
|
+
copy,
|
|
68
|
+
tokens,
|
|
69
|
+
variant,
|
|
70
|
+
videoLength
|
|
71
|
+
} = _ref3;
|
|
72
|
+
const {
|
|
73
|
+
buttonContentChildrenBackground
|
|
74
|
+
} = (0, _componentsBase.useThemeTokens)('SplashButton', tokens, variant, {
|
|
75
|
+
hover: true
|
|
76
|
+
});
|
|
77
|
+
const {
|
|
78
|
+
playIcon: PlayIcon,
|
|
79
|
+
playIconColor,
|
|
80
|
+
...themeTokens
|
|
81
|
+
} = (0, _componentsBase.useThemeTokens)('SplashButton', tokens, variant);
|
|
82
|
+
const ariaLabel = (0, _helpers.getAriaLabel)((0, _helpers.getTimestamp)(videoLength), copy);
|
|
83
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonContainer, {
|
|
84
|
+
"aria-label": ariaLabel,
|
|
85
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonContent, { ...themeTokens,
|
|
86
|
+
buttonContentChildrenBackground: buttonContentChildrenBackground,
|
|
87
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(PlayIcon, {
|
|
88
|
+
size: 27,
|
|
89
|
+
color: playIconColor
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
SplashButton.propTypes = {
|
|
96
|
+
videoLength: _propTypes.default.number,
|
|
97
|
+
tokens: _propTypes.default.object,
|
|
98
|
+
variant: _propTypes.default.object,
|
|
99
|
+
copy: _propTypes.default.oneOf(['en', 'fr'])
|
|
100
|
+
};
|
|
101
|
+
var _default = SplashButton;
|
|
102
|
+
exports.default = _default;
|