@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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import isSvgUrl from './isSvgUrl'
|
|
1
|
+
import { isSvgUrl } from './isSvgUrl'
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export function getFallbackUrl(url, dimension, size, quality) {
|
|
4
4
|
if (!isSvgUrl(url)) {
|
|
5
5
|
return `${url}?${dimension}=${size}&q=${quality}`
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import getOptimizedUrl from './getOptimizedUrl'
|
|
2
|
-
import getFallbackUrl from './getFallbackUrl'
|
|
1
|
+
import { getOptimizedUrl } from './getOptimizedUrl'
|
|
2
|
+
import { getFallbackUrl } from './getFallbackUrl'
|
|
3
3
|
|
|
4
|
-
export
|
|
4
|
+
export function getImageUrls(
|
|
5
5
|
contentfulAssetUrl,
|
|
6
6
|
dimension,
|
|
7
7
|
xs,
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
import isSvgUrl from './isSvgUrl'
|
|
1
|
+
import { isSvgUrl } from './isSvgUrl'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
url,
|
|
5
|
-
dimension,
|
|
6
|
-
size,
|
|
7
|
-
quality,
|
|
8
|
-
disableRetina,
|
|
9
|
-
supportsWebp
|
|
10
|
-
) {
|
|
3
|
+
export function getOptimizedUrl(url, dimension, size, quality, disableRetina, supportsWebp) {
|
|
11
4
|
if (!isSvgUrl(url)) {
|
|
12
5
|
let format = ''
|
|
13
6
|
|
|
@@ -6,7 +6,7 @@ let promise
|
|
|
6
6
|
* @see https://developers.google.com/speed/webp/faq#in_your_own_javascript
|
|
7
7
|
* @return {Promise<boolean>}
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export function hasWebpSupport() {
|
|
10
10
|
// cache the result, so that this function runs only once
|
|
11
11
|
if (!promise) {
|
|
12
12
|
promise = new Promise((resolve) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import getOptimizedUrl from './getOptimizedUrl'
|
|
2
|
-
import getFallbackUrl from './getFallbackUrl'
|
|
3
|
-
import hasWebpSupport from './hasWebpSupport'
|
|
4
|
-
import getImageUrls from './getImageUrls'
|
|
1
|
+
import { getOptimizedUrl } from './getOptimizedUrl'
|
|
2
|
+
import { getFallbackUrl } from './getFallbackUrl'
|
|
3
|
+
import { hasWebpSupport } from './hasWebpSupport'
|
|
4
|
+
import { getImageUrls } from './getImageUrls'
|
|
5
5
|
|
|
6
6
|
export { getOptimizedUrl, getFallbackUrl, hasWebpSupport, getImageUrls }
|
|
@@ -3,8 +3,7 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
import { getTokensPropType, selectSystemProps, variantProp } from '@telus-uds/components-base'
|
|
4
4
|
import styled from 'styled-components'
|
|
5
5
|
import { htmlAttrs } from '../utils'
|
|
6
|
-
import OrderedListBase from './OrderedListBase'
|
|
7
|
-
import Item from './Item'
|
|
6
|
+
import { OrderedListBase } from './OrderedListBase'
|
|
8
7
|
import { OL_COUNTER_NAME } from './constants'
|
|
9
8
|
|
|
10
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
@@ -18,7 +17,7 @@ const StyledOrderedListBase = styled(OrderedListBase)(({ start }) => ({
|
|
|
18
17
|
/**
|
|
19
18
|
* Themed semantic ordered list.
|
|
20
19
|
*/
|
|
21
|
-
const OrderedList = React.forwardRef(
|
|
20
|
+
export const OrderedList = React.forwardRef(
|
|
22
21
|
({ children, start = 1, variant = {}, tokens = {}, ...rest }, ref) => {
|
|
23
22
|
// Check if children is an array
|
|
24
23
|
const isChildrenArray = Array.isArray(children)
|
|
@@ -57,7 +56,7 @@ OrderedList.displayName = 'OrderedList'
|
|
|
57
56
|
OrderedList.propTypes = {
|
|
58
57
|
...selectedSystemPropTypes,
|
|
59
58
|
/**
|
|
60
|
-
* A list of ordered items wrapped in `
|
|
59
|
+
* A list of ordered items wrapped in `OrderedListItem`.
|
|
61
60
|
*/
|
|
62
61
|
children: PropTypes.node.isRequired,
|
|
63
62
|
/**
|
|
@@ -67,7 +66,3 @@ OrderedList.propTypes = {
|
|
|
67
66
|
variant: variantProp.propType,
|
|
68
67
|
tokens: getTokensPropType('OrderedList')
|
|
69
68
|
}
|
|
70
|
-
|
|
71
|
-
OrderedList.Item = Item
|
|
72
|
-
|
|
73
|
-
export default OrderedList
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import styled from 'styled-components'
|
|
4
|
-
import ItemBase from './ItemBase'
|
|
5
4
|
|
|
6
5
|
const StyledList = styled.ol({
|
|
7
6
|
display: 'flex',
|
|
@@ -14,12 +13,12 @@ const StyledList = styled.ol({
|
|
|
14
13
|
/**
|
|
15
14
|
* Semantic ordered list.
|
|
16
15
|
*/
|
|
17
|
-
const OrderedListBase = React.forwardRef(({ children, start = 1, ...rest }, ref) => (
|
|
16
|
+
export const OrderedListBase = React.forwardRef(({ children, start = 1, ...rest }, ref) => (
|
|
18
17
|
<StyledList {...rest} ref={ref} start={start}>
|
|
19
18
|
{children}
|
|
20
19
|
</StyledList>
|
|
21
20
|
))
|
|
22
|
-
OrderedListBase.displayName = '
|
|
21
|
+
OrderedListBase.displayName = 'OrderedListBase'
|
|
23
22
|
|
|
24
23
|
OrderedListBase.propTypes = {
|
|
25
24
|
/**
|
|
@@ -31,7 +30,3 @@ OrderedListBase.propTypes = {
|
|
|
31
30
|
*/
|
|
32
31
|
start: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
OrderedListBase.Item = ItemBase
|
|
36
|
-
|
|
37
|
-
export default OrderedListBase
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
wrapStringsInText
|
|
12
12
|
} from '@telus-uds/components-base'
|
|
13
13
|
import styled from 'styled-components'
|
|
14
|
-
import
|
|
14
|
+
import { OrderedListItemBase } from './OrderedListItemBase'
|
|
15
15
|
import { htmlAttrs } from '../utils'
|
|
16
16
|
import { OL_COUNTER_NAME } from './constants'
|
|
17
17
|
|
|
@@ -30,40 +30,40 @@ const selectItemTextStyles = (
|
|
|
30
30
|
lineHeight: itemLineHeight
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const StyledItemBase = styled(
|
|
33
|
+
const StyledItemBase = styled(OrderedListItemBase)(
|
|
34
34
|
({
|
|
35
|
-
interItemMargin,
|
|
36
|
-
itemBulletContainerWidth,
|
|
37
|
-
itemBulletTextAlign,
|
|
38
|
-
itemFontWeight,
|
|
39
|
-
itemFontSize,
|
|
40
|
-
itemFontName,
|
|
41
|
-
itemLineHeight,
|
|
42
|
-
themeOptions,
|
|
43
|
-
listGutter,
|
|
44
|
-
itemColor,
|
|
45
|
-
itemTextColor
|
|
35
|
+
$interItemMargin,
|
|
36
|
+
$itemBulletContainerWidth,
|
|
37
|
+
$itemBulletTextAlign,
|
|
38
|
+
$itemFontWeight,
|
|
39
|
+
$itemFontSize,
|
|
40
|
+
$itemFontName,
|
|
41
|
+
$itemLineHeight,
|
|
42
|
+
$themeOptions,
|
|
43
|
+
$listGutter,
|
|
44
|
+
$itemColor,
|
|
45
|
+
$itemTextColor
|
|
46
46
|
}) => ({
|
|
47
47
|
counterIncrement: OL_COUNTER_NAME,
|
|
48
|
-
'
|
|
48
|
+
'&::before': {
|
|
49
49
|
content: `counter(${OL_COUNTER_NAME})'.'`,
|
|
50
50
|
display: 'inline-block',
|
|
51
|
-
color: itemColor || itemTextColor,
|
|
52
|
-
width: itemBulletContainerWidth,
|
|
53
|
-
paddingRight: listGutter,
|
|
54
|
-
textAlign: itemBulletTextAlign,
|
|
51
|
+
color: $itemColor || $itemTextColor,
|
|
52
|
+
width: $itemBulletContainerWidth,
|
|
53
|
+
paddingRight: $listGutter,
|
|
54
|
+
textAlign: $itemBulletTextAlign,
|
|
55
55
|
flexShrink: 0,
|
|
56
56
|
whiteSpace: 'nowrap',
|
|
57
57
|
overflow: 'hidden',
|
|
58
58
|
...applyTextStyles({
|
|
59
|
-
fontWeight: itemFontWeight,
|
|
60
|
-
fontSize: itemFontSize,
|
|
61
|
-
fontName: itemFontName,
|
|
62
|
-
themeOptions
|
|
59
|
+
fontWeight: $itemFontWeight,
|
|
60
|
+
fontSize: $itemFontSize,
|
|
61
|
+
fontName: $itemFontName,
|
|
62
|
+
themeOptions: $themeOptions
|
|
63
63
|
}),
|
|
64
|
-
lineHeight: `${itemLineHeight * itemFontSize}px`
|
|
64
|
+
lineHeight: `${$itemLineHeight * $itemFontSize}px`
|
|
65
65
|
},
|
|
66
|
-
'
|
|
66
|
+
'&:not(:last-child)': { marginBottom: $interItemMargin }
|
|
67
67
|
})
|
|
68
68
|
)
|
|
69
69
|
|
|
@@ -73,7 +73,7 @@ const ItemContent = styled.div({
|
|
|
73
73
|
gap: 0
|
|
74
74
|
})
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
export const OrderedListItem = React.forwardRef(
|
|
77
77
|
({ children, counterName, title, tokens = {}, variant, ...rest }, ref) => {
|
|
78
78
|
// We are reusing some tokens from the list component here in order to provide a unified
|
|
79
79
|
// experience
|
|
@@ -92,13 +92,27 @@ const Item = React.forwardRef(
|
|
|
92
92
|
})
|
|
93
93
|
|
|
94
94
|
return (
|
|
95
|
-
<StyledItemBase
|
|
95
|
+
<StyledItemBase
|
|
96
|
+
ref={ref}
|
|
97
|
+
$themeOptions={themeOptions}
|
|
98
|
+
$interItemMargin={themeTokens.interItemMargin}
|
|
99
|
+
$itemBulletContainerWidth={themeTokens.itemBulletContainerWidth}
|
|
100
|
+
$itemBulletTextAlign={themeTokens.itemBulletTextAlign}
|
|
101
|
+
$itemFontWeight={themeTokens.itemFontWeight}
|
|
102
|
+
$itemFontSize={themeTokens.itemFontSize}
|
|
103
|
+
$itemFontName={themeTokens.itemFontName}
|
|
104
|
+
$itemLineHeight={themeTokens.itemLineHeight}
|
|
105
|
+
$listGutter={themeTokens.listGutter}
|
|
106
|
+
$itemColor={themeTokens.itemColor}
|
|
107
|
+
$itemTextColor={themeTokens.itemTextColor}
|
|
108
|
+
{...selectProps(rest)}
|
|
109
|
+
>
|
|
96
110
|
{title ? (
|
|
97
111
|
<StackView tokens={{ flexShrink: 1 }} space={0}>
|
|
98
112
|
<Typography variant={{ size: 'h4' }} tokens={headingTokens}>
|
|
99
113
|
{title}
|
|
100
114
|
</Typography>
|
|
101
|
-
<ItemContent
|
|
115
|
+
<ItemContent>{itemContent}</ItemContent>
|
|
102
116
|
</StackView>
|
|
103
117
|
) : (
|
|
104
118
|
<ItemContent>{itemContent}</ItemContent>
|
|
@@ -108,16 +122,16 @@ const Item = React.forwardRef(
|
|
|
108
122
|
}
|
|
109
123
|
)
|
|
110
124
|
|
|
111
|
-
|
|
125
|
+
OrderedListItem.displayName = 'OrderedListItem'
|
|
112
126
|
|
|
113
|
-
|
|
127
|
+
OrderedListItem.propTypes = {
|
|
114
128
|
...selectedSystemPropTypes,
|
|
115
129
|
/**
|
|
116
130
|
* Item content
|
|
117
131
|
*/
|
|
118
132
|
children: PropTypes.node.isRequired,
|
|
119
133
|
/**
|
|
120
|
-
* Defines the title of the `
|
|
134
|
+
* Defines the title of the `OrderedListItem`
|
|
121
135
|
*/
|
|
122
136
|
title: PropTypes.string,
|
|
123
137
|
/**
|
|
@@ -125,5 +139,3 @@ Item.propTypes = {
|
|
|
125
139
|
*/
|
|
126
140
|
tokens: getTokensPropType('OrderedList')
|
|
127
141
|
}
|
|
128
|
-
|
|
129
|
-
export default Item
|
|
@@ -6,13 +6,13 @@ const StyledItem = styled.li({
|
|
|
6
6
|
display: 'flex'
|
|
7
7
|
})
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
export const OrderedListItemBase = ({ children, ...rest }) => (
|
|
10
|
+
<StyledItem {...rest}>{children}</StyledItem>
|
|
11
|
+
)
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
OrderedListItemBase.propTypes = {
|
|
12
14
|
/**
|
|
13
15
|
* Item content
|
|
14
16
|
*/
|
|
15
17
|
children: PropTypes.node.isRequired
|
|
16
18
|
}
|
|
17
|
-
|
|
18
|
-
export default Item
|
|
@@ -7,10 +7,10 @@ import { htmlAttrs, useTypographyTheme } from '../utils'
|
|
|
7
7
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
8
8
|
|
|
9
9
|
const StyledParagraph = styled.p`
|
|
10
|
-
${({ align }) => (align ? `text-align: ${align};` : '')}
|
|
11
|
-
${({ linesBetween }) => `
|
|
12
|
-
margin-block-start: ${linesBetween}em;
|
|
13
|
-
margin-block-end: ${linesBetween}em;
|
|
10
|
+
${({ $align }) => ($align ? `text-align: ${$align};` : '')}
|
|
11
|
+
${({ $linesBetween }) => `
|
|
12
|
+
margin-block-start: ${$linesBetween}em;
|
|
13
|
+
margin-block-end: ${$linesBetween}em;
|
|
14
14
|
`}
|
|
15
15
|
&:first-child {
|
|
16
16
|
margin-block-start: 0em;
|
|
@@ -30,15 +30,15 @@ const StyledParagraph = styled.p`
|
|
|
30
30
|
contrast.
|
|
31
31
|
* - All Allium Typography variants other than header size variants are supported.
|
|
32
32
|
*/
|
|
33
|
-
const Paragraph = React.forwardRef(
|
|
33
|
+
export const Paragraph = React.forwardRef(
|
|
34
34
|
({ children, variant, tokens, testID, align, linesBetween = 1, ...rest }, ref) => {
|
|
35
35
|
const style = useTypographyTheme(variant, tokens)
|
|
36
36
|
return (
|
|
37
37
|
<StyledParagraph
|
|
38
38
|
ref={ref}
|
|
39
|
-
linesBetween={linesBetween}
|
|
39
|
+
$linesBetween={linesBetween}
|
|
40
40
|
data-testid={testID}
|
|
41
|
-
align={align}
|
|
41
|
+
$align={align}
|
|
42
42
|
style={style}
|
|
43
43
|
{...selectProps(rest)}
|
|
44
44
|
>
|
|
@@ -82,5 +82,3 @@ Paragraph.propTypes = {
|
|
|
82
82
|
size: PropTypes.oneOf(['micro', 'small', 'large'])
|
|
83
83
|
})
|
|
84
84
|
}
|
|
85
|
-
|
|
86
|
-
export default Paragraph
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
getTokensPropType
|
|
19
19
|
} from '@telus-uds/components-base'
|
|
20
20
|
import styled from 'styled-components'
|
|
21
|
-
import
|
|
21
|
+
import {
|
|
22
|
+
FullBleedContent,
|
|
22
23
|
getFullBleedBorderRadius,
|
|
23
24
|
useFullBleedContentProps
|
|
24
25
|
} from '../shared/FullBleedContent'
|
|
25
|
-
import AuthorDate from './AuthorDate'
|
|
26
26
|
|
|
27
27
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
28
28
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
@@ -33,13 +33,13 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([
|
|
|
33
33
|
|
|
34
34
|
// Stop changes to the card's inner border width causing the size and
|
|
35
35
|
// apparent position of the full bleed image to change.
|
|
36
|
-
const FullBleedOffsetOuter = styled.div(({ borderOffset }) => ({
|
|
36
|
+
const FullBleedOffsetOuter = styled.div(({ $borderOffset }) => ({
|
|
37
37
|
overflow: 'hidden',
|
|
38
|
-
marginTop: borderOffset * 2
|
|
38
|
+
marginTop: $borderOffset * 2
|
|
39
39
|
}))
|
|
40
|
-
const FullBleedOffsetInner = styled.div(({ borderOffset }) => ({
|
|
40
|
+
const FullBleedOffsetInner = styled.div(({ $borderOffset }) => ({
|
|
41
41
|
position: 'relative',
|
|
42
|
-
margin: 0 - borderOffset
|
|
42
|
+
margin: 0 - $borderOffset
|
|
43
43
|
}))
|
|
44
44
|
|
|
45
45
|
const defaultTokens = {
|
|
@@ -62,19 +62,7 @@ const defaultTokens = {
|
|
|
62
62
|
* - Use `fullBleedContent` to set the thumbnail image
|
|
63
63
|
*/
|
|
64
64
|
const PreviewCard = React.forwardRef(
|
|
65
|
-
(
|
|
66
|
-
{
|
|
67
|
-
tag,
|
|
68
|
-
title,
|
|
69
|
-
footer,
|
|
70
|
-
fullBleedImage,
|
|
71
|
-
fullBleedContent = fullBleedImage,
|
|
72
|
-
onPress,
|
|
73
|
-
href,
|
|
74
|
-
...rest
|
|
75
|
-
},
|
|
76
|
-
ref
|
|
77
|
-
) => {
|
|
65
|
+
({ tag, title, footer, fullBleedContent, onPress, href, ...rest }, ref) => {
|
|
78
66
|
const { fullBleedContentPosition, contentStackDirection, fullBleedContentProps } =
|
|
79
67
|
useFullBleedContentProps({
|
|
80
68
|
...fullBleedContent,
|
|
@@ -137,8 +125,8 @@ const PreviewCard = React.forwardRef(
|
|
|
137
125
|
)}
|
|
138
126
|
</Box>
|
|
139
127
|
{Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && (
|
|
140
|
-
<FullBleedOffsetOuter borderOffset={borderOffset}>
|
|
141
|
-
<FullBleedOffsetInner borderOffset={borderOffset}>
|
|
128
|
+
<FullBleedOffsetOuter $borderOffset={borderOffset}>
|
|
129
|
+
<FullBleedOffsetInner $borderOffset={borderOffset}>
|
|
142
130
|
<FullBleedContent
|
|
143
131
|
borderRadius={fullBleedBorderRadius}
|
|
144
132
|
{...fullBleedContentProps}
|
|
@@ -156,9 +144,6 @@ const PreviewCard = React.forwardRef(
|
|
|
156
144
|
|
|
157
145
|
PreviewCard.displayName = 'PreviewCard'
|
|
158
146
|
|
|
159
|
-
// Provide standard author/date footer as a preset with the export
|
|
160
|
-
PreviewCard.AuthorDate = AuthorDate
|
|
161
|
-
|
|
162
147
|
PreviewCard.propTypes = {
|
|
163
148
|
...selectedSystemPropTypes,
|
|
164
149
|
tokens: getTokensPropType('PreviewCard'),
|
|
@@ -180,23 +165,22 @@ PreviewCard.propTypes = {
|
|
|
180
165
|
tag: PropTypes.string,
|
|
181
166
|
/**
|
|
182
167
|
* Section containing additional information, such as author and date.
|
|
183
|
-
* Use `<
|
|
168
|
+
* Use `<PreviewCardAuthorDate author={...} date={...} />` here for author and date.
|
|
184
169
|
*/
|
|
185
170
|
footer: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
186
171
|
/**
|
|
187
172
|
* Text stating the title or headline of the story.
|
|
188
173
|
*/
|
|
189
174
|
title: PropTypes.string.isRequired,
|
|
190
|
-
/**
|
|
191
|
-
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
192
|
-
*
|
|
193
|
-
* @deprecated
|
|
194
|
-
*/
|
|
195
|
-
fullBleedImage: PropTypes.exact(FullBleedContent.propTypes || {}),
|
|
196
175
|
/**
|
|
197
176
|
* Full bleed content to be placed on the card.
|
|
198
177
|
*/
|
|
199
178
|
fullBleedContent: PropTypes.exact(FullBleedContent.propTypes || {})
|
|
200
179
|
}
|
|
201
180
|
|
|
202
|
-
|
|
181
|
+
// Export unwrapped component for react-docgen to extract info for docsite
|
|
182
|
+
export { PreviewCard as PreviewCardBase }
|
|
183
|
+
|
|
184
|
+
// Export wrapped component as main PreviewCard export
|
|
185
|
+
const PreviewCardWithRouter = withLinkRouter(PreviewCard)
|
|
186
|
+
export { PreviewCardWithRouter as PreviewCard }
|
|
@@ -10,7 +10,7 @@ import { StackWrap, Typography, useThemeTokens } from '@telus-uds/components-bas
|
|
|
10
10
|
* Add same locale-based date formatting as StoryCard when ready.
|
|
11
11
|
* Get locale based on decision of https://github.com/telus/universal-design-system/issues/715
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
export const PreviewCardAuthorDate = React.forwardRef(({ author, date }, ref) => {
|
|
14
14
|
const { separatorColor: color } = useThemeTokens('PreviewCard', {}, {})
|
|
15
15
|
return (
|
|
16
16
|
<StackWrap space={2} ref={ref}>
|
|
@@ -23,9 +23,9 @@ const AuthorDate = React.forwardRef(({ author, date }, ref) => {
|
|
|
23
23
|
)
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
PreviewCardAuthorDate.displayName = 'PreviewCardAuthorDate'
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
PreviewCardAuthorDate.propTypes = {
|
|
29
29
|
/**
|
|
30
30
|
* Name of the author
|
|
31
31
|
*/
|
|
@@ -35,5 +35,3 @@ AuthorDate.propTypes = {
|
|
|
35
35
|
*/
|
|
36
36
|
date: PropTypes.string.isRequired
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
export default AuthorDate
|
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
a11yProps
|
|
12
12
|
} from '@telus-uds/components-base'
|
|
13
13
|
import styled from 'styled-components'
|
|
14
|
-
import FootnoteLink from '../Footnote/FootnoteLink'
|
|
15
|
-
import getTypographyTokens from './tokens'
|
|
14
|
+
import { FootnoteLink } from '../Footnote/FootnoteLink'
|
|
15
|
+
import { tokens as getTypographyTokens } from './tokens'
|
|
16
16
|
import { htmlAttrs, warn } from '../utils'
|
|
17
|
-
import defaultDictionary from './dictionary'
|
|
17
|
+
import { dictionary as defaultDictionary } from './dictionary'
|
|
18
18
|
|
|
19
19
|
const PRICE_BASELINE_VARIANT = 'baseline'
|
|
20
20
|
|
|
21
21
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs, a11yProps])
|
|
22
22
|
|
|
23
23
|
const PriceLockupContainer = styled.div`
|
|
24
|
-
align-items: ${({ alignItemsText }) => alignItemsText};
|
|
24
|
+
align-items: ${({ $alignItemsText }) => $alignItemsText};
|
|
25
25
|
display: flex;
|
|
26
26
|
flex-direction: column;
|
|
27
27
|
width: fit-content;
|
|
@@ -30,32 +30,32 @@ const PriceContainer = styled.div.attrs({
|
|
|
30
30
|
'aria-hidden': 'true'
|
|
31
31
|
})`
|
|
32
32
|
display: flex;
|
|
33
|
-
margin-bottom: ${({ priceMarginBottom }) => priceMarginBottom};
|
|
33
|
+
margin-bottom: ${({ $priceMarginBottom }) => $priceMarginBottom};
|
|
34
34
|
`
|
|
35
35
|
const FootnoteContainer = styled.div`
|
|
36
36
|
display: flex;
|
|
37
|
-
margin-top: ${({ footnoteMarginTop }) => footnoteMarginTop};
|
|
38
|
-
gap: ${({ footnoteGap }) => footnoteGap};
|
|
37
|
+
margin-top: ${({ $footnoteMarginTop }) => $footnoteMarginTop};
|
|
38
|
+
gap: ${({ $footnoteGap }) => $footnoteGap};
|
|
39
39
|
`
|
|
40
40
|
|
|
41
41
|
const BottomTextContainer = styled.div`
|
|
42
|
-
margin-top: ${({ bottomTextMarginTop }) => bottomTextMarginTop};
|
|
42
|
+
margin-top: ${({ $bottomTextMarginTop }) => $bottomTextMarginTop};
|
|
43
43
|
`
|
|
44
44
|
|
|
45
45
|
const BottomLinksContainer = styled.div`
|
|
46
46
|
align-self: center;
|
|
47
|
-
margin-left: ${({ bottomLinksMarginLeft }) => bottomLinksMarginLeft};
|
|
47
|
+
margin-left: ${({ $bottomLinksMarginLeft }) => $bottomLinksMarginLeft};
|
|
48
48
|
`
|
|
49
49
|
|
|
50
50
|
const TopTextContainer = styled.div.attrs({
|
|
51
51
|
'aria-hidden': 'true'
|
|
52
52
|
})`
|
|
53
|
-
margin-bottom: ${({ topTextMarginBottom }) => topTextMarginBottom};
|
|
53
|
+
margin-bottom: ${({ $topTextMarginBottom }) => $topTextMarginBottom};
|
|
54
54
|
`
|
|
55
55
|
|
|
56
56
|
const PriceTextContainer = styled.div`
|
|
57
57
|
display: flex;
|
|
58
|
-
flex-direction: ${({ ratePosition }) => (ratePosition === 'bottom' ? 'column' : 'row')};
|
|
58
|
+
flex-direction: ${({ $ratePosition }) => ($ratePosition === 'bottom' ? 'column' : 'row')};
|
|
59
59
|
`
|
|
60
60
|
|
|
61
61
|
const RateContainer = styled.div`
|
|
@@ -63,25 +63,25 @@ const RateContainer = styled.div`
|
|
|
63
63
|
`
|
|
64
64
|
|
|
65
65
|
const RateTextContainer = styled.div`
|
|
66
|
-
align-self: ${({ ratePosition }) => (ratePosition === 'bottom' ? 'flex-start' : 'flex-end')};
|
|
66
|
+
align-self: ${({ $ratePosition }) => ($ratePosition === 'bottom' ? 'flex-start' : 'flex-end')};
|
|
67
67
|
`
|
|
68
68
|
|
|
69
69
|
const StrikeThroughContainer = styled.div`
|
|
70
70
|
display: flex;
|
|
71
71
|
position: relative;
|
|
72
72
|
align-items: center;
|
|
73
|
-
|
|
73
|
+
&::before {
|
|
74
74
|
content: '';
|
|
75
75
|
width: 100%;
|
|
76
|
-
top: ${({ strikeThroughPosition }) => `${strikeThroughPosition}px`};
|
|
77
|
-
height: ${({ strikeThroughHeight }) => `${strikeThroughHeight}px`};
|
|
78
|
-
background: ${({ strikeThroughColor }) => strikeThroughColor};
|
|
76
|
+
top: ${({ $strikeThroughPosition }) => `${$strikeThroughPosition}px`};
|
|
77
|
+
height: ${({ $strikeThroughHeight }) => `${$strikeThroughHeight}px`};
|
|
78
|
+
background: ${({ $strikeThroughColor }) => $strikeThroughColor};
|
|
79
79
|
position: absolute;
|
|
80
80
|
}
|
|
81
81
|
`
|
|
82
82
|
const TypographyContainer = styled.div`
|
|
83
83
|
display: flex;
|
|
84
|
-
padding-top: ${({ paddingTop }) => `${paddingTop || 0}px`};
|
|
84
|
+
padding-top: ${({ $paddingTop }) => `${$paddingTop || 0}px`};
|
|
85
85
|
`
|
|
86
86
|
const InlineTextWithFootnote = styled.div`
|
|
87
87
|
display: inline;
|
|
@@ -126,7 +126,7 @@ const selectStrikeThroughTokens = ({
|
|
|
126
126
|
strikeThroughColor
|
|
127
127
|
})
|
|
128
128
|
|
|
129
|
-
const PriceLockup = React.forwardRef(
|
|
129
|
+
export const PriceLockup = React.forwardRef(
|
|
130
130
|
(
|
|
131
131
|
{
|
|
132
132
|
size = 'medium',
|
|
@@ -193,7 +193,7 @@ const PriceLockup = React.forwardRef(
|
|
|
193
193
|
: { tokens: { ...restOfTokens, color: fontColor } }
|
|
194
194
|
|
|
195
195
|
return (
|
|
196
|
-
<TypographyContainer paddingTop={paddingTop}>
|
|
196
|
+
<TypographyContainer $paddingTop={paddingTop}>
|
|
197
197
|
<Typography {...customProps}>{value}</Typography>
|
|
198
198
|
</TypographyContainer>
|
|
199
199
|
)
|
|
@@ -218,7 +218,11 @@ const PriceLockup = React.forwardRef(
|
|
|
218
218
|
return (
|
|
219
219
|
<>
|
|
220
220
|
<A11yText text={a11yText} />
|
|
221
|
-
<StrikeThroughContainer
|
|
221
|
+
<StrikeThroughContainer
|
|
222
|
+
$strikeThroughPosition={selectStrikeThroughTokens(themeTokens).strikeThroughPosition}
|
|
223
|
+
$strikeThroughHeight={selectStrikeThroughTokens(themeTokens).strikeThroughHeight}
|
|
224
|
+
$strikeThroughColor={selectStrikeThroughTokens(themeTokens).strikeThroughColor}
|
|
225
|
+
>
|
|
222
226
|
{amountComponent}
|
|
223
227
|
</StrikeThroughContainer>
|
|
224
228
|
</>
|
|
@@ -230,8 +234,8 @@ const PriceLockup = React.forwardRef(
|
|
|
230
234
|
|
|
231
235
|
const renderPrice = () => (
|
|
232
236
|
<>
|
|
233
|
-
<PriceContainer priceMarginBottom={`${priceMarginBottom}px`}>
|
|
234
|
-
<PriceTextContainer ratePosition={ratePosition}>
|
|
237
|
+
<PriceContainer $priceMarginBottom={`${priceMarginBottom}px`}>
|
|
238
|
+
<PriceTextContainer $ratePosition={ratePosition}>
|
|
235
239
|
<RateContainer>
|
|
236
240
|
{signDirection === 'left' && renderCurrencySymbol()}
|
|
237
241
|
{renderAmount()}
|
|
@@ -239,14 +243,14 @@ const PriceLockup = React.forwardRef(
|
|
|
239
243
|
{signDirection === 'right' && <> {renderCurrencySymbol()}</>}
|
|
240
244
|
</RateContainer>
|
|
241
245
|
{rateText && (
|
|
242
|
-
<RateTextContainer ratePosition={ratePosition}>
|
|
246
|
+
<RateTextContainer $ratePosition={ratePosition}>
|
|
243
247
|
{renderTypography(rateText, typographyTokens.rate, ratePosition)}
|
|
244
248
|
</RateTextContainer>
|
|
245
249
|
)}
|
|
246
250
|
</PriceTextContainer>
|
|
247
251
|
|
|
248
252
|
{!bottomText && footnoteLinks.length <= 3 && (
|
|
249
|
-
<BottomLinksContainer bottomLinksMarginLeft={`${bottomLinksMarginLeft}px`}>
|
|
253
|
+
<BottomLinksContainer $bottomLinksMarginLeft={`${bottomLinksMarginLeft}px`}>
|
|
250
254
|
{renderFootnoteLinks()}
|
|
251
255
|
</BottomLinksContainer>
|
|
252
256
|
)}
|
|
@@ -257,8 +261,8 @@ const PriceLockup = React.forwardRef(
|
|
|
257
261
|
|
|
258
262
|
const renderFootnoteContent = () => {
|
|
259
263
|
const containerProps = {
|
|
260
|
-
footnoteMarginTop: `${footnoteMarginTop}px`,
|
|
261
|
-
footnoteGap: `${footnoteGap}px`
|
|
264
|
+
$footnoteMarginTop: `${footnoteMarginTop}px`,
|
|
265
|
+
$footnoteGap: `${footnoteGap}px`
|
|
262
266
|
}
|
|
263
267
|
|
|
264
268
|
const shouldUseInline = linkPosition === 'inline'
|
|
@@ -280,7 +284,7 @@ const PriceLockup = React.forwardRef(
|
|
|
280
284
|
return (
|
|
281
285
|
<>
|
|
282
286
|
<FootnoteContainer {...containerProps}>
|
|
283
|
-
<BottomTextContainer bottomTextMarginTop={`${bottomTextMarginTop}px`}>
|
|
287
|
+
<BottomTextContainer $bottomTextMarginTop={`${bottomTextMarginTop}px`}>
|
|
284
288
|
{bottomTextContent}
|
|
285
289
|
</BottomTextContainer>
|
|
286
290
|
{showFootnotesInContainer && renderFootnoteLinks()}
|
|
@@ -358,13 +362,13 @@ const PriceLockup = React.forwardRef(
|
|
|
358
362
|
return (
|
|
359
363
|
<PriceLockupContainer
|
|
360
364
|
{...selectProps(rest)}
|
|
361
|
-
alignItemsText={alignItemsText}
|
|
365
|
+
$alignItemsText={alignItemsText}
|
|
362
366
|
ref={ref}
|
|
363
367
|
role="group"
|
|
364
368
|
aria-label={ariaLabel}
|
|
365
369
|
>
|
|
366
370
|
{topText && (
|
|
367
|
-
<TopTextContainer topTextMarginBottom={`${topTextMarginBottom}px`}>
|
|
371
|
+
<TopTextContainer $topTextMarginBottom={`${topTextMarginBottom}px`}>
|
|
368
372
|
{renderTypography(topText, typographyTokens.topText)}
|
|
369
373
|
</TopTextContainer>
|
|
370
374
|
)}
|
|
@@ -470,5 +474,3 @@ PriceLockup.propTypes = {
|
|
|
470
474
|
*/
|
|
471
475
|
tokens: getTokensPropType('PriceLockup')
|
|
472
476
|
}
|
|
473
|
-
|
|
474
|
-
export default PriceLockup
|