@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,153 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
-
const ExpandCollapseControl = /*#__PURE__*/styled.div.withConfig({
|
|
8
|
-
displayName: "ExpandCollapse__ExpandCollapseControl",
|
|
9
|
-
componentId: "components-web__sc-1l2mmq7-0"
|
|
10
|
-
})({
|
|
11
|
-
alignItems: 'center',
|
|
12
|
-
cursor: 'pointer',
|
|
13
|
-
display: 'flex',
|
|
14
|
-
flex: 1,
|
|
15
|
-
justifyContent: 'flex-start'
|
|
16
|
-
});
|
|
17
|
-
const ExpandCollapseIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18
|
-
displayName: "ExpandCollapse__ExpandCollapseIconContainer",
|
|
19
|
-
componentId: "components-web__sc-1l2mmq7-1"
|
|
20
|
-
})(_ref => {
|
|
21
|
-
let {
|
|
22
|
-
tokens
|
|
23
|
-
} = _ref;
|
|
24
|
-
return {
|
|
25
|
-
alignItems: tokens.expandIconContainerAlignItems,
|
|
26
|
-
justifyContent: tokens.expandIconContainerJustifyContent,
|
|
27
|
-
marginLeft: `${tokens.expandIconContainerMarginY}px`,
|
|
28
|
-
marginRight: `${tokens.expandIconContainerMarginY}px`,
|
|
29
|
-
width: tokens.expandIconContainerWidth
|
|
30
|
-
};
|
|
31
|
-
});
|
|
32
|
-
const ExpandCollapseTitle = /*#__PURE__*/styled.h4.withConfig({
|
|
33
|
-
displayName: "ExpandCollapse__ExpandCollapseTitle",
|
|
34
|
-
componentId: "components-web__sc-1l2mmq7-2"
|
|
35
|
-
})(_ref2 => {
|
|
36
|
-
let {
|
|
37
|
-
tokens
|
|
38
|
-
} = _ref2;
|
|
39
|
-
return {
|
|
40
|
-
color: tokens.expandTitleColor,
|
|
41
|
-
fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
|
|
42
|
-
fontSize: tokens.expandTitleFontSize,
|
|
43
|
-
lineHeight: tokens.expandTitleLineHeight,
|
|
44
|
-
margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
|
|
45
|
-
};
|
|
46
|
-
});
|
|
47
|
-
const getIconButtonTokens = _ref3 => {
|
|
48
|
-
let {
|
|
49
|
-
icon,
|
|
50
|
-
iconBackgroundColor,
|
|
51
|
-
iconBorderColor,
|
|
52
|
-
iconColor,
|
|
53
|
-
iconOuterBorderColor,
|
|
54
|
-
iconOuterBorderGap,
|
|
55
|
-
iconOuterBorderWidth
|
|
56
|
-
} = _ref3;
|
|
57
|
-
return {
|
|
58
|
-
icon,
|
|
59
|
-
backgroundColor: iconBackgroundColor,
|
|
60
|
-
borderColor: iconBorderColor,
|
|
61
|
-
iconColor,
|
|
62
|
-
outerBorderColor: iconOuterBorderColor,
|
|
63
|
-
outerBorderGap: iconOuterBorderGap,
|
|
64
|
-
outerBorderWidth: iconOuterBorderWidth
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
const ExpandCollapse = /*#__PURE__*/React.forwardRef((_ref4, ref) => {
|
|
68
|
-
let {
|
|
69
|
-
children,
|
|
70
|
-
collapseTitle,
|
|
71
|
-
expandTitle = collapseTitle,
|
|
72
|
-
expandLabel,
|
|
73
|
-
collapseLabel
|
|
74
|
-
} = _ref4;
|
|
75
|
-
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {});
|
|
76
|
-
const {
|
|
77
|
-
expandBaseBorderWidth,
|
|
78
|
-
expandContentPaddingBottom,
|
|
79
|
-
expandContentPaddingLeft,
|
|
80
|
-
expandContentPaddingRight,
|
|
81
|
-
expandContentPaddingTop,
|
|
82
|
-
contentBorderColor,
|
|
83
|
-
contentMarginBottom,
|
|
84
|
-
headerBackgroundColor,
|
|
85
|
-
expandTitlePaddingLeft,
|
|
86
|
-
expandTitleBorder,
|
|
87
|
-
expandTitleBorderColor,
|
|
88
|
-
expandTitleUnderline
|
|
89
|
-
} = getTokens();
|
|
90
|
-
return /*#__PURE__*/_jsx(ExpandCollapseBase, {
|
|
91
|
-
tokens: {
|
|
92
|
-
borderWidth: expandBaseBorderWidth
|
|
93
|
-
},
|
|
94
|
-
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapseBase.Panel, {
|
|
95
|
-
...expandProps,
|
|
96
|
-
panelId: "ExpandCollapsePanel",
|
|
97
|
-
controlTokens: {
|
|
98
|
-
icon: null,
|
|
99
|
-
backgroundColor: 'transparent',
|
|
100
|
-
paddingLeft: expandTitlePaddingLeft,
|
|
101
|
-
borderColor: expandTitleBorderColor,
|
|
102
|
-
borderWidth: expandTitleBorder,
|
|
103
|
-
textLine: expandTitleUnderline
|
|
104
|
-
}
|
|
105
|
-
// TODO refactor
|
|
106
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
107
|
-
,
|
|
108
|
-
control: pressableState => {
|
|
109
|
-
const {
|
|
110
|
-
expanded
|
|
111
|
-
} = pressableState || {};
|
|
112
|
-
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
|
|
113
|
-
const label = expanded ? collapseLabel : expandLabel;
|
|
114
|
-
return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
|
|
115
|
-
ref: ref,
|
|
116
|
-
children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
|
|
117
|
-
tokens: getTokens(),
|
|
118
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
|
119
|
-
variant: {
|
|
120
|
-
size: 'small'
|
|
121
|
-
},
|
|
122
|
-
tokens: iconTokens,
|
|
123
|
-
focusable: false,
|
|
124
|
-
accessibilityLabel: label
|
|
125
|
-
})
|
|
126
|
-
}), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
|
|
127
|
-
tokens: getTokens(),
|
|
128
|
-
children: expanded ? expandTitle : collapseTitle
|
|
129
|
-
})]
|
|
130
|
-
});
|
|
131
|
-
},
|
|
132
|
-
tokens: {
|
|
133
|
-
contentPaddingBottom: expandContentPaddingBottom,
|
|
134
|
-
contentPaddingLeft: expandContentPaddingLeft,
|
|
135
|
-
contentPaddingRight: expandContentPaddingRight,
|
|
136
|
-
contentPaddingTop: expandContentPaddingTop,
|
|
137
|
-
contentPanelBackgroundColor: headerBackgroundColor,
|
|
138
|
-
borderColor: contentBorderColor,
|
|
139
|
-
marginBottom: contentMarginBottom
|
|
140
|
-
},
|
|
141
|
-
children: children
|
|
142
|
-
})
|
|
143
|
-
});
|
|
144
|
-
});
|
|
145
|
-
ExpandCollapse.displayName = 'ExpandCollapse';
|
|
146
|
-
ExpandCollapse.propTypes = {
|
|
147
|
-
children: PropTypes.node.isRequired,
|
|
148
|
-
collapseTitle: PropTypes.string.isRequired,
|
|
149
|
-
expandTitle: PropTypes.string,
|
|
150
|
-
collapseLabel: PropTypes.string,
|
|
151
|
-
expandLabel: PropTypes.string
|
|
152
|
-
};
|
|
153
|
-
export default ExpandCollapse;
|
|
@@ -1,277 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport, getTokensPropType, useTheme, useResponsiveThemeTokens, createMediaQueryStyles, StyleSheet } from '@telus-uds/components-base';
|
|
5
|
-
import ExpandCollapse from './ExpandCollapse';
|
|
6
|
-
import OrderedListBase from '../OrderedList/OrderedListBase';
|
|
7
|
-
import { htmlAttrs, media, renderStructuredContent } from '../utils';
|
|
8
|
-
import defaultDictionary from './dictionary';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
12
|
-
const ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
-
displayName: "TermsAndConditions__ContentContainer",
|
|
14
|
-
componentId: "components-web__sc-1199epn-0"
|
|
15
|
-
})(_ref => {
|
|
16
|
-
let {
|
|
17
|
-
tokens
|
|
18
|
-
} = _ref;
|
|
19
|
-
return {
|
|
20
|
-
paddingBottom: tokens.contentPaddingBottom,
|
|
21
|
-
paddingLeft: tokens.contentPaddingLeft,
|
|
22
|
-
...media().from('md').css({
|
|
23
|
-
paddingBottom: tokens.mdContentPaddingBottom,
|
|
24
|
-
paddingLeft: tokens.mdContentPaddingLeft
|
|
25
|
-
})
|
|
26
|
-
};
|
|
27
|
-
});
|
|
28
|
-
const Ordered = /*#__PURE__*/styled(OrderedListBase).withConfig({
|
|
29
|
-
displayName: "TermsAndConditions__Ordered",
|
|
30
|
-
componentId: "components-web__sc-1199epn-1"
|
|
31
|
-
})(_ref2 => {
|
|
32
|
-
let {
|
|
33
|
-
tokens
|
|
34
|
-
} = _ref2;
|
|
35
|
-
return {
|
|
36
|
-
listStylePosition: 'outside',
|
|
37
|
-
padding: tokens.orderedPadding
|
|
38
|
-
};
|
|
39
|
-
});
|
|
40
|
-
const Unordered = /*#__PURE__*/styled.ul.withConfig({
|
|
41
|
-
displayName: "TermsAndConditions__Unordered",
|
|
42
|
-
componentId: "components-web__sc-1199epn-2"
|
|
43
|
-
})(_ref3 => {
|
|
44
|
-
let {
|
|
45
|
-
tokens
|
|
46
|
-
} = _ref3;
|
|
47
|
-
return {
|
|
48
|
-
listStyleType: 'none',
|
|
49
|
-
margin: 0,
|
|
50
|
-
padding: 0,
|
|
51
|
-
paddingTop: tokens.unorderedPadding
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
|
|
55
|
-
displayName: "TermsAndConditions__ListItem",
|
|
56
|
-
componentId: "components-web__sc-1199epn-3"
|
|
57
|
-
})(_ref4 => {
|
|
58
|
-
let {
|
|
59
|
-
tokens
|
|
60
|
-
} = _ref4;
|
|
61
|
-
return {
|
|
62
|
-
display: 'list-item',
|
|
63
|
-
'&::marker': {
|
|
64
|
-
fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
|
|
65
|
-
fontSize: tokens.listFontSize,
|
|
66
|
-
lineHeight: tokens.listLineHeight,
|
|
67
|
-
textAlign: 'end !important'
|
|
68
|
-
},
|
|
69
|
-
color: tokens.listColor,
|
|
70
|
-
fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
|
|
71
|
-
fontSize: tokens.listFontSize,
|
|
72
|
-
lineHeight: tokens.listLineHeight,
|
|
73
|
-
marginBottom: tokens.listMarginBottom,
|
|
74
|
-
marginLeft: tokens.listMarginLeft,
|
|
75
|
-
wordBreak: 'break-word'
|
|
76
|
-
};
|
|
77
|
-
});
|
|
78
|
-
const NonIndexedContentTitle = /*#__PURE__*/styled.div.withConfig({
|
|
79
|
-
displayName: "TermsAndConditions__NonIndexedContentTitle",
|
|
80
|
-
componentId: "components-web__sc-1199epn-4"
|
|
81
|
-
})(_ref5 => {
|
|
82
|
-
let {
|
|
83
|
-
tokens
|
|
84
|
-
} = _ref5;
|
|
85
|
-
return {
|
|
86
|
-
color: tokens.titleColor,
|
|
87
|
-
fontSize: tokens.titleFontSize,
|
|
88
|
-
lineHeight: tokens.titleLineHeight,
|
|
89
|
-
paddingLeft: tokens.titlePaddingLeft
|
|
90
|
-
};
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Use `TermsAndConditions` to display important legal content.
|
|
95
|
-
*
|
|
96
|
-
* ## Usage Criteria
|
|
97
|
-
*
|
|
98
|
-
* - Display before the page footer, except for call-to-action callback cards
|
|
99
|
-
* - Responsive display based on breakpoints
|
|
100
|
-
* - Use `copy` to set language, ‘en’ for English or ‘fr’ for French
|
|
101
|
-
*/
|
|
102
|
-
const TermsAndConditions = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
103
|
-
let {
|
|
104
|
-
copy = 'en',
|
|
105
|
-
indexedContent = [],
|
|
106
|
-
nonIndexedContent = [],
|
|
107
|
-
tokens = {},
|
|
108
|
-
variant = {},
|
|
109
|
-
dictionary = defaultDictionary,
|
|
110
|
-
...rest
|
|
111
|
-
} = _ref6;
|
|
112
|
-
const getCopy = useCopy({
|
|
113
|
-
dictionary,
|
|
114
|
-
copy
|
|
115
|
-
});
|
|
116
|
-
const hasIndexedContent = indexedContent.length > 0;
|
|
117
|
-
const hasNonIndexedContent = nonIndexedContent.length > 0;
|
|
118
|
-
const viewport = useViewport();
|
|
119
|
-
const {
|
|
120
|
-
themeOptions
|
|
121
|
-
} = useTheme();
|
|
122
|
-
const {
|
|
123
|
-
enableMediaQueryStyleSheet
|
|
124
|
-
} = themeOptions;
|
|
125
|
-
const useTokens = enableMediaQueryStyleSheet ? useResponsiveThemeTokens : useThemeTokens;
|
|
126
|
-
const themeTokens = useTokens('TermsAndConditions', tokens, variant, !enableMediaQueryStyleSheet && {
|
|
127
|
-
viewport
|
|
128
|
-
});
|
|
129
|
-
let listItemStyles;
|
|
130
|
-
let listItemMediaIds;
|
|
131
|
-
let nonIndexedContentStyles;
|
|
132
|
-
let nonIndexedContentMediaIds;
|
|
133
|
-
if (enableMediaQueryStyleSheet) {
|
|
134
|
-
const {
|
|
135
|
-
transformedListItemThemeTokens,
|
|
136
|
-
transformedNonIndexedContentThemeTokens
|
|
137
|
-
} = Object.entries(themeTokens).reduce((acc, _ref7) => {
|
|
138
|
-
let [vp, viewportTokens] = _ref7;
|
|
139
|
-
acc.transformedListItemThemeTokens[vp] = {
|
|
140
|
-
marginLeft: viewportTokens.listMarginLeft
|
|
141
|
-
};
|
|
142
|
-
acc.transformedNonIndexedContentThemeTokens[vp] = {
|
|
143
|
-
paddingLeft: viewportTokens.titlePaddingLeft
|
|
144
|
-
};
|
|
145
|
-
return acc;
|
|
146
|
-
}, {
|
|
147
|
-
transformedListItemThemeTokens: {},
|
|
148
|
-
transformedNonIndexedContentThemeTokens: {}
|
|
149
|
-
});
|
|
150
|
-
const listItemMediaQueryStyles = createMediaQueryStyles(transformedListItemThemeTokens);
|
|
151
|
-
const nonIndexedContentMediaQueryStyles = createMediaQueryStyles(transformedNonIndexedContentThemeTokens);
|
|
152
|
-
const {
|
|
153
|
-
ids,
|
|
154
|
-
styles
|
|
155
|
-
} = StyleSheet.create({
|
|
156
|
-
listItem: {
|
|
157
|
-
...themeTokens[viewport],
|
|
158
|
-
...listItemMediaQueryStyles
|
|
159
|
-
},
|
|
160
|
-
nonIndexedContent: {
|
|
161
|
-
...themeTokens[viewport],
|
|
162
|
-
...nonIndexedContentMediaQueryStyles
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
listItemStyles = styles.listItem;
|
|
166
|
-
listItemMediaIds = ids.listItem;
|
|
167
|
-
nonIndexedContentStyles = styles.nonIndexedContent;
|
|
168
|
-
nonIndexedContentMediaIds = ids.nonIndexedContent;
|
|
169
|
-
} else {
|
|
170
|
-
listItemStyles = themeTokens;
|
|
171
|
-
nonIndexedContentStyles = themeTokens;
|
|
172
|
-
}
|
|
173
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
174
|
-
...selectProps(rest),
|
|
175
|
-
children: [/*#__PURE__*/_jsx(Divider, {
|
|
176
|
-
tokens: {
|
|
177
|
-
color: themeTokens.dividerColor
|
|
178
|
-
}
|
|
179
|
-
}), /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
180
|
-
collapseTitle: getCopy('headingView'),
|
|
181
|
-
expandTitle: getCopy('headingHide'),
|
|
182
|
-
collapseLabel: getCopy('collapseLabel'),
|
|
183
|
-
expandLabel: getCopy('expandLabel'),
|
|
184
|
-
ref: ref,
|
|
185
|
-
children: /*#__PURE__*/_jsxs(ContentContainer, {
|
|
186
|
-
tokens: themeTokens,
|
|
187
|
-
children: [hasIndexedContent && /*#__PURE__*/_jsx(Ordered, {
|
|
188
|
-
tokens: themeTokens,
|
|
189
|
-
children: indexedContent.map((contentItem, idx) =>
|
|
190
|
-
/*#__PURE__*/
|
|
191
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
192
|
-
_jsx(ListItem, {
|
|
193
|
-
tokens: listItemStyles,
|
|
194
|
-
media: listItemMediaIds,
|
|
195
|
-
children: renderStructuredContent(contentItem)
|
|
196
|
-
}, idx))
|
|
197
|
-
}), hasNonIndexedContent && /*#__PURE__*/_jsxs(Box, {
|
|
198
|
-
between: 3,
|
|
199
|
-
children: [/*#__PURE__*/_jsx(NonIndexedContentTitle, {
|
|
200
|
-
tokens: nonIndexedContentStyles,
|
|
201
|
-
media: nonIndexedContentMediaIds,
|
|
202
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
203
|
-
block: true,
|
|
204
|
-
heading: true,
|
|
205
|
-
tokens: {
|
|
206
|
-
fontName: themeTokens.expandTitleFontName,
|
|
207
|
-
fontWeight: themeTokens.expandTitleFontWeight,
|
|
208
|
-
fontSize: themeTokens.titleFontSize,
|
|
209
|
-
lineHeight: themeTokens.titleLineHeight
|
|
210
|
-
},
|
|
211
|
-
children: getCopy('nonIndexedTitle')
|
|
212
|
-
})
|
|
213
|
-
}), /*#__PURE__*/_jsx(Unordered, {
|
|
214
|
-
tokens: themeTokens,
|
|
215
|
-
children: nonIndexedContent.map((contentItem, idx) =>
|
|
216
|
-
/*#__PURE__*/
|
|
217
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
218
|
-
_jsx(ListItem, {
|
|
219
|
-
tokens: listItemStyles,
|
|
220
|
-
media: listItemMediaIds,
|
|
221
|
-
children: renderStructuredContent(contentItem)
|
|
222
|
-
}, idx))
|
|
223
|
-
})]
|
|
224
|
-
})]
|
|
225
|
-
})
|
|
226
|
-
}), /*#__PURE__*/_jsx(Divider, {
|
|
227
|
-
tokens: {
|
|
228
|
-
color: themeTokens.dividerColor
|
|
229
|
-
}
|
|
230
|
-
})]
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
TermsAndConditions.displayName = 'TermsAndConditions';
|
|
234
|
-
|
|
235
|
-
// If a language dictionary entry is provided, it must contain every key
|
|
236
|
-
const dictionaryContentShape = PropTypes.shape({
|
|
237
|
-
headingHide: PropTypes.string.isRequired,
|
|
238
|
-
headingView: PropTypes.string.isRequired,
|
|
239
|
-
nonIndexedTitle: PropTypes.string.isRequired
|
|
240
|
-
});
|
|
241
|
-
TermsAndConditions.propTypes = {
|
|
242
|
-
...selectedSystemPropTypes,
|
|
243
|
-
/**
|
|
244
|
-
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
245
|
-
*
|
|
246
|
-
* To provide your own, pass a JSON object with the keys `headingView`, `headingHide`, and `nonIndexedTitle`.
|
|
247
|
-
*/
|
|
248
|
-
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), PropTypes.shape({
|
|
249
|
-
headingView: PropTypes.string,
|
|
250
|
-
headingHide: PropTypes.string,
|
|
251
|
-
nonIndexedTitle: PropTypes.string
|
|
252
|
-
})]),
|
|
253
|
-
/**
|
|
254
|
-
* Sets the tokens for TermsAndConditions element.
|
|
255
|
-
*/
|
|
256
|
-
tokens: getTokensPropType('TermsAndConditions'),
|
|
257
|
-
/**
|
|
258
|
-
* An array of nodes, strings, or a combination to be displayed in an ordered list.
|
|
259
|
-
*
|
|
260
|
-
* Each item in the array must have a corresponding superscript in the page.
|
|
261
|
-
*/
|
|
262
|
-
indexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string])),
|
|
263
|
-
/**
|
|
264
|
-
* An array of nodes, strings, or a combination to be displayed in an unordered list.
|
|
265
|
-
*
|
|
266
|
-
* nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
|
|
267
|
-
*/
|
|
268
|
-
nonIndexedContent: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.node, PropTypes.string])),
|
|
269
|
-
/**
|
|
270
|
-
* Custom dictionary containing the labels to use for `TermsAndConditions`
|
|
271
|
-
*/
|
|
272
|
-
dictionary: PropTypes.shape({
|
|
273
|
-
en: dictionaryContentShape,
|
|
274
|
-
fr: dictionaryContentShape
|
|
275
|
-
})
|
|
276
|
-
};
|
|
277
|
-
export default TermsAndConditions;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
en: {
|
|
3
|
-
headingHide: 'Hide terms and conditions',
|
|
4
|
-
headingView: 'View terms and conditions',
|
|
5
|
-
nonIndexedTitle: 'The following applies to all terms and conditions above',
|
|
6
|
-
expandLabel: 'Expand',
|
|
7
|
-
collapseLabel: 'Collapse'
|
|
8
|
-
},
|
|
9
|
-
fr: {
|
|
10
|
-
headingHide: 'Masquer les modalités et conditions',
|
|
11
|
-
headingView: 'Voir les modalités et conditions',
|
|
12
|
-
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus',
|
|
13
|
-
expandLabel: 'Détailler',
|
|
14
|
-
collapseLabel: 'Réduire'
|
|
15
|
-
}
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './TermsAndConditions';
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { Icon, selectSystemProps, Typography, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
-
import Image from '../Image';
|
|
6
|
-
import { htmlAttrs } from '../utils';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
-
const TestimonialContainer = /*#__PURE__*/styled.figure.withConfig({
|
|
11
|
-
displayName: "Testimonial__TestimonialContainer",
|
|
12
|
-
componentId: "components-web__sc-1az53gr-0"
|
|
13
|
-
})(_ref => {
|
|
14
|
-
let {
|
|
15
|
-
testimonialContainerGap
|
|
16
|
-
} = _ref;
|
|
17
|
-
return {
|
|
18
|
-
display: 'flex',
|
|
19
|
-
flexDirection: 'column',
|
|
20
|
-
gap: testimonialContainerGap,
|
|
21
|
-
margin: 0
|
|
22
|
-
};
|
|
23
|
-
});
|
|
24
|
-
const QuoteContainer = /*#__PURE__*/styled.div.withConfig({
|
|
25
|
-
displayName: "Testimonial__QuoteContainer",
|
|
26
|
-
componentId: "components-web__sc-1az53gr-1"
|
|
27
|
-
})(_ref2 => {
|
|
28
|
-
let {
|
|
29
|
-
quoteContainerGap
|
|
30
|
-
} = _ref2;
|
|
31
|
-
return {
|
|
32
|
-
display: 'flex',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
gap: quoteContainerGap
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
const Divider = /*#__PURE__*/styled.div.withConfig({
|
|
38
|
-
displayName: "Testimonial__Divider",
|
|
39
|
-
componentId: "components-web__sc-1az53gr-2"
|
|
40
|
-
})(_ref3 => {
|
|
41
|
-
let {
|
|
42
|
-
dividerBorder,
|
|
43
|
-
dividerBackgroundColor
|
|
44
|
-
} = _ref3;
|
|
45
|
-
return {
|
|
46
|
-
height: dividerBorder,
|
|
47
|
-
background: dividerBackgroundColor,
|
|
48
|
-
width: '100%'
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
const BlockQuote = /*#__PURE__*/styled.blockquote.withConfig({
|
|
52
|
-
displayName: "Testimonial__BlockQuote",
|
|
53
|
-
componentId: "components-web__sc-1az53gr-3"
|
|
54
|
-
})({
|
|
55
|
-
margin: 0
|
|
56
|
-
});
|
|
57
|
-
const AuthorInfoContainer = /*#__PURE__*/styled.div.withConfig({
|
|
58
|
-
displayName: "Testimonial__AuthorInfoContainer",
|
|
59
|
-
componentId: "components-web__sc-1az53gr-4"
|
|
60
|
-
})({
|
|
61
|
-
display: 'flex',
|
|
62
|
-
flexDirection: 'column'
|
|
63
|
-
});
|
|
64
|
-
const Figcaption = /*#__PURE__*/styled.figcaption.withConfig({
|
|
65
|
-
displayName: "Testimonial__Figcaption",
|
|
66
|
-
componentId: "components-web__sc-1az53gr-5"
|
|
67
|
-
})(_ref4 => {
|
|
68
|
-
let {
|
|
69
|
-
figcaptionGap
|
|
70
|
-
} = _ref4;
|
|
71
|
-
return {
|
|
72
|
-
display: 'flex',
|
|
73
|
-
alignItems: 'center',
|
|
74
|
-
gap: figcaptionGap
|
|
75
|
-
};
|
|
76
|
-
});
|
|
77
|
-
const Testimonial = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
78
|
-
let {
|
|
79
|
-
showDivider,
|
|
80
|
-
testimonial,
|
|
81
|
-
title,
|
|
82
|
-
imageSrc,
|
|
83
|
-
image = imageSrc,
|
|
84
|
-
additionalInfo,
|
|
85
|
-
testimonialStyle = 'large',
|
|
86
|
-
tokens,
|
|
87
|
-
copy = 'en',
|
|
88
|
-
variant = {},
|
|
89
|
-
...rest
|
|
90
|
-
} = _ref5;
|
|
91
|
-
const viewport = useViewport();
|
|
92
|
-
const {
|
|
93
|
-
testimonialContainerGap,
|
|
94
|
-
quoteContainerGap,
|
|
95
|
-
dividerBorder,
|
|
96
|
-
dividerBackgroundColor,
|
|
97
|
-
figcaptionGap,
|
|
98
|
-
textColor,
|
|
99
|
-
icon,
|
|
100
|
-
iconFr,
|
|
101
|
-
iconColor,
|
|
102
|
-
imageSize,
|
|
103
|
-
testimonialFontSizeLarge,
|
|
104
|
-
testimonialLineHeightLarge,
|
|
105
|
-
testimonialFontWeightLarge,
|
|
106
|
-
testimonialFontSizeHeading,
|
|
107
|
-
testimonialLineHeightHeading,
|
|
108
|
-
testimonialFontNameHeading,
|
|
109
|
-
testimonialFontWeightHeading,
|
|
110
|
-
authorFontSize,
|
|
111
|
-
authorLineHeight,
|
|
112
|
-
authorFontName,
|
|
113
|
-
authorFontWeight,
|
|
114
|
-
additionalFontSize,
|
|
115
|
-
additionalLineHeight,
|
|
116
|
-
additionalFontName,
|
|
117
|
-
additionalFontWeight
|
|
118
|
-
} = useThemeTokens('Testimonial', tokens, variant, {
|
|
119
|
-
viewport
|
|
120
|
-
});
|
|
121
|
-
const getQuoteTestimonial = open => {
|
|
122
|
-
let quote = '';
|
|
123
|
-
if (copy === 'en') quote = open ? '\u201C' : '\u201D';else quote = open ? '\u00AB ' : ' \u00BB';
|
|
124
|
-
return quote;
|
|
125
|
-
};
|
|
126
|
-
return /*#__PURE__*/_jsxs(TestimonialContainer, {
|
|
127
|
-
testimonialContainerGap: testimonialContainerGap,
|
|
128
|
-
ref: ref,
|
|
129
|
-
...selectProps(rest),
|
|
130
|
-
children: [/*#__PURE__*/_jsxs(QuoteContainer, {
|
|
131
|
-
quoteContainerGap: quoteContainerGap,
|
|
132
|
-
children: [/*#__PURE__*/_jsx(Icon, {
|
|
133
|
-
tokens: {
|
|
134
|
-
color: iconColor
|
|
135
|
-
},
|
|
136
|
-
variant: {
|
|
137
|
-
size: 'micro'
|
|
138
|
-
},
|
|
139
|
-
icon: copy === 'en' ? icon : iconFr
|
|
140
|
-
}), showDivider && /*#__PURE__*/_jsx(Divider, {
|
|
141
|
-
dividerBackgroundColor: dividerBackgroundColor,
|
|
142
|
-
dividerBorder: dividerBorder,
|
|
143
|
-
role: "separator"
|
|
144
|
-
})]
|
|
145
|
-
}), /*#__PURE__*/_jsx(BlockQuote, {
|
|
146
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
147
|
-
variant: {
|
|
148
|
-
size: testimonialStyle === 'large' ? 'large' : 'h3'
|
|
149
|
-
},
|
|
150
|
-
tokens: {
|
|
151
|
-
color: textColor,
|
|
152
|
-
fontSize: testimonialStyle === 'heading' ? testimonialFontSizeHeading : testimonialFontSizeLarge,
|
|
153
|
-
lineHeight: testimonialStyle === 'heading' ? testimonialLineHeightHeading : testimonialLineHeightLarge,
|
|
154
|
-
fontName: testimonialFontNameHeading,
|
|
155
|
-
fontWeight: testimonialStyle === 'heading' ? testimonialFontWeightHeading : testimonialFontWeightLarge
|
|
156
|
-
},
|
|
157
|
-
children: `${getQuoteTestimonial(true)}${testimonial}${getQuoteTestimonial()}`
|
|
158
|
-
})
|
|
159
|
-
}), (image || title || additionalInfo) && /*#__PURE__*/_jsxs(Figcaption, {
|
|
160
|
-
figcaptionGap: figcaptionGap,
|
|
161
|
-
children: [image && (typeof image === 'string' ? /*#__PURE__*/_jsx(Image, {
|
|
162
|
-
rounded: "circle",
|
|
163
|
-
src: image,
|
|
164
|
-
alt: title,
|
|
165
|
-
width: imageSize,
|
|
166
|
-
height: imageSize
|
|
167
|
-
}) : image), (title || additionalInfo) && /*#__PURE__*/_jsxs(AuthorInfoContainer, {
|
|
168
|
-
children: [title && /*#__PURE__*/_jsx(Typography, {
|
|
169
|
-
variant: {
|
|
170
|
-
size: 'small'
|
|
171
|
-
},
|
|
172
|
-
tokens: {
|
|
173
|
-
color: textColor,
|
|
174
|
-
fontSize: authorFontSize,
|
|
175
|
-
lineHeight: authorLineHeight,
|
|
176
|
-
fontName: authorFontName,
|
|
177
|
-
fontWeight: authorFontWeight
|
|
178
|
-
},
|
|
179
|
-
children: title
|
|
180
|
-
}), additionalInfo && /*#__PURE__*/_jsx(Typography, {
|
|
181
|
-
variant: {
|
|
182
|
-
size: 'small'
|
|
183
|
-
},
|
|
184
|
-
tokens: {
|
|
185
|
-
color: textColor,
|
|
186
|
-
fontSize: additionalFontSize,
|
|
187
|
-
lineHeight: additionalLineHeight,
|
|
188
|
-
fontName: additionalFontName,
|
|
189
|
-
fontWeight: additionalFontWeight
|
|
190
|
-
},
|
|
191
|
-
children: additionalInfo
|
|
192
|
-
})]
|
|
193
|
-
})]
|
|
194
|
-
}), showDivider && /*#__PURE__*/_jsx(Divider, {
|
|
195
|
-
dividerBackgroundColor: dividerBackgroundColor,
|
|
196
|
-
dividerBorder: dividerBorder,
|
|
197
|
-
role: "separator"
|
|
198
|
-
})]
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
Testimonial.displayName = 'Testimonial';
|
|
202
|
-
Testimonial.propTypes = {
|
|
203
|
-
...selectedSystemPropTypes,
|
|
204
|
-
tokens: getTokensPropType('Testimonial'),
|
|
205
|
-
/**
|
|
206
|
-
* Testimonial content
|
|
207
|
-
*/
|
|
208
|
-
testimonial: PropTypes.string.isRequired,
|
|
209
|
-
/**
|
|
210
|
-
* Testimonial author or source
|
|
211
|
-
*/
|
|
212
|
-
title: PropTypes.string,
|
|
213
|
-
/**
|
|
214
|
-
* Additional information on the author or source
|
|
215
|
-
*/
|
|
216
|
-
additionalInfo: PropTypes.string,
|
|
217
|
-
/**
|
|
218
|
-
* Testimonial style
|
|
219
|
-
*/
|
|
220
|
-
testimonialStyle: PropTypes.oneOf(['large', 'heading']),
|
|
221
|
-
/**
|
|
222
|
-
* Whether to show or not dividers at the top and the bottom of the testimonial
|
|
223
|
-
showDivider: PropTypes.bool,
|
|
224
|
-
/**
|
|
225
|
-
* The src attribute for the Image component or custom JSX content to render instead
|
|
226
|
-
*/
|
|
227
|
-
image: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
228
|
-
/**
|
|
229
|
-
* The src attribute for the `Image` component to be displayed on the testimonial
|
|
230
|
-
* @deprecated please use the `image` prop instead
|
|
231
|
-
*/
|
|
232
|
-
imageSrc: PropTypes.string
|
|
233
|
-
};
|
|
234
|
-
export default Testimonial;
|