@telus-uds/components-web 4.19.0 → 5.0.0-alpha.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 +12 -0
- package/CHANGELOG.md +24 -1
- package/lib/cjs/Badge/Badge.js +26 -27
- package/lib/cjs/BlockQuote/BlockQuote.js +24 -25
- package/lib/cjs/Breadcrumbs/{Item/Item.js → BreadcrumbItem.js} +36 -37
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +8 -10
- package/lib/cjs/Callout/Callout.js +24 -25
- package/lib/cjs/Card/Card.js +79 -89
- package/lib/cjs/Card/CardContent.js +53 -29
- package/lib/cjs/Card/CardFooter.js +28 -18
- package/lib/cjs/Countdown/Countdown.js +7 -8
- package/lib/cjs/Countdown/Segment.js +10 -11
- package/lib/cjs/Countdown/dictionary.js +2 -2
- package/lib/cjs/Countdown/types.js +2 -6
- package/lib/cjs/Countdown/useCountdown.js +2 -2
- package/lib/cjs/DatePicker/CalendarContainer.js +66 -67
- package/lib/cjs/DatePicker/DatePicker.js +27 -28
- package/lib/cjs/DatePicker/dictionary.js +3 -4
- package/lib/cjs/DatePicker/reactDatesCss.js +2 -3
- package/lib/cjs/Disclaimer/Disclaimer.js +28 -13
- package/lib/cjs/Footnote/Footnote.js +108 -109
- package/lib/cjs/Footnote/FootnoteLink.js +28 -19
- package/lib/cjs/Footnote/dictionary.js +2 -2
- package/lib/cjs/IconButton/IconButton.js +3 -4
- package/lib/cjs/Image/Image.js +9 -3
- package/lib/cjs/Image/server.js +4 -6
- package/lib/cjs/List/List.js +7 -3
- package/lib/cjs/List/ListItem.js +3 -4
- package/lib/cjs/NavigationBar/NavigationBar.js +8 -9
- package/lib/cjs/NavigationBar/NavigationItem.js +10 -11
- package/lib/cjs/NavigationBar/NavigationSubMenu.js +10 -11
- package/lib/cjs/NavigationBar/collapseItems.js +2 -2
- package/lib/cjs/NavigationBar/resolveItemSelection.js +2 -2
- package/lib/cjs/OptimizeImage/OptimizeImage.js +6 -8
- package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +3 -4
- package/lib/cjs/OptimizeImage/utils/getImageUrls.js +9 -10
- package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +3 -4
- package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/lib/cjs/OptimizeImage/utils/index.js +8 -9
- package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/lib/cjs/OrderedList/OrderedList.js +6 -9
- package/lib/cjs/OrderedList/OrderedListBase.js +4 -7
- package/lib/cjs/OrderedList/{Item.js → OrderedListItem.js} +46 -39
- package/lib/cjs/OrderedList/{ItemBase.js → OrderedListItemBase.js} +7 -7
- package/lib/cjs/OrderedList/constants.js +0 -1
- package/lib/cjs/Paragraph/Paragraph.js +10 -11
- package/lib/cjs/PreviewCard/PreviewCard.js +18 -27
- package/lib/cjs/PreviewCard/{AuthorDate.js → PreviewCardAuthorDate.js} +6 -6
- package/lib/cjs/PriceLockup/PriceLockup.js +61 -60
- package/lib/cjs/PriceLockup/dictionary.js +2 -2
- package/lib/cjs/PriceLockup/tokens.js +3 -3
- package/lib/cjs/Progress/ProgressBar.js +14 -17
- package/lib/cjs/QuantitySelector/QuantitySelector.js +8 -9
- package/lib/cjs/QuantitySelector/{SideButton.js → QuantitySelectorSideButton.js} +5 -6
- package/lib/cjs/QuantitySelector/dictionary.js +2 -2
- package/lib/cjs/ResponsiveImage/ResponsiveImage.js +3 -4
- package/lib/cjs/Ribbon/Ribbon.js +56 -65
- package/lib/cjs/SkeletonProvider/SkeletonImage.js +3 -4
- package/lib/cjs/SkeletonProvider/SkeletonProvider.js +10 -10
- package/lib/cjs/SkeletonProvider/SkeletonTypography.js +3 -4
- package/lib/cjs/Span/Span.js +6 -7
- package/lib/cjs/Spinner/Spinner.js +29 -29
- package/lib/cjs/Spinner/SpinnerContent.js +6 -7
- package/lib/cjs/StoryCard/StoryCard.js +17 -22
- package/lib/cjs/Table/Table.js +32 -25
- package/lib/cjs/Table/{Body.js → TableBody.js} +5 -6
- package/lib/cjs/Table/{Cell.js → TableCell.js} +59 -61
- package/lib/cjs/Table/{Header.js → TableHeader.js} +7 -8
- package/lib/cjs/Table/{Row.js → TableRow.js} +18 -19
- package/lib/cjs/Table/{SubHeading.js → TableSubHeading.js} +7 -8
- package/lib/cjs/TermsAndConditions/ExpandCollapse.js +18 -19
- package/lib/cjs/TermsAndConditions/TermsAndConditions.js +44 -44
- package/lib/cjs/TermsAndConditions/dictionary.js +2 -2
- package/lib/cjs/Testimonial/Testimonial.js +24 -31
- package/lib/cjs/Toast/Toast.js +28 -30
- package/lib/cjs/Video/ControlBar/ControlBar.js +48 -47
- package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +6 -6
- package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +30 -32
- package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +35 -35
- package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +42 -42
- package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +15 -15
- package/lib/cjs/Video/Video.js +27 -29
- package/lib/cjs/Video/videoText.js +3 -4
- package/lib/cjs/VideoPicker/VideoPicker.js +37 -33
- package/lib/cjs/VideoPicker/VideoPickerPlayer.js +5 -6
- package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +28 -25
- package/lib/cjs/VideoPicker/VideoSlider.js +3 -4
- package/lib/cjs/WaffleGrid/WaffleGrid.js +51 -50
- package/lib/cjs/WebVideo/WebVideo.js +7 -8
- package/lib/cjs/baseExports.js +84 -0
- package/lib/cjs/index.js +179 -105
- package/lib/cjs/server.js +2 -3
- package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +3 -3
- package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +28 -22
- package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +2 -2
- package/lib/cjs/shared/FullBleedContent/index.js +11 -10
- package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +2 -2
- package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +9 -9
- package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +50 -50
- package/lib/cjs/shared/VideoSplash/VideoSplash.js +12 -12
- package/lib/cjs/shared/VideoSplash/helpers.js +2 -3
- package/lib/cjs/utils/index.js +14 -15
- package/lib/cjs/utils/isElementFocusable.js +2 -2
- package/lib/cjs/utils/logger.js +2 -6
- package/lib/cjs/utils/media.js +1 -1
- package/lib/cjs/utils/renderStructuredContent.js +3 -4
- package/lib/cjs/utils/scrollToAnchor.js +2 -2
- package/lib/cjs/utils/ssr.js +2 -2
- package/lib/cjs/utils/theming/get-theme-from-server.js +2 -3
- package/lib/cjs/utils/theming/with-client-theme.js +2 -2
- package/lib/cjs/utils/theming/with-server-theme.js +4 -4
- package/lib/cjs/utils/transforms.js +2 -5
- package/lib/cjs/utils/useOverlaidPosition.js +2 -2
- package/lib/cjs/utils/useTypographyTheme.js +2 -2
- package/lib/esm/Badge/Badge.js +25 -26
- package/lib/esm/BlockQuote/BlockQuote.js +23 -24
- package/lib/esm/Breadcrumbs/{Item/Item.js → BreadcrumbItem.js} +35 -36
- package/lib/esm/Breadcrumbs/Breadcrumbs.js +6 -7
- package/lib/esm/Callout/Callout.js +23 -24
- package/lib/esm/Card/Card.js +63 -71
- package/lib/esm/Card/CardContent.js +52 -28
- package/lib/esm/Card/CardFooter.js +27 -18
- package/lib/esm/Countdown/Countdown.js +4 -5
- package/lib/esm/Countdown/Segment.js +8 -9
- package/lib/esm/Countdown/dictionary.js +1 -1
- package/lib/esm/Countdown/types.js +1 -5
- package/lib/esm/Countdown/useCountdown.js +2 -3
- package/lib/esm/DatePicker/CalendarContainer.js +64 -65
- package/lib/esm/DatePicker/DatePicker.js +18 -19
- package/lib/esm/DatePicker/dictionary.js +2 -3
- package/lib/esm/DatePicker/reactDatesCss.js +1 -2
- package/lib/esm/Disclaimer/Disclaimer.js +27 -12
- package/lib/esm/Footnote/Footnote.js +104 -104
- package/lib/esm/Footnote/FootnoteLink.js +26 -17
- package/lib/esm/Footnote/dictionary.js +1 -1
- package/lib/esm/IconButton/IconButton.js +2 -3
- package/lib/esm/Image/Image.js +10 -1
- package/lib/esm/Image/server.js +4 -4
- package/lib/esm/List/List.js +2 -2
- package/lib/esm/List/ListItem.js +2 -3
- package/lib/esm/NavigationBar/NavigationBar.js +5 -6
- package/lib/esm/NavigationBar/NavigationItem.js +9 -10
- package/lib/esm/NavigationBar/NavigationSubMenu.js +7 -8
- package/lib/esm/NavigationBar/collapseItems.js +2 -3
- package/lib/esm/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/esm/OptimizeImage/OptimizeImage.js +4 -6
- package/lib/esm/OptimizeImage/utils/getFallbackUrl.js +2 -2
- package/lib/esm/OptimizeImage/utils/getImageUrls.js +3 -3
- package/lib/esm/OptimizeImage/utils/getOptimizedUrl.js +2 -2
- package/lib/esm/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/lib/esm/OptimizeImage/utils/index.js +4 -4
- package/lib/esm/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/lib/esm/OrderedList/OrderedList.js +4 -7
- package/lib/esm/OrderedList/OrderedListBase.js +3 -6
- package/lib/esm/OrderedList/{Item.js → OrderedListItem.js} +45 -38
- package/lib/esm/OrderedList/{ItemBase.js → OrderedListItemBase.js} +5 -6
- package/lib/esm/OrderedList/constants.js +0 -1
- package/lib/esm/Paragraph/Paragraph.js +9 -10
- package/lib/esm/PreviewCard/PreviewCard.js +16 -21
- package/lib/esm/PreviewCard/{AuthorDate.js → PreviewCardAuthorDate.js} +4 -5
- package/lib/esm/PriceLockup/PriceLockup.js +57 -56
- package/lib/esm/PriceLockup/dictionary.js +1 -1
- package/lib/esm/PriceLockup/tokens.js +1 -1
- package/lib/esm/Progress/ProgressBar.js +13 -16
- package/lib/esm/QuantitySelector/QuantitySelector.js +6 -7
- package/lib/esm/QuantitySelector/{SideButton.js → QuantitySelectorSideButton.js} +4 -5
- package/lib/esm/QuantitySelector/dictionary.js +1 -1
- package/lib/esm/ResponsiveImage/ResponsiveImage.js +2 -3
- package/lib/esm/Ribbon/Ribbon.js +55 -64
- package/lib/esm/SkeletonProvider/SkeletonImage.js +2 -3
- package/lib/esm/SkeletonProvider/SkeletonProvider.js +6 -7
- package/lib/esm/SkeletonProvider/SkeletonTypography.js +2 -3
- package/lib/esm/Span/Span.js +5 -6
- package/lib/esm/Spinner/Spinner.js +24 -24
- package/lib/esm/Spinner/SpinnerContent.js +5 -6
- package/lib/esm/StoryCard/StoryCard.js +15 -16
- package/lib/esm/Table/Table.js +31 -24
- package/lib/esm/Table/{Body.js → TableBody.js} +4 -5
- package/lib/esm/Table/{Cell.js → TableCell.js} +57 -58
- package/lib/esm/Table/{Header.js → TableHeader.js} +6 -7
- package/lib/esm/Table/{Row.js → TableRow.js} +17 -18
- package/lib/esm/Table/{SubHeading.js → TableSubHeading.js} +6 -7
- package/lib/esm/TermsAndConditions/ExpandCollapse.js +18 -19
- package/lib/esm/TermsAndConditions/TermsAndConditions.js +40 -40
- package/lib/esm/TermsAndConditions/dictionary.js +1 -1
- package/lib/esm/Testimonial/Testimonial.js +22 -29
- package/lib/esm/Toast/Toast.js +26 -27
- package/lib/esm/Video/ControlBar/ControlBar.js +33 -33
- package/lib/esm/Video/ControlBar/Controls/VideoButton/VideoButton.js +5 -6
- package/lib/esm/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +28 -31
- package/lib/esm/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +33 -34
- package/lib/esm/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +38 -39
- package/lib/esm/Video/MiddleControlButton/MiddleControlButton.js +14 -15
- package/lib/esm/Video/Video.js +19 -21
- package/lib/esm/Video/videoText.js +2 -3
- package/lib/esm/VideoPicker/VideoPicker.js +32 -27
- package/lib/esm/VideoPicker/VideoPickerPlayer.js +3 -4
- package/lib/esm/VideoPicker/VideoPickerThumbnail.js +26 -23
- package/lib/esm/VideoPicker/VideoSlider.js +2 -3
- package/lib/esm/WaffleGrid/WaffleGrid.js +49 -46
- package/lib/esm/WebVideo/WebVideo.js +5 -6
- package/lib/esm/baseExports.js +1 -1
- package/lib/esm/index.js +46 -37
- package/lib/esm/server.js +1 -2
- package/lib/esm/shared/ConditionalWrapper/ConditionalWrapper.js +2 -3
- package/lib/esm/shared/FullBleedContent/FullBleedContent.js +25 -20
- package/lib/esm/shared/FullBleedContent/getFullBleedBorderRadius.js +2 -3
- package/lib/esm/shared/FullBleedContent/index.js +3 -4
- package/lib/esm/shared/FullBleedContent/useFullBleedContentProps.js +3 -5
- package/lib/esm/shared/VideoSplash/SplashButton/SplashButton.js +8 -9
- package/lib/esm/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +48 -49
- package/lib/esm/shared/VideoSplash/VideoSplash.js +8 -9
- package/lib/esm/shared/VideoSplash/helpers.js +1 -1
- package/lib/esm/utils/index.js +7 -7
- package/lib/esm/utils/isElementFocusable.js +2 -3
- package/lib/esm/utils/logger.js +0 -4
- package/lib/esm/utils/media.js +1 -1
- package/lib/esm/utils/renderStructuredContent.js +2 -3
- package/lib/esm/utils/scrollToAnchor.js +2 -3
- package/lib/esm/utils/ssr.js +2 -3
- package/lib/esm/utils/theming/get-theme-from-server.js +1 -1
- package/lib/esm/utils/theming/with-client-theme.js +2 -3
- package/lib/esm/utils/theming/with-server-theme.js +3 -4
- package/lib/esm/utils/transforms.js +1 -4
- package/lib/esm/utils/useOverlaidPosition.js +2 -3
- package/lib/esm/utils/useTypographyTheme.js +2 -3
- package/package.json +13 -22
- package/src/Badge/Badge.jsx +18 -20
- package/src/BlockQuote/BlockQuote.jsx +16 -18
- package/src/Breadcrumbs/{Item/Item.jsx → BreadcrumbItem.jsx} +20 -21
- package/src/Breadcrumbs/Breadcrumbs.jsx +6 -9
- package/src/Callout/Callout.jsx +16 -18
- package/src/Card/Card.jsx +59 -80
- package/src/Card/CardContent.jsx +52 -28
- package/src/Card/CardFooter.jsx +26 -12
- package/src/Countdown/Countdown.jsx +3 -5
- package/src/Countdown/Segment.jsx +6 -8
- package/src/Countdown/dictionary.js +1 -1
- package/src/Countdown/types.js +0 -2
- package/src/Countdown/useCountdown.js +1 -3
- package/src/DatePicker/CalendarContainer.jsx +65 -67
- package/src/DatePicker/DatePicker.jsx +17 -19
- package/src/DatePicker/dictionary.js +1 -3
- package/src/DatePicker/reactDatesCss.js +1 -3
- package/src/Disclaimer/Disclaimer.jsx +15 -8
- package/src/Footnote/Footnote.jsx +104 -93
- package/src/Footnote/FootnoteLink.jsx +16 -13
- package/src/Footnote/dictionary.js +1 -1
- package/src/IconButton/IconButton.jsx +1 -3
- package/src/Image/Image.jsx +9 -1
- package/src/Image/server.js +4 -4
- package/src/List/List.jsx +2 -2
- package/src/List/ListItem.jsx +1 -3
- package/src/NavigationBar/NavigationBar.jsx +4 -6
- package/src/NavigationBar/NavigationItem.jsx +6 -8
- package/src/NavigationBar/NavigationSubMenu.jsx +7 -8
- package/src/NavigationBar/collapseItems.js +1 -3
- package/src/NavigationBar/resolveItemSelection.js +1 -3
- package/src/OptimizeImage/OptimizeImage.jsx +3 -6
- package/src/OptimizeImage/utils/getFallbackUrl.js +2 -2
- package/src/OptimizeImage/utils/getImageUrls.js +3 -3
- package/src/OptimizeImage/utils/getOptimizedUrl.js +2 -9
- package/src/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/src/OptimizeImage/utils/index.js +4 -4
- package/src/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/src/OrderedList/OrderedList.jsx +3 -8
- package/src/OrderedList/OrderedListBase.jsx +2 -7
- package/src/OrderedList/{Item.jsx → OrderedListItem.jsx} +44 -32
- package/src/OrderedList/{ItemBase.jsx → OrderedListItemBase.jsx} +4 -4
- package/src/OrderedList/constants.js +0 -1
- package/src/Paragraph/Paragraph.jsx +7 -9
- package/src/PreviewCard/PreviewCard.jsx +16 -32
- package/src/PreviewCard/{AuthorDate.jsx → PreviewCardAuthorDate.jsx} +3 -5
- package/src/PriceLockup/PriceLockup.jsx +33 -31
- package/src/PriceLockup/dictionary.js +1 -1
- package/src/PriceLockup/tokens.js +1 -1
- package/src/Progress/ProgressBar.jsx +33 -30
- package/src/QuantitySelector/QuantitySelector.jsx +5 -7
- package/src/QuantitySelector/{SideButton.jsx → QuantitySelectorSideButton.jsx} +3 -4
- package/src/QuantitySelector/dictionary.js +1 -1
- package/src/ResponsiveImage/ResponsiveImage.jsx +1 -3
- package/src/Ribbon/Ribbon.jsx +35 -44
- package/src/SkeletonProvider/SkeletonImage.jsx +1 -3
- package/src/SkeletonProvider/SkeletonProvider.jsx +5 -9
- package/src/SkeletonProvider/SkeletonTypography.jsx +1 -3
- package/src/Span/Span.jsx +11 -11
- package/src/Spinner/Spinner.jsx +17 -19
- package/src/Spinner/SpinnerContent.jsx +4 -6
- package/src/StoryCard/StoryCard.jsx +15 -16
- package/src/Table/Table.jsx +81 -75
- package/src/Table/{Body.jsx → TableBody.jsx} +3 -5
- package/src/Table/{Cell.jsx → TableCell.jsx} +69 -65
- package/src/Table/{Header.jsx → TableHeader.jsx} +6 -8
- package/src/Table/{Row.jsx → TableRow.jsx} +11 -12
- package/src/Table/{SubHeading.jsx → TableSubHeading.jsx} +6 -8
- package/src/TermsAndConditions/ExpandCollapse.jsx +18 -19
- package/src/TermsAndConditions/TermsAndConditions.jsx +37 -37
- package/src/TermsAndConditions/dictionary.js +1 -1
- package/src/Testimonial/Testimonial.jsx +20 -28
- package/src/Toast/Toast.jsx +36 -35
- package/src/Video/ControlBar/ControlBar.jsx +28 -25
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +4 -6
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +26 -30
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +31 -33
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +40 -40
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +10 -12
- package/src/Video/Video.jsx +697 -683
- package/src/Video/videoText.js +1 -3
- package/src/VideoPicker/VideoPicker.jsx +37 -25
- package/src/VideoPicker/VideoPickerPlayer.jsx +2 -4
- package/src/VideoPicker/VideoPickerThumbnail.jsx +26 -15
- package/src/VideoPicker/VideoSlider.jsx +1 -3
- package/src/WaffleGrid/WaffleGrid.jsx +31 -27
- package/src/WebVideo/WebVideo.jsx +4 -6
- package/src/baseExports.js +27 -13
- package/src/index.js +46 -37
- package/src/server.js +1 -2
- package/src/shared/ConditionalWrapper/ConditionalWrapper.jsx +1 -3
- package/src/shared/FullBleedContent/FullBleedContent.jsx +26 -19
- package/src/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -3
- package/src/shared/FullBleedContent/index.js +3 -8
- package/src/shared/FullBleedContent/useFullBleedContentProps.js +2 -5
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +5 -7
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +25 -25
- package/src/shared/VideoSplash/VideoSplash.jsx +7 -9
- package/src/shared/VideoSplash/helpers.js +1 -1
- package/src/utils/index.js +7 -7
- package/src/utils/isElementFocusable.js +1 -3
- package/src/utils/logger.js +0 -5
- package/src/utils/media.js +1 -1
- package/src/utils/renderStructuredContent.jsx +1 -3
- package/src/utils/scrollToAnchor.js +1 -3
- package/src/utils/ssr.js +1 -3
- package/src/utils/theming/get-theme-from-server.js +1 -1
- package/src/utils/theming/with-client-theme.jsx +1 -3
- package/src/utils/theming/with-server-theme.jsx +2 -4
- package/src/utils/transforms.js +0 -2
- package/src/utils/useOverlaidPosition.js +1 -3
- package/src/utils/useTypographyTheme.js +1 -3
- package/types/Autocomplete.d.ts +1 -3
- package/types/Badge.d.ts +1 -3
- package/types/BaseProvider.d.ts +1 -3
- package/types/BlockQuote.d.ts +1 -3
- package/types/Box.d.ts +1 -3
- package/types/BreadcrumbItem.d.ts +1 -3
- package/types/Breadcrumbs.d.ts +2 -4
- package/types/Callout.d.ts +1 -3
- package/types/Card.d.ts +1 -3
- package/types/Cell.d.ts +1 -3
- package/types/ControlBar.d.ts +1 -3
- package/types/Countdown.d.ts +1 -3
- package/types/DatePicker.d.ts +1 -3
- package/types/FileUpload.d.ts +1 -3
- package/types/Footnote.d.ts +1 -3
- package/types/FootnoteLink.d.ts +1 -3
- package/types/Listbox.d.ts +1 -3
- package/types/MiddleControlButton.d.ts +1 -3
- package/types/MultiSelectFilter.d.ts +1 -3
- package/types/PriceLockup.d.ts +1 -3
- package/types/QuantitySelector.d.ts +1 -3
- package/types/Ribbon.d.ts +1 -3
- package/types/Spinner.d.ts +1 -3
- package/types/Table.d.ts +1 -3
- package/types/Tooltip.d.ts +1 -3
- package/types/TooltipButton.d.ts +1 -3
- package/types/Typography.d.ts +1 -3
- package/types/Video.d.ts +1 -3
- package/types/VideoButton.d.ts +1 -3
- package/types/VideoMenu.d.ts +1 -3
- package/types/VideoProgressBar.d.ts +1 -3
- package/types/VolumeSlider.d.ts +1 -3
- package/types/WebVideo.d.ts +1 -3
- package/lib/cjs/Badge/index.js +0 -9
- package/lib/cjs/BlockQuote/index.js +0 -9
- package/lib/cjs/Breadcrumbs/index.js +0 -13
- package/lib/cjs/Callout/index.js +0 -9
- package/lib/cjs/Card/index.js +0 -9
- package/lib/cjs/Countdown/index.js +0 -9
- package/lib/cjs/DatePicker/index.js +0 -9
- package/lib/cjs/Disclaimer/index.js +0 -13
- package/lib/cjs/Footnote/index.js +0 -11
- package/lib/cjs/IconButton/index.js +0 -9
- package/lib/cjs/Image/index.js +0 -20
- package/lib/cjs/List/index.js +0 -17
- package/lib/cjs/NavigationBar/index.js +0 -11
- package/lib/cjs/OptimizeImage/index.js +0 -9
- package/lib/cjs/OrderedList/index.js +0 -17
- package/lib/cjs/Paragraph/index.js +0 -9
- package/lib/cjs/PreviewCard/index.js +0 -9
- package/lib/cjs/PriceLockup/index.js +0 -9
- package/lib/cjs/Progress/index.js +0 -11
- package/lib/cjs/QuantitySelector/index.js +0 -9
- package/lib/cjs/ResponsiveImage/index.js +0 -9
- package/lib/cjs/Ribbon/index.js +0 -9
- package/lib/cjs/SkeletonProvider/index.js +0 -9
- package/lib/cjs/Span/index.js +0 -9
- package/lib/cjs/Spinner/index.js +0 -9
- package/lib/cjs/StoryCard/index.js +0 -9
- package/lib/cjs/Table/index.js +0 -24
- package/lib/cjs/TermsAndConditions/index.js +0 -13
- package/lib/cjs/Testimonial/index.js +0 -9
- package/lib/cjs/Toast/index.js +0 -9
- package/lib/cjs/Video/index.js +0 -9
- package/lib/cjs/VideoPicker/index.js +0 -9
- package/lib/cjs/WaffleGrid/index.js +0 -9
- package/lib/cjs/WebVideo/index.js +0 -9
- package/lib/cjs/shared/ConditionalWrapper/index.js +0 -9
- package/lib/esm/Badge/index.js +0 -2
- package/lib/esm/BlockQuote/index.js +0 -2
- package/lib/esm/Breadcrumbs/index.js +0 -1
- package/lib/esm/Callout/index.js +0 -2
- package/lib/esm/Card/index.js +0 -2
- package/lib/esm/Countdown/index.js +0 -2
- package/lib/esm/DatePicker/index.js +0 -2
- package/lib/esm/Disclaimer/index.js +0 -1
- package/lib/esm/Footnote/index.js +0 -4
- package/lib/esm/IconButton/index.js +0 -2
- package/lib/esm/Image/index.js +0 -9
- package/lib/esm/List/index.js +0 -5
- package/lib/esm/NavigationBar/index.js +0 -4
- package/lib/esm/OptimizeImage/index.js +0 -2
- package/lib/esm/OrderedList/index.js +0 -5
- package/lib/esm/Paragraph/index.js +0 -2
- package/lib/esm/PreviewCard/index.js +0 -2
- package/lib/esm/PriceLockup/index.js +0 -2
- package/lib/esm/Progress/index.js +0 -4
- package/lib/esm/QuantitySelector/index.js +0 -2
- package/lib/esm/ResponsiveImage/index.js +0 -2
- package/lib/esm/Ribbon/index.js +0 -2
- package/lib/esm/SkeletonProvider/index.js +0 -2
- package/lib/esm/Span/index.js +0 -2
- package/lib/esm/Spinner/index.js +0 -2
- package/lib/esm/StoryCard/index.js +0 -2
- package/lib/esm/Table/index.js +0 -17
- package/lib/esm/TermsAndConditions/index.js +0 -1
- package/lib/esm/Testimonial/index.js +0 -2
- package/lib/esm/Toast/index.js +0 -2
- package/lib/esm/Video/index.js +0 -2
- package/lib/esm/VideoPicker/index.js +0 -2
- package/lib/esm/WaffleGrid/index.js +0 -2
- package/lib/esm/WebVideo/index.js +0 -2
- package/lib/esm/shared/ConditionalWrapper/index.js +0 -2
- package/src/Badge/index.js +0 -3
- package/src/BlockQuote/index.js +0 -3
- package/src/Breadcrumbs/index.js +0 -1
- package/src/Callout/index.js +0 -3
- package/src/Card/index.js +0 -3
- package/src/Countdown/index.js +0 -3
- package/src/DatePicker/index.js +0 -3
- package/src/Disclaimer/index.js +0 -1
- package/src/Footnote/index.js +0 -6
- package/src/IconButton/index.js +0 -3
- package/src/Image/index.js +0 -10
- package/src/List/index.js +0 -8
- package/src/NavigationBar/index.js +0 -6
- package/src/OptimizeImage/index.js +0 -3
- package/src/OrderedList/index.js +0 -8
- package/src/Paragraph/index.js +0 -3
- package/src/PreviewCard/index.js +0 -3
- package/src/PriceLockup/index.js +0 -3
- package/src/Progress/index.js +0 -6
- package/src/QuantitySelector/index.js +0 -3
- package/src/ResponsiveImage/index.js +0 -3
- package/src/Ribbon/index.js +0 -3
- package/src/SkeletonProvider/index.js +0 -3
- package/src/Span/index.js +0 -3
- package/src/Spinner/index.js +0 -3
- package/src/StoryCard/index.js +0 -3
- package/src/Table/index.js +0 -20
- package/src/TermsAndConditions/index.js +0 -1
- package/src/Testimonial/index.js +0 -3
- package/src/Toast/index.js +0 -3
- package/src/Video/index.js +0 -3
- package/src/VideoPicker/index.js +0 -3
- package/src/WaffleGrid/index.js +0 -3
- package/src/WebVideo/index.js +0 -3
- package/src/shared/ConditionalWrapper/index.js +0 -3
package/lib/esm/Card/Card.js
CHANGED
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, useThemeTokensCallback, variantProp, a11yProps, viewProps, PressableCardBase, useResponsiveProp, hrefAttrsProp, useAllViewportTokens } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import CardContent from './CardContent';
|
|
6
|
-
import CardFooter from './CardFooter';
|
|
7
|
-
import FullBleedContent,
|
|
8
|
-
import ConditionalWrapper from '../shared/ConditionalWrapper';
|
|
5
|
+
import { CardContent } from './CardContent';
|
|
6
|
+
import { CardFooter } from './CardFooter';
|
|
7
|
+
import { FullBleedContent, getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
8
|
+
import { ConditionalWrapper } from '../shared/ConditionalWrapper/ConditionalWrapper';
|
|
9
9
|
|
|
10
10
|
// Passes React Native-oriented system props through UDS Card
|
|
11
11
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -97,31 +97,30 @@ const getCardContentTokens = function (baseTokens) {
|
|
|
97
97
|
* `Card` component accepts all the standard accessibility props.
|
|
98
98
|
*/
|
|
99
99
|
const DynamicWidthContainer = /*#__PURE__*/styled.div.withConfig({
|
|
100
|
-
shouldForwardProp: prop => !['marginTop', 'marginBottom', 'marginLeft', 'marginRight', 'height', 'alignSelf'].includes(prop),
|
|
101
100
|
displayName: "Card__DynamicWidthContainer",
|
|
102
101
|
componentId: "components-web__sc-1elbtwd-0"
|
|
103
102
|
})(_ref => {
|
|
104
103
|
let {
|
|
105
|
-
width,
|
|
106
|
-
display,
|
|
107
|
-
borderRadius,
|
|
108
|
-
overflow,
|
|
109
|
-
marginTop,
|
|
110
|
-
marginBottom,
|
|
111
|
-
marginLeft,
|
|
112
|
-
marginRight,
|
|
113
|
-
alignSelf
|
|
104
|
+
$width,
|
|
105
|
+
$display,
|
|
106
|
+
$borderRadius,
|
|
107
|
+
$overflow,
|
|
108
|
+
$marginTop,
|
|
109
|
+
$marginBottom,
|
|
110
|
+
$marginLeft,
|
|
111
|
+
$marginRight,
|
|
112
|
+
$alignSelf
|
|
114
113
|
} = _ref;
|
|
115
114
|
return {
|
|
116
|
-
width,
|
|
117
|
-
display,
|
|
118
|
-
borderRadius,
|
|
119
|
-
overflow,
|
|
120
|
-
marginTop,
|
|
121
|
-
marginBottom,
|
|
122
|
-
marginLeft,
|
|
123
|
-
marginRight,
|
|
124
|
-
alignSelf
|
|
115
|
+
width: $width,
|
|
116
|
+
display: $display,
|
|
117
|
+
borderRadius: $borderRadius,
|
|
118
|
+
overflow: $overflow,
|
|
119
|
+
marginTop: $marginTop,
|
|
120
|
+
marginBottom: $marginBottom,
|
|
121
|
+
marginLeft: $marginLeft,
|
|
122
|
+
marginRight: $marginRight,
|
|
123
|
+
alignSelf: $alignSelf
|
|
125
124
|
};
|
|
126
125
|
});
|
|
127
126
|
const InteractiveCardWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
@@ -138,8 +137,8 @@ const InteractiveOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
|
138
137
|
componentId: "components-web__sc-1elbtwd-2"
|
|
139
138
|
})(_ref2 => {
|
|
140
139
|
let {
|
|
141
|
-
overlayOpacity,
|
|
142
|
-
borderRadius
|
|
140
|
+
$overlayOpacity,
|
|
141
|
+
$borderRadius
|
|
143
142
|
} = _ref2;
|
|
144
143
|
return {
|
|
145
144
|
position: 'absolute',
|
|
@@ -147,8 +146,8 @@ const InteractiveOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
|
147
146
|
left: 0,
|
|
148
147
|
right: 0,
|
|
149
148
|
bottom: 0,
|
|
150
|
-
backgroundColor: `rgba(0, 0, 0, ${overlayOpacity || 0})`,
|
|
151
|
-
borderRadius,
|
|
149
|
+
backgroundColor: `rgba(0, 0, 0, ${$overlayOpacity || 0})`,
|
|
150
|
+
borderRadius: $borderRadius,
|
|
152
151
|
pointerEvents: 'none',
|
|
153
152
|
transition: 'background-color 0.2s ease',
|
|
154
153
|
zIndex: 1
|
|
@@ -159,9 +158,9 @@ const FocusBorder = /*#__PURE__*/styled.div.withConfig({
|
|
|
159
158
|
componentId: "components-web__sc-1elbtwd-3"
|
|
160
159
|
})(_ref3 => {
|
|
161
160
|
let {
|
|
162
|
-
borderWidth,
|
|
163
|
-
borderColor,
|
|
164
|
-
borderRadius
|
|
161
|
+
$borderWidth,
|
|
162
|
+
$borderColor,
|
|
163
|
+
$borderRadius
|
|
165
164
|
} = _ref3;
|
|
166
165
|
return {
|
|
167
166
|
position: 'absolute',
|
|
@@ -169,9 +168,9 @@ const FocusBorder = /*#__PURE__*/styled.div.withConfig({
|
|
|
169
168
|
left: 0,
|
|
170
169
|
right: 0,
|
|
171
170
|
bottom: 0,
|
|
172
|
-
borderWidth,
|
|
173
|
-
borderColor,
|
|
174
|
-
borderRadius,
|
|
171
|
+
borderWidth: $borderWidth,
|
|
172
|
+
borderColor: $borderColor,
|
|
173
|
+
borderRadius: $borderRadius,
|
|
175
174
|
borderStyle: 'solid',
|
|
176
175
|
pointerEvents: 'none',
|
|
177
176
|
zIndex: 2
|
|
@@ -182,16 +181,16 @@ const FullBleedPaddingWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
|
182
181
|
componentId: "components-web__sc-1elbtwd-4"
|
|
183
182
|
})(_ref4 => {
|
|
184
183
|
let {
|
|
185
|
-
paddingTop,
|
|
186
|
-
paddingBottom,
|
|
187
|
-
paddingLeft,
|
|
188
|
-
paddingRight
|
|
184
|
+
$paddingTop,
|
|
185
|
+
$paddingBottom,
|
|
186
|
+
$paddingLeft,
|
|
187
|
+
$paddingRight
|
|
189
188
|
} = _ref4;
|
|
190
189
|
return {
|
|
191
|
-
paddingTop,
|
|
192
|
-
paddingBottom,
|
|
193
|
-
paddingLeft,
|
|
194
|
-
paddingRight,
|
|
190
|
+
paddingTop: $paddingTop,
|
|
191
|
+
paddingBottom: $paddingBottom,
|
|
192
|
+
paddingLeft: $paddingLeft,
|
|
193
|
+
paddingRight: $paddingRight,
|
|
195
194
|
display: 'flex',
|
|
196
195
|
flexDirection: 'column'
|
|
197
196
|
};
|
|
@@ -217,13 +216,13 @@ const calculateFullBleedPadding = (themeTokens, fullBleedPadding, paddingSides)
|
|
|
217
216
|
return customTokens?.[tokenKey] ?? themeTokens[tokenKey] - borderWidth ?? 0;
|
|
218
217
|
};
|
|
219
218
|
return {
|
|
220
|
-
paddingTop: applyPadding('Top'),
|
|
221
|
-
paddingBottom: applyPadding('Bottom'),
|
|
222
|
-
paddingLeft: applyPadding('Left'),
|
|
223
|
-
paddingRight: applyPadding('Right')
|
|
219
|
+
$paddingTop: applyPadding('Top'),
|
|
220
|
+
$paddingBottom: applyPadding('Bottom'),
|
|
221
|
+
$paddingLeft: applyPadding('Left'),
|
|
222
|
+
$paddingRight: applyPadding('Right')
|
|
224
223
|
};
|
|
225
224
|
};
|
|
226
|
-
const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
225
|
+
export const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
227
226
|
let {
|
|
228
227
|
children,
|
|
229
228
|
footer,
|
|
@@ -382,13 +381,13 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
382
381
|
const isImageWidthAdjustable = hasValidImgCol && (fullBleedContentPosition === POSITION.LEFT || fullBleedContentPosition === POSITION.RIGHT);
|
|
383
382
|
const contentWrapperStyleProps = {
|
|
384
383
|
...(hasValidImgCol && {
|
|
385
|
-
width: adaptiveContentWidth
|
|
384
|
+
$width: adaptiveContentWidth
|
|
386
385
|
}),
|
|
387
386
|
...(hasValidImgCol && imgColCurrentViewport >= maxCol && {
|
|
388
|
-
display: 'none'
|
|
387
|
+
$display: 'none'
|
|
389
388
|
}),
|
|
390
389
|
...(fullBleedContentChildrenAlign && {
|
|
391
|
-
alignSelf: fullBleedContentChildrenAlign
|
|
390
|
+
$alignSelf: fullBleedContentChildrenAlign
|
|
392
391
|
})
|
|
393
392
|
};
|
|
394
393
|
const columnFlex = {
|
|
@@ -412,14 +411,14 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
412
411
|
const isVerticalFullBleed = fullBleedContentPosition === POSITION.TOP || fullBleedContentPosition === POSITION.BOTTOM;
|
|
413
412
|
const imageWrapperStyleProps = {
|
|
414
413
|
...(isImageWidthAdjustable && {
|
|
415
|
-
width: fullBleedImageWidth
|
|
414
|
+
$width: fullBleedImageWidth
|
|
416
415
|
}),
|
|
417
416
|
...(isImageWidthAdjustable && imgColCurrentViewport >= maxCol && {
|
|
418
|
-
borderRadius,
|
|
419
|
-
overflow: 'hidden'
|
|
417
|
+
$borderRadius: borderRadius,
|
|
418
|
+
$overflow: 'hidden'
|
|
420
419
|
}),
|
|
421
420
|
...(isImageWidthAdjustable && imgColCurrentViewport === 0 && {
|
|
422
|
-
display: 'none'
|
|
421
|
+
$display: 'none'
|
|
423
422
|
})
|
|
424
423
|
};
|
|
425
424
|
return /*#__PURE__*/_jsxs(CardBase, {
|
|
@@ -489,17 +488,11 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
489
488
|
wrapperProps: contentWrapperStyleProps,
|
|
490
489
|
condition: isImageWidthAdjustable,
|
|
491
490
|
children: /*#__PURE__*/_jsx(CardContent, {
|
|
492
|
-
tokens: {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}),
|
|
498
|
-
paddingTop: tokens.paddingTop !== undefined ? tokens.paddingTop : allThemeTokens.paddingTop,
|
|
499
|
-
paddingBottom: tokens.paddingBottom !== undefined ? tokens.paddingBottom : allThemeTokens.paddingBottom,
|
|
500
|
-
paddingLeft: tokens.paddingLeft !== undefined ? tokens.paddingLeft : allThemeTokens.paddingLeft,
|
|
501
|
-
paddingRight: tokens.paddingRight !== undefined ? tokens.paddingRight : allThemeTokens.paddingRight
|
|
502
|
-
},
|
|
491
|
+
tokens: getCardContentTokens(tokensWithoutBg, {
|
|
492
|
+
backgroundImage,
|
|
493
|
+
fullBleedContentChildrenAlign,
|
|
494
|
+
useTransparentBackground: true
|
|
495
|
+
}),
|
|
503
496
|
variant: variant,
|
|
504
497
|
withFooter: hasFooter,
|
|
505
498
|
backgroundImage: backgroundImage,
|
|
@@ -522,12 +515,12 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
522
515
|
})
|
|
523
516
|
})]
|
|
524
517
|
}), /*#__PURE__*/_jsx(InteractiveOverlay, {
|
|
525
|
-
overlayOpacity: overlayOpacity,
|
|
526
|
-
borderRadius: borderRadius
|
|
518
|
+
$overlayOpacity: overlayOpacity,
|
|
519
|
+
$borderRadius: borderRadius
|
|
527
520
|
}), showFocusBorder && /*#__PURE__*/_jsx(FocusBorder, {
|
|
528
|
-
borderWidth: `${focusTokens.borderWidth}px`,
|
|
529
|
-
borderColor: focusTokens.borderColor,
|
|
530
|
-
borderRadius: borderRadius
|
|
521
|
+
$borderWidth: `${focusTokens.borderWidth}px`,
|
|
522
|
+
$borderColor: focusTokens.borderColor,
|
|
523
|
+
$borderRadius: borderRadius
|
|
531
524
|
})]
|
|
532
525
|
});
|
|
533
526
|
}
|
|
@@ -685,5 +678,4 @@ Card.propTypes = {
|
|
|
685
678
|
* Data set for the card.
|
|
686
679
|
*/
|
|
687
680
|
dataSet: PropTypes.object
|
|
688
|
-
};
|
|
689
|
-
export default Card;
|
|
681
|
+
};
|
|
@@ -10,46 +10,46 @@ const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
10
10
|
componentId: "components-web__sc-1k2501q-0"
|
|
11
11
|
})(_ref => {
|
|
12
12
|
let {
|
|
13
|
-
borderRadius,
|
|
14
|
-
paddingBottom,
|
|
15
|
-
paddingLeft,
|
|
16
|
-
paddingRight,
|
|
17
|
-
paddingTop,
|
|
18
|
-
withFooter,
|
|
19
|
-
contentAlignItems: alignItems,
|
|
20
|
-
contentFlexGrow: flexGrow,
|
|
21
|
-
contentFlexShrink: flexShrink,
|
|
22
|
-
contentJustifyContent: justifyContent,
|
|
23
|
-
borderWidth,
|
|
24
|
-
alignSelf,
|
|
25
|
-
backgroundColor
|
|
13
|
+
$borderRadius,
|
|
14
|
+
$paddingBottom,
|
|
15
|
+
$paddingLeft,
|
|
16
|
+
$paddingRight,
|
|
17
|
+
$paddingTop,
|
|
18
|
+
$withFooter,
|
|
19
|
+
$contentAlignItems: alignItems,
|
|
20
|
+
$contentFlexGrow: flexGrow,
|
|
21
|
+
$contentFlexShrink: flexShrink,
|
|
22
|
+
$contentJustifyContent: justifyContent,
|
|
23
|
+
$borderWidth,
|
|
24
|
+
$alignSelf,
|
|
25
|
+
$backgroundColor
|
|
26
26
|
} = _ref;
|
|
27
27
|
return {
|
|
28
28
|
// We need to make sure to have sharp corners on the bottom
|
|
29
29
|
// if the card has a footer
|
|
30
|
-
borderBottomLeftRadius: withFooter ? 0 : borderRadius,
|
|
31
|
-
borderBottomRightRadius: withFooter ? 0 : borderRadius,
|
|
32
|
-
borderTopLeftRadius: borderRadius,
|
|
33
|
-
borderTopRightRadius: borderRadius,
|
|
34
|
-
paddingBottom: paddingBottom - borderWidth,
|
|
35
|
-
paddingLeft: paddingLeft - borderWidth,
|
|
36
|
-
paddingRight: paddingRight - borderWidth,
|
|
37
|
-
paddingTop: paddingTop - borderWidth,
|
|
30
|
+
borderBottomLeftRadius: $withFooter ? 0 : $borderRadius,
|
|
31
|
+
borderBottomRightRadius: $withFooter ? 0 : $borderRadius,
|
|
32
|
+
borderTopLeftRadius: $borderRadius,
|
|
33
|
+
borderTopRightRadius: $borderRadius,
|
|
34
|
+
paddingBottom: $paddingBottom - $borderWidth,
|
|
35
|
+
paddingLeft: $paddingLeft - $borderWidth,
|
|
36
|
+
paddingRight: $paddingRight - $borderWidth,
|
|
37
|
+
paddingTop: $paddingTop - $borderWidth,
|
|
38
38
|
display: 'flex',
|
|
39
39
|
flexDirection: 'column',
|
|
40
40
|
alignItems,
|
|
41
41
|
flexGrow,
|
|
42
42
|
flexShrink,
|
|
43
43
|
justifyContent,
|
|
44
|
-
alignSelf,
|
|
45
|
-
backgroundColor
|
|
44
|
+
alignSelf: $alignSelf,
|
|
45
|
+
backgroundColor: $backgroundColor
|
|
46
46
|
};
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Card content, applying the card tokens as per the theme used.
|
|
51
51
|
*/
|
|
52
|
-
const CardContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
52
|
+
export const CardContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
53
53
|
let {
|
|
54
54
|
children,
|
|
55
55
|
flexContent,
|
|
@@ -138,10 +138,35 @@ const CardContent = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
138
138
|
} else {
|
|
139
139
|
themeTokens = allTokens.current;
|
|
140
140
|
}
|
|
141
|
+
const {
|
|
142
|
+
borderRadius,
|
|
143
|
+
paddingBottom,
|
|
144
|
+
paddingLeft,
|
|
145
|
+
paddingRight,
|
|
146
|
+
paddingTop,
|
|
147
|
+
contentAlignItems,
|
|
148
|
+
contentFlexGrow,
|
|
149
|
+
contentFlexShrink,
|
|
150
|
+
contentJustifyContent,
|
|
151
|
+
borderWidth,
|
|
152
|
+
alignSelf,
|
|
153
|
+
backgroundColor
|
|
154
|
+
} = themeTokens;
|
|
141
155
|
return /*#__PURE__*/_jsx(CardContentContainer, {
|
|
142
|
-
|
|
156
|
+
$borderRadius: borderRadius,
|
|
157
|
+
$paddingBottom: paddingBottom,
|
|
158
|
+
$paddingLeft: paddingLeft,
|
|
159
|
+
$paddingRight: paddingRight,
|
|
160
|
+
$paddingTop: paddingTop,
|
|
161
|
+
$contentAlignItems: contentAlignItems,
|
|
162
|
+
$contentFlexGrow: contentFlexGrow,
|
|
163
|
+
$contentFlexShrink: contentFlexShrink,
|
|
164
|
+
$contentJustifyContent: contentJustifyContent,
|
|
165
|
+
$borderWidth: borderWidth,
|
|
166
|
+
$alignSelf: alignSelf,
|
|
167
|
+
$backgroundColor: backgroundColor,
|
|
143
168
|
flexContent: flexContent,
|
|
144
|
-
withFooter: withFooter,
|
|
169
|
+
$withFooter: withFooter,
|
|
145
170
|
ref: ref,
|
|
146
171
|
"data-media": mediaIds,
|
|
147
172
|
...selectProps(rest),
|
|
@@ -175,5 +200,4 @@ CardContent.propTypes = {
|
|
|
175
200
|
* When present, makes the CardContent background transparent.
|
|
176
201
|
*/
|
|
177
202
|
backgroundImage: PropTypes.object
|
|
178
|
-
};
|
|
179
|
-
export default CardContent;
|
|
203
|
+
};
|
|
@@ -10,31 +10,31 @@ const CardFooterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
10
10
|
componentId: "components-web__sc-pm6vns-0"
|
|
11
11
|
})(_ref => {
|
|
12
12
|
let {
|
|
13
|
-
backgroundColor,
|
|
14
|
-
borderRadius,
|
|
15
|
-
paddingBottom,
|
|
16
|
-
paddingLeft,
|
|
17
|
-
paddingRight,
|
|
18
|
-
paddingTop
|
|
13
|
+
$backgroundColor,
|
|
14
|
+
$borderRadius,
|
|
15
|
+
$paddingBottom,
|
|
16
|
+
$paddingLeft,
|
|
17
|
+
$paddingRight,
|
|
18
|
+
$paddingTop
|
|
19
19
|
} = _ref;
|
|
20
20
|
return {
|
|
21
|
-
backgroundColor,
|
|
22
|
-
borderBottomLeftRadius: borderRadius,
|
|
23
|
-
borderBottomRightRadius: borderRadius,
|
|
21
|
+
backgroundColor: $backgroundColor,
|
|
22
|
+
borderBottomLeftRadius: $borderRadius,
|
|
23
|
+
borderBottomRightRadius: $borderRadius,
|
|
24
24
|
// @todo circle back to the following non-standard value to
|
|
25
25
|
// see if it can be integrated into the palette
|
|
26
26
|
boxShadow: 'inset 0px 1px 3px rgba(0, 0, 0, 0.05)',
|
|
27
|
-
paddingBottom,
|
|
28
|
-
paddingLeft,
|
|
29
|
-
paddingRight,
|
|
30
|
-
paddingTop
|
|
27
|
+
paddingBottom: $paddingBottom,
|
|
28
|
+
paddingLeft: $paddingLeft,
|
|
29
|
+
paddingRight: $paddingRight,
|
|
30
|
+
paddingTop: $paddingTop
|
|
31
31
|
};
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Card footer, applying the tokens as per the theme used.
|
|
36
36
|
*/
|
|
37
|
-
const CardFooter = _ref2 => {
|
|
37
|
+
export const CardFooter = _ref2 => {
|
|
38
38
|
let {
|
|
39
39
|
children,
|
|
40
40
|
padding,
|
|
@@ -49,9 +49,19 @@ const CardFooter = _ref2 => {
|
|
|
49
49
|
}, {
|
|
50
50
|
viewport
|
|
51
51
|
});
|
|
52
|
+
const {
|
|
53
|
+
paddingBottom,
|
|
54
|
+
paddingLeft,
|
|
55
|
+
paddingRight,
|
|
56
|
+
paddingTop
|
|
57
|
+
} = padding || themeTokens;
|
|
52
58
|
return /*#__PURE__*/_jsx(CardFooterContainer, {
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
$paddingBottom: paddingBottom,
|
|
60
|
+
$paddingLeft: paddingLeft,
|
|
61
|
+
$paddingRight: paddingRight,
|
|
62
|
+
$paddingTop: paddingTop,
|
|
63
|
+
$borderRadius: themeTokens.borderRadius,
|
|
64
|
+
$backgroundColor: themeTokens.backgroundColor,
|
|
55
65
|
...selectProps(rest),
|
|
56
66
|
children: children
|
|
57
67
|
});
|
|
@@ -74,5 +84,4 @@ CardFooter.propTypes = {
|
|
|
74
84
|
* Card variant.
|
|
75
85
|
*/
|
|
76
86
|
variant: variantProp.propType
|
|
77
|
-
};
|
|
78
|
-
export default CardFooter;
|
|
87
|
+
};
|
|
@@ -6,8 +6,8 @@ import styled from 'styled-components';
|
|
|
6
6
|
// Reading these from the RN palette since they will be used to generate
|
|
7
7
|
// the `Typography` tokens
|
|
8
8
|
import { htmlAttrs, transformGradient } from '../utils';
|
|
9
|
-
import Segment from './Segment';
|
|
10
|
-
import useCountdown from './useCountdown';
|
|
9
|
+
import { Segment } from './Segment';
|
|
10
|
+
import { useCountdown } from './useCountdown';
|
|
11
11
|
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
const DAYS = 'days';
|
|
@@ -72,7 +72,7 @@ const getMainTextTokens = _ref2 => {
|
|
|
72
72
|
fontName: textTimerFontName
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
|
-
const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
75
|
+
export const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
76
76
|
let {
|
|
77
77
|
copy = 'en',
|
|
78
78
|
targetTime,
|
|
@@ -257,5 +257,4 @@ Countdown.propTypes = {
|
|
|
257
257
|
* Possible values: `'days'`, `'hours'`, `'minutes'`, `'seconds'`
|
|
258
258
|
*/
|
|
259
259
|
units: PropTypes.arrayOf(PropTypes.oneOf([DAYS, HOURS, MINUTES, SECONDS]))
|
|
260
|
-
};
|
|
261
|
-
export default Countdown;
|
|
260
|
+
};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { StackView, Typography, useCopy } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import dictionary from './dictionary';
|
|
5
|
+
import { dictionary } from './dictionary';
|
|
6
6
|
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
7
7
|
// !TODO: put this back
|
|
8
8
|
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants';
|
|
@@ -18,8 +18,8 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
18
18
|
componentId: "components-web__sc-yrh35y-0"
|
|
19
19
|
})(_ref => {
|
|
20
20
|
let {
|
|
21
|
-
segmentFontSize,
|
|
22
|
-
segmentWidth = 2,
|
|
21
|
+
$segmentFontSize,
|
|
22
|
+
$segmentWidth = 2,
|
|
23
23
|
variant: {
|
|
24
24
|
feature
|
|
25
25
|
}
|
|
@@ -29,7 +29,7 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
29
29
|
display: 'inline-flex',
|
|
30
30
|
...(feature && {
|
|
31
31
|
// This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
|
|
32
|
-
width: `${segmentFontSize * SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
|
|
32
|
+
width: `${$segmentFontSize * SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * $segmentWidth}px`,
|
|
33
33
|
display: 'flex'
|
|
34
34
|
})
|
|
35
35
|
};
|
|
@@ -37,7 +37,7 @@ const Container = /*#__PURE__*/styled.div.withConfig({
|
|
|
37
37
|
// A segment of the countdown string: we need to make sure it
|
|
38
38
|
// keeps its width constant to prevent the whole component from
|
|
39
39
|
// being automatically resized while using variable size fonts
|
|
40
|
-
const Segment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
40
|
+
export const Segment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
41
41
|
let {
|
|
42
42
|
copy = 'en',
|
|
43
43
|
segmentFontSize,
|
|
@@ -60,8 +60,8 @@ const Segment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
60
60
|
feature
|
|
61
61
|
} = variant;
|
|
62
62
|
return /*#__PURE__*/_jsx(Container, {
|
|
63
|
-
segmentFontSize: segmentFontSize,
|
|
64
|
-
segmentWidth: segmentWidth,
|
|
63
|
+
$segmentFontSize: segmentFontSize,
|
|
64
|
+
$segmentWidth: segmentWidth,
|
|
65
65
|
variant: variant,
|
|
66
66
|
ref: ref,
|
|
67
67
|
children: /*#__PURE__*/_jsxs(StackView, {
|
|
@@ -100,5 +100,4 @@ Segment.propTypes = {
|
|
|
100
100
|
labelMediaIds: PropTypes.string,
|
|
101
101
|
mainTextMediaIds: PropTypes.string,
|
|
102
102
|
variant: countdownVariantPropType
|
|
103
|
-
};
|
|
104
|
-
export default Segment;
|
|
103
|
+
};
|
|
@@ -17,8 +17,4 @@ export const dictionaryContentShape = PropTypes.shape({
|
|
|
17
17
|
minute: PropTypes.string.isRequired,
|
|
18
18
|
seconds: PropTypes.string.isRequired,
|
|
19
19
|
second: PropTypes.string.isRequired
|
|
20
|
-
});
|
|
21
|
-
export default {
|
|
22
|
-
countdownVariantPropType,
|
|
23
|
-
dictionaryContentShape
|
|
24
|
-
};
|
|
20
|
+
});
|
|
@@ -9,7 +9,7 @@ const getTimeCounts = countdown => {
|
|
|
9
9
|
const seconds = Math.floor(countdown % (1000 * 60) / 1000);
|
|
10
10
|
return [days, hours, minutes, seconds];
|
|
11
11
|
};
|
|
12
|
-
const useCountdown = targetTime => {
|
|
12
|
+
export const useCountdown = targetTime => {
|
|
13
13
|
const countdownTime = new Date(targetTime).getTime();
|
|
14
14
|
if (!countdownTime) {
|
|
15
15
|
throw new Error('Invalid target time is provided!');
|
|
@@ -22,5 +22,4 @@ const useCountdown = targetTime => {
|
|
|
22
22
|
return () => clearInterval(interval);
|
|
23
23
|
}, [countdownTime]);
|
|
24
24
|
return getTimeCounts(countdown);
|
|
25
|
-
};
|
|
26
|
-
export default useCountdown;
|
|
25
|
+
};
|