@telus-uds/components-web 2.43.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 +21 -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 +105 -101
- 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 +17 -4
- 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 -506
- 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,39 +0,0 @@
|
|
|
1
|
-
var _Skeleton$propTypes, _Skeleton$propTypes2, _Skeleton$propTypes3;
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Skeleton } from '@telus-uds/components-base';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const SkeletonImage = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
7
|
-
let {
|
|
8
|
-
rounded,
|
|
9
|
-
imgHeight,
|
|
10
|
-
size,
|
|
11
|
-
sizeIndex,
|
|
12
|
-
// Size automatically from image height, unless any size prop is passed in
|
|
13
|
-
sizePixels = !(size || sizeIndex) ? imgHeight : undefined,
|
|
14
|
-
show,
|
|
15
|
-
children
|
|
16
|
-
} = _ref;
|
|
17
|
-
if (!show) {
|
|
18
|
-
return children;
|
|
19
|
-
}
|
|
20
|
-
const shape = rounded !== 'circle' ? 'box' : rounded;
|
|
21
|
-
return /*#__PURE__*/_jsx(Skeleton, {
|
|
22
|
-
size: size,
|
|
23
|
-
sizePixels: sizePixels,
|
|
24
|
-
sizeIndex: sizeIndex,
|
|
25
|
-
shape: shape,
|
|
26
|
-
ref: ref
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
SkeletonImage.displayName = 'SkeletonImage';
|
|
30
|
-
SkeletonImage.propTypes = {
|
|
31
|
-
imgHeight: PropTypes.number,
|
|
32
|
-
rounded: PropTypes.oneOf(['circle', 'corners']),
|
|
33
|
-
size: (_Skeleton$propTypes = Skeleton.propTypes) === null || _Skeleton$propTypes === void 0 ? void 0 : _Skeleton$propTypes.size,
|
|
34
|
-
sizeIndex: (_Skeleton$propTypes2 = Skeleton.propTypes) === null || _Skeleton$propTypes2 === void 0 ? void 0 : _Skeleton$propTypes2.sizeIndex,
|
|
35
|
-
sizePixels: (_Skeleton$propTypes3 = Skeleton.propTypes) === null || _Skeleton$propTypes3 === void 0 ? void 0 : _Skeleton$propTypes3.sizePixels,
|
|
36
|
-
show: PropTypes.bool.isRequired,
|
|
37
|
-
children: PropTypes.node
|
|
38
|
-
};
|
|
39
|
-
export default SkeletonImage;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Typography } from '@telus-uds/components-base';
|
|
4
|
-
import Image from '../Image';
|
|
5
|
-
import SkeletonTypography from './SkeletonTypography';
|
|
6
|
-
import SkeletonImage from './SkeletonImage';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
9
|
-
const SkeletonProvider = _ref => {
|
|
10
|
-
let {
|
|
11
|
-
children,
|
|
12
|
-
show
|
|
13
|
-
} = _ref;
|
|
14
|
-
if (!show) {
|
|
15
|
-
return children;
|
|
16
|
-
}
|
|
17
|
-
const mapChild = child => {
|
|
18
|
-
if (!child) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
let childElement = child;
|
|
22
|
-
if (childElement.props && 'children' in childElement.props) {
|
|
23
|
-
const {
|
|
24
|
-
children: elementChildren
|
|
25
|
-
} = childElement.props;
|
|
26
|
-
const mappedChildren = Array.isArray(elementChildren) ? elementChildren.map(mapChild) : mapChild(elementChildren);
|
|
27
|
-
childElement = /*#__PURE__*/React.cloneElement(childElement, {
|
|
28
|
-
children: mappedChildren
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
if (childElement.type === Typography) {
|
|
32
|
-
return /*#__PURE__*/_jsx(SkeletonTypography, {
|
|
33
|
-
...childElement.props.skeleton,
|
|
34
|
-
show: show,
|
|
35
|
-
children: childElement
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
if (childElement.type === Image) {
|
|
39
|
-
return /*#__PURE__*/_jsx(SkeletonImage, {
|
|
40
|
-
...childElement.props.skeleton,
|
|
41
|
-
imgHeight: childElement.props.height,
|
|
42
|
-
rounded: childElement.props.rounded,
|
|
43
|
-
show: show,
|
|
44
|
-
children: childElement
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
return childElement;
|
|
48
|
-
};
|
|
49
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
50
|
-
children: React.Children.map(children, mapChild)
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
SkeletonProvider.propTypes = {
|
|
54
|
-
show: PropTypes.bool.isRequired,
|
|
55
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired
|
|
56
|
-
};
|
|
57
|
-
export default SkeletonProvider;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var _Skeleton$propTypes, _Skeleton$propTypes2, _Skeleton$propTypes3, _Skeleton$propTypes4, _Skeleton$propTypes5;
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Skeleton } from '@telus-uds/components-base';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const SkeletonTypography = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
7
|
-
let {
|
|
8
|
-
show,
|
|
9
|
-
size,
|
|
10
|
-
sizeIndex,
|
|
11
|
-
sizePixels,
|
|
12
|
-
characters,
|
|
13
|
-
lines,
|
|
14
|
-
children
|
|
15
|
-
} = _ref;
|
|
16
|
-
if (!show) {
|
|
17
|
-
return children;
|
|
18
|
-
}
|
|
19
|
-
return /*#__PURE__*/_jsx(Skeleton, {
|
|
20
|
-
size: size,
|
|
21
|
-
sizeIndex: sizeIndex,
|
|
22
|
-
sizePixels: sizePixels,
|
|
23
|
-
characters: characters,
|
|
24
|
-
lines: lines,
|
|
25
|
-
ref: ref
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
SkeletonTypography.displayName = 'SkeletonTypography';
|
|
29
|
-
SkeletonTypography.propTypes = {
|
|
30
|
-
show: PropTypes.bool.isRequired,
|
|
31
|
-
children: PropTypes.node,
|
|
32
|
-
size: (_Skeleton$propTypes = Skeleton.propTypes) === null || _Skeleton$propTypes === void 0 ? void 0 : _Skeleton$propTypes.size,
|
|
33
|
-
sizeIndex: (_Skeleton$propTypes2 = Skeleton.propTypes) === null || _Skeleton$propTypes2 === void 0 ? void 0 : _Skeleton$propTypes2.sizeIndex,
|
|
34
|
-
sizePixels: (_Skeleton$propTypes3 = Skeleton.propTypes) === null || _Skeleton$propTypes3 === void 0 ? void 0 : _Skeleton$propTypes3.sizePixels,
|
|
35
|
-
characters: (_Skeleton$propTypes4 = Skeleton.propTypes) === null || _Skeleton$propTypes4 === void 0 ? void 0 : _Skeleton$propTypes4.characters,
|
|
36
|
-
lines: (_Skeleton$propTypes5 = Skeleton.propTypes) === null || _Skeleton$propTypes5 === void 0 ? void 0 : _Skeleton$propTypes5.lines
|
|
37
|
-
};
|
|
38
|
-
export default SkeletonTypography;
|
package/lib-module/Span/Span.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs, useTypographyTheme } from '../utils';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const StyledSpan = /*#__PURE__*/styled.span.withConfig({
|
|
9
|
-
displayName: "Span__StyledSpan",
|
|
10
|
-
componentId: "components-web__sc-o7sihn-0"
|
|
11
|
-
})(["", "};"], _ref => {
|
|
12
|
-
let {
|
|
13
|
-
flex
|
|
14
|
-
} = _ref;
|
|
15
|
-
return flex ? 'display: inline-flex' : '';
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Text as an HTML ```<span>``` element.
|
|
20
|
-
*
|
|
21
|
-
* Span may be used in cases where an inline span or direct access to HTML attributes is required.
|
|
22
|
-
* In most cases, `Typography` should be used for text, or Paragraph for body text.
|
|
23
|
-
*/
|
|
24
|
-
const Span = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
25
|
-
let {
|
|
26
|
-
children,
|
|
27
|
-
variant,
|
|
28
|
-
tokens,
|
|
29
|
-
testID,
|
|
30
|
-
flex,
|
|
31
|
-
...rest
|
|
32
|
-
} = _ref2;
|
|
33
|
-
const style = useTypographyTheme(variant, tokens);
|
|
34
|
-
return /*#__PURE__*/_jsx(StyledSpan, {
|
|
35
|
-
"data-testid": testID,
|
|
36
|
-
flex: flex,
|
|
37
|
-
style: style,
|
|
38
|
-
ref: ref,
|
|
39
|
-
...selectProps(rest),
|
|
40
|
-
children: children
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
Span.displayName = 'Span';
|
|
44
|
-
Span.propTypes = {
|
|
45
|
-
...selectedSystemPropTypes,
|
|
46
|
-
children: PropTypes.node.isRequired,
|
|
47
|
-
/**
|
|
48
|
-
* Adds `data-testid` attribute for testing
|
|
49
|
-
*/
|
|
50
|
-
testID: PropTypes.string,
|
|
51
|
-
/**
|
|
52
|
-
* Sets display to inline-flex so that children are laid out using the flex model.
|
|
53
|
-
* Use this if the span contains children that expect to be inside a flex container.
|
|
54
|
-
*/
|
|
55
|
-
flex: PropTypes.bool,
|
|
56
|
-
/**
|
|
57
|
-
* Span takes the same tokens overrides as Typography
|
|
58
|
-
*/
|
|
59
|
-
tokens: getTokensPropType('Typography'),
|
|
60
|
-
/**
|
|
61
|
-
* Span can take any of Typography's theme variants
|
|
62
|
-
*/
|
|
63
|
-
variant: PropTypes.exact({
|
|
64
|
-
bold: PropTypes.bool,
|
|
65
|
-
colour: PropTypes.oneOf(['secondary', 'tertiary']),
|
|
66
|
-
compact: PropTypes.bool,
|
|
67
|
-
inverse: PropTypes.bool,
|
|
68
|
-
size: PropTypes.oneOf(['micro', 'small', 'large', 'eyebrow', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'display1', 'display2']),
|
|
69
|
-
weight: PropTypes.oneOf(['semibold', 'bold'])
|
|
70
|
-
})
|
|
71
|
-
};
|
|
72
|
-
export default Span;
|
package/lib-module/Span/index.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { selectSystemProps, useScrollBlocking, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
-
import { Portal } from '@gorhom/portal';
|
|
6
|
-
import SpinnerContent from './SpinnerContent';
|
|
7
|
-
import { htmlAttrs, media } from '../utils';
|
|
8
|
-
import { BACKDROP_OPACITY, BACKDROP_Z_INDEX } from './constants';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
12
|
-
const SpinnerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
13
|
-
displayName: "Spinner__SpinnerContainer",
|
|
14
|
-
componentId: "components-web__sc-116rqck-0"
|
|
15
|
-
})(_ref => {
|
|
16
|
-
let {
|
|
17
|
-
inline,
|
|
18
|
-
fullScreen
|
|
19
|
-
} = _ref;
|
|
20
|
-
return {
|
|
21
|
-
position: 'relative',
|
|
22
|
-
...(inline && {
|
|
23
|
-
display: 'block',
|
|
24
|
-
...media().from('md').css({
|
|
25
|
-
display: 'inline-block'
|
|
26
|
-
})
|
|
27
|
-
}),
|
|
28
|
-
...(fullScreen && {
|
|
29
|
-
top: '50%',
|
|
30
|
-
transform: 'translateY(-50%)'
|
|
31
|
-
})
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
const ContentOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
35
|
-
displayName: "Spinner__ContentOverlay",
|
|
36
|
-
componentId: "components-web__sc-116rqck-1"
|
|
37
|
-
})({
|
|
38
|
-
position: 'absolute',
|
|
39
|
-
width: '100%',
|
|
40
|
-
height: '100%',
|
|
41
|
-
zIndex: BACKDROP_Z_INDEX
|
|
42
|
-
});
|
|
43
|
-
const FullscreenOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
44
|
-
displayName: "Spinner__FullscreenOverlay",
|
|
45
|
-
componentId: "components-web__sc-116rqck-2"
|
|
46
|
-
})(_ref2 => {
|
|
47
|
-
let {
|
|
48
|
-
fullScreenOverLayBackground
|
|
49
|
-
} = _ref2;
|
|
50
|
-
return {
|
|
51
|
-
position: 'fixed',
|
|
52
|
-
width: '100vw',
|
|
53
|
-
height: '100vh',
|
|
54
|
-
top: 0,
|
|
55
|
-
left: 0,
|
|
56
|
-
zIndex: BACKDROP_Z_INDEX,
|
|
57
|
-
backgroundColor: fullScreenOverLayBackground
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
const OpaqueContainer = /*#__PURE__*/styled.div.withConfig({
|
|
61
|
-
displayName: "Spinner__OpaqueContainer",
|
|
62
|
-
componentId: "components-web__sc-116rqck-3"
|
|
63
|
-
})({
|
|
64
|
-
opacity: BACKDROP_OPACITY
|
|
65
|
-
});
|
|
66
|
-
const recursiveMap = (children, fn) => React.Children.map(children, child => {
|
|
67
|
-
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
68
|
-
return child;
|
|
69
|
-
}
|
|
70
|
-
if (child.props.children) {
|
|
71
|
-
return fn( /*#__PURE__*/React.cloneElement(child, {
|
|
72
|
-
children: recursiveMap(child.props.children, fn)
|
|
73
|
-
}));
|
|
74
|
-
}
|
|
75
|
-
return fn(child);
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Loading indicator.
|
|
80
|
-
*/
|
|
81
|
-
const Spinner = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
82
|
-
let {
|
|
83
|
-
children,
|
|
84
|
-
fullScreen = false,
|
|
85
|
-
inline = false,
|
|
86
|
-
label,
|
|
87
|
-
labelPosition,
|
|
88
|
-
show = false,
|
|
89
|
-
isStatic = false,
|
|
90
|
-
tokens,
|
|
91
|
-
variant = {},
|
|
92
|
-
...rest
|
|
93
|
-
} = _ref3;
|
|
94
|
-
const {
|
|
95
|
-
fullScreenOverLayBackground,
|
|
96
|
-
size,
|
|
97
|
-
thickness
|
|
98
|
-
} = useThemeTokens('Spinner', tokens, variant);
|
|
99
|
-
const {
|
|
100
|
-
size: sizeVariant = 'large'
|
|
101
|
-
} = variant;
|
|
102
|
-
useScrollBlocking([fullScreen, show]);
|
|
103
|
-
if (!show) {
|
|
104
|
-
return children ?? null;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Full screen spinner
|
|
108
|
-
if (fullScreen) {
|
|
109
|
-
return /*#__PURE__*/_jsx(Portal, {
|
|
110
|
-
children: /*#__PURE__*/_jsx(FullscreenOverlay, {
|
|
111
|
-
fullScreenOverLayBackground: fullScreenOverLayBackground,
|
|
112
|
-
children: /*#__PURE__*/_jsx(SpinnerContainer, {
|
|
113
|
-
inline: inline,
|
|
114
|
-
fullScreen: fullScreen,
|
|
115
|
-
"aria-live": "assertive",
|
|
116
|
-
...selectProps(rest),
|
|
117
|
-
children: /*#__PURE__*/_jsx(SpinnerContent, {
|
|
118
|
-
label: label,
|
|
119
|
-
labelPosition: labelPosition,
|
|
120
|
-
overlay: true,
|
|
121
|
-
size: size,
|
|
122
|
-
thickness: thickness,
|
|
123
|
-
sizeVariant: sizeVariant,
|
|
124
|
-
isStatic: isStatic
|
|
125
|
-
})
|
|
126
|
-
})
|
|
127
|
-
})
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// Overlay spinner
|
|
132
|
-
if (children) {
|
|
133
|
-
return /*#__PURE__*/_jsxs(SpinnerContainer, {
|
|
134
|
-
inline: inline,
|
|
135
|
-
"aria-live": "assertive",
|
|
136
|
-
...selectProps(rest),
|
|
137
|
-
children: [/*#__PURE__*/_jsx(SpinnerContent, {
|
|
138
|
-
label: label,
|
|
139
|
-
labelPosition: labelPosition,
|
|
140
|
-
overlay: true,
|
|
141
|
-
size: size,
|
|
142
|
-
thickness: thickness,
|
|
143
|
-
sizeVariant: sizeVariant,
|
|
144
|
-
isStatic: isStatic
|
|
145
|
-
}), /*#__PURE__*/_jsx(ContentOverlay, {}), /*#__PURE__*/_jsx(OpaqueContainer, {
|
|
146
|
-
inert: "true",
|
|
147
|
-
children: recursiveMap(children, c => {
|
|
148
|
-
if (c) {
|
|
149
|
-
return /*#__PURE__*/React.cloneElement(c, {
|
|
150
|
-
tabIndex: '-1',
|
|
151
|
-
'aria-hidden': 'true'
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
return undefined;
|
|
155
|
-
})
|
|
156
|
-
})]
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// Standalone spinner
|
|
161
|
-
return /*#__PURE__*/_jsx(SpinnerContainer, {
|
|
162
|
-
ref: ref,
|
|
163
|
-
...selectProps(rest),
|
|
164
|
-
children: /*#__PURE__*/_jsx(SpinnerContent, {
|
|
165
|
-
label: label,
|
|
166
|
-
labelPosition: labelPosition,
|
|
167
|
-
size: size,
|
|
168
|
-
thickness: thickness,
|
|
169
|
-
sizeVariant: sizeVariant,
|
|
170
|
-
isStatic: isStatic
|
|
171
|
-
})
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
Spinner.displayName = 'Spinner';
|
|
175
|
-
Spinner.propTypes = {
|
|
176
|
-
...selectedSystemPropTypes,
|
|
177
|
-
tokens: getTokensPropType('Spinner'),
|
|
178
|
-
/**
|
|
179
|
-
* Content to be overlaid while the spinner is active. Can be text, any HTML element,
|
|
180
|
-
* or any component.
|
|
181
|
-
*/
|
|
182
|
-
children: PropTypes.node,
|
|
183
|
-
/**
|
|
184
|
-
* Enables body locking.
|
|
185
|
-
*/
|
|
186
|
-
fullScreen: PropTypes.bool,
|
|
187
|
-
/**
|
|
188
|
-
* Set the inline prop to true if the Spinner should only cover its children; if
|
|
189
|
-
* the Spinner should cover the full width of its parent regardless of the size of
|
|
190
|
-
* its children, inline should be set to false
|
|
191
|
-
*/
|
|
192
|
-
inline: PropTypes.bool,
|
|
193
|
-
/**
|
|
194
|
-
* Communicates a message to assistive technology while visible. This same message
|
|
195
|
-
* will appear underneath the spinner when its `size` is `large`.
|
|
196
|
-
*/
|
|
197
|
-
label: PropTypes.string.isRequired,
|
|
198
|
-
/**
|
|
199
|
-
* The size of the spinner
|
|
200
|
-
*/
|
|
201
|
-
// size: PropTypes.oneOf(['large', 'small']),
|
|
202
|
-
/**
|
|
203
|
-
* Whether or not to render the spinner.
|
|
204
|
-
*/
|
|
205
|
-
show: PropTypes.bool,
|
|
206
|
-
/**
|
|
207
|
-
* If true, it should render a static spinner
|
|
208
|
-
*/
|
|
209
|
-
isStatic: PropTypes.bool,
|
|
210
|
-
/**
|
|
211
|
-
* Determine where the label of the spinner should be placed, left, right, bottom or top.
|
|
212
|
-
*/
|
|
213
|
-
labelPosition: PropTypes.string
|
|
214
|
-
};
|
|
215
|
-
export default Spinner;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { ActivityIndicator, StackView, Typography, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
6
|
-
import { BACKDROP_Z_INDEX, LARGE } from './constants';
|
|
7
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
-
const Container = /*#__PURE__*/styled.div.withConfig({
|
|
11
|
-
displayName: "SpinnerContent__Container",
|
|
12
|
-
componentId: "components-web__sc-1c8bd8e-0"
|
|
13
|
-
})(_ref => {
|
|
14
|
-
let {
|
|
15
|
-
overlay
|
|
16
|
-
} = _ref;
|
|
17
|
-
return {
|
|
18
|
-
display: 'inline-flex',
|
|
19
|
-
flexDirection: 'column',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
...(overlay && {
|
|
22
|
-
position: 'absolute',
|
|
23
|
-
top: '50%',
|
|
24
|
-
left: '50%',
|
|
25
|
-
transform: 'translate(-50%, -50%)',
|
|
26
|
-
zIndex: BACKDROP_Z_INDEX
|
|
27
|
-
})
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
const SpinnerContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
31
|
-
let {
|
|
32
|
-
label,
|
|
33
|
-
labelPosition,
|
|
34
|
-
overlay = false,
|
|
35
|
-
sizeVariant,
|
|
36
|
-
size,
|
|
37
|
-
thickness,
|
|
38
|
-
isStatic,
|
|
39
|
-
...rest
|
|
40
|
-
} = _ref2;
|
|
41
|
-
const labelMapping = {
|
|
42
|
-
top: 'column-reverse',
|
|
43
|
-
bottom: 'column',
|
|
44
|
-
left: 'row-reverse',
|
|
45
|
-
right: 'row'
|
|
46
|
-
};
|
|
47
|
-
return /*#__PURE__*/_jsx(Container, {
|
|
48
|
-
overlay: overlay,
|
|
49
|
-
ref: ref,
|
|
50
|
-
children: /*#__PURE__*/_jsxs(StackView, {
|
|
51
|
-
space: 3,
|
|
52
|
-
tokens: {
|
|
53
|
-
alignItems: 'center'
|
|
54
|
-
},
|
|
55
|
-
direction: labelMapping[labelPosition],
|
|
56
|
-
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
57
|
-
label: label,
|
|
58
|
-
tokens: {
|
|
59
|
-
size,
|
|
60
|
-
thickness
|
|
61
|
-
},
|
|
62
|
-
isStatic: isStatic,
|
|
63
|
-
...selectProps(rest)
|
|
64
|
-
}), sizeVariant === LARGE && /*#__PURE__*/_jsx(Typography, {
|
|
65
|
-
children: label
|
|
66
|
-
})]
|
|
67
|
-
})
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
SpinnerContent.displayName = 'SpinnerContent';
|
|
71
|
-
SpinnerContent.propTypes = {
|
|
72
|
-
...selectedSystemPropTypes,
|
|
73
|
-
/**
|
|
74
|
-
* Communicates a message to assistive technology while visible. This same message will appear underneath the spinner when its `size` is `large`.
|
|
75
|
-
*/
|
|
76
|
-
label: PropTypes.string.isRequired,
|
|
77
|
-
/**
|
|
78
|
-
* Whether the container has to have an overlay styling.
|
|
79
|
-
*/
|
|
80
|
-
overlay: PropTypes.bool,
|
|
81
|
-
/**
|
|
82
|
-
* Size (width and height) of the spinner.
|
|
83
|
-
*/
|
|
84
|
-
size: PropTypes.number,
|
|
85
|
-
/**
|
|
86
|
-
* The size of the spinner
|
|
87
|
-
*/
|
|
88
|
-
sizeVariant: PropTypes.oneOf(['large', 'small']),
|
|
89
|
-
/**
|
|
90
|
-
* If true, it should render a static spinner
|
|
91
|
-
*/
|
|
92
|
-
isStatic: PropTypes.bool
|
|
93
|
-
};
|
|
94
|
-
export default SpinnerContent;
|