@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,45 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import ItemBase from './ItemBase';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const StyledList = /*#__PURE__*/styled.ol.withConfig({
|
|
7
|
-
displayName: "OrderedListBase__StyledList",
|
|
8
|
-
componentId: "components-web__sc-4m9lgj-0"
|
|
9
|
-
})({
|
|
10
|
-
display: 'flex',
|
|
11
|
-
flexDirection: 'column',
|
|
12
|
-
listStylePosition: 'inside',
|
|
13
|
-
margin: 0,
|
|
14
|
-
padding: 0
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Semantic ordered list.
|
|
19
|
-
*/
|
|
20
|
-
const OrderedListBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
21
|
-
let {
|
|
22
|
-
children,
|
|
23
|
-
start = 1,
|
|
24
|
-
...rest
|
|
25
|
-
} = _ref;
|
|
26
|
-
return /*#__PURE__*/_jsx(StyledList, {
|
|
27
|
-
...rest,
|
|
28
|
-
ref: ref,
|
|
29
|
-
start: start,
|
|
30
|
-
children: children
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
OrderedListBase.displayName = 'OrderedList';
|
|
34
|
-
OrderedListBase.propTypes = {
|
|
35
|
-
/**
|
|
36
|
-
* A list of ordered items wrapped in `OrderedListBase.Item`.
|
|
37
|
-
*/
|
|
38
|
-
children: PropTypes.node.isRequired,
|
|
39
|
-
/**
|
|
40
|
-
* The position to start the list with.
|
|
41
|
-
*/
|
|
42
|
-
start: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
43
|
-
};
|
|
44
|
-
OrderedListBase.Item = ItemBase;
|
|
45
|
-
export default OrderedListBase;
|
|
@@ -1,90 +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 StyledParagraph = /*#__PURE__*/styled.p.withConfig({
|
|
9
|
-
displayName: "Paragraph__StyledParagraph",
|
|
10
|
-
componentId: "components-web__sc-1bg9r8p-0"
|
|
11
|
-
})(["", " ", " &:first-child{margin-block-start:0em;}&:last-child{margin-block-end:0em;}"], _ref => {
|
|
12
|
-
let {
|
|
13
|
-
align
|
|
14
|
-
} = _ref;
|
|
15
|
-
return align ? `text-align: ${align};` : '';
|
|
16
|
-
}, _ref2 => {
|
|
17
|
-
let {
|
|
18
|
-
linesBetween
|
|
19
|
-
} = _ref2;
|
|
20
|
-
return `
|
|
21
|
-
margin-block-start: ${linesBetween}em;
|
|
22
|
-
margin-block-end: ${linesBetween}em;
|
|
23
|
-
`;
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Block text as an HTML ```<p>``` element.
|
|
28
|
-
*
|
|
29
|
-
* ##Usage criteria
|
|
30
|
-
*
|
|
31
|
-
* - All body text should be contained in a **Paragraph**, regardless of length.
|
|
32
|
-
* - If the Paragraph is on a dark background, variant **{ invert: true }** must be used to maintain sufficient colour
|
|
33
|
-
contrast.
|
|
34
|
-
* - All Allium Typography variants other than header size variants are supported.
|
|
35
|
-
*/
|
|
36
|
-
const Paragraph = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
37
|
-
let {
|
|
38
|
-
children,
|
|
39
|
-
variant,
|
|
40
|
-
tokens,
|
|
41
|
-
testID,
|
|
42
|
-
align,
|
|
43
|
-
linesBetween = 1,
|
|
44
|
-
...rest
|
|
45
|
-
} = _ref3;
|
|
46
|
-
const style = useTypographyTheme(variant, tokens);
|
|
47
|
-
return /*#__PURE__*/_jsx(StyledParagraph, {
|
|
48
|
-
ref: ref,
|
|
49
|
-
linesBetween: linesBetween,
|
|
50
|
-
"data-testid": testID,
|
|
51
|
-
align: align,
|
|
52
|
-
style: style,
|
|
53
|
-
...selectProps(rest),
|
|
54
|
-
children: children
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
Paragraph.displayName = 'Paragraph';
|
|
58
|
-
Paragraph.propTypes = {
|
|
59
|
-
...selectedSystemPropTypes,
|
|
60
|
-
children: PropTypes.node.isRequired,
|
|
61
|
-
/**
|
|
62
|
-
* Adds a `data-testid` attribute to the element for testing purposes
|
|
63
|
-
*/
|
|
64
|
-
testID: PropTypes.string,
|
|
65
|
-
/**
|
|
66
|
-
* Sets the alignment style for the paragraph. Same options as Typography's `align` prop.
|
|
67
|
-
* 'justify' should be avoided as it usually reduces ease of reading.
|
|
68
|
-
*/
|
|
69
|
-
align: PropTypes.oneOf(['auto', 'left', 'right', 'center', 'justify']),
|
|
70
|
-
/**
|
|
71
|
-
* How much space between consecutive paragraphs, or between a paragraph and its siblings, in CSS
|
|
72
|
-
* `em` units: 1 gives space equal to one line of paragraph text, 0.5 would be half a line, etc.
|
|
73
|
-
* @default 1
|
|
74
|
-
*/
|
|
75
|
-
linesBetween: PropTypes.number,
|
|
76
|
-
/**
|
|
77
|
-
* Paragraph takes the same tokens overrides as Typography
|
|
78
|
-
*/
|
|
79
|
-
tokens: getTokensPropType('Typography'),
|
|
80
|
-
/**
|
|
81
|
-
* Paragraph takes any of Typography's theme variants except for header sizes
|
|
82
|
-
*/
|
|
83
|
-
variant: PropTypes.exact({
|
|
84
|
-
bold: PropTypes.bool,
|
|
85
|
-
colour: PropTypes.oneOf(['secondary', 'tertiary']),
|
|
86
|
-
inverse: PropTypes.bool,
|
|
87
|
-
size: PropTypes.oneOf(['micro', 'small', 'large'])
|
|
88
|
-
})
|
|
89
|
-
};
|
|
90
|
-
export default Paragraph;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { StackWrap, Typography, useThemeTokens } from '@telus-uds/components-base';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* A footer for PreviewCard that composes author and date in a standard way
|
|
7
|
-
*
|
|
8
|
-
* @TODO
|
|
9
|
-
* Add same locale-based date formatting as StoryCard when ready.
|
|
10
|
-
* Get locale based on decision of https://github.com/telus/universal-design-system/issues/715
|
|
11
|
-
*/
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const AuthorDate = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
author,
|
|
17
|
-
date
|
|
18
|
-
} = _ref;
|
|
19
|
-
const {
|
|
20
|
-
separatorColor: color
|
|
21
|
-
} = useThemeTokens('PreviewCard', {}, {});
|
|
22
|
-
return /*#__PURE__*/_jsxs(StackWrap, {
|
|
23
|
-
space: 2,
|
|
24
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
25
|
-
variant: {
|
|
26
|
-
size: 'small',
|
|
27
|
-
colour: 'secondary'
|
|
28
|
-
},
|
|
29
|
-
children: author
|
|
30
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
31
|
-
variant: {
|
|
32
|
-
size: 'small'
|
|
33
|
-
},
|
|
34
|
-
tokens: {
|
|
35
|
-
color
|
|
36
|
-
},
|
|
37
|
-
children: "\xB7"
|
|
38
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
39
|
-
variant: {
|
|
40
|
-
size: 'small',
|
|
41
|
-
colour: 'secondary'
|
|
42
|
-
},
|
|
43
|
-
children: date
|
|
44
|
-
})]
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
AuthorDate.propTypes = {
|
|
48
|
-
/**
|
|
49
|
-
* Name of the author
|
|
50
|
-
*/
|
|
51
|
-
author: PropTypes.string.isRequired,
|
|
52
|
-
/**
|
|
53
|
-
* Date of the post
|
|
54
|
-
*/
|
|
55
|
-
date: PropTypes.string.isRequired
|
|
56
|
-
};
|
|
57
|
-
export default AuthorDate;
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import omit from 'lodash.omit';
|
|
4
|
-
import { Box, getThemeTokens, hrefAttrsProp, PressableCardBase, selectSystemProps, Spacer, StackView, Typography, a11yProps, focusHandlerProps, viewProps, withLinkRouter, useTheme, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
7
|
-
import AuthorDate from './AuthorDate';
|
|
8
|
-
|
|
9
|
-
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
|
|
14
|
-
|
|
15
|
-
// Stop changes to the card's inner border width causing the size and
|
|
16
|
-
// apparent position of the full bleed image to change.
|
|
17
|
-
const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
|
|
18
|
-
displayName: "PreviewCard__FullBleedOffsetOuter",
|
|
19
|
-
componentId: "components-web__sc-1yfz4de-0"
|
|
20
|
-
})(_ref => {
|
|
21
|
-
let {
|
|
22
|
-
borderOffset
|
|
23
|
-
} = _ref;
|
|
24
|
-
return {
|
|
25
|
-
overflow: 'hidden',
|
|
26
|
-
marginTop: borderOffset * 2
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
const FullBleedOffsetInner = /*#__PURE__*/styled.div.withConfig({
|
|
30
|
-
displayName: "PreviewCard__FullBleedOffsetInner",
|
|
31
|
-
componentId: "components-web__sc-1yfz4de-1"
|
|
32
|
-
})(_ref2 => {
|
|
33
|
-
let {
|
|
34
|
-
borderOffset
|
|
35
|
-
} = _ref2;
|
|
36
|
-
return {
|
|
37
|
-
position: 'relative',
|
|
38
|
-
margin: 0 - borderOffset
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
const defaultTokens = {
|
|
42
|
-
minWidth: 0,
|
|
43
|
-
shadow: null,
|
|
44
|
-
contentAlignItems: 'stretch',
|
|
45
|
-
contentJustifyContent: 'flex-start',
|
|
46
|
-
contentFlexGrow: 0,
|
|
47
|
-
contentFlexShrink: 0
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Showcase and guide users to another page, with a preview containing title and a footer.
|
|
52
|
-
* Whole card is interactive, width expands based on column or container.
|
|
53
|
-
*
|
|
54
|
-
* - Use `tag` to show category of content
|
|
55
|
-
* - Use `title` to show title of the story
|
|
56
|
-
* - Use `footer` to show text such as the author / date
|
|
57
|
-
* - Use `href` to set the target URL
|
|
58
|
-
* - Use `fullBleedContent` to set the thumbnail image
|
|
59
|
-
*/
|
|
60
|
-
const PreviewCard = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
61
|
-
let {
|
|
62
|
-
tag,
|
|
63
|
-
title,
|
|
64
|
-
footer,
|
|
65
|
-
fullBleedImage,
|
|
66
|
-
fullBleedContent = fullBleedImage,
|
|
67
|
-
onPress,
|
|
68
|
-
href,
|
|
69
|
-
...rest
|
|
70
|
-
} = _ref3;
|
|
71
|
-
const {
|
|
72
|
-
fullBleedContentPosition,
|
|
73
|
-
contentStackDirection,
|
|
74
|
-
fullBleedContentProps
|
|
75
|
-
} = useFullBleedContentProps({
|
|
76
|
-
...fullBleedContent,
|
|
77
|
-
position: 'bottom'
|
|
78
|
-
});
|
|
79
|
-
const {
|
|
80
|
-
components: {
|
|
81
|
-
PreviewCard: theme
|
|
82
|
-
}
|
|
83
|
-
} = useTheme();
|
|
84
|
-
const getPressableCardTokens = cardState => ({
|
|
85
|
-
...omit(getThemeTokens(theme, {}, {}, cardState), 'separatorColor'),
|
|
86
|
-
...defaultTokens
|
|
87
|
-
});
|
|
88
|
-
const {
|
|
89
|
-
hrefAttrs,
|
|
90
|
-
rest: unusedRest
|
|
91
|
-
} = hrefAttrsProp.bundle(rest);
|
|
92
|
-
return /*#__PURE__*/_jsx(PressableCardBase, {
|
|
93
|
-
onPress: onPress,
|
|
94
|
-
href: href,
|
|
95
|
-
hrefAttrs: hrefAttrs,
|
|
96
|
-
tokens: getPressableCardTokens,
|
|
97
|
-
ref: ref,
|
|
98
|
-
...selectProps(unusedRest),
|
|
99
|
-
children: cardState => {
|
|
100
|
-
const {
|
|
101
|
-
borderRadius,
|
|
102
|
-
borderWidth
|
|
103
|
-
} = getPressableCardTokens(cardState);
|
|
104
|
-
// Stop content jumping around as border size changes
|
|
105
|
-
const borderOffset = borderWidth - theme.tokens.borderWidth;
|
|
106
|
-
const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius + borderOffset, fullBleedContentPosition);
|
|
107
|
-
return /*#__PURE__*/_jsxs(StackView, {
|
|
108
|
-
direction: contentStackDirection,
|
|
109
|
-
tokens: {
|
|
110
|
-
justifyContent: 'space-between',
|
|
111
|
-
flexGrow: 1
|
|
112
|
-
},
|
|
113
|
-
children: [/*#__PURE__*/_jsxs(Box, {
|
|
114
|
-
horizontal: {
|
|
115
|
-
xs: 4,
|
|
116
|
-
lg: 5,
|
|
117
|
-
options: {
|
|
118
|
-
subtract: borderOffset
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
vertical: {
|
|
122
|
-
xs: 5,
|
|
123
|
-
lg: 7,
|
|
124
|
-
options: {
|
|
125
|
-
subtract: borderOffset
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
children: [Boolean(tag) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
129
|
-
children: [/*#__PURE__*/_jsx(Typography, {
|
|
130
|
-
variant: {
|
|
131
|
-
size: 'eyebrow'
|
|
132
|
-
},
|
|
133
|
-
children: tag
|
|
134
|
-
}), /*#__PURE__*/_jsx(Spacer, {
|
|
135
|
-
space: 2
|
|
136
|
-
})]
|
|
137
|
-
}), /*#__PURE__*/_jsx(Typography, {
|
|
138
|
-
variant: {
|
|
139
|
-
size: 'h4'
|
|
140
|
-
},
|
|
141
|
-
children: title
|
|
142
|
-
}), Boolean(footer) && /*#__PURE__*/_jsxs(_Fragment, {
|
|
143
|
-
children: [/*#__PURE__*/_jsx(Spacer, {
|
|
144
|
-
space: 2
|
|
145
|
-
}), typeof footer === 'string' ? /*#__PURE__*/_jsx(Typography, {
|
|
146
|
-
variant: {
|
|
147
|
-
size: 'small'
|
|
148
|
-
},
|
|
149
|
-
children: footer
|
|
150
|
-
}) : footer]
|
|
151
|
-
})]
|
|
152
|
-
}), Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && /*#__PURE__*/_jsx(FullBleedOffsetOuter, {
|
|
153
|
-
borderOffset: borderOffset,
|
|
154
|
-
children: /*#__PURE__*/_jsx(FullBleedOffsetInner, {
|
|
155
|
-
borderOffset: borderOffset,
|
|
156
|
-
children: /*#__PURE__*/_jsx(FullBleedContent, {
|
|
157
|
-
borderRadius: fullBleedBorderRadius,
|
|
158
|
-
...fullBleedContentProps
|
|
159
|
-
})
|
|
160
|
-
})
|
|
161
|
-
})]
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
PreviewCard.displayName = 'PreviewCard';
|
|
167
|
-
|
|
168
|
-
// Provide standard author/date footer as a preset with the export
|
|
169
|
-
PreviewCard.AuthorDate = AuthorDate;
|
|
170
|
-
PreviewCard.propTypes = {
|
|
171
|
-
...selectedSystemPropTypes,
|
|
172
|
-
tokens: getTokensPropType('PreviewCard'),
|
|
173
|
-
/**
|
|
174
|
-
* The URL of the story to be navigated to. Note that `Video` component does not play well when used within
|
|
175
|
-
* a `PreviewCard` with `href` prop set (the volume and progress sliders can be clicked but are not draggable).
|
|
176
|
-
* Please use `onPress` prop instead `href` to organize navigation in cases like this.
|
|
177
|
-
*
|
|
178
|
-
* @see https://github.com/telus/allium-design-system/issues/6
|
|
179
|
-
*/
|
|
180
|
-
href: PropTypes.string,
|
|
181
|
-
/**
|
|
182
|
-
* Optional function to be called on press e.g. for within-page navigation.
|
|
183
|
-
*/
|
|
184
|
-
onPress: PropTypes.func,
|
|
185
|
-
/**
|
|
186
|
-
* Text stating the category of the content.
|
|
187
|
-
*/
|
|
188
|
-
tag: PropTypes.string,
|
|
189
|
-
/**
|
|
190
|
-
* Section containing additional information, such as author and date.
|
|
191
|
-
* Use `<PreviewCard.AuthorDate author={...} date={...} />` here for author and date.
|
|
192
|
-
*/
|
|
193
|
-
footer: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
194
|
-
/**
|
|
195
|
-
* Text stating the title or headline of the story.
|
|
196
|
-
*/
|
|
197
|
-
title: PropTypes.string.isRequired,
|
|
198
|
-
/**
|
|
199
|
-
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
200
|
-
*
|
|
201
|
-
* @deprecated
|
|
202
|
-
*/
|
|
203
|
-
fullBleedImage: PropTypes.exact(FullBleedContent.propTypes || {}),
|
|
204
|
-
/**
|
|
205
|
-
* Full bleed content to be placed on the card.
|
|
206
|
-
*/
|
|
207
|
-
fullBleedContent: PropTypes.exact(FullBleedContent.propTypes || {})
|
|
208
|
-
};
|
|
209
|
-
export default withLinkRouter(PreviewCard);
|