@telus-uds/components-web 2.21.2 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -2
- package/lib/Badge/Badge.js +2 -14
- package/lib/Badge/index.js +0 -3
- package/lib/BlockQuote/BlockQuote.js +4 -25
- package/lib/BlockQuote/index.js +0 -3
- package/lib/Breadcrumbs/Breadcrumbs.js +9 -36
- package/lib/Breadcrumbs/Item/Item.js +15 -25
- package/lib/Breadcrumbs/index.js +0 -2
- package/lib/Callout/Callout.js +2 -24
- package/lib/Callout/index.js +0 -3
- package/lib/Card/Card.js +15 -29
- package/lib/Card/CardContent.js +5 -18
- package/lib/Card/CardFooter.js +7 -19
- package/lib/Card/index.js +0 -3
- package/lib/Countdown/Countdown.js +5 -24
- package/lib/Countdown/Segment.js +3 -15
- package/lib/Countdown/index.js +0 -3
- package/lib/Countdown/types.js +2 -7
- package/lib/Countdown/useCountdown.js +0 -7
- package/lib/DatePicker/CalendarContainer.js +0 -5
- package/lib/DatePicker/DatePicker.js +9 -61
- package/lib/DatePicker/dictionary.js +0 -8
- package/lib/DatePicker/index.js +0 -3
- package/lib/DatePicker/reactDatesCss.js +0 -2
- package/lib/Disclaimer/Disclaimer.js +5 -14
- package/lib/Disclaimer/index.js +0 -2
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +6 -17
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +12 -25
- package/lib/ExpandCollapseMini/index.js +0 -3
- package/lib/Footnote/Footnote.js +17 -63
- package/lib/Footnote/FootnoteLink.js +3 -24
- package/lib/Footnote/index.js +0 -4
- package/lib/IconButton/IconButton.js +4 -14
- package/lib/IconButton/index.js +0 -3
- package/lib/Image/Image.js +5 -24
- package/lib/Image/index.js +0 -3
- package/lib/List/List.js +0 -2
- package/lib/List/ListItem.js +0 -8
- package/lib/List/index.js +0 -4
- package/lib/NavigationBar/NavigationBar.js +10 -35
- package/lib/NavigationBar/NavigationItem.js +5 -17
- package/lib/NavigationBar/NavigationSubMenu.js +3 -19
- package/lib/NavigationBar/collapseItems.js +6 -9
- package/lib/NavigationBar/index.js +0 -3
- package/lib/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/OptimizeImage/OptimizeImage.js +6 -27
- package/lib/OptimizeImage/index.js +0 -3
- package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -4
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -8
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib/OptimizeImage/utils/index.js +0 -4
- package/lib/OptimizeImage/utils/isSvgUrl.js +0 -1
- package/lib/OrderedList/Item.js +4 -21
- package/lib/OrderedList/ItemBase.js +2 -9
- package/lib/OrderedList/OrderedList.js +11 -22
- package/lib/OrderedList/OrderedListBase.js +3 -13
- package/lib/OrderedList/index.js +0 -4
- package/lib/Paragraph/Paragraph.js +3 -18
- package/lib/Paragraph/index.js +0 -3
- package/lib/PreviewCard/AuthorDate.js +1 -10
- package/lib/PreviewCard/PreviewCard.js +15 -35
- package/lib/PreviewCard/index.js +0 -3
- package/lib/PriceLockup/PriceLockup.js +78 -75
- package/lib/PriceLockup/index.js +0 -3
- package/lib/PriceLockup/tokens.js +0 -2
- package/lib/Progress/ProgressBar.js +5 -16
- package/lib/Progress/index.js +0 -4
- package/lib/QuantitySelector/QuantitySelector.js +8 -42
- package/lib/QuantitySelector/SideButton.js +4 -11
- package/lib/QuantitySelector/index.js +0 -3
- package/lib/QuantitySelector/styles.js +0 -6
- package/lib/ResponsiveImage/ResponsiveImage.js +5 -20
- package/lib/ResponsiveImage/index.js +0 -3
- package/lib/Ribbon/Ribbon.js +4 -20
- package/lib/Ribbon/index.js +0 -3
- package/lib/SkeletonProvider/SkeletonImage.js +0 -10
- package/lib/SkeletonProvider/SkeletonProvider.js +4 -22
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -10
- package/lib/SkeletonProvider/index.js +0 -3
- package/lib/Span/Span.js +3 -17
- package/lib/Span/index.js +0 -3
- package/lib/Spinner/Spinner.js +11 -39
- package/lib/Spinner/SpinnerContent.js +2 -18
- package/lib/Spinner/index.js +0 -3
- package/lib/StoryCard/StoryCard.js +11 -31
- package/lib/StoryCard/index.js +0 -3
- package/lib/Table/Body.js +0 -6
- package/lib/Table/Cell.js +4 -24
- package/lib/Table/Header.js +0 -9
- package/lib/Table/Row.js +0 -8
- package/lib/Table/SubHeading.js +0 -9
- package/lib/Table/Table.js +5 -23
- package/lib/Table/index.js +0 -8
- package/lib/TermsAndConditions/ExpandCollapse.js +4 -14
- package/lib/TermsAndConditions/TermsAndConditions.js +7 -29
- package/lib/TermsAndConditions/index.js +0 -2
- package/lib/Testimonial/Testimonial.js +2 -26
- package/lib/Testimonial/index.js +0 -3
- package/lib/Toast/Toast.js +4 -25
- package/lib/Toast/index.js +0 -3
- package/lib/Video/ControlBar/ControlBar.js +2 -25
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -17
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -20
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -26
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -23
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +2 -12
- package/lib/Video/Video.js +122 -194
- package/lib/Video/index.js +0 -3
- package/lib/VideoPicker/VideoPicker.js +6 -32
- package/lib/VideoPicker/VideoPickerPlayer.js +2 -10
- package/lib/VideoPicker/VideoPickerThumbnail.js +7 -28
- package/lib/VideoPicker/VideoSlider.js +7 -17
- package/lib/VideoPicker/index.js +0 -3
- package/lib/VideoPicker/videoPropType.js +2 -8
- package/lib/WaffleGrid/WaffleGrid.js +11 -28
- package/lib/WaffleGrid/index.js +0 -3
- package/lib/WebPortal/WebPortal.js +1 -5
- package/lib/WebPortal/index.js +0 -3
- package/lib/WebVideo/WebVideo.js +4 -30
- package/lib/WebVideo/index.js +0 -3
- package/lib/baseExports.js +6 -1
- package/lib/index.js +0 -49
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -17
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -11
- package/lib/shared/FullBleedContent/index.js +0 -5
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +1 -12
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +2 -12
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -23
- package/lib/shared/VideoSplash/VideoSplash.js +4 -17
- package/lib/shared/VideoSplash/helpers.js +0 -6
- package/lib/utils/index.js +0 -9
- package/lib/utils/logger.js +0 -6
- package/lib/utils/media.js +2 -11
- package/lib/utils/renderStructuredContent.js +14 -31
- package/lib/utils/ssr.js +0 -6
- package/lib/utils/transforms.js +0 -2
- package/lib/utils/useOverlaidPosition.js +6 -28
- package/lib/utils/useTypographyTheme.js +4 -5
- package/lib-module/Badge/Badge.js +2 -5
- package/lib-module/BlockQuote/BlockQuote.js +4 -15
- package/lib-module/Breadcrumbs/Breadcrumbs.js +9 -25
- package/lib-module/Breadcrumbs/Item/Item.js +15 -12
- package/lib-module/Callout/Callout.js +2 -16
- package/lib-module/Card/Card.js +14 -17
- package/lib-module/Card/CardContent.js +5 -8
- package/lib-module/Card/CardFooter.js +7 -9
- package/lib-module/Countdown/Countdown.js +6 -11
- package/lib-module/Countdown/Segment.js +6 -8
- package/lib-module/Countdown/types.js +2 -1
- package/lib-module/Countdown/useCountdown.js +0 -6
- package/lib-module/DatePicker/CalendarContainer.js +3 -1
- package/lib-module/DatePicker/DatePicker.js +9 -39
- package/lib-module/DatePicker/dictionary.js +0 -8
- package/lib-module/Disclaimer/Disclaimer.js +5 -4
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -8
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +13 -19
- package/lib-module/Footnote/Footnote.js +17 -41
- package/lib-module/Footnote/FootnoteLink.js +3 -12
- package/lib-module/IconButton/IconButton.js +4 -6
- package/lib-module/Image/Image.js +5 -14
- package/lib-module/NavigationBar/NavigationBar.js +10 -20
- package/lib-module/NavigationBar/NavigationItem.js +5 -5
- package/lib-module/NavigationBar/NavigationSubMenu.js +3 -8
- package/lib-module/NavigationBar/collapseItems.js +6 -8
- package/lib-module/NavigationBar/resolveItemSelection.js +2 -2
- package/lib-module/OptimizeImage/OptimizeImage.js +6 -16
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -1
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -5
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +1 -5
- package/lib-module/OrderedList/Item.js +4 -7
- package/lib-module/OrderedList/ItemBase.js +2 -3
- package/lib-module/OrderedList/OrderedList.js +11 -9
- package/lib-module/OrderedList/OrderedListBase.js +3 -3
- package/lib-module/Paragraph/Paragraph.js +3 -8
- package/lib-module/PreviewCard/AuthorDate.js +1 -4
- package/lib-module/PreviewCard/PreviewCard.js +16 -19
- package/lib-module/PriceLockup/PriceLockup.js +78 -57
- package/lib-module/Progress/ProgressBar.js +7 -8
- package/lib-module/QuantitySelector/QuantitySelector.js +8 -30
- package/lib-module/QuantitySelector/SideButton.js +4 -6
- package/lib-module/ResponsiveImage/ResponsiveImage.js +5 -12
- package/lib-module/Ribbon/Ribbon.js +4 -9
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -5
- package/lib-module/SkeletonProvider/SkeletonProvider.js +4 -12
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -5
- package/lib-module/Span/Span.js +3 -7
- package/lib-module/Spinner/Spinner.js +11 -24
- package/lib-module/Spinner/SpinnerContent.js +2 -8
- package/lib-module/StoryCard/StoryCard.js +12 -17
- package/lib-module/Table/Body.js +0 -2
- package/lib-module/Table/Cell.js +4 -14
- package/lib-module/Table/Header.js +0 -2
- package/lib-module/Table/Row.js +0 -2
- package/lib-module/Table/SubHeading.js +0 -2
- package/lib-module/Table/Table.js +5 -6
- package/lib-module/TermsAndConditions/ExpandCollapse.js +4 -2
- package/lib-module/TermsAndConditions/TermsAndConditions.js +7 -9
- package/lib-module/Testimonial/Testimonial.js +2 -11
- package/lib-module/Toast/Toast.js +4 -15
- package/lib-module/Video/ControlBar/ControlBar.js +2 -9
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +4 -8
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +12 -13
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +8 -10
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +2 -3
- package/lib-module/Video/Video.js +122 -173
- package/lib-module/VideoPicker/VideoPicker.js +6 -15
- package/lib-module/VideoPicker/VideoPickerPlayer.js +2 -3
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +7 -13
- package/lib-module/VideoPicker/VideoSlider.js +6 -9
- package/lib-module/VideoPicker/videoPropType.js +2 -1
- package/lib-module/WaffleGrid/WaffleGrid.js +11 -15
- package/lib-module/WebPortal/WebPortal.js +1 -1
- package/lib-module/WebVideo/WebVideo.js +4 -15
- package/lib-module/baseExports.js +3 -2
- package/lib-module/index.js +0 -1
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +5 -10
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -10
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +1 -11
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +2 -3
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +7 -12
- package/lib-module/shared/VideoSplash/VideoSplash.js +4 -4
- package/lib-module/utils/logger.js +2 -2
- package/lib-module/utils/media.js +2 -9
- package/lib-module/utils/renderStructuredContent.js +14 -25
- package/lib-module/utils/ssr.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +8 -27
- package/lib-module/utils/useTypographyTheme.js +4 -4
- package/package.json +3 -3
- package/src/PriceLockup/PriceLockup.jsx +36 -11
- package/src/baseExports.js +1 -0
- package/src/index.js +0 -1
- package/lib/Modal/Modal.js +0 -146
- package/lib/Modal/ModalContent.js +0 -203
- package/lib/Modal/index.js +0 -13
- package/lib-module/Modal/Modal.js +0 -132
- package/lib-module/Modal/ModalContent.js +0 -181
- package/lib-module/Modal/index.js +0 -2
- package/src/Modal/Modal.jsx +0 -121
- package/src/Modal/ModalContent.jsx +0 -167
- package/src/Modal/index.js +0 -3
package/lib/Footnote/Footnote.js
CHANGED
|
@@ -4,29 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _componentsBase = require("@telus-uds/components-base");
|
|
15
|
-
|
|
16
11
|
var _OrderedListBase = _interopRequireDefault(require("../OrderedList/OrderedListBase"));
|
|
17
|
-
|
|
18
12
|
var _utils = require("../utils");
|
|
19
|
-
|
|
20
13
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
21
|
-
|
|
22
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
|
-
|
|
24
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
16
|
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); }
|
|
27
|
-
|
|
28
17
|
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; }
|
|
29
|
-
|
|
30
18
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
31
19
|
const viewportBreakpoint = 1440;
|
|
32
20
|
const GlobalBodyScrollLock = /*#__PURE__*/(0, _styledComponents.createGlobalStyle)({
|
|
@@ -34,7 +22,6 @@ const GlobalBodyScrollLock = /*#__PURE__*/(0, _styledComponents.createGlobalStyl
|
|
|
34
22
|
overflow: 'hidden'
|
|
35
23
|
})
|
|
36
24
|
});
|
|
37
|
-
|
|
38
25
|
const StyledFootnote = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
39
26
|
displayName: "Footnote__StyledFootnote",
|
|
40
27
|
componentId: "components-web__sc-1563bo5-0"
|
|
@@ -74,16 +61,13 @@ const StyledFootnote = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
74
61
|
let {
|
|
75
62
|
isOpen
|
|
76
63
|
} = _ref2;
|
|
77
|
-
|
|
78
64
|
if (isOpen) {
|
|
79
65
|
return {
|
|
80
66
|
transform: 'translateY(0)'
|
|
81
67
|
};
|
|
82
68
|
}
|
|
83
|
-
|
|
84
69
|
return {};
|
|
85
70
|
});
|
|
86
|
-
|
|
87
71
|
const StyledFootnoteHeader = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
88
72
|
displayName: "Footnote__StyledFootnoteHeader",
|
|
89
73
|
componentId: "components-web__sc-1563bo5-1"
|
|
@@ -91,7 +75,6 @@ const StyledFootnoteHeader = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
91
75
|
position: 'relative',
|
|
92
76
|
width: '100%'
|
|
93
77
|
}));
|
|
94
|
-
|
|
95
78
|
const StyledHeader = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
96
79
|
displayName: "Footnote__StyledHeader",
|
|
97
80
|
componentId: "components-web__sc-1563bo5-2"
|
|
@@ -113,7 +96,6 @@ const StyledHeader = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
113
96
|
paddingLeft: footnoteHeaderPaddingLeft
|
|
114
97
|
};
|
|
115
98
|
});
|
|
116
|
-
|
|
117
99
|
const StyledFootnoteBody = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
118
100
|
displayName: "Footnote__StyledFootnoteBody",
|
|
119
101
|
componentId: "components-web__sc-1563bo5-3"
|
|
@@ -142,7 +124,6 @@ const StyledFootnoteBody = /*#__PURE__*/_styledComponents.default.div.withConfig
|
|
|
142
124
|
opacity: isTextVisible ? 1 : 0
|
|
143
125
|
};
|
|
144
126
|
});
|
|
145
|
-
|
|
146
127
|
const List = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.default).withConfig({
|
|
147
128
|
displayName: "Footnote__List",
|
|
148
129
|
componentId: "components-web__sc-1563bo5-4"
|
|
@@ -182,7 +163,6 @@ const ListItem = /*#__PURE__*/(0, _styledComponents.default)(_OrderedListBase.de
|
|
|
182
163
|
paddingLeft: listItemPaddingLeft
|
|
183
164
|
};
|
|
184
165
|
});
|
|
185
|
-
|
|
186
166
|
const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
187
167
|
displayName: "Footnote__CloseButton",
|
|
188
168
|
componentId: "components-web__sc-1563bo5-6"
|
|
@@ -207,7 +187,6 @@ const CloseButton = /*#__PURE__*/_styledComponents.default.button.withConfig({
|
|
|
207
187
|
width: closeButtonWidth
|
|
208
188
|
};
|
|
209
189
|
});
|
|
210
|
-
|
|
211
190
|
const ContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
212
191
|
displayName: "Footnote__ContentContainer",
|
|
213
192
|
componentId: "components-web__sc-1563bo5-7"
|
|
@@ -225,7 +204,6 @@ const ContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
|
225
204
|
width: maxWidth
|
|
226
205
|
};
|
|
227
206
|
});
|
|
228
|
-
|
|
229
207
|
const StyledCustomContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
230
208
|
displayName: "Footnote__StyledCustomContentContainer",
|
|
231
209
|
componentId: "components-web__sc-1563bo5-8"
|
|
@@ -244,19 +222,17 @@ const StyledCustomContentContainer = /*#__PURE__*/_styledComponents.default.div.
|
|
|
244
222
|
fontFamily: 'HelveticaNow400normal'
|
|
245
223
|
};
|
|
246
224
|
});
|
|
247
|
-
|
|
248
225
|
const usePrevious = value => {
|
|
249
226
|
const ref = (0, _react.useRef)();
|
|
250
227
|
(0, _react.useEffect)(() => {
|
|
251
228
|
ref.current = value;
|
|
252
229
|
});
|
|
253
|
-
|
|
254
230
|
if (ref.current) {
|
|
255
231
|
return ref.current;
|
|
256
232
|
}
|
|
257
|
-
|
|
258
233
|
return {};
|
|
259
234
|
};
|
|
235
|
+
|
|
260
236
|
/**
|
|
261
237
|
* Use `Footnote` to display a single legal content.
|
|
262
238
|
*
|
|
@@ -275,11 +251,8 @@ const usePrevious = value => {
|
|
|
275
251
|
* - When `Footnote` is open, the inert prop must be set on all children of body excluding the Footnote
|
|
276
252
|
* - When `Footnote` is closed, focus must return to the initiating element
|
|
277
253
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
254
|
const Footnote = props => {
|
|
281
255
|
var _theme$themeOptions;
|
|
282
|
-
|
|
283
256
|
const viewport = (0, _componentsBase.useViewport)();
|
|
284
257
|
const {
|
|
285
258
|
copy,
|
|
@@ -352,15 +325,14 @@ const Footnote = props => {
|
|
|
352
325
|
const [isScrollable, setIsScrollable] = (0, _react.useState)(false);
|
|
353
326
|
const closeFootnote = (0, _react.useCallback)((event, options) => {
|
|
354
327
|
onClose(event, options);
|
|
355
|
-
}, [onClose]);
|
|
328
|
+
}, [onClose]);
|
|
356
329
|
|
|
330
|
+
// Listen for ESCAPE, close button clicks, and clicks outside of the Footnote. Call onClose.
|
|
357
331
|
const handleClose = (0, _react.useCallback)(event => {
|
|
358
332
|
var _footnoteRef$current, _footnoteRef$current2;
|
|
359
|
-
|
|
360
333
|
if (!isVisible) {
|
|
361
334
|
return;
|
|
362
335
|
}
|
|
363
|
-
|
|
364
336
|
if (event.type === 'keydown') {
|
|
365
337
|
if (event.key === 'Escape' || event.key === 27) {
|
|
366
338
|
closeFootnote(event, {
|
|
@@ -377,18 +349,15 @@ const Footnote = props => {
|
|
|
377
349
|
});
|
|
378
350
|
}
|
|
379
351
|
}, [closeFootnote, isVisible]);
|
|
380
|
-
|
|
381
352
|
const saveCurrentHeight = () => {
|
|
382
353
|
const oldHeight = contentRef.current.offsetHeight;
|
|
383
354
|
setBodyHeight(oldHeight);
|
|
384
355
|
};
|
|
385
|
-
|
|
386
356
|
const focusHeading = () => {
|
|
387
357
|
if (Boolean(content) && isVisible && headingRef && headingRef.current !== null) {
|
|
388
358
|
headingRef.current.focus();
|
|
389
359
|
}
|
|
390
360
|
};
|
|
391
|
-
|
|
392
361
|
const handleStyledFootnoteTransitionEnd = event => {
|
|
393
362
|
if (event.propertyName === 'transform' && !isOpen) {
|
|
394
363
|
setIsVisible(false);
|
|
@@ -396,16 +365,13 @@ const Footnote = props => {
|
|
|
396
365
|
focusHeading();
|
|
397
366
|
}
|
|
398
367
|
};
|
|
399
|
-
|
|
400
368
|
const handleTransitionEnd = event => {
|
|
401
369
|
event.persist();
|
|
402
|
-
|
|
403
370
|
if (event.propertyName === 'opacity' && !isTextVisible) {
|
|
404
371
|
setData({
|
|
405
372
|
content,
|
|
406
373
|
number
|
|
407
374
|
});
|
|
408
|
-
|
|
409
375
|
if (bodyHeight !== contentRef.current.offsetHeight) {
|
|
410
376
|
// Set new height
|
|
411
377
|
setBodyHeight(contentRef.current.offsetHeight);
|
|
@@ -415,34 +381,30 @@ const Footnote = props => {
|
|
|
415
381
|
} else {
|
|
416
382
|
setBodyHeight(contentRef.current.offsetHeight);
|
|
417
383
|
}
|
|
418
|
-
|
|
419
384
|
if (event.propertyName === 'height' && !isTextVisible) {
|
|
420
385
|
setIsTextVisible(true);
|
|
421
386
|
}
|
|
422
387
|
};
|
|
423
|
-
|
|
424
388
|
const resetFootnote = () => {
|
|
425
389
|
// Reset footnote state if closed
|
|
426
390
|
if (!isOpen) {
|
|
427
391
|
setBodyHeight('auto');
|
|
428
392
|
setIsTextVisible(true);
|
|
429
393
|
}
|
|
430
|
-
};
|
|
431
|
-
|
|
394
|
+
};
|
|
432
395
|
|
|
396
|
+
// Set height of header on mount
|
|
433
397
|
(0, _react.useEffect)(() => {
|
|
434
398
|
var _headerRef$current;
|
|
435
|
-
|
|
436
399
|
setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
|
|
437
400
|
}, []);
|
|
438
|
-
|
|
439
401
|
const preventDefault = event => {
|
|
440
402
|
if (!bodyRef.current.contains(event.touches[0].target)) {
|
|
441
403
|
event.preventDefault();
|
|
442
404
|
}
|
|
443
|
-
};
|
|
444
|
-
|
|
405
|
+
};
|
|
445
406
|
|
|
407
|
+
// Add listeners for mouse clicks outside of Footnote and for ESCAPE key presses
|
|
446
408
|
(0, _react.useEffect)(() => {
|
|
447
409
|
if (isOpen) {
|
|
448
410
|
setIsVisible(true);
|
|
@@ -454,7 +416,6 @@ const Footnote = props => {
|
|
|
454
416
|
passive: false
|
|
455
417
|
});
|
|
456
418
|
}
|
|
457
|
-
|
|
458
419
|
return () => {
|
|
459
420
|
if (isOpen) {
|
|
460
421
|
document.removeEventListener('mousedown', handleClose);
|
|
@@ -464,8 +425,9 @@ const Footnote = props => {
|
|
|
464
425
|
window.removeEventListener('touchmove', preventDefault);
|
|
465
426
|
}
|
|
466
427
|
};
|
|
467
|
-
}, [handleClose, isOpen]);
|
|
428
|
+
}, [handleClose, isOpen]);
|
|
468
429
|
|
|
430
|
+
// Set data if opening a new footnote
|
|
469
431
|
(0, _react.useEffect)(() => {
|
|
470
432
|
if (isOpen && !prevProps.isOpen) {
|
|
471
433
|
setData({
|
|
@@ -479,14 +441,14 @@ const Footnote = props => {
|
|
|
479
441
|
saveCurrentHeight();
|
|
480
442
|
setIsTextVisible(false);
|
|
481
443
|
}
|
|
482
|
-
}, [number, isOpen, prevProps.isOpen, prevProps.number]);
|
|
444
|
+
}, [number, isOpen, prevProps.isOpen, prevProps.number]);
|
|
483
445
|
|
|
446
|
+
// Reset footnote on close
|
|
484
447
|
(0, _react.useEffect)(resetFootnote, [isOpen]);
|
|
485
448
|
const getFootnoteBodyContent = (0, _react.useCallback)(() => {
|
|
486
449
|
if (!data.number || !data.content) {
|
|
487
450
|
return null;
|
|
488
451
|
}
|
|
489
|
-
|
|
490
452
|
if ( /*#__PURE__*/_react.default.isValidElement(data.content)) {
|
|
491
453
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCustomContentContainer, {
|
|
492
454
|
listItemColor: listItemColor,
|
|
@@ -497,7 +459,6 @@ const Footnote = props => {
|
|
|
497
459
|
children: data.content
|
|
498
460
|
});
|
|
499
461
|
}
|
|
500
|
-
|
|
501
462
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(List, {
|
|
502
463
|
start: data.number,
|
|
503
464
|
ref: contentRef,
|
|
@@ -521,7 +482,6 @@ const Footnote = props => {
|
|
|
521
482
|
}, [data.content, data.number, listItemColor, listItemFontSize, listItemLineHeight, listItemMarkerFontSize, listItemMarkerLineHeight, listItemPaddingLeft, listPaddingLeft]);
|
|
522
483
|
const checkIfScrollable = (0, _react.useCallback)(() => {
|
|
523
484
|
const footnoteElement = footnoteRef.current;
|
|
524
|
-
|
|
525
485
|
if (footnoteElement) {
|
|
526
486
|
const footnoteViewportHeight = footnoteElement.clientHeight ? footnoteElement.clientHeight : 0;
|
|
527
487
|
const contentHeight = contentRef.current ? contentRef.current.offsetHeight : 0;
|
|
@@ -536,7 +496,8 @@ const Footnote = props => {
|
|
|
536
496
|
}
|
|
537
497
|
}, [isOpen, checkIfScrollable]);
|
|
538
498
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Portal, {
|
|
539
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
499
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
500
|
+
...selectProps(rest),
|
|
540
501
|
children: [isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(GlobalBodyScrollLock, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledFootnote, {
|
|
541
502
|
ref: footnoteRef,
|
|
542
503
|
isOpen: isOpen,
|
|
@@ -603,43 +564,37 @@ const Footnote = props => {
|
|
|
603
564
|
})
|
|
604
565
|
});
|
|
605
566
|
};
|
|
606
|
-
|
|
607
567
|
const copyShape = _propTypes.default.shape({
|
|
608
568
|
close: _propTypes.default.string.isRequired,
|
|
609
569
|
heading: _propTypes.default.string.isRequired
|
|
610
|
-
});
|
|
611
|
-
|
|
570
|
+
});
|
|
612
571
|
|
|
572
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
613
573
|
const dictionaryContentShape = _propTypes.default.shape({
|
|
614
574
|
a11yLabel: _propTypes.default.string.isRequired,
|
|
615
575
|
close: _propTypes.default.string.isRequired,
|
|
616
576
|
heading: _propTypes.default.string.isRequired
|
|
617
577
|
});
|
|
618
|
-
|
|
619
|
-
|
|
578
|
+
Footnote.propTypes = {
|
|
579
|
+
...selectedSystemPropTypes,
|
|
620
580
|
tokens: (0, _componentsBase.getTokensPropType)('Footnote'),
|
|
621
|
-
|
|
622
581
|
/**
|
|
623
582
|
* The content.
|
|
624
583
|
*/
|
|
625
584
|
content: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.element]),
|
|
626
|
-
|
|
627
585
|
/**
|
|
628
586
|
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
629
587
|
* To provide your own, pass a JSON object with the keys `heading` and `close`.
|
|
630
588
|
*/
|
|
631
589
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), copyShape]),
|
|
632
|
-
|
|
633
590
|
/**
|
|
634
591
|
* A boolean flag used hide or show the `Footnote`. Set to `true` to open the `Footnote`.
|
|
635
592
|
*/
|
|
636
593
|
isOpen: _propTypes.default.bool,
|
|
637
|
-
|
|
638
594
|
/**
|
|
639
595
|
* The number, must match the number of the `FootnoteLink` that initiated the `Footnote`.
|
|
640
596
|
*/
|
|
641
597
|
number: _propTypes.default.number,
|
|
642
|
-
|
|
643
598
|
/**
|
|
644
599
|
* A callback function to handle the closing of the footnote.
|
|
645
600
|
*
|
|
@@ -648,7 +603,6 @@ Footnote.propTypes = { ...selectedSystemPropTypes,
|
|
|
648
603
|
* @param {boolean} options.returnFocus Should the `Footnote` return focus on close
|
|
649
604
|
*/
|
|
650
605
|
onClose: _propTypes.default.func.isRequired,
|
|
651
|
-
|
|
652
606
|
/**
|
|
653
607
|
* Override the default dictionary, by passing the complete dictionary object for `en` and `fr`
|
|
654
608
|
*/
|
|
@@ -4,25 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _componentsBase = require("@telus-uds/components-base");
|
|
15
|
-
|
|
16
11
|
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
17
|
-
|
|
18
12
|
var _utils = require("../utils");
|
|
19
|
-
|
|
20
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
-
|
|
22
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
15
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
25
|
-
|
|
26
16
|
const StyledSup = /*#__PURE__*/_styledComponents.default.sup.withConfig({
|
|
27
17
|
displayName: "FootnoteLink__StyledSup",
|
|
28
18
|
componentId: "components-web__sc-17nd7xo-0"
|
|
@@ -50,6 +40,7 @@ const StyledSup = /*#__PURE__*/_styledComponents.default.sup.withConfig({
|
|
|
50
40
|
...(0, _componentsBase.applyTextStyles)(fontNameAndWeight)
|
|
51
41
|
};
|
|
52
42
|
});
|
|
43
|
+
|
|
53
44
|
/**
|
|
54
45
|
* Use `FootnoteLink` to open `Footnote` component and display related legal content.
|
|
55
46
|
*
|
|
@@ -59,8 +50,6 @@ const StyledSup = /*#__PURE__*/_styledComponents.default.sup.withConfig({
|
|
|
59
50
|
* - Avoid using FootnoteLink if there is only one annotation on a page. Consider including
|
|
60
51
|
* the annotation as part of the content whenever possible.
|
|
61
52
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
53
|
const FootnoteLink = _ref2 => {
|
|
65
54
|
let {
|
|
66
55
|
copy = 'en',
|
|
@@ -74,28 +63,23 @@ const FootnoteLink = _ref2 => {
|
|
|
74
63
|
const themeTokens = (0, _componentsBase.useThemeTokens)('FootnoteLink', tokens, variant);
|
|
75
64
|
const numbers = Array.isArray(number) ? number : [number];
|
|
76
65
|
const refs = numbers.map(() => /*#__PURE__*/_react.default.createRef());
|
|
77
|
-
|
|
78
66
|
const handleClick = index => {
|
|
79
67
|
onClick(numbers[index], refs[index]);
|
|
80
68
|
};
|
|
81
|
-
|
|
82
69
|
const getCopy = (0, _componentsBase.useCopy)({
|
|
83
70
|
dictionary: _dictionary.default,
|
|
84
71
|
copy
|
|
85
72
|
});
|
|
86
|
-
|
|
87
73
|
const handleOnClick = (event, index) => {
|
|
88
74
|
event.preventDefault();
|
|
89
75
|
event.stopPropagation();
|
|
90
76
|
handleClick(index);
|
|
91
77
|
};
|
|
92
|
-
|
|
93
78
|
const handleOnKeyDown = (event, index) => {
|
|
94
79
|
if (event.key === 'Enter' || event.key === 13) {
|
|
95
80
|
handleClick(index);
|
|
96
81
|
}
|
|
97
82
|
};
|
|
98
|
-
|
|
99
83
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
100
84
|
children: numbers.map((num, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSup, {
|
|
101
85
|
onKeyDown: event => handleOnKeyDown(event, index),
|
|
@@ -110,30 +94,25 @@ const FootnoteLink = _ref2 => {
|
|
|
110
94
|
}, num))
|
|
111
95
|
});
|
|
112
96
|
};
|
|
113
|
-
|
|
114
97
|
const copyShape = _propTypes.default.shape({
|
|
115
98
|
a11yLabel: _propTypes.default.string.isRequired
|
|
116
99
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
100
|
+
FootnoteLink.propTypes = {
|
|
101
|
+
...selectedSystemPropTypes,
|
|
120
102
|
/**
|
|
121
103
|
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
122
104
|
* To provide your own, pass a JSON object with the key `a11yLabel`.
|
|
123
105
|
*/
|
|
124
106
|
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr']), copyShape]),
|
|
125
|
-
|
|
126
107
|
/**
|
|
127
108
|
* The footnote number, or multiple numbers if passed as an array.
|
|
128
109
|
* If using an array, a comma-separated group of numbers will be rendered as superscript.
|
|
129
110
|
*/
|
|
130
111
|
number: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.arrayOf(_propTypes.default.number), _propTypes.default.string, _propTypes.default.arrayOf(_propTypes.default.string)]).isRequired,
|
|
131
|
-
|
|
132
112
|
/**
|
|
133
113
|
* A callback function to handle the click of a FootnoteLink.
|
|
134
114
|
*/
|
|
135
115
|
onClick: _propTypes.default.func.isRequired,
|
|
136
|
-
|
|
137
116
|
/**
|
|
138
117
|
* Override default `fontSize` to set specific font size value
|
|
139
118
|
*/
|
package/lib/Footnote/index.js
CHANGED
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _Footnote = _interopRequireDefault(require("./Footnote"));
|
|
9
|
-
|
|
10
8
|
var _FootnoteLink = _interopRequireDefault(require("./FootnoteLink"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
_Footnote.default.Link = _FootnoteLink.default;
|
|
15
11
|
var _default = _Footnote.default;
|
|
16
12
|
exports.default = _default;
|
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
23
15
|
let {
|
|
24
16
|
icon,
|
|
@@ -27,7 +19,8 @@ const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
27
19
|
variant = {},
|
|
28
20
|
...iconButtonProps
|
|
29
21
|
} = _ref;
|
|
30
|
-
const variantWithAction = action && !variant.action ? {
|
|
22
|
+
const variantWithAction = action && !variant.action ? {
|
|
23
|
+
...variant,
|
|
31
24
|
action
|
|
32
25
|
} : variant;
|
|
33
26
|
const {
|
|
@@ -49,7 +42,6 @@ const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
49
42
|
});
|
|
50
43
|
const multiBrandIconNames = ['add', 'subtract', 'close', 'play', 'moveUp', 'moveDown', 'moveLeft', 'moveRight', 'expand'];
|
|
51
44
|
IconButton.displayName = 'IconButton';
|
|
52
|
-
|
|
53
45
|
const propsWithoutIcon = _ref2 => {
|
|
54
46
|
let {
|
|
55
47
|
icon,
|
|
@@ -57,16 +49,14 @@ const propsWithoutIcon = _ref2 => {
|
|
|
57
49
|
} = _ref2;
|
|
58
50
|
return props;
|
|
59
51
|
};
|
|
60
|
-
|
|
61
|
-
|
|
52
|
+
IconButton.propTypes = {
|
|
53
|
+
...propsWithoutIcon(_componentsBase.IconButton.propTypes),
|
|
62
54
|
tokens: (0, _componentsBase.getTokensPropType)('IconButton'),
|
|
63
|
-
|
|
64
55
|
/**
|
|
65
56
|
* To set the icon to a multi-brand compatabile icon
|
|
66
57
|
*/
|
|
67
58
|
// eslint-disable-next-line react/require-default-props
|
|
68
59
|
action: _propTypes.default.oneOf(multiBrandIconNames),
|
|
69
|
-
|
|
70
60
|
/**
|
|
71
61
|
* To set a custom icon
|
|
72
62
|
*/
|
package/lib/IconButton/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _IconButton.default;
|
|
13
10
|
exports.default = _default;
|
package/lib/Image/Image.js
CHANGED
|
@@ -4,23 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
10
|
var _componentsBase = require("@telus-uds/components-base");
|
|
15
|
-
|
|
16
11
|
var _utils = require("../utils");
|
|
17
|
-
|
|
18
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
-
|
|
20
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
14
|
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
23
|
-
|
|
24
15
|
const StyledImage = /*#__PURE__*/_styledComponents.default.img.withConfig({
|
|
25
16
|
displayName: "Image__StyledImage",
|
|
26
17
|
componentId: "components-web__sc-blwu4l-0"
|
|
@@ -33,7 +24,6 @@ const StyledImage = /*#__PURE__*/_styledComponents.default.img.withConfig({
|
|
|
33
24
|
maxWidth: '100%'
|
|
34
25
|
};
|
|
35
26
|
});
|
|
36
|
-
|
|
37
27
|
const StyledRoundedImage = /*#__PURE__*/(0, _styledComponents.default)(StyledImage).withConfig({
|
|
38
28
|
displayName: "Image__StyledRoundedImage",
|
|
39
29
|
componentId: "components-web__sc-blwu4l-1"
|
|
@@ -49,7 +39,6 @@ const StyledCircularImage = /*#__PURE__*/(0, _styledComponents.default)(StyledIm
|
|
|
49
39
|
})({
|
|
50
40
|
borderRadius: '50%'
|
|
51
41
|
});
|
|
52
|
-
|
|
53
42
|
const Image = _ref3 => {
|
|
54
43
|
let {
|
|
55
44
|
src,
|
|
@@ -68,13 +57,10 @@ const Image = _ref3 => {
|
|
|
68
57
|
const isCircle = rounded === 'circle';
|
|
69
58
|
const isCorners = rounded === 'corners';
|
|
70
59
|
const isSquare = width === height;
|
|
71
|
-
|
|
72
60
|
if (isCircle && !isSquare) {
|
|
73
61
|
(0, _utils.warn)('Image', 'rounded="circle" is not supported for non-square images. Please provide a square image, otherwise the resulting shape will not be a circle.');
|
|
74
62
|
}
|
|
75
|
-
|
|
76
63
|
let ImageComponent;
|
|
77
|
-
|
|
78
64
|
if (isCircle) {
|
|
79
65
|
ImageComponent = StyledCircularImage;
|
|
80
66
|
} else if (isCorners) {
|
|
@@ -82,8 +68,8 @@ const Image = _ref3 => {
|
|
|
82
68
|
} else {
|
|
83
69
|
ImageComponent = StyledImage;
|
|
84
70
|
}
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageComponent, {
|
|
72
|
+
...selectProps(rest),
|
|
87
73
|
borderRadius: borderRadius,
|
|
88
74
|
src: src,
|
|
89
75
|
width: width,
|
|
@@ -92,36 +78,31 @@ const Image = _ref3 => {
|
|
|
92
78
|
loading: loading
|
|
93
79
|
});
|
|
94
80
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
81
|
+
Image.propTypes = {
|
|
82
|
+
...selectedSystemPropTypes,
|
|
98
83
|
/**
|
|
99
84
|
* The src attribute for the HTML img element.
|
|
100
85
|
*/
|
|
101
|
-
src: _propTypes.default.string.isRequired,
|
|
102
86
|
|
|
87
|
+
src: _propTypes.default.string.isRequired,
|
|
103
88
|
/**
|
|
104
89
|
* The alt attribute for the HTML img element. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering.
|
|
105
90
|
*/
|
|
106
91
|
alt: _propTypes.default.string.isRequired,
|
|
107
|
-
|
|
108
92
|
/**
|
|
109
93
|
* The image's width.
|
|
110
94
|
*/
|
|
111
95
|
width: _propTypes.default.number.isRequired,
|
|
112
|
-
|
|
113
96
|
/**
|
|
114
97
|
* The image's height.
|
|
115
98
|
*/
|
|
116
99
|
height: _propTypes.default.number,
|
|
117
|
-
|
|
118
100
|
/**
|
|
119
101
|
* Loading strategy.
|
|
120
102
|
* @default 'eager'
|
|
121
103
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
|
|
122
104
|
*/
|
|
123
105
|
loading: _propTypes.default.oneOf(['eager', 'lazy']),
|
|
124
|
-
|
|
125
106
|
/**
|
|
126
107
|
* Make image render as a circle or with rounded corners.
|
|
127
108
|
*/
|
package/lib/Image/index.js
CHANGED
|
@@ -4,10 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _Image = _interopRequireDefault(require("./Image"));
|
|
9
|
-
|
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
9
|
var _default = _Image.default;
|
|
13
10
|
exports.default = _default;
|
package/lib/List/List.js
CHANGED
package/lib/List/ListItem.js
CHANGED
|
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _componentsBase = require("@telus-uds/components-base");
|
|
13
|
-
|
|
14
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
16
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
-
|
|
18
12
|
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); }
|
|
19
|
-
|
|
20
13
|
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; }
|
|
21
|
-
|
|
22
14
|
const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
23
15
|
let {
|
|
24
16
|
children,
|