@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,187 @@
|
|
|
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 = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
var _Table = require("./Table");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const HEADER_TYPE = {
|
|
17
|
+
HEADING: 'heading',
|
|
18
|
+
SUBHEADING: 'subHeading',
|
|
19
|
+
ROWHEADING: 'rowHeading'
|
|
20
|
+
};
|
|
21
|
+
const stickyStyles = _ref => {
|
|
22
|
+
let {
|
|
23
|
+
cellStickyShadow,
|
|
24
|
+
stickyBackgroundColor,
|
|
25
|
+
type
|
|
26
|
+
} = _ref;
|
|
27
|
+
return (0, _styledComponents.css)(["position:sticky;left:0;z-index:2;clip-path:inset(0 -8px 0 0);", " &::before{content:'';box-shadow:", ";position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;}"], type !== HEADER_TYPE.SUBHEADING && type !== HEADER_TYPE.HEADING ? `background-color: ${stickyBackgroundColor};` : undefined, cellStickyShadow);
|
|
28
|
+
};
|
|
29
|
+
const sharedStyles = /*#__PURE__*/(0, _styledComponents.css)(["", ""], _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
isSticky,
|
|
32
|
+
align,
|
|
33
|
+
cellPaddingTop,
|
|
34
|
+
cellPaddingRight,
|
|
35
|
+
cellPaddingBottom,
|
|
36
|
+
cellPaddingLeft,
|
|
37
|
+
cellMinWidth,
|
|
38
|
+
cellBackground,
|
|
39
|
+
cellStickyShadow,
|
|
40
|
+
stickyBackgroundColor,
|
|
41
|
+
type
|
|
42
|
+
} = _ref2;
|
|
43
|
+
return (0, _styledComponents.css)(["text-align:", ";min-width:", "px;padding:", "px ", "px ", "px ", "px;background-color:", ";", ";"], align, cellMinWidth, cellPaddingTop, cellPaddingRight, cellPaddingBottom, cellPaddingLeft, cellBackground, isSticky && stickyStyles({
|
|
44
|
+
type,
|
|
45
|
+
cellStickyShadow,
|
|
46
|
+
stickyBackgroundColor
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
const createStyledCell = htmlElement => _styledComponents.default[htmlElement].withConfig({
|
|
50
|
+
displayName: "Cell__createStyledCell",
|
|
51
|
+
componentId: "components-web__sc-ltgfic-0"
|
|
52
|
+
})(["", ";box-shadow:", ";", ""], sharedStyles, _ref3 => {
|
|
53
|
+
let {
|
|
54
|
+
cellBoxShadowColor,
|
|
55
|
+
type
|
|
56
|
+
} = _ref3;
|
|
57
|
+
return type === HEADER_TYPE.HEADING ? `inset 0 1px 0 ${cellBoxShadowColor}, inset 0 -1px 0 ${cellBoxShadowColor}` : `inset 0 1px 0 ${cellBoxShadowColor}`;
|
|
58
|
+
}, _ref4 => {
|
|
59
|
+
let {
|
|
60
|
+
display
|
|
61
|
+
} = _ref4;
|
|
62
|
+
return display && `*:not(:empty) {
|
|
63
|
+
display: ${display};
|
|
64
|
+
}`;
|
|
65
|
+
});
|
|
66
|
+
const StyledHeaderCell = createStyledCell('th');
|
|
67
|
+
const StyledDataCell = createStyledCell('td');
|
|
68
|
+
const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
69
|
+
let {
|
|
70
|
+
children,
|
|
71
|
+
isFirstInRow,
|
|
72
|
+
align = 'left',
|
|
73
|
+
tokens: cellTokens,
|
|
74
|
+
type = 'default'
|
|
75
|
+
} = _ref5;
|
|
76
|
+
const {
|
|
77
|
+
text,
|
|
78
|
+
isScrollable: isTableScrollable,
|
|
79
|
+
tokens: tableTokens,
|
|
80
|
+
spacing,
|
|
81
|
+
variant
|
|
82
|
+
} = (0, _Table.useTableContext)();
|
|
83
|
+
const themeTokens = {
|
|
84
|
+
...tableTokens,
|
|
85
|
+
...cellTokens
|
|
86
|
+
};
|
|
87
|
+
const {
|
|
88
|
+
cellMinWidth,
|
|
89
|
+
cellBoxShadowColor,
|
|
90
|
+
cellBackground,
|
|
91
|
+
cellStickyShadow,
|
|
92
|
+
cellPaddingTop,
|
|
93
|
+
cellPaddingRight,
|
|
94
|
+
cellPaddingLeft,
|
|
95
|
+
cellPaddingBottom,
|
|
96
|
+
fontName,
|
|
97
|
+
fontWeight,
|
|
98
|
+
fontSize,
|
|
99
|
+
lineHeight,
|
|
100
|
+
stickyBackgroundColor,
|
|
101
|
+
fontColor,
|
|
102
|
+
display
|
|
103
|
+
} = (0, _componentsBase.useThemeTokens)('Table', themeTokens, {
|
|
104
|
+
spacing,
|
|
105
|
+
type,
|
|
106
|
+
text,
|
|
107
|
+
...variant
|
|
108
|
+
});
|
|
109
|
+
const sharedProps = {
|
|
110
|
+
align,
|
|
111
|
+
isSticky: isTableScrollable && isFirstInRow,
|
|
112
|
+
cellBackground,
|
|
113
|
+
cellMinWidth,
|
|
114
|
+
cellStickyShadow: (0, _componentsBase.applyShadowToken)(cellStickyShadow).boxShadow,
|
|
115
|
+
cellPaddingTop,
|
|
116
|
+
cellPaddingRight,
|
|
117
|
+
cellPaddingLeft,
|
|
118
|
+
cellPaddingBottom,
|
|
119
|
+
stickyBackgroundColor,
|
|
120
|
+
cellBoxShadowColor,
|
|
121
|
+
display,
|
|
122
|
+
ref
|
|
123
|
+
};
|
|
124
|
+
const typographyTokens = {
|
|
125
|
+
fontName,
|
|
126
|
+
fontWeight,
|
|
127
|
+
fontSize,
|
|
128
|
+
lineHeight,
|
|
129
|
+
color: fontColor
|
|
130
|
+
};
|
|
131
|
+
switch (type) {
|
|
132
|
+
case HEADER_TYPE.HEADING:
|
|
133
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
134
|
+
scope: "col",
|
|
135
|
+
...sharedProps,
|
|
136
|
+
type: type,
|
|
137
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
138
|
+
tokens: typographyTokens,
|
|
139
|
+
children: children
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
case HEADER_TYPE.SUBHEADING:
|
|
143
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
144
|
+
scope: "col",
|
|
145
|
+
...sharedProps,
|
|
146
|
+
type: type,
|
|
147
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
148
|
+
tokens: typographyTokens,
|
|
149
|
+
children: children
|
|
150
|
+
})
|
|
151
|
+
});
|
|
152
|
+
case HEADER_TYPE.ROWHEADING:
|
|
153
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledHeaderCell, {
|
|
154
|
+
scope: "row",
|
|
155
|
+
...sharedProps,
|
|
156
|
+
type: type,
|
|
157
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
158
|
+
tokens: typographyTokens,
|
|
159
|
+
children: children
|
|
160
|
+
})
|
|
161
|
+
});
|
|
162
|
+
default:
|
|
163
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDataCell, {
|
|
164
|
+
...sharedProps,
|
|
165
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
|
|
166
|
+
tokens: typographyTokens,
|
|
167
|
+
children: children
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
Cell.displayName = 'Cell';
|
|
173
|
+
Cell.propTypes = {
|
|
174
|
+
type: _propTypes.default.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
175
|
+
tokens: _propTypes.default.object,
|
|
176
|
+
children: _propTypes.default.node,
|
|
177
|
+
/**
|
|
178
|
+
* @ignore
|
|
179
|
+
* Used internally for making the first column sticky
|
|
180
|
+
*/
|
|
181
|
+
isFirstInRow: _propTypes.default.bool,
|
|
182
|
+
/**
|
|
183
|
+
* Defines the text alignment within the cell
|
|
184
|
+
*/
|
|
185
|
+
align: _propTypes.default.oneOf(['left', 'center', 'right'])
|
|
186
|
+
};
|
|
187
|
+
var _default = exports.default = Cell;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 _Row = _interopRequireDefault(require("./Row"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const Header = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
13
|
+
let {
|
|
14
|
+
children
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
17
|
+
ref: ref,
|
|
18
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Row.default, {
|
|
19
|
+
children: _react.default.Children.map(children, child =>
|
|
20
|
+
/*#__PURE__*/
|
|
21
|
+
// TO DO: pass type as a variant instead of prop
|
|
22
|
+
_react.default.cloneElement(child, {
|
|
23
|
+
type: 'heading'
|
|
24
|
+
}))
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
Header.displayName = 'Header';
|
|
29
|
+
Header.propTypes = {
|
|
30
|
+
children: _propTypes.default.node
|
|
31
|
+
};
|
|
32
|
+
var _default = exports.default = Header;
|
|
@@ -0,0 +1,41 @@
|
|
|
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 _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
|
+
var _Table = require("./Table");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const StyledTR = /*#__PURE__*/_styledComponents.default.tr.withConfig({
|
|
14
|
+
displayName: "Row__StyledTR",
|
|
15
|
+
componentId: "components-web__sc-6pbb9a-0"
|
|
16
|
+
})(["&:hover{background-color:", " !important;}"], _ref => {
|
|
17
|
+
let {
|
|
18
|
+
rowHoverBackgroundColor
|
|
19
|
+
} = _ref;
|
|
20
|
+
return rowHoverBackgroundColor;
|
|
21
|
+
});
|
|
22
|
+
const Row = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
|
|
23
|
+
let {
|
|
24
|
+
children
|
|
25
|
+
} = _ref2;
|
|
26
|
+
const {
|
|
27
|
+
themeTokens
|
|
28
|
+
} = (0, _Table.useTableContext)();
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTR, {
|
|
30
|
+
ref: ref,
|
|
31
|
+
rowHoverBackgroundColor: themeTokens?.rowHoverBackgroundColor,
|
|
32
|
+
children: _react.default.Children.map(children, (child, index) => /*#__PURE__*/_react.default.cloneElement(child, {
|
|
33
|
+
isFirstInRow: index === 0
|
|
34
|
+
}))
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
Row.displayName = 'Row';
|
|
38
|
+
Row.propTypes = {
|
|
39
|
+
children: _propTypes.default.node
|
|
40
|
+
};
|
|
41
|
+
var _default = exports.default = Row;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 _Row = _interopRequireDefault(require("./Row"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const Header = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
13
|
+
let {
|
|
14
|
+
children
|
|
15
|
+
} = _ref;
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Row.default, {
|
|
17
|
+
ref: ref,
|
|
18
|
+
children: _react.default.Children.map(children, child =>
|
|
19
|
+
/*#__PURE__*/
|
|
20
|
+
// TO DO: pass type as a variant instead of prop
|
|
21
|
+
_react.default.cloneElement(child, {
|
|
22
|
+
type: 'subHeading'
|
|
23
|
+
}))
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
Header.displayName = 'Header';
|
|
27
|
+
Header.propTypes = {
|
|
28
|
+
children: _propTypes.default.node
|
|
29
|
+
};
|
|
30
|
+
var _default = exports.default = Header;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useTableContext = 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 _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
11
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _utils = require("../utils");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const [selectProps, selectedSystemPropTypes] = (0, _componentsBase.selectSystemProps)([_utils.htmlAttrs]);
|
|
16
|
+
const StyledContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
17
|
+
displayName: "Table__StyledContainer",
|
|
18
|
+
componentId: "components-web__sc-10d9q3m-0"
|
|
19
|
+
})(["overflow:auto;padding-bottom:", ";"], props => props.isScrollable ? `${props.tablePaddingBottom}px` : 0);
|
|
20
|
+
const StyledTable = /*#__PURE__*/_styledComponents.default.table.withConfig({
|
|
21
|
+
displayName: "Table__StyledTable",
|
|
22
|
+
componentId: "components-web__sc-10d9q3m-1"
|
|
23
|
+
})(["margin:0;padding:0;width:", ";border:", ";"], _ref => {
|
|
24
|
+
let {
|
|
25
|
+
fullWidth,
|
|
26
|
+
tableWidth
|
|
27
|
+
} = _ref;
|
|
28
|
+
return fullWidth ? '100%' : `${tableWidth}px`;
|
|
29
|
+
}, props => `${props.borderWidth}px solid ${props.borderColor}`);
|
|
30
|
+
const TableContext = /*#__PURE__*/_react.default.createContext({});
|
|
31
|
+
const useTableContext = () => _react.default.useContext(TableContext);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Use `Table` to display tabular data.
|
|
35
|
+
*
|
|
36
|
+
* - Takes an optional `spacing` variant (compact)
|
|
37
|
+
* - Available in 2 text styles (medium, small)
|
|
38
|
+
* - When `Table` exceeds viewport, the first column becomes sticky, enabling horizontal scrolling
|
|
39
|
+
* - Right-align prices and numbers that display decimal points
|
|
40
|
+
*
|
|
41
|
+
* ### Building up a `Table`
|
|
42
|
+
* - Use `Table.Header` and `Table.Body` as direct children of `Table`
|
|
43
|
+
* - Use `Table.SubHeading` to render an intermediate data heading row
|
|
44
|
+
* - Use `Table.Row` and `Table.Cell` to build up the tabular data
|
|
45
|
+
* - Use `Cell`'s `type` prop to visually mark it as a row heading (`type="rowHeading"`)
|
|
46
|
+
*/
|
|
47
|
+
exports.useTableContext = useTableContext;
|
|
48
|
+
const Table = _ref2 => {
|
|
49
|
+
let {
|
|
50
|
+
children,
|
|
51
|
+
spacing = 'default',
|
|
52
|
+
fullWidth = true,
|
|
53
|
+
text = 'medium',
|
|
54
|
+
tokens,
|
|
55
|
+
variant,
|
|
56
|
+
...rest
|
|
57
|
+
} = _ref2;
|
|
58
|
+
const themeTokens = (0, _componentsBase.useThemeTokens)('Table', tokens, variant);
|
|
59
|
+
const {
|
|
60
|
+
tablePaddingBottom,
|
|
61
|
+
borderColor,
|
|
62
|
+
borderWidth
|
|
63
|
+
} = themeTokens;
|
|
64
|
+
const containerRef = _react.default.useRef();
|
|
65
|
+
const tableRef = _react.default.useRef();
|
|
66
|
+
const [containerWidth, setContainerWidth] = _react.default.useState(0);
|
|
67
|
+
const [tableWidth, setTableWidth] = _react.default.useState(0);
|
|
68
|
+
(0, _componentsBase.useSafeLayoutEffect)(() => {
|
|
69
|
+
const updateDimensions = () => {
|
|
70
|
+
const containerClientWidth = containerRef.current?.clientWidth;
|
|
71
|
+
const responsiveTableWidth = fullWidth ? containerClientWidth : tableRef.current?.clientWidth;
|
|
72
|
+
setContainerWidth(containerClientWidth);
|
|
73
|
+
setTableWidth(responsiveTableWidth);
|
|
74
|
+
};
|
|
75
|
+
const throttledUpdateDimensions = (0, _lodash.default)(updateDimensions, 100, {
|
|
76
|
+
leading: false
|
|
77
|
+
});
|
|
78
|
+
updateDimensions();
|
|
79
|
+
|
|
80
|
+
// a pretty naive way of repeating the measurement after the fonts are loaded
|
|
81
|
+
window.addEventListener('load', updateDimensions);
|
|
82
|
+
window.addEventListener('resize', throttledUpdateDimensions);
|
|
83
|
+
return () => {
|
|
84
|
+
window.removeEventListener('load', updateDimensions);
|
|
85
|
+
window.removeEventListener('resize', throttledUpdateDimensions);
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
const isScrollable = tableWidth > containerWidth;
|
|
89
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledContainer, {
|
|
90
|
+
ref: containerRef,
|
|
91
|
+
isScrollable: isScrollable,
|
|
92
|
+
tablePaddingBottom: tablePaddingBottom,
|
|
93
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TableContext.Provider, {
|
|
94
|
+
value: {
|
|
95
|
+
text,
|
|
96
|
+
isScrollable,
|
|
97
|
+
tokens,
|
|
98
|
+
spacing,
|
|
99
|
+
variant,
|
|
100
|
+
themeTokens
|
|
101
|
+
},
|
|
102
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledTable, {
|
|
103
|
+
borderColor: borderColor,
|
|
104
|
+
borderWidth: borderWidth,
|
|
105
|
+
tableWidth: tableWidth,
|
|
106
|
+
cellSpacing: 0,
|
|
107
|
+
ref: tableRef,
|
|
108
|
+
fullWidth: fullWidth,
|
|
109
|
+
...selectProps(rest),
|
|
110
|
+
children: children
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
Table.propTypes = {
|
|
116
|
+
...selectedSystemPropTypes,
|
|
117
|
+
tokens: (0, _componentsBase.getTokensPropType)('Table'),
|
|
118
|
+
children: _propTypes.default.node,
|
|
119
|
+
/**
|
|
120
|
+
* Sets text style
|
|
121
|
+
*/
|
|
122
|
+
text: _propTypes.default.oneOf(['medium', 'small'])
|
|
123
|
+
};
|
|
124
|
+
var _default = exports.default = Table;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _Table = _interopRequireDefault(require("./Table"));
|
|
8
|
+
var _Header = _interopRequireDefault(require("./Header"));
|
|
9
|
+
var _Body = _interopRequireDefault(require("./Body"));
|
|
10
|
+
var _Row = _interopRequireDefault(require("./Row"));
|
|
11
|
+
var _SubHeading = _interopRequireDefault(require("./SubHeading"));
|
|
12
|
+
var _Cell = _interopRequireDefault(require("./Cell"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
_Table.default.Header = _Header.default;
|
|
15
|
+
_Table.default.Body = _Body.default;
|
|
16
|
+
_Table.default.Row = _Row.default;
|
|
17
|
+
_Table.default.SubHeading = _SubHeading.default;
|
|
18
|
+
_Table.default.Cell = _Cell.default;
|
|
19
|
+
var _default = exports.default = _Table.default;
|
|
@@ -0,0 +1,160 @@
|
|
|
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
|
+
const ExpandCollapseControl = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
14
|
+
displayName: "ExpandCollapse__ExpandCollapseControl",
|
|
15
|
+
componentId: "components-web__sc-1l2mmq7-0"
|
|
16
|
+
})({
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
display: 'flex',
|
|
20
|
+
flex: 1,
|
|
21
|
+
justifyContent: 'flex-start'
|
|
22
|
+
});
|
|
23
|
+
const ExpandCollapseIconContainer = /*#__PURE__*/_styledComponents.default.div.withConfig({
|
|
24
|
+
displayName: "ExpandCollapse__ExpandCollapseIconContainer",
|
|
25
|
+
componentId: "components-web__sc-1l2mmq7-1"
|
|
26
|
+
})(_ref => {
|
|
27
|
+
let {
|
|
28
|
+
tokens
|
|
29
|
+
} = _ref;
|
|
30
|
+
return {
|
|
31
|
+
alignItems: tokens.expandIconContainerAlignItems,
|
|
32
|
+
justifyContent: tokens.expandIconContainerJustifyContent,
|
|
33
|
+
marginLeft: `${tokens.expandIconContainerMarginY}px`,
|
|
34
|
+
marginRight: `${tokens.expandIconContainerMarginY}px`,
|
|
35
|
+
width: tokens.expandIconContainerWidth
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
const ExpandCollapseTitle = /*#__PURE__*/_styledComponents.default.h4.withConfig({
|
|
39
|
+
displayName: "ExpandCollapse__ExpandCollapseTitle",
|
|
40
|
+
componentId: "components-web__sc-1l2mmq7-2"
|
|
41
|
+
})(_ref2 => {
|
|
42
|
+
let {
|
|
43
|
+
tokens
|
|
44
|
+
} = _ref2;
|
|
45
|
+
return {
|
|
46
|
+
color: tokens.expandTitleColor,
|
|
47
|
+
fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
|
|
48
|
+
fontSize: tokens.expandTitleFontSize,
|
|
49
|
+
lineHeight: tokens.expandTitleLineHeight,
|
|
50
|
+
margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
const getIconButtonTokens = _ref3 => {
|
|
54
|
+
let {
|
|
55
|
+
icon,
|
|
56
|
+
iconBackgroundColor,
|
|
57
|
+
iconBorderColor,
|
|
58
|
+
iconColor,
|
|
59
|
+
iconOuterBorderColor,
|
|
60
|
+
iconOuterBorderGap,
|
|
61
|
+
iconOuterBorderWidth
|
|
62
|
+
} = _ref3;
|
|
63
|
+
return {
|
|
64
|
+
icon,
|
|
65
|
+
backgroundColor: iconBackgroundColor,
|
|
66
|
+
borderColor: iconBorderColor,
|
|
67
|
+
iconColor,
|
|
68
|
+
outerBorderColor: iconOuterBorderColor,
|
|
69
|
+
outerBorderGap: iconOuterBorderGap,
|
|
70
|
+
outerBorderWidth: iconOuterBorderWidth
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const ExpandCollapse = /*#__PURE__*/_react.default.forwardRef((_ref4, ref) => {
|
|
74
|
+
let {
|
|
75
|
+
children,
|
|
76
|
+
collapseTitle,
|
|
77
|
+
expandTitle = collapseTitle,
|
|
78
|
+
expandLabel,
|
|
79
|
+
collapseLabel
|
|
80
|
+
} = _ref4;
|
|
81
|
+
const getTokens = (0, _componentsBase.useThemeTokensCallback)('TermsAndConditions', {}, {});
|
|
82
|
+
const {
|
|
83
|
+
expandBaseBorderWidth,
|
|
84
|
+
expandContentPaddingBottom,
|
|
85
|
+
expandContentPaddingLeft,
|
|
86
|
+
expandContentPaddingRight,
|
|
87
|
+
expandContentPaddingTop,
|
|
88
|
+
contentBorderColor,
|
|
89
|
+
contentMarginBottom,
|
|
90
|
+
headerBackgroundColor,
|
|
91
|
+
expandTitlePaddingLeft,
|
|
92
|
+
expandTitleBorder,
|
|
93
|
+
expandTitleBorderColor,
|
|
94
|
+
expandTitleUnderline
|
|
95
|
+
} = getTokens();
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
|
|
97
|
+
tokens: {
|
|
98
|
+
borderWidth: expandBaseBorderWidth
|
|
99
|
+
},
|
|
100
|
+
children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, {
|
|
101
|
+
...expandProps,
|
|
102
|
+
panelId: "ExpandCollapsePanel",
|
|
103
|
+
controlTokens: {
|
|
104
|
+
icon: null,
|
|
105
|
+
backgroundColor: 'transparent',
|
|
106
|
+
paddingLeft: expandTitlePaddingLeft,
|
|
107
|
+
borderColor: expandTitleBorderColor,
|
|
108
|
+
borderWidth: expandTitleBorder,
|
|
109
|
+
textLine: expandTitleUnderline
|
|
110
|
+
}
|
|
111
|
+
// TODO refactor
|
|
112
|
+
// eslint-disable-next-line react/no-unstable-nested-components
|
|
113
|
+
,
|
|
114
|
+
control: pressableState => {
|
|
115
|
+
const {
|
|
116
|
+
expanded
|
|
117
|
+
} = pressableState || {};
|
|
118
|
+
const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
|
|
119
|
+
const label = expanded ? collapseLabel : expandLabel;
|
|
120
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExpandCollapseControl, {
|
|
121
|
+
ref: ref,
|
|
122
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseIconContainer, {
|
|
123
|
+
tokens: getTokens(),
|
|
124
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.IconButton, {
|
|
125
|
+
variant: {
|
|
126
|
+
size: 'small'
|
|
127
|
+
},
|
|
128
|
+
tokens: iconTokens,
|
|
129
|
+
focusable: false,
|
|
130
|
+
accessibilityLabel: label,
|
|
131
|
+
accessibilityRole: "none"
|
|
132
|
+
})
|
|
133
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseTitle, {
|
|
134
|
+
tokens: getTokens(),
|
|
135
|
+
children: expanded ? expandTitle : collapseTitle
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
tokens: {
|
|
140
|
+
contentPaddingBottom: expandContentPaddingBottom,
|
|
141
|
+
contentPaddingLeft: expandContentPaddingLeft,
|
|
142
|
+
contentPaddingRight: expandContentPaddingRight,
|
|
143
|
+
contentPaddingTop: expandContentPaddingTop,
|
|
144
|
+
contentPanelBackgroundColor: headerBackgroundColor,
|
|
145
|
+
borderColor: contentBorderColor,
|
|
146
|
+
marginBottom: contentMarginBottom
|
|
147
|
+
},
|
|
148
|
+
children: children
|
|
149
|
+
})
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
ExpandCollapse.displayName = 'ExpandCollapse';
|
|
153
|
+
ExpandCollapse.propTypes = {
|
|
154
|
+
children: _propTypes.default.node.isRequired,
|
|
155
|
+
collapseTitle: _propTypes.default.string.isRequired,
|
|
156
|
+
expandTitle: _propTypes.default.string,
|
|
157
|
+
collapseLabel: _propTypes.default.string,
|
|
158
|
+
expandLabel: _propTypes.default.string
|
|
159
|
+
};
|
|
160
|
+
var _default = exports.default = ExpandCollapse;
|