@telus-uds/components-web 2.21.1 → 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 +22 -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
|
@@ -53,13 +53,11 @@ const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
|
|
|
53
53
|
let {
|
|
54
54
|
isOpen
|
|
55
55
|
} = _ref2;
|
|
56
|
-
|
|
57
56
|
if (isOpen) {
|
|
58
57
|
return {
|
|
59
58
|
transform: 'translateY(0)'
|
|
60
59
|
};
|
|
61
60
|
}
|
|
62
|
-
|
|
63
61
|
return {};
|
|
64
62
|
});
|
|
65
63
|
const StyledFootnoteHeader = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -216,19 +214,17 @@ const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
216
214
|
fontFamily: 'HelveticaNow400normal'
|
|
217
215
|
};
|
|
218
216
|
});
|
|
219
|
-
|
|
220
217
|
const usePrevious = value => {
|
|
221
218
|
const ref = useRef();
|
|
222
219
|
useEffect(() => {
|
|
223
220
|
ref.current = value;
|
|
224
221
|
});
|
|
225
|
-
|
|
226
222
|
if (ref.current) {
|
|
227
223
|
return ref.current;
|
|
228
224
|
}
|
|
229
|
-
|
|
230
225
|
return {};
|
|
231
226
|
};
|
|
227
|
+
|
|
232
228
|
/**
|
|
233
229
|
* Use `Footnote` to display a single legal content.
|
|
234
230
|
*
|
|
@@ -247,11 +243,8 @@ const usePrevious = value => {
|
|
|
247
243
|
* - When `Footnote` is open, the inert prop must be set on all children of body excluding the Footnote
|
|
248
244
|
* - When `Footnote` is closed, focus must return to the initiating element
|
|
249
245
|
*/
|
|
250
|
-
|
|
251
|
-
|
|
252
246
|
const Footnote = props => {
|
|
253
247
|
var _theme$themeOptions;
|
|
254
|
-
|
|
255
248
|
const viewport = useViewport();
|
|
256
249
|
const {
|
|
257
250
|
copy,
|
|
@@ -324,15 +317,14 @@ const Footnote = props => {
|
|
|
324
317
|
const [isScrollable, setIsScrollable] = useState(false);
|
|
325
318
|
const closeFootnote = useCallback((event, options) => {
|
|
326
319
|
onClose(event, options);
|
|
327
|
-
}, [onClose]);
|
|
320
|
+
}, [onClose]);
|
|
328
321
|
|
|
322
|
+
// Listen for ESCAPE, close button clicks, and clicks outside of the Footnote. Call onClose.
|
|
329
323
|
const handleClose = useCallback(event => {
|
|
330
324
|
var _footnoteRef$current, _footnoteRef$current2;
|
|
331
|
-
|
|
332
325
|
if (!isVisible) {
|
|
333
326
|
return;
|
|
334
327
|
}
|
|
335
|
-
|
|
336
328
|
if (event.type === 'keydown') {
|
|
337
329
|
if (event.key === 'Escape' || event.key === 27) {
|
|
338
330
|
closeFootnote(event, {
|
|
@@ -349,18 +341,15 @@ const Footnote = props => {
|
|
|
349
341
|
});
|
|
350
342
|
}
|
|
351
343
|
}, [closeFootnote, isVisible]);
|
|
352
|
-
|
|
353
344
|
const saveCurrentHeight = () => {
|
|
354
345
|
const oldHeight = contentRef.current.offsetHeight;
|
|
355
346
|
setBodyHeight(oldHeight);
|
|
356
347
|
};
|
|
357
|
-
|
|
358
348
|
const focusHeading = () => {
|
|
359
349
|
if (Boolean(content) && isVisible && headingRef && headingRef.current !== null) {
|
|
360
350
|
headingRef.current.focus();
|
|
361
351
|
}
|
|
362
352
|
};
|
|
363
|
-
|
|
364
353
|
const handleStyledFootnoteTransitionEnd = event => {
|
|
365
354
|
if (event.propertyName === 'transform' && !isOpen) {
|
|
366
355
|
setIsVisible(false);
|
|
@@ -368,16 +357,13 @@ const Footnote = props => {
|
|
|
368
357
|
focusHeading();
|
|
369
358
|
}
|
|
370
359
|
};
|
|
371
|
-
|
|
372
360
|
const handleTransitionEnd = event => {
|
|
373
361
|
event.persist();
|
|
374
|
-
|
|
375
362
|
if (event.propertyName === 'opacity' && !isTextVisible) {
|
|
376
363
|
setData({
|
|
377
364
|
content,
|
|
378
365
|
number
|
|
379
366
|
});
|
|
380
|
-
|
|
381
367
|
if (bodyHeight !== contentRef.current.offsetHeight) {
|
|
382
368
|
// Set new height
|
|
383
369
|
setBodyHeight(contentRef.current.offsetHeight);
|
|
@@ -387,34 +373,30 @@ const Footnote = props => {
|
|
|
387
373
|
} else {
|
|
388
374
|
setBodyHeight(contentRef.current.offsetHeight);
|
|
389
375
|
}
|
|
390
|
-
|
|
391
376
|
if (event.propertyName === 'height' && !isTextVisible) {
|
|
392
377
|
setIsTextVisible(true);
|
|
393
378
|
}
|
|
394
379
|
};
|
|
395
|
-
|
|
396
380
|
const resetFootnote = () => {
|
|
397
381
|
// Reset footnote state if closed
|
|
398
382
|
if (!isOpen) {
|
|
399
383
|
setBodyHeight('auto');
|
|
400
384
|
setIsTextVisible(true);
|
|
401
385
|
}
|
|
402
|
-
};
|
|
403
|
-
|
|
386
|
+
};
|
|
404
387
|
|
|
388
|
+
// Set height of header on mount
|
|
405
389
|
useEffect(() => {
|
|
406
390
|
var _headerRef$current;
|
|
407
|
-
|
|
408
391
|
setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
|
|
409
392
|
}, []);
|
|
410
|
-
|
|
411
393
|
const preventDefault = event => {
|
|
412
394
|
if (!bodyRef.current.contains(event.touches[0].target)) {
|
|
413
395
|
event.preventDefault();
|
|
414
396
|
}
|
|
415
|
-
};
|
|
416
|
-
|
|
397
|
+
};
|
|
417
398
|
|
|
399
|
+
// Add listeners for mouse clicks outside of Footnote and for ESCAPE key presses
|
|
418
400
|
useEffect(() => {
|
|
419
401
|
if (isOpen) {
|
|
420
402
|
setIsVisible(true);
|
|
@@ -426,7 +408,6 @@ const Footnote = props => {
|
|
|
426
408
|
passive: false
|
|
427
409
|
});
|
|
428
410
|
}
|
|
429
|
-
|
|
430
411
|
return () => {
|
|
431
412
|
if (isOpen) {
|
|
432
413
|
document.removeEventListener('mousedown', handleClose);
|
|
@@ -436,8 +417,9 @@ const Footnote = props => {
|
|
|
436
417
|
window.removeEventListener('touchmove', preventDefault);
|
|
437
418
|
}
|
|
438
419
|
};
|
|
439
|
-
}, [handleClose, isOpen]);
|
|
420
|
+
}, [handleClose, isOpen]);
|
|
440
421
|
|
|
422
|
+
// Set data if opening a new footnote
|
|
441
423
|
useEffect(() => {
|
|
442
424
|
if (isOpen && !prevProps.isOpen) {
|
|
443
425
|
setData({
|
|
@@ -451,14 +433,14 @@ const Footnote = props => {
|
|
|
451
433
|
saveCurrentHeight();
|
|
452
434
|
setIsTextVisible(false);
|
|
453
435
|
}
|
|
454
|
-
}, [number, isOpen, prevProps.isOpen, prevProps.number]);
|
|
436
|
+
}, [number, isOpen, prevProps.isOpen, prevProps.number]);
|
|
455
437
|
|
|
438
|
+
// Reset footnote on close
|
|
456
439
|
useEffect(resetFootnote, [isOpen]);
|
|
457
440
|
const getFootnoteBodyContent = useCallback(() => {
|
|
458
441
|
if (!data.number || !data.content) {
|
|
459
442
|
return null;
|
|
460
443
|
}
|
|
461
|
-
|
|
462
444
|
if ( /*#__PURE__*/React.isValidElement(data.content)) {
|
|
463
445
|
return /*#__PURE__*/_jsx(StyledCustomContentContainer, {
|
|
464
446
|
listItemColor: listItemColor,
|
|
@@ -469,7 +451,6 @@ const Footnote = props => {
|
|
|
469
451
|
children: data.content
|
|
470
452
|
});
|
|
471
453
|
}
|
|
472
|
-
|
|
473
454
|
return /*#__PURE__*/_jsx(List, {
|
|
474
455
|
start: data.number,
|
|
475
456
|
ref: contentRef,
|
|
@@ -493,7 +474,6 @@ const Footnote = props => {
|
|
|
493
474
|
}, [data.content, data.number, listItemColor, listItemFontSize, listItemLineHeight, listItemMarkerFontSize, listItemMarkerLineHeight, listItemPaddingLeft, listPaddingLeft]);
|
|
494
475
|
const checkIfScrollable = useCallback(() => {
|
|
495
476
|
const footnoteElement = footnoteRef.current;
|
|
496
|
-
|
|
497
477
|
if (footnoteElement) {
|
|
498
478
|
const footnoteViewportHeight = footnoteElement.clientHeight ? footnoteElement.clientHeight : 0;
|
|
499
479
|
const contentHeight = contentRef.current ? contentRef.current.offsetHeight : 0;
|
|
@@ -508,7 +488,8 @@ const Footnote = props => {
|
|
|
508
488
|
}
|
|
509
489
|
}, [isOpen, checkIfScrollable]);
|
|
510
490
|
return /*#__PURE__*/_jsx(Portal, {
|
|
511
|
-
children: /*#__PURE__*/_jsxs("div", {
|
|
491
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
492
|
+
...selectProps(rest),
|
|
512
493
|
children: [isOpen && /*#__PURE__*/_jsx(GlobalBodyScrollLock, {}), /*#__PURE__*/_jsx(StyledFootnote, {
|
|
513
494
|
ref: footnoteRef,
|
|
514
495
|
isOpen: isOpen,
|
|
@@ -575,41 +556,37 @@ const Footnote = props => {
|
|
|
575
556
|
})
|
|
576
557
|
});
|
|
577
558
|
};
|
|
578
|
-
|
|
579
559
|
const copyShape = PropTypes.shape({
|
|
580
560
|
close: PropTypes.string.isRequired,
|
|
581
561
|
heading: PropTypes.string.isRequired
|
|
582
|
-
});
|
|
562
|
+
});
|
|
583
563
|
|
|
564
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
584
565
|
const dictionaryContentShape = PropTypes.shape({
|
|
585
566
|
a11yLabel: PropTypes.string.isRequired,
|
|
586
567
|
close: PropTypes.string.isRequired,
|
|
587
568
|
heading: PropTypes.string.isRequired
|
|
588
569
|
});
|
|
589
|
-
Footnote.propTypes = {
|
|
570
|
+
Footnote.propTypes = {
|
|
571
|
+
...selectedSystemPropTypes,
|
|
590
572
|
tokens: getTokensPropType('Footnote'),
|
|
591
|
-
|
|
592
573
|
/**
|
|
593
574
|
* The content.
|
|
594
575
|
*/
|
|
595
576
|
content: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
596
|
-
|
|
597
577
|
/**
|
|
598
578
|
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
599
579
|
* To provide your own, pass a JSON object with the keys `heading` and `close`.
|
|
600
580
|
*/
|
|
601
581
|
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), copyShape]),
|
|
602
|
-
|
|
603
582
|
/**
|
|
604
583
|
* A boolean flag used hide or show the `Footnote`. Set to `true` to open the `Footnote`.
|
|
605
584
|
*/
|
|
606
585
|
isOpen: PropTypes.bool,
|
|
607
|
-
|
|
608
586
|
/**
|
|
609
587
|
* The number, must match the number of the `FootnoteLink` that initiated the `Footnote`.
|
|
610
588
|
*/
|
|
611
589
|
number: PropTypes.number,
|
|
612
|
-
|
|
613
590
|
/**
|
|
614
591
|
* A callback function to handle the closing of the footnote.
|
|
615
592
|
*
|
|
@@ -618,7 +595,6 @@ Footnote.propTypes = { ...selectedSystemPropTypes,
|
|
|
618
595
|
* @param {boolean} options.returnFocus Should the `Footnote` return focus on close
|
|
619
596
|
*/
|
|
620
597
|
onClose: PropTypes.func.isRequired,
|
|
621
|
-
|
|
622
598
|
/**
|
|
623
599
|
* Override the default dictionary, by passing the complete dictionary object for `en` and `fr`
|
|
624
600
|
*/
|
|
@@ -34,6 +34,7 @@ const StyledSup = /*#__PURE__*/styled.sup.withConfig({
|
|
|
34
34
|
...applyTextStyles(fontNameAndWeight)
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
|
+
|
|
37
38
|
/**
|
|
38
39
|
* Use `FootnoteLink` to open `Footnote` component and display related legal content.
|
|
39
40
|
*
|
|
@@ -43,7 +44,6 @@ const StyledSup = /*#__PURE__*/styled.sup.withConfig({
|
|
|
43
44
|
* - Avoid using FootnoteLink if there is only one annotation on a page. Consider including
|
|
44
45
|
* the annotation as part of the content whenever possible.
|
|
45
46
|
*/
|
|
46
|
-
|
|
47
47
|
const FootnoteLink = _ref2 => {
|
|
48
48
|
let {
|
|
49
49
|
copy = 'en',
|
|
@@ -57,28 +57,23 @@ const FootnoteLink = _ref2 => {
|
|
|
57
57
|
const themeTokens = useThemeTokens('FootnoteLink', tokens, variant);
|
|
58
58
|
const numbers = Array.isArray(number) ? number : [number];
|
|
59
59
|
const refs = numbers.map(() => /*#__PURE__*/React.createRef());
|
|
60
|
-
|
|
61
60
|
const handleClick = index => {
|
|
62
61
|
onClick(numbers[index], refs[index]);
|
|
63
62
|
};
|
|
64
|
-
|
|
65
63
|
const getCopy = useCopy({
|
|
66
64
|
dictionary,
|
|
67
65
|
copy
|
|
68
66
|
});
|
|
69
|
-
|
|
70
67
|
const handleOnClick = (event, index) => {
|
|
71
68
|
event.preventDefault();
|
|
72
69
|
event.stopPropagation();
|
|
73
70
|
handleClick(index);
|
|
74
71
|
};
|
|
75
|
-
|
|
76
72
|
const handleOnKeyDown = (event, index) => {
|
|
77
73
|
if (event.key === 'Enter' || event.key === 13) {
|
|
78
74
|
handleClick(index);
|
|
79
75
|
}
|
|
80
76
|
};
|
|
81
|
-
|
|
82
77
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
83
78
|
children: numbers.map((num, index) => /*#__PURE__*/_jsx(StyledSup, {
|
|
84
79
|
onKeyDown: event => handleOnKeyDown(event, index),
|
|
@@ -93,29 +88,25 @@ const FootnoteLink = _ref2 => {
|
|
|
93
88
|
}, num))
|
|
94
89
|
});
|
|
95
90
|
};
|
|
96
|
-
|
|
97
91
|
const copyShape = PropTypes.shape({
|
|
98
92
|
a11yLabel: PropTypes.string.isRequired
|
|
99
93
|
});
|
|
100
|
-
FootnoteLink.propTypes = {
|
|
101
|
-
|
|
94
|
+
FootnoteLink.propTypes = {
|
|
95
|
+
...selectedSystemPropTypes,
|
|
102
96
|
/**
|
|
103
97
|
* Use the `copy` prop to either select provided English or French copy by passing 'en' or 'fr' respectively.
|
|
104
98
|
* To provide your own, pass a JSON object with the key `a11yLabel`.
|
|
105
99
|
*/
|
|
106
100
|
copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr']), copyShape]),
|
|
107
|
-
|
|
108
101
|
/**
|
|
109
102
|
* The footnote number, or multiple numbers if passed as an array.
|
|
110
103
|
* If using an array, a comma-separated group of numbers will be rendered as superscript.
|
|
111
104
|
*/
|
|
112
105
|
number: PropTypes.oneOfType([PropTypes.number, PropTypes.arrayOf(PropTypes.number), PropTypes.string, PropTypes.arrayOf(PropTypes.string)]).isRequired,
|
|
113
|
-
|
|
114
106
|
/**
|
|
115
107
|
* A callback function to handle the click of a FootnoteLink.
|
|
116
108
|
*/
|
|
117
109
|
onClick: PropTypes.func.isRequired,
|
|
118
|
-
|
|
119
110
|
/**
|
|
120
111
|
* Override default `fontSize` to set specific font size value
|
|
121
112
|
*/
|
|
@@ -10,7 +10,8 @@ const IconButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
10
10
|
variant = {},
|
|
11
11
|
...iconButtonProps
|
|
12
12
|
} = _ref;
|
|
13
|
-
const variantWithAction = action && !variant.action ? {
|
|
13
|
+
const variantWithAction = action && !variant.action ? {
|
|
14
|
+
...variant,
|
|
14
15
|
action
|
|
15
16
|
} : variant;
|
|
16
17
|
const {
|
|
@@ -32,7 +33,6 @@ const IconButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
32
33
|
});
|
|
33
34
|
const multiBrandIconNames = ['add', 'subtract', 'close', 'play', 'moveUp', 'moveDown', 'moveLeft', 'moveRight', 'expand'];
|
|
34
35
|
IconButton.displayName = 'IconButton';
|
|
35
|
-
|
|
36
36
|
const propsWithoutIcon = _ref2 => {
|
|
37
37
|
let {
|
|
38
38
|
icon,
|
|
@@ -40,16 +40,14 @@ const propsWithoutIcon = _ref2 => {
|
|
|
40
40
|
} = _ref2;
|
|
41
41
|
return props;
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
IconButton.propTypes = {
|
|
44
|
+
...propsWithoutIcon(IconButtonBase.propTypes),
|
|
45
45
|
tokens: getTokensPropType('IconButton'),
|
|
46
|
-
|
|
47
46
|
/**
|
|
48
47
|
* To set the icon to a multi-brand compatabile icon
|
|
49
48
|
*/
|
|
50
49
|
// eslint-disable-next-line react/require-default-props
|
|
51
50
|
action: PropTypes.oneOf(multiBrandIconNames),
|
|
52
|
-
|
|
53
51
|
/**
|
|
54
52
|
* To set a custom icon
|
|
55
53
|
*/
|
|
@@ -32,7 +32,6 @@ const StyledCircularImage = /*#__PURE__*/styled(StyledImage).withConfig({
|
|
|
32
32
|
})({
|
|
33
33
|
borderRadius: '50%'
|
|
34
34
|
});
|
|
35
|
-
|
|
36
35
|
const Image = _ref3 => {
|
|
37
36
|
let {
|
|
38
37
|
src,
|
|
@@ -51,13 +50,10 @@ const Image = _ref3 => {
|
|
|
51
50
|
const isCircle = rounded === 'circle';
|
|
52
51
|
const isCorners = rounded === 'corners';
|
|
53
52
|
const isSquare = width === height;
|
|
54
|
-
|
|
55
53
|
if (isCircle && !isSquare) {
|
|
56
54
|
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.');
|
|
57
55
|
}
|
|
58
|
-
|
|
59
56
|
let ImageComponent;
|
|
60
|
-
|
|
61
57
|
if (isCircle) {
|
|
62
58
|
ImageComponent = StyledCircularImage;
|
|
63
59
|
} else if (isCorners) {
|
|
@@ -65,8 +61,8 @@ const Image = _ref3 => {
|
|
|
65
61
|
} else {
|
|
66
62
|
ImageComponent = StyledImage;
|
|
67
63
|
}
|
|
68
|
-
|
|
69
|
-
|
|
64
|
+
return /*#__PURE__*/_jsx(ImageComponent, {
|
|
65
|
+
...selectProps(rest),
|
|
70
66
|
borderRadius: borderRadius,
|
|
71
67
|
src: src,
|
|
72
68
|
width: width,
|
|
@@ -75,36 +71,31 @@ const Image = _ref3 => {
|
|
|
75
71
|
loading: loading
|
|
76
72
|
});
|
|
77
73
|
};
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
Image.propTypes = {
|
|
75
|
+
...selectedSystemPropTypes,
|
|
81
76
|
/**
|
|
82
77
|
* The src attribute for the HTML img element.
|
|
83
78
|
*/
|
|
84
|
-
src: PropTypes.string.isRequired,
|
|
85
79
|
|
|
80
|
+
src: PropTypes.string.isRequired,
|
|
86
81
|
/**
|
|
87
82
|
* 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.
|
|
88
83
|
*/
|
|
89
84
|
alt: PropTypes.string.isRequired,
|
|
90
|
-
|
|
91
85
|
/**
|
|
92
86
|
* The image's width.
|
|
93
87
|
*/
|
|
94
88
|
width: PropTypes.number.isRequired,
|
|
95
|
-
|
|
96
89
|
/**
|
|
97
90
|
* The image's height.
|
|
98
91
|
*/
|
|
99
92
|
height: PropTypes.number,
|
|
100
|
-
|
|
101
93
|
/**
|
|
102
94
|
* Loading strategy.
|
|
103
95
|
* @default 'eager'
|
|
104
96
|
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
|
|
105
97
|
*/
|
|
106
98
|
loading: PropTypes.oneOf(['eager', 'lazy']),
|
|
107
|
-
|
|
108
99
|
/**
|
|
109
100
|
* Make image render as a circle or with rounded corners.
|
|
110
101
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
var _withLinkRouter$propT, _withLinkRouter$propT2, _withLinkRouter$propT3, _withLinkRouter$propT4;
|
|
2
|
-
|
|
3
2
|
import React, { forwardRef, useEffect, useRef, useState } from 'react';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import { selectSystemProps, StackView, Typography, useResponsiveProp, withLinkRouter, getTokensPropType } from '@telus-uds/components-base';
|
|
@@ -24,11 +23,11 @@ const Heading = /*#__PURE__*/styled.div.withConfig({
|
|
|
24
23
|
letterSpacing: 0
|
|
25
24
|
}
|
|
26
25
|
});
|
|
26
|
+
|
|
27
27
|
/**
|
|
28
28
|
* NavigationBar can be used to allow customers to consistently navigate across
|
|
29
29
|
* key pages within a specific product line
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
31
|
const NavigationBar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
33
32
|
let {
|
|
34
33
|
accessibilityRole = 'navigation',
|
|
@@ -51,10 +50,8 @@ const NavigationBar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
51
50
|
});
|
|
52
51
|
const openOverlayRef = useRef(null);
|
|
53
52
|
const [openSubMenuId, setOpenSubMenuId] = useState(null);
|
|
54
|
-
|
|
55
53
|
const handleSubMenuClose = event => {
|
|
56
54
|
var _openOverlayRef$curre, _openOverlayRef$curre2;
|
|
57
|
-
|
|
58
55
|
if (event.type === 'keydown') {
|
|
59
56
|
if (event.key === 'Escape' || event.key === 27) {
|
|
60
57
|
setOpenSubMenuId(null);
|
|
@@ -64,17 +61,16 @@ const NavigationBar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
64
61
|
} else if (event.type === 'touchstart' && openOverlayRef !== null && openOverlayRef !== void 0 && openOverlayRef.current && event.touches[0].target && !(openOverlayRef !== null && openOverlayRef !== void 0 && (_openOverlayRef$curre2 = openOverlayRef.current) !== null && _openOverlayRef$curre2 !== void 0 && _openOverlayRef$curre2.contains(event.touches[0].target))) {
|
|
65
62
|
setOpenSubMenuId(null);
|
|
66
63
|
}
|
|
67
|
-
};
|
|
68
|
-
// TODO: create a custom hook for that and use here and in the Footnote
|
|
69
|
-
|
|
64
|
+
};
|
|
70
65
|
|
|
66
|
+
// Add listeners for mouse clicks outside and for ESCAPE key presses
|
|
67
|
+
// TODO: create a custom hook for that and use here and in the Footnote
|
|
71
68
|
useEffect(() => {
|
|
72
69
|
if (openSubMenuId !== null) {
|
|
73
70
|
window.addEventListener('click', handleSubMenuClose);
|
|
74
71
|
window.addEventListener('keydown', handleSubMenuClose);
|
|
75
72
|
window.addEventListener('touchstart', handleSubMenuClose);
|
|
76
73
|
}
|
|
77
|
-
|
|
78
74
|
return () => {
|
|
79
75
|
if (openSubMenuId !== null) {
|
|
80
76
|
window.removeEventListener('click', handleSubMenuClose);
|
|
@@ -114,27 +110,26 @@ const NavigationBar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
114
110
|
...itemRest
|
|
115
111
|
} = _ref2;
|
|
116
112
|
const itemId = id ?? label;
|
|
117
|
-
|
|
118
113
|
const handleClick = event => {
|
|
119
114
|
if (nestedItems) {
|
|
120
115
|
setOpenSubMenuId(openSubMenuId !== itemId ? itemId : null);
|
|
121
116
|
}
|
|
122
|
-
|
|
123
117
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
124
118
|
onChange === null || onChange === void 0 ? void 0 : onChange(itemId, event);
|
|
125
119
|
};
|
|
126
|
-
|
|
127
120
|
const ItemComponent = nestedItems ? NavigationSubMenu : NavigationItem;
|
|
128
121
|
const isOpen = itemId === openSubMenuId;
|
|
129
122
|
return /*#__PURE__*/_jsx(ItemComponent, {
|
|
130
123
|
ref: itemRef,
|
|
131
124
|
href: href,
|
|
132
|
-
onClick: handleClick
|
|
125
|
+
onClick: handleClick
|
|
126
|
+
// TODO: refactor to pass selected ID via context
|
|
133
127
|
,
|
|
134
128
|
selectedId: selectedId,
|
|
135
129
|
index: index,
|
|
136
130
|
LinkRouter: ItemLinkRouter,
|
|
137
|
-
linkRouterProps: {
|
|
131
|
+
linkRouterProps: {
|
|
132
|
+
...linkRouterProps,
|
|
138
133
|
...itemLinkRouterProps
|
|
139
134
|
},
|
|
140
135
|
items: nestedItems,
|
|
@@ -152,10 +147,10 @@ const NavigationBar = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
152
147
|
});
|
|
153
148
|
});
|
|
154
149
|
NavigationBar.displayName = 'NavigationBar';
|
|
155
|
-
NavigationBar.propTypes = {
|
|
150
|
+
NavigationBar.propTypes = {
|
|
151
|
+
...selectedSystemPropTypes,
|
|
156
152
|
tokens: getTokensPropType('NavigationBar'),
|
|
157
153
|
...withLinkRouter.propTypes,
|
|
158
|
-
|
|
159
154
|
/**
|
|
160
155
|
* NavigationBar pages
|
|
161
156
|
*
|
|
@@ -183,27 +178,22 @@ NavigationBar.propTypes = { ...selectedSystemPropTypes,
|
|
|
183
178
|
linkRouterProps: (_withLinkRouter$propT4 = withLinkRouter.propTypes) === null || _withLinkRouter$propT4 === void 0 ? void 0 : _withLinkRouter$propT4.linkRouterProps
|
|
184
179
|
}))
|
|
185
180
|
})).isRequired,
|
|
186
|
-
|
|
187
181
|
/**
|
|
188
182
|
* Common navigation bar heading.
|
|
189
183
|
*/
|
|
190
184
|
heading: PropTypes.string,
|
|
191
|
-
|
|
192
185
|
/**
|
|
193
186
|
* Sets the `headingLevel` of the `heading`
|
|
194
187
|
*/
|
|
195
188
|
headingLevel: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
|
|
196
|
-
|
|
197
189
|
/**
|
|
198
190
|
* Matches the `id` property of the item in `items` corresponding to the current page
|
|
199
191
|
*/
|
|
200
192
|
selectedId: PropTypes.string.isRequired,
|
|
201
|
-
|
|
202
193
|
/**
|
|
203
194
|
* Optional function to be called on pressing a link
|
|
204
195
|
*/
|
|
205
196
|
onChange: PropTypes.func,
|
|
206
|
-
|
|
207
197
|
/**
|
|
208
198
|
* Accesibility role for stackview
|
|
209
199
|
*/
|
|
@@ -22,12 +22,12 @@ const ItemContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
22
22
|
flexShrink: 1
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
|
+
|
|
25
26
|
/**
|
|
26
27
|
* NavigationItem within a NavigationBar component.
|
|
27
28
|
*
|
|
28
29
|
* This is rendered automatically by `NavigationBar` and isn't intended be used directly.
|
|
29
30
|
*/
|
|
30
|
-
|
|
31
31
|
const NavigationItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
32
32
|
let {
|
|
33
33
|
accessibilityRole = 'link',
|
|
@@ -53,11 +53,10 @@ const NavigationItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
53
53
|
});
|
|
54
54
|
const viewport = useViewport();
|
|
55
55
|
const getTokens = useThemeTokensCallback('NavigationBar', tokens, variant);
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
const getStateTokens = state => getTokens({
|
|
57
|
+
...state,
|
|
58
58
|
viewport
|
|
59
59
|
});
|
|
60
|
-
|
|
61
60
|
return /*#__PURE__*/_jsx(ItemContainer, {
|
|
62
61
|
targetWidth: targetWidth,
|
|
63
62
|
children: /*#__PURE__*/_jsx(Button, {
|
|
@@ -78,7 +77,8 @@ const NavigationItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
78
77
|
});
|
|
79
78
|
});
|
|
80
79
|
NavigationItem.displayName = 'NavigationItem';
|
|
81
|
-
NavigationItem.propTypes = {
|
|
80
|
+
NavigationItem.propTypes = {
|
|
81
|
+
...selectedSystemPropTypes,
|
|
82
82
|
onClick: PropTypes.func,
|
|
83
83
|
selected: PropTypes.bool,
|
|
84
84
|
children: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired
|
|
@@ -4,16 +4,15 @@ import { Icon, useResponsiveProp, useThemeTokens, Listbox } from '@telus-uds/com
|
|
|
4
4
|
import NavigationItem from './NavigationItem';
|
|
5
5
|
import useOverlaidPosition from '../utils/useOverlaidPosition';
|
|
6
6
|
import resolveItemSelection from './resolveItemSelection';
|
|
7
|
+
|
|
7
8
|
/**
|
|
8
9
|
* A NavigationItem that opens or closes a Listbox of other NavigationItems.
|
|
9
10
|
*
|
|
10
11
|
* This is rendered automatically by `NavigationBar` and isn't intended be used directly.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
14
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
|
|
17
16
|
const NavigationSubMenu = _ref => {
|
|
18
17
|
let {
|
|
19
18
|
children,
|
|
@@ -29,7 +28,6 @@ const NavigationSubMenu = _ref => {
|
|
|
29
28
|
} = _ref;
|
|
30
29
|
const focusTrapRef = useRef();
|
|
31
30
|
const maxWidth = 289; // Slightly over 288 of nav item to account for subpixel rounding
|
|
32
|
-
|
|
33
31
|
const {
|
|
34
32
|
align,
|
|
35
33
|
offsets,
|
|
@@ -78,11 +76,9 @@ const NavigationSubMenu = _ref => {
|
|
|
78
76
|
label,
|
|
79
77
|
items
|
|
80
78
|
}, selectedId);
|
|
81
|
-
|
|
82
79
|
const handleClick = event => {
|
|
83
80
|
if (typeof onClick === 'function') onClick(event);
|
|
84
81
|
};
|
|
85
|
-
|
|
86
82
|
const {
|
|
87
83
|
icoMenu
|
|
88
84
|
} = useThemeTokens('NavigationBar', {}, {}, {
|
|
@@ -98,7 +94,6 @@ const NavigationSubMenu = _ref => {
|
|
|
98
94
|
icon: icoMenu,
|
|
99
95
|
children: _ref2 => {
|
|
100
96
|
var _textStyles$;
|
|
101
|
-
|
|
102
97
|
let {
|
|
103
98
|
textStyles
|
|
104
99
|
} = _ref2;
|
|
@@ -138,9 +133,9 @@ const NavigationSubMenu = _ref => {
|
|
|
138
133
|
})]
|
|
139
134
|
});
|
|
140
135
|
};
|
|
136
|
+
NavigationSubMenu.displayName = 'NavigationSubMenu';
|
|
141
137
|
|
|
142
|
-
|
|
143
|
-
|
|
138
|
+
// @TODO - proper prop types and comments
|
|
144
139
|
NavigationSubMenu.propTypes = {
|
|
145
140
|
children: PropTypes.node,
|
|
146
141
|
id: PropTypes.string,
|