@telus-uds/components-web 2.44.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 +13 -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,15 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _Dimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Dimensions"));
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
10
2
|
// TODO: add react-native as a peer dep and support native apps too.
|
|
11
3
|
// That requires some fiddling with Allium repo storybook config, babel, etc,
|
|
12
4
|
// unless ADS gets merged back into UDS monorepo.
|
|
5
|
+
import Dimensions from "react-native-web/dist/exports/Dimensions";
|
|
13
6
|
const adjustHorizontalToFit = (initialOffset, windowWidth, sourceWidth) => {
|
|
14
7
|
const offset = Math.max(0, initialOffset);
|
|
15
8
|
const otherEdgeOverflow = Math.max(0, offset + sourceWidth - windowWidth);
|
|
@@ -132,14 +125,14 @@ const useOverlaidPosition = _ref3 => {
|
|
|
132
125
|
}
|
|
133
126
|
} = _ref3;
|
|
134
127
|
// Element in main document flow that the targetRef element is positioned around
|
|
135
|
-
const sourceRef =
|
|
136
|
-
const [sourceLayout, setSourceLayout] =
|
|
128
|
+
const sourceRef = useRef(null);
|
|
129
|
+
const [sourceLayout, setSourceLayout] = useState(null);
|
|
137
130
|
|
|
138
131
|
// Element in a modal or portal overlay positioned to appear adjacent to sourceRef
|
|
139
|
-
const targetRef =
|
|
140
|
-
const [targetDimensions, setTargetDimensions] =
|
|
141
|
-
const [windowDimensions, setWindowDimensions] =
|
|
142
|
-
const onTargetLayout =
|
|
132
|
+
const targetRef = useRef(null);
|
|
133
|
+
const [targetDimensions, setTargetDimensions] = useState(null);
|
|
134
|
+
const [windowDimensions, setWindowDimensions] = useState(null);
|
|
135
|
+
const onTargetLayout = useCallback(_ref4 => {
|
|
143
136
|
let {
|
|
144
137
|
nativeEvent: {
|
|
145
138
|
layout: {
|
|
@@ -164,13 +157,13 @@ const useOverlaidPosition = _ref3 => {
|
|
|
164
157
|
});
|
|
165
158
|
}, []);
|
|
166
159
|
const readyToShow = Boolean(isShown && sourceRef.current);
|
|
167
|
-
|
|
160
|
+
useEffect(() => {
|
|
168
161
|
const handleDimensionsChange = _ref5 => {
|
|
169
162
|
var _sourceRef$current;
|
|
170
163
|
let {
|
|
171
164
|
window
|
|
172
165
|
} = _ref5;
|
|
173
|
-
(_sourceRef$current = sourceRef.current) === null || _sourceRef$current === void 0
|
|
166
|
+
(_sourceRef$current = sourceRef.current) === null || _sourceRef$current === void 0 || _sourceRef$current.measureInWindow((x, y, width, height) => {
|
|
174
167
|
// Could add a debouncer here if there's too many rerenders during gradual resizes
|
|
175
168
|
setWindowDimensions(window);
|
|
176
169
|
setSourceLayout({
|
|
@@ -187,17 +180,17 @@ const useOverlaidPosition = _ref3 => {
|
|
|
187
180
|
if (typeof ((_subscription = subscription) === null || _subscription === void 0 ? void 0 : _subscription.remove) === 'function') {
|
|
188
181
|
// React Native >=0.65.0
|
|
189
182
|
subscription.remove();
|
|
190
|
-
} else if (typeof
|
|
183
|
+
} else if (typeof Dimensions.remove === 'function') {
|
|
191
184
|
// React Native <0.65.0
|
|
192
|
-
|
|
185
|
+
Dimensions.remove('change', handleDimensionsChange);
|
|
193
186
|
}
|
|
194
187
|
setSourceLayout(null);
|
|
195
188
|
setTargetDimensions(null);
|
|
196
189
|
};
|
|
197
190
|
if (readyToShow) {
|
|
198
|
-
subscription =
|
|
191
|
+
subscription = Dimensions.addEventListener('change', handleDimensionsChange);
|
|
199
192
|
handleDimensionsChange({
|
|
200
|
-
window:
|
|
193
|
+
window: Dimensions.get('window')
|
|
201
194
|
});
|
|
202
195
|
} else {
|
|
203
196
|
unsubscribe();
|
|
@@ -220,5 +213,4 @@ const useOverlaidPosition = _ref3 => {
|
|
|
220
213
|
isReady
|
|
221
214
|
};
|
|
222
215
|
};
|
|
223
|
-
|
|
224
|
-
exports.default = _default;
|
|
216
|
+
export default useOverlaidPosition;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
1
|
+
import { applyTextStyles, useTheme, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
8
2
|
const useTypographyTheme = (variant, tokens) => {
|
|
9
|
-
const viewport =
|
|
10
|
-
const themeTokens =
|
|
3
|
+
const viewport = useViewport();
|
|
4
|
+
const themeTokens = useThemeTokens('Typography', tokens, variant, {
|
|
11
5
|
viewport
|
|
12
6
|
});
|
|
13
7
|
const {
|
|
14
8
|
themeOptions
|
|
15
|
-
} =
|
|
9
|
+
} = useTheme();
|
|
16
10
|
const {
|
|
17
11
|
fontSize,
|
|
18
12
|
lineHeight,
|
|
19
13
|
...rnStyles
|
|
20
|
-
} =
|
|
14
|
+
} = applyTextStyles({
|
|
21
15
|
...themeTokens,
|
|
22
16
|
themeOptions
|
|
23
17
|
});
|
|
@@ -27,5 +21,4 @@ const useTypographyTheme = (variant, tokens) => {
|
|
|
27
21
|
lineHeight: `${lineHeight}px`
|
|
28
22
|
};
|
|
29
23
|
};
|
|
30
|
-
|
|
31
|
-
exports.default = _default;
|
|
24
|
+
export default useTypographyTheme;
|
package/package.json
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "TELUS Digital",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"browserslist": [
|
|
4
5
|
"extends @telus-uds/browserslist-config"
|
|
5
6
|
],
|
|
6
7
|
"dependencies": {
|
|
7
8
|
"@gorhom/portal": "^1.0.14",
|
|
8
|
-
"@telus-uds/components-base": "1.97.
|
|
9
|
-
"@telus-uds/system-constants": "^
|
|
9
|
+
"@telus-uds/components-base": "1.97.1",
|
|
10
|
+
"@telus-uds/system-constants": "^2.0.0",
|
|
10
11
|
"fscreen": "^1.2.0",
|
|
11
12
|
"lodash.omit": "^4.5.0",
|
|
12
13
|
"moment": "2.29.4",
|
|
13
14
|
"react-dates": "^21.8.0",
|
|
14
15
|
"react-helmet-async": "^1.3.0",
|
|
15
16
|
"react-moment-proptypes": "^1.8.1",
|
|
16
|
-
"@telus-uds/system-theme-tokens": "^
|
|
17
|
+
"@telus-uds/system-theme-tokens": "^3.0.0",
|
|
17
18
|
"prop-types": "^15.7.2",
|
|
18
19
|
"lodash.throttle": "^4.1.1",
|
|
19
20
|
"react-youtube": "^10.1.0",
|
|
@@ -21,20 +22,20 @@
|
|
|
21
22
|
},
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
|
-
"import": "./lib
|
|
25
|
-
"
|
|
25
|
+
"import": "./lib/index.js",
|
|
26
|
+
"default": "./lib/index.js"
|
|
26
27
|
},
|
|
27
28
|
"./*": {
|
|
28
|
-
"import": "./lib
|
|
29
|
-
"
|
|
29
|
+
"import": "./lib/*/index.js",
|
|
30
|
+
"default": "./lib/index.js"
|
|
30
31
|
},
|
|
31
32
|
"./server": {
|
|
32
|
-
"import": "./lib
|
|
33
|
-
"
|
|
33
|
+
"import": "./lib/server.js",
|
|
34
|
+
"default": "./lib/server.js"
|
|
34
35
|
},
|
|
35
36
|
"./server/*": {
|
|
36
|
-
"import": "./lib
|
|
37
|
-
"
|
|
37
|
+
"import": "./lib/*/server.js",
|
|
38
|
+
"default": "./lib/*/server.js"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
"description": "UDS mult-brand web components",
|
|
@@ -56,12 +57,12 @@
|
|
|
56
57
|
"homepage": "https://github.com/telus/universal-design-system#readme",
|
|
57
58
|
"license": "MIT",
|
|
58
59
|
"main": "lib/index.js",
|
|
59
|
-
"module": "lib
|
|
60
|
+
"module": "lib/index.js",
|
|
60
61
|
"name": "@telus-uds/components-web",
|
|
61
62
|
"peerDependencies": {
|
|
62
|
-
"react": "^
|
|
63
|
-
"react-dom": "^
|
|
64
|
-
"react-native-web": "
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"react-native-web": "^0.19.10",
|
|
65
66
|
"styled-components": "^5.3.0"
|
|
66
67
|
},
|
|
67
68
|
"repository": {
|
|
@@ -69,10 +70,7 @@
|
|
|
69
70
|
"url": "git+https://github.com/telus/universal-design-system.git"
|
|
70
71
|
},
|
|
71
72
|
"scripts": {
|
|
72
|
-
"build": "
|
|
73
|
-
"build:main": "babel src -d lib",
|
|
74
|
-
"build:module": "babel src -d lib-module --env-name module",
|
|
75
|
-
"build:code": "npm run build:main && npm run build:module",
|
|
73
|
+
"build": "babel src -d lib --env-name module",
|
|
76
74
|
"format": "prettier --write .",
|
|
77
75
|
"lint": "telus-standard",
|
|
78
76
|
"lint:fix": "telus-standard --fix",
|
|
@@ -83,5 +81,5 @@
|
|
|
83
81
|
"skip": true
|
|
84
82
|
},
|
|
85
83
|
"types": "types/index.d.ts",
|
|
86
|
-
"version": "
|
|
84
|
+
"version": "3.0.0"
|
|
87
85
|
}
|
package/src/Card/Card.jsx
CHANGED
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
variantProp,
|
|
13
13
|
a11yProps,
|
|
14
14
|
viewProps,
|
|
15
|
-
PressableCardBase
|
|
15
|
+
PressableCardBase,
|
|
16
|
+
useResponsiveProp
|
|
16
17
|
} from '@telus-uds/components-base'
|
|
17
|
-
import { useResponsiveProp } from '@telus-uds/components-web'
|
|
18
18
|
import styled from 'styled-components'
|
|
19
19
|
import CardContent from './CardContent'
|
|
20
20
|
import CardFooter from './CardFooter'
|
|
@@ -3,8 +3,7 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
import momentPropTypes from 'react-moment-proptypes'
|
|
5
5
|
import 'react-dates/initialize'
|
|
6
|
-
import SingleDatePicker from 'react-dates
|
|
7
|
-
import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController'
|
|
6
|
+
import { SingleDatePicker, DayPickerSingleDateController } from 'react-dates'
|
|
8
7
|
import {
|
|
9
8
|
IconButton,
|
|
10
9
|
TextInput,
|
|
@@ -10,10 +10,10 @@ import { StackWrap, Typography, useThemeTokens } from '@telus-uds/components-bas
|
|
|
10
10
|
* Add same locale-based date formatting as StoryCard when ready.
|
|
11
11
|
* Get locale based on decision of https://github.com/telus/universal-design-system/issues/715
|
|
12
12
|
*/
|
|
13
|
-
const AuthorDate = ({ author, date }) => {
|
|
13
|
+
const AuthorDate = React.forwardRef(({ author, date }, ref) => {
|
|
14
14
|
const { separatorColor: color } = useThemeTokens('PreviewCard', {}, {})
|
|
15
15
|
return (
|
|
16
|
-
<StackWrap space={2}>
|
|
16
|
+
<StackWrap space={2} ref={ref}>
|
|
17
17
|
<Typography variant={{ size: 'small', colour: 'secondary' }}>{author}</Typography>
|
|
18
18
|
<Typography variant={{ size: 'small' }} tokens={{ color }}>
|
|
19
19
|
·
|
|
@@ -21,7 +21,9 @@ const AuthorDate = ({ author, date }) => {
|
|
|
21
21
|
<Typography variant={{ size: 'small', colour: 'secondary' }}>{date}</Typography>
|
|
22
22
|
</StackWrap>
|
|
23
23
|
)
|
|
24
|
-
}
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
AuthorDate.displayName = 'AuthorDate'
|
|
25
27
|
|
|
26
28
|
AuthorDate.propTypes = {
|
|
27
29
|
/**
|
package/src/utils/logger.js
CHANGED
|
@@ -3,7 +3,7 @@ export const deprecate = (componentName, message) => {
|
|
|
3
3
|
return
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
console.warn(`[Allium] [Deprecate] ${componentName}: ${message}`)
|
|
6
|
+
console.warn(`[Allium] [Deprecate] ${componentName}: ${message}`)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const warn = (componentName, message) => {
|
|
@@ -11,7 +11,7 @@ export const warn = (componentName, message) => {
|
|
|
11
11
|
return
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
console.warn(`[Allium] ${componentName}: ${message}`)
|
|
14
|
+
console.warn(`[Allium] ${componentName}: ${message}`)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export default {
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { selectSystemProps, Typography, getTokensPropType, useThemeTokens } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs, transformGradient } from '../utils';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const BadgeContainer = /*#__PURE__*/styled.div.withConfig({
|
|
9
|
-
displayName: "Badge__BadgeContainer",
|
|
10
|
-
componentId: "components-web__sc-tsiuo2-0"
|
|
11
|
-
})(["background:", ";border:", ";display:inline-flex;justify-content:center;padding:", ";border-radius:", ";width:fit-content;", ""], _ref => {
|
|
12
|
-
let {
|
|
13
|
-
background
|
|
14
|
-
} = _ref;
|
|
15
|
-
return background;
|
|
16
|
-
}, _ref2 => {
|
|
17
|
-
let {
|
|
18
|
-
border
|
|
19
|
-
} = _ref2;
|
|
20
|
-
return border;
|
|
21
|
-
}, _ref3 => {
|
|
22
|
-
let {
|
|
23
|
-
padding
|
|
24
|
-
} = _ref3;
|
|
25
|
-
return padding;
|
|
26
|
-
}, _ref4 => {
|
|
27
|
-
let {
|
|
28
|
-
radius
|
|
29
|
-
} = _ref4;
|
|
30
|
-
return radius;
|
|
31
|
-
}, _ref5 => {
|
|
32
|
-
let {
|
|
33
|
-
isOutlineOffer,
|
|
34
|
-
isAlternative,
|
|
35
|
-
gradient
|
|
36
|
-
} = _ref5;
|
|
37
|
-
return (isOutlineOffer || isAlternative) && `
|
|
38
|
-
> div {
|
|
39
|
-
background: ${gradient};
|
|
40
|
-
-webkit-background-clip: text;
|
|
41
|
-
${gradient && '-webkit-text-fill-color: transparent;'}
|
|
42
|
-
}`;
|
|
43
|
-
});
|
|
44
|
-
const fontSizeMapping = {
|
|
45
|
-
12: 'micro',
|
|
46
|
-
14: 'small',
|
|
47
|
-
16: 'h6'
|
|
48
|
-
};
|
|
49
|
-
const Badge = /*#__PURE__*/React.forwardRef((_ref6, ref) => {
|
|
50
|
-
let {
|
|
51
|
-
children,
|
|
52
|
-
tokens,
|
|
53
|
-
variant = {},
|
|
54
|
-
...rest
|
|
55
|
-
} = _ref6;
|
|
56
|
-
const {
|
|
57
|
-
backgroundColor,
|
|
58
|
-
gradient,
|
|
59
|
-
borderColor,
|
|
60
|
-
borderRadius,
|
|
61
|
-
borderWidth,
|
|
62
|
-
color,
|
|
63
|
-
paddingLeft,
|
|
64
|
-
paddingRight,
|
|
65
|
-
paddingTop,
|
|
66
|
-
paddingBottom,
|
|
67
|
-
fontName,
|
|
68
|
-
fontWeight,
|
|
69
|
-
fontSize
|
|
70
|
-
} = useThemeTokens('Badge', tokens, variant);
|
|
71
|
-
const semanticGradient = gradient && transformGradient(gradient);
|
|
72
|
-
const {
|
|
73
|
-
outline,
|
|
74
|
-
purpose,
|
|
75
|
-
alternative
|
|
76
|
-
} = variant;
|
|
77
|
-
let background = backgroundColor;
|
|
78
|
-
const isOutlineOffer = purpose === 'offer' && outline;
|
|
79
|
-
if ((isOutlineOffer || alternative) && gradient) {
|
|
80
|
-
background = `linear-gradient(#fff 0 0) padding-box, ${semanticGradient} border-box`;
|
|
81
|
-
} else if (purpose === 'offer' && gradient) {
|
|
82
|
-
background = semanticGradient;
|
|
83
|
-
}
|
|
84
|
-
return /*#__PURE__*/_jsx(BadgeContainer, {
|
|
85
|
-
isOutlineOffer: isOutlineOffer,
|
|
86
|
-
isAlternative: alternative,
|
|
87
|
-
padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
|
|
88
|
-
radius: `${borderRadius}px`,
|
|
89
|
-
background: background,
|
|
90
|
-
fontName: fontName,
|
|
91
|
-
fontWeight: fontWeight,
|
|
92
|
-
gradient: semanticGradient,
|
|
93
|
-
border: `${borderWidth}px solid ${borderColor}`,
|
|
94
|
-
ref: ref,
|
|
95
|
-
...selectProps(rest),
|
|
96
|
-
children: /*#__PURE__*/_jsx(Typography, {
|
|
97
|
-
tokens: {
|
|
98
|
-
fontName,
|
|
99
|
-
fontWeight,
|
|
100
|
-
color
|
|
101
|
-
},
|
|
102
|
-
variant: {
|
|
103
|
-
size: fontSizeMapping[fontSize]
|
|
104
|
-
},
|
|
105
|
-
children: children
|
|
106
|
-
})
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
Badge.displayName = 'Badge';
|
|
110
|
-
Badge.propTypes = {
|
|
111
|
-
...selectedSystemPropTypes,
|
|
112
|
-
children: PropTypes.node,
|
|
113
|
-
tokens: getTokensPropType('Badge'),
|
|
114
|
-
variant: PropTypes.exact({
|
|
115
|
-
outline: PropTypes.bool,
|
|
116
|
-
purpose: PropTypes.oneOf(['offer', 'editorial']),
|
|
117
|
-
alternative: PropTypes.bool,
|
|
118
|
-
inverse: PropTypes.bool
|
|
119
|
-
})
|
|
120
|
-
};
|
|
121
|
-
export default Badge;
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { Link, selectSystemProps, StackView, Typography, useThemeTokens, withLinkRouter, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
import { htmlAttrs, transformGradient } from '../utils';
|
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
-
const BlockQuoteContainer = /*#__PURE__*/styled.blockquote.withConfig({
|
|
10
|
-
displayName: "BlockQuote__BlockQuoteContainer",
|
|
11
|
-
componentId: "components-web__sc-vals3u-0"
|
|
12
|
-
})(["margin:0;position:relative;padding-left:", ";padding-right:", ";padding-bottom:", ";padding-top:", ";&::before{content:'';left:0;top:0;position:absolute;height:100%;width:", ";background:", ";}"], _ref => {
|
|
13
|
-
let {
|
|
14
|
-
paddingLeft
|
|
15
|
-
} = _ref;
|
|
16
|
-
return `${paddingLeft}px`;
|
|
17
|
-
}, _ref2 => {
|
|
18
|
-
let {
|
|
19
|
-
paddingRight
|
|
20
|
-
} = _ref2;
|
|
21
|
-
return `${paddingRight}px`;
|
|
22
|
-
}, _ref3 => {
|
|
23
|
-
let {
|
|
24
|
-
paddingBottom
|
|
25
|
-
} = _ref3;
|
|
26
|
-
return `${paddingBottom}px`;
|
|
27
|
-
}, _ref4 => {
|
|
28
|
-
let {
|
|
29
|
-
paddingTop
|
|
30
|
-
} = _ref4;
|
|
31
|
-
return `${paddingTop}px`;
|
|
32
|
-
}, _ref5 => {
|
|
33
|
-
let {
|
|
34
|
-
width
|
|
35
|
-
} = _ref5;
|
|
36
|
-
return `${width}px`;
|
|
37
|
-
}, _ref6 => {
|
|
38
|
-
let {
|
|
39
|
-
backgroundGradient
|
|
40
|
-
} = _ref6;
|
|
41
|
-
return backgroundGradient && transformGradient(backgroundGradient);
|
|
42
|
-
});
|
|
43
|
-
const QuoteContainer = /*#__PURE__*/styled.div.withConfig({
|
|
44
|
-
displayName: "BlockQuote__QuoteContainer",
|
|
45
|
-
componentId: "components-web__sc-vals3u-1"
|
|
46
|
-
})(["margin-bottom:", ";"], _ref7 => {
|
|
47
|
-
let {
|
|
48
|
-
marginBottom
|
|
49
|
-
} = _ref7;
|
|
50
|
-
return `${marginBottom}px`;
|
|
51
|
-
});
|
|
52
|
-
const BlockQuote = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
53
|
-
let {
|
|
54
|
-
children,
|
|
55
|
-
link,
|
|
56
|
-
additionalInfo,
|
|
57
|
-
linkHref,
|
|
58
|
-
textStyle = 'large',
|
|
59
|
-
LinkRouter,
|
|
60
|
-
linkRouterProps,
|
|
61
|
-
tokens,
|
|
62
|
-
variant,
|
|
63
|
-
...rest
|
|
64
|
-
} = _ref8;
|
|
65
|
-
const viewport = useViewport();
|
|
66
|
-
const {
|
|
67
|
-
color,
|
|
68
|
-
paddingTop,
|
|
69
|
-
paddingBottom,
|
|
70
|
-
paddingLeft,
|
|
71
|
-
paddingRight,
|
|
72
|
-
marginBottom,
|
|
73
|
-
width,
|
|
74
|
-
backgroundGradient,
|
|
75
|
-
titleHeadingFontSize,
|
|
76
|
-
titleHeadingFontName,
|
|
77
|
-
titleHeadingFontWeight,
|
|
78
|
-
titleHeadingLineHeight,
|
|
79
|
-
titleFontSize,
|
|
80
|
-
titleFontName,
|
|
81
|
-
titleFontWeight,
|
|
82
|
-
titleLineHeight,
|
|
83
|
-
linkFontSize,
|
|
84
|
-
linkFontName,
|
|
85
|
-
linkFontWeight,
|
|
86
|
-
linkLineHeight
|
|
87
|
-
} = useThemeTokens('BlockQuote', tokens, variant, {
|
|
88
|
-
viewport
|
|
89
|
-
});
|
|
90
|
-
const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle;
|
|
91
|
-
const titleTokens = textStyle === 'heading' ? {
|
|
92
|
-
fontSize: titleHeadingFontSize,
|
|
93
|
-
fontName: titleHeadingFontName,
|
|
94
|
-
fontWeight: titleHeadingFontWeight,
|
|
95
|
-
lineHeight: titleHeadingLineHeight
|
|
96
|
-
} : {
|
|
97
|
-
fontSize: titleFontSize,
|
|
98
|
-
fontName: titleFontName,
|
|
99
|
-
fontWeight: titleFontWeight,
|
|
100
|
-
lineHeight: titleLineHeight
|
|
101
|
-
};
|
|
102
|
-
const renderLink = () => {
|
|
103
|
-
if (linkHref) {
|
|
104
|
-
return /*#__PURE__*/_jsx(Link, {
|
|
105
|
-
href: linkHref,
|
|
106
|
-
tokens: {
|
|
107
|
-
blockFontSize: linkFontSize,
|
|
108
|
-
blockFontName: linkFontName,
|
|
109
|
-
blockFontWeight: linkFontWeight,
|
|
110
|
-
blockLineHeight: linkLineHeight,
|
|
111
|
-
color
|
|
112
|
-
},
|
|
113
|
-
variant: {
|
|
114
|
-
alternative: true
|
|
115
|
-
},
|
|
116
|
-
LinkRouter: LinkRouter,
|
|
117
|
-
linkRouterProps: linkRouterProps,
|
|
118
|
-
children: link
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return /*#__PURE__*/_jsx(Typography, {
|
|
122
|
-
tokens: {
|
|
123
|
-
color,
|
|
124
|
-
fontName: linkFontName,
|
|
125
|
-
fontSize: linkFontSize,
|
|
126
|
-
fontWeight: linkFontWeight,
|
|
127
|
-
lineHeight: linkLineHeight
|
|
128
|
-
},
|
|
129
|
-
children: link
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
const renderQuote = () => {
|
|
133
|
-
const quote = /*#__PURE__*/_jsx(Typography, {
|
|
134
|
-
tokens: {
|
|
135
|
-
color,
|
|
136
|
-
...titleTokens
|
|
137
|
-
},
|
|
138
|
-
variant: {
|
|
139
|
-
size: mappedTextSize
|
|
140
|
-
},
|
|
141
|
-
children: children
|
|
142
|
-
});
|
|
143
|
-
if (additionalInfo || link) {
|
|
144
|
-
return /*#__PURE__*/_jsx(QuoteContainer, {
|
|
145
|
-
marginBottom: marginBottom,
|
|
146
|
-
children: quote
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
return quote;
|
|
150
|
-
};
|
|
151
|
-
return /*#__PURE__*/_jsxs(BlockQuoteContainer, {
|
|
152
|
-
...selectProps(rest),
|
|
153
|
-
paddingTop: paddingTop,
|
|
154
|
-
paddingBottom: paddingBottom,
|
|
155
|
-
paddingLeft: paddingLeft,
|
|
156
|
-
paddingRight: paddingRight,
|
|
157
|
-
width: width,
|
|
158
|
-
backgroundGradient: backgroundGradient,
|
|
159
|
-
ref: ref,
|
|
160
|
-
children: [renderQuote(), (additionalInfo || link) && /*#__PURE__*/_jsxs(StackView, {
|
|
161
|
-
space: 0,
|
|
162
|
-
children: [link && renderLink(), additionalInfo && /*#__PURE__*/_jsx(Typography, {
|
|
163
|
-
tokens: {
|
|
164
|
-
color
|
|
165
|
-
},
|
|
166
|
-
variant: {
|
|
167
|
-
size: 'small'
|
|
168
|
-
},
|
|
169
|
-
children: additionalInfo
|
|
170
|
-
})]
|
|
171
|
-
})]
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
BlockQuote.displayName = 'BlockQuote';
|
|
175
|
-
BlockQuote.propTypes = {
|
|
176
|
-
...selectedSystemPropTypes,
|
|
177
|
-
...withLinkRouter.propTypes,
|
|
178
|
-
tokens: getTokensPropType('BlockQuote'),
|
|
179
|
-
variant: PropTypes.exact({
|
|
180
|
-
alternative: PropTypes.bool,
|
|
181
|
-
size: PropTypes.string
|
|
182
|
-
}),
|
|
183
|
-
/**
|
|
184
|
-
* Children nodes that can be added
|
|
185
|
-
*/
|
|
186
|
-
children: PropTypes.node.isRequired,
|
|
187
|
-
/**
|
|
188
|
-
* External source's identifier (e.g. author's name)
|
|
189
|
-
*/
|
|
190
|
-
link: PropTypes.string,
|
|
191
|
-
/**
|
|
192
|
-
* External source's URL
|
|
193
|
-
*/
|
|
194
|
-
linkHref: PropTypes.string,
|
|
195
|
-
/**
|
|
196
|
-
* To provide additional information about the source, rendered underneath `link`
|
|
197
|
-
*/
|
|
198
|
-
additionalInfo: PropTypes.string,
|
|
199
|
-
/**
|
|
200
|
-
* Whether to render BlockQuote as a heading size of `h3` or large text size
|
|
201
|
-
*/
|
|
202
|
-
textStyle: PropTypes.oneOf(['large', 'heading'])
|
|
203
|
-
};
|
|
204
|
-
export default BlockQuote;
|