@telus-uds/components-web 2.44.0 → 3.0.1
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 +22 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +94 -103
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +1 -2
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -519
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _utils = require("../../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
-
const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Link, Typography, applyTextStyles, clickProps, selectSystemProps, useThemeTokens } from '@telus-uds/components-base';
|
|
5
|
+
import { htmlAttrs } from '../../utils';
|
|
6
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
+
const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
|
|
16
9
|
displayName: "Item__StyledItemContainer",
|
|
17
10
|
componentId: "components-web__sc-1rfdaul-0"
|
|
18
11
|
})({
|
|
@@ -32,7 +25,7 @@ const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig
|
|
|
32
25
|
},
|
|
33
26
|
marginBottom: '8px'
|
|
34
27
|
});
|
|
35
|
-
const IconContainer = /*#__PURE__*/
|
|
28
|
+
const IconContainer = /*#__PURE__*/styled.span.withConfig({
|
|
36
29
|
displayName: "Item__IconContainer",
|
|
37
30
|
componentId: "components-web__sc-1rfdaul-1"
|
|
38
31
|
})({
|
|
@@ -54,7 +47,7 @@ const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
|
|
|
54
47
|
fontName,
|
|
55
48
|
fontWeight
|
|
56
49
|
} = _ref5;
|
|
57
|
-
return
|
|
50
|
+
return applyTextStyles({
|
|
58
51
|
fontName,
|
|
59
52
|
fontWeight
|
|
60
53
|
}).fontFamily;
|
|
@@ -74,7 +67,7 @@ const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
|
|
|
74
67
|
},
|
|
75
68
|
verticalAlign: 'bottom'
|
|
76
69
|
});
|
|
77
|
-
const Item = /*#__PURE__*/
|
|
70
|
+
const Item = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
78
71
|
let {
|
|
79
72
|
href,
|
|
80
73
|
children,
|
|
@@ -102,17 +95,17 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
102
95
|
listItemPadding,
|
|
103
96
|
iconContainerSize,
|
|
104
97
|
iconPadding
|
|
105
|
-
} =
|
|
98
|
+
} = useThemeTokens('Breadcrumbs', tokens, variant);
|
|
106
99
|
const linkOptions = {
|
|
107
|
-
...
|
|
100
|
+
...clickProps.toPressProps(selectProps(rest)),
|
|
108
101
|
href
|
|
109
102
|
};
|
|
110
|
-
return /*#__PURE__*/(
|
|
103
|
+
return /*#__PURE__*/_jsx(StyledItemContainer, {
|
|
111
104
|
listItemPadding: listItemPadding,
|
|
112
105
|
lineHeight: lineHeight,
|
|
113
106
|
fontSize: fontSize,
|
|
114
107
|
iconContainerSize: iconContainerSize,
|
|
115
|
-
children: current ? /*#__PURE__*/(
|
|
108
|
+
children: current ? /*#__PURE__*/_jsx(Typography, {
|
|
116
109
|
tokens: {
|
|
117
110
|
color: currentColor,
|
|
118
111
|
fontSize,
|
|
@@ -121,8 +114,8 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
121
114
|
},
|
|
122
115
|
variant: variant,
|
|
123
116
|
children: children
|
|
124
|
-
}) : /*#__PURE__*/(
|
|
125
|
-
children: [/*#__PURE__*/(
|
|
117
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
|
118
|
+
children: [/*#__PURE__*/_jsx(Link, {
|
|
126
119
|
...linkOptions,
|
|
127
120
|
ref: ref,
|
|
128
121
|
tokens: {
|
|
@@ -135,12 +128,12 @@ const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
|
135
128
|
variant: variant,
|
|
136
129
|
onPress: onPress,
|
|
137
130
|
children: children
|
|
138
|
-
}), /*#__PURE__*/(
|
|
131
|
+
}), /*#__PURE__*/_jsx(IconContainer, {
|
|
139
132
|
iconPadding: iconPadding,
|
|
140
133
|
fontName: fontName,
|
|
141
134
|
fontWeight: fontWeight,
|
|
142
135
|
iconContainerSize: iconContainerSize,
|
|
143
|
-
children: /*#__PURE__*/(
|
|
136
|
+
children: /*#__PURE__*/_jsx(ChevronRightIcon, {
|
|
144
137
|
size: iconSize,
|
|
145
138
|
color: iconColor
|
|
146
139
|
})
|
|
@@ -154,28 +147,27 @@ Item.propTypes = {
|
|
|
154
147
|
/**
|
|
155
148
|
* Breadcrumb text
|
|
156
149
|
*/
|
|
157
|
-
children:
|
|
150
|
+
children: PropTypes.node.isRequired,
|
|
158
151
|
/**
|
|
159
152
|
* @ignore
|
|
160
153
|
*
|
|
161
154
|
* Indicates whether or not the Item should be as current/active
|
|
162
155
|
*/
|
|
163
|
-
current:
|
|
156
|
+
current: PropTypes.bool,
|
|
164
157
|
/**
|
|
165
158
|
* Target URL. This will be converted to `to` if the `LinkRouter`
|
|
166
159
|
* prop is provided to the `Item` or parent `Breadcrumbs` element.
|
|
167
160
|
*/
|
|
168
|
-
href:
|
|
161
|
+
href: PropTypes.string.isRequired,
|
|
169
162
|
/**
|
|
170
163
|
* Variant to render.
|
|
171
164
|
*/
|
|
172
|
-
variant:
|
|
173
|
-
inverse:
|
|
165
|
+
variant: PropTypes.shape({
|
|
166
|
+
inverse: PropTypes.bool
|
|
174
167
|
}),
|
|
175
168
|
/**
|
|
176
169
|
* Function to be called when the Item is clicked.
|
|
177
170
|
*/
|
|
178
|
-
onPress:
|
|
171
|
+
onPress: PropTypes.func
|
|
179
172
|
};
|
|
180
|
-
|
|
181
|
-
exports.default = _default;
|
|
173
|
+
export default Item;
|
package/lib/Breadcrumbs/index.js
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "default", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _Breadcrumbs.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
export { default } from './Breadcrumbs';
|
package/lib/Callout/Callout.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _utils = require("../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { Icon, selectSystemProps, Typography, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
15
8
|
const getAlignment = (rounded, textAlignToFlex) => {
|
|
16
9
|
if (textAlignToFlex) {
|
|
17
10
|
switch (textAlignToFlex) {
|
|
@@ -37,7 +30,7 @@ const verticalAlignToFlex = verticalAlign => {
|
|
|
37
30
|
return 'top';
|
|
38
31
|
}
|
|
39
32
|
};
|
|
40
|
-
const CalloutContainer = /*#__PURE__*/
|
|
33
|
+
const CalloutContainer = /*#__PURE__*/styled.div.withConfig({
|
|
41
34
|
displayName: "Callout__CalloutContainer",
|
|
42
35
|
componentId: "components-web__sc-1a7ptx-0"
|
|
43
36
|
})(_ref => {
|
|
@@ -60,7 +53,7 @@ const CalloutContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
60
53
|
alignItems: verticalAlignToFlex(verticalAlign)
|
|
61
54
|
};
|
|
62
55
|
});
|
|
63
|
-
const Callout = /*#__PURE__*/
|
|
56
|
+
const Callout = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
64
57
|
let {
|
|
65
58
|
icon,
|
|
66
59
|
children,
|
|
@@ -79,12 +72,12 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
79
72
|
paddingTop,
|
|
80
73
|
paddingBottom,
|
|
81
74
|
color
|
|
82
|
-
} =
|
|
75
|
+
} = useThemeTokens('Callout', tokens, variant);
|
|
83
76
|
const {
|
|
84
77
|
rounded = false,
|
|
85
78
|
size = 'medium'
|
|
86
79
|
} = variant;
|
|
87
|
-
return /*#__PURE__*/(
|
|
80
|
+
return /*#__PURE__*/_jsxs(CalloutContainer, {
|
|
88
81
|
size: size,
|
|
89
82
|
rounded: rounded,
|
|
90
83
|
"data-testid": "callout-container",
|
|
@@ -96,7 +89,7 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
96
89
|
padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
|
|
97
90
|
ref: ref,
|
|
98
91
|
...selectProps(rest),
|
|
99
|
-
children: [icon && /*#__PURE__*/(
|
|
92
|
+
children: [icon && /*#__PURE__*/_jsx(Icon, {
|
|
100
93
|
tokens: {
|
|
101
94
|
color
|
|
102
95
|
},
|
|
@@ -105,7 +98,7 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
105
98
|
rank: 'primary',
|
|
106
99
|
size
|
|
107
100
|
}
|
|
108
|
-
}), /*#__PURE__*/(
|
|
101
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
109
102
|
variant: {
|
|
110
103
|
size,
|
|
111
104
|
compact: size === 'small'
|
|
@@ -120,23 +113,22 @@ const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
120
113
|
Callout.displayName = 'Callout';
|
|
121
114
|
Callout.propTypes = {
|
|
122
115
|
...selectedSystemPropTypes,
|
|
123
|
-
tokens:
|
|
116
|
+
tokens: getTokensPropType('Callout'),
|
|
124
117
|
/**
|
|
125
118
|
* Icon to display on the left side of the Callout
|
|
126
119
|
*/
|
|
127
|
-
icon:
|
|
120
|
+
icon: PropTypes.elementType,
|
|
128
121
|
/**
|
|
129
122
|
* Children nodes that can be added
|
|
130
123
|
*/
|
|
131
|
-
children:
|
|
124
|
+
children: PropTypes.node.isRequired,
|
|
132
125
|
/**
|
|
133
126
|
* To change the horizontal alignment of the Callout's text
|
|
134
127
|
*/
|
|
135
|
-
textAlignToFlex:
|
|
128
|
+
textAlignToFlex: PropTypes.oneOf(['center', 'left']),
|
|
136
129
|
/**
|
|
137
130
|
* To change the vertical alignment of the Callout's icon
|
|
138
131
|
*/
|
|
139
|
-
verticalAlign:
|
|
132
|
+
verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
|
|
140
133
|
};
|
|
141
|
-
|
|
142
|
-
exports.default = _default;
|
|
134
|
+
export default Callout;
|
package/lib/Callout/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _Callout = _interopRequireDefault(require("./Callout"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _Callout.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import Callout from './Callout';
|
|
2
|
+
export default Callout;
|
package/lib/Card/Card.js
CHANGED
|
@@ -1,24 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, useThemeTokensCallback, variantProp, a11yProps, viewProps, PressableCardBase, useResponsiveProp } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import CardContent from './CardContent';
|
|
6
|
+
import CardFooter from './CardFooter';
|
|
7
|
+
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
8
|
+
import ConditionalWrapper from '../shared/ConditionalWrapper';
|
|
2
9
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _componentsWeb = require("@telus-uds/components-web");
|
|
11
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
-
var _CardContent = _interopRequireDefault(require("./CardContent"));
|
|
13
|
-
var _CardFooter = _interopRequireDefault(require("./CardFooter"));
|
|
14
|
-
var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
|
|
15
|
-
var _ConditionalWrapper = _interopRequireDefault(require("../shared/ConditionalWrapper"));
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
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); }
|
|
18
|
-
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; }
|
|
19
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
10
|
// Passes React Native-oriented system props through UDS Card
|
|
21
|
-
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
22
13
|
|
|
23
14
|
/**
|
|
24
15
|
* A basic card component, unstyled by default.
|
|
@@ -49,7 +40,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemP
|
|
|
49
40
|
* ## Accessibility
|
|
50
41
|
* `Card` component accepts all the standard accessibility props.
|
|
51
42
|
*/
|
|
52
|
-
const DynamicWidthContainer = /*#__PURE__*/
|
|
43
|
+
const DynamicWidthContainer = /*#__PURE__*/styled.div.withConfig({
|
|
53
44
|
displayName: "Card__DynamicWidthContainer",
|
|
54
45
|
componentId: "components-web__sc-1elbtwd-0"
|
|
55
46
|
})(_ref => {
|
|
@@ -66,7 +57,7 @@ const DynamicWidthContainer = /*#__PURE__*/_styledComponents.default.div.withCon
|
|
|
66
57
|
overflow
|
|
67
58
|
};
|
|
68
59
|
});
|
|
69
|
-
const Card = /*#__PURE__*/
|
|
60
|
+
const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
70
61
|
let {
|
|
71
62
|
children,
|
|
72
63
|
footer,
|
|
@@ -91,7 +82,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
|
91
82
|
contentStackDirection,
|
|
92
83
|
fullBleedContentPosition,
|
|
93
84
|
fullBleedContentProps
|
|
94
|
-
} =
|
|
85
|
+
} = useFullBleedContentProps(fullBleedContent);
|
|
95
86
|
const {
|
|
96
87
|
imgCol
|
|
97
88
|
} = fullBleedContentProps;
|
|
@@ -100,18 +91,18 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
|
100
91
|
// those corners on the image as well, but partially
|
|
101
92
|
const {
|
|
102
93
|
borderRadius
|
|
103
|
-
} =
|
|
104
|
-
const getThemeTokens =
|
|
94
|
+
} = useThemeTokens('Card', tokens, variant);
|
|
95
|
+
const getThemeTokens = useThemeTokensCallback('Card', interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.tokens, {
|
|
105
96
|
interactive: true,
|
|
106
97
|
...((interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.variant) || {})
|
|
107
98
|
});
|
|
108
99
|
const hasFooter = Boolean(footer);
|
|
109
|
-
const fullBleedBorderRadius =
|
|
100
|
+
const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter);
|
|
110
101
|
|
|
111
102
|
// takes imgCol from fullBleedContent if present, to dynamically set width of image
|
|
112
103
|
// card content will adapt to the size of image to add up to 100% width of card width
|
|
113
104
|
// pass as props to ConditionalWrapper
|
|
114
|
-
const imgColCurrentViewport =
|
|
105
|
+
const imgColCurrentViewport = useResponsiveProp(imgCol);
|
|
115
106
|
const maxCol = 12;
|
|
116
107
|
const fullBleedImageWidth = `${imgColCurrentViewport / maxCol * 100}%`;
|
|
117
108
|
const adaptiveContentWidth = `${(maxCol - imgColCurrentViewport) / maxCol * 100}%`;
|
|
@@ -140,7 +131,7 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
|
140
131
|
paddingRight,
|
|
141
132
|
...restOfTokens
|
|
142
133
|
} = tokens;
|
|
143
|
-
return /*#__PURE__*/(
|
|
134
|
+
return /*#__PURE__*/_jsxs(CardBase, {
|
|
144
135
|
ref: ref,
|
|
145
136
|
variant: {
|
|
146
137
|
...variant,
|
|
@@ -149,41 +140,41 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
|
149
140
|
tokens: restOfTokens,
|
|
150
141
|
backgroundImage: backgroundImage,
|
|
151
142
|
...selectProps(rest),
|
|
152
|
-
children: [interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? /*#__PURE__*/(
|
|
143
|
+
children: [interactiveCard !== null && interactiveCard !== void 0 && interactiveCard.body ? /*#__PURE__*/_jsx(PressableCardBase, {
|
|
153
144
|
ref: ref,
|
|
154
145
|
tokens: getThemeTokens,
|
|
155
146
|
dataSet: dataSet,
|
|
156
147
|
onPress: onPress,
|
|
157
148
|
...selectProps(rest),
|
|
158
149
|
children: typeof (interactiveCard === null || interactiveCard === void 0 ? void 0 : interactiveCard.body) === 'function' ? interactiveCard.body() : interactiveCard.body
|
|
159
|
-
}) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/(
|
|
150
|
+
}) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
|
|
160
151
|
direction: contentStackDirection,
|
|
161
152
|
tokens: {
|
|
162
153
|
...columnFlex,
|
|
163
154
|
alignItems: contentStackAlign
|
|
164
155
|
},
|
|
165
156
|
space: 0,
|
|
166
|
-
children: [children ? /*#__PURE__*/(
|
|
157
|
+
children: [children ? /*#__PURE__*/_jsx(ConditionalWrapper, {
|
|
167
158
|
WrapperComponent: DynamicWidthContainer,
|
|
168
159
|
wrapperProps: contentWrapperStyleProps,
|
|
169
160
|
condition: isImageWidthAdjustable,
|
|
170
|
-
children: /*#__PURE__*/(
|
|
161
|
+
children: /*#__PURE__*/_jsx(CardContent, {
|
|
171
162
|
tokens: tokens,
|
|
172
163
|
variant: variant,
|
|
173
164
|
withFooter: hasFooter,
|
|
174
165
|
children: children
|
|
175
166
|
})
|
|
176
|
-
}) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/(
|
|
167
|
+
}) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/_jsx(ConditionalWrapper, {
|
|
177
168
|
WrapperComponent: DynamicWidthContainer,
|
|
178
169
|
wrapperProps: imageWrapperStyleProps,
|
|
179
170
|
condition: isImageWidthAdjustable,
|
|
180
|
-
children: /*#__PURE__*/(
|
|
171
|
+
children: /*#__PURE__*/_jsx(FullBleedContent, {
|
|
181
172
|
borderRadius: fullBleedBorderRadius,
|
|
182
173
|
...fullBleedContentProps,
|
|
183
174
|
position: fullBleedContentPosition
|
|
184
175
|
})
|
|
185
176
|
})]
|
|
186
|
-
}) : null, footer && /*#__PURE__*/(
|
|
177
|
+
}) : null, footer && /*#__PURE__*/_jsx(CardFooter, {
|
|
187
178
|
padding: footerPadding,
|
|
188
179
|
tokens: tokens,
|
|
189
180
|
variant: variant,
|
|
@@ -193,11 +184,11 @@ const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
|
193
184
|
});
|
|
194
185
|
const positionValues = ['none', 'bottom', 'left', 'right', 'top'];
|
|
195
186
|
const alignValues = ['start', 'end', 'center', 'stretch'];
|
|
196
|
-
const PositionedFullBleedContentPropType =
|
|
197
|
-
position:
|
|
198
|
-
align:
|
|
187
|
+
const PositionedFullBleedContentPropType = PropTypes.shape({
|
|
188
|
+
position: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(positionValues)).isRequired,
|
|
189
|
+
align: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(alignValues)),
|
|
199
190
|
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
200
|
-
...
|
|
191
|
+
...FullBleedContent.propTypes
|
|
201
192
|
});
|
|
202
193
|
Card.displayName = 'Card';
|
|
203
194
|
Card.propTypes = {
|
|
@@ -205,15 +196,15 @@ Card.propTypes = {
|
|
|
205
196
|
/**
|
|
206
197
|
* Card content.
|
|
207
198
|
*/
|
|
208
|
-
children:
|
|
199
|
+
children: PropTypes.node,
|
|
209
200
|
/**
|
|
210
201
|
* Card footer.
|
|
211
202
|
*/
|
|
212
|
-
footer:
|
|
203
|
+
footer: PropTypes.node,
|
|
213
204
|
/**
|
|
214
205
|
* Custom card footer padding.
|
|
215
206
|
*/
|
|
216
|
-
footerPadding:
|
|
207
|
+
footerPadding: paddingProp.propType,
|
|
217
208
|
/**
|
|
218
209
|
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
219
210
|
*
|
|
@@ -227,33 +218,32 @@ Card.propTypes = {
|
|
|
227
218
|
/**
|
|
228
219
|
* Card tokens.
|
|
229
220
|
*/
|
|
230
|
-
tokens:
|
|
221
|
+
tokens: getTokensPropType('Card'),
|
|
231
222
|
/**
|
|
232
223
|
* Card variant.
|
|
233
224
|
*/
|
|
234
|
-
variant:
|
|
225
|
+
variant: variantProp.propType,
|
|
235
226
|
/**
|
|
236
227
|
* Function to call on pressing the card.
|
|
237
228
|
* Note: This is only available when `interactive` variant is used.
|
|
238
229
|
*/
|
|
239
|
-
onPress:
|
|
230
|
+
onPress: PropTypes.func,
|
|
240
231
|
/**
|
|
241
232
|
* Object to set interactive card's properties
|
|
242
233
|
*/
|
|
243
|
-
interactiveCard:
|
|
244
|
-
body:
|
|
245
|
-
tokens:
|
|
246
|
-
variant:
|
|
234
|
+
interactiveCard: PropTypes.shape({
|
|
235
|
+
body: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
|
|
236
|
+
tokens: getTokensPropType('Card'),
|
|
237
|
+
variant: variantProp.propType
|
|
247
238
|
}),
|
|
248
239
|
/**
|
|
249
240
|
* Apply background image to the card.
|
|
250
241
|
*/
|
|
251
|
-
backgroundImage:
|
|
242
|
+
backgroundImage: PropTypes.shape({
|
|
252
243
|
// src is either a URI string or an object when used responsively to provide different image sources for different screen sizes
|
|
253
|
-
src:
|
|
254
|
-
alt:
|
|
255
|
-
resizeMode:
|
|
244
|
+
src: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
|
245
|
+
alt: PropTypes.string,
|
|
246
|
+
resizeMode: responsiveProps.getTypeOptionallyByViewport(PropTypes.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']))
|
|
256
247
|
})
|
|
257
248
|
};
|
|
258
|
-
|
|
259
|
-
exports.default = _default;
|
|
249
|
+
export default Card;
|
package/lib/Card/CardContent.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _utils = require("../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
-
const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { getTokensPropType, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
+
const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16
9
|
displayName: "CardContent__CardContentContainer",
|
|
17
10
|
componentId: "components-web__sc-1k2501q-0"
|
|
18
11
|
})(_ref => {
|
|
@@ -52,7 +45,7 @@ const CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
52
45
|
/**
|
|
53
46
|
* Card content, applying the card tokens as per the theme used.
|
|
54
47
|
*/
|
|
55
|
-
const CardContent = /*#__PURE__*/
|
|
48
|
+
const CardContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
56
49
|
let {
|
|
57
50
|
children,
|
|
58
51
|
flexContent,
|
|
@@ -61,11 +54,11 @@ const CardContent = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
|
61
54
|
withFooter = false,
|
|
62
55
|
...rest
|
|
63
56
|
} = _ref2;
|
|
64
|
-
const viewport =
|
|
65
|
-
const themeTokens =
|
|
57
|
+
const viewport = useViewport();
|
|
58
|
+
const themeTokens = useThemeTokens('Card', tokens, variant, {
|
|
66
59
|
viewport
|
|
67
60
|
});
|
|
68
|
-
return /*#__PURE__*/(
|
|
61
|
+
return /*#__PURE__*/_jsx(CardContentContainer, {
|
|
69
62
|
...themeTokens,
|
|
70
63
|
flexContent: flexContent,
|
|
71
64
|
withFooter: withFooter,
|
|
@@ -80,19 +73,18 @@ CardContent.propTypes = {
|
|
|
80
73
|
/**
|
|
81
74
|
* Card section content.
|
|
82
75
|
*/
|
|
83
|
-
children:
|
|
76
|
+
children: PropTypes.node,
|
|
84
77
|
/**
|
|
85
78
|
* Card tokens.
|
|
86
79
|
*/
|
|
87
|
-
tokens:
|
|
80
|
+
tokens: getTokensPropType('Card'),
|
|
88
81
|
/**
|
|
89
82
|
* Card variant.
|
|
90
83
|
*/
|
|
91
|
-
variant:
|
|
84
|
+
variant: variantProp.propType,
|
|
92
85
|
/**
|
|
93
86
|
* Whether the card has a footer.
|
|
94
87
|
*/
|
|
95
|
-
withFooter:
|
|
88
|
+
withFooter: PropTypes.bool
|
|
96
89
|
};
|
|
97
|
-
|
|
98
|
-
exports.default = _default;
|
|
90
|
+
export default CardContent;
|
package/lib/Card/CardFooter.js
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
-
var _utils = require("../utils");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
-
const CardFooterContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { getTokensPropType, paddingProp, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
+
const CardFooterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
16
9
|
displayName: "CardFooter__CardFooterContainer",
|
|
17
10
|
componentId: "components-web__sc-pm6vns-0"
|
|
18
11
|
})(_ref => {
|
|
@@ -49,14 +42,14 @@ const CardFooter = _ref2 => {
|
|
|
49
42
|
variant,
|
|
50
43
|
...rest
|
|
51
44
|
} = _ref2;
|
|
52
|
-
const viewport =
|
|
53
|
-
const themeTokens =
|
|
45
|
+
const viewport = useViewport();
|
|
46
|
+
const themeTokens = useThemeTokens('Card', tokens, {
|
|
54
47
|
...variant,
|
|
55
48
|
background: 'alternative'
|
|
56
49
|
}, {
|
|
57
50
|
viewport
|
|
58
51
|
});
|
|
59
|
-
return /*#__PURE__*/(
|
|
52
|
+
return /*#__PURE__*/_jsx(CardFooterContainer, {
|
|
60
53
|
...themeTokens,
|
|
61
54
|
...padding,
|
|
62
55
|
...selectProps(rest),
|
|
@@ -68,19 +61,18 @@ CardFooter.propTypes = {
|
|
|
68
61
|
/**
|
|
69
62
|
* Card footer content.
|
|
70
63
|
*/
|
|
71
|
-
children:
|
|
64
|
+
children: PropTypes.node,
|
|
72
65
|
/**
|
|
73
66
|
* Card footer padding.
|
|
74
67
|
*/
|
|
75
|
-
padding:
|
|
68
|
+
padding: paddingProp.propType,
|
|
76
69
|
/**
|
|
77
70
|
* Card tokens.
|
|
78
71
|
*/
|
|
79
|
-
tokens:
|
|
72
|
+
tokens: getTokensPropType('Card'),
|
|
80
73
|
/**
|
|
81
74
|
* Card variant.
|
|
82
75
|
*/
|
|
83
|
-
variant:
|
|
76
|
+
variant: variantProp.propType
|
|
84
77
|
};
|
|
85
|
-
|
|
86
|
-
exports.default = _default;
|
|
78
|
+
export default CardFooter;
|
package/lib/Card/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _Card = _interopRequireDefault(require("./Card"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _Card.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import Card from './Card';
|
|
2
|
+
export default Card;
|