@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,257 @@
|
|
|
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 _CardContent = _interopRequireDefault(require("./CardContent"));
|
|
12
|
+
var _CardFooter = _interopRequireDefault(require("./CardFooter"));
|
|
13
|
+
var _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
|
|
14
|
+
var _ConditionalWrapper = _interopRequireDefault(require("../shared/ConditionalWrapper"));
|
|
15
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
// Passes React Native-oriented system props through UDS Card
|
|
20
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* A basic card component, unstyled by default.
|
|
24
|
+
*
|
|
25
|
+
* ## Component API
|
|
26
|
+
*
|
|
27
|
+
* ### With Footer
|
|
28
|
+
*
|
|
29
|
+
* Pass any component or simply a string in the `footer` prop in order to render
|
|
30
|
+
* a card with a footer (which uses the `alternative` background).
|
|
31
|
+
*
|
|
32
|
+
* ### With Full Bleed Content
|
|
33
|
+
*
|
|
34
|
+
* Use `fullBleedContent` prop to add a full bleed style image, video or other content to the
|
|
35
|
+
* card. This prop accepts an object with the following properties:
|
|
36
|
+
* - `alt`: alt tag for an image,
|
|
37
|
+
* - `src`: default image source,
|
|
38
|
+
* - `position`: `none`, `bottom`, `left`, `right` or `top`, depending on where you would like your full bleed image to be placed,
|
|
39
|
+
* - `imgCol`: set the span of the image per viewport (based on 12 column value for width of card) when `position` of image is on `left` or `right`
|
|
40
|
+
* - all the props from the `ResponsiveImage` component in case you want that full bleed image to be responsive,
|
|
41
|
+
* - `content`: pass a custom JSX to be used for rendering of the full bleed content (defaults to `ResponsiveImage`
|
|
42
|
+
* receiving the other props).
|
|
43
|
+
*
|
|
44
|
+
* Note that `position` can be responsive, i.e. different for different viewports. A full bleed content with position
|
|
45
|
+
* {xs: 'none', md: 'left'} for example, will have a full bleed content to the left of card content when viewed on desktops
|
|
46
|
+
* viewports, and no content when viewed on mobile viewports.
|
|
47
|
+
*
|
|
48
|
+
* ## Accessibility
|
|
49
|
+
* `Card` component accepts all the standard accessibility props.
|
|
50
|
+
*/
|
|
51
|
+
const DynamicWidthContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
52
|
+
displayName: "Card__DynamicWidthContainer",
|
|
53
|
+
componentId: "components-web__sc-1elbtwd-0"
|
|
54
|
+
})(_ref => {
|
|
55
|
+
let {
|
|
56
|
+
width,
|
|
57
|
+
display,
|
|
58
|
+
borderRadius,
|
|
59
|
+
overflow
|
|
60
|
+
} = _ref;
|
|
61
|
+
return {
|
|
62
|
+
width,
|
|
63
|
+
display,
|
|
64
|
+
borderRadius,
|
|
65
|
+
overflow
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
const Card = /*#__PURE__*/_react.default.forwardRef(function () {
|
|
69
|
+
let {
|
|
70
|
+
children,
|
|
71
|
+
footer,
|
|
72
|
+
footerPadding,
|
|
73
|
+
fullBleedImage,
|
|
74
|
+
fullBleedContent = fullBleedImage,
|
|
75
|
+
tokens = {},
|
|
76
|
+
variant,
|
|
77
|
+
interactiveCard,
|
|
78
|
+
onPress,
|
|
79
|
+
dataSet,
|
|
80
|
+
backgroundImage,
|
|
81
|
+
...rest
|
|
82
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
83
|
+
fullBleedContent: {
|
|
84
|
+
position: null
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
let ref = arguments.length > 1 ? arguments[1] : undefined;
|
|
88
|
+
const {
|
|
89
|
+
contentStackAlign,
|
|
90
|
+
contentStackDirection,
|
|
91
|
+
fullBleedContentPosition,
|
|
92
|
+
fullBleedContentProps
|
|
93
|
+
} = (0, _FullBleedContent.useFullBleedContentProps)(fullBleedContent);
|
|
94
|
+
const {
|
|
95
|
+
imgCol
|
|
96
|
+
} = fullBleedContentProps;
|
|
97
|
+
|
|
98
|
+
// If the card has rounded corners and a full bleed image, we need to apply
|
|
99
|
+
// those corners on the image as well, but partially
|
|
100
|
+
const {
|
|
101
|
+
borderRadius
|
|
102
|
+
} = (0, _componentsBase.useThemeTokens)('Card', tokens, variant);
|
|
103
|
+
const getThemeTokens = (0, _componentsBase.useThemeTokensCallback)('Card', interactiveCard?.tokens, {
|
|
104
|
+
interactive: true,
|
|
105
|
+
...(interactiveCard?.variant || {})
|
|
106
|
+
});
|
|
107
|
+
const hasFooter = Boolean(footer);
|
|
108
|
+
const fullBleedBorderRadius = (0, _FullBleedContent.getFullBleedBorderRadius)(borderRadius, fullBleedContentPosition, hasFooter);
|
|
109
|
+
|
|
110
|
+
// takes imgCol from fullBleedContent if present, to dynamically set width of image
|
|
111
|
+
// card content will adapt to the size of image to add up to 100% width of card width
|
|
112
|
+
// pass as props to ConditionalWrapper
|
|
113
|
+
const imgColCurrentViewport = (0, _componentsBase.useResponsiveProp)(imgCol);
|
|
114
|
+
const maxCol = 12;
|
|
115
|
+
const fullBleedImageWidth = `${imgColCurrentViewport / maxCol * 100}%`;
|
|
116
|
+
const adaptiveContentWidth = `${(maxCol - imgColCurrentViewport) / maxCol * 100}%`;
|
|
117
|
+
const isImageWidthAdjustable = imgCol && (fullBleedContentPosition === 'left' || fullBleedContentPosition === 'right');
|
|
118
|
+
const contentWrapperStyleProps = {
|
|
119
|
+
width: adaptiveContentWidth,
|
|
120
|
+
display: imgColCurrentViewport >= maxCol ? 'none' : undefined
|
|
121
|
+
};
|
|
122
|
+
const imageWrapperStyleProps = {
|
|
123
|
+
width: fullBleedImageWidth,
|
|
124
|
+
borderRadius: imgColCurrentViewport >= maxCol ? borderRadius : undefined,
|
|
125
|
+
overflow: imgColCurrentViewport >= maxCol ? 'hidden' : undefined,
|
|
126
|
+
display: imgColCurrentViewport === 0 ? 'none' : undefined
|
|
127
|
+
};
|
|
128
|
+
const columnFlex = {
|
|
129
|
+
flexGrow: interactiveCard?.body ? 0 : 1,
|
|
130
|
+
flexShrink: 1,
|
|
131
|
+
justifyContent: 'space-between'
|
|
132
|
+
};
|
|
133
|
+
// When interactive area is present, spacing tokens should only be applied
|
|
134
|
+
// to individual Card sections, not Card as a whole
|
|
135
|
+
const {
|
|
136
|
+
paddingTop,
|
|
137
|
+
paddingBottom,
|
|
138
|
+
paddingLeft,
|
|
139
|
+
paddingRight,
|
|
140
|
+
...restOfTokens
|
|
141
|
+
} = tokens;
|
|
142
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Card, {
|
|
143
|
+
ref: ref,
|
|
144
|
+
variant: {
|
|
145
|
+
...variant,
|
|
146
|
+
padding: 'custom'
|
|
147
|
+
},
|
|
148
|
+
tokens: restOfTokens,
|
|
149
|
+
backgroundImage: backgroundImage,
|
|
150
|
+
...selectProps(rest),
|
|
151
|
+
children: [interactiveCard?.body ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.PressableCardBase, {
|
|
152
|
+
ref: ref,
|
|
153
|
+
tokens: getThemeTokens,
|
|
154
|
+
dataSet: dataSet,
|
|
155
|
+
onPress: onPress,
|
|
156
|
+
...selectProps(rest),
|
|
157
|
+
children: typeof interactiveCard?.body === 'function' ? interactiveCard.body() : interactiveCard.body
|
|
158
|
+
}) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.StackView, {
|
|
159
|
+
direction: contentStackDirection,
|
|
160
|
+
tokens: {
|
|
161
|
+
...columnFlex,
|
|
162
|
+
alignItems: contentStackAlign
|
|
163
|
+
},
|
|
164
|
+
space: 0,
|
|
165
|
+
children: [children ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
|
|
166
|
+
WrapperComponent: DynamicWidthContainer,
|
|
167
|
+
wrapperProps: contentWrapperStyleProps,
|
|
168
|
+
condition: isImageWidthAdjustable,
|
|
169
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardContent.default, {
|
|
170
|
+
tokens: tokens,
|
|
171
|
+
variant: variant,
|
|
172
|
+
withFooter: hasFooter,
|
|
173
|
+
children: children
|
|
174
|
+
})
|
|
175
|
+
}) : null, fullBleedContentPosition !== 'none' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.default, {
|
|
176
|
+
WrapperComponent: DynamicWidthContainer,
|
|
177
|
+
wrapperProps: imageWrapperStyleProps,
|
|
178
|
+
condition: isImageWidthAdjustable,
|
|
179
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_FullBleedContent.default, {
|
|
180
|
+
borderRadius: fullBleedBorderRadius,
|
|
181
|
+
...fullBleedContentProps,
|
|
182
|
+
position: fullBleedContentPosition
|
|
183
|
+
})
|
|
184
|
+
})]
|
|
185
|
+
}) : null, footer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_CardFooter.default, {
|
|
186
|
+
padding: footerPadding,
|
|
187
|
+
tokens: tokens,
|
|
188
|
+
variant: variant,
|
|
189
|
+
children: footer
|
|
190
|
+
})]
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
const positionValues = ['none', 'bottom', 'left', 'right', 'top'];
|
|
194
|
+
const alignValues = ['start', 'end', 'center', 'stretch'];
|
|
195
|
+
const PositionedFullBleedContentPropType = _propTypes.default.shape({
|
|
196
|
+
position: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(positionValues)).isRequired,
|
|
197
|
+
align: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(alignValues)),
|
|
198
|
+
// eslint-disable-next-line react/forbid-foreign-prop-types
|
|
199
|
+
..._FullBleedContent.default.propTypes
|
|
200
|
+
});
|
|
201
|
+
Card.displayName = 'Card';
|
|
202
|
+
Card.propTypes = {
|
|
203
|
+
...selectedSystemPropTypes,
|
|
204
|
+
/**
|
|
205
|
+
* Card content.
|
|
206
|
+
*/
|
|
207
|
+
children: _propTypes.default.node,
|
|
208
|
+
/**
|
|
209
|
+
* Card footer.
|
|
210
|
+
*/
|
|
211
|
+
footer: _propTypes.default.node,
|
|
212
|
+
/**
|
|
213
|
+
* Custom card footer padding.
|
|
214
|
+
*/
|
|
215
|
+
footerPadding: _componentsBase.paddingProp.propType,
|
|
216
|
+
/**
|
|
217
|
+
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
218
|
+
*
|
|
219
|
+
* @deprecated
|
|
220
|
+
*/
|
|
221
|
+
fullBleedImage: PositionedFullBleedContentPropType,
|
|
222
|
+
/**
|
|
223
|
+
* Full bleed content to be placed on the card.
|
|
224
|
+
*/
|
|
225
|
+
fullBleedContent: PositionedFullBleedContentPropType,
|
|
226
|
+
/**
|
|
227
|
+
* Card tokens.
|
|
228
|
+
*/
|
|
229
|
+
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
230
|
+
/**
|
|
231
|
+
* Card variant.
|
|
232
|
+
*/
|
|
233
|
+
variant: _componentsBase.variantProp.propType,
|
|
234
|
+
/**
|
|
235
|
+
* Function to call on pressing the card.
|
|
236
|
+
* Note: This is only available when `interactive` variant is used.
|
|
237
|
+
*/
|
|
238
|
+
onPress: _propTypes.default.func,
|
|
239
|
+
/**
|
|
240
|
+
* Object to set interactive card's properties
|
|
241
|
+
*/
|
|
242
|
+
interactiveCard: _propTypes.default.shape({
|
|
243
|
+
body: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
|
|
244
|
+
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
245
|
+
variant: _componentsBase.variantProp.propType
|
|
246
|
+
}),
|
|
247
|
+
/**
|
|
248
|
+
* Apply background image to the card.
|
|
249
|
+
*/
|
|
250
|
+
backgroundImage: _propTypes.default.shape({
|
|
251
|
+
// src is either a URI string or an object when used responsively to provide different image sources for different screen sizes
|
|
252
|
+
src: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]).isRequired,
|
|
253
|
+
alt: _propTypes.default.string,
|
|
254
|
+
resizeMode: _componentsBase.responsiveProps.getTypeOptionallyByViewport(_propTypes.default.oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']))
|
|
255
|
+
})
|
|
256
|
+
};
|
|
257
|
+
var _default = exports.default = Card;
|
|
@@ -0,0 +1,97 @@
|
|
|
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 CardContentContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
16
|
+
displayName: "CardContent__CardContentContainer",
|
|
17
|
+
componentId: "components-web__sc-1k2501q-0"
|
|
18
|
+
})(_ref => {
|
|
19
|
+
let {
|
|
20
|
+
borderRadius,
|
|
21
|
+
paddingBottom,
|
|
22
|
+
paddingLeft,
|
|
23
|
+
paddingRight,
|
|
24
|
+
paddingTop,
|
|
25
|
+
withFooter,
|
|
26
|
+
contentAlignItems: alignItems,
|
|
27
|
+
contentFlexGrow: flexGrow,
|
|
28
|
+
contentFlexShrink: flexShrink,
|
|
29
|
+
contentJustifyContent: justifyContent,
|
|
30
|
+
borderWidth
|
|
31
|
+
} = _ref;
|
|
32
|
+
return {
|
|
33
|
+
// We need to make sure to have sharp corners on the bottom
|
|
34
|
+
// if the card has a footer
|
|
35
|
+
borderBottomLeftRadius: withFooter ? 0 : borderRadius,
|
|
36
|
+
borderBottomRightRadius: withFooter ? 0 : borderRadius,
|
|
37
|
+
borderTopLeftRadius: borderRadius,
|
|
38
|
+
borderTopRightRadius: borderRadius,
|
|
39
|
+
paddingBottom: paddingBottom - borderWidth,
|
|
40
|
+
paddingLeft: paddingLeft - borderWidth,
|
|
41
|
+
paddingRight: paddingRight - borderWidth,
|
|
42
|
+
paddingTop: paddingTop - borderWidth,
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'column',
|
|
45
|
+
alignItems,
|
|
46
|
+
flexGrow,
|
|
47
|
+
flexShrink,
|
|
48
|
+
justifyContent
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Card content, applying the card tokens as per the theme used.
|
|
54
|
+
*/
|
|
55
|
+
const CardContent = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
56
|
+
let {
|
|
57
|
+
children,
|
|
58
|
+
flexContent,
|
|
59
|
+
tokens,
|
|
60
|
+
variant,
|
|
61
|
+
withFooter = false,
|
|
62
|
+
...rest
|
|
63
|
+
} = _ref2;
|
|
64
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
65
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, variant, {
|
|
66
|
+
viewport
|
|
67
|
+
});
|
|
68
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardContentContainer, {
|
|
69
|
+
...themeTokens,
|
|
70
|
+
flexContent: flexContent,
|
|
71
|
+
withFooter: withFooter,
|
|
72
|
+
ref: ref,
|
|
73
|
+
...selectProps(rest),
|
|
74
|
+
children: children
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
CardContent.displayName = 'CardContent';
|
|
78
|
+
CardContent.propTypes = {
|
|
79
|
+
...selectedSystemPropTypes,
|
|
80
|
+
/**
|
|
81
|
+
* Card section content.
|
|
82
|
+
*/
|
|
83
|
+
children: _propTypes.default.node,
|
|
84
|
+
/**
|
|
85
|
+
* Card tokens.
|
|
86
|
+
*/
|
|
87
|
+
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
88
|
+
/**
|
|
89
|
+
* Card variant.
|
|
90
|
+
*/
|
|
91
|
+
variant: _componentsBase.variantProp.propType,
|
|
92
|
+
/**
|
|
93
|
+
* Whether the card has a footer.
|
|
94
|
+
*/
|
|
95
|
+
withFooter: _propTypes.default.bool
|
|
96
|
+
};
|
|
97
|
+
var _default = exports.default = CardContent;
|
|
@@ -0,0 +1,85 @@
|
|
|
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 CardFooterContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
16
|
+
displayName: "CardFooter__CardFooterContainer",
|
|
17
|
+
componentId: "components-web__sc-pm6vns-0"
|
|
18
|
+
})(_ref => {
|
|
19
|
+
let {
|
|
20
|
+
backgroundColor,
|
|
21
|
+
borderRadius,
|
|
22
|
+
paddingBottom,
|
|
23
|
+
paddingLeft,
|
|
24
|
+
paddingRight,
|
|
25
|
+
paddingTop
|
|
26
|
+
} = _ref;
|
|
27
|
+
return {
|
|
28
|
+
backgroundColor,
|
|
29
|
+
borderBottomLeftRadius: borderRadius,
|
|
30
|
+
borderBottomRightRadius: borderRadius,
|
|
31
|
+
// @todo circle back to the following non-standard value to
|
|
32
|
+
// see if it can be integrated into the palette
|
|
33
|
+
boxShadow: 'inset 0px 1px 3px rgba(0, 0, 0, 0.05)',
|
|
34
|
+
paddingBottom,
|
|
35
|
+
paddingLeft,
|
|
36
|
+
paddingRight,
|
|
37
|
+
paddingTop
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Card footer, applying the tokens as per the theme used.
|
|
43
|
+
*/
|
|
44
|
+
const CardFooter = _ref2 => {
|
|
45
|
+
let {
|
|
46
|
+
children,
|
|
47
|
+
padding,
|
|
48
|
+
tokens,
|
|
49
|
+
variant,
|
|
50
|
+
...rest
|
|
51
|
+
} = _ref2;
|
|
52
|
+
const viewport = (0, _componentsBase.useViewport)();
|
|
53
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('Card', tokens, {
|
|
54
|
+
...variant,
|
|
55
|
+
background: 'alternative'
|
|
56
|
+
}, {
|
|
57
|
+
viewport
|
|
58
|
+
});
|
|
59
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(CardFooterContainer, {
|
|
60
|
+
...themeTokens,
|
|
61
|
+
...padding,
|
|
62
|
+
...selectProps(rest),
|
|
63
|
+
children: children
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
CardFooter.propTypes = {
|
|
67
|
+
...selectedSystemPropTypes,
|
|
68
|
+
/**
|
|
69
|
+
* Card footer content.
|
|
70
|
+
*/
|
|
71
|
+
children: _propTypes.default.node,
|
|
72
|
+
/**
|
|
73
|
+
* Card footer padding.
|
|
74
|
+
*/
|
|
75
|
+
padding: _componentsBase.paddingProp.propType,
|
|
76
|
+
/**
|
|
77
|
+
* Card tokens.
|
|
78
|
+
*/
|
|
79
|
+
tokens: (0, _componentsBase.getTokensPropType)('Card'),
|
|
80
|
+
/**
|
|
81
|
+
* Card variant.
|
|
82
|
+
*/
|
|
83
|
+
variant: _componentsBase.variantProp.propType
|
|
84
|
+
};
|
|
85
|
+
var _default = exports.default = CardFooter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Card = _interopRequireDefault(require("./Card"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _Card.default;
|