@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,26 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import omit from 'lodash.omit';
|
|
4
|
+
import { Box, getThemeTokens, hrefAttrsProp, PressableCardBase, selectSystemProps, Spacer, StackView, Typography, a11yProps, focusHandlerProps, viewProps, withLinkRouter, useTheme, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
+
import styled from 'styled-components';
|
|
6
|
+
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
7
|
+
import AuthorDate from './AuthorDate';
|
|
2
8
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
-
var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
|
|
13
|
-
var _AuthorDate = _interopRequireDefault(require("./AuthorDate"));
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
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); }
|
|
16
|
-
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; }
|
|
17
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
9
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
19
|
-
|
|
10
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
|
|
20
12
|
|
|
21
13
|
// Stop changes to the card's inner border width causing the size and
|
|
22
14
|
// apparent position of the full bleed image to change.
|
|
23
|
-
const FullBleedOffsetOuter = /*#__PURE__*/
|
|
15
|
+
const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
|
|
24
16
|
displayName: "PreviewCard__FullBleedOffsetOuter",
|
|
25
17
|
componentId: "components-web__sc-1yfz4de-0"
|
|
26
18
|
})(_ref => {
|
|
@@ -32,7 +24,7 @@ const FullBleedOffsetOuter = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
32
24
|
marginTop: borderOffset * 2
|
|
33
25
|
};
|
|
34
26
|
});
|
|
35
|
-
const FullBleedOffsetInner = /*#__PURE__*/
|
|
27
|
+
const FullBleedOffsetInner = /*#__PURE__*/styled.div.withConfig({
|
|
36
28
|
displayName: "PreviewCard__FullBleedOffsetInner",
|
|
37
29
|
componentId: "components-web__sc-1yfz4de-1"
|
|
38
30
|
})(_ref2 => {
|
|
@@ -63,7 +55,7 @@ const defaultTokens = {
|
|
|
63
55
|
* - Use `href` to set the target URL
|
|
64
56
|
* - Use `fullBleedContent` to set the thumbnail image
|
|
65
57
|
*/
|
|
66
|
-
const PreviewCard = /*#__PURE__*/
|
|
58
|
+
const PreviewCard = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
67
59
|
let {
|
|
68
60
|
tag,
|
|
69
61
|
title,
|
|
@@ -78,7 +70,7 @@ const PreviewCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
78
70
|
fullBleedContentPosition,
|
|
79
71
|
contentStackDirection,
|
|
80
72
|
fullBleedContentProps
|
|
81
|
-
} =
|
|
73
|
+
} = useFullBleedContentProps({
|
|
82
74
|
...fullBleedContent,
|
|
83
75
|
position: 'bottom'
|
|
84
76
|
});
|
|
@@ -86,16 +78,16 @@ const PreviewCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
86
78
|
components: {
|
|
87
79
|
PreviewCard: theme
|
|
88
80
|
}
|
|
89
|
-
} =
|
|
81
|
+
} = useTheme();
|
|
90
82
|
const getPressableCardTokens = cardState => ({
|
|
91
|
-
...(
|
|
83
|
+
...omit(getThemeTokens(theme, {}, {}, cardState), 'separatorColor'),
|
|
92
84
|
...defaultTokens
|
|
93
85
|
});
|
|
94
86
|
const {
|
|
95
87
|
hrefAttrs,
|
|
96
88
|
rest: unusedRest
|
|
97
|
-
} =
|
|
98
|
-
return /*#__PURE__*/(
|
|
89
|
+
} = hrefAttrsProp.bundle(rest);
|
|
90
|
+
return /*#__PURE__*/_jsx(PressableCardBase, {
|
|
99
91
|
onPress: onPress,
|
|
100
92
|
href: href,
|
|
101
93
|
hrefAttrs: hrefAttrs,
|
|
@@ -109,14 +101,14 @@ const PreviewCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
109
101
|
} = getPressableCardTokens(cardState);
|
|
110
102
|
// Stop content jumping around as border size changes
|
|
111
103
|
const borderOffset = borderWidth - theme.tokens.borderWidth;
|
|
112
|
-
const fullBleedBorderRadius =
|
|
113
|
-
return /*#__PURE__*/(
|
|
104
|
+
const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius + borderOffset, fullBleedContentPosition);
|
|
105
|
+
return /*#__PURE__*/_jsxs(StackView, {
|
|
114
106
|
direction: contentStackDirection,
|
|
115
107
|
tokens: {
|
|
116
108
|
justifyContent: 'space-between',
|
|
117
109
|
flexGrow: 1
|
|
118
110
|
},
|
|
119
|
-
children: [/*#__PURE__*/(
|
|
111
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
120
112
|
horizontal: {
|
|
121
113
|
xs: 4,
|
|
122
114
|
lg: 5,
|
|
@@ -131,35 +123,35 @@ const PreviewCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
131
123
|
subtract: borderOffset
|
|
132
124
|
}
|
|
133
125
|
},
|
|
134
|
-
children: [Boolean(tag) && /*#__PURE__*/(
|
|
135
|
-
children: [/*#__PURE__*/(
|
|
126
|
+
children: [Boolean(tag) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
127
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
136
128
|
variant: {
|
|
137
129
|
size: 'eyebrow'
|
|
138
130
|
},
|
|
139
131
|
children: tag
|
|
140
|
-
}), /*#__PURE__*/(
|
|
132
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
141
133
|
space: 2
|
|
142
134
|
})]
|
|
143
|
-
}), /*#__PURE__*/(
|
|
135
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
144
136
|
variant: {
|
|
145
137
|
size: 'h4'
|
|
146
138
|
},
|
|
147
139
|
children: title
|
|
148
|
-
}), Boolean(footer) && /*#__PURE__*/(
|
|
149
|
-
children: [/*#__PURE__*/(
|
|
140
|
+
}), Boolean(footer) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
141
|
+
children: [/*#__PURE__*/_jsx(Spacer, {
|
|
150
142
|
space: 2
|
|
151
|
-
}), typeof footer === 'string' ? /*#__PURE__*/(
|
|
143
|
+
}), typeof footer === 'string' ? /*#__PURE__*/_jsx(Typography, {
|
|
152
144
|
variant: {
|
|
153
145
|
size: 'small'
|
|
154
146
|
},
|
|
155
147
|
children: footer
|
|
156
148
|
}) : footer]
|
|
157
149
|
})]
|
|
158
|
-
}), Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && /*#__PURE__*/(
|
|
150
|
+
}), Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && /*#__PURE__*/_jsx(FullBleedOffsetOuter, {
|
|
159
151
|
borderOffset: borderOffset,
|
|
160
|
-
children: /*#__PURE__*/(
|
|
152
|
+
children: /*#__PURE__*/_jsx(FullBleedOffsetInner, {
|
|
161
153
|
borderOffset: borderOffset,
|
|
162
|
-
children: /*#__PURE__*/(
|
|
154
|
+
children: /*#__PURE__*/_jsx(FullBleedContent, {
|
|
163
155
|
borderRadius: fullBleedBorderRadius,
|
|
164
156
|
...fullBleedContentProps
|
|
165
157
|
})
|
|
@@ -172,10 +164,10 @@ const PreviewCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
172
164
|
PreviewCard.displayName = 'PreviewCard';
|
|
173
165
|
|
|
174
166
|
// Provide standard author/date footer as a preset with the export
|
|
175
|
-
PreviewCard.AuthorDate =
|
|
167
|
+
PreviewCard.AuthorDate = AuthorDate;
|
|
176
168
|
PreviewCard.propTypes = {
|
|
177
169
|
...selectedSystemPropTypes,
|
|
178
|
-
tokens:
|
|
170
|
+
tokens: getTokensPropType('PreviewCard'),
|
|
179
171
|
/**
|
|
180
172
|
* The URL of the story to be navigated to. Note that `Video` component does not play well when used within
|
|
181
173
|
* a `PreviewCard` with `href` prop set (the volume and progress sliders can be clicked but are not draggable).
|
|
@@ -183,34 +175,33 @@ PreviewCard.propTypes = {
|
|
|
183
175
|
*
|
|
184
176
|
* @see https://github.com/telus/allium-design-system/issues/6
|
|
185
177
|
*/
|
|
186
|
-
href:
|
|
178
|
+
href: PropTypes.string,
|
|
187
179
|
/**
|
|
188
180
|
* Optional function to be called on press e.g. for within-page navigation.
|
|
189
181
|
*/
|
|
190
|
-
onPress:
|
|
182
|
+
onPress: PropTypes.func,
|
|
191
183
|
/**
|
|
192
184
|
* Text stating the category of the content.
|
|
193
185
|
*/
|
|
194
|
-
tag:
|
|
186
|
+
tag: PropTypes.string,
|
|
195
187
|
/**
|
|
196
188
|
* Section containing additional information, such as author and date.
|
|
197
189
|
* Use `<PreviewCard.AuthorDate author={...} date={...} />` here for author and date.
|
|
198
190
|
*/
|
|
199
|
-
footer:
|
|
191
|
+
footer: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
200
192
|
/**
|
|
201
193
|
* Text stating the title or headline of the story.
|
|
202
194
|
*/
|
|
203
|
-
title:
|
|
195
|
+
title: PropTypes.string.isRequired,
|
|
204
196
|
/**
|
|
205
197
|
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
206
198
|
*
|
|
207
199
|
* @deprecated
|
|
208
200
|
*/
|
|
209
|
-
fullBleedImage:
|
|
201
|
+
fullBleedImage: PropTypes.exact(FullBleedContent.propTypes || {}),
|
|
210
202
|
/**
|
|
211
203
|
* Full bleed content to be placed on the card.
|
|
212
204
|
*/
|
|
213
|
-
fullBleedContent:
|
|
205
|
+
fullBleedContent: PropTypes.exact(FullBleedContent.propTypes || {})
|
|
214
206
|
};
|
|
215
|
-
|
|
216
|
-
exports.default = _default;
|
|
207
|
+
export default withLinkRouter(PreviewCard);
|
package/lib/PreviewCard/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _PreviewCard = _interopRequireDefault(require("./PreviewCard"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _PreviewCard.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import PreviewCard from './PreviewCard';
|
|
2
|
+
export default PreviewCard;
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _FootnoteLink = _interopRequireDefault(require("../Footnote/FootnoteLink"));
|
|
12
|
-
var _tokens = _interopRequireDefault(require("./tokens"));
|
|
13
|
-
var _utils = require("../utils");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
17
|
-
const PriceLockupContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { A11yText, Divider, selectSystemProps, Typography, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import FootnoteLink from '../Footnote/FootnoteLink';
|
|
6
|
+
import getTypographyTokens from './tokens';
|
|
7
|
+
import { htmlAttrs, warn } from '../utils';
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
+
const PriceLockupContainer = /*#__PURE__*/styled.div.withConfig({
|
|
18
11
|
displayName: "PriceLockup__PriceLockupContainer",
|
|
19
12
|
componentId: "components-web__sc-1x6duay-0"
|
|
20
13
|
})(["align-items:", ";display:flex;flex-direction:column;width:fit-content;"], _ref => {
|
|
@@ -23,7 +16,7 @@ const PriceLockupContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
23
16
|
} = _ref;
|
|
24
17
|
return alignItemsText;
|
|
25
18
|
});
|
|
26
|
-
const PriceContainer = /*#__PURE__*/
|
|
19
|
+
const PriceContainer = /*#__PURE__*/styled.div.withConfig({
|
|
27
20
|
displayName: "PriceLockup__PriceContainer",
|
|
28
21
|
componentId: "components-web__sc-1x6duay-1"
|
|
29
22
|
})(["display:flex;margin-bottom:", ";"], _ref2 => {
|
|
@@ -32,7 +25,7 @@ const PriceContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
32
25
|
} = _ref2;
|
|
33
26
|
return priceMarginBottom;
|
|
34
27
|
});
|
|
35
|
-
const FootnoteContainer = /*#__PURE__*/
|
|
28
|
+
const FootnoteContainer = /*#__PURE__*/styled.div.withConfig({
|
|
36
29
|
displayName: "PriceLockup__FootnoteContainer",
|
|
37
30
|
componentId: "components-web__sc-1x6duay-2"
|
|
38
31
|
})(["display:flex;margin-top:", ";gap:", ";"], _ref3 => {
|
|
@@ -46,7 +39,7 @@ const FootnoteContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
|
|
|
46
39
|
} = _ref4;
|
|
47
40
|
return footnoteGap;
|
|
48
41
|
});
|
|
49
|
-
const BottomTextContainer = /*#__PURE__*/
|
|
42
|
+
const BottomTextContainer = /*#__PURE__*/styled.div.withConfig({
|
|
50
43
|
displayName: "PriceLockup__BottomTextContainer",
|
|
51
44
|
componentId: "components-web__sc-1x6duay-3"
|
|
52
45
|
})(["margin-top:", ";"], _ref5 => {
|
|
@@ -55,7 +48,7 @@ const BottomTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfi
|
|
|
55
48
|
} = _ref5;
|
|
56
49
|
return bottomTextMarginTop;
|
|
57
50
|
});
|
|
58
|
-
const BottomLinksContainer = /*#__PURE__*/
|
|
51
|
+
const BottomLinksContainer = /*#__PURE__*/styled.div.withConfig({
|
|
59
52
|
displayName: "PriceLockup__BottomLinksContainer",
|
|
60
53
|
componentId: "components-web__sc-1x6duay-4"
|
|
61
54
|
})(["align-self:center;margin-left:", ";"], _ref6 => {
|
|
@@ -64,7 +57,7 @@ const BottomLinksContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
64
57
|
} = _ref6;
|
|
65
58
|
return bottomLinksMarginLeft;
|
|
66
59
|
});
|
|
67
|
-
const TopTextContainer = /*#__PURE__*/
|
|
60
|
+
const TopTextContainer = /*#__PURE__*/styled.div.withConfig({
|
|
68
61
|
displayName: "PriceLockup__TopTextContainer",
|
|
69
62
|
componentId: "components-web__sc-1x6duay-5"
|
|
70
63
|
})(["margin-bottom:", ";"], _ref7 => {
|
|
@@ -73,7 +66,7 @@ const TopTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
73
66
|
} = _ref7;
|
|
74
67
|
return topTextMarginBottom;
|
|
75
68
|
});
|
|
76
|
-
const PriceTextContainer = /*#__PURE__*/
|
|
69
|
+
const PriceTextContainer = /*#__PURE__*/styled.div.withConfig({
|
|
77
70
|
displayName: "PriceLockup__PriceTextContainer",
|
|
78
71
|
componentId: "components-web__sc-1x6duay-6"
|
|
79
72
|
})(["display:flex;flex-direction:", ";"], _ref8 => {
|
|
@@ -82,11 +75,11 @@ const PriceTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig
|
|
|
82
75
|
} = _ref8;
|
|
83
76
|
return ratePosition === 'bottom' ? 'column' : 'row';
|
|
84
77
|
});
|
|
85
|
-
const RateContainer = /*#__PURE__*/
|
|
78
|
+
const RateContainer = /*#__PURE__*/styled.div.withConfig({
|
|
86
79
|
displayName: "PriceLockup__RateContainer",
|
|
87
80
|
componentId: "components-web__sc-1x6duay-7"
|
|
88
81
|
})(["display:flex;"]);
|
|
89
|
-
const RateTextContainer = /*#__PURE__*/
|
|
82
|
+
const RateTextContainer = /*#__PURE__*/styled.div.withConfig({
|
|
90
83
|
displayName: "PriceLockup__RateTextContainer",
|
|
91
84
|
componentId: "components-web__sc-1x6duay-8"
|
|
92
85
|
})(["align-self:", ";"], _ref9 => {
|
|
@@ -95,7 +88,7 @@ const RateTextContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
|
|
|
95
88
|
} = _ref9;
|
|
96
89
|
return ratePosition === 'bottom' ? 'flex-start' : 'flex-end';
|
|
97
90
|
});
|
|
98
|
-
const StrikeThroughContainer = /*#__PURE__*/
|
|
91
|
+
const StrikeThroughContainer = /*#__PURE__*/styled.div.withConfig({
|
|
99
92
|
displayName: "PriceLockup__StrikeThroughContainer",
|
|
100
93
|
componentId: "components-web__sc-1x6duay-9"
|
|
101
94
|
})(["display:flex;position:relative;align-items:center;::before{content:'';width:100%;top:", ";height:", ";background:", ";position:absolute;}"], _ref10 => {
|
|
@@ -140,7 +133,7 @@ const selectStrikeThroughTokens = _ref14 => {
|
|
|
140
133
|
strikeThroughColor
|
|
141
134
|
};
|
|
142
135
|
};
|
|
143
|
-
const PriceLockup = /*#__PURE__*/
|
|
136
|
+
const PriceLockup = /*#__PURE__*/React.forwardRef((_ref15, ref) => {
|
|
144
137
|
let {
|
|
145
138
|
size = 'medium',
|
|
146
139
|
signDirection = 'left',
|
|
@@ -158,7 +151,7 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref15, ref) => {
|
|
|
158
151
|
variant = {},
|
|
159
152
|
...rest
|
|
160
153
|
} = _ref15;
|
|
161
|
-
const viewport =
|
|
154
|
+
const viewport = useViewport();
|
|
162
155
|
const {
|
|
163
156
|
footnoteMarginTop,
|
|
164
157
|
footnoteGap,
|
|
@@ -171,14 +164,14 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref15, ref) => {
|
|
|
171
164
|
footnoteLinkFontSize,
|
|
172
165
|
alignItemsText,
|
|
173
166
|
...themeTokens
|
|
174
|
-
} =
|
|
167
|
+
} = useThemeTokens('PriceLockup', priceLockupTokens, {
|
|
175
168
|
...variant,
|
|
176
169
|
size
|
|
177
170
|
}, {
|
|
178
171
|
viewport,
|
|
179
172
|
strikeThrough
|
|
180
173
|
});
|
|
181
|
-
const typographyTokens = (
|
|
174
|
+
const typographyTokens = getTypographyTokens(themeTokens);
|
|
182
175
|
const priceString = String(price);
|
|
183
176
|
const lastDotPosition = priceString.lastIndexOf('.');
|
|
184
177
|
const lastCommaPosition = priceString.lastIndexOf(',');
|
|
@@ -203,13 +196,13 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref15, ref) => {
|
|
|
203
196
|
color: fontColor
|
|
204
197
|
}
|
|
205
198
|
};
|
|
206
|
-
return /*#__PURE__*/(
|
|
199
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
207
200
|
...customProps,
|
|
208
201
|
children: value
|
|
209
202
|
});
|
|
210
203
|
};
|
|
211
204
|
const renderCurrencySymbol = () => renderTypography(`${currencySymbol}`, typographyTokens.dollarSign);
|
|
212
|
-
const renderFootnoteLinks = () => footnoteLinks && footnoteLinks.length > 0 ? /*#__PURE__*/(
|
|
205
|
+
const renderFootnoteLinks = () => footnoteLinks && footnoteLinks.length > 0 ? /*#__PURE__*/_jsx(FootnoteLink, {
|
|
213
206
|
fontSize: footnoteLinkFontSize,
|
|
214
207
|
tokens: selectFootnoteLinkStyles(themeTokens),
|
|
215
208
|
number: footnoteLinks,
|
|
@@ -218,10 +211,10 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref15, ref) => {
|
|
|
218
211
|
const renderAmount = () => {
|
|
219
212
|
const amountComponent = renderTypography(amount, typographyTokens.amount);
|
|
220
213
|
if (strikeThrough) {
|
|
221
|
-
return /*#__PURE__*/(
|
|
222
|
-
children: [/*#__PURE__*/(
|
|
214
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
215
|
+
children: [/*#__PURE__*/_jsx(A11yText, {
|
|
223
216
|
text: a11yText
|
|
224
|
-
}), /*#__PURE__*/(
|
|
217
|
+
}), /*#__PURE__*/_jsx(StrikeThroughContainer, {
|
|
225
218
|
...selectStrikeThroughTokens(themeTokens),
|
|
226
219
|
children: amountComponent
|
|
227
220
|
})]
|
|
@@ -229,46 +222,46 @@ const PriceLockup = /*#__PURE__*/_react.default.forwardRef((_ref15, ref) => {
|
|
|
229
222
|
}
|
|
230
223
|
return amountComponent;
|
|
231
224
|
};
|
|
232
|
-
const renderPrice = () => /*#__PURE__*/(
|
|
233
|
-
children: [/*#__PURE__*/(
|
|
225
|
+
const renderPrice = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
226
|
+
children: [/*#__PURE__*/_jsxs(PriceContainer, {
|
|
234
227
|
priceMarginBottom: `${priceMarginBottom}px`,
|
|
235
|
-
children: [/*#__PURE__*/(
|
|
228
|
+
children: [/*#__PURE__*/_jsxs(PriceTextContainer, {
|
|
236
229
|
ratePosition: ratePosition,
|
|
237
|
-
children: [/*#__PURE__*/(
|
|
238
|
-
children: [signDirection === 'left' && renderCurrencySymbol(), renderAmount(), cents && renderTypography(`${separator}${cents}`, typographyTokens.cents), signDirection === 'right' && /*#__PURE__*/(
|
|
230
|
+
children: [/*#__PURE__*/_jsxs(RateContainer, {
|
|
231
|
+
children: [signDirection === 'left' && renderCurrencySymbol(), renderAmount(), cents && renderTypography(`${separator}${cents}`, typographyTokens.cents), signDirection === 'right' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
239
232
|
children: ["\xA0", renderCurrencySymbol()]
|
|
240
233
|
})]
|
|
241
|
-
}), rateText && /*#__PURE__*/(
|
|
234
|
+
}), rateText && /*#__PURE__*/_jsx(RateTextContainer, {
|
|
242
235
|
ratePosition: ratePosition,
|
|
243
236
|
children: renderTypography(rateText, typographyTokens.rate, ratePosition)
|
|
244
237
|
})]
|
|
245
|
-
}), !bottomText && footnoteLinks.length <= 3 && /*#__PURE__*/(
|
|
238
|
+
}), !bottomText && footnoteLinks.length <= 3 && /*#__PURE__*/_jsx(BottomLinksContainer, {
|
|
246
239
|
bottomLinksMarginLeft: `${bottomLinksMarginLeft}px`,
|
|
247
240
|
children: renderFootnoteLinks()
|
|
248
241
|
})]
|
|
249
242
|
}), !bottomText && footnoteLinks.length > 3 && renderFootnoteLinks()]
|
|
250
243
|
});
|
|
251
|
-
const renderFootnoteContent = () => /*#__PURE__*/(
|
|
252
|
-
children: [/*#__PURE__*/(
|
|
244
|
+
const renderFootnoteContent = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
245
|
+
children: [/*#__PURE__*/_jsxs(FootnoteContainer, {
|
|
253
246
|
footnoteMarginTop: `${footnoteMarginTop}px`,
|
|
254
247
|
footnoteGap: `${footnoteGap}px`,
|
|
255
|
-
children: [/*#__PURE__*/(
|
|
248
|
+
children: [/*#__PURE__*/_jsx(BottomTextContainer, {
|
|
256
249
|
bottomTextMarginTop: `${bottomTextMarginTop}px`,
|
|
257
250
|
children: renderTypography(bottomText, typographyTokens.bottomText)
|
|
258
251
|
}), footnoteLinks.length <= 3 && renderFootnoteLinks()]
|
|
259
252
|
}), footnoteLinks.length > 3 && renderFootnoteLinks()]
|
|
260
253
|
});
|
|
261
254
|
if (strikeThrough && !a11yText) {
|
|
262
|
-
|
|
255
|
+
warn('PriceLockup', 'a11yText must be provided with strikethrough pricing');
|
|
263
256
|
}
|
|
264
|
-
return /*#__PURE__*/(
|
|
257
|
+
return /*#__PURE__*/_jsxs(PriceLockupContainer, {
|
|
265
258
|
...selectProps(rest),
|
|
266
259
|
alignItemsText: alignItemsText,
|
|
267
260
|
ref: ref,
|
|
268
|
-
children: [topText && /*#__PURE__*/(
|
|
261
|
+
children: [topText && /*#__PURE__*/_jsx(TopTextContainer, {
|
|
269
262
|
topTextMarginBottom: `${topTextMarginBottom}px`,
|
|
270
263
|
children: renderTypography(topText, typographyTokens.topText)
|
|
271
|
-
}), renderPrice(), bottomText && /*#__PURE__*/(
|
|
264
|
+
}), renderPrice(), bottomText && /*#__PURE__*/_jsx(Divider, {
|
|
272
265
|
testID: "price-lockup-divider",
|
|
273
266
|
role: "separator",
|
|
274
267
|
tokens: {
|
|
@@ -285,57 +278,56 @@ PriceLockup.propTypes = {
|
|
|
285
278
|
*
|
|
286
279
|
* Micro for mini cart pricing, small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
|
|
287
280
|
*/
|
|
288
|
-
size:
|
|
281
|
+
size: PropTypes.oneOf(['micro', 'small', 'medium', 'large']),
|
|
289
282
|
/**
|
|
290
283
|
* If currency symbol other than `$` to be used
|
|
291
284
|
*/
|
|
292
|
-
currencySymbol:
|
|
285
|
+
currencySymbol: PropTypes.string,
|
|
293
286
|
/**
|
|
294
287
|
* Shows additional info above the price
|
|
295
288
|
*/
|
|
296
|
-
topText:
|
|
289
|
+
topText: PropTypes.string,
|
|
297
290
|
/**
|
|
298
291
|
* Monetary value (including decimals separated by ".")
|
|
299
292
|
*/
|
|
300
|
-
price:
|
|
293
|
+
price: PropTypes.string.isRequired,
|
|
301
294
|
/**
|
|
302
295
|
* Shows month/year unit
|
|
303
296
|
*/
|
|
304
|
-
rateText:
|
|
297
|
+
rateText: PropTypes.string,
|
|
305
298
|
/**
|
|
306
299
|
* Shows additional info below the price with a `Divider`
|
|
307
300
|
*/
|
|
308
|
-
bottomText:
|
|
301
|
+
bottomText: PropTypes.string,
|
|
309
302
|
/**
|
|
310
303
|
* Displays which side the currency should apperar (left, right)
|
|
311
304
|
*/
|
|
312
|
-
signDirection:
|
|
305
|
+
signDirection: PropTypes.oneOf(['right', 'left']),
|
|
313
306
|
/**
|
|
314
307
|
* Displays where the rate should apperar (bottom, right)
|
|
315
308
|
*/
|
|
316
|
-
ratePosition:
|
|
309
|
+
ratePosition: PropTypes.oneOf(['right', 'bottom']),
|
|
317
310
|
/**
|
|
318
311
|
* Shows additional link for context
|
|
319
312
|
*/
|
|
320
|
-
footnoteLinks:
|
|
313
|
+
footnoteLinks: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
|
|
321
314
|
/**
|
|
322
315
|
* Function to be called when a footnote link is clicked
|
|
323
316
|
*/
|
|
324
|
-
onClickFootnote:
|
|
317
|
+
onClickFootnote: PropTypes.func,
|
|
325
318
|
/**
|
|
326
319
|
* To show price savings comparison
|
|
327
320
|
*/
|
|
328
|
-
strikeThrough:
|
|
321
|
+
strikeThrough: PropTypes.bool,
|
|
329
322
|
/**
|
|
330
323
|
* To provide a11y text for `PriceLockup` component
|
|
331
324
|
*
|
|
332
325
|
* **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
|
|
333
326
|
*/
|
|
334
|
-
a11yText:
|
|
327
|
+
a11yText: PropTypes.string,
|
|
335
328
|
/**
|
|
336
329
|
* `PriceLockup` tokens
|
|
337
330
|
*/
|
|
338
|
-
tokens:
|
|
331
|
+
tokens: getTokensPropType('PriceLockup')
|
|
339
332
|
};
|
|
340
|
-
|
|
341
|
-
exports.default = _default;
|
|
333
|
+
export default PriceLockup;
|
package/lib/PriceLockup/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _PriceLockup = _interopRequireDefault(require("./PriceLockup"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _PriceLockup.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import PriceLockup from './PriceLockup';
|
|
2
|
+
export default PriceLockup;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
// map typography tokens accordenly
|
|
8
|
-
|
|
2
|
+
export default _ref => {
|
|
9
3
|
let {
|
|
10
4
|
topTextFontSize,
|
|
11
5
|
fontColor,
|
|
@@ -58,5 +52,4 @@ var _default = _ref => {
|
|
|
58
52
|
lineHeight: bottomTextLineHeight
|
|
59
53
|
}
|
|
60
54
|
};
|
|
61
|
-
};
|
|
62
|
-
exports.default = _default;
|
|
55
|
+
};
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { getTokensPropType, Progress, selectSystemProps, useThemeTokens, a11yProps, viewProps, variantProp, applyShadowToken } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
2
5
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
6
|
// Passes React Native-oriented system props through UDS Progress
|
|
14
|
-
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
15
9
|
const {
|
|
16
10
|
Bar: ProgressBarBase
|
|
17
|
-
} =
|
|
18
|
-
const Gradient = /*#__PURE__*/
|
|
11
|
+
} = Progress;
|
|
12
|
+
const Gradient = /*#__PURE__*/styled.div.attrs({
|
|
19
13
|
'data-testid': 'ProgressBar-Gradient'
|
|
20
14
|
}).withConfig({
|
|
21
15
|
displayName: "ProgressBar__Gradient",
|
|
@@ -35,7 +29,7 @@ const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
|
35
29
|
width: '100%',
|
|
36
30
|
background: `${type}-gradient(${angle}deg, ${stops[0].color}, ${stops[1].color})`,
|
|
37
31
|
borderRadius,
|
|
38
|
-
...
|
|
32
|
+
...applyShadowToken(shadow)
|
|
39
33
|
};
|
|
40
34
|
});
|
|
41
35
|
|
|
@@ -50,22 +44,22 @@ const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
|
50
44
|
* `gradient` is being used here to provide gradient filling.
|
|
51
45
|
*
|
|
52
46
|
*/
|
|
53
|
-
const ProgressBar = /*#__PURE__*/
|
|
47
|
+
const ProgressBar = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
54
48
|
let {
|
|
55
49
|
percentage,
|
|
56
50
|
tokens,
|
|
57
51
|
variant,
|
|
58
52
|
...rest
|
|
59
53
|
} = _ref2;
|
|
60
|
-
const themeTokens =
|
|
54
|
+
const themeTokens = useThemeTokens('ProgressBar', tokens, variant);
|
|
61
55
|
const selectedProps = selectProps(rest);
|
|
62
|
-
return /*#__PURE__*/(
|
|
56
|
+
return /*#__PURE__*/_jsx(ProgressBarBase, {
|
|
63
57
|
percentage: percentage,
|
|
64
58
|
tokens: tokens,
|
|
65
59
|
variant: variant,
|
|
66
60
|
ref: ref,
|
|
67
61
|
...selectedProps,
|
|
68
|
-
children: themeTokens.gradient && /*#__PURE__*/(
|
|
62
|
+
children: themeTokens.gradient && /*#__PURE__*/_jsx(Gradient, {
|
|
69
63
|
...themeTokens
|
|
70
64
|
})
|
|
71
65
|
});
|
|
@@ -76,15 +70,14 @@ ProgressBar.propTypes = {
|
|
|
76
70
|
/**
|
|
77
71
|
* Percentage of completion.
|
|
78
72
|
*/
|
|
79
|
-
percentage:
|
|
73
|
+
percentage: PropTypes.number,
|
|
80
74
|
/**
|
|
81
75
|
* ProgressBar tokens.
|
|
82
76
|
*/
|
|
83
|
-
tokens:
|
|
77
|
+
tokens: getTokensPropType('ProgressBar'),
|
|
84
78
|
/**
|
|
85
79
|
* ProgressBar variant.
|
|
86
80
|
*/
|
|
87
|
-
variant:
|
|
81
|
+
variant: variantProp.propType
|
|
88
82
|
};
|
|
89
|
-
|
|
90
|
-
exports.default = _default;
|
|
83
|
+
export default ProgressBar;
|