@telus-uds/components-web 2.21.2 → 2.23.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 +23 -2
- package/lib/Badge/Badge.js +2 -14
- package/lib/Badge/index.js +0 -3
- package/lib/BlockQuote/BlockQuote.js +4 -25
- package/lib/BlockQuote/index.js +0 -3
- package/lib/Breadcrumbs/Breadcrumbs.js +9 -36
- package/lib/Breadcrumbs/Item/Item.js +15 -25
- package/lib/Breadcrumbs/index.js +0 -2
- package/lib/Callout/Callout.js +2 -24
- package/lib/Callout/index.js +0 -3
- package/lib/Card/Card.js +15 -29
- package/lib/Card/CardContent.js +5 -18
- package/lib/Card/CardFooter.js +7 -19
- package/lib/Card/index.js +0 -3
- package/lib/Countdown/Countdown.js +5 -24
- package/lib/Countdown/Segment.js +3 -15
- package/lib/Countdown/index.js +0 -3
- package/lib/Countdown/types.js +2 -7
- package/lib/Countdown/useCountdown.js +0 -7
- package/lib/DatePicker/CalendarContainer.js +0 -5
- package/lib/DatePicker/DatePicker.js +9 -61
- package/lib/DatePicker/dictionary.js +0 -8
- package/lib/DatePicker/index.js +0 -3
- package/lib/DatePicker/reactDatesCss.js +0 -2
- package/lib/Disclaimer/Disclaimer.js +5 -14
- package/lib/Disclaimer/index.js +0 -2
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +6 -17
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +12 -25
- package/lib/ExpandCollapseMini/index.js +0 -3
- package/lib/Footnote/Footnote.js +17 -63
- package/lib/Footnote/FootnoteLink.js +3 -24
- package/lib/Footnote/index.js +0 -4
- package/lib/IconButton/IconButton.js +4 -14
- package/lib/IconButton/index.js +0 -3
- package/lib/Image/Image.js +5 -24
- package/lib/Image/index.js +0 -3
- package/lib/List/List.js +0 -2
- package/lib/List/ListItem.js +0 -8
- package/lib/List/index.js +0 -4
- package/lib/NavigationBar/NavigationBar.js +10 -35
- package/lib/NavigationBar/NavigationItem.js +5 -17
- package/lib/NavigationBar/NavigationSubMenu.js +3 -19
- package/lib/NavigationBar/collapseItems.js +6 -9
- package/lib/NavigationBar/index.js +0 -3
- package/lib/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/OptimizeImage/OptimizeImage.js +6 -27
- package/lib/OptimizeImage/index.js +0 -3
- package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -4
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -8
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib/OptimizeImage/utils/index.js +0 -4
- package/lib/OptimizeImage/utils/isSvgUrl.js +0 -1
- package/lib/OrderedList/Item.js +4 -21
- package/lib/OrderedList/ItemBase.js +2 -9
- package/lib/OrderedList/OrderedList.js +11 -22
- package/lib/OrderedList/OrderedListBase.js +3 -13
- package/lib/OrderedList/index.js +0 -4
- package/lib/Paragraph/Paragraph.js +3 -18
- package/lib/Paragraph/index.js +0 -3
- package/lib/PreviewCard/AuthorDate.js +1 -10
- package/lib/PreviewCard/PreviewCard.js +15 -35
- package/lib/PreviewCard/index.js +0 -3
- package/lib/PriceLockup/PriceLockup.js +78 -75
- package/lib/PriceLockup/index.js +0 -3
- package/lib/PriceLockup/tokens.js +0 -2
- package/lib/Progress/ProgressBar.js +5 -16
- package/lib/Progress/index.js +0 -4
- package/lib/QuantitySelector/QuantitySelector.js +8 -42
- package/lib/QuantitySelector/SideButton.js +4 -11
- package/lib/QuantitySelector/index.js +0 -3
- package/lib/QuantitySelector/styles.js +0 -6
- package/lib/ResponsiveImage/ResponsiveImage.js +5 -20
- package/lib/ResponsiveImage/index.js +0 -3
- package/lib/Ribbon/Ribbon.js +4 -20
- package/lib/Ribbon/index.js +0 -3
- package/lib/SkeletonProvider/SkeletonImage.js +0 -10
- package/lib/SkeletonProvider/SkeletonProvider.js +4 -22
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -10
- package/lib/SkeletonProvider/index.js +0 -3
- package/lib/Span/Span.js +3 -17
- package/lib/Span/index.js +0 -3
- package/lib/Spinner/Spinner.js +11 -39
- package/lib/Spinner/SpinnerContent.js +2 -18
- package/lib/Spinner/index.js +0 -3
- package/lib/StoryCard/StoryCard.js +11 -31
- package/lib/StoryCard/index.js +0 -3
- package/lib/Table/Body.js +0 -6
- package/lib/Table/Cell.js +4 -24
- package/lib/Table/Header.js +0 -9
- package/lib/Table/Row.js +0 -8
- package/lib/Table/SubHeading.js +0 -9
- package/lib/Table/Table.js +5 -23
- package/lib/Table/index.js +0 -8
- package/lib/TermsAndConditions/ExpandCollapse.js +4 -14
- package/lib/TermsAndConditions/TermsAndConditions.js +7 -29
- package/lib/TermsAndConditions/index.js +0 -2
- package/lib/Testimonial/Testimonial.js +2 -26
- package/lib/Testimonial/index.js +0 -3
- package/lib/Toast/Toast.js +4 -25
- package/lib/Toast/index.js +0 -3
- package/lib/Video/ControlBar/ControlBar.js +2 -25
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -17
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -20
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -26
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -23
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +2 -12
- package/lib/Video/Video.js +122 -194
- package/lib/Video/index.js +0 -3
- package/lib/VideoPicker/VideoPicker.js +6 -32
- package/lib/VideoPicker/VideoPickerPlayer.js +2 -10
- package/lib/VideoPicker/VideoPickerThumbnail.js +7 -28
- package/lib/VideoPicker/VideoSlider.js +7 -17
- package/lib/VideoPicker/index.js +0 -3
- package/lib/VideoPicker/videoPropType.js +2 -8
- package/lib/WaffleGrid/WaffleGrid.js +11 -28
- package/lib/WaffleGrid/index.js +0 -3
- package/lib/WebPortal/WebPortal.js +1 -5
- package/lib/WebPortal/index.js +0 -3
- package/lib/WebVideo/WebVideo.js +4 -30
- package/lib/WebVideo/index.js +0 -3
- package/lib/baseExports.js +6 -1
- package/lib/index.js +0 -49
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -17
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -11
- package/lib/shared/FullBleedContent/index.js +0 -5
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +1 -12
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +2 -12
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -23
- package/lib/shared/VideoSplash/VideoSplash.js +4 -17
- package/lib/shared/VideoSplash/helpers.js +0 -6
- package/lib/utils/index.js +0 -9
- package/lib/utils/logger.js +0 -6
- package/lib/utils/media.js +2 -11
- package/lib/utils/renderStructuredContent.js +14 -31
- package/lib/utils/ssr.js +0 -6
- package/lib/utils/transforms.js +0 -2
- package/lib/utils/useOverlaidPosition.js +6 -28
- package/lib/utils/useTypographyTheme.js +4 -5
- package/lib-module/Badge/Badge.js +2 -5
- package/lib-module/BlockQuote/BlockQuote.js +4 -15
- package/lib-module/Breadcrumbs/Breadcrumbs.js +9 -25
- package/lib-module/Breadcrumbs/Item/Item.js +15 -12
- package/lib-module/Callout/Callout.js +2 -16
- package/lib-module/Card/Card.js +14 -17
- package/lib-module/Card/CardContent.js +5 -8
- package/lib-module/Card/CardFooter.js +7 -9
- package/lib-module/Countdown/Countdown.js +6 -11
- package/lib-module/Countdown/Segment.js +6 -8
- package/lib-module/Countdown/types.js +2 -1
- package/lib-module/Countdown/useCountdown.js +0 -6
- package/lib-module/DatePicker/CalendarContainer.js +3 -1
- package/lib-module/DatePicker/DatePicker.js +9 -39
- package/lib-module/DatePicker/dictionary.js +0 -8
- package/lib-module/Disclaimer/Disclaimer.js +5 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -8
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +13 -19
- package/lib-module/Footnote/Footnote.js +17 -41
- package/lib-module/Footnote/FootnoteLink.js +3 -12
- package/lib-module/IconButton/IconButton.js +4 -6
- package/lib-module/Image/Image.js +5 -14
- package/lib-module/NavigationBar/NavigationBar.js +10 -20
- package/lib-module/NavigationBar/NavigationItem.js +5 -5
- package/lib-module/NavigationBar/NavigationSubMenu.js +3 -8
- package/lib-module/NavigationBar/collapseItems.js +6 -8
- package/lib-module/NavigationBar/resolveItemSelection.js +2 -2
- package/lib-module/OptimizeImage/OptimizeImage.js +6 -16
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -1
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -5
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib-module/OrderedList/Item.js +4 -7
- package/lib-module/OrderedList/ItemBase.js +2 -3
- package/lib-module/OrderedList/OrderedList.js +11 -9
- package/lib-module/OrderedList/OrderedListBase.js +3 -3
- package/lib-module/Paragraph/Paragraph.js +3 -8
- package/lib-module/PreviewCard/AuthorDate.js +1 -4
- package/lib-module/PreviewCard/PreviewCard.js +16 -19
- package/lib-module/PriceLockup/PriceLockup.js +78 -57
- package/lib-module/Progress/ProgressBar.js +7 -8
- package/lib-module/QuantitySelector/QuantitySelector.js +8 -30
- package/lib-module/QuantitySelector/SideButton.js +4 -6
- package/lib-module/ResponsiveImage/ResponsiveImage.js +5 -12
- package/lib-module/Ribbon/Ribbon.js +4 -9
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -5
- package/lib-module/SkeletonProvider/SkeletonProvider.js +4 -12
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -5
- package/lib-module/Span/Span.js +3 -7
- package/lib-module/Spinner/Spinner.js +11 -24
- package/lib-module/Spinner/SpinnerContent.js +2 -8
- package/lib-module/StoryCard/StoryCard.js +12 -17
- package/lib-module/Table/Body.js +0 -2
- package/lib-module/Table/Cell.js +4 -14
- package/lib-module/Table/Header.js +0 -2
- package/lib-module/Table/Row.js +0 -2
- package/lib-module/Table/SubHeading.js +0 -2
- package/lib-module/Table/Table.js +5 -6
- package/lib-module/TermsAndConditions/ExpandCollapse.js +4 -2
- package/lib-module/TermsAndConditions/TermsAndConditions.js +7 -9
- package/lib-module/Testimonial/Testimonial.js +2 -11
- package/lib-module/Toast/Toast.js +4 -15
- package/lib-module/Video/ControlBar/ControlBar.js +2 -9
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -13
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -10
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +2 -3
- package/lib-module/Video/Video.js +122 -173
- package/lib-module/VideoPicker/VideoPicker.js +6 -15
- package/lib-module/VideoPicker/VideoPickerPlayer.js +2 -3
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +7 -13
- package/lib-module/VideoPicker/VideoSlider.js +6 -9
- package/lib-module/VideoPicker/videoPropType.js +2 -1
- package/lib-module/WaffleGrid/WaffleGrid.js +11 -15
- package/lib-module/WebPortal/WebPortal.js +1 -1
- package/lib-module/WebVideo/WebVideo.js +4 -15
- package/lib-module/baseExports.js +3 -2
- package/lib-module/index.js +0 -1
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +5 -10
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -10
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +1 -11
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +2 -3
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -12
- package/lib-module/shared/VideoSplash/VideoSplash.js +4 -4
- package/lib-module/utils/logger.js +2 -2
- package/lib-module/utils/media.js +2 -9
- package/lib-module/utils/renderStructuredContent.js +14 -25
- package/lib-module/utils/ssr.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +8 -27
- package/lib-module/utils/useTypographyTheme.js +4 -4
- package/package.json +3 -3
- package/src/PriceLockup/PriceLockup.jsx +36 -11
- package/src/baseExports.js +1 -0
- package/src/index.js +0 -1
- package/lib/Modal/Modal.js +0 -146
- package/lib/Modal/ModalContent.js +0 -203
- package/lib/Modal/index.js +0 -13
- package/lib-module/Modal/Modal.js +0 -132
- package/lib-module/Modal/ModalContent.js +0 -181
- package/lib-module/Modal/index.js +0 -2
- package/src/Modal/Modal.jsx +0 -121
- package/src/Modal/ModalContent.jsx +0 -167
- package/src/Modal/index.js +0 -3
package/lib/Card/Card.js
CHANGED
|
@@ -4,28 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _CardContent = _interopRequireDefault(require("./CardContent"));
|
|
15
|
-
|
|
16
11
|
var _CardFooter = _interopRequireDefault(require("./CardFooter"));
|
|
17
|
-
|
|
18
12
|
var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
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); }
|
|
25
|
-
|
|
26
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; }
|
|
27
|
-
|
|
28
17
|
/* eslint-disable react/require-default-props */
|
|
18
|
+
|
|
29
19
|
const selectCardBaseTokens = _ref => {
|
|
30
20
|
let {
|
|
31
21
|
backgroundColor,
|
|
@@ -45,10 +35,11 @@ const selectCardBaseTokens = _ref => {
|
|
|
45
35
|
shadow,
|
|
46
36
|
minWidth
|
|
47
37
|
};
|
|
48
|
-
};
|
|
49
|
-
|
|
38
|
+
};
|
|
50
39
|
|
|
40
|
+
// Passes React Native-oriented system props through UDS Card
|
|
51
41
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
|
|
42
|
+
|
|
52
43
|
/**
|
|
53
44
|
* A basic card component, unstyled by default.
|
|
54
45
|
*
|
|
@@ -77,7 +68,6 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
|
|
|
77
68
|
* ## Accessibility
|
|
78
69
|
* `Card` component accepts all the standard accessibility props.
|
|
79
70
|
*/
|
|
80
|
-
|
|
81
71
|
const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
|
|
82
72
|
let {
|
|
83
73
|
children,
|
|
@@ -99,13 +89,15 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
|
|
|
99
89
|
contentStackDirection,
|
|
100
90
|
fullBleedContentPosition,
|
|
101
91
|
fullBleedContentProps
|
|
102
|
-
} = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent);
|
|
103
|
-
// those corners on the image as well, but partially
|
|
92
|
+
} = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent);
|
|
104
93
|
|
|
94
|
+
// If the card has rounded corners and a full bleed image, we need to apply
|
|
95
|
+
// those corners on the image as well, but partially
|
|
105
96
|
const cardTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, variant);
|
|
106
97
|
const hasFooter = Boolean(footer);
|
|
107
|
-
const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter);
|
|
98
|
+
const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter);
|
|
108
99
|
|
|
100
|
+
// Make multiple cards in a row have equal heights with even space between content items
|
|
109
101
|
const columnFlex = {
|
|
110
102
|
flexGrow: 1,
|
|
111
103
|
flexShrink: 1,
|
|
@@ -113,7 +105,8 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
|
|
|
113
105
|
};
|
|
114
106
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Card, {
|
|
115
107
|
ref: ref,
|
|
116
|
-
variant: {
|
|
108
|
+
variant: {
|
|
109
|
+
...variant,
|
|
117
110
|
padding: 'custom'
|
|
118
111
|
},
|
|
119
112
|
tokens: selectCardBaseTokens(cardTokens),
|
|
@@ -123,7 +116,8 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
|
|
|
123
116
|
tokens: columnFlex,
|
|
124
117
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
|
|
125
118
|
direction: contentStackDirection,
|
|
126
|
-
tokens: {
|
|
119
|
+
tokens: {
|
|
120
|
+
...columnFlex,
|
|
127
121
|
alignItems: contentStackAlign
|
|
128
122
|
},
|
|
129
123
|
space: 0,
|
|
@@ -147,49 +141,41 @@ const Card = /*#__PURE__*/(0, _react.forwardRef)(function () {
|
|
|
147
141
|
});
|
|
148
142
|
const positionValues = ['none', 'bottom', 'left', 'right', 'top'];
|
|
149
143
|
const alignValues = ['start', 'end', 'center', 'stretch'];
|
|
150
|
-
|
|
151
144
|
const PositionedFullBleedContentPropType = _propTypes.default.shape({
|
|
152
145
|
position: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(positionValues)).isRequired,
|
|
153
146
|
align: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(alignValues)),
|
|
154
147
|
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
155
148
|
..._FullBleedContent.default.propTypes
|
|
156
149
|
});
|
|
157
|
-
|
|
158
150
|
Card.displayName = 'Card';
|
|
159
|
-
Card.propTypes = {
|
|
160
|
-
|
|
151
|
+
Card.propTypes = {
|
|
152
|
+
...selectedSystemPropTypes,
|
|
161
153
|
/**
|
|
162
154
|
* Card content.
|
|
163
155
|
*/
|
|
164
156
|
children: _propTypes.default.node,
|
|
165
|
-
|
|
166
157
|
/**
|
|
167
158
|
* Card footer.
|
|
168
159
|
*/
|
|
169
160
|
footer: _propTypes.default.node,
|
|
170
|
-
|
|
171
161
|
/**
|
|
172
162
|
* Custom card footer padding.
|
|
173
163
|
*/
|
|
174
164
|
footerPadding: _componentsBase.paddingProp.propType,
|
|
175
|
-
|
|
176
165
|
/**
|
|
177
166
|
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
178
167
|
*
|
|
179
168
|
* @deprecated
|
|
180
169
|
*/
|
|
181
170
|
fullBleedImage: PositionedFullBleedContentPropType,
|
|
182
|
-
|
|
183
171
|
/**
|
|
184
172
|
* Full bleed content to be placed on the card.
|
|
185
173
|
*/
|
|
186
174
|
fullBleedContent: PositionedFullBleedContentPropType,
|
|
187
|
-
|
|
188
175
|
/**
|
|
189
176
|
* Card tokens.
|
|
190
177
|
*/
|
|
191
178
|
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
192
|
-
|
|
193
179
|
/**
|
|
194
180
|
* Card variant.
|
|
195
181
|
*/
|
package/lib/Card/CardContent.js
CHANGED
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("../utils");
|
|
17
|
-
|
|
18
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
23
|
-
|
|
24
15
|
const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
25
16
|
displayName: "CardContent__CardContentContainer",
|
|
26
17
|
componentId: "components-web__sc-1k2501q-0"
|
|
@@ -57,11 +48,10 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
57
48
|
justifyContent
|
|
58
49
|
};
|
|
59
50
|
});
|
|
51
|
+
|
|
60
52
|
/**
|
|
61
53
|
* Card content, applying the card tokens as per the theme used.
|
|
62
54
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
55
|
const CardContent = _ref2 => {
|
|
66
56
|
let {
|
|
67
57
|
children,
|
|
@@ -75,31 +65,28 @@ const CardContent = _ref2 => {
|
|
|
75
65
|
const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, variant, {
|
|
76
66
|
viewport
|
|
77
67
|
});
|
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardContentContainer, {
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardContentContainer, {
|
|
69
|
+
...themeTokens,
|
|
79
70
|
flexContent: flexContent,
|
|
80
71
|
withFooter: withFooter,
|
|
81
72
|
...selectProps(rest),
|
|
82
73
|
children: children
|
|
83
74
|
});
|
|
84
75
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
76
|
+
CardContent.propTypes = {
|
|
77
|
+
...selectedSystemPropTypes,
|
|
88
78
|
/**
|
|
89
79
|
* Card section content.
|
|
90
80
|
*/
|
|
91
81
|
children: _propTypes.default.node,
|
|
92
|
-
|
|
93
82
|
/**
|
|
94
83
|
* Card tokens.
|
|
95
84
|
*/
|
|
96
85
|
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
97
|
-
|
|
98
86
|
/**
|
|
99
87
|
* Card variant.
|
|
100
88
|
*/
|
|
101
89
|
variant: _componentsBase.variantProp.propType,
|
|
102
|
-
|
|
103
90
|
/**
|
|
104
91
|
* Whether the card has a footer.
|
|
105
92
|
*/
|
package/lib/Card/CardFooter.js
CHANGED
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _utils = require("../utils");
|
|
17
|
-
|
|
18
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
23
|
-
|
|
24
15
|
const CardFooterContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
25
16
|
displayName: "CardFooter__CardFooterContainer",
|
|
26
17
|
componentId: "components-web__sc-pm6vns-0"
|
|
@@ -46,11 +37,10 @@ const CardFooterContainer = /*#__PURE__*/_styledComponents.default.div.withConfi
|
|
|
46
37
|
paddingTop
|
|
47
38
|
};
|
|
48
39
|
});
|
|
40
|
+
|
|
49
41
|
/**
|
|
50
42
|
* Card footer, applying the tokens as per the theme used.
|
|
51
43
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
44
|
const CardFooter = _ref2 => {
|
|
55
45
|
let {
|
|
56
46
|
children,
|
|
@@ -60,35 +50,33 @@ const CardFooter = _ref2 => {
|
|
|
60
50
|
...rest
|
|
61
51
|
} = _ref2;
|
|
62
52
|
const viewport = (0, _componentsBase.useViewport)();
|
|
63
|
-
const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, {
|
|
53
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, {
|
|
54
|
+
...variant,
|
|
64
55
|
background: 'alternative'
|
|
65
56
|
}, {
|
|
66
57
|
viewport
|
|
67
58
|
});
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardFooterContainer, {
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardFooterContainer, {
|
|
60
|
+
...themeTokens,
|
|
69
61
|
...padding,
|
|
70
62
|
...selectProps(rest),
|
|
71
63
|
children: children
|
|
72
64
|
});
|
|
73
65
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
66
|
+
CardFooter.propTypes = {
|
|
67
|
+
...selectedSystemPropTypes,
|
|
77
68
|
/**
|
|
78
69
|
* Card footer content.
|
|
79
70
|
*/
|
|
80
71
|
children: _propTypes.default.node,
|
|
81
|
-
|
|
82
72
|
/**
|
|
83
73
|
* Card footer padding.
|
|
84
74
|
*/
|
|
85
75
|
padding: _componentsBase.paddingProp.propType,
|
|
86
|
-
|
|
87
76
|
/**
|
|
88
77
|
* Card tokens.
|
|
89
78
|
*/
|
|
90
79
|
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
91
|
-
|
|
92
80
|
/**
|
|
93
81
|
* Card variant.
|
|
94
82
|
*/
|
package/lib/Card/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _Card = _interopRequireDefault(require("./Card"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _Card.default;
|
|
13
10
|
exports.default = _default;
|
|
@@ -4,38 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _systemConstants = require("@telus-uds/system-constants");
|
|
15
|
-
|
|
16
11
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
17
|
-
|
|
18
12
|
var _utils = require("../utils");
|
|
19
|
-
|
|
20
13
|
var _Segment = _interopRequireDefault(require("./Segment"));
|
|
21
|
-
|
|
22
14
|
var _useCountdown = _interopRequireDefault(require("./useCountdown"));
|
|
23
|
-
|
|
24
15
|
var _types = require("./types");
|
|
25
|
-
|
|
26
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
-
|
|
28
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
-
|
|
30
18
|
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); }
|
|
31
|
-
|
|
32
19
|
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; }
|
|
33
|
-
|
|
34
20
|
/* eslint-disable react/require-default-props */
|
|
21
|
+
|
|
35
22
|
// Reading these from the RN palette since they will be used to generate
|
|
36
23
|
// the `Typography` tokens
|
|
37
24
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
38
|
-
|
|
39
25
|
const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
40
26
|
displayName: "Countdown__Container",
|
|
41
27
|
componentId: "components-web__sc-18tqcb2-0"
|
|
@@ -49,7 +35,8 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
49
35
|
themeTokens,
|
|
50
36
|
gradient
|
|
51
37
|
} = _ref;
|
|
52
|
-
return {
|
|
38
|
+
return {
|
|
39
|
+
...(large || feature ? {
|
|
53
40
|
display: 'flex',
|
|
54
41
|
flex: 0
|
|
55
42
|
} : {}),
|
|
@@ -70,14 +57,12 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
70
57
|
})
|
|
71
58
|
};
|
|
72
59
|
});
|
|
73
|
-
|
|
74
60
|
const getLabelTokens = themeTokens => ({
|
|
75
61
|
color: themeTokens.labelBorderColor,
|
|
76
62
|
fontSize: themeTokens.labelFontSize,
|
|
77
63
|
fontWeight: themeTokens.labelFontWeight,
|
|
78
64
|
lineHeight: themeTokens.labelLineHeight
|
|
79
65
|
});
|
|
80
|
-
|
|
81
66
|
const getMainTextTokens = _ref2 => {
|
|
82
67
|
let {
|
|
83
68
|
labelBorderColor,
|
|
@@ -94,7 +79,6 @@ const getMainTextTokens = _ref2 => {
|
|
|
94
79
|
fontName: textTimerFontName
|
|
95
80
|
};
|
|
96
81
|
};
|
|
97
|
-
|
|
98
82
|
const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
99
83
|
let {
|
|
100
84
|
copy = 'en',
|
|
@@ -111,11 +95,9 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
111
95
|
label,
|
|
112
96
|
noDivider
|
|
113
97
|
} = variant;
|
|
114
|
-
|
|
115
98
|
if (noDivider && !label) {
|
|
116
99
|
throw new Error('`noDivider` variant can only be used with `label` enabled!');
|
|
117
100
|
}
|
|
118
|
-
|
|
119
101
|
const themeTokens = (0, _componentsBase.useThemeTokens)('Countdown', tokens, variant, {
|
|
120
102
|
viewport
|
|
121
103
|
});
|
|
@@ -179,15 +161,14 @@ const Countdown = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
179
161
|
);
|
|
180
162
|
});
|
|
181
163
|
Countdown.displayName = 'Countdown';
|
|
182
|
-
Countdown.propTypes = {
|
|
164
|
+
Countdown.propTypes = {
|
|
165
|
+
...selectedSystemPropTypes,
|
|
183
166
|
tokens: (0, _componentsBase.getTokensPropType)('Countdown'),
|
|
184
|
-
|
|
185
167
|
/**
|
|
186
168
|
* Copy language identifier (`'en'` or `'fr'`) or a dictionary instance (an object with
|
|
187
169
|
* the following keys: days, day, hours, hour, minutes, minute, seconds, second)
|
|
188
170
|
*/
|
|
189
171
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), _types.dictionaryContentShape]),
|
|
190
|
-
|
|
191
172
|
/**
|
|
192
173
|
* An instance of JavaScript `Date` object or a string parseable via `Date.parse()`
|
|
193
174
|
* representing a point in the future to count down to.
|
package/lib/Countdown/Segment.js
CHANGED
|
@@ -4,32 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
15
|
-
|
|
16
11
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
17
|
-
|
|
18
12
|
var _types = require("./types");
|
|
19
|
-
|
|
20
13
|
var _constants = require("./constants");
|
|
21
|
-
|
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
16
|
// !TODO: put this back
|
|
17
|
+
|
|
27
18
|
// Pads with zeros on the left if it's a single digit number
|
|
28
19
|
const pad = function (number) {
|
|
29
20
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
30
21
|
return String(number).padStart(segmentWidth, '0');
|
|
31
22
|
};
|
|
32
|
-
|
|
33
23
|
const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
34
24
|
displayName: "Segment__Container",
|
|
35
25
|
componentId: "components-web__sc-yrh35y-0"
|
|
@@ -50,11 +40,10 @@ const Container = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
50
40
|
display: 'flex'
|
|
51
41
|
})
|
|
52
42
|
};
|
|
53
|
-
});
|
|
43
|
+
});
|
|
44
|
+
// A segment of the countdown string: we need to make sure it
|
|
54
45
|
// keeps its width constant to prevent the whole component from
|
|
55
46
|
// being automatically resized while using variable size fonts
|
|
56
|
-
|
|
57
|
-
|
|
58
47
|
const Segment = _ref2 => {
|
|
59
48
|
let {
|
|
60
49
|
copy = 'en',
|
|
@@ -95,7 +84,6 @@ const Segment = _ref2 => {
|
|
|
95
84
|
})
|
|
96
85
|
});
|
|
97
86
|
};
|
|
98
|
-
|
|
99
87
|
Segment.propTypes = {
|
|
100
88
|
/**
|
|
101
89
|
* Copy language identifier or a dictionary instance.
|
package/lib/Countdown/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _Countdown = _interopRequireDefault(require("./Countdown"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _Countdown.default;
|
|
13
10
|
exports.default = _default;
|
package/lib/Countdown/types.js
CHANGED
|
@@ -4,22 +4,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dictionaryContentShape = exports.default = exports.countdownVariantPropType = void 0;
|
|
7
|
-
|
|
8
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
const countdownVariantPropType = _propTypes.default.shape({
|
|
13
10
|
feature: _propTypes.default.bool,
|
|
14
11
|
inverse: _propTypes.default.bool,
|
|
15
12
|
label: _propTypes.default.bool,
|
|
16
13
|
large: _propTypes.default.bool,
|
|
17
14
|
noDivider: _propTypes.default.bool
|
|
18
|
-
});
|
|
19
|
-
|
|
15
|
+
});
|
|
20
16
|
|
|
17
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
21
18
|
exports.countdownVariantPropType = countdownVariantPropType;
|
|
22
|
-
|
|
23
19
|
const dictionaryContentShape = _propTypes.default.shape({
|
|
24
20
|
days: _propTypes.default.string.isRequired,
|
|
25
21
|
day: _propTypes.default.string.isRequired,
|
|
@@ -30,7 +26,6 @@ const dictionaryContentShape = _propTypes.default.shape({
|
|
|
30
26
|
seconds: _propTypes.default.string.isRequired,
|
|
31
27
|
second: _propTypes.default.string.isRequired
|
|
32
28
|
});
|
|
33
|
-
|
|
34
29
|
exports.dictionaryContentShape = dictionaryContentShape;
|
|
35
30
|
var _default = {
|
|
36
31
|
countdownVariantPropType,
|
|
@@ -4,28 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = require("react");
|
|
9
|
-
|
|
10
8
|
const getTimeCounts = countdown => {
|
|
11
9
|
if (countdown <= 0) {
|
|
12
10
|
return [0, 0, 0, 0];
|
|
13
11
|
}
|
|
14
|
-
|
|
15
12
|
const days = Math.floor(countdown / (1000 * 60 * 60 * 24));
|
|
16
13
|
const hours = Math.floor(countdown % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
|
|
17
14
|
const minutes = Math.floor(countdown % (1000 * 60 * 60) / (1000 * 60));
|
|
18
15
|
const seconds = Math.floor(countdown % (1000 * 60) / 1000);
|
|
19
16
|
return [days, hours, minutes, seconds];
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
const useCountdown = targetTime => {
|
|
23
19
|
const countdownTime = new Date(targetTime).getTime();
|
|
24
|
-
|
|
25
20
|
if (!countdownTime) {
|
|
26
21
|
throw new Error('Invalid target time is provided!');
|
|
27
22
|
}
|
|
28
|
-
|
|
29
23
|
const [countdown, setCountdown] = (0, _react.useState)(countdownTime - new Date().getTime());
|
|
30
24
|
(0, _react.useEffect)(() => {
|
|
31
25
|
const interval = setInterval(() => {
|
|
@@ -35,6 +29,5 @@ const useCountdown = targetTime => {
|
|
|
35
29
|
}, [countdownTime]);
|
|
36
30
|
return getTimeCounts(countdown);
|
|
37
31
|
};
|
|
38
|
-
|
|
39
32
|
var _default = useCountdown;
|
|
40
33
|
exports.default = _default;
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
-
|
|
10
8
|
var _reactDatesCss = _interopRequireDefault(require("./reactDatesCss"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
// calendarDayDefaultHeight and calendarDayDefaultWidth
|
|
15
11
|
// refer to circle size when selected, focused, or hovered and is passed with getResponsiveCircleSize in DatePicker
|
|
16
12
|
const CalendarContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
@@ -214,6 +210,5 @@ const CalendarContainer = /*#__PURE__*/_styledComponents.default.div.withConfig(
|
|
|
214
210
|
}
|
|
215
211
|
`;
|
|
216
212
|
});
|
|
217
|
-
|
|
218
213
|
var _default = CalendarContainer;
|
|
219
214
|
exports.default = _default;
|