@telus-uds/components-web 3.3.0 → 4.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 +7 -1
- package/CHANGELOG.md +38 -2
- package/jest.config.cjs +1 -1
- package/lib/cjs/Badge/Badge.js +128 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BlockQuote/BlockQuote.js +256 -0
- package/lib/cjs/BlockQuote/index.js +9 -0
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +264 -0
- package/lib/cjs/Breadcrumbs/Item/Item.js +180 -0
- package/lib/cjs/Breadcrumbs/index.js +13 -0
- package/lib/cjs/Callout/Callout.js +141 -0
- package/lib/cjs/Callout/index.js +9 -0
- package/lib/cjs/Card/Card.js +257 -0
- package/lib/cjs/Card/CardContent.js +97 -0
- package/lib/cjs/Card/CardFooter.js +85 -0
- package/lib/cjs/Card/index.js +9 -0
- package/lib/cjs/Countdown/Countdown.js +268 -0
- package/lib/cjs/Countdown/Segment.js +108 -0
- package/lib/cjs/Countdown/constants.js +10 -0
- package/lib/cjs/Countdown/dictionary.js +28 -0
- package/lib/cjs/Countdown/index.js +9 -0
- package/lib/cjs/Countdown/types.js +31 -0
- package/lib/cjs/Countdown/useCountdown.js +32 -0
- package/lib/cjs/DatePicker/CalendarContainer.js +214 -0
- package/lib/cjs/DatePicker/DatePicker.js +525 -0
- package/lib/cjs/DatePicker/dictionary.js +125 -0
- package/lib/cjs/DatePicker/index.js +9 -0
- package/lib/cjs/DatePicker/reactDatesCss.js +9 -0
- package/lib/cjs/Disclaimer/Disclaimer.js +61 -0
- package/lib/cjs/Disclaimer/index.js +13 -0
- package/lib/cjs/Footnote/Footnote.js +637 -0
- package/lib/cjs/Footnote/FootnoteLink.js +125 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/IconButton/IconButton.js +62 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/Image/Image.js +90 -0
- package/lib/cjs/Image/index.js +20 -0
- package/lib/cjs/Image/server.js +11 -0
- package/lib/cjs/List/List.js +8 -0
- package/lib/cjs/List/ListItem.js +34 -0
- package/lib/cjs/List/index.js +11 -0
- package/lib/cjs/NavigationBar/NavigationBar.js +282 -0
- package/lib/cjs/NavigationBar/NavigationItem.js +94 -0
- package/lib/cjs/NavigationBar/NavigationSubMenu.js +164 -0
- package/lib/{NavigationBar → cjs/NavigationBar}/collapseItems.js +9 -4
- package/lib/cjs/NavigationBar/index.js +11 -0
- package/lib/cjs/NavigationBar/resolveItemSelection.js +22 -0
- package/lib/cjs/OptimizeImage/OptimizeImage.js +99 -0
- package/lib/cjs/OptimizeImage/index.js +9 -0
- package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +14 -0
- package/lib/cjs/OptimizeImage/utils/getImageUrls.js +19 -0
- package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +24 -0
- package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +34 -0
- package/lib/cjs/OptimizeImage/utils/index.js +34 -0
- package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +9 -0
- package/lib/cjs/OrderedList/Item.js +151 -0
- package/lib/cjs/OrderedList/ItemBase.js +34 -0
- package/lib/cjs/OrderedList/OrderedList.js +92 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +52 -0
- package/lib/cjs/OrderedList/constants.js +8 -0
- package/lib/cjs/OrderedList/index.js +11 -0
- package/lib/cjs/Paragraph/Paragraph.js +97 -0
- package/lib/cjs/Paragraph/index.js +9 -0
- package/lib/cjs/PreviewCard/AuthorDate.js +63 -0
- package/lib/cjs/PreviewCard/PreviewCard.js +215 -0
- package/lib/cjs/PreviewCard/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +356 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/tokens.js +66 -0
- package/lib/cjs/Progress/ProgressBar.js +99 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuantitySelector/QuantitySelector.js +267 -0
- package/lib/cjs/QuantitySelector/SideButton.js +77 -0
- package/lib/cjs/QuantitySelector/dictionary.js +32 -0
- package/lib/cjs/QuantitySelector/index.js +9 -0
- package/lib/cjs/QuantitySelector/styles.js +16 -0
- package/lib/cjs/ResponsiveImage/ResponsiveImage.js +107 -0
- package/lib/cjs/ResponsiveImage/index.js +9 -0
- package/lib/cjs/Ribbon/Ribbon.js +222 -0
- package/lib/cjs/Ribbon/index.js +9 -0
- package/lib/cjs/SkeletonProvider/SkeletonImage.js +45 -0
- package/lib/cjs/SkeletonProvider/SkeletonProvider.js +63 -0
- package/lib/cjs/SkeletonProvider/SkeletonTypography.js +44 -0
- package/lib/cjs/SkeletonProvider/index.js +9 -0
- package/lib/cjs/Span/Span.js +79 -0
- package/lib/cjs/Span/index.js +9 -0
- package/lib/cjs/Spinner/Spinner.js +221 -0
- package/lib/cjs/Spinner/SpinnerContent.js +100 -0
- package/lib/cjs/Spinner/constants.js +10 -0
- package/lib/cjs/Spinner/index.js +9 -0
- package/lib/cjs/StoryCard/StoryCard.js +219 -0
- package/lib/cjs/StoryCard/index.js +9 -0
- package/lib/cjs/Table/Body.js +24 -0
- package/lib/cjs/Table/Cell.js +187 -0
- package/lib/cjs/Table/Header.js +32 -0
- package/lib/cjs/Table/Row.js +41 -0
- package/lib/cjs/Table/SubHeading.js +30 -0
- package/lib/cjs/Table/Table.js +124 -0
- package/lib/cjs/Table/index.js +19 -0
- package/lib/cjs/TermsAndConditions/ExpandCollapse.js +160 -0
- package/lib/cjs/TermsAndConditions/TermsAndConditions.js +283 -0
- package/lib/cjs/TermsAndConditions/dictionary.js +22 -0
- package/lib/cjs/TermsAndConditions/index.js +13 -0
- package/lib/cjs/Testimonial/Testimonial.js +240 -0
- package/lib/cjs/Testimonial/index.js +9 -0
- package/lib/cjs/Toast/Toast.js +165 -0
- package/lib/cjs/Toast/index.js +9 -0
- package/lib/cjs/Video/ControlBar/ControlBar.js +294 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +76 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +169 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +211 -0
- package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +197 -0
- package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +78 -0
- package/lib/cjs/Video/Video.js +964 -0
- package/lib/cjs/Video/index.js +9 -0
- package/lib/cjs/Video/videoText.js +61 -0
- package/lib/cjs/VideoPicker/VideoPicker.js +197 -0
- package/lib/cjs/VideoPicker/VideoPickerPlayer.js +54 -0
- package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +223 -0
- package/lib/cjs/VideoPicker/VideoSlider.js +88 -0
- package/lib/cjs/VideoPicker/index.js +9 -0
- package/lib/cjs/VideoPicker/videoPropType.js +17 -0
- package/lib/cjs/WaffleGrid/WaffleGrid.js +164 -0
- package/lib/cjs/WaffleGrid/index.js +9 -0
- package/lib/cjs/WebVideo/WebVideo.js +197 -0
- package/lib/cjs/WebVideo/index.js +9 -0
- package/lib/cjs/WebVideo/utils/index.js +57 -0
- package/lib/cjs/baseExports.js +438 -0
- package/lib/cjs/index.js +317 -0
- package/lib/cjs/server.js +13 -0
- package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +29 -0
- package/lib/cjs/shared/ConditionalWrapper/index.js +9 -0
- package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +108 -0
- package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +61 -0
- package/lib/cjs/shared/FullBleedContent/index.js +23 -0
- package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +61 -0
- package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +91 -0
- package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +229 -0
- package/lib/cjs/shared/VideoSplash/VideoSplash.js +72 -0
- package/lib/cjs/shared/VideoSplash/helpers.js +32 -0
- package/lib/cjs/utils/index.js +88 -0
- package/lib/cjs/utils/isElementFocusable.js +14 -0
- package/lib/cjs/utils/logger.js +24 -0
- package/lib/cjs/utils/media.js +45 -0
- package/lib/cjs/utils/renderStructuredContent.js +71 -0
- package/lib/cjs/utils/scrollToAnchor.js +25 -0
- package/lib/cjs/utils/ssr.js +50 -0
- package/lib/cjs/utils/theming/get-theme-from-server.js +24 -0
- package/lib/cjs/utils/theming/with-client-theme.js +31 -0
- package/lib/cjs/utils/theming/with-server-theme.js +33 -0
- package/lib/cjs/utils/transforms.js +11 -0
- package/lib/cjs/utils/useOverlaidPosition.js +222 -0
- package/lib/cjs/utils/useTypographyTheme.js +30 -0
- package/lib/{Badge → esm/Badge}/Badge.js +11 -19
- package/lib/{BlockQuote → esm/BlockQuote}/BlockQuote.js +17 -31
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Breadcrumbs.js +6 -5
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Item/Item.js +10 -6
- package/lib/{Callout → esm/Callout}/Callout.js +6 -5
- package/lib/{Card → esm/Card}/Card.js +10 -10
- package/lib/{Card → esm/Card}/CardContent.js +6 -5
- package/lib/{Card → esm/Card}/CardFooter.js +6 -5
- package/lib/{Countdown → esm/Countdown}/Countdown.js +53 -32
- package/lib/{Countdown → esm/Countdown}/Segment.js +6 -6
- package/lib/{DatePicker → esm/DatePicker}/CalendarContainer.js +5 -5
- package/lib/{DatePicker → esm/DatePicker}/DatePicker.js +24 -20
- package/lib/esm/DatePicker/reactDatesCss.js +3 -0
- package/lib/{Disclaimer → esm/Disclaimer}/Disclaimer.js +6 -5
- package/lib/{Footnote → esm/Footnote}/Footnote.js +43 -22
- package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +19 -20
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationSubMenu.js +1 -2
- package/lib/esm/NavigationBar/collapseItems.js +37 -0
- package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.js +1 -1
- package/lib/{OrderedList → esm/OrderedList}/Item.js +10 -6
- package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +5 -5
- package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +8 -8
- package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +5 -5
- package/lib/{Paragraph → esm/Paragraph}/Paragraph.js +8 -16
- package/lib/{PreviewCard → esm/PreviewCard}/PreviewCard.js +10 -7
- package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +59 -69
- package/lib/{Progress → esm/Progress}/ProgressBar.js +6 -6
- package/lib/esm/QuantitySelector/styles.js +9 -0
- package/lib/{Ribbon → esm/Ribbon}/Ribbon.js +31 -57
- package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonImage.js +3 -4
- package/lib/esm/SkeletonProvider/SkeletonTypography.js +37 -0
- package/lib/{Span → esm/Span}/Span.js +7 -6
- package/lib/{Spinner → esm/Spinner}/Spinner.js +18 -8
- package/lib/{Spinner → esm/Spinner}/SpinnerContent.js +6 -5
- package/lib/{StoryCard → esm/StoryCard}/StoryCard.js +10 -7
- package/lib/{Table → esm/Table}/Cell.js +16 -45
- package/lib/esm/Table/Row.js +34 -0
- package/lib/{Table → esm/Table}/Table.js +18 -20
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +15 -8
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/TermsAndConditions.js +22 -9
- package/lib/{Testimonial → esm/Testimonial}/Testimonial.js +26 -10
- package/lib/{Toast → esm/Toast}/Toast.js +15 -67
- package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +7 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoMenu/VideoMenu.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VolumeSlider/VolumeSlider.js +10 -6
- package/lib/{Video → esm/Video}/MiddleControlButton/MiddleControlButton.js +6 -5
- package/lib/{Video → esm/Video}/Video.js +28 -12
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +21 -46
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +19 -54
- package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
- package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
- package/lib/{baseExports.js → esm/baseExports.js} +1 -1
- package/lib/{index.js → esm/index.js} +1 -2
- package/lib/{shared → esm/shared}/FullBleedContent/FullBleedContent.js +5 -5
- package/lib/{shared → esm/shared}/VideoSplash/SplashButton/SplashButton.js +9 -6
- package/lib/{shared → esm/shared}/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +17 -8
- package/lib/{shared → esm/shared}/VideoSplash/VideoSplash.js +6 -5
- package/lib/{utils → esm/utils}/index.js +1 -2
- package/lib/{utils → esm/utils}/scrollToAnchor.js +2 -2
- package/lib/{utils → esm/utils}/ssr.js +8 -4
- package/lib/{utils → esm/utils}/useOverlaidPosition.js +2 -4
- package/package.json +17 -16
- package/src/Badge/Badge.jsx +4 -3
- package/src/BlockQuote/BlockQuote.jsx +2 -3
- package/src/Breadcrumbs/Breadcrumbs.jsx +2 -3
- package/src/Breadcrumbs/Item/Item.jsx +2 -3
- package/src/Callout/Callout.jsx +2 -4
- package/src/Card/Card.jsx +1 -3
- package/src/Card/CardContent.jsx +2 -3
- package/src/Card/CardFooter.jsx +2 -3
- package/src/Countdown/Countdown.jsx +62 -36
- package/src/Countdown/Segment.jsx +1 -3
- package/src/DatePicker/CalendarContainer.jsx +1 -3
- package/src/DatePicker/DatePicker.jsx +2 -3
- package/src/DatePicker/reactDatesCss.js +1 -3
- package/src/Disclaimer/Disclaimer.jsx +2 -3
- package/src/Footnote/Footnote.jsx +2 -10
- package/src/Footnote/FootnoteLink.jsx +2 -3
- package/src/NavigationBar/NavigationBar.jsx +2 -3
- package/src/NavigationBar/NavigationItem.jsx +2 -3
- package/src/OrderedList/Item.jsx +2 -3
- package/src/OrderedList/ItemBase.jsx +1 -3
- package/src/OrderedList/OrderedList.jsx +2 -3
- package/src/OrderedList/OrderedListBase.jsx +1 -3
- package/src/Paragraph/Paragraph.jsx +2 -4
- package/src/PreviewCard/PreviewCard.jsx +1 -3
- package/src/PriceLockup/PriceLockup.jsx +2 -3
- package/src/Progress/ProgressBar.jsx +1 -3
- package/src/QuantitySelector/styles.js +1 -3
- package/src/Ribbon/Ribbon.jsx +2 -3
- package/src/Span/Span.jsx +2 -4
- package/src/Spinner/Spinner.jsx +2 -3
- package/src/Spinner/SpinnerContent.jsx +2 -3
- package/src/StoryCard/StoryCard.jsx +1 -3
- package/src/Table/Cell.jsx +4 -5
- package/src/Table/Row.jsx +13 -2
- package/src/Table/Table.jsx +14 -5
- package/src/TermsAndConditions/ExpandCollapse.jsx +6 -4
- package/src/TermsAndConditions/TermsAndConditions.jsx +2 -3
- package/src/Testimonial/Testimonial.jsx +2 -3
- package/src/Toast/Toast.jsx +2 -3
- package/src/Video/ControlBar/ControlBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +2 -4
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +2 -4
- package/src/Video/Video.jsx +2 -4
- package/src/VideoPicker/VideoPicker.jsx +2 -4
- package/src/VideoPicker/VideoPickerThumbnail.jsx +1 -3
- package/src/WaffleGrid/WaffleGrid.jsx +2 -3
- package/src/WebVideo/WebVideo.jsx +3 -4
- package/src/baseExports.js +1 -0
- package/src/index.js +1 -2
- package/src/shared/FullBleedContent/FullBleedContent.jsx +1 -3
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +1 -3
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +1 -4
- package/src/shared/VideoSplash/VideoSplash.jsx +2 -3
- package/src/utils/index.js +1 -3
- package/src/utils/ssr.js +10 -3
- package/types/Callout.d.ts +2 -1
- package/types/Tooltip.d.ts +1 -0
- package/lib/DatePicker/reactDatesCss.js +0 -830
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -116
- package/lib/ExpandCollapseMini/index.js +0 -2
- package/lib/QuantitySelector/styles.js +0 -18
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib/Table/Row.js +0 -19
- package/lib/utils/theming/styled-components.js +0 -26
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +0 -72
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +0 -104
- package/src/ExpandCollapseMini/index.js +0 -3
- package/src/utils/theming/styled-components.js +0 -23
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{BlockQuote → esm/BlockQuote}/index.js +0 -0
- /package/lib/{Breadcrumbs → esm/Breadcrumbs}/index.js +0 -0
- /package/lib/{Callout → esm/Callout}/index.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/constants.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/dictionary.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/types.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/useCountdown.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/dictionary.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/index.js +0 -0
- /package/lib/{Disclaimer → esm/Disclaimer}/index.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{Image → esm/Image}/Image.js +0 -0
- /package/lib/{Image → esm/Image}/index.js +0 -0
- /package/lib/{Image → esm/Image}/server.js +0 -0
- /package/lib/{List → esm/List}/List.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/OptimizeImage.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getFallbackUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getImageUrls.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getOptimizedUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/hasWebpSupport.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/isSvgUrl.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/constants.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Paragraph → esm/Paragraph}/index.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/AuthorDate.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/tokens.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/QuantitySelector.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/SideButton.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/dictionary.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/index.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/ResponsiveImage.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/index.js +0 -0
- /package/lib/{Ribbon → esm/Ribbon}/index.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/index.js +0 -0
- /package/lib/{Span → esm/Span}/index.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/constants.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/index.js +0 -0
- /package/lib/{StoryCard → esm/StoryCard}/index.js +0 -0
- /package/lib/{Table → esm/Table}/Body.js +0 -0
- /package/lib/{Table → esm/Table}/Header.js +0 -0
- /package/lib/{Table → esm/Table}/SubHeading.js +0 -0
- /package/lib/{Table → esm/Table}/index.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/dictionary.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/index.js +0 -0
- /package/lib/{Testimonial → esm/Testimonial}/index.js +0 -0
- /package/lib/{Toast → esm/Toast}/index.js +0 -0
- /package/lib/{Video → esm/Video}/index.js +0 -0
- /package/lib/{Video → esm/Video}/videoText.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerPlayer.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoSlider.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/index.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/videoPropType.js +0 -0
- /package/lib/{WaffleGrid → esm/WaffleGrid}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/utils/index.js +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/ConditionalWrapper.js +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/getFullBleedBorderRadius.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/useFullBleedContentProps.js +0 -0
- /package/lib/{shared → esm/shared}/VideoSplash/helpers.js +0 -0
- /package/lib/{utils → esm/utils}/isElementFocusable.js +0 -0
- /package/lib/{utils → esm/utils}/logger.js +0 -0
- /package/lib/{utils → esm/utils}/media.js +0 -0
- /package/lib/{utils → esm/utils}/renderStructuredContent.js +0 -0
- /package/lib/{utils → esm/utils}/theming/get-theme-from-server.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-client-theme.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-server-theme.js +0 -0
- /package/lib/{utils → esm/utils}/transforms.js +0 -0
- /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _reactHelmetAsync = require("react-helmet-async");
|
|
10
|
+
var _lodash = require("lodash");
|
|
11
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
12
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
+
var _utils = require("../utils");
|
|
14
|
+
var _Item = _interopRequireDefault(require("./Item/Item"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
20
|
+
const StyledList = /*#__PURE__*/_styledComponents.default.ol.withConfig({
|
|
21
|
+
displayName: "Breadcrumbs__StyledList",
|
|
22
|
+
componentId: "components-web__sc-gwwxrc-0"
|
|
23
|
+
})({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
flexWrap: 'wrap',
|
|
27
|
+
listStyle: 'none',
|
|
28
|
+
listStylePosition: 'inside',
|
|
29
|
+
margin: 0,
|
|
30
|
+
padding: 0,
|
|
31
|
+
alignItems: 'baseline'
|
|
32
|
+
});
|
|
33
|
+
const omitProps = _ref => {
|
|
34
|
+
let {
|
|
35
|
+
current,
|
|
36
|
+
path,
|
|
37
|
+
breadcrumbName,
|
|
38
|
+
indexRoute,
|
|
39
|
+
childRoutes,
|
|
40
|
+
component,
|
|
41
|
+
...props
|
|
42
|
+
} = _ref;
|
|
43
|
+
return props;
|
|
44
|
+
};
|
|
45
|
+
const getBreadcrumbName = (item, params) => {
|
|
46
|
+
if (!item.breadcrumbName) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
let {
|
|
50
|
+
breadcrumbName
|
|
51
|
+
} = item;
|
|
52
|
+
Object.keys(params).forEach(key => {
|
|
53
|
+
breadcrumbName = breadcrumbName.replace(`:${key}`, params[key]);
|
|
54
|
+
});
|
|
55
|
+
return breadcrumbName;
|
|
56
|
+
};
|
|
57
|
+
const getPath = (path, params, concatenatePaths, paths) => {
|
|
58
|
+
let p = path;
|
|
59
|
+
if (concatenatePaths) {
|
|
60
|
+
p = p.replace(/^\//, '');
|
|
61
|
+
Object.keys(params).forEach(key => {
|
|
62
|
+
p = p.replace(`:${key}`, params[key]);
|
|
63
|
+
});
|
|
64
|
+
if (p) {
|
|
65
|
+
paths.push(p);
|
|
66
|
+
}
|
|
67
|
+
return `/${paths.join('/')}`;
|
|
68
|
+
}
|
|
69
|
+
return p;
|
|
70
|
+
};
|
|
71
|
+
const getItems = (items, params, concatenatePaths) => {
|
|
72
|
+
const paths = [];
|
|
73
|
+
return items.filter(item => item.path).map((item, i, filteredItems) => {
|
|
74
|
+
const isLast = i === filteredItems.length - 1;
|
|
75
|
+
const breadcrumbName = getBreadcrumbName(item, params);
|
|
76
|
+
const href = getPath(item.path, params, concatenatePaths, paths);
|
|
77
|
+
const {
|
|
78
|
+
LinkRouter,
|
|
79
|
+
linkRouterProps
|
|
80
|
+
} = item;
|
|
81
|
+
return {
|
|
82
|
+
breadcrumbName,
|
|
83
|
+
href: item.isExpander ? '#' : href,
|
|
84
|
+
current: isLast,
|
|
85
|
+
LinkRouter,
|
|
86
|
+
linkRouterProps,
|
|
87
|
+
onPress: item.onPress,
|
|
88
|
+
...omitProps(selectProps(item))
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const getStructuredData = (items, baseUrl) => {
|
|
93
|
+
return items.map((item, index) => ({
|
|
94
|
+
'@type': 'ListItem',
|
|
95
|
+
position: index + 1,
|
|
96
|
+
item: {
|
|
97
|
+
'@id': `${baseUrl || ''}${item.href}`,
|
|
98
|
+
name: item.breadcrumbName
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
const MAX_ITEMS_ON_XS_VIEWPORT = 4;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Display a hierarchy of links, commonly used for navigation.
|
|
106
|
+
*/
|
|
107
|
+
const Breadcrumbs = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
108
|
+
let {
|
|
109
|
+
baseUrl,
|
|
110
|
+
children,
|
|
111
|
+
linkRouterProps,
|
|
112
|
+
params = {},
|
|
113
|
+
tokens,
|
|
114
|
+
routes,
|
|
115
|
+
variant,
|
|
116
|
+
LinkRouter,
|
|
117
|
+
...rest
|
|
118
|
+
} = _ref2;
|
|
119
|
+
// React Helmet can cause a memory leak in SSR if not properly configured.
|
|
120
|
+
// Only run it in SSR if theme options tells us to.
|
|
121
|
+
/* const {
|
|
122
|
+
themeOptions: { enableHelmetSSR }
|
|
123
|
+
} = useTheme() */
|
|
124
|
+
// const isHydrating = useHydrationContext()
|
|
125
|
+
// const isSSR = typeof window === 'undefined' || isHydrating
|
|
126
|
+
// const hasMetadata = isSSR ? enableHelmetSSR : true
|
|
127
|
+
const helmetContext = {};
|
|
128
|
+
const activeRoutes = children ? _react.default.Children.map((0, _componentsBase.unpackFragment)(children), _ref3 => {
|
|
129
|
+
let {
|
|
130
|
+
props: {
|
|
131
|
+
href,
|
|
132
|
+
children: breadcrumbName,
|
|
133
|
+
...itemRest
|
|
134
|
+
},
|
|
135
|
+
ref: routeRef
|
|
136
|
+
} = _ref3;
|
|
137
|
+
return {
|
|
138
|
+
path: href,
|
|
139
|
+
breadcrumbName,
|
|
140
|
+
routeRef,
|
|
141
|
+
...itemRest
|
|
142
|
+
};
|
|
143
|
+
}) : routes.filter(route => route.path && route.breadcrumbName);
|
|
144
|
+
const [optionsHidden, setOptionsHidden] = _react.default.useState(false);
|
|
145
|
+
const [itemsToBeRendered, setItemsToBeRendered] = _react.default.useState([]);
|
|
146
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
147
|
+
const newItems = _react.default.useMemo(() => {
|
|
148
|
+
if (viewport === 'xs' && activeRoutes.length >= MAX_ITEMS_ON_XS_VIEWPORT) {
|
|
149
|
+
return [...activeRoutes.slice(0, 2), {
|
|
150
|
+
path: '#',
|
|
151
|
+
breadcrumbName: '...',
|
|
152
|
+
onPress: event => {
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
setItemsToBeRendered(activeRoutes);
|
|
155
|
+
},
|
|
156
|
+
isExpander: true
|
|
157
|
+
}, activeRoutes[activeRoutes.length - 1]];
|
|
158
|
+
}
|
|
159
|
+
return activeRoutes;
|
|
160
|
+
}, [viewport, activeRoutes]);
|
|
161
|
+
_react.default.useEffect(() => {
|
|
162
|
+
if (optionsHidden) {
|
|
163
|
+
if (viewport !== 'xs' && !(0, _lodash.isEqual)(itemsToBeRendered, activeRoutes)) {
|
|
164
|
+
setItemsToBeRendered(activeRoutes);
|
|
165
|
+
}
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (viewport === 'xs' && activeRoutes.length >= MAX_ITEMS_ON_XS_VIEWPORT) {
|
|
169
|
+
if (!(0, _lodash.isEqual)(itemsToBeRendered, newItems)) {
|
|
170
|
+
setItemsToBeRendered(newItems);
|
|
171
|
+
setOptionsHidden(true);
|
|
172
|
+
}
|
|
173
|
+
} else if (!(0, _lodash.isEqual)(itemsToBeRendered, activeRoutes)) {
|
|
174
|
+
setItemsToBeRendered(activeRoutes);
|
|
175
|
+
}
|
|
176
|
+
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered, newItems]);
|
|
177
|
+
const items = getItems(itemsToBeRendered, params, !children);
|
|
178
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('Breadcrumbs', tokens, variant);
|
|
179
|
+
const metadata = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHelmetAsync.HelmetProvider, {
|
|
180
|
+
context: helmetContext,
|
|
181
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactHelmetAsync.Helmet, {
|
|
182
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("script", {
|
|
183
|
+
type: "application/ld+json",
|
|
184
|
+
children: `
|
|
185
|
+
{
|
|
186
|
+
"@context": "http://schema.org",
|
|
187
|
+
"@type": "BreadcrumbList",
|
|
188
|
+
"itemListElement": ${JSON.stringify(getStructuredData(items, baseUrl))}
|
|
189
|
+
}
|
|
190
|
+
`
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("nav", {
|
|
195
|
+
"aria-label": "Breadcrumb",
|
|
196
|
+
ref: ref,
|
|
197
|
+
...selectProps(rest),
|
|
198
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
|
|
199
|
+
iconContainerSize: themeTokens.iconContainerSize,
|
|
200
|
+
children: items.map(_ref4 => {
|
|
201
|
+
let {
|
|
202
|
+
href,
|
|
203
|
+
current,
|
|
204
|
+
breadcrumbName,
|
|
205
|
+
LinkRouter: ItemLinkRouter = LinkRouter,
|
|
206
|
+
linkRouterProps: itemLinkRouterProps,
|
|
207
|
+
onPress,
|
|
208
|
+
...itemRest
|
|
209
|
+
} = _ref4;
|
|
210
|
+
return /*#__PURE__*/(0, _react.createElement)(_Item.default, {
|
|
211
|
+
...itemRest,
|
|
212
|
+
current: current,
|
|
213
|
+
href: href,
|
|
214
|
+
tokens: tokens,
|
|
215
|
+
key: href,
|
|
216
|
+
linkRouterProps: {
|
|
217
|
+
...linkRouterProps,
|
|
218
|
+
...itemLinkRouterProps
|
|
219
|
+
},
|
|
220
|
+
variant: {
|
|
221
|
+
...variant,
|
|
222
|
+
size: 'micro'
|
|
223
|
+
},
|
|
224
|
+
LinkRouter: ItemLinkRouter,
|
|
225
|
+
onPress: onPress
|
|
226
|
+
}, breadcrumbName);
|
|
227
|
+
})
|
|
228
|
+
}), metadata]
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
Breadcrumbs.displayName = 'Breadcrumbs';
|
|
232
|
+
Breadcrumbs.propTypes = {
|
|
233
|
+
...selectedSystemPropTypes,
|
|
234
|
+
tokens: (0, _componentsBase.getTokensPropType)('Breadcrumbs'),
|
|
235
|
+
..._componentsBase.withLinkRouter.propTypes,
|
|
236
|
+
/**
|
|
237
|
+
* Base URL used to build structured data.
|
|
238
|
+
*/
|
|
239
|
+
baseUrl: _propTypes.default.string,
|
|
240
|
+
/**
|
|
241
|
+
* A list of Items to be used as an alternative to the `routes` prop.
|
|
242
|
+
*/
|
|
243
|
+
children: (0, _componentsBase.componentPropType)('Item'),
|
|
244
|
+
/**
|
|
245
|
+
* React Router params.
|
|
246
|
+
*/
|
|
247
|
+
params: _propTypes.default.object,
|
|
248
|
+
/**
|
|
249
|
+
* An array of routes to be displayed as breadcrumbs.
|
|
250
|
+
*/
|
|
251
|
+
routes: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
252
|
+
path: _propTypes.default.string,
|
|
253
|
+
breadcrumbName: _propTypes.default.string
|
|
254
|
+
})),
|
|
255
|
+
/**
|
|
256
|
+
* Variant to render.
|
|
257
|
+
*/
|
|
258
|
+
variant: _propTypes.default.shape({
|
|
259
|
+
inverse: _propTypes.default.bool,
|
|
260
|
+
light: _propTypes.default.bool
|
|
261
|
+
})
|
|
262
|
+
};
|
|
263
|
+
Breadcrumbs.Item = _Item.default;
|
|
264
|
+
var _default = exports.default = Breadcrumbs;
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _utils = require("../../utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
+
const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig({
|
|
16
|
+
displayName: "Item__StyledItemContainer",
|
|
17
|
+
componentId: "components-web__sc-1rfdaul-0"
|
|
18
|
+
})({
|
|
19
|
+
display: 'inline-block',
|
|
20
|
+
paddingLeft: _ref => {
|
|
21
|
+
let {
|
|
22
|
+
listItemPadding
|
|
23
|
+
} = _ref;
|
|
24
|
+
return `${listItemPadding}px`;
|
|
25
|
+
},
|
|
26
|
+
lineHeight: _ref2 => {
|
|
27
|
+
let {
|
|
28
|
+
lineHeight,
|
|
29
|
+
fontSize
|
|
30
|
+
} = _ref2;
|
|
31
|
+
return `${Math.ceil(lineHeight * fontSize)}px`;
|
|
32
|
+
},
|
|
33
|
+
marginBottom: '8px'
|
|
34
|
+
});
|
|
35
|
+
const IconContainer = /*#__PURE__*/_styledComponents.default.span.withConfig({
|
|
36
|
+
displayName: "Item__IconContainer",
|
|
37
|
+
componentId: "components-web__sc-1rfdaul-1"
|
|
38
|
+
})({
|
|
39
|
+
display: 'inline-block',
|
|
40
|
+
paddingLeft: _ref3 => {
|
|
41
|
+
let {
|
|
42
|
+
iconPadding
|
|
43
|
+
} = _ref3;
|
|
44
|
+
return `${iconPadding}px`;
|
|
45
|
+
},
|
|
46
|
+
paddingRight: _ref4 => {
|
|
47
|
+
let {
|
|
48
|
+
iconPadding
|
|
49
|
+
} = _ref4;
|
|
50
|
+
return `${iconPadding}px`;
|
|
51
|
+
},
|
|
52
|
+
fontFamily: _ref5 => {
|
|
53
|
+
let {
|
|
54
|
+
fontName,
|
|
55
|
+
fontWeight
|
|
56
|
+
} = _ref5;
|
|
57
|
+
return (0, _componentsBase.applyTextStyles)({
|
|
58
|
+
fontName,
|
|
59
|
+
fontWeight
|
|
60
|
+
}).fontFamily;
|
|
61
|
+
},
|
|
62
|
+
height: _ref6 => {
|
|
63
|
+
let {
|
|
64
|
+
iconContainerSize
|
|
65
|
+
} = _ref6;
|
|
66
|
+
return `${iconContainerSize}px`;
|
|
67
|
+
},
|
|
68
|
+
width: _ref7 => {
|
|
69
|
+
let {
|
|
70
|
+
iconContainerSize,
|
|
71
|
+
iconPadding
|
|
72
|
+
} = _ref7;
|
|
73
|
+
return `${iconContainerSize + iconPadding * 2}px`;
|
|
74
|
+
},
|
|
75
|
+
verticalAlign: 'bottom'
|
|
76
|
+
});
|
|
77
|
+
const Item = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
|
|
78
|
+
let {
|
|
79
|
+
href,
|
|
80
|
+
children,
|
|
81
|
+
current = false,
|
|
82
|
+
tokens,
|
|
83
|
+
variant = {
|
|
84
|
+
light: true
|
|
85
|
+
},
|
|
86
|
+
// `light` variant (shared with the `Link` component) is default by design
|
|
87
|
+
LinkRouter,
|
|
88
|
+
linkRouterProps,
|
|
89
|
+
onPress,
|
|
90
|
+
...rest
|
|
91
|
+
} = _ref8;
|
|
92
|
+
const {
|
|
93
|
+
iconColor,
|
|
94
|
+
icon: ChevronRightIcon,
|
|
95
|
+
currentColor,
|
|
96
|
+
color,
|
|
97
|
+
iconSize,
|
|
98
|
+
fontSize,
|
|
99
|
+
fontWeight,
|
|
100
|
+
fontName,
|
|
101
|
+
lineHeight,
|
|
102
|
+
listItemPadding,
|
|
103
|
+
iconContainerSize,
|
|
104
|
+
iconPadding
|
|
105
|
+
} = (0, _componentsBase.useThemeTokens)('Breadcrumbs', tokens, variant);
|
|
106
|
+
const linkOptions = {
|
|
107
|
+
..._componentsBase.clickProps.toPressProps(selectProps(rest)),
|
|
108
|
+
href
|
|
109
|
+
};
|
|
110
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledItemContainer, {
|
|
111
|
+
listItemPadding: listItemPadding,
|
|
112
|
+
lineHeight: lineHeight,
|
|
113
|
+
fontSize: fontSize,
|
|
114
|
+
iconContainerSize: iconContainerSize,
|
|
115
|
+
children: current ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
116
|
+
tokens: {
|
|
117
|
+
color: currentColor,
|
|
118
|
+
fontSize,
|
|
119
|
+
fontWeight,
|
|
120
|
+
lineHeight
|
|
121
|
+
},
|
|
122
|
+
variant: variant,
|
|
123
|
+
children: children
|
|
124
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
125
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Link, {
|
|
126
|
+
...linkOptions,
|
|
127
|
+
ref: ref,
|
|
128
|
+
tokens: {
|
|
129
|
+
color,
|
|
130
|
+
blockFontSize: fontSize,
|
|
131
|
+
blockLineHeight: lineHeight
|
|
132
|
+
},
|
|
133
|
+
LinkRouter: LinkRouter,
|
|
134
|
+
linkRouterProps: linkRouterProps,
|
|
135
|
+
variant: variant,
|
|
136
|
+
onPress: onPress,
|
|
137
|
+
children: children
|
|
138
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(IconContainer, {
|
|
139
|
+
iconPadding: iconPadding,
|
|
140
|
+
fontName: fontName,
|
|
141
|
+
fontWeight: fontWeight,
|
|
142
|
+
iconContainerSize: iconContainerSize,
|
|
143
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronRightIcon, {
|
|
144
|
+
size: iconSize,
|
|
145
|
+
color: iconColor
|
|
146
|
+
})
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
Item.displayName = 'Item';
|
|
152
|
+
Item.propTypes = {
|
|
153
|
+
...selectedSystemPropTypes,
|
|
154
|
+
/**
|
|
155
|
+
* Breadcrumb text
|
|
156
|
+
*/
|
|
157
|
+
children: _propTypes.default.node.isRequired,
|
|
158
|
+
/**
|
|
159
|
+
* @ignore
|
|
160
|
+
*
|
|
161
|
+
* Indicates whether or not the Item should be as current/active
|
|
162
|
+
*/
|
|
163
|
+
current: _propTypes.default.bool,
|
|
164
|
+
/**
|
|
165
|
+
* Target URL. This will be converted to `to` if the `LinkRouter`
|
|
166
|
+
* prop is provided to the `Item` or parent `Breadcrumbs` element.
|
|
167
|
+
*/
|
|
168
|
+
href: _propTypes.default.string.isRequired,
|
|
169
|
+
/**
|
|
170
|
+
* Variant to render.
|
|
171
|
+
*/
|
|
172
|
+
variant: _propTypes.default.shape({
|
|
173
|
+
inverse: _propTypes.default.bool
|
|
174
|
+
}),
|
|
175
|
+
/**
|
|
176
|
+
* Function to be called when the Item is clicked.
|
|
177
|
+
*/
|
|
178
|
+
onPress: _propTypes.default.func
|
|
179
|
+
};
|
|
180
|
+
var _default = exports.default = Item;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "default", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Breadcrumbs.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _utils = require("../utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
15
|
+
const getAlignment = (rounded, textAlignToFlex) => {
|
|
16
|
+
if (textAlignToFlex) {
|
|
17
|
+
switch (textAlignToFlex) {
|
|
18
|
+
case 'left':
|
|
19
|
+
return 'flex-star';
|
|
20
|
+
case 'center':
|
|
21
|
+
return 'center';
|
|
22
|
+
default:
|
|
23
|
+
return 'flex-start';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return rounded ? 'center' : ' flex-start';
|
|
27
|
+
};
|
|
28
|
+
const verticalAlignToFlex = verticalAlign => {
|
|
29
|
+
switch (verticalAlign) {
|
|
30
|
+
case 'top':
|
|
31
|
+
return 'flex-start';
|
|
32
|
+
case 'middle':
|
|
33
|
+
return 'center';
|
|
34
|
+
case 'bottom':
|
|
35
|
+
return 'flex-end';
|
|
36
|
+
default:
|
|
37
|
+
return 'top';
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const CalloutContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
41
|
+
displayName: "Callout__CalloutContainer",
|
|
42
|
+
componentId: "components-web__sc-1a7ptx-0"
|
|
43
|
+
})(_ref => {
|
|
44
|
+
let {
|
|
45
|
+
rounded,
|
|
46
|
+
verticalAlign,
|
|
47
|
+
textAlignToFlex,
|
|
48
|
+
background,
|
|
49
|
+
gap,
|
|
50
|
+
borderRadius,
|
|
51
|
+
padding
|
|
52
|
+
} = _ref;
|
|
53
|
+
return {
|
|
54
|
+
background,
|
|
55
|
+
display: 'flex',
|
|
56
|
+
gap,
|
|
57
|
+
borderRadius,
|
|
58
|
+
padding,
|
|
59
|
+
justifyContent: getAlignment(rounded, textAlignToFlex),
|
|
60
|
+
alignItems: verticalAlignToFlex(verticalAlign)
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
const Callout = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
64
|
+
let {
|
|
65
|
+
icon,
|
|
66
|
+
children,
|
|
67
|
+
verticalAlign,
|
|
68
|
+
textAlignToFlex,
|
|
69
|
+
tokens,
|
|
70
|
+
variant = {},
|
|
71
|
+
...rest
|
|
72
|
+
} = _ref2;
|
|
73
|
+
const {
|
|
74
|
+
background,
|
|
75
|
+
gap,
|
|
76
|
+
borderRadius,
|
|
77
|
+
paddingLeft,
|
|
78
|
+
paddingRight,
|
|
79
|
+
paddingTop,
|
|
80
|
+
paddingBottom,
|
|
81
|
+
color
|
|
82
|
+
} = (0, _componentsBase.useThemeTokens)('Callout', tokens, variant);
|
|
83
|
+
const {
|
|
84
|
+
rounded = false,
|
|
85
|
+
size = 'medium'
|
|
86
|
+
} = variant;
|
|
87
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(CalloutContainer, {
|
|
88
|
+
size: size,
|
|
89
|
+
rounded: rounded,
|
|
90
|
+
"data-testid": "callout-container",
|
|
91
|
+
verticalAlign: verticalAlign,
|
|
92
|
+
textAlignToFlex: textAlignToFlex,
|
|
93
|
+
background: background,
|
|
94
|
+
gap: gap,
|
|
95
|
+
borderRadius: borderRadius,
|
|
96
|
+
padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
|
|
97
|
+
ref: ref,
|
|
98
|
+
...selectProps(rest),
|
|
99
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
|
|
100
|
+
tokens: {
|
|
101
|
+
color
|
|
102
|
+
},
|
|
103
|
+
icon: icon,
|
|
104
|
+
variant: {
|
|
105
|
+
rank: 'primary',
|
|
106
|
+
size
|
|
107
|
+
}
|
|
108
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
109
|
+
variant: {
|
|
110
|
+
size,
|
|
111
|
+
compact: size === 'small'
|
|
112
|
+
},
|
|
113
|
+
tokens: {
|
|
114
|
+
color
|
|
115
|
+
},
|
|
116
|
+
children: children
|
|
117
|
+
})]
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
Callout.displayName = 'Callout';
|
|
121
|
+
Callout.propTypes = {
|
|
122
|
+
...selectedSystemPropTypes,
|
|
123
|
+
tokens: (0, _componentsBase.getTokensPropType)('Callout'),
|
|
124
|
+
/**
|
|
125
|
+
* Icon to display on the left side of the Callout
|
|
126
|
+
*/
|
|
127
|
+
icon: _propTypes.default.elementType,
|
|
128
|
+
/**
|
|
129
|
+
* Children nodes that can be added
|
|
130
|
+
*/
|
|
131
|
+
children: _propTypes.default.node.isRequired,
|
|
132
|
+
/**
|
|
133
|
+
* To change the horizontal alignment of the Callout's text
|
|
134
|
+
*/
|
|
135
|
+
textAlignToFlex: _propTypes.default.oneOf(['center', 'left']),
|
|
136
|
+
/**
|
|
137
|
+
* To change the vertical alignment of the Callout's icon
|
|
138
|
+
*/
|
|
139
|
+
verticalAlign: _propTypes.default.oneOf(['top', 'middle', 'bottom'])
|
|
140
|
+
};
|
|
141
|
+
var _default = exports.default = Callout;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Callout = _interopRequireDefault(require("./Callout"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _Callout.default;
|