@telus-uds/components-web 2.44.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 +13 -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 +94 -103
- 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 +1 -2
- 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 -519
- 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,157 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Link, responsiveProps, selectSystemProps, useResponsiveProp, useThemeTokens, withLinkRouter, useViewport, Typography, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
-
import OrderedListBase from '../OrderedList/OrderedListBase';
|
|
6
|
-
import ItemBase from '../OrderedList/ItemBase';
|
|
7
|
-
import Image from '../Image';
|
|
8
|
-
import { htmlAttrs } from '../utils';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { createElement as _createElement } from "react";
|
|
12
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
13
|
-
const row = (rowSize, rowBorderWidth) => ({
|
|
14
|
-
flexBasis: `calc(100% / ${rowSize})`,
|
|
15
|
-
[`:not(:nth-of-type(${rowSize}n + 1))`]: {
|
|
16
|
-
borderLeftWidth: `${rowBorderWidth}px`
|
|
17
|
-
},
|
|
18
|
-
[`:nth-of-type(n+${rowSize + 1})`]: {
|
|
19
|
-
borderTopWidth: `${rowBorderWidth}px`
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const Container = /*#__PURE__*/styled(OrderedListBase).withConfig({
|
|
23
|
-
displayName: "WaffleGrid__Container",
|
|
24
|
-
componentId: "components-web__sc-ec8g0a-0"
|
|
25
|
-
})({
|
|
26
|
-
display: 'flex',
|
|
27
|
-
flexDirection: 'row',
|
|
28
|
-
flexWrap: 'wrap',
|
|
29
|
-
justifyContent: 'flex-start'
|
|
30
|
-
});
|
|
31
|
-
const Item = /*#__PURE__*/styled(ItemBase).withConfig({
|
|
32
|
-
displayName: "WaffleGrid__Item",
|
|
33
|
-
componentId: "components-web__sc-ec8g0a-1"
|
|
34
|
-
})(_ref => {
|
|
35
|
-
let {
|
|
36
|
-
rowSize,
|
|
37
|
-
itemPadding,
|
|
38
|
-
itemBorderColor,
|
|
39
|
-
rowBorderWidth
|
|
40
|
-
} = _ref;
|
|
41
|
-
return {
|
|
42
|
-
display: 'flex',
|
|
43
|
-
flexDirection: 'row',
|
|
44
|
-
alignItems: 'center',
|
|
45
|
-
justifyContent: 'center',
|
|
46
|
-
flexGrow: 1,
|
|
47
|
-
flexShrink: 1,
|
|
48
|
-
padding: `${itemPadding}px`,
|
|
49
|
-
boxSizing: 'border-box',
|
|
50
|
-
borderStyle: 'solid',
|
|
51
|
-
borderColor: itemBorderColor,
|
|
52
|
-
borderWidth: 0,
|
|
53
|
-
'& > a': {
|
|
54
|
-
alignSelf: 'center'
|
|
55
|
-
},
|
|
56
|
-
...row(rowSize, rowBorderWidth)
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
const Center = /*#__PURE__*/styled('div').withConfig({
|
|
60
|
-
displayName: "WaffleGrid__Center",
|
|
61
|
-
componentId: "components-web__sc-ec8g0a-2"
|
|
62
|
-
})({
|
|
63
|
-
display: 'flex',
|
|
64
|
-
flexDirection: 'column',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
textAlign: 'center'
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* The WaffleGrid is used to show items in a waffle like manner with borders surrounding the element
|
|
71
|
-
*/
|
|
72
|
-
const WaffleGrid = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
73
|
-
let {
|
|
74
|
-
items,
|
|
75
|
-
rowSize = null,
|
|
76
|
-
LinkRouter,
|
|
77
|
-
tokens,
|
|
78
|
-
variant,
|
|
79
|
-
linkRouterProps,
|
|
80
|
-
...rest
|
|
81
|
-
} = _ref2;
|
|
82
|
-
const viewport = useViewport();
|
|
83
|
-
const themeTokens = useThemeTokens('WaffleGrid', tokens, variant, {
|
|
84
|
-
viewport
|
|
85
|
-
});
|
|
86
|
-
const currentRowSize = useResponsiveProp(rowSize);
|
|
87
|
-
return /*#__PURE__*/_jsx(Container, {
|
|
88
|
-
ref: ref,
|
|
89
|
-
...selectProps(rest),
|
|
90
|
-
children: items.map(child => /*#__PURE__*/_createElement(Item, {
|
|
91
|
-
...themeTokens,
|
|
92
|
-
key: child.href,
|
|
93
|
-
rowSize: rowSize ? currentRowSize : themeTokens.rowSize
|
|
94
|
-
}, /*#__PURE__*/_jsx(Link, {
|
|
95
|
-
href: child.href,
|
|
96
|
-
LinkRouter: child.LinkRouter || LinkRouter,
|
|
97
|
-
linkRouterProps: {
|
|
98
|
-
...linkRouterProps,
|
|
99
|
-
...child.linkRouterProps
|
|
100
|
-
},
|
|
101
|
-
children: /*#__PURE__*/_jsxs(Center, {
|
|
102
|
-
children: [typeof child.image === 'string' ?
|
|
103
|
-
/*#__PURE__*/
|
|
104
|
-
// Assuming that string passed is the image URL
|
|
105
|
-
_jsx(Image, {
|
|
106
|
-
src: child.image,
|
|
107
|
-
alt: child.imageAltText,
|
|
108
|
-
width: 96
|
|
109
|
-
}) :
|
|
110
|
-
// Otherwise it must be an arbitrary content, which we just display by itself
|
|
111
|
-
child.image, /*#__PURE__*/_jsx(Typography, {
|
|
112
|
-
variant: {
|
|
113
|
-
weight: 'semibold'
|
|
114
|
-
},
|
|
115
|
-
children: child.text
|
|
116
|
-
})]
|
|
117
|
-
})
|
|
118
|
-
})))
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
WaffleGrid.displayName = 'WaffleGrid';
|
|
122
|
-
WaffleGrid.propTypes = {
|
|
123
|
-
...selectedSystemPropTypes,
|
|
124
|
-
/**
|
|
125
|
-
* The image and the link to display. `items` should be an array of objects with the following keys:
|
|
126
|
-
*/
|
|
127
|
-
items: PropTypes.arrayOf(PropTypes.shape({
|
|
128
|
-
/**
|
|
129
|
-
* The src attribute for the HTML img element or custom JSX content to render instead
|
|
130
|
-
*/
|
|
131
|
-
image: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
132
|
-
/**
|
|
133
|
-
* The alt attribute for the HTML img element (note that this is ignored if a custom
|
|
134
|
-
* JSX content is used instead of an image URL)
|
|
135
|
-
*/
|
|
136
|
-
imageAltText: PropTypes.string,
|
|
137
|
-
/**
|
|
138
|
-
* The text displayed under the image
|
|
139
|
-
*/
|
|
140
|
-
text: PropTypes.string,
|
|
141
|
-
/**
|
|
142
|
-
* Target URL
|
|
143
|
-
*/
|
|
144
|
-
href: PropTypes.string,
|
|
145
|
-
...withLinkRouter.propTypes
|
|
146
|
-
})).isRequired,
|
|
147
|
-
/**
|
|
148
|
-
* Sets the tokens for WaffleGrid element.
|
|
149
|
-
*/
|
|
150
|
-
tokens: getTokensPropType('WaffleGrid'),
|
|
151
|
-
/**
|
|
152
|
-
* Row size, optionally depending on the viewport
|
|
153
|
-
*/
|
|
154
|
-
rowSize: responsiveProps.getTypeOptionallyByViewport(PropTypes.number),
|
|
155
|
-
...withLinkRouter.propTypes
|
|
156
|
-
};
|
|
157
|
-
export default WaffleGrid;
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { selectSystemProps } from '@telus-uds/components-base';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import YouTube from 'react-youtube';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import VideoSplash from '../shared/VideoSplash/VideoSplash';
|
|
7
|
-
import { htmlAttrs } from '../utils';
|
|
8
|
-
import { triggerInProgressVideoIntervals, YoutubePlayerState } from './utils';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const StyledPlayerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
12
|
-
displayName: "WebVideo__StyledPlayerContainer",
|
|
13
|
-
componentId: "components-web__sc-327a6k-0"
|
|
14
|
-
})({
|
|
15
|
-
width: '100%',
|
|
16
|
-
minWidth: 288,
|
|
17
|
-
outline: 'none'
|
|
18
|
-
});
|
|
19
|
-
const StyledYoutubePlayer = /*#__PURE__*/styled(YouTube).withConfig({
|
|
20
|
-
displayName: "WebVideo__StyledYoutubePlayer",
|
|
21
|
-
componentId: "components-web__sc-327a6k-1"
|
|
22
|
-
})({
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
top: 0,
|
|
25
|
-
left: 0,
|
|
26
|
-
bottom: 0,
|
|
27
|
-
right: 0
|
|
28
|
-
});
|
|
29
|
-
const aspectRatios = {
|
|
30
|
-
'16:9': {
|
|
31
|
-
paddingTop: '56.25%'
|
|
32
|
-
},
|
|
33
|
-
'4:3': {
|
|
34
|
-
paddingTop: '75%'
|
|
35
|
-
},
|
|
36
|
-
'1:1': {
|
|
37
|
-
paddingTop: '100%'
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const AspectLimiter = /*#__PURE__*/styled.div.withConfig({
|
|
41
|
-
displayName: "WebVideo__AspectLimiter",
|
|
42
|
-
componentId: "components-web__sc-327a6k-2"
|
|
43
|
-
})(props => ({
|
|
44
|
-
...aspectRatios[props.aspectRatio],
|
|
45
|
-
position: 'relative'
|
|
46
|
-
}));
|
|
47
|
-
const WebVideo = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
48
|
-
let {
|
|
49
|
-
videoId,
|
|
50
|
-
aspectRatio = '16:9',
|
|
51
|
-
posterSrc,
|
|
52
|
-
defaultVolume = 1,
|
|
53
|
-
beginMuted = false,
|
|
54
|
-
videoLength,
|
|
55
|
-
copy,
|
|
56
|
-
onPlay = () => {},
|
|
57
|
-
onPause = () => {},
|
|
58
|
-
onEnd = () => {},
|
|
59
|
-
onProgress = () => {},
|
|
60
|
-
onStart = () => {},
|
|
61
|
-
...rest
|
|
62
|
-
} = _ref;
|
|
63
|
-
const [started, setStarted] = React.useState(false);
|
|
64
|
-
const videoStateData = React.useRef({
|
|
65
|
-
requestAnimationIds: [],
|
|
66
|
-
state: YoutubePlayerState.UNSTARTED
|
|
67
|
-
});
|
|
68
|
-
const playerRef = React.useRef(null);
|
|
69
|
-
const onPlayCallback = event => {
|
|
70
|
-
onPlay(event, videoStateData.current.state === YoutubePlayerState.PAUSED);
|
|
71
|
-
videoStateData.current.state = YoutubePlayerState.PLAYING;
|
|
72
|
-
if (onProgress) {
|
|
73
|
-
videoStateData.current.requestAnimationIds = triggerInProgressVideoIntervals(onProgress, playerRef, event);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const initializeYoutubePlayer = event => {
|
|
77
|
-
onStart();
|
|
78
|
-
playerRef.current = event.target;
|
|
79
|
-
if (beginMuted) {
|
|
80
|
-
event.target.mute();
|
|
81
|
-
}
|
|
82
|
-
event.target.setVolume(defaultVolume);
|
|
83
|
-
event.target.playVideo(); // This plays the video after passing the splash screen on mobile.
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const onEndVideoCallback = event => {
|
|
87
|
-
onEnd(event);
|
|
88
|
-
videoStateData.current.requestAnimationIds.forEach(id => cancelAnimationFrame(id));
|
|
89
|
-
videoStateData.current.requestAnimationIds = [];
|
|
90
|
-
videoStateData.current.state = YoutubePlayerState.ENDED;
|
|
91
|
-
if (onProgress) {
|
|
92
|
-
onProgress(event, 100);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
const onPauseVideoCallback = event => {
|
|
96
|
-
videoStateData.current.requestAnimationIds.forEach(id => cancelAnimationFrame(id));
|
|
97
|
-
onPause(event);
|
|
98
|
-
videoStateData.current.state = YoutubePlayerState.PAUSED;
|
|
99
|
-
videoStateData.current.requestAnimationIds = [];
|
|
100
|
-
};
|
|
101
|
-
return /*#__PURE__*/_jsx(StyledPlayerContainer, {
|
|
102
|
-
ref: ref,
|
|
103
|
-
"data-testid": "web-video-container",
|
|
104
|
-
...selectProps(rest),
|
|
105
|
-
children: /*#__PURE__*/_jsx(AspectLimiter, {
|
|
106
|
-
aspectRatio: aspectRatio,
|
|
107
|
-
children: started ? /*#__PURE__*/_jsx(StyledYoutubePlayer, {
|
|
108
|
-
videoId: videoId,
|
|
109
|
-
opts: {
|
|
110
|
-
width: '100%',
|
|
111
|
-
height: '100%',
|
|
112
|
-
playerVars: {
|
|
113
|
-
autoplay: 1,
|
|
114
|
-
modestbranding: 1,
|
|
115
|
-
playsinline: 1,
|
|
116
|
-
rel: 0
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
onReady: initializeYoutubePlayer,
|
|
120
|
-
onPlay: onPlayCallback,
|
|
121
|
-
onPause: onPauseVideoCallback,
|
|
122
|
-
onEnd: onEndVideoCallback
|
|
123
|
-
}) : /*#__PURE__*/_jsx(VideoSplash, {
|
|
124
|
-
poster: posterSrc || `https://img.youtube.com/vi/${videoId}/maxresdefault.jpg`,
|
|
125
|
-
videoLength: videoLength,
|
|
126
|
-
copy: copy,
|
|
127
|
-
onClick: () => {
|
|
128
|
-
setStarted(true);
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
WebVideo.displayName = 'WebVideo';
|
|
135
|
-
export const VideoProps = {
|
|
136
|
-
...selectedSystemPropTypes,
|
|
137
|
-
/**
|
|
138
|
-
* The video's ID, typically available via the video's URL.
|
|
139
|
-
*/
|
|
140
|
-
videoId: PropTypes.string.isRequired,
|
|
141
|
-
/**
|
|
142
|
-
* The aspect ratio of the player.
|
|
143
|
-
*/
|
|
144
|
-
aspectRatio: PropTypes.oneOf(['16:9', '4:3', '1:1']),
|
|
145
|
-
/**
|
|
146
|
-
* 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.
|
|
147
|
-
*/
|
|
148
|
-
posterSrc: PropTypes.string,
|
|
149
|
-
/**
|
|
150
|
-
* The video's default volume, defined from 1 to 100. Please use the `beginMuted` prop to have the video start silenced.
|
|
151
|
-
*/
|
|
152
|
-
defaultVolume: PropTypes.number,
|
|
153
|
-
/**
|
|
154
|
-
* Defines if the video should start muted.
|
|
155
|
-
*/
|
|
156
|
-
beginMuted: PropTypes.bool,
|
|
157
|
-
/**
|
|
158
|
-
* The video's length, which will be displayed on the splash screen. This is defined in seconds.
|
|
159
|
-
*/
|
|
160
|
-
videoLength: PropTypes.number.isRequired,
|
|
161
|
-
/**
|
|
162
|
-
* The splash screen UI's language as an ISO language code. It currently supports English and French.
|
|
163
|
-
*/
|
|
164
|
-
copy: PropTypes.oneOf(['en', 'fr']),
|
|
165
|
-
/**
|
|
166
|
-
* A function to be run when the play button is pressed on the video splash screen and the video is ready to play.
|
|
167
|
-
*/
|
|
168
|
-
onStart: PropTypes.func,
|
|
169
|
-
/**
|
|
170
|
-
* A function to be run when the video is played.
|
|
171
|
-
*/
|
|
172
|
-
onPlay: PropTypes.func,
|
|
173
|
-
/**
|
|
174
|
-
* A function to be run when the video is paused.
|
|
175
|
-
*/
|
|
176
|
-
onPause: PropTypes.func,
|
|
177
|
-
/**
|
|
178
|
-
* A function to be run when the video ends.
|
|
179
|
-
*/
|
|
180
|
-
onEnd: PropTypes.func,
|
|
181
|
-
/**
|
|
182
|
-
* A function to be run when the video resumes.
|
|
183
|
-
*/
|
|
184
|
-
onResume: PropTypes.func,
|
|
185
|
-
/**
|
|
186
|
-
* A function to be run when the video progresses. This function will be run at 10%, 25%, 50%, 75% and 100%.
|
|
187
|
-
*/
|
|
188
|
-
onProgress: PropTypes.func
|
|
189
|
-
};
|
|
190
|
-
WebVideo.propTypes = VideoProps;
|
|
191
|
-
export default WebVideo;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fires analytics events for inProgress analytics
|
|
3
|
-
* @param {current progress} progress
|
|
4
|
-
* @param {callback to run on defined milestones} onProgress
|
|
5
|
-
* @param {YouTube Video Event} event
|
|
6
|
-
*/
|
|
7
|
-
const fireVideoProgressEvents = (progress, onProgress, event) => {
|
|
8
|
-
const validProgressValues = [10, 25, 50, 75];
|
|
9
|
-
if (validProgressValues.includes(progress)) {
|
|
10
|
-
onProgress(event, progress);
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export const YoutubePlayerState = {
|
|
14
|
-
UNSTARTED: -1,
|
|
15
|
-
ENDED: 0,
|
|
16
|
-
PLAYING: 1,
|
|
17
|
-
PAUSED: 2,
|
|
18
|
-
BUFFERING: 3,
|
|
19
|
-
CUED: 5
|
|
20
|
-
};
|
|
21
|
-
const PERCENTAGE_MULTIPLIER = 100;
|
|
22
|
-
/**
|
|
23
|
-
* Run an interval to check the progress of the video and fire events at 10%, 25%, 50% and 75%
|
|
24
|
-
* @param {callback to run on defined milestones} onProgress
|
|
25
|
-
* @param {player reference} playerRef
|
|
26
|
-
* @param {YouTube video event} event
|
|
27
|
-
*/
|
|
28
|
-
export const triggerInProgressVideoIntervals = (onProgress, playerRef, event) => {
|
|
29
|
-
const duration = playerRef.current.getDuration();
|
|
30
|
-
let lastProgress = null;
|
|
31
|
-
const requestAnimationFrameIds = [];
|
|
32
|
-
const frame = () => {
|
|
33
|
-
const currentTime = playerRef.current.getCurrentTime();
|
|
34
|
-
const progress = Math.round(currentTime / duration * PERCENTAGE_MULTIPLIER);
|
|
35
|
-
if (progress !== lastProgress) {
|
|
36
|
-
fireVideoProgressEvents(progress, onProgress, event);
|
|
37
|
-
lastProgress = progress;
|
|
38
|
-
}
|
|
39
|
-
if (currentTime < duration) {
|
|
40
|
-
requestAnimationFrameIds.push(requestAnimationFrame(frame));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// Cancel any previous animation frames
|
|
45
|
-
requestAnimationFrameIds.forEach(id => cancelAnimationFrame(id));
|
|
46
|
-
|
|
47
|
-
// Start a new animation frame
|
|
48
|
-
requestAnimationFrameIds.push(requestAnimationFrame(frame));
|
|
49
|
-
return requestAnimationFrameIds;
|
|
50
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The following are re-exported unchanged from components-base.
|
|
3
|
-
*/
|
|
4
|
-
export {
|
|
5
|
-
/**
|
|
6
|
-
* Most base components should be re-exported as-is.
|
|
7
|
-
*/
|
|
8
|
-
ActionCard, A11yText, ActivityIndicator, Autocomplete, Box, Button, BaseProvider, A11yInfoProvider, ViewportProvider, ThemeProvider, ButtonDropdown, ButtonGroup, ButtonLink, CardGroup, Carousel, CarouselTabs, Checkbox, CheckboxGroup, ChevronLink, ColourToggle, Divider, DownloadApp, ExpandCollapse, Feedback, FlexGrid, FileUpload, Icon, InputLabel, InputSupports, Link, Listbox, Modal, MultiSelectFilter, Notification, Pagination, Portal, QuickLinks, QuickLinksFeature, Radio, RadioGroup, RadioCard, RadioCardGroup, Responsive, Search, Select, SideNav, Skeleton, SkipLink, Spacer, StackView, StackWrap, StepTracker, Status, Tabs, TabBar, Tags, TextButton, TextArea, TextInput, Timeline, ToggleSwitch, ToggleSwitchGroup, TooltipButton, Tooltip, Typography, Validator,
|
|
9
|
-
/*
|
|
10
|
-
* Most utilities exported from @telus-uds/components-base are for building systems, not apps.
|
|
11
|
-
* Re-export only those utilities with a stable API and known use cases within apps / pages.
|
|
12
|
-
*/
|
|
13
|
-
// Enable access to the viewports system for app-specific responsive layouts and features
|
|
14
|
-
useResponsiveProp, useViewport,
|
|
15
|
-
// TODO reenable ViewportContext once published from base // enable localised viewport overrides e.g. in tests, narrow columns, etc
|
|
16
|
-
useCarousel, useSetTheme } from '@telus-uds/components-base';
|
|
17
|
-
|
|
18
|
-
// TODO: Added `WebPortal` alias for backwards compatibility with `Portal` from `@telus-uds/components-base`. Remove in next major version.
|
|
19
|
-
export { Portal as WebPortal } from '@telus-uds/components-base';
|
package/lib-module/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
export { default as Badge } from './Badge';
|
|
4
|
-
export { default as OrderedList } from './OrderedList';
|
|
5
|
-
export { default as PreviewCard } from './PreviewCard';
|
|
6
|
-
export { default as ResponsiveImage } from './ResponsiveImage';
|
|
7
|
-
export { default as Ribbon } from './Ribbon';
|
|
8
|
-
export { default as Countdown } from './Countdown';
|
|
9
|
-
export { default as DatePicker } from './DatePicker';
|
|
10
|
-
export { default as Paragraph } from './Paragraph';
|
|
11
|
-
export { default as Span } from './Span';
|
|
12
|
-
export { default as ExpandCollapseMini } from './ExpandCollapseMini';
|
|
13
|
-
export { default as Callout } from './Callout';
|
|
14
|
-
export { default as PriceLockup } from './PriceLockup';
|
|
15
|
-
export { default as Footnote } from './Footnote';
|
|
16
|
-
export { default as QuantitySelector } from './QuantitySelector';
|
|
17
|
-
export { default as IconButton } from './IconButton';
|
|
18
|
-
export { default as Image, DefaultImage } from './Image';
|
|
19
|
-
export { transformGradient } from './utils';
|
|
20
|
-
export { default as Breadcrumbs } from './Breadcrumbs';
|
|
21
|
-
export { default as BlockQuote } from './BlockQuote';
|
|
22
|
-
export { default as OptimizeImage } from './OptimizeImage';
|
|
23
|
-
export { default as Testimonial } from './Testimonial';
|
|
24
|
-
export { default as Toast } from './Toast';
|
|
25
|
-
export { default as Table } from './Table';
|
|
26
|
-
export { default as WebVideo } from './WebVideo';
|
|
27
|
-
export { default as WaffleGrid } from './WaffleGrid';
|
|
28
|
-
export { default as Spinner } from './Spinner';
|
|
29
|
-
export { default as VideoPicker } from './VideoPicker';
|
|
30
|
-
export { default as Video } from './Video';
|
|
31
|
-
export { default as StoryCard } from './StoryCard';
|
|
32
|
-
export { default as Disclaimer } from './Disclaimer';
|
|
33
|
-
export { default as Card } from './Card';
|
|
34
|
-
export { default as List } from './List';
|
|
35
|
-
export { default as TermsAndConditions } from './TermsAndConditions';
|
|
36
|
-
export { default as NavigationBar } from './NavigationBar';
|
|
37
|
-
export { default as Progress } from './Progress';
|
|
38
|
-
export { default as SkeletonProvider } from './SkeletonProvider';
|
|
39
|
-
export { ssrStyles } from './utils';
|
|
40
|
-
export * from './baseExports';
|
package/lib-module/server.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const ConditionalWrapper = _ref => {
|
|
5
|
-
let {
|
|
6
|
-
children,
|
|
7
|
-
condition,
|
|
8
|
-
WrapperComponent,
|
|
9
|
-
wrapperProps
|
|
10
|
-
} = _ref;
|
|
11
|
-
return condition ? /*#__PURE__*/_jsx(WrapperComponent, {
|
|
12
|
-
...wrapperProps,
|
|
13
|
-
children: children
|
|
14
|
-
}) : children;
|
|
15
|
-
};
|
|
16
|
-
ConditionalWrapper.propTypes = {
|
|
17
|
-
children: PropTypes.node,
|
|
18
|
-
condition: PropTypes.bool,
|
|
19
|
-
WrapperComponent: PropTypes.elementType,
|
|
20
|
-
wrapperProps: PropTypes.object
|
|
21
|
-
};
|
|
22
|
-
export default ConditionalWrapper;
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import ResponsiveImage from '../../ResponsiveImage';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const selectFullBleedContentProps = _ref => {
|
|
7
|
-
let {
|
|
8
|
-
alt,
|
|
9
|
-
height,
|
|
10
|
-
loading,
|
|
11
|
-
src,
|
|
12
|
-
width,
|
|
13
|
-
fallbackSrc = src,
|
|
14
|
-
lgSrc = src,
|
|
15
|
-
mdSrc = src,
|
|
16
|
-
smSrc = src,
|
|
17
|
-
xlSrc = src,
|
|
18
|
-
xsSrc = src
|
|
19
|
-
} = _ref;
|
|
20
|
-
return {
|
|
21
|
-
alt,
|
|
22
|
-
height,
|
|
23
|
-
loading,
|
|
24
|
-
src,
|
|
25
|
-
width,
|
|
26
|
-
fallbackSrc,
|
|
27
|
-
lgSrc,
|
|
28
|
-
mdSrc,
|
|
29
|
-
smSrc,
|
|
30
|
-
xlSrc,
|
|
31
|
-
xsSrc
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const FullBleedContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
35
|
-
displayName: "FullBleedContent__FullBleedContentContainer",
|
|
36
|
-
componentId: "components-web__sc-1130ea5-0"
|
|
37
|
-
})(_ref2 => {
|
|
38
|
-
let {
|
|
39
|
-
borderBottomLeftRadius,
|
|
40
|
-
borderBottomRightRadius,
|
|
41
|
-
borderTopLeftRadius,
|
|
42
|
-
borderTopRightRadius
|
|
43
|
-
} = _ref2;
|
|
44
|
-
return {
|
|
45
|
-
overflow: 'hidden',
|
|
46
|
-
borderBottomLeftRadius,
|
|
47
|
-
borderBottomRightRadius,
|
|
48
|
-
borderTopLeftRadius,
|
|
49
|
-
borderTopRightRadius
|
|
50
|
-
};
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Full bleed content component can accept either a single source,
|
|
55
|
-
* a number of sources corresponding to the `ResponsiveImage` component API,
|
|
56
|
-
* or a custom component.
|
|
57
|
-
*/
|
|
58
|
-
const FullBleedContent = _ref3 => {
|
|
59
|
-
let {
|
|
60
|
-
borderRadius,
|
|
61
|
-
content,
|
|
62
|
-
...rest
|
|
63
|
-
} = _ref3;
|
|
64
|
-
return /*#__PURE__*/_jsx(FullBleedContentContainer, {
|
|
65
|
-
...borderRadius,
|
|
66
|
-
children: content ?? /*#__PURE__*/_jsx(ResponsiveImage, {
|
|
67
|
-
...selectFullBleedContentProps(rest)
|
|
68
|
-
})
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
FullBleedContent.propTypes = {
|
|
72
|
-
/**
|
|
73
|
-
* Content border radius matching the edge values on the parent card.
|
|
74
|
-
*/
|
|
75
|
-
borderRadius: PropTypes.shape({
|
|
76
|
-
borderBottomLeftRadius: PropTypes.number,
|
|
77
|
-
borderBottomRightRadius: PropTypes.number,
|
|
78
|
-
borderTopLeftRadius: PropTypes.number,
|
|
79
|
-
borderTopRightRadius: PropTypes.number
|
|
80
|
-
}),
|
|
81
|
-
/**
|
|
82
|
-
* Custom JSX to be used for rendering the content (defaults to `ResponsiveImage` receiving other props).
|
|
83
|
-
*/
|
|
84
|
-
content: PropTypes.node,
|
|
85
|
-
/**
|
|
86
|
-
* Image source.
|
|
87
|
-
*/
|
|
88
|
-
src: PropTypes.string,
|
|
89
|
-
/**
|
|
90
|
-
* Also accept props for `ResponsiveImage`...
|
|
91
|
-
*/
|
|
92
|
-
...ResponsiveImage.propTypes,
|
|
93
|
-
/**
|
|
94
|
-
* ...but make the required ones optional.
|
|
95
|
-
*/
|
|
96
|
-
alt: PropTypes.string,
|
|
97
|
-
xsSrc: PropTypes.string,
|
|
98
|
-
smSrc: PropTypes.string,
|
|
99
|
-
fallbackSrc: PropTypes.string
|
|
100
|
-
};
|
|
101
|
-
export default FullBleedContent;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gets the border radius values for an item of content that goes right up to
|
|
3
|
-
* the edges of its container, to the top, bottom, left or right of other content.
|
|
4
|
-
*
|
|
5
|
-
* Gives the full bleed item the same border radius as the container on the corners
|
|
6
|
-
* that are flush with the corners of the container.
|
|
7
|
-
*
|
|
8
|
-
* @param {number} borderRadius
|
|
9
|
-
* @param {'top'|'bottom'|'left'|'right'} position
|
|
10
|
-
* @param {boolean} hasFooter
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
const getFullBleedBorderRadius = function (borderRadius, position) {
|
|
14
|
-
let hasFooter = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
15
|
-
const innerBorderRadius = {
|
|
16
|
-
borderBottomLeftRadius: 0,
|
|
17
|
-
borderBottomRightRadius: 0,
|
|
18
|
-
borderTopLeftRadius: 0,
|
|
19
|
-
borderTopRightRadius: 0
|
|
20
|
-
};
|
|
21
|
-
if (position && position !== 'none') {
|
|
22
|
-
if (borderRadius) {
|
|
23
|
-
// Depending on the position of the image, we need to round some
|
|
24
|
-
// corners, but not the others
|
|
25
|
-
switch (position) {
|
|
26
|
-
case 'bottom':
|
|
27
|
-
if (!hasFooter) {
|
|
28
|
-
innerBorderRadius.borderBottomLeftRadius = borderRadius;
|
|
29
|
-
innerBorderRadius.borderBottomRightRadius = borderRadius;
|
|
30
|
-
}
|
|
31
|
-
break;
|
|
32
|
-
case 'left':
|
|
33
|
-
if (!hasFooter) {
|
|
34
|
-
innerBorderRadius.borderBottomLeftRadius = borderRadius;
|
|
35
|
-
}
|
|
36
|
-
innerBorderRadius.borderTopLeftRadius = borderRadius;
|
|
37
|
-
break;
|
|
38
|
-
case 'right':
|
|
39
|
-
if (!hasFooter) {
|
|
40
|
-
innerBorderRadius.borderBottomRightRadius = borderRadius;
|
|
41
|
-
}
|
|
42
|
-
innerBorderRadius.borderTopRightRadius = borderRadius;
|
|
43
|
-
break;
|
|
44
|
-
case 'top':
|
|
45
|
-
innerBorderRadius.borderTopLeftRadius = borderRadius;
|
|
46
|
-
innerBorderRadius.borderTopRightRadius = borderRadius;
|
|
47
|
-
break;
|
|
48
|
-
default:
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return innerBorderRadius;
|
|
54
|
-
};
|
|
55
|
-
export default getFullBleedBorderRadius;
|