@telus-uds/components-web 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +7 -1
- package/CHANGELOG.md +38 -2
- package/jest.config.cjs +1 -1
- package/lib/cjs/Badge/Badge.js +128 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BlockQuote/BlockQuote.js +256 -0
- package/lib/cjs/BlockQuote/index.js +9 -0
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +264 -0
- package/lib/cjs/Breadcrumbs/Item/Item.js +180 -0
- package/lib/cjs/Breadcrumbs/index.js +13 -0
- package/lib/cjs/Callout/Callout.js +141 -0
- package/lib/cjs/Callout/index.js +9 -0
- package/lib/cjs/Card/Card.js +257 -0
- package/lib/cjs/Card/CardContent.js +97 -0
- package/lib/cjs/Card/CardFooter.js +85 -0
- package/lib/cjs/Card/index.js +9 -0
- package/lib/cjs/Countdown/Countdown.js +268 -0
- package/lib/cjs/Countdown/Segment.js +108 -0
- package/lib/cjs/Countdown/constants.js +10 -0
- package/lib/cjs/Countdown/dictionary.js +28 -0
- package/lib/cjs/Countdown/index.js +9 -0
- package/lib/cjs/Countdown/types.js +31 -0
- package/lib/cjs/Countdown/useCountdown.js +32 -0
- package/lib/cjs/DatePicker/CalendarContainer.js +214 -0
- package/lib/cjs/DatePicker/DatePicker.js +525 -0
- package/lib/cjs/DatePicker/dictionary.js +125 -0
- package/lib/cjs/DatePicker/index.js +9 -0
- package/lib/cjs/DatePicker/reactDatesCss.js +9 -0
- package/lib/cjs/Disclaimer/Disclaimer.js +61 -0
- package/lib/cjs/Disclaimer/index.js +13 -0
- package/lib/cjs/Footnote/Footnote.js +637 -0
- package/lib/cjs/Footnote/FootnoteLink.js +125 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/IconButton/IconButton.js +62 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/Image/Image.js +90 -0
- package/lib/cjs/Image/index.js +20 -0
- package/lib/cjs/Image/server.js +11 -0
- package/lib/cjs/List/List.js +8 -0
- package/lib/cjs/List/ListItem.js +34 -0
- package/lib/cjs/List/index.js +11 -0
- package/lib/cjs/NavigationBar/NavigationBar.js +282 -0
- package/lib/cjs/NavigationBar/NavigationItem.js +94 -0
- package/lib/cjs/NavigationBar/NavigationSubMenu.js +164 -0
- package/lib/{NavigationBar → cjs/NavigationBar}/collapseItems.js +9 -4
- package/lib/cjs/NavigationBar/index.js +11 -0
- package/lib/cjs/NavigationBar/resolveItemSelection.js +22 -0
- package/lib/cjs/OptimizeImage/OptimizeImage.js +99 -0
- package/lib/cjs/OptimizeImage/index.js +9 -0
- package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +14 -0
- package/lib/cjs/OptimizeImage/utils/getImageUrls.js +19 -0
- package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +24 -0
- package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +34 -0
- package/lib/cjs/OptimizeImage/utils/index.js +34 -0
- package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +9 -0
- package/lib/cjs/OrderedList/Item.js +151 -0
- package/lib/cjs/OrderedList/ItemBase.js +34 -0
- package/lib/cjs/OrderedList/OrderedList.js +92 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +52 -0
- package/lib/cjs/OrderedList/constants.js +8 -0
- package/lib/cjs/OrderedList/index.js +11 -0
- package/lib/cjs/Paragraph/Paragraph.js +97 -0
- package/lib/cjs/Paragraph/index.js +9 -0
- package/lib/cjs/PreviewCard/AuthorDate.js +63 -0
- package/lib/cjs/PreviewCard/PreviewCard.js +215 -0
- package/lib/cjs/PreviewCard/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +356 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/tokens.js +66 -0
- package/lib/cjs/Progress/ProgressBar.js +99 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuantitySelector/QuantitySelector.js +267 -0
- package/lib/cjs/QuantitySelector/SideButton.js +77 -0
- package/lib/cjs/QuantitySelector/dictionary.js +32 -0
- package/lib/cjs/QuantitySelector/index.js +9 -0
- package/lib/cjs/QuantitySelector/styles.js +16 -0
- package/lib/cjs/ResponsiveImage/ResponsiveImage.js +107 -0
- package/lib/cjs/ResponsiveImage/index.js +9 -0
- package/lib/cjs/Ribbon/Ribbon.js +222 -0
- package/lib/cjs/Ribbon/index.js +9 -0
- package/lib/cjs/SkeletonProvider/SkeletonImage.js +45 -0
- package/lib/cjs/SkeletonProvider/SkeletonProvider.js +63 -0
- package/lib/cjs/SkeletonProvider/SkeletonTypography.js +44 -0
- package/lib/cjs/SkeletonProvider/index.js +9 -0
- package/lib/cjs/Span/Span.js +79 -0
- package/lib/cjs/Span/index.js +9 -0
- package/lib/cjs/Spinner/Spinner.js +221 -0
- package/lib/cjs/Spinner/SpinnerContent.js +100 -0
- package/lib/cjs/Spinner/constants.js +10 -0
- package/lib/cjs/Spinner/index.js +9 -0
- package/lib/cjs/StoryCard/StoryCard.js +219 -0
- package/lib/cjs/StoryCard/index.js +9 -0
- package/lib/cjs/Table/Body.js +24 -0
- package/lib/cjs/Table/Cell.js +187 -0
- package/lib/cjs/Table/Header.js +32 -0
- package/lib/cjs/Table/Row.js +41 -0
- package/lib/cjs/Table/SubHeading.js +30 -0
- package/lib/cjs/Table/Table.js +124 -0
- package/lib/cjs/Table/index.js +19 -0
- package/lib/cjs/TermsAndConditions/ExpandCollapse.js +160 -0
- package/lib/cjs/TermsAndConditions/TermsAndConditions.js +283 -0
- package/lib/cjs/TermsAndConditions/dictionary.js +22 -0
- package/lib/cjs/TermsAndConditions/index.js +13 -0
- package/lib/cjs/Testimonial/Testimonial.js +240 -0
- package/lib/cjs/Testimonial/index.js +9 -0
- package/lib/cjs/Toast/Toast.js +165 -0
- package/lib/cjs/Toast/index.js +9 -0
- package/lib/cjs/Video/ControlBar/ControlBar.js +294 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +76 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +169 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +211 -0
- package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +197 -0
- package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +78 -0
- package/lib/cjs/Video/Video.js +964 -0
- package/lib/cjs/Video/index.js +9 -0
- package/lib/cjs/Video/videoText.js +61 -0
- package/lib/cjs/VideoPicker/VideoPicker.js +197 -0
- package/lib/cjs/VideoPicker/VideoPickerPlayer.js +54 -0
- package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +223 -0
- package/lib/cjs/VideoPicker/VideoSlider.js +88 -0
- package/lib/cjs/VideoPicker/index.js +9 -0
- package/lib/cjs/VideoPicker/videoPropType.js +17 -0
- package/lib/cjs/WaffleGrid/WaffleGrid.js +164 -0
- package/lib/cjs/WaffleGrid/index.js +9 -0
- package/lib/cjs/WebVideo/WebVideo.js +197 -0
- package/lib/cjs/WebVideo/index.js +9 -0
- package/lib/cjs/WebVideo/utils/index.js +57 -0
- package/lib/cjs/baseExports.js +438 -0
- package/lib/cjs/index.js +317 -0
- package/lib/cjs/server.js +13 -0
- package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +29 -0
- package/lib/cjs/shared/ConditionalWrapper/index.js +9 -0
- package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +108 -0
- package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +61 -0
- package/lib/cjs/shared/FullBleedContent/index.js +23 -0
- package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +61 -0
- package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +91 -0
- package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +229 -0
- package/lib/cjs/shared/VideoSplash/VideoSplash.js +72 -0
- package/lib/cjs/shared/VideoSplash/helpers.js +32 -0
- package/lib/cjs/utils/index.js +88 -0
- package/lib/cjs/utils/isElementFocusable.js +14 -0
- package/lib/cjs/utils/logger.js +24 -0
- package/lib/cjs/utils/media.js +45 -0
- package/lib/cjs/utils/renderStructuredContent.js +71 -0
- package/lib/cjs/utils/scrollToAnchor.js +25 -0
- package/lib/cjs/utils/ssr.js +50 -0
- package/lib/cjs/utils/theming/get-theme-from-server.js +24 -0
- package/lib/cjs/utils/theming/with-client-theme.js +31 -0
- package/lib/cjs/utils/theming/with-server-theme.js +33 -0
- package/lib/cjs/utils/transforms.js +11 -0
- package/lib/cjs/utils/useOverlaidPosition.js +222 -0
- package/lib/cjs/utils/useTypographyTheme.js +30 -0
- package/lib/{Badge → esm/Badge}/Badge.js +11 -19
- package/lib/{BlockQuote → esm/BlockQuote}/BlockQuote.js +17 -31
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Breadcrumbs.js +6 -5
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Item/Item.js +10 -6
- package/lib/{Callout → esm/Callout}/Callout.js +6 -5
- package/lib/{Card → esm/Card}/Card.js +10 -10
- package/lib/{Card → esm/Card}/CardContent.js +6 -5
- package/lib/{Card → esm/Card}/CardFooter.js +6 -5
- package/lib/{Countdown → esm/Countdown}/Countdown.js +53 -32
- package/lib/{Countdown → esm/Countdown}/Segment.js +6 -6
- package/lib/{DatePicker → esm/DatePicker}/CalendarContainer.js +5 -5
- package/lib/{DatePicker → esm/DatePicker}/DatePicker.js +24 -20
- package/lib/esm/DatePicker/reactDatesCss.js +3 -0
- package/lib/{Disclaimer → esm/Disclaimer}/Disclaimer.js +6 -5
- package/lib/{Footnote → esm/Footnote}/Footnote.js +43 -22
- package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +19 -20
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationSubMenu.js +1 -2
- package/lib/esm/NavigationBar/collapseItems.js +37 -0
- package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.js +1 -1
- package/lib/{OrderedList → esm/OrderedList}/Item.js +10 -6
- package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +5 -5
- package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +8 -8
- package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +5 -5
- package/lib/{Paragraph → esm/Paragraph}/Paragraph.js +8 -16
- package/lib/{PreviewCard → esm/PreviewCard}/PreviewCard.js +10 -7
- package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +59 -69
- package/lib/{Progress → esm/Progress}/ProgressBar.js +6 -6
- package/lib/esm/QuantitySelector/styles.js +9 -0
- package/lib/{Ribbon → esm/Ribbon}/Ribbon.js +31 -57
- package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonImage.js +3 -4
- package/lib/esm/SkeletonProvider/SkeletonTypography.js +37 -0
- package/lib/{Span → esm/Span}/Span.js +7 -6
- package/lib/{Spinner → esm/Spinner}/Spinner.js +18 -8
- package/lib/{Spinner → esm/Spinner}/SpinnerContent.js +6 -5
- package/lib/{StoryCard → esm/StoryCard}/StoryCard.js +10 -7
- package/lib/{Table → esm/Table}/Cell.js +16 -45
- package/lib/esm/Table/Row.js +34 -0
- package/lib/{Table → esm/Table}/Table.js +18 -20
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +15 -8
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/TermsAndConditions.js +22 -9
- package/lib/{Testimonial → esm/Testimonial}/Testimonial.js +26 -10
- package/lib/{Toast → esm/Toast}/Toast.js +15 -67
- package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +7 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoMenu/VideoMenu.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VolumeSlider/VolumeSlider.js +10 -6
- package/lib/{Video → esm/Video}/MiddleControlButton/MiddleControlButton.js +6 -5
- package/lib/{Video → esm/Video}/Video.js +28 -12
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +21 -46
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +19 -54
- package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
- package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
- package/lib/{baseExports.js → esm/baseExports.js} +1 -1
- package/lib/{index.js → esm/index.js} +1 -2
- package/lib/{shared → esm/shared}/FullBleedContent/FullBleedContent.js +5 -5
- package/lib/{shared → esm/shared}/VideoSplash/SplashButton/SplashButton.js +9 -6
- package/lib/{shared → esm/shared}/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +17 -8
- package/lib/{shared → esm/shared}/VideoSplash/VideoSplash.js +6 -5
- package/lib/{utils → esm/utils}/index.js +1 -2
- package/lib/{utils → esm/utils}/scrollToAnchor.js +2 -2
- package/lib/{utils → esm/utils}/ssr.js +8 -4
- package/lib/{utils → esm/utils}/useOverlaidPosition.js +2 -4
- package/package.json +17 -16
- package/src/Badge/Badge.jsx +4 -3
- package/src/BlockQuote/BlockQuote.jsx +2 -3
- package/src/Breadcrumbs/Breadcrumbs.jsx +2 -3
- package/src/Breadcrumbs/Item/Item.jsx +2 -3
- package/src/Callout/Callout.jsx +2 -4
- package/src/Card/Card.jsx +1 -3
- package/src/Card/CardContent.jsx +2 -3
- package/src/Card/CardFooter.jsx +2 -3
- package/src/Countdown/Countdown.jsx +62 -36
- package/src/Countdown/Segment.jsx +1 -3
- package/src/DatePicker/CalendarContainer.jsx +1 -3
- package/src/DatePicker/DatePicker.jsx +2 -3
- package/src/DatePicker/reactDatesCss.js +1 -3
- package/src/Disclaimer/Disclaimer.jsx +2 -3
- package/src/Footnote/Footnote.jsx +2 -10
- package/src/Footnote/FootnoteLink.jsx +2 -3
- package/src/NavigationBar/NavigationBar.jsx +2 -3
- package/src/NavigationBar/NavigationItem.jsx +2 -3
- package/src/OrderedList/Item.jsx +2 -3
- package/src/OrderedList/ItemBase.jsx +1 -3
- package/src/OrderedList/OrderedList.jsx +2 -3
- package/src/OrderedList/OrderedListBase.jsx +1 -3
- package/src/Paragraph/Paragraph.jsx +2 -4
- package/src/PreviewCard/PreviewCard.jsx +1 -3
- package/src/PriceLockup/PriceLockup.jsx +2 -3
- package/src/Progress/ProgressBar.jsx +1 -3
- package/src/QuantitySelector/styles.js +1 -3
- package/src/Ribbon/Ribbon.jsx +2 -3
- package/src/Span/Span.jsx +2 -4
- package/src/Spinner/Spinner.jsx +2 -3
- package/src/Spinner/SpinnerContent.jsx +2 -3
- package/src/StoryCard/StoryCard.jsx +1 -3
- package/src/Table/Cell.jsx +4 -5
- package/src/Table/Row.jsx +13 -2
- package/src/Table/Table.jsx +14 -5
- package/src/TermsAndConditions/ExpandCollapse.jsx +6 -4
- package/src/TermsAndConditions/TermsAndConditions.jsx +2 -3
- package/src/Testimonial/Testimonial.jsx +2 -3
- package/src/Toast/Toast.jsx +2 -3
- package/src/Video/ControlBar/ControlBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +2 -4
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +2 -4
- package/src/Video/Video.jsx +2 -4
- package/src/VideoPicker/VideoPicker.jsx +2 -4
- package/src/VideoPicker/VideoPickerThumbnail.jsx +1 -3
- package/src/WaffleGrid/WaffleGrid.jsx +2 -3
- package/src/WebVideo/WebVideo.jsx +3 -4
- package/src/baseExports.js +1 -0
- package/src/index.js +1 -2
- package/src/shared/FullBleedContent/FullBleedContent.jsx +1 -3
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +1 -3
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +1 -4
- package/src/shared/VideoSplash/VideoSplash.jsx +2 -3
- package/src/utils/index.js +1 -3
- package/src/utils/ssr.js +10 -3
- package/types/Callout.d.ts +2 -1
- package/types/Tooltip.d.ts +1 -0
- package/lib/DatePicker/reactDatesCss.js +0 -830
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -116
- package/lib/ExpandCollapseMini/index.js +0 -2
- package/lib/QuantitySelector/styles.js +0 -18
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib/Table/Row.js +0 -19
- package/lib/utils/theming/styled-components.js +0 -26
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +0 -72
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +0 -104
- package/src/ExpandCollapseMini/index.js +0 -3
- package/src/utils/theming/styled-components.js +0 -23
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{BlockQuote → esm/BlockQuote}/index.js +0 -0
- /package/lib/{Breadcrumbs → esm/Breadcrumbs}/index.js +0 -0
- /package/lib/{Callout → esm/Callout}/index.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/constants.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/dictionary.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/types.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/useCountdown.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/dictionary.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/index.js +0 -0
- /package/lib/{Disclaimer → esm/Disclaimer}/index.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{Image → esm/Image}/Image.js +0 -0
- /package/lib/{Image → esm/Image}/index.js +0 -0
- /package/lib/{Image → esm/Image}/server.js +0 -0
- /package/lib/{List → esm/List}/List.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/OptimizeImage.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getFallbackUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getImageUrls.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getOptimizedUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/hasWebpSupport.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/isSvgUrl.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/constants.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Paragraph → esm/Paragraph}/index.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/AuthorDate.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/tokens.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/QuantitySelector.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/SideButton.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/dictionary.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/index.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/ResponsiveImage.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/index.js +0 -0
- /package/lib/{Ribbon → esm/Ribbon}/index.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/index.js +0 -0
- /package/lib/{Span → esm/Span}/index.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/constants.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/index.js +0 -0
- /package/lib/{StoryCard → esm/StoryCard}/index.js +0 -0
- /package/lib/{Table → esm/Table}/Body.js +0 -0
- /package/lib/{Table → esm/Table}/Header.js +0 -0
- /package/lib/{Table → esm/Table}/SubHeading.js +0 -0
- /package/lib/{Table → esm/Table}/index.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/dictionary.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/index.js +0 -0
- /package/lib/{Testimonial → esm/Testimonial}/index.js +0 -0
- /package/lib/{Toast → esm/Toast}/index.js +0 -0
- /package/lib/{Video → esm/Video}/index.js +0 -0
- /package/lib/{Video → esm/Video}/videoText.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerPlayer.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoSlider.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/index.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/videoPropType.js +0 -0
- /package/lib/{WaffleGrid → esm/WaffleGrid}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/utils/index.js +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/ConditionalWrapper.js +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/getFullBleedBorderRadius.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/useFullBleedContentProps.js +0 -0
- /package/lib/{shared → esm/shared}/VideoSplash/helpers.js +0 -0
- /package/lib/{utils → esm/utils}/isElementFocusable.js +0 -0
- /package/lib/{utils → esm/utils}/logger.js +0 -0
- /package/lib/{utils → esm/utils}/media.js +0 -0
- /package/lib/{utils → esm/utils}/renderStructuredContent.js +0 -0
- /package/lib/{utils → esm/utils}/theming/get-theme-from-server.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-client-theme.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-server-theme.js +0 -0
- /package/lib/{utils → esm/utils}/transforms.js +0 -0
- /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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 } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
5
|
import CardContent from './CardContent';
|
|
6
6
|
import CardFooter from './CardFooter';
|
|
7
7
|
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
@@ -10,9 +10,6 @@ import ConditionalWrapper from '../shared/ConditionalWrapper';
|
|
|
10
10
|
// Passes React Native-oriented system props through UDS Card
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
13
|
-
const {
|
|
14
|
-
styled
|
|
15
|
-
} = styledComponents;
|
|
16
13
|
|
|
17
14
|
/**
|
|
18
15
|
* A basic card component, unstyled by default.
|
|
@@ -43,7 +40,10 @@ const {
|
|
|
43
40
|
* ## Accessibility
|
|
44
41
|
* `Card` component accepts all the standard accessibility props.
|
|
45
42
|
*/
|
|
46
|
-
const DynamicWidthContainer = styled.div(
|
|
43
|
+
const DynamicWidthContainer = /*#__PURE__*/styled.div.withConfig({
|
|
44
|
+
displayName: "Card__DynamicWidthContainer",
|
|
45
|
+
componentId: "components-web__sc-1elbtwd-0"
|
|
46
|
+
})(_ref => {
|
|
47
47
|
let {
|
|
48
48
|
width,
|
|
49
49
|
display,
|
|
@@ -92,9 +92,9 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
92
92
|
const {
|
|
93
93
|
borderRadius
|
|
94
94
|
} = useThemeTokens('Card', tokens, variant);
|
|
95
|
-
const getThemeTokens = useThemeTokensCallback('Card', interactiveCard
|
|
95
|
+
const getThemeTokens = useThemeTokensCallback('Card', interactiveCard?.tokens, {
|
|
96
96
|
interactive: true,
|
|
97
|
-
...(
|
|
97
|
+
...(interactiveCard?.variant || {})
|
|
98
98
|
});
|
|
99
99
|
const hasFooter = Boolean(footer);
|
|
100
100
|
const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius, fullBleedContentPosition, hasFooter);
|
|
@@ -118,7 +118,7 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
118
118
|
display: imgColCurrentViewport === 0 ? 'none' : undefined
|
|
119
119
|
};
|
|
120
120
|
const columnFlex = {
|
|
121
|
-
flexGrow: interactiveCard
|
|
121
|
+
flexGrow: interactiveCard?.body ? 0 : 1,
|
|
122
122
|
flexShrink: 1,
|
|
123
123
|
justifyContent: 'space-between'
|
|
124
124
|
};
|
|
@@ -140,13 +140,13 @@ const Card = /*#__PURE__*/React.forwardRef(function () {
|
|
|
140
140
|
tokens: restOfTokens,
|
|
141
141
|
backgroundImage: backgroundImage,
|
|
142
142
|
...selectProps(rest),
|
|
143
|
-
children: [interactiveCard
|
|
143
|
+
children: [interactiveCard?.body ? /*#__PURE__*/_jsx(PressableCardBase, {
|
|
144
144
|
ref: ref,
|
|
145
145
|
tokens: getThemeTokens,
|
|
146
146
|
dataSet: dataSet,
|
|
147
147
|
onPress: onPress,
|
|
148
148
|
...selectProps(rest),
|
|
149
|
-
children: typeof
|
|
149
|
+
children: typeof interactiveCard?.body === 'function' ? interactiveCard.body() : interactiveCard.body
|
|
150
150
|
}) : null, children || fullBleedContentPosition !== 'none' ? /*#__PURE__*/_jsxs(StackView, {
|
|
151
151
|
direction: contentStackDirection,
|
|
152
152
|
tokens: {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { getTokensPropType, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const CardContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
9
|
+
displayName: "CardContent__CardContentContainer",
|
|
10
|
+
componentId: "components-web__sc-1k2501q-0"
|
|
11
|
+
})(_ref => {
|
|
11
12
|
let {
|
|
12
13
|
borderRadius,
|
|
13
14
|
paddingBottom,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { getTokensPropType, paddingProp, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
const CardFooterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
9
|
+
displayName: "CardFooter__CardFooterContainer",
|
|
10
|
+
componentId: "components-web__sc-pm6vns-0"
|
|
11
|
+
})(_ref => {
|
|
11
12
|
let {
|
|
12
13
|
backgroundColor,
|
|
13
14
|
borderRadius,
|
|
@@ -2,18 +2,23 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Spacer, StackView, Typography, selectSystemProps, useViewport, useTheme, useThemeTokens, useResponsiveThemeTokens, createMediaQueryStyles, applyTextStyles, getTokensPropType, StyleSheet } from '@telus-uds/components-base';
|
|
4
4
|
import { viewports } from '@telus-uds/system-constants';
|
|
5
|
+
import styled from 'styled-components';
|
|
5
6
|
// Reading these from the RN palette since they will be used to generate
|
|
6
7
|
// the `Typography` tokens
|
|
7
|
-
import { htmlAttrs, transformGradient
|
|
8
|
+
import { htmlAttrs, transformGradient } from '../utils';
|
|
8
9
|
import Segment from './Segment';
|
|
9
10
|
import useCountdown from './useCountdown';
|
|
10
11
|
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
const DAYS = 'days';
|
|
14
|
+
const HOURS = 'hours';
|
|
15
|
+
const MINUTES = 'minutes';
|
|
16
|
+
const SECONDS = 'seconds';
|
|
12
17
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
const Container = /*#__PURE__*/styled.div.withConfig({
|
|
19
|
+
displayName: "Countdown__Container",
|
|
20
|
+
componentId: "components-web__sc-18tqcb2-0"
|
|
21
|
+
})(_ref => {
|
|
17
22
|
let {
|
|
18
23
|
variant: {
|
|
19
24
|
feature,
|
|
@@ -73,6 +78,7 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
73
78
|
targetTime,
|
|
74
79
|
tokens,
|
|
75
80
|
variant = {},
|
|
81
|
+
units = [DAYS, HOURS, MINUTES, SECONDS],
|
|
76
82
|
...rest
|
|
77
83
|
} = _ref3;
|
|
78
84
|
const [days, hours, minutes, seconds] = useCountdown(targetTime);
|
|
@@ -80,12 +86,8 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
80
86
|
const {
|
|
81
87
|
feature,
|
|
82
88
|
large,
|
|
83
|
-
label,
|
|
84
89
|
noDivider
|
|
85
90
|
} = variant;
|
|
86
|
-
if (noDivider && !label) {
|
|
87
|
-
throw new Error('`noDivider` variant can only be used with `label` enabled!');
|
|
88
|
-
}
|
|
89
91
|
const {
|
|
90
92
|
themeOptions
|
|
91
93
|
} = useTheme();
|
|
@@ -192,30 +194,44 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
192
194
|
themeTokens: containerStyles,
|
|
193
195
|
gradient: semanticGradient,
|
|
194
196
|
media: containerMediaIds,
|
|
195
|
-
children: /*#__PURE__*/
|
|
197
|
+
children: /*#__PURE__*/_jsx(StackView, {
|
|
196
198
|
direction: "row",
|
|
197
199
|
space: 1,
|
|
198
|
-
children:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
200
|
+
children: units.map((unit, index) => {
|
|
201
|
+
let number;
|
|
202
|
+
let labelKey;
|
|
203
|
+
switch (unit) {
|
|
204
|
+
case DAYS:
|
|
205
|
+
number = days;
|
|
206
|
+
labelKey = 'day';
|
|
207
|
+
break;
|
|
208
|
+
case HOURS:
|
|
209
|
+
number = hours;
|
|
210
|
+
labelKey = 'hour';
|
|
211
|
+
break;
|
|
212
|
+
case MINUTES:
|
|
213
|
+
number = minutes;
|
|
214
|
+
labelKey = 'minute';
|
|
215
|
+
break;
|
|
216
|
+
case SECONDS:
|
|
217
|
+
number = seconds;
|
|
218
|
+
labelKey = 'second';
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
return /*#__PURE__*/_jsxs(React.Fragment, {
|
|
224
|
+
children: [/*#__PURE__*/_jsx(Segment, {
|
|
225
|
+
labelKey: labelKey,
|
|
226
|
+
number: number,
|
|
227
|
+
...(unit === DAYS && {
|
|
228
|
+
segmentWidth: String(number).length
|
|
229
|
+
}),
|
|
230
|
+
...segmentProps,
|
|
231
|
+
...applyTextStyles(themeTokens)
|
|
232
|
+
}), index < units.length - 1 && divider]
|
|
233
|
+
}, unit);
|
|
234
|
+
})
|
|
219
235
|
})
|
|
220
236
|
})
|
|
221
237
|
);
|
|
@@ -234,6 +250,11 @@ Countdown.propTypes = {
|
|
|
234
250
|
* representing a point in the future to count down to.
|
|
235
251
|
*/
|
|
236
252
|
targetTime: PropTypes.instanceOf(Date),
|
|
237
|
-
variant: countdownVariantPropType
|
|
253
|
+
variant: countdownVariantPropType,
|
|
254
|
+
/**
|
|
255
|
+
* An array of strings representing the units to display in the countdown.
|
|
256
|
+
* Possible values: `'days'`, `'hours'`, `'minutes'`, `'seconds'`
|
|
257
|
+
*/
|
|
258
|
+
units: PropTypes.arrayOf(PropTypes.oneOf([DAYS, HOURS, MINUTES, SECONDS]))
|
|
238
259
|
};
|
|
239
260
|
export default Countdown;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { StackView, Typography, useCopy } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
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';
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const {
|
|
11
|
-
styled
|
|
12
|
-
} = styledComponents;
|
|
13
9
|
|
|
14
10
|
// Pads with zeros on the left if it's a single digit number
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
12
|
const pad = function (number) {
|
|
16
13
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
17
14
|
return String(number).padStart(segmentWidth, '0');
|
|
18
15
|
};
|
|
19
|
-
const Container = styled.div(
|
|
16
|
+
const Container = /*#__PURE__*/styled.div.withConfig({
|
|
17
|
+
displayName: "Segment__Container",
|
|
18
|
+
componentId: "components-web__sc-yrh35y-0"
|
|
19
|
+
})(_ref => {
|
|
20
20
|
let {
|
|
21
21
|
segmentFontSize,
|
|
22
22
|
segmentWidth = 2,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import styled from 'styled-components';
|
|
2
2
|
import defaultReactDatesCss from './reactDatesCss';
|
|
3
3
|
|
|
4
4
|
// calendarDayDefaultHeight and calendarDayDefaultWidth
|
|
5
5
|
// refer to circle size when selected, focused, or hovered and is passed with getResponsiveCircleSize in DatePicker
|
|
6
6
|
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const CalendarContainer = /*#__PURE__*/styled.div.withConfig({
|
|
8
|
+
displayName: "CalendarContainer",
|
|
9
|
+
componentId: "components-web__sc-qdc1tg-0"
|
|
10
|
+
})(_ref => {
|
|
11
11
|
let {
|
|
12
12
|
daySize,
|
|
13
13
|
remainingTokens,
|
|
@@ -4,15 +4,13 @@ import momentPropTypes from 'react-moment-proptypes';
|
|
|
4
4
|
import 'react-dates/initialize';
|
|
5
5
|
import { SingleDatePicker, DayPickerSingleDateController } from 'react-dates';
|
|
6
6
|
import { IconButton, TextInput, Portal, selectSystemProps, useCopy, useViewport, useThemeTokens, applyTextStyles, getTokensPropType, useSafeLayoutEffect } from '@telus-uds/components-base';
|
|
7
|
+
import styled from 'styled-components';
|
|
7
8
|
import moment from 'moment';
|
|
8
9
|
import { isUndefined, throttle } from 'lodash';
|
|
9
10
|
import CalendarContainer from './CalendarContainer';
|
|
10
11
|
import dictionary from './dictionary';
|
|
11
|
-
import { htmlAttrs
|
|
12
|
+
import { htmlAttrs } from '../utils';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
const {
|
|
14
|
-
styled
|
|
15
|
-
} = styledComponents;
|
|
16
14
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
17
15
|
const getResponsiveDaySize = function () {
|
|
18
16
|
let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
@@ -30,15 +28,24 @@ const getResponsiveCircleSize = function () {
|
|
|
30
28
|
}
|
|
31
29
|
return inline ? 44 : 26;
|
|
32
30
|
};
|
|
33
|
-
const MonthCenterContainer = styled.div({
|
|
31
|
+
const MonthCenterContainer = /*#__PURE__*/styled.div.withConfig({
|
|
32
|
+
displayName: "DatePicker__MonthCenterContainer",
|
|
33
|
+
componentId: "components-web__sc-mz8fi3-0"
|
|
34
|
+
})({
|
|
34
35
|
display: 'flex',
|
|
35
36
|
justifyContent: 'center'
|
|
36
37
|
});
|
|
37
|
-
const DateInputWrapper = styled.div({
|
|
38
|
+
const DateInputWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
39
|
+
displayName: "DatePicker__DateInputWrapper",
|
|
40
|
+
componentId: "components-web__sc-mz8fi3-1"
|
|
41
|
+
})({
|
|
38
42
|
display: 'flex',
|
|
39
43
|
flexDirection: 'column'
|
|
40
44
|
});
|
|
41
|
-
const PortalPositionedContainer = styled.div({
|
|
45
|
+
const PortalPositionedContainer = /*#__PURE__*/styled.div.withConfig({
|
|
46
|
+
displayName: "DatePicker__PortalPositionedContainer",
|
|
47
|
+
componentId: "components-web__sc-mz8fi3-2"
|
|
48
|
+
})({
|
|
42
49
|
position: 'absolute',
|
|
43
50
|
left: _ref => {
|
|
44
51
|
let {
|
|
@@ -82,7 +89,6 @@ const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
|
82
89
|
* - Recommended for viewports greater than or equal to 576px
|
|
83
90
|
*/
|
|
84
91
|
const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
85
|
-
var _dictionary$copy;
|
|
86
92
|
let {
|
|
87
93
|
copy = 'en',
|
|
88
94
|
id,
|
|
@@ -118,7 +124,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
118
124
|
const datePickerRef = React.useRef(null);
|
|
119
125
|
useSafeLayoutEffect(() => {
|
|
120
126
|
const updateDatePickerPosition = () => {
|
|
121
|
-
if (inline || !
|
|
127
|
+
if (inline || !textInputRef?.current) return;
|
|
122
128
|
const {
|
|
123
129
|
left,
|
|
124
130
|
top
|
|
@@ -174,8 +180,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
174
180
|
}, [isFocused]);
|
|
175
181
|
React.useEffect(() => {
|
|
176
182
|
if (inputText !== '' && inputDate !== undefined) {
|
|
177
|
-
|
|
178
|
-
textInputRef === null || textInputRef === void 0 || (_textInputRef$current = textInputRef.current) === null || _textInputRef$current === void 0 || _textInputRef$current.focus();
|
|
183
|
+
textInputRef?.current?.focus();
|
|
179
184
|
}
|
|
180
185
|
}, [inputDate, inputText]);
|
|
181
186
|
const onFocusChange = _ref4 => {
|
|
@@ -216,10 +221,10 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
216
221
|
if (value === '' || moment(value.replace(/\s/g, ''), dateFormatWithoutSpaces, true).isValid()) {
|
|
217
222
|
if (value === '') {
|
|
218
223
|
setInputDate(undefined); // Set inputDate to undefined if input is empty
|
|
219
|
-
onDateChange
|
|
224
|
+
onDateChange?.(undefined);
|
|
220
225
|
} else {
|
|
221
226
|
setInputDate(moment(value, dateFormat));
|
|
222
|
-
onDateChange
|
|
227
|
+
onDateChange?.(moment(value, dateFormat));
|
|
223
228
|
}
|
|
224
229
|
setInputText(value === '' ? '' : moment(value, dateFormatWithoutSpaces).format(dateFormat));
|
|
225
230
|
} else {
|
|
@@ -229,7 +234,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
229
234
|
const handleOnKeyPress = event => {
|
|
230
235
|
if (event.key === 'Backspace' && inputText === '') {
|
|
231
236
|
setInputDate(undefined);
|
|
232
|
-
onDateChange
|
|
237
|
+
onDateChange?.(undefined);
|
|
233
238
|
}
|
|
234
239
|
};
|
|
235
240
|
const handleValidation = inputValidation => {
|
|
@@ -246,11 +251,10 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
246
251
|
const viewport = useViewport();
|
|
247
252
|
const daySize = getResponsiveDaySize(inline, viewport);
|
|
248
253
|
const circleSize = getResponsiveCircleSize(inline, viewport);
|
|
249
|
-
const HiddenInputFieldContainer = styled.div
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
`;
|
|
254
|
+
const HiddenInputFieldContainer = /*#__PURE__*/styled.div.withConfig({
|
|
255
|
+
displayName: "DatePicker__HiddenInputFieldContainer",
|
|
256
|
+
componentId: "components-web__sc-mz8fi3-3"
|
|
257
|
+
})(["height:", ";width:", ";overflow:hidden;"], props => props.height, props => props.width);
|
|
254
258
|
const {
|
|
255
259
|
hiddenInputFieldContainerHeight,
|
|
256
260
|
hiddenInputFieldContainerWidth,
|
|
@@ -369,7 +373,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
369
373
|
onKeyPress: handleOnKeyPress,
|
|
370
374
|
tooltip: tooltip,
|
|
371
375
|
hintPosition: hintPosition,
|
|
372
|
-
label: label ??
|
|
376
|
+
label: label ?? dictionary[copy]?.roleDescription,
|
|
373
377
|
value: inputText,
|
|
374
378
|
validation: handleValidation(validation),
|
|
375
379
|
inactive: disabled,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
const defaultReactDatesCss = /*#__PURE__*/css([".PresetDateRangePicker_panel{padding:0 22px 11px;}.PresetDateRangePicker_button{position:relative;height:100%;text-align:center;background:0 0;border:2px solid #00a699;color:#00a699;padding:4px 12px;margin-right:8px;font:inherit;font-weight:700;line-height:normal;overflow:visible;-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;}.PresetDateRangePicker_button:active{outline:0;}.PresetDateRangePicker_button__selected{color:#fff;background:#00a699;}.SingleDatePickerInput{display:inline-block;background-color:#fff;position:absolute;top:-55px;}.SingleDatePickerInput__disabled{background-color:#f2f2f2;}.SingleDatePickerInput__block{display:block;}.SingleDatePickerInput__showClearDate{padding-right:30px;}.SingleDatePickerInput_clearDate{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;padding:10px;margin:0 10px 0 5px;position:absolute;right:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}.SingleDatePickerInput_clearDate__default:focus,.SingleDatePickerInput_clearDate__default:hover{background:#dbdbdb;border-radius:50%;}.SingleDatePickerInput_clearDate__small{padding:6px;}.SingleDatePickerInput_clearDate__hide{visibility:hidden;}.SingleDatePickerInput_clearDate_svg{fill:#82888a;height:12px;width:15px;vertical-align:middle;}.SingleDatePickerInput_clearDate_svg__small{height:9px;}.SingleDatePickerInput_calendarIcon{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;display:inline-block;vertical-align:middle;padding:10px;margin:0 5px 0 10px;}.SingleDatePickerInput_calendarIcon_svg{fill:#82888a;height:15px;width:14px;vertical-align:middle;}.SingleDatePicker{position:relative;display:inline-block;}.SingleDatePicker__block{display:block;}.SingleDatePicker_picker{z-index:1;background-color:#fff;position:absolute;}.SingleDatePicker_picker__rtl{direction:rtl;}.SingleDatePicker_picker__directionLeft{left:0;}.SingleDatePicker_picker__directionRight{right:0;}.SingleDatePicker_picker__portal{background-color:rgba(0,0,0,0.3);position:fixed;top:0;left:0;height:100%;width:100%;}.SingleDatePicker_picker__fullScreenPortal{background-color:#fff;}.SingleDatePicker_closeButton{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;position:absolute;top:0;right:0;padding:15px;z-index:2;}.SingleDatePicker_closeButton:focus,.SingleDatePicker_closeButton:hover{color:darken(#cacccd,10%);text-decoration:none;}.SingleDatePicker_closeButton_svg{height:15px;width:15px;fill:#cacccd;}.DayPickerKeyboardShortcuts_buttonReset{background:0 0;border:0;border-radius:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;cursor:pointer;font-size:14px;}.DayPickerKeyboardShortcuts_buttonReset:active{outline:0;}.DayPickerKeyboardShortcuts_show{width:33px;height:26px;position:absolute;z-index:2;}.DayPickerKeyboardShortcuts_show::before{content:'';display:block;position:absolute;}.DayPickerKeyboardShortcuts_show__bottomRight{bottom:0;right:0;}.DayPickerKeyboardShortcuts_show__bottomRight::before{border-top:26px solid transparent;border-right:33px solid #00a699;bottom:0;right:0;}.DayPickerKeyboardShortcuts_show__bottomRight:hover::before{border-right:33px solid #008489;}.DayPickerKeyboardShortcuts_show__topRight{top:0;right:0;}.DayPickerKeyboardShortcuts_show__topRight::before{border-bottom:26px solid transparent;border-right:33px solid #00a699;top:0;right:0;}.DayPickerKeyboardShortcuts_show__topRight:hover::before{border-right:33px solid #008489;}.DayPickerKeyboardShortcuts_show__topLeft{top:0;left:0;}.DayPickerKeyboardShortcuts_show__topLeft::before{border-bottom:26px solid transparent;border-left:33px solid #00a699;top:0;left:0;}.DayPickerKeyboardShortcuts_show__topLeft:hover::before{border-left:33px solid #008489;}.DayPickerKeyboardShortcuts_showSpan{color:#fff;position:absolute;}.DayPickerKeyboardShortcuts_showSpan__bottomRight{bottom:0;right:5px;}.DayPickerKeyboardShortcuts_showSpan__topRight{top:1px;right:5px;}.DayPickerKeyboardShortcuts_showSpan__topLeft{top:1px;left:5px;}.DayPickerKeyboardShortcuts_panel{overflow:auto;background:#fff;border:1px solid #dbdbdb;border-radius:2px;position:absolute;top:0;bottom:0;right:0;left:0;z-index:2;padding:22px;margin:33px;text-align:left;}.DayPickerKeyboardShortcuts_title{font-size:16px;font-weight:700;margin:0;}.DayPickerKeyboardShortcuts_list{list-style:none;padding:0;font-size:14px;}.DayPickerKeyboardShortcuts_close{position:absolute;right:22px;top:22px;z-index:2;}.DayPickerKeyboardShortcuts_close:active{outline:0;}.DayPickerKeyboardShortcuts_closeSvg{height:15px;width:15px;fill:#cacccd;}.DayPickerKeyboardShortcuts_closeSvg:focus,.DayPickerKeyboardShortcuts_closeSvg:hover{fill:#82888a;}.CalendarDay{-moz-box-sizing:border-box;box-sizing:border-box;cursor:pointer;font-size:14px;text-align:center;}.CalendarDay:active{outline:0;}.CalendarDay__defaultCursor{cursor:default;}.CalendarDay__default{border:1px solid #e4e7e7;color:#484848;background:#fff;}.CalendarDay__default:hover{background:#e4e7e7;border:1px solid #e4e7e7;color:inherit;}.CalendarDay__hovered_offset{background:#f4f5f5;border:1px double #e4e7e7;color:inherit;}.CalendarDay__outside{border:0;background:#fff;color:#484848;}.CalendarDay__outside:hover{border:0;}.CalendarDay__blocked_minimum_nights{background:#fff;border:1px solid #eceeee;color:#cacccd;}.CalendarDay__blocked_minimum_nights:active,.CalendarDay__blocked_minimum_nights:hover{background:#fff;color:#cacccd;}.CalendarDay__highlighted_calendar{background:#ffe8bc;color:#484848;}.CalendarDay__highlighted_calendar:active,.CalendarDay__highlighted_calendar:hover{background:#ffce71;color:#484848;}.CalendarDay__selected_span{background:#66e2da;border:1px double #33dacd;color:#fff;}.CalendarDay__selected_span:active,.CalendarDay__selected_span:hover{background:#33dacd;border:1px double #33dacd;color:#fff;}.CalendarDay__selected,.CalendarDay__selected:active,.CalendarDay__selected:hover{background:#00a699;border:1px double #00a699;color:#fff;}.CalendarDay__hovered_span,.CalendarDay__hovered_span:hover{background:#b2f1ec;border:1px double #80e8e0;color:#007a87;}.CalendarDay__hovered_span:active{background:#80e8e0;border:1px double #80e8e0;color:#007a87;}.CalendarDay__blocked_calendar,.CalendarDay__blocked_calendar:active,.CalendarDay__blocked_calendar:hover{background:#cacccd;border:1px solid #cacccd;color:#82888a;}.CalendarDay__blocked_out_of_range,.CalendarDay__blocked_out_of_range:active,.CalendarDay__blocked_out_of_range:hover{background:#fff;border:1px solid #e4e7e7;color:#cacccd;}.CalendarDay__hovered_start_first_possible_end{background:#eceeee;border:1px double #eceeee;}.CalendarDay__hovered_start_blocked_min_nights{background:#eceeee;border:1px double #e4e7e7;}.CalendarMonth{background:#fff;text-align:center;vertical-align:top;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.CalendarMonth_table{border-collapse:collapse;border-spacing:0;}.CalendarMonth_verticalSpacing{border-collapse:separate;}.CalendarMonth_caption{color:#484848;font-size:18px;text-align:center;padding-top:22px;padding-bottom:37px;caption-side:initial;}.CalendarMonth_caption__verticalScrollable{padding-top:12px;padding-bottom:7px;}.CalendarMonthGrid{background:#fff;text-align:left;z-index:0;}.CalendarMonthGrid__animating{z-index:1;}.CalendarMonthGrid__horizontal{position:absolute;left:9px;}.CalendarMonthGrid__vertical,.CalendarMonthGrid__vertical_scrollable{margin:0 auto;}.CalendarMonthGrid_month__horizontal{display:inline-block;vertical-align:top;min-height:100%;}.CalendarMonthGrid_month__hideForAnimation{position:absolute;z-index:-1;opacity:0;pointer-events:none;}.CalendarMonthGrid_month__hidden{visibility:hidden;}.DayPickerNavigation{position:relative;z-index:2;}.DayPickerNavigation__horizontal{height:0;}.DayPickerNavigation__verticalScrollable_prevNav{z-index:1;}.DayPickerNavigation__verticalDefault{position:absolute;width:100%;height:52px;bottom:0;left:0;}.DayPickerNavigation__verticalScrollableDefault{position:relative;}.DayPickerNavigation__bottom{height:auto;}.DayPickerNavigation__bottomDefault{-webkit-box-pack:justify;-ms-flex-pack:justify;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;}.DayPickerNavigation_button{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:0;padding:0;margin:0;}.DayPickerNavigation_button__default{border:1px solid #e4e7e7;background-color:#fff;color:#757575;}.DayPickerNavigation_button__default:focus,.DayPickerNavigation_button__default:hover{border:1px solid #c4c4c4;}.DayPickerNavigation_button__default:active{background:#f2f2f2;}.DayPickerNavigation_button__disabled{cursor:default;border:1px solid #f2f2f2;}.DayPickerNavigation_button__disabled:focus,.DayPickerNavigation_button__disabled:hover{border:1px solid #f2f2f2;}.DayPickerNavigation_button__disabled:active{background:0 0;}.DayPickerNavigation_button__horizontalDefault{position:absolute;top:18px;line-height:0.78;border-radius:3px;padding:6px 9px;}.DayPickerNavigation_bottomButton__horizontalDefault{position:static;margin:-10px 22px 30px;}.DayPickerNavigation_leftButton__horizontalDefault{left:22px;}.DayPickerNavigation_rightButton__horizontalDefault{right:22px;}.DayPickerNavigation_button__verticalDefault{padding:5px;background:#fff;box-shadow:0 0 5px 2px rgba(0,0,0,0.1);position:relative;display:inline-block;text-align:center;height:100%;width:50%;}.DayPickerNavigation_nextButton__verticalDefault{border-left:0;}.DayPickerNavigation_nextButton__verticalScrollableDefault,.DayPickerNavigation_prevButton__verticalScrollableDefault{width:100%;}.DayPickerNavigation_svg__horizontal{height:19px;width:19px;fill:#82888a;display:block;}.DayPickerNavigation_svg__vertical{height:42px;width:42px;fill:#484848;}.DayPickerNavigation_svg__disabled{fill:#f2f2f2;}.DayPicker{background:#fff;position:relative;text-align:left;}.DayPicker__horizontal{background:#fff;}.DayPicker__verticalScrollable{height:100%;}.DayPicker__hidden{visibility:hidden;}.DayPicker__withBorder{box-shadow:0 2px 6px rgba(0,0,0,0.05),0 0 0 1px rgba(0,0,0,0.07);border-radius:3px;}.DayPicker_portal__horizontal{box-shadow:none;position:absolute;left:50%;top:50%;}.DayPicker_portal__vertical{position:initial;}.DayPicker_focusRegion{outline:0;}.DayPicker_calendarInfo__horizontal,.DayPicker_wrapper__horizontal{display:inline-block;vertical-align:top;}.DayPicker_weekHeaders{position:relative;}.DayPicker_weekHeaders__horizontal{margin-left:9px;}.DayPicker_weekHeader{color:#757575;position:absolute;top:62px;z-index:2;text-align:left;}.DayPicker_weekHeader__vertical{left:50%;}.DayPicker_weekHeader__verticalScrollable{top:0;display:table-row;border-bottom:1px solid #dbdbdb;background:#fff;margin-left:0;left:0;width:100%;text-align:center;}.DayPicker_weekHeader_ul{list-style:none;margin:1px 0;padding-left:0;padding-right:0;font-size:14px;}.DayPicker_weekHeader_li{display:inline-block;text-align:center;}.DayPicker_transitionContainer{position:relative;overflow:hidden;border-radius:3px;}.DayPicker_transitionContainer__horizontal{-webkit-transition:height 0.2s ease-in-out;-moz-transition:height 0.2s ease-in-out;transition:height 0.2s ease-in-out;}.DayPicker_transitionContainer__vertical{width:100%;}.DayPicker_transitionContainer__verticalScrollable{padding-top:20px;height:100%;position:absolute;top:0;bottom:0;right:0;left:0;overflow-y:scroll;}.DateInput_input{display:none;}.DateInput_screenReaderMessage{border:0;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.DateInput_fang{position:absolute;top:55px;width:20px;height:10px;left:22px;z-index:2;}.DateInput_fangShape{fill:#fff;}.DateInput_fangStroke{stroke:#dbdbdb;fill:transparent;}.DateRangePickerInput{background-color:#fff;display:inline-block;}.DateRangePickerInput__disabled{background:#f2f2f2;}.DateRangePickerInput__withBorder{border-radius:2px;border:1px solid #dbdbdb;}.DateRangePickerInput__rtl{direction:rtl;}.DateRangePickerInput__block{display:block;}.DateRangePickerInput__showClearDates{padding-right:30px;}.DateRangePickerInput_arrow{display:inline-block;vertical-align:middle;color:#484848;}.DateRangePickerInput_arrow_svg{vertical-align:middle;fill:#484848;height:24px;width:24px;}.DateRangePickerInput_clearDates{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;padding:10px;margin:0 10px 0 5px;position:absolute;right:0;top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);}.DateRangePickerInput_clearDates__small{padding:6px;}.DateRangePickerInput_clearDates_default:focus,.DateRangePickerInput_clearDates_default:hover{background:#dbdbdb;border-radius:50%;}.DateRangePickerInput_clearDates__hide{visibility:hidden;}.DateRangePickerInput_clearDates_svg{fill:#82888a;height:12px;width:15px;vertical-align:middle;}.DateRangePickerInput_clearDates_svg__small{height:9px;}.DateRangePickerInput_calendarIcon{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;display:inline-block;vertical-align:middle;padding:10px;margin:0 5px 0 10px;}.DateRangePickerInput_calendarIcon_svg{fill:#82888a;height:15px;width:14px;vertical-align:middle;}.DateRangePicker{position:relative;display:inline-block;}.DateRangePicker__block{display:block;}.DateRangePicker_picker{z-index:1;background-color:#fff;position:absolute;}.DateRangePicker_picker__rtl{direction:rtl;}.DateRangePicker_picker__directionLeft{left:0;}.DateRangePicker_picker__directionRight{right:0;}.DateRangePicker_picker__portal{background-color:rgba(0,0,0,0.3);position:fixed;top:0;left:0;height:100%;width:100%;}.DateRangePicker_picker__fullScreenPortal{background-color:#fff;}.DateRangePicker_closeButton{background:0 0;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;cursor:pointer;position:absolute;top:0;right:0;padding:15px;z-index:2;}.DateRangePicker_closeButton:focus,.DateRangePicker_closeButton:hover{color:darken(#cacccd,10%);text-decoration:none;}.DateRangePicker_closeButton_svg{height:15px;width:15px;fill:#cacccd;}"]);
|
|
3
|
+
export default defaultReactDatesCss;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { applyTextStyles, selectSystemProps, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { htmlAttrs } from '../utils';
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const {
|
|
7
|
-
styled
|
|
8
|
-
} = styledComponents;
|
|
9
7
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
10
|
-
const StyledDisclaimer = styled.p(
|
|
8
|
+
const StyledDisclaimer = /*#__PURE__*/styled.p.withConfig({
|
|
9
|
+
displayName: "Disclaimer__StyledDisclaimer",
|
|
10
|
+
componentId: "components-web__sc-1l4xf7u-0"
|
|
11
|
+
})(_ref => {
|
|
11
12
|
let {
|
|
12
13
|
fontName,
|
|
13
14
|
fontWeight,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Icon, Portal, selectSystemProps, Typography, useCopy, useTheme, useResponsiveProp, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
+
import styled, { createGlobalStyle } from 'styled-components';
|
|
4
5
|
import OrderedListBase from '../OrderedList/OrderedListBase';
|
|
5
|
-
import { htmlAttrs, media, renderStructuredContent, isElementFocusable
|
|
6
|
+
import { htmlAttrs, media, renderStructuredContent, isElementFocusable } from '../utils';
|
|
6
7
|
import defaultDictionary from './dictionary';
|
|
7
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
10
|
const viewportBreakpoint = 1440;
|
|
10
|
-
const {
|
|
11
|
-
styled,
|
|
12
|
-
createGlobalStyle
|
|
13
|
-
} = styledComponents;
|
|
14
|
-
const GlobalBodyScrollLock = createGlobalStyle({
|
|
11
|
+
const GlobalBodyScrollLock = /*#__PURE__*/createGlobalStyle({
|
|
15
12
|
'html, body': media().until('md').css({
|
|
16
13
|
overflow: 'hidden'
|
|
17
14
|
})
|
|
18
15
|
});
|
|
19
|
-
const StyledFootnote = styled.div(
|
|
16
|
+
const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
|
|
17
|
+
displayName: "Footnote__StyledFootnote",
|
|
18
|
+
componentId: "components-web__sc-1563bo5-0"
|
|
19
|
+
})(_ref => {
|
|
20
20
|
let {
|
|
21
21
|
footnoteBackground,
|
|
22
22
|
isVisible,
|
|
@@ -60,11 +60,17 @@ const StyledFootnote = styled.div(_ref => {
|
|
|
60
60
|
}
|
|
61
61
|
return {};
|
|
62
62
|
});
|
|
63
|
-
const StyledFootnoteHeader = styled.div(
|
|
63
|
+
const StyledFootnoteHeader = /*#__PURE__*/styled.div.withConfig({
|
|
64
|
+
displayName: "Footnote__StyledFootnoteHeader",
|
|
65
|
+
componentId: "components-web__sc-1563bo5-1"
|
|
66
|
+
})(() => ({
|
|
64
67
|
position: 'relative',
|
|
65
68
|
width: '100%'
|
|
66
69
|
}));
|
|
67
|
-
const StyledHeader = styled.div(
|
|
70
|
+
const StyledHeader = /*#__PURE__*/styled.div.withConfig({
|
|
71
|
+
displayName: "Footnote__StyledHeader",
|
|
72
|
+
componentId: "components-web__sc-1563bo5-2"
|
|
73
|
+
})(_ref3 => {
|
|
68
74
|
let {
|
|
69
75
|
footnoteHeaderPaddingLeft,
|
|
70
76
|
footnoteHeaderPaddingRight,
|
|
@@ -82,7 +88,10 @@ const StyledHeader = styled.div(_ref3 => {
|
|
|
82
88
|
paddingLeft: footnoteHeaderPaddingLeft
|
|
83
89
|
};
|
|
84
90
|
});
|
|
85
|
-
const StyledFootnoteBody = styled.div(
|
|
91
|
+
const StyledFootnoteBody = /*#__PURE__*/styled.div.withConfig({
|
|
92
|
+
displayName: "Footnote__StyledFootnoteBody",
|
|
93
|
+
componentId: "components-web__sc-1563bo5-3"
|
|
94
|
+
})(_ref4 => {
|
|
86
95
|
let {
|
|
87
96
|
footnoteBodyBackground,
|
|
88
97
|
footnoteBodyPadding,
|
|
@@ -107,7 +116,10 @@ const StyledFootnoteBody = styled.div(_ref4 => {
|
|
|
107
116
|
opacity: isTextVisible ? 1 : 0
|
|
108
117
|
};
|
|
109
118
|
});
|
|
110
|
-
const List = styled(OrderedListBase)(
|
|
119
|
+
const List = /*#__PURE__*/styled(OrderedListBase).withConfig({
|
|
120
|
+
displayName: "Footnote__List",
|
|
121
|
+
componentId: "components-web__sc-1563bo5-4"
|
|
122
|
+
})(_ref5 => {
|
|
111
123
|
let {
|
|
112
124
|
listPaddingLeft
|
|
113
125
|
} = _ref5;
|
|
@@ -116,7 +128,10 @@ const List = styled(OrderedListBase)(_ref5 => {
|
|
|
116
128
|
paddingLeft: listPaddingLeft
|
|
117
129
|
};
|
|
118
130
|
});
|
|
119
|
-
const ListItem = styled(OrderedListBase.Item)(
|
|
131
|
+
const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
|
|
132
|
+
displayName: "Footnote__ListItem",
|
|
133
|
+
componentId: "components-web__sc-1563bo5-5"
|
|
134
|
+
})(_ref6 => {
|
|
120
135
|
let {
|
|
121
136
|
listItemMarkerFontSize,
|
|
122
137
|
listItemMarkerLineHeight,
|
|
@@ -140,7 +155,10 @@ const ListItem = styled(OrderedListBase.Item)(_ref6 => {
|
|
|
140
155
|
paddingLeft: listItemPaddingLeft
|
|
141
156
|
};
|
|
142
157
|
});
|
|
143
|
-
const CloseButton = styled.button(
|
|
158
|
+
const CloseButton = /*#__PURE__*/styled.button.withConfig({
|
|
159
|
+
displayName: "Footnote__CloseButton",
|
|
160
|
+
componentId: "components-web__sc-1563bo5-6"
|
|
161
|
+
})(_ref7 => {
|
|
144
162
|
let {
|
|
145
163
|
closeButtonBorder,
|
|
146
164
|
closeButtonHeight,
|
|
@@ -161,7 +179,10 @@ const CloseButton = styled.button(_ref7 => {
|
|
|
161
179
|
width: closeButtonWidth
|
|
162
180
|
};
|
|
163
181
|
});
|
|
164
|
-
const ContentContainer = styled.div({
|
|
182
|
+
const ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
183
|
+
displayName: "Footnote__ContentContainer",
|
|
184
|
+
componentId: "components-web__sc-1563bo5-7"
|
|
185
|
+
})({
|
|
165
186
|
'margin-left': 'auto',
|
|
166
187
|
'margin-right': 'auto',
|
|
167
188
|
left: 0,
|
|
@@ -175,7 +196,10 @@ const ContentContainer = styled.div({
|
|
|
175
196
|
width: maxWidth
|
|
176
197
|
};
|
|
177
198
|
});
|
|
178
|
-
const StyledCustomContentContainer = styled.div(
|
|
199
|
+
const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
200
|
+
displayName: "Footnote__StyledCustomContentContainer",
|
|
201
|
+
componentId: "components-web__sc-1563bo5-8"
|
|
202
|
+
})(_ref9 => {
|
|
179
203
|
let {
|
|
180
204
|
listItemColor,
|
|
181
205
|
listItemFontSize,
|
|
@@ -220,7 +244,6 @@ const usePrevious = value => {
|
|
|
220
244
|
* - When `Footnote` is closed, focus must return to the initiating element
|
|
221
245
|
*/
|
|
222
246
|
const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
223
|
-
var _theme$themeOptions;
|
|
224
247
|
const {
|
|
225
248
|
copy = 'en',
|
|
226
249
|
number,
|
|
@@ -290,7 +313,7 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
290
313
|
});
|
|
291
314
|
const prevProps = usePrevious(props);
|
|
292
315
|
const theme = useTheme();
|
|
293
|
-
const maxWidth = useResponsiveProp(
|
|
316
|
+
const maxWidth = useResponsiveProp(theme.themeOptions?.contentMaxWidth);
|
|
294
317
|
const [isScrollable, setIsScrollable] = React.useState(false);
|
|
295
318
|
const closeFootnote = React.useCallback((event, options) => {
|
|
296
319
|
onClose(event, options);
|
|
@@ -304,7 +327,6 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
304
327
|
* if there are no interactive elements the focus will remain inside the close button.
|
|
305
328
|
*/
|
|
306
329
|
const manageFootnoteFocusAndClose = React.useCallback(event => {
|
|
307
|
-
var _footnoteRef$current, _footnoteRef$current2;
|
|
308
330
|
if (!isVisible) {
|
|
309
331
|
return;
|
|
310
332
|
}
|
|
@@ -325,11 +347,11 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
325
347
|
firstElement.focus();
|
|
326
348
|
}
|
|
327
349
|
}
|
|
328
|
-
} else if ((event.type === 'click' || event.type === 'mousedown') && footnoteRef
|
|
350
|
+
} else if ((event.type === 'click' || event.type === 'mousedown') && footnoteRef?.current && event.target && !footnoteRef?.current?.contains(event.target) && event.target.getAttribute('data-tds-id') !== 'footnote-link') {
|
|
329
351
|
closeFootnote(event, {
|
|
330
352
|
returnFocus: false
|
|
331
353
|
});
|
|
332
|
-
} else if (event.type === 'touchstart' && footnoteRef
|
|
354
|
+
} else if (event.type === 'touchstart' && footnoteRef?.current && event.touches[0].target && !footnoteRef?.current?.contains(event.touches[0].target) && event.touches[0].target.getAttribute('data-tds-id') !== 'footnote-link') {
|
|
333
355
|
closeFootnote(event, {
|
|
334
356
|
returnFocus: false
|
|
335
357
|
});
|
|
@@ -381,8 +403,7 @@ const Footnote = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
381
403
|
|
|
382
404
|
// Set height of header on mount
|
|
383
405
|
React.useEffect(() => {
|
|
384
|
-
|
|
385
|
-
setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
|
|
406
|
+
setHeaderHeight(headerRef.current?.offsetHeight);
|
|
386
407
|
}, []);
|
|
387
408
|
const preventDefault = event => {
|
|
388
409
|
if (!bodyRef.current.contains(event.touches[0].target)) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { applyTextStyles, selectSystemProps, useCopy, useThemeTokens, variantProp } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
4
5
|
import dictionary from './dictionary';
|
|
5
|
-
import { htmlAttrs
|
|
6
|
+
import { htmlAttrs } from '../utils';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const {
|
|
8
|
-
styled
|
|
9
|
-
} = styledComponents;
|
|
10
8
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const StyledSup = styled.sup(
|
|
9
|
+
const StyledSup = /*#__PURE__*/styled.sup.withConfig({
|
|
10
|
+
displayName: "FootnoteLink__StyledSup",
|
|
11
|
+
componentId: "components-web__sc-17nd7xo-0"
|
|
12
|
+
})(_ref => {
|
|
12
13
|
let {
|
|
13
14
|
fontSize,
|
|
14
15
|
lineHeight,
|