@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,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
12
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
+
|
|
14
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
const ExpandCollapseControl = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
25
|
+
displayName: "ExpandCollapse__ExpandCollapseControl",
|
|
26
|
+
componentId: "components-web__sc-1l2mmq7-0"
|
|
27
|
+
})({
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
display: 'flex',
|
|
31
|
+
flex: 1,
|
|
32
|
+
justifyContent: 'flex-start'
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const ExpandCollapseIconContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
36
|
+
displayName: "ExpandCollapse__ExpandCollapseIconContainer",
|
|
37
|
+
componentId: "components-web__sc-1l2mmq7-1"
|
|
38
|
+
})(_ref => {
|
|
39
|
+
let {
|
|
40
|
+
tokens
|
|
41
|
+
} = _ref;
|
|
42
|
+
return {
|
|
43
|
+
alignItems: tokens.expandIconContainerAlignItems,
|
|
44
|
+
border: `${tokens.expandIconContainerBorder}px solid ${tokens.expandIconContainerBorderColor}`,
|
|
45
|
+
borderRadius: '50%',
|
|
46
|
+
display: 'flex',
|
|
47
|
+
height: tokens.expandIconContainerHeight,
|
|
48
|
+
justifyContent: tokens.expandIconContainerJustifyContent,
|
|
49
|
+
margin: `${tokens.expandIconContainerMarginX}px ${tokens.expandIconContainerMarginY}px`,
|
|
50
|
+
width: tokens.expandIconContainerWidth
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const ExpandCollapseTitle = /*#__PURE__*/_styledComponents.default.h4.withConfig({
|
|
55
|
+
displayName: "ExpandCollapse__ExpandCollapseTitle",
|
|
56
|
+
componentId: "components-web__sc-1l2mmq7-2"
|
|
57
|
+
})(_ref2 => {
|
|
58
|
+
let {
|
|
59
|
+
tokens
|
|
60
|
+
} = _ref2;
|
|
61
|
+
return {
|
|
62
|
+
color: tokens.expandTitleColor,
|
|
63
|
+
fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
|
|
64
|
+
fontSize: tokens.expandTitleFontSize,
|
|
65
|
+
lineHeight: tokens.expandTitleLineHeight,
|
|
66
|
+
margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
71
|
+
let {
|
|
72
|
+
children,
|
|
73
|
+
collapseTitle,
|
|
74
|
+
expandTitle = collapseTitle
|
|
75
|
+
} = _ref3;
|
|
76
|
+
const getTokens = (0, _componentsBase.useThemeTokensCallback)('TermsAndConditions', {}, {});
|
|
77
|
+
const {
|
|
78
|
+
expandBaseBorderWidth,
|
|
79
|
+
expandContentPaddingBottom,
|
|
80
|
+
expandContentPaddingLeft,
|
|
81
|
+
expandContentPaddingRight,
|
|
82
|
+
expandContentPaddingTop
|
|
83
|
+
} = getTokens();
|
|
84
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
|
|
85
|
+
tokens: {
|
|
86
|
+
borderWidth: expandBaseBorderWidth
|
|
87
|
+
},
|
|
88
|
+
children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, { ...expandProps,
|
|
89
|
+
panelId: "ExpandCollapsePanel",
|
|
90
|
+
controlTokens: {
|
|
91
|
+
icon: null
|
|
92
|
+
} // TODO refactor
|
|
93
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
94
|
+
,
|
|
95
|
+
control: pressableState => {
|
|
96
|
+
const {
|
|
97
|
+
expanded
|
|
98
|
+
} = pressableState || {};
|
|
99
|
+
const {
|
|
100
|
+
icon
|
|
101
|
+
} = getTokens({
|
|
102
|
+
expanded
|
|
103
|
+
});
|
|
104
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExpandCollapseControl, {
|
|
105
|
+
onClick: event => expandProps.onToggle('ExpandCollapsePanel', event),
|
|
106
|
+
ref: ref,
|
|
107
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseIconContainer, {
|
|
108
|
+
tokens: getTokens(),
|
|
109
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
110
|
+
icon: icon,
|
|
111
|
+
variant: {
|
|
112
|
+
size: 'small'
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseTitle, {
|
|
116
|
+
tokens: getTokens(),
|
|
117
|
+
children: expanded ? expandTitle : collapseTitle
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
tokens: {
|
|
122
|
+
contentPaddingBottom: expandContentPaddingBottom,
|
|
123
|
+
contentPaddingLeft: expandContentPaddingLeft,
|
|
124
|
+
contentPaddingRight: expandContentPaddingRight,
|
|
125
|
+
contentPaddingTop: expandContentPaddingTop
|
|
126
|
+
},
|
|
127
|
+
children: children
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
ExpandCollapse.displayName = 'ExpandCollapse';
|
|
132
|
+
ExpandCollapse.propTypes = {
|
|
133
|
+
children: _propTypes.default.node.isRequired,
|
|
134
|
+
collapseTitle: _propTypes.default.string.isRequired,
|
|
135
|
+
expandTitle: _propTypes.default.string
|
|
136
|
+
};
|
|
137
|
+
ExpandCollapse.defaultProps = {
|
|
138
|
+
expandTitle: undefined
|
|
139
|
+
};
|
|
140
|
+
var _default = ExpandCollapse;
|
|
141
|
+
exports.default = _default;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = 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 _componentsBase = require("@telus-uds/components-base");
|
|
15
|
+
|
|
16
|
+
var _ExpandCollapse = _interopRequireDefault(require("./ExpandCollapse"));
|
|
17
|
+
|
|
18
|
+
var _OrderedListBase = _interopRequireDefault(require("../OrderedList/OrderedListBase"));
|
|
19
|
+
|
|
20
|
+
var _utils = require("../utils");
|
|
21
|
+
|
|
22
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
23
|
+
|
|
24
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
|
+
|
|
28
|
+
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); }
|
|
29
|
+
|
|
30
|
+
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; }
|
|
31
|
+
|
|
32
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
33
|
+
|
|
34
|
+
const ContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
35
|
+
displayName: "TermsAndConditions__ContentContainer",
|
|
36
|
+
componentId: "components-web__sc-1199epn-0"
|
|
37
|
+
})(_ref => {
|
|
38
|
+
let {
|
|
39
|
+
tokens
|
|
40
|
+
} = _ref;
|
|
41
|
+
return {
|
|
42
|
+
paddingBottom: tokens.contentPaddingBottom,
|
|
43
|
+
paddingLeft: tokens.contentPaddingLeft,
|
|
44
|
+
...(0, _utils.media)().from('md').css({
|
|
45
|
+
paddingBottom: tokens.mdContentPaddingBottom,
|
|
46
|
+
paddingLeft: tokens.mdContentPaddingLeft
|
|
47
|
+
})
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const Ordered = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.default).withConfig({
|
|
52
|
+
displayName: "TermsAndConditions__Ordered",
|
|
53
|
+
componentId: "components-web__sc-1199epn-1"
|
|
54
|
+
})(_ref2 => {
|
|
55
|
+
let {
|
|
56
|
+
tokens
|
|
57
|
+
} = _ref2;
|
|
58
|
+
return {
|
|
59
|
+
listStylePosition: 'outside',
|
|
60
|
+
padding: tokens.orderedPadding
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const Unordered = /*#__PURE__*/_styledComponents.default.ul.withConfig({
|
|
65
|
+
displayName: "TermsAndConditions__Unordered",
|
|
66
|
+
componentId: "components-web__sc-1199epn-2"
|
|
67
|
+
})(_ref3 => {
|
|
68
|
+
let {
|
|
69
|
+
tokens
|
|
70
|
+
} = _ref3;
|
|
71
|
+
return {
|
|
72
|
+
listStyleType: 'none',
|
|
73
|
+
margin: 0,
|
|
74
|
+
padding: tokens.unorderedPadding
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const ListItem = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.default.Item).withConfig({
|
|
79
|
+
displayName: "TermsAndConditions__ListItem",
|
|
80
|
+
componentId: "components-web__sc-1199epn-3"
|
|
81
|
+
})(_ref4 => {
|
|
82
|
+
let {
|
|
83
|
+
tokens
|
|
84
|
+
} = _ref4;
|
|
85
|
+
return {
|
|
86
|
+
display: 'list-item',
|
|
87
|
+
'&::marker': {
|
|
88
|
+
fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
|
|
89
|
+
fontSize: tokens.listFontSize,
|
|
90
|
+
lineHeight: tokens.listLineHeight,
|
|
91
|
+
textAlign: 'end !important'
|
|
92
|
+
},
|
|
93
|
+
color: tokens.listColor,
|
|
94
|
+
fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
|
|
95
|
+
fontSize: tokens.listFontSize,
|
|
96
|
+
lineHeight: tokens.listLineHeight,
|
|
97
|
+
marginBottom: tokens.listMarginBottom,
|
|
98
|
+
marginLeft: tokens.listMarginLeft,
|
|
99
|
+
wordBreak: 'break-word'
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const NonIndexedContentTitle = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
104
|
+
displayName: "TermsAndConditions__NonIndexedContentTitle",
|
|
105
|
+
componentId: "components-web__sc-1199epn-4"
|
|
106
|
+
})(_ref5 => {
|
|
107
|
+
let {
|
|
108
|
+
tokens
|
|
109
|
+
} = _ref5;
|
|
110
|
+
return {
|
|
111
|
+
color: tokens.titleColor,
|
|
112
|
+
fontSize: tokens.titleFontSize,
|
|
113
|
+
lineHeight: tokens.titleLineHeight,
|
|
114
|
+
paddingLeft: tokens.titlePaddingLeft
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* Use `TermsAndConditions` to display important legal content.
|
|
119
|
+
*
|
|
120
|
+
* ## Usage Criteria
|
|
121
|
+
*
|
|
122
|
+
* - Display before the page footer, except for call-to-action callback cards
|
|
123
|
+
* - Responsive display based on breakpoints
|
|
124
|
+
* - Use `copy` to set language, ‘en’ for English or ‘fr’ for French
|
|
125
|
+
*/
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
const TermsAndConditions = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
129
|
+
let {
|
|
130
|
+
copy = 'en',
|
|
131
|
+
indexedContent,
|
|
132
|
+
nonIndexedContent,
|
|
133
|
+
tokens,
|
|
134
|
+
variant = {},
|
|
135
|
+
...rest
|
|
136
|
+
} = _ref6;
|
|
137
|
+
const getCopy = (0, _componentsBase.useCopy)({
|
|
138
|
+
dictionary: _dictionary.default,
|
|
139
|
+
copy
|
|
140
|
+
});
|
|
141
|
+
const hasIndexedContent = indexedContent.length > 0;
|
|
142
|
+
const hasNonIndexedContent = nonIndexedContent.length > 0;
|
|
143
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('TermsAndConditions', tokens, variant);
|
|
144
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", { ...selectProps(rest),
|
|
145
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ExpandCollapse.default, {
|
|
146
|
+
collapseTitle: getCopy('headingView'),
|
|
147
|
+
expandTitle: getCopy('headingHide'),
|
|
148
|
+
ref: ref,
|
|
149
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentContainer, {
|
|
150
|
+
tokens: themeTokens,
|
|
151
|
+
children: [hasIndexedContent && /*#__PURE__*/(0, _jsxRuntime.jsx)(Ordered, {
|
|
152
|
+
tokens: themeTokens,
|
|
153
|
+
children: indexedContent.map((contentItem, idx) =>
|
|
154
|
+
/*#__PURE__*/
|
|
155
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
156
|
+
(0, _jsxRuntime.jsx)(ListItem, {
|
|
157
|
+
tokens: themeTokens,
|
|
158
|
+
children: (0, _utils.renderStructuredContent)(contentItem)
|
|
159
|
+
}, idx))
|
|
160
|
+
}), hasNonIndexedContent && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Box, {
|
|
161
|
+
between: 3,
|
|
162
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(NonIndexedContentTitle, {
|
|
163
|
+
tokens: themeTokens,
|
|
164
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
165
|
+
block: true,
|
|
166
|
+
heading: true,
|
|
167
|
+
variant: {
|
|
168
|
+
size: 'h4'
|
|
169
|
+
},
|
|
170
|
+
children: getCopy('nonIndexedTitle')
|
|
171
|
+
})
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Unordered, {
|
|
173
|
+
tokens: themeTokens,
|
|
174
|
+
children: nonIndexedContent.map((contentItem, idx) =>
|
|
175
|
+
/*#__PURE__*/
|
|
176
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
177
|
+
(0, _jsxRuntime.jsx)(ListItem, {
|
|
178
|
+
tokens: themeTokens,
|
|
179
|
+
children: (0, _utils.renderStructuredContent)(contentItem)
|
|
180
|
+
}, idx))
|
|
181
|
+
})]
|
|
182
|
+
})]
|
|
183
|
+
})
|
|
184
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Divider, {})]
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
TermsAndConditions.displayName = 'TermsAndConditions';
|
|
188
|
+
TermsAndConditions.propTypes = { ...selectedSystemPropTypes,
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
192
|
+
*
|
|
193
|
+
* To provide your own, pass a JSON object with the keys `headingView`, `headingHide`, and `nonIndexedTitle`.
|
|
194
|
+
*/
|
|
195
|
+
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _propTypes.default.shape({
|
|
196
|
+
headingView: _propTypes.default.string,
|
|
197
|
+
headingHide: _propTypes.default.string,
|
|
198
|
+
nonIndexedTitle: _propTypes.default.string
|
|
199
|
+
})]),
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* An array of nodes, strings, or a combination to be displayed in an ordered list.
|
|
203
|
+
*
|
|
204
|
+
* Each item in the array must have a corresponding superscript in the page.
|
|
205
|
+
*/
|
|
206
|
+
indexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string])),
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* An array of nodes, strings, or a combination to be displayed in an unordered list.
|
|
210
|
+
*
|
|
211
|
+
* nonIndexedContent do not have a corresponding superscript and instead apply to the page as a whole.
|
|
212
|
+
*/
|
|
213
|
+
nonIndexedContent: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string]))
|
|
214
|
+
};
|
|
215
|
+
TermsAndConditions.defaultProps = {
|
|
216
|
+
copy: 'en',
|
|
217
|
+
indexedContent: [],
|
|
218
|
+
nonIndexedContent: []
|
|
219
|
+
};
|
|
220
|
+
var _default = TermsAndConditions;
|
|
221
|
+
exports.default = _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
8
|
+
en: {
|
|
9
|
+
headingHide: 'Hide terms and conditions',
|
|
10
|
+
headingView: 'View terms and conditions',
|
|
11
|
+
nonIndexedTitle: 'The following applies to all terms and conditions above'
|
|
12
|
+
},
|
|
13
|
+
fr: {
|
|
14
|
+
headingHide: 'Masquer les modalités et conditions',
|
|
15
|
+
headingView: 'Voir les modalités et conditions',
|
|
16
|
+
nonIndexedTitle: 'Ce qui suit s’applique aux modalités et conditions ci-dessus'
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _TermsAndConditions.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _TermsAndConditions = _interopRequireDefault(require("./TermsAndConditions"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,226 @@
|
|
|
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 _Image = _interopRequireDefault(require("../Image"));
|
|
17
|
+
|
|
18
|
+
var _utils = require("../utils");
|
|
19
|
+
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
25
|
+
|
|
26
|
+
const TestimonialContainer = /*#__PURE__*/_styledComponents.default.figure.withConfig({
|
|
27
|
+
displayName: "Testimonial__TestimonialContainer",
|
|
28
|
+
componentId: "components-web__sc-1az53gr-0"
|
|
29
|
+
})(_ref => {
|
|
30
|
+
let {
|
|
31
|
+
testimonialContainerGap
|
|
32
|
+
} = _ref;
|
|
33
|
+
return {
|
|
34
|
+
display: 'flex',
|
|
35
|
+
flexDirection: 'column',
|
|
36
|
+
gap: testimonialContainerGap,
|
|
37
|
+
margin: 0
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const QuoteContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
42
|
+
displayName: "Testimonial__QuoteContainer",
|
|
43
|
+
componentId: "components-web__sc-1az53gr-1"
|
|
44
|
+
})(_ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
quoteContainerGap
|
|
47
|
+
} = _ref2;
|
|
48
|
+
return {
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
gap: quoteContainerGap
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const Divider = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
56
|
+
displayName: "Testimonial__Divider",
|
|
57
|
+
componentId: "components-web__sc-1az53gr-2"
|
|
58
|
+
})(_ref3 => {
|
|
59
|
+
let {
|
|
60
|
+
dividerBorder,
|
|
61
|
+
dividerBackgroundColor
|
|
62
|
+
} = _ref3;
|
|
63
|
+
return {
|
|
64
|
+
height: dividerBorder,
|
|
65
|
+
background: dividerBackgroundColor,
|
|
66
|
+
width: '100%'
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const BlockQuote = /*#__PURE__*/_styledComponents.default.blockquote.withConfig({
|
|
71
|
+
displayName: "Testimonial__BlockQuote",
|
|
72
|
+
componentId: "components-web__sc-1az53gr-3"
|
|
73
|
+
})({
|
|
74
|
+
margin: 0
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const AuthorInfoContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
78
|
+
displayName: "Testimonial__AuthorInfoContainer",
|
|
79
|
+
componentId: "components-web__sc-1az53gr-4"
|
|
80
|
+
})({
|
|
81
|
+
display: 'flex',
|
|
82
|
+
flexDirection: 'column'
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const Figcaption = /*#__PURE__*/_styledComponents.default.figcaption.withConfig({
|
|
86
|
+
displayName: "Testimonial__Figcaption",
|
|
87
|
+
componentId: "components-web__sc-1az53gr-5"
|
|
88
|
+
})(_ref4 => {
|
|
89
|
+
let {
|
|
90
|
+
figcaptionGap
|
|
91
|
+
} = _ref4;
|
|
92
|
+
return {
|
|
93
|
+
display: 'flex',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
gap: figcaptionGap
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const Testimonial = _ref5 => {
|
|
100
|
+
let {
|
|
101
|
+
showDivider,
|
|
102
|
+
testimonial,
|
|
103
|
+
title,
|
|
104
|
+
imageSrc,
|
|
105
|
+
image = imageSrc,
|
|
106
|
+
additionalInfo,
|
|
107
|
+
testimonialStyle = 'heading',
|
|
108
|
+
tokens,
|
|
109
|
+
variant = {},
|
|
110
|
+
...rest
|
|
111
|
+
} = _ref5;
|
|
112
|
+
const {
|
|
113
|
+
testimonialContainerGap,
|
|
114
|
+
quoteContainerGap,
|
|
115
|
+
dividerBorder,
|
|
116
|
+
dividerBackgroundColor,
|
|
117
|
+
figcaptionGap,
|
|
118
|
+
textColor,
|
|
119
|
+
icon,
|
|
120
|
+
iconColor,
|
|
121
|
+
imageSize
|
|
122
|
+
} = (0, _componentsBase.useThemeTokens)('Testimonial', tokens, variant);
|
|
123
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(TestimonialContainer, {
|
|
124
|
+
testimonialContainerGap: testimonialContainerGap,
|
|
125
|
+
...selectProps(rest),
|
|
126
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(QuoteContainer, {
|
|
127
|
+
quoteContainerGap: quoteContainerGap,
|
|
128
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
129
|
+
tokens: {
|
|
130
|
+
color: iconColor
|
|
131
|
+
},
|
|
132
|
+
variant: {
|
|
133
|
+
size: 'micro'
|
|
134
|
+
},
|
|
135
|
+
icon: icon
|
|
136
|
+
}), showDivider && /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
|
|
137
|
+
dividerBackgroundColor: dividerBackgroundColor,
|
|
138
|
+
dividerBorder: dividerBorder,
|
|
139
|
+
role: "separator"
|
|
140
|
+
})]
|
|
141
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(BlockQuote, {
|
|
142
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
143
|
+
variant: {
|
|
144
|
+
size: testimonialStyle === 'large' ? 'large' : 'h3'
|
|
145
|
+
},
|
|
146
|
+
tokens: {
|
|
147
|
+
color: textColor,
|
|
148
|
+
fontWeight: '400'
|
|
149
|
+
},
|
|
150
|
+
children: `\u201C${testimonial}\u201D`
|
|
151
|
+
})
|
|
152
|
+
}), (image || title || additionalInfo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(Figcaption, {
|
|
153
|
+
figcaptionGap: figcaptionGap,
|
|
154
|
+
children: [image && (typeof image === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
|
|
155
|
+
rounded: "circle",
|
|
156
|
+
src: image,
|
|
157
|
+
alt: title,
|
|
158
|
+
width: imageSize,
|
|
159
|
+
height: imageSize
|
|
160
|
+
}) : image), (title || additionalInfo) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(AuthorInfoContainer, {
|
|
161
|
+
children: [title && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
162
|
+
variant: {
|
|
163
|
+
size: 'small',
|
|
164
|
+
colour: 'secondary'
|
|
165
|
+
},
|
|
166
|
+
tokens: {
|
|
167
|
+
fontWeight: '500'
|
|
168
|
+
},
|
|
169
|
+
children: title
|
|
170
|
+
}), additionalInfo && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
171
|
+
variant: {
|
|
172
|
+
size: 'micro',
|
|
173
|
+
colour: 'secondary'
|
|
174
|
+
},
|
|
175
|
+
tokens: {
|
|
176
|
+
fontWeight: '400'
|
|
177
|
+
},
|
|
178
|
+
children: additionalInfo
|
|
179
|
+
})]
|
|
180
|
+
})]
|
|
181
|
+
}), showDivider && /*#__PURE__*/(0, _jsxRuntime.jsx)(Divider, {
|
|
182
|
+
dividerBackgroundColor: dividerBackgroundColor,
|
|
183
|
+
dividerBorder: dividerBorder,
|
|
184
|
+
role: "separator"
|
|
185
|
+
})]
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
Testimonial.propTypes = { ...selectedSystemPropTypes,
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Testimonial content
|
|
193
|
+
*/
|
|
194
|
+
testimonial: _propTypes.default.string.isRequired,
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Testimonial author or source
|
|
198
|
+
*/
|
|
199
|
+
title: _propTypes.default.string,
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Additional information on the author or source
|
|
203
|
+
*/
|
|
204
|
+
additionalInfo: _propTypes.default.string,
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Testimonial style
|
|
208
|
+
*/
|
|
209
|
+
testimonialStyle: _propTypes.default.oneOf(['large', 'heading']),
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Whether to show or not dividers at the top and the bottom of the testimonial
|
|
213
|
+
showDivider: PropTypes.bool,
|
|
214
|
+
/**
|
|
215
|
+
* The src attribute for the Image component or custom JSX content to render instead
|
|
216
|
+
*/
|
|
217
|
+
image: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The src attribute for the `Image` component to be displayed on the testimonial
|
|
221
|
+
* @deprecated please use the `image` prop instead
|
|
222
|
+
*/
|
|
223
|
+
imageSrc: _propTypes.default.string
|
|
224
|
+
};
|
|
225
|
+
var _default = Testimonial;
|
|
226
|
+
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 _Testimonial = _interopRequireDefault(require("./Testimonial"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
var _default = _Testimonial.default;
|
|
13
|
+
exports.default = _default;
|