@telus-uds/components-web 3.4.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 +22 -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/cjs/NavigationBar/collapseItems.js +43 -0
- 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 -21
- 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 +5 -5
- 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 +18 -12
- package/lib/esm/DatePicker/reactDatesCss.js +3 -0
- package/lib/{Disclaimer → esm/Disclaimer}/Disclaimer.js +6 -5
- package/lib/{Footnote → esm/Footnote}/Footnote.js +39 -15
- package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
- 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 +6 -5
- 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/{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 +16 -17
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +13 -7
- 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 +13 -64
- package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +6 -5
- 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 +26 -10
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +20 -44
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +18 -52
- package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
- package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
- package/lib/{index.js → esm/index.js} +1 -1
- 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}/ssr.js +1 -4
- package/package.json +17 -16
- package/src/Badge/Badge.jsx +2 -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 +1 -3
- 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/index.js +1 -1
- 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 +1 -2
- package/lib/DatePicker/reactDatesCss.js +0 -830
- package/lib/QuantitySelector/styles.js +0 -18
- package/lib/Table/Row.js +0 -19
- package/lib/utils/theming/styled-components.js +0 -26
- 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}/NavigationSubMenu.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/collapseItems.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.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}/SkeletonImage.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonTypography.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/{baseExports.js → esm/baseExports.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}/scrollToAnchor.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}/useOverlaidPosition.js +0 -0
- /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
// Passes React Native-oriented system props through UDS Progress
|
|
14
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _componentsBase.viewProps]);
|
|
15
|
+
const {
|
|
16
|
+
Bar: ProgressBarBase
|
|
17
|
+
} = _componentsBase.Progress;
|
|
18
|
+
const Gradient = /*#__PURE__*/_styledComponents.default.div.attrs({
|
|
19
|
+
'data-testid': 'ProgressBar-Gradient'
|
|
20
|
+
}).withConfig({
|
|
21
|
+
displayName: "ProgressBar__Gradient",
|
|
22
|
+
componentId: "components-web__sc-1vmzyq5-0"
|
|
23
|
+
})(_ref => {
|
|
24
|
+
let {
|
|
25
|
+
gradient: {
|
|
26
|
+
angle,
|
|
27
|
+
stops,
|
|
28
|
+
type
|
|
29
|
+
},
|
|
30
|
+
borderRadius,
|
|
31
|
+
shadow
|
|
32
|
+
} = _ref;
|
|
33
|
+
return {
|
|
34
|
+
height: '100%',
|
|
35
|
+
width: '100%',
|
|
36
|
+
background: `${type}-gradient(${angle}deg, ${stops[0].color}, ${stops[1].color})`,
|
|
37
|
+
borderRadius,
|
|
38
|
+
...(0, _componentsBase.applyShadowToken)(shadow)
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The `ProgressBar` is a visual representation of linear progression.
|
|
44
|
+
* It provides simple but important information at a quick glance.
|
|
45
|
+
* This is a Web-specific progress bar.
|
|
46
|
+
*
|
|
47
|
+
* ## Component API
|
|
48
|
+
*
|
|
49
|
+
* Use props and tokens from the base ProgressBar component. The difference is that the
|
|
50
|
+
* `gradient` is being used here to provide gradient filling.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
const ProgressBar = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
55
|
+
let {
|
|
56
|
+
percentage,
|
|
57
|
+
tokens,
|
|
58
|
+
variant,
|
|
59
|
+
offset,
|
|
60
|
+
...rest
|
|
61
|
+
} = _ref2;
|
|
62
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('ProgressBar', tokens, variant);
|
|
63
|
+
const selectedProps = selectProps(rest);
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ProgressBarBase, {
|
|
65
|
+
percentage: percentage,
|
|
66
|
+
tokens: tokens,
|
|
67
|
+
variant: variant,
|
|
68
|
+
ref: ref,
|
|
69
|
+
offset: offset,
|
|
70
|
+
...selectedProps,
|
|
71
|
+
children: themeTokens.gradient && /*#__PURE__*/(0, _jsxRuntime.jsx)(Gradient, {
|
|
72
|
+
...themeTokens
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
ProgressBar.displayName = 'ProgressBar';
|
|
77
|
+
ProgressBar.propTypes = {
|
|
78
|
+
...selectedSystemPropTypes,
|
|
79
|
+
/**
|
|
80
|
+
* Percentage of completion.
|
|
81
|
+
*/
|
|
82
|
+
percentage: _propTypes.default.number,
|
|
83
|
+
/**
|
|
84
|
+
* ProgressBar tokens.
|
|
85
|
+
*/
|
|
86
|
+
tokens: (0, _componentsBase.getTokensPropType)('ProgressBar'),
|
|
87
|
+
/**
|
|
88
|
+
* ProgressBar variant.
|
|
89
|
+
*/
|
|
90
|
+
variant: _componentsBase.variantProp.propType,
|
|
91
|
+
/**
|
|
92
|
+
* Offset position.
|
|
93
|
+
*/
|
|
94
|
+
offset: _propTypes.default.shape({
|
|
95
|
+
items: _propTypes.default.number,
|
|
96
|
+
current: _propTypes.default.number
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
var _default = exports.default = ProgressBar;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
8
|
+
var _ProgressBar = _interopRequireDefault(require("./ProgressBar"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
_componentsBase.Progress.Bar = _ProgressBar.default;
|
|
11
|
+
var _default = exports.default = _componentsBase.Progress;
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
+
var _utils = require("../utils");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
var _dictionary = _interopRequireDefault(require("./dictionary"));
|
|
13
|
+
var _SideButton = _interopRequireDefault(require("./SideButton"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const {
|
|
17
|
+
isNaN
|
|
18
|
+
} = Number;
|
|
19
|
+
const isNumber = value => {
|
|
20
|
+
return typeof value === 'number' && !isNaN(value);
|
|
21
|
+
};
|
|
22
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_componentsBase.a11yProps, _utils.htmlAttrs]);
|
|
23
|
+
const QuantitySelector = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
id = 'quantity-selector',
|
|
26
|
+
minNumber,
|
|
27
|
+
maxNumber,
|
|
28
|
+
defaultValue,
|
|
29
|
+
value,
|
|
30
|
+
label,
|
|
31
|
+
hint,
|
|
32
|
+
hintPosition = 'inline',
|
|
33
|
+
tooltip,
|
|
34
|
+
onChange,
|
|
35
|
+
dictionary = _dictionary.default,
|
|
36
|
+
accessibilityLabel,
|
|
37
|
+
copy = 'en',
|
|
38
|
+
variant = {
|
|
39
|
+
alternative: false
|
|
40
|
+
},
|
|
41
|
+
tokens,
|
|
42
|
+
testID = 'quantity-selector-testid',
|
|
43
|
+
...rest
|
|
44
|
+
} = _ref;
|
|
45
|
+
const {
|
|
46
|
+
disabled
|
|
47
|
+
} = variant;
|
|
48
|
+
const [error, setError] = _react.default.useState('');
|
|
49
|
+
const getCopy = (0, _componentsBase.useCopy)({
|
|
50
|
+
dictionary,
|
|
51
|
+
copy
|
|
52
|
+
});
|
|
53
|
+
const getValidatedNumber = numberToEvaluate => {
|
|
54
|
+
if (isNaN(numberToEvaluate)) return null;
|
|
55
|
+
if (isNumber(minNumber) && numberToEvaluate < minNumber) throw getCopy('errors').numberIsTooSmall(minNumber);
|
|
56
|
+
if (isNumber(maxNumber) && numberToEvaluate > maxNumber) throw getCopy('errors').numberIsTooBig(maxNumber);
|
|
57
|
+
return numberToEvaluate;
|
|
58
|
+
};
|
|
59
|
+
const {
|
|
60
|
+
currentValue: number,
|
|
61
|
+
setValue: setNumber
|
|
62
|
+
} = (0, _componentsBase.useInputValue)({
|
|
63
|
+
value: getValidatedNumber(value),
|
|
64
|
+
initialValue: getValidatedNumber(defaultValue),
|
|
65
|
+
onChange
|
|
66
|
+
});
|
|
67
|
+
const isDecreaseEnabled = !disabled && !isNumber(minNumber) || number > minNumber;
|
|
68
|
+
const isIncreaseEnabled = !disabled && !isNumber(maxNumber) || number < maxNumber;
|
|
69
|
+
const inputValue = isNumber(number) ? number.toString() : '';
|
|
70
|
+
const updateNumber = (newNumber, originalInputEvent) => {
|
|
71
|
+
try {
|
|
72
|
+
const validatedNumber = getValidatedNumber(newNumber);
|
|
73
|
+
setNumber(validatedNumber, originalInputEvent);
|
|
74
|
+
setError('');
|
|
75
|
+
} catch (e) {
|
|
76
|
+
setError(e);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const inputChangeHandler = (textInputValue, event) => {
|
|
80
|
+
if (textInputValue === '') setNumber(null);
|
|
81
|
+
const numberFromTextInput = Number(textInputValue);
|
|
82
|
+
if (isNumber(numberFromTextInput)) {
|
|
83
|
+
updateNumber(numberFromTextInput, event);
|
|
84
|
+
} else {
|
|
85
|
+
setError(getCopy('errors').invalidCharacters);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const renderLabel = () => label || hint ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.InputLabel, {
|
|
89
|
+
forId: id,
|
|
90
|
+
label: label,
|
|
91
|
+
hint: hint,
|
|
92
|
+
hintPosition: hintPosition,
|
|
93
|
+
tooltip: tooltip
|
|
94
|
+
}) : null;
|
|
95
|
+
const getTokens = (0, _componentsBase.useThemeTokensCallback)('QuantitySelector', tokens, variant);
|
|
96
|
+
const renderTextInput = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.TextInput, {
|
|
97
|
+
nativeID: id,
|
|
98
|
+
value: inputValue,
|
|
99
|
+
defaultValue: defaultValue,
|
|
100
|
+
tokens: textInputState => {
|
|
101
|
+
const {
|
|
102
|
+
inputWidth,
|
|
103
|
+
inputBorderWidth,
|
|
104
|
+
inputBorderColor,
|
|
105
|
+
textColor,
|
|
106
|
+
inputBackgroundColor,
|
|
107
|
+
...restOfTokens
|
|
108
|
+
} = getTokens({
|
|
109
|
+
...textInputState
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
...restOfTokens,
|
|
113
|
+
order: 1,
|
|
114
|
+
borderWidth: inputBorderWidth,
|
|
115
|
+
backgroundColor: inputBackgroundColor,
|
|
116
|
+
color: textColor,
|
|
117
|
+
width: inputWidth,
|
|
118
|
+
borderColor: inputBorderColor,
|
|
119
|
+
borderRadius: 0,
|
|
120
|
+
outerBorderWidth: 0
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
onChange: inputChangeHandler
|
|
124
|
+
// Using title as an accessibility workaround
|
|
125
|
+
// given that accessibilityLabel is not available
|
|
126
|
+
,
|
|
127
|
+
keyboardType: "numeric",
|
|
128
|
+
accessibilityLabel: accessibilityLabel ?? getCopy('accessibility').a11yLabel,
|
|
129
|
+
accessibilityRole: "spinbutton",
|
|
130
|
+
accessibilityValueMax: maxNumber,
|
|
131
|
+
accessibilityValueMin: minNumber,
|
|
132
|
+
accessibilityValueNow: number
|
|
133
|
+
});
|
|
134
|
+
const flexOrder = order => ({
|
|
135
|
+
order
|
|
136
|
+
});
|
|
137
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_componentsBase.Box, {
|
|
138
|
+
testID: testID,
|
|
139
|
+
ref: ref,
|
|
140
|
+
...selectProps(rest),
|
|
141
|
+
children: [renderLabel(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
|
|
142
|
+
space: 2
|
|
143
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.InputWrapper, {
|
|
144
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputField, {
|
|
145
|
+
children: renderTextInput()
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
147
|
+
style: flexOrder(0),
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
|
|
149
|
+
isEnabled: isDecreaseEnabled,
|
|
150
|
+
onPress: () => updateNumber(number - 1),
|
|
151
|
+
onDoubleClick: () => updateNumber(number - 1),
|
|
152
|
+
tokens: tokens,
|
|
153
|
+
variant: {
|
|
154
|
+
decrease: true,
|
|
155
|
+
...variant
|
|
156
|
+
},
|
|
157
|
+
accessibilityLabel: getCopy('accessibility').decreaseButton,
|
|
158
|
+
accessibilityDisabled: !isDecreaseEnabled
|
|
159
|
+
})
|
|
160
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
161
|
+
style: flexOrder(2),
|
|
162
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SideButton.default, {
|
|
163
|
+
isEnabled: isIncreaseEnabled,
|
|
164
|
+
onPress: () => updateNumber(number + 1),
|
|
165
|
+
onDoubleClick: () => updateNumber(number + 1),
|
|
166
|
+
accessibilityLabel: getCopy('accessibility').increaseButton,
|
|
167
|
+
accessibilityDisabled: !isIncreaseEnabled,
|
|
168
|
+
tokens: tokens,
|
|
169
|
+
variant: {
|
|
170
|
+
increase: true,
|
|
171
|
+
...variant
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
})]
|
|
175
|
+
}), error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Box, {
|
|
176
|
+
vertical: 2,
|
|
177
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Feedback, {
|
|
178
|
+
validation: "error",
|
|
179
|
+
children: error
|
|
180
|
+
})
|
|
181
|
+
}) : null]
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// If a language dictionary entry is provided, it must contain every key
|
|
186
|
+
const dictionaryContentShape = _propTypes.default.shape({
|
|
187
|
+
accessibility: _propTypes.default.shape({
|
|
188
|
+
a11yLabel: _propTypes.default.string.isRequired,
|
|
189
|
+
increaseButton: _propTypes.default.string.isRequired,
|
|
190
|
+
decreaseButton: _propTypes.default.string.isRequired
|
|
191
|
+
}).isRequired,
|
|
192
|
+
errors: _propTypes.default.shape({
|
|
193
|
+
numberIsTooSmall: _propTypes.default.func.isRequired,
|
|
194
|
+
numberIsTooBig: _propTypes.default.func.isRequired,
|
|
195
|
+
invalidCharacters: _propTypes.default.string.isRequired
|
|
196
|
+
}).isRequired
|
|
197
|
+
});
|
|
198
|
+
QuantitySelector.displayName = 'QuantitySelector';
|
|
199
|
+
QuantitySelector.propTypes = {
|
|
200
|
+
...selectedSystemPropTypes,
|
|
201
|
+
/**
|
|
202
|
+
* The id of the input field
|
|
203
|
+
*/
|
|
204
|
+
id: _propTypes.default.string,
|
|
205
|
+
/**
|
|
206
|
+
* The minimum number allowed
|
|
207
|
+
*/
|
|
208
|
+
minNumber: _propTypes.default.number,
|
|
209
|
+
/**
|
|
210
|
+
* The maximum number allowed
|
|
211
|
+
*/
|
|
212
|
+
maxNumber: _propTypes.default.number,
|
|
213
|
+
/**
|
|
214
|
+
* The callback function that is called when the value of the input field changes
|
|
215
|
+
*/
|
|
216
|
+
onChange: _propTypes.default.func,
|
|
217
|
+
/**
|
|
218
|
+
* The default value of the input field
|
|
219
|
+
*/
|
|
220
|
+
defaultValue: _propTypes.default.number,
|
|
221
|
+
/**
|
|
222
|
+
* If the input's state is to be controlled by a parent component, use this prop
|
|
223
|
+
* together with the `onChange` to pass down and update the lifted state.
|
|
224
|
+
*/
|
|
225
|
+
value: _propTypes.default.number,
|
|
226
|
+
/**
|
|
227
|
+
* The label of the input field
|
|
228
|
+
*/
|
|
229
|
+
label: _propTypes.default.string,
|
|
230
|
+
/**
|
|
231
|
+
* The hint of the input field
|
|
232
|
+
*/
|
|
233
|
+
hint: _propTypes.default.string,
|
|
234
|
+
/**
|
|
235
|
+
* The position of the hint. Could be shown along side the label or below it
|
|
236
|
+
*/
|
|
237
|
+
hintPosition: _propTypes.default.oneOf(['inline', 'below']),
|
|
238
|
+
/**
|
|
239
|
+
* Adds a question mark which will display a tooltip when clicked
|
|
240
|
+
*/
|
|
241
|
+
tooltip: _propTypes.default.string,
|
|
242
|
+
/**
|
|
243
|
+
* The accessibility label of the input field
|
|
244
|
+
*/
|
|
245
|
+
accessibilityLabel: _propTypes.default.string,
|
|
246
|
+
/**
|
|
247
|
+
* The dictionary object containing the content for the input field
|
|
248
|
+
*/
|
|
249
|
+
dictionary: _propTypes.default.shape({
|
|
250
|
+
en: dictionaryContentShape,
|
|
251
|
+
fr: dictionaryContentShape
|
|
252
|
+
}),
|
|
253
|
+
/**
|
|
254
|
+
* The language to use for the copy.
|
|
255
|
+
*/
|
|
256
|
+
copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr'])]),
|
|
257
|
+
variant: _propTypes.default.exact({
|
|
258
|
+
alternative: _propTypes.default.bool,
|
|
259
|
+
disabled: _propTypes.default.bool
|
|
260
|
+
}),
|
|
261
|
+
tokens: (0, _componentsBase.getTokensPropType)('QuantitySelector'),
|
|
262
|
+
/**
|
|
263
|
+
* Sets `data-testid` attribute on the input field for testing purposes.
|
|
264
|
+
*/
|
|
265
|
+
testID: _propTypes.default.string
|
|
266
|
+
};
|
|
267
|
+
var _default = exports.default = QuantitySelector;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const SideButton = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
13
|
+
let {
|
|
14
|
+
isEnabled = true,
|
|
15
|
+
onPress = () => {},
|
|
16
|
+
onDoubleClick = () => {},
|
|
17
|
+
accessibilityLabel = '',
|
|
18
|
+
accessibilityDisabled = false,
|
|
19
|
+
tokens = {},
|
|
20
|
+
variant = {}
|
|
21
|
+
} = _ref;
|
|
22
|
+
const getTokens = (0, _componentsBase.useThemeTokensCallback)('QuantitySelectorSideButton', tokens, variant);
|
|
23
|
+
const getButtonTokens = _ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
buttonState,
|
|
26
|
+
disabled
|
|
27
|
+
} = _ref2;
|
|
28
|
+
const {
|
|
29
|
+
borderRadius,
|
|
30
|
+
borderTopLeftRadius,
|
|
31
|
+
borderTopRightRadius,
|
|
32
|
+
borderBottomLeftRadius,
|
|
33
|
+
borderBottomRightRadius,
|
|
34
|
+
...rest
|
|
35
|
+
} = getTokens({
|
|
36
|
+
...buttonState,
|
|
37
|
+
disabled
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
...rest,
|
|
41
|
+
borderRadius,
|
|
42
|
+
borderTopLeftRadius,
|
|
43
|
+
borderTopRightRadius,
|
|
44
|
+
borderBottomLeftRadius,
|
|
45
|
+
borderBottomRightRadius,
|
|
46
|
+
outerBorderRadius: borderRadius,
|
|
47
|
+
outerBorderTopLeftRadius: borderTopLeftRadius,
|
|
48
|
+
outerBorderTopRightRadius: borderTopRightRadius,
|
|
49
|
+
outerBorderBottomLeftRadius: borderBottomLeftRadius,
|
|
50
|
+
outerBorderBottomRightRadius: borderBottomRightRadius,
|
|
51
|
+
outerBorderGap: 0,
|
|
52
|
+
outerBorderWidth: 0
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.IconButton, {
|
|
56
|
+
tokens: buttonState => getButtonTokens({
|
|
57
|
+
disabled: !isEnabled,
|
|
58
|
+
buttonState
|
|
59
|
+
}),
|
|
60
|
+
onPress: onPress,
|
|
61
|
+
onDoubleClick: onDoubleClick,
|
|
62
|
+
accessibilityLabel: accessibilityLabel,
|
|
63
|
+
accessibilityDisabled: accessibilityDisabled,
|
|
64
|
+
ref: ref
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
SideButton.displayName = 'QuantitySelectorSideButton';
|
|
68
|
+
SideButton.propTypes = {
|
|
69
|
+
isEnabled: _propTypes.default.bool,
|
|
70
|
+
onPress: _propTypes.default.func,
|
|
71
|
+
onDoubleClick: _propTypes.default.func,
|
|
72
|
+
accessibilityLabel: _propTypes.default.string,
|
|
73
|
+
accessibilityDisabled: _propTypes.default.bool,
|
|
74
|
+
tokens: (0, _componentsBase.getTokensPropType)('QuantitySelectorSideButton'),
|
|
75
|
+
variant: _propTypes.default.object
|
|
76
|
+
};
|
|
77
|
+
var _default = exports.default = SideButton;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
en: {
|
|
9
|
+
accessibility: {
|
|
10
|
+
a11yLabel: 'Quantity selector',
|
|
11
|
+
increaseButton: 'Increase quantity',
|
|
12
|
+
decreaseButton: 'Decrease quantity'
|
|
13
|
+
},
|
|
14
|
+
errors: {
|
|
15
|
+
numberIsTooSmall: minNumber => `You can enter a number equal or greater than ${minNumber}.`,
|
|
16
|
+
numberIsTooBig: maxNumber => `You can enter a number equal or less than ${maxNumber}.`,
|
|
17
|
+
invalidCharacters: 'Try using numbers only. Alphabetical or symbols characters are not allowed.'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
fr: {
|
|
21
|
+
accessibility: {
|
|
22
|
+
a11yLabel: 'Sélecteur de quantité',
|
|
23
|
+
increaseButton: `Augmenter la quantité`,
|
|
24
|
+
decreaseButton: `Réduire la quantité`
|
|
25
|
+
},
|
|
26
|
+
errors: {
|
|
27
|
+
numberIsTooSmall: minNumber => `Vous pouvez saisir un nombre égal ou supérieur à ${minNumber}.`,
|
|
28
|
+
numberIsTooBig: maxNumber => `Vous pouvez saisir un nombre égal ou inférieur à ${maxNumber}.`,
|
|
29
|
+
invalidCharacters: `Essayez d'utiliser seulement des chiffres. Les caractères alphabétiques ou les symboles ne sont pas permis.`
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _QuantitySelector = _interopRequireDefault(require("./QuantitySelector"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _QuantitySelector.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.InputWrapper = exports.InputField = void 0;
|
|
7
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const InputField = exports.InputField = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
10
|
+
displayName: "styles__InputField",
|
|
11
|
+
componentId: "components-web__sc-1lrz1xk-0"
|
|
12
|
+
})(["order:1;text-align:center;z-index:10;input{text-align:center;}"]);
|
|
13
|
+
const InputWrapper = exports.InputWrapper = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
14
|
+
displayName: "styles__InputWrapper",
|
|
15
|
+
componentId: "components-web__sc-1lrz1xk-1"
|
|
16
|
+
})(["text-align:start;display:flex;flex-direction:row;flex-wrap:nowrap;"]);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _componentsBase = require("@telus-uds/components-base");
|
|
10
|
+
var _systemConstants = require("@telus-uds/system-constants");
|
|
11
|
+
var _utils = require("../utils");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs, _utils.contentfulProps]);
|
|
15
|
+
const staticStyles = {
|
|
16
|
+
image: {
|
|
17
|
+
display: 'block',
|
|
18
|
+
width: '100%'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Provide different image sources for different screen sizes.
|
|
24
|
+
*/
|
|
25
|
+
const ResponsiveImage = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
26
|
+
let {
|
|
27
|
+
xsSrc,
|
|
28
|
+
smSrc,
|
|
29
|
+
mdSrc,
|
|
30
|
+
lgSrc,
|
|
31
|
+
xlSrc,
|
|
32
|
+
fallbackSrc,
|
|
33
|
+
alt,
|
|
34
|
+
loading = 'eager',
|
|
35
|
+
dataSet,
|
|
36
|
+
...rest
|
|
37
|
+
} = _ref;
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("picture", {
|
|
39
|
+
...selectProps(rest),
|
|
40
|
+
ref: ref,
|
|
41
|
+
...dataSet,
|
|
42
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
43
|
+
srcSet: xlSrc,
|
|
44
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.xl)}px)`
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
46
|
+
srcSet: lgSrc,
|
|
47
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.lg)}px)`
|
|
48
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
49
|
+
srcSet: mdSrc,
|
|
50
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.md)}px)`
|
|
51
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
52
|
+
srcSet: smSrc,
|
|
53
|
+
media: `(min-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.sm)}px)`
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("source", {
|
|
55
|
+
srcSet: xsSrc,
|
|
56
|
+
media: `(max-width: ${_systemConstants.viewports.map.get(_systemConstants.viewports.sm) - 1}px)`
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
58
|
+
src: fallbackSrc,
|
|
59
|
+
alt: alt,
|
|
60
|
+
style: staticStyles.image,
|
|
61
|
+
loading: loading
|
|
62
|
+
})]
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
ResponsiveImage.displayName = 'ResponsiveImage';
|
|
66
|
+
ResponsiveImage.propTypes = {
|
|
67
|
+
...selectedSystemPropTypes,
|
|
68
|
+
/**
|
|
69
|
+
* The src attribute used for screen widths up to 575px
|
|
70
|
+
*/
|
|
71
|
+
xsSrc: _propTypes.default.string.isRequired,
|
|
72
|
+
/**
|
|
73
|
+
* The src attribute used for screen widths greater than 576px
|
|
74
|
+
*/
|
|
75
|
+
smSrc: _propTypes.default.string.isRequired,
|
|
76
|
+
/**
|
|
77
|
+
* The src attribute used for screen widths greater than 768px
|
|
78
|
+
*/
|
|
79
|
+
mdSrc: _propTypes.default.string,
|
|
80
|
+
/**
|
|
81
|
+
* The src attribute used for screen widths greater than 992px
|
|
82
|
+
*/
|
|
83
|
+
lgSrc: _propTypes.default.string,
|
|
84
|
+
/**
|
|
85
|
+
* The src attribute used for screen widths greater than 1200px
|
|
86
|
+
*/
|
|
87
|
+
xlSrc: _propTypes.default.string,
|
|
88
|
+
/**
|
|
89
|
+
* The src attribute used for browsers that don't support responsive images (InternetExplorer)
|
|
90
|
+
*/
|
|
91
|
+
fallbackSrc: _propTypes.default.string.isRequired,
|
|
92
|
+
/**
|
|
93
|
+
* The alt attribute for the HTML img element. Setting this attribute to an empty string (alt="") indicates that this image is not a key part of the content, and that non-visual browsers may omit it from rendering.
|
|
94
|
+
*/
|
|
95
|
+
alt: _propTypes.default.string.isRequired,
|
|
96
|
+
/**
|
|
97
|
+
* Loading strategy.
|
|
98
|
+
* @default 'eager'
|
|
99
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading
|
|
100
|
+
*/
|
|
101
|
+
loading: _propTypes.default.oneOf(['eager', 'lazy']),
|
|
102
|
+
/**
|
|
103
|
+
* The dataSet prop allows to pass data-* attributes element to the component.
|
|
104
|
+
*/
|
|
105
|
+
dataSet: _propTypes.default.object
|
|
106
|
+
};
|
|
107
|
+
var _default = exports.default = ResponsiveImage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _ResponsiveImage = _interopRequireDefault(require("./ResponsiveImage"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
var _default = exports.default = _ResponsiveImage.default;
|