@telus-uds/components-web 2.21.1 → 2.22.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 +22 -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
|
@@ -22,7 +22,6 @@ const StyledList = /*#__PURE__*/styled.ol.withConfig({
|
|
|
22
22
|
padding: 0,
|
|
23
23
|
alignItems: 'baseline'
|
|
24
24
|
});
|
|
25
|
-
|
|
26
25
|
const omitProps = _ref => {
|
|
27
26
|
let {
|
|
28
27
|
current,
|
|
@@ -35,12 +34,10 @@ const omitProps = _ref => {
|
|
|
35
34
|
} = _ref;
|
|
36
35
|
return props;
|
|
37
36
|
};
|
|
38
|
-
|
|
39
37
|
const getBreadcrumbName = (item, params) => {
|
|
40
38
|
if (!item.breadcrumbName) {
|
|
41
39
|
return null;
|
|
42
40
|
}
|
|
43
|
-
|
|
44
41
|
let {
|
|
45
42
|
breadcrumbName
|
|
46
43
|
} = item;
|
|
@@ -49,26 +46,20 @@ const getBreadcrumbName = (item, params) => {
|
|
|
49
46
|
});
|
|
50
47
|
return breadcrumbName;
|
|
51
48
|
};
|
|
52
|
-
|
|
53
49
|
const getPath = (path, params, concatenatePaths, paths) => {
|
|
54
50
|
let p = path;
|
|
55
|
-
|
|
56
51
|
if (concatenatePaths) {
|
|
57
52
|
p = p.replace(/^\//, '');
|
|
58
53
|
Object.keys(params).forEach(key => {
|
|
59
54
|
p = p.replace(`:${key}`, params[key]);
|
|
60
55
|
});
|
|
61
|
-
|
|
62
56
|
if (p) {
|
|
63
57
|
paths.push(p);
|
|
64
58
|
}
|
|
65
|
-
|
|
66
59
|
return `/${paths.join('/')}`;
|
|
67
60
|
}
|
|
68
|
-
|
|
69
61
|
return p;
|
|
70
62
|
};
|
|
71
|
-
|
|
72
63
|
const getItems = (items, params, concatenatePaths) => {
|
|
73
64
|
const paths = [];
|
|
74
65
|
return items.filter(item => item.path).map((item, i, filteredItems) => {
|
|
@@ -89,7 +80,6 @@ const getItems = (items, params, concatenatePaths) => {
|
|
|
89
80
|
};
|
|
90
81
|
});
|
|
91
82
|
};
|
|
92
|
-
|
|
93
83
|
const getStructuredData = (items, baseUrl) => {
|
|
94
84
|
return items.map((item, index) => ({
|
|
95
85
|
'@type': 'ListItem',
|
|
@@ -100,11 +90,10 @@ const getStructuredData = (items, baseUrl) => {
|
|
|
100
90
|
}
|
|
101
91
|
}));
|
|
102
92
|
};
|
|
93
|
+
|
|
103
94
|
/**
|
|
104
95
|
* Display a hierarchy of links, commonly used for navigation.
|
|
105
96
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
97
|
const Breadcrumbs = _ref2 => {
|
|
109
98
|
let {
|
|
110
99
|
baseUrl,
|
|
@@ -119,7 +108,6 @@ const Breadcrumbs = _ref2 => {
|
|
|
119
108
|
} = _ref2;
|
|
120
109
|
// React Helmet can cause a memory leak in SSR if not properly configured.
|
|
121
110
|
// Only run it in SSR if theme options tells us to.
|
|
122
|
-
|
|
123
111
|
/* const {
|
|
124
112
|
themeOptions: { enableHelmetSSR }
|
|
125
113
|
} = useTheme() */
|
|
@@ -144,7 +132,6 @@ const Breadcrumbs = _ref2 => {
|
|
|
144
132
|
};
|
|
145
133
|
}) : routes.filter(route => route.path && route.breadcrumbName);
|
|
146
134
|
const items = getItems(activeRoutes, params, !children);
|
|
147
|
-
|
|
148
135
|
const metadata = /*#__PURE__*/_jsx(HelmetProvider, {
|
|
149
136
|
context: helmetContext,
|
|
150
137
|
children: /*#__PURE__*/_jsx(Helmet, {
|
|
@@ -160,7 +147,6 @@ const Breadcrumbs = _ref2 => {
|
|
|
160
147
|
})
|
|
161
148
|
})
|
|
162
149
|
});
|
|
163
|
-
|
|
164
150
|
return /*#__PURE__*/_jsxs("nav", {
|
|
165
151
|
"aria-label": "Breadcrumb",
|
|
166
152
|
...selectProps(rest),
|
|
@@ -174,15 +160,18 @@ const Breadcrumbs = _ref2 => {
|
|
|
174
160
|
linkRouterProps: itemLinkRouterProps,
|
|
175
161
|
...itemRest
|
|
176
162
|
} = _ref4;
|
|
177
|
-
return /*#__PURE__*/_createElement(Item, {
|
|
163
|
+
return /*#__PURE__*/_createElement(Item, {
|
|
164
|
+
...itemRest,
|
|
178
165
|
current: current,
|
|
179
166
|
href: href,
|
|
180
167
|
tokens: tokens,
|
|
181
168
|
key: href,
|
|
182
|
-
linkRouterProps: {
|
|
169
|
+
linkRouterProps: {
|
|
170
|
+
...linkRouterProps,
|
|
183
171
|
...itemLinkRouterProps
|
|
184
172
|
},
|
|
185
|
-
variant: {
|
|
173
|
+
variant: {
|
|
174
|
+
...variant,
|
|
186
175
|
size: 'micro'
|
|
187
176
|
},
|
|
188
177
|
LinkRouter: ItemLinkRouter
|
|
@@ -191,26 +180,22 @@ const Breadcrumbs = _ref2 => {
|
|
|
191
180
|
}), metadata]
|
|
192
181
|
});
|
|
193
182
|
};
|
|
194
|
-
|
|
195
|
-
|
|
183
|
+
Breadcrumbs.propTypes = {
|
|
184
|
+
...selectedSystemPropTypes,
|
|
196
185
|
tokens: getTokensPropType('Breadcrumbs'),
|
|
197
186
|
...withLinkRouter.propTypes,
|
|
198
|
-
|
|
199
187
|
/**
|
|
200
188
|
* Base URL used to build structured data.
|
|
201
189
|
*/
|
|
202
190
|
baseUrl: PropTypes.string,
|
|
203
|
-
|
|
204
191
|
/**
|
|
205
192
|
* A list of Items to be used as an alternative to the `routes` prop.
|
|
206
193
|
*/
|
|
207
194
|
children: componentPropType('Item'),
|
|
208
|
-
|
|
209
195
|
/**
|
|
210
196
|
* React Router params.
|
|
211
197
|
*/
|
|
212
198
|
params: PropTypes.object,
|
|
213
|
-
|
|
214
199
|
/**
|
|
215
200
|
* An array of routes to be displayed as breadcrumbs.
|
|
216
201
|
*/
|
|
@@ -218,7 +203,6 @@ Breadcrumbs.propTypes = { ...selectedSystemPropTypes,
|
|
|
218
203
|
path: PropTypes.string,
|
|
219
204
|
breadcrumbName: PropTypes.string
|
|
220
205
|
})),
|
|
221
|
-
|
|
222
206
|
/**
|
|
223
207
|
* Variant to render.
|
|
224
208
|
*/
|
|
@@ -71,20 +71,24 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
71
71
|
fontSize,
|
|
72
72
|
...themeTokens
|
|
73
73
|
} = useThemeTokens('Breadcrumbs', tokens, variant);
|
|
74
|
-
const linkOptions = {
|
|
74
|
+
const linkOptions = {
|
|
75
|
+
...clickProps.toPressProps(selectProps(rest)),
|
|
75
76
|
href
|
|
76
77
|
};
|
|
77
|
-
return /*#__PURE__*/_jsx(StyledItemContainer, {
|
|
78
|
+
return /*#__PURE__*/_jsx(StyledItemContainer, {
|
|
79
|
+
...themeTokens,
|
|
78
80
|
children: current ? /*#__PURE__*/_jsx(Typography, {
|
|
79
81
|
tokens: {
|
|
80
82
|
color: currentColor,
|
|
81
83
|
fontSize
|
|
82
84
|
},
|
|
83
|
-
variant: {
|
|
85
|
+
variant: {
|
|
86
|
+
...variant
|
|
84
87
|
},
|
|
85
88
|
children: children
|
|
86
89
|
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
87
|
-
children: [/*#__PURE__*/_jsx(Link, {
|
|
90
|
+
children: [/*#__PURE__*/_jsx(Link, {
|
|
91
|
+
...linkOptions,
|
|
88
92
|
ref: ref,
|
|
89
93
|
tokens: {
|
|
90
94
|
color,
|
|
@@ -94,7 +98,8 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
94
98
|
linkRouterProps: linkRouterProps,
|
|
95
99
|
variant: variant,
|
|
96
100
|
children: children
|
|
97
|
-
}), /*#__PURE__*/_jsx(IconContainer, {
|
|
101
|
+
}), /*#__PURE__*/_jsx(IconContainer, {
|
|
102
|
+
...themeTokens,
|
|
98
103
|
children: /*#__PURE__*/_jsx(ChevronRightIcon, {
|
|
99
104
|
size: iconSize,
|
|
100
105
|
color: iconColor
|
|
@@ -104,35 +109,33 @@ const Item = /*#__PURE__*/forwardRef((_ref5, ref) => {
|
|
|
104
109
|
});
|
|
105
110
|
});
|
|
106
111
|
Item.displayName = 'Item';
|
|
107
|
-
Item.propTypes = {
|
|
108
|
-
|
|
112
|
+
Item.propTypes = {
|
|
113
|
+
...selectedSystemPropTypes,
|
|
109
114
|
/**
|
|
110
115
|
* Breadcrumb text
|
|
111
116
|
*/
|
|
112
117
|
children: PropTypes.node.isRequired,
|
|
113
|
-
|
|
114
118
|
/**
|
|
115
119
|
* @ignore
|
|
116
120
|
*
|
|
117
121
|
* Indicates whether or not the Item should be as current/active
|
|
118
122
|
*/
|
|
119
123
|
current: PropTypes.bool,
|
|
120
|
-
|
|
121
124
|
/**
|
|
122
125
|
* Target URL. This will be converted to `to` if the `LinkRouter`
|
|
123
126
|
* prop is provided to the `Item` or parent `Breadcrumbs` element.
|
|
124
127
|
*/
|
|
125
128
|
href: PropTypes.string.isRequired,
|
|
126
|
-
|
|
127
129
|
/**
|
|
128
130
|
* Variant to render.
|
|
129
131
|
*/
|
|
130
132
|
variant: PropTypes.shape({
|
|
131
133
|
inverse: PropTypes.bool
|
|
132
134
|
})
|
|
133
|
-
};
|
|
134
|
-
// - probably related https://github.com/yannickcr/eslint-plugin-react/issues/2760
|
|
135
|
+
};
|
|
135
136
|
|
|
137
|
+
// Since react/require-default-props eslint rule doesn't pick up default arguments as default props when combined with `forwardRef`
|
|
138
|
+
// - probably related https://github.com/yannickcr/eslint-plugin-react/issues/2760
|
|
136
139
|
Item.defaultProps = {
|
|
137
140
|
current: false,
|
|
138
141
|
variant: {
|
|
@@ -6,40 +6,31 @@ import { htmlAttrs } from '../utils';
|
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
8
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
-
|
|
10
9
|
const getAlignment = (rounded, textAlignToFlex) => {
|
|
11
10
|
if (textAlignToFlex) {
|
|
12
11
|
switch (textAlignToFlex) {
|
|
13
12
|
case 'left':
|
|
14
13
|
return 'flex-star';
|
|
15
|
-
|
|
16
14
|
case 'center':
|
|
17
15
|
return 'center';
|
|
18
|
-
|
|
19
16
|
default:
|
|
20
17
|
return 'flex-start';
|
|
21
18
|
}
|
|
22
19
|
}
|
|
23
|
-
|
|
24
20
|
return rounded ? 'center' : ' flex-start';
|
|
25
21
|
};
|
|
26
|
-
|
|
27
22
|
const verticalAlignToFlex = verticalAlign => {
|
|
28
23
|
switch (verticalAlign) {
|
|
29
24
|
case 'top':
|
|
30
25
|
return 'flex-start';
|
|
31
|
-
|
|
32
26
|
case 'middle':
|
|
33
27
|
return 'center';
|
|
34
|
-
|
|
35
28
|
case 'bottom':
|
|
36
29
|
return 'flex-end';
|
|
37
|
-
|
|
38
30
|
default:
|
|
39
31
|
return 'top';
|
|
40
32
|
}
|
|
41
33
|
};
|
|
42
|
-
|
|
43
34
|
const CalloutContainer = /*#__PURE__*/styled.div.withConfig({
|
|
44
35
|
displayName: "Callout__CalloutContainer",
|
|
45
36
|
componentId: "components-web__sc-1a7ptx-0"
|
|
@@ -63,7 +54,6 @@ const CalloutContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
63
54
|
alignItems: verticalAlignToFlex(verticalAlign)
|
|
64
55
|
};
|
|
65
56
|
});
|
|
66
|
-
|
|
67
57
|
const Callout = _ref2 => {
|
|
68
58
|
let {
|
|
69
59
|
icon,
|
|
@@ -120,25 +110,21 @@ const Callout = _ref2 => {
|
|
|
120
110
|
})]
|
|
121
111
|
});
|
|
122
112
|
};
|
|
123
|
-
|
|
124
|
-
|
|
113
|
+
Callout.propTypes = {
|
|
114
|
+
...selectedSystemPropTypes,
|
|
125
115
|
tokens: getTokensPropType('Callout'),
|
|
126
|
-
|
|
127
116
|
/**
|
|
128
117
|
* Icon to display on the left side of the Callout
|
|
129
118
|
*/
|
|
130
119
|
icon: PropTypes.elementType,
|
|
131
|
-
|
|
132
120
|
/**
|
|
133
121
|
* Children nodes that can be added
|
|
134
122
|
*/
|
|
135
123
|
children: PropTypes.node.isRequired,
|
|
136
|
-
|
|
137
124
|
/**
|
|
138
125
|
* To change the horizontal alignment of the Callout's text
|
|
139
126
|
*/
|
|
140
127
|
textAlignToFlex: PropTypes.oneOf(['center', 'left']),
|
|
141
|
-
|
|
142
128
|
/**
|
|
143
129
|
* To change the vertical alignment of the Callout's icon
|
|
144
130
|
*/
|
package/lib-module/Card/Card.js
CHANGED
|
@@ -7,7 +7,6 @@ import CardFooter from './CardFooter';
|
|
|
7
7
|
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
|
|
11
10
|
const selectCardBaseTokens = _ref => {
|
|
12
11
|
let {
|
|
13
12
|
backgroundColor,
|
|
@@ -27,10 +26,11 @@ const selectCardBaseTokens = _ref => {
|
|
|
27
26
|
shadow,
|
|
28
27
|
minWidth
|
|
29
28
|
};
|
|
30
|
-
};
|
|
31
|
-
|
|
29
|
+
};
|
|
32
30
|
|
|
31
|
+
// Passes React Native-oriented system props through UDS Card
|
|
33
32
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
33
|
+
|
|
34
34
|
/**
|
|
35
35
|
* A basic card component, unstyled by default.
|
|
36
36
|
*
|
|
@@ -59,7 +59,6 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
59
59
|
* ## Accessibility
|
|
60
60
|
* `Card` component accepts all the standard accessibility props.
|
|
61
61
|
*/
|
|
62
|
-
|
|
63
62
|
const Card = /*#__PURE__*/forwardRef(function () {
|
|
64
63
|
let {
|
|
65
64
|
children,
|
|
@@ -81,13 +80,15 @@ const Card = /*#__PURE__*/forwardRef(function () {
|
|
|
81
80
|
contentStackDirection,
|
|
82
81
|
fullBleedContentPosition,
|
|
83
82
|
fullBleedContentProps
|
|
84
|
-
} = useFullBleedContentProps(fullBleedContent);
|
|
85
|
-
// those corners on the image as well, but partially
|
|
83
|
+
} = useFullBleedContentProps(fullBleedContent);
|
|
86
84
|
|
|
85
|
+
// If the card has rounded corners and a full bleed image, we need to apply
|
|
86
|
+
// those corners on the image as well, but partially
|
|
87
87
|
const cardTokens = useThemeTokens('Card', tokens, variant);
|
|
88
88
|
const hasFooter = Boolean(footer);
|
|
89
|
-
const fullBleedBorderRadius = getFullBleedBorderRadius(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter);
|
|
89
|
+
const fullBleedBorderRadius = getFullBleedBorderRadius(cardTokens === null || cardTokens === void 0 ? void 0 : cardTokens.borderRadius, fullBleedContentPosition, hasFooter);
|
|
90
90
|
|
|
91
|
+
// Make multiple cards in a row have equal heights with even space between content items
|
|
91
92
|
const columnFlex = {
|
|
92
93
|
flexGrow: 1,
|
|
93
94
|
flexShrink: 1,
|
|
@@ -95,7 +96,8 @@ const Card = /*#__PURE__*/forwardRef(function () {
|
|
|
95
96
|
};
|
|
96
97
|
return /*#__PURE__*/_jsx(CardBase, {
|
|
97
98
|
ref: ref,
|
|
98
|
-
variant: {
|
|
99
|
+
variant: {
|
|
100
|
+
...variant,
|
|
99
101
|
padding: 'custom'
|
|
100
102
|
},
|
|
101
103
|
tokens: selectCardBaseTokens(cardTokens),
|
|
@@ -105,7 +107,8 @@ const Card = /*#__PURE__*/forwardRef(function () {
|
|
|
105
107
|
tokens: columnFlex,
|
|
106
108
|
children: [/*#__PURE__*/_jsxs(StackView, {
|
|
107
109
|
direction: contentStackDirection,
|
|
108
|
-
tokens: {
|
|
110
|
+
tokens: {
|
|
111
|
+
...columnFlex,
|
|
109
112
|
alignItems: contentStackAlign
|
|
110
113
|
},
|
|
111
114
|
space: 0,
|
|
@@ -136,40 +139,34 @@ const PositionedFullBleedContentPropType = PropTypes.shape({
|
|
|
136
139
|
...FullBleedContent.propTypes
|
|
137
140
|
});
|
|
138
141
|
Card.displayName = 'Card';
|
|
139
|
-
Card.propTypes = {
|
|
140
|
-
|
|
142
|
+
Card.propTypes = {
|
|
143
|
+
...selectedSystemPropTypes,
|
|
141
144
|
/**
|
|
142
145
|
* Card content.
|
|
143
146
|
*/
|
|
144
147
|
children: PropTypes.node,
|
|
145
|
-
|
|
146
148
|
/**
|
|
147
149
|
* Card footer.
|
|
148
150
|
*/
|
|
149
151
|
footer: PropTypes.node,
|
|
150
|
-
|
|
151
152
|
/**
|
|
152
153
|
* Custom card footer padding.
|
|
153
154
|
*/
|
|
154
155
|
footerPadding: paddingProp.propType,
|
|
155
|
-
|
|
156
156
|
/**
|
|
157
157
|
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
158
158
|
*
|
|
159
159
|
* @deprecated
|
|
160
160
|
*/
|
|
161
161
|
fullBleedImage: PositionedFullBleedContentPropType,
|
|
162
|
-
|
|
163
162
|
/**
|
|
164
163
|
* Full bleed content to be placed on the card.
|
|
165
164
|
*/
|
|
166
165
|
fullBleedContent: PositionedFullBleedContentPropType,
|
|
167
|
-
|
|
168
166
|
/**
|
|
169
167
|
* Card tokens.
|
|
170
168
|
*/
|
|
171
169
|
tokens: getTokensPropType('Card'),
|
|
172
|
-
|
|
173
170
|
/**
|
|
174
171
|
* Card variant.
|
|
175
172
|
*/
|
|
@@ -41,10 +41,10 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
41
41
|
justifyContent
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
|
+
|
|
44
45
|
/**
|
|
45
46
|
* Card content, applying the card tokens as per the theme used.
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
48
|
const CardContent = _ref2 => {
|
|
49
49
|
let {
|
|
50
50
|
children,
|
|
@@ -58,31 +58,28 @@ const CardContent = _ref2 => {
|
|
|
58
58
|
const themeTokens = useThemeTokens('Card', tokens, variant, {
|
|
59
59
|
viewport
|
|
60
60
|
});
|
|
61
|
-
return /*#__PURE__*/_jsx(CardContentContainer, {
|
|
61
|
+
return /*#__PURE__*/_jsx(CardContentContainer, {
|
|
62
|
+
...themeTokens,
|
|
62
63
|
flexContent: flexContent,
|
|
63
64
|
withFooter: withFooter,
|
|
64
65
|
...selectProps(rest),
|
|
65
66
|
children: children
|
|
66
67
|
});
|
|
67
68
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
CardContent.propTypes = {
|
|
70
|
+
...selectedSystemPropTypes,
|
|
71
71
|
/**
|
|
72
72
|
* Card section content.
|
|
73
73
|
*/
|
|
74
74
|
children: PropTypes.node,
|
|
75
|
-
|
|
76
75
|
/**
|
|
77
76
|
* Card tokens.
|
|
78
77
|
*/
|
|
79
78
|
tokens: getTokensPropType('Card'),
|
|
80
|
-
|
|
81
79
|
/**
|
|
82
80
|
* Card variant.
|
|
83
81
|
*/
|
|
84
82
|
variant: variantProp.propType,
|
|
85
|
-
|
|
86
83
|
/**
|
|
87
84
|
* Whether the card has a footer.
|
|
88
85
|
*/
|
|
@@ -30,10 +30,10 @@ const CardFooterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
30
30
|
paddingTop
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
|
+
|
|
33
34
|
/**
|
|
34
35
|
* Card footer, applying the tokens as per the theme used.
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
37
|
const CardFooter = _ref2 => {
|
|
38
38
|
let {
|
|
39
39
|
children,
|
|
@@ -43,35 +43,33 @@ const CardFooter = _ref2 => {
|
|
|
43
43
|
...rest
|
|
44
44
|
} = _ref2;
|
|
45
45
|
const viewport = useViewport();
|
|
46
|
-
const themeTokens = useThemeTokens('Card', tokens, {
|
|
46
|
+
const themeTokens = useThemeTokens('Card', tokens, {
|
|
47
|
+
...variant,
|
|
47
48
|
background: 'alternative'
|
|
48
49
|
}, {
|
|
49
50
|
viewport
|
|
50
51
|
});
|
|
51
|
-
return /*#__PURE__*/_jsx(CardFooterContainer, {
|
|
52
|
+
return /*#__PURE__*/_jsx(CardFooterContainer, {
|
|
53
|
+
...themeTokens,
|
|
52
54
|
...padding,
|
|
53
55
|
...selectProps(rest),
|
|
54
56
|
children: children
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
CardFooter.propTypes = {
|
|
60
|
+
...selectedSystemPropTypes,
|
|
60
61
|
/**
|
|
61
62
|
* Card footer content.
|
|
62
63
|
*/
|
|
63
64
|
children: PropTypes.node,
|
|
64
|
-
|
|
65
65
|
/**
|
|
66
66
|
* Card footer padding.
|
|
67
67
|
*/
|
|
68
68
|
padding: paddingProp.propType,
|
|
69
|
-
|
|
70
69
|
/**
|
|
71
70
|
* Card tokens.
|
|
72
71
|
*/
|
|
73
72
|
tokens: getTokensPropType('Card'),
|
|
74
|
-
|
|
75
73
|
/**
|
|
76
74
|
* Card variant.
|
|
77
75
|
*/
|
|
@@ -3,9 +3,9 @@ import React, { forwardRef } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Spacer, StackView, Typography, selectSystemProps, useViewport, useThemeTokens, applyTextStyles, getTokensPropType } from '@telus-uds/components-base';
|
|
5
5
|
import { viewports } from '@telus-uds/system-constants';
|
|
6
|
-
import styled from 'styled-components';
|
|
6
|
+
import styled from 'styled-components';
|
|
7
|
+
// Reading these from the RN palette since they will be used to generate
|
|
7
8
|
// the `Typography` tokens
|
|
8
|
-
|
|
9
9
|
import { htmlAttrs, transformGradient } from '../utils';
|
|
10
10
|
import Segment from './Segment';
|
|
11
11
|
import useCountdown from './useCountdown';
|
|
@@ -26,7 +26,8 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
26
26
|
themeTokens,
|
|
27
27
|
gradient
|
|
28
28
|
} = _ref;
|
|
29
|
-
return {
|
|
29
|
+
return {
|
|
30
|
+
...(large || feature ? {
|
|
30
31
|
display: 'flex',
|
|
31
32
|
flex: 0
|
|
32
33
|
} : {}),
|
|
@@ -47,14 +48,12 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
47
48
|
})
|
|
48
49
|
};
|
|
49
50
|
});
|
|
50
|
-
|
|
51
51
|
const getLabelTokens = themeTokens => ({
|
|
52
52
|
color: themeTokens.labelBorderColor,
|
|
53
53
|
fontSize: themeTokens.labelFontSize,
|
|
54
54
|
fontWeight: themeTokens.labelFontWeight,
|
|
55
55
|
lineHeight: themeTokens.labelLineHeight
|
|
56
56
|
});
|
|
57
|
-
|
|
58
57
|
const getMainTextTokens = _ref2 => {
|
|
59
58
|
let {
|
|
60
59
|
labelBorderColor,
|
|
@@ -71,7 +70,6 @@ const getMainTextTokens = _ref2 => {
|
|
|
71
70
|
fontName: textTimerFontName
|
|
72
71
|
};
|
|
73
72
|
};
|
|
74
|
-
|
|
75
73
|
const Countdown = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
76
74
|
let {
|
|
77
75
|
copy = 'en',
|
|
@@ -88,11 +86,9 @@ const Countdown = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
88
86
|
label,
|
|
89
87
|
noDivider
|
|
90
88
|
} = variant;
|
|
91
|
-
|
|
92
89
|
if (noDivider && !label) {
|
|
93
90
|
throw new Error('`noDivider` variant can only be used with `label` enabled!');
|
|
94
91
|
}
|
|
95
|
-
|
|
96
92
|
const themeTokens = useThemeTokens('Countdown', tokens, variant, {
|
|
97
93
|
viewport
|
|
98
94
|
});
|
|
@@ -156,15 +152,14 @@ const Countdown = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
156
152
|
);
|
|
157
153
|
});
|
|
158
154
|
Countdown.displayName = 'Countdown';
|
|
159
|
-
Countdown.propTypes = {
|
|
155
|
+
Countdown.propTypes = {
|
|
156
|
+
...selectedSystemPropTypes,
|
|
160
157
|
tokens: getTokensPropType('Countdown'),
|
|
161
|
-
|
|
162
158
|
/**
|
|
163
159
|
* Copy language identifier (`'en'` or `'fr'`) or a dictionary instance (an object with
|
|
164
160
|
* the following keys: days, day, hours, hour, minutes, minute, seconds, second)
|
|
165
161
|
*/
|
|
166
162
|
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), dictionaryContentShape]),
|
|
167
|
-
|
|
168
163
|
/**
|
|
169
164
|
* An instance of JavaScript `Date` object or a string parseable via `Date.parse()`
|
|
170
165
|
* representing a point in the future to count down to.
|
|
@@ -3,18 +3,17 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { StackView, Typography, useCopy } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import dictionary from './dictionary';
|
|
6
|
-
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
7
|
-
|
|
8
|
-
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants';
|
|
6
|
+
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
7
|
+
// !TODO: put this back
|
|
8
|
+
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants';
|
|
9
9
|
|
|
10
|
+
// Pads with zeros on the left if it's a single digit number
|
|
10
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
13
13
|
const pad = function (number) {
|
|
14
14
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
15
15
|
return String(number).padStart(segmentWidth, '0');
|
|
16
16
|
};
|
|
17
|
-
|
|
18
17
|
const Container = /*#__PURE__*/styled.div.withConfig({
|
|
19
18
|
displayName: "Segment__Container",
|
|
20
19
|
componentId: "components-web__sc-yrh35y-0"
|
|
@@ -35,10 +34,10 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
35
34
|
display: 'flex'
|
|
36
35
|
})
|
|
37
36
|
};
|
|
38
|
-
});
|
|
37
|
+
});
|
|
38
|
+
// A segment of the countdown string: we need to make sure it
|
|
39
39
|
// keeps its width constant to prevent the whole component from
|
|
40
40
|
// being automatically resized while using variable size fonts
|
|
41
|
-
|
|
42
41
|
const Segment = _ref2 => {
|
|
43
42
|
let {
|
|
44
43
|
copy = 'en',
|
|
@@ -79,7 +78,6 @@ const Segment = _ref2 => {
|
|
|
79
78
|
})
|
|
80
79
|
});
|
|
81
80
|
};
|
|
82
|
-
|
|
83
81
|
Segment.propTypes = {
|
|
84
82
|
/**
|
|
85
83
|
* Copy language identifier or a dictionary instance.
|
|
@@ -5,8 +5,9 @@ export const countdownVariantPropType = PropTypes.shape({
|
|
|
5
5
|
label: PropTypes.bool,
|
|
6
6
|
large: PropTypes.bool,
|
|
7
7
|
noDivider: PropTypes.bool
|
|
8
|
-
});
|
|
8
|
+
});
|
|
9
9
|
|
|
10
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
10
11
|
export const dictionaryContentShape = PropTypes.shape({
|
|
11
12
|
days: PropTypes.string.isRequired,
|
|
12
13
|
day: PropTypes.string.isRequired,
|
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
|
|
3
2
|
const getTimeCounts = countdown => {
|
|
4
3
|
if (countdown <= 0) {
|
|
5
4
|
return [0, 0, 0, 0];
|
|
6
5
|
}
|
|
7
|
-
|
|
8
6
|
const days = Math.floor(countdown / (1000 * 60 * 60 * 24));
|
|
9
7
|
const hours = Math.floor(countdown % (1000 * 60 * 60 * 24) / (1000 * 60 * 60));
|
|
10
8
|
const minutes = Math.floor(countdown % (1000 * 60 * 60) / (1000 * 60));
|
|
11
9
|
const seconds = Math.floor(countdown % (1000 * 60) / 1000);
|
|
12
10
|
return [days, hours, minutes, seconds];
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
const useCountdown = targetTime => {
|
|
16
13
|
const countdownTime = new Date(targetTime).getTime();
|
|
17
|
-
|
|
18
14
|
if (!countdownTime) {
|
|
19
15
|
throw new Error('Invalid target time is provided!');
|
|
20
16
|
}
|
|
21
|
-
|
|
22
17
|
const [countdown, setCountdown] = useState(countdownTime - new Date().getTime());
|
|
23
18
|
useEffect(() => {
|
|
24
19
|
const interval = setInterval(() => {
|
|
@@ -28,5 +23,4 @@ const useCountdown = targetTime => {
|
|
|
28
23
|
}, [countdownTime]);
|
|
29
24
|
return getTimeCounts(countdown);
|
|
30
25
|
};
|
|
31
|
-
|
|
32
26
|
export default useCountdown;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import defaultReactDatesCss from './reactDatesCss';
|
|
2
|
+
import defaultReactDatesCss from './reactDatesCss';
|
|
3
|
+
|
|
4
|
+
// calendarDayDefaultHeight and calendarDayDefaultWidth
|
|
3
5
|
// refer to circle size when selected, focused, or hovered and is passed with getResponsiveCircleSize in DatePicker
|
|
4
6
|
|
|
5
7
|
const CalendarContainer = /*#__PURE__*/styled.div.withConfig({
|