@telus-uds/components-web 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +7 -1
- package/CHANGELOG.md +38 -2
- package/jest.config.cjs +1 -1
- package/lib/cjs/Badge/Badge.js +128 -0
- package/lib/cjs/Badge/index.js +9 -0
- package/lib/cjs/BlockQuote/BlockQuote.js +256 -0
- package/lib/cjs/BlockQuote/index.js +9 -0
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +264 -0
- package/lib/cjs/Breadcrumbs/Item/Item.js +180 -0
- package/lib/cjs/Breadcrumbs/index.js +13 -0
- package/lib/cjs/Callout/Callout.js +141 -0
- package/lib/cjs/Callout/index.js +9 -0
- package/lib/cjs/Card/Card.js +257 -0
- package/lib/cjs/Card/CardContent.js +97 -0
- package/lib/cjs/Card/CardFooter.js +85 -0
- package/lib/cjs/Card/index.js +9 -0
- package/lib/cjs/Countdown/Countdown.js +268 -0
- package/lib/cjs/Countdown/Segment.js +108 -0
- package/lib/cjs/Countdown/constants.js +10 -0
- package/lib/cjs/Countdown/dictionary.js +28 -0
- package/lib/cjs/Countdown/index.js +9 -0
- package/lib/cjs/Countdown/types.js +31 -0
- package/lib/cjs/Countdown/useCountdown.js +32 -0
- package/lib/cjs/DatePicker/CalendarContainer.js +214 -0
- package/lib/cjs/DatePicker/DatePicker.js +525 -0
- package/lib/cjs/DatePicker/dictionary.js +125 -0
- package/lib/cjs/DatePicker/index.js +9 -0
- package/lib/cjs/DatePicker/reactDatesCss.js +9 -0
- package/lib/cjs/Disclaimer/Disclaimer.js +61 -0
- package/lib/cjs/Disclaimer/index.js +13 -0
- package/lib/cjs/Footnote/Footnote.js +637 -0
- package/lib/cjs/Footnote/FootnoteLink.js +125 -0
- package/lib/cjs/Footnote/dictionary.js +18 -0
- package/lib/cjs/Footnote/index.js +11 -0
- package/lib/cjs/IconButton/IconButton.js +62 -0
- package/lib/cjs/IconButton/index.js +9 -0
- package/lib/cjs/Image/Image.js +90 -0
- package/lib/cjs/Image/index.js +20 -0
- package/lib/cjs/Image/server.js +11 -0
- package/lib/cjs/List/List.js +8 -0
- package/lib/cjs/List/ListItem.js +34 -0
- package/lib/cjs/List/index.js +11 -0
- package/lib/cjs/NavigationBar/NavigationBar.js +282 -0
- package/lib/cjs/NavigationBar/NavigationItem.js +94 -0
- package/lib/cjs/NavigationBar/NavigationSubMenu.js +164 -0
- package/lib/{NavigationBar → cjs/NavigationBar}/collapseItems.js +9 -4
- package/lib/cjs/NavigationBar/index.js +11 -0
- package/lib/cjs/NavigationBar/resolveItemSelection.js +22 -0
- package/lib/cjs/OptimizeImage/OptimizeImage.js +99 -0
- package/lib/cjs/OptimizeImage/index.js +9 -0
- package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +14 -0
- package/lib/cjs/OptimizeImage/utils/getImageUrls.js +19 -0
- package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +24 -0
- package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +34 -0
- package/lib/cjs/OptimizeImage/utils/index.js +34 -0
- package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +9 -0
- package/lib/cjs/OrderedList/Item.js +151 -0
- package/lib/cjs/OrderedList/ItemBase.js +34 -0
- package/lib/cjs/OrderedList/OrderedList.js +92 -0
- package/lib/cjs/OrderedList/OrderedListBase.js +52 -0
- package/lib/cjs/OrderedList/constants.js +8 -0
- package/lib/cjs/OrderedList/index.js +11 -0
- package/lib/cjs/Paragraph/Paragraph.js +97 -0
- package/lib/cjs/Paragraph/index.js +9 -0
- package/lib/cjs/PreviewCard/AuthorDate.js +63 -0
- package/lib/cjs/PreviewCard/PreviewCard.js +215 -0
- package/lib/cjs/PreviewCard/index.js +9 -0
- package/lib/cjs/PriceLockup/PriceLockup.js +356 -0
- package/lib/cjs/PriceLockup/index.js +9 -0
- package/lib/cjs/PriceLockup/tokens.js +66 -0
- package/lib/cjs/Progress/ProgressBar.js +99 -0
- package/lib/cjs/Progress/index.js +11 -0
- package/lib/cjs/QuantitySelector/QuantitySelector.js +267 -0
- package/lib/cjs/QuantitySelector/SideButton.js +77 -0
- package/lib/cjs/QuantitySelector/dictionary.js +32 -0
- package/lib/cjs/QuantitySelector/index.js +9 -0
- package/lib/cjs/QuantitySelector/styles.js +16 -0
- package/lib/cjs/ResponsiveImage/ResponsiveImage.js +107 -0
- package/lib/cjs/ResponsiveImage/index.js +9 -0
- package/lib/cjs/Ribbon/Ribbon.js +222 -0
- package/lib/cjs/Ribbon/index.js +9 -0
- package/lib/cjs/SkeletonProvider/SkeletonImage.js +45 -0
- package/lib/cjs/SkeletonProvider/SkeletonProvider.js +63 -0
- package/lib/cjs/SkeletonProvider/SkeletonTypography.js +44 -0
- package/lib/cjs/SkeletonProvider/index.js +9 -0
- package/lib/cjs/Span/Span.js +79 -0
- package/lib/cjs/Span/index.js +9 -0
- package/lib/cjs/Spinner/Spinner.js +221 -0
- package/lib/cjs/Spinner/SpinnerContent.js +100 -0
- package/lib/cjs/Spinner/constants.js +10 -0
- package/lib/cjs/Spinner/index.js +9 -0
- package/lib/cjs/StoryCard/StoryCard.js +219 -0
- package/lib/cjs/StoryCard/index.js +9 -0
- package/lib/cjs/Table/Body.js +24 -0
- package/lib/cjs/Table/Cell.js +187 -0
- package/lib/cjs/Table/Header.js +32 -0
- package/lib/cjs/Table/Row.js +41 -0
- package/lib/cjs/Table/SubHeading.js +30 -0
- package/lib/cjs/Table/Table.js +124 -0
- package/lib/cjs/Table/index.js +19 -0
- package/lib/cjs/TermsAndConditions/ExpandCollapse.js +160 -0
- package/lib/cjs/TermsAndConditions/TermsAndConditions.js +283 -0
- package/lib/cjs/TermsAndConditions/dictionary.js +22 -0
- package/lib/cjs/TermsAndConditions/index.js +13 -0
- package/lib/cjs/Testimonial/Testimonial.js +240 -0
- package/lib/cjs/Testimonial/index.js +9 -0
- package/lib/cjs/Toast/Toast.js +165 -0
- package/lib/cjs/Toast/index.js +9 -0
- package/lib/cjs/Video/ControlBar/ControlBar.js +294 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +76 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +169 -0
- package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +211 -0
- package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +197 -0
- package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +78 -0
- package/lib/cjs/Video/Video.js +964 -0
- package/lib/cjs/Video/index.js +9 -0
- package/lib/cjs/Video/videoText.js +61 -0
- package/lib/cjs/VideoPicker/VideoPicker.js +197 -0
- package/lib/cjs/VideoPicker/VideoPickerPlayer.js +54 -0
- package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +223 -0
- package/lib/cjs/VideoPicker/VideoSlider.js +88 -0
- package/lib/cjs/VideoPicker/index.js +9 -0
- package/lib/cjs/VideoPicker/videoPropType.js +17 -0
- package/lib/cjs/WaffleGrid/WaffleGrid.js +164 -0
- package/lib/cjs/WaffleGrid/index.js +9 -0
- package/lib/cjs/WebVideo/WebVideo.js +197 -0
- package/lib/cjs/WebVideo/index.js +9 -0
- package/lib/cjs/WebVideo/utils/index.js +57 -0
- package/lib/cjs/baseExports.js +438 -0
- package/lib/cjs/index.js +317 -0
- package/lib/cjs/server.js +13 -0
- package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +29 -0
- package/lib/cjs/shared/ConditionalWrapper/index.js +9 -0
- package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +108 -0
- package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +61 -0
- package/lib/cjs/shared/FullBleedContent/index.js +23 -0
- package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +61 -0
- package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +91 -0
- package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +229 -0
- package/lib/cjs/shared/VideoSplash/VideoSplash.js +72 -0
- package/lib/cjs/shared/VideoSplash/helpers.js +32 -0
- package/lib/cjs/utils/index.js +88 -0
- package/lib/cjs/utils/isElementFocusable.js +14 -0
- package/lib/cjs/utils/logger.js +24 -0
- package/lib/cjs/utils/media.js +45 -0
- package/lib/cjs/utils/renderStructuredContent.js +71 -0
- package/lib/cjs/utils/scrollToAnchor.js +25 -0
- package/lib/cjs/utils/ssr.js +50 -0
- package/lib/cjs/utils/theming/get-theme-from-server.js +24 -0
- package/lib/cjs/utils/theming/with-client-theme.js +31 -0
- package/lib/cjs/utils/theming/with-server-theme.js +33 -0
- package/lib/cjs/utils/transforms.js +11 -0
- package/lib/cjs/utils/useOverlaidPosition.js +222 -0
- package/lib/cjs/utils/useTypographyTheme.js +30 -0
- package/lib/{Badge → esm/Badge}/Badge.js +11 -19
- package/lib/{BlockQuote → esm/BlockQuote}/BlockQuote.js +17 -31
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Breadcrumbs.js +6 -5
- package/lib/{Breadcrumbs → esm/Breadcrumbs}/Item/Item.js +10 -6
- package/lib/{Callout → esm/Callout}/Callout.js +6 -5
- package/lib/{Card → esm/Card}/Card.js +10 -10
- package/lib/{Card → esm/Card}/CardContent.js +6 -5
- package/lib/{Card → esm/Card}/CardFooter.js +6 -5
- package/lib/{Countdown → esm/Countdown}/Countdown.js +53 -32
- package/lib/{Countdown → esm/Countdown}/Segment.js +6 -6
- package/lib/{DatePicker → esm/DatePicker}/CalendarContainer.js +5 -5
- package/lib/{DatePicker → esm/DatePicker}/DatePicker.js +24 -20
- package/lib/esm/DatePicker/reactDatesCss.js +3 -0
- package/lib/{Disclaimer → esm/Disclaimer}/Disclaimer.js +6 -5
- package/lib/{Footnote → esm/Footnote}/Footnote.js +43 -22
- package/lib/{Footnote → esm/Footnote}/FootnoteLink.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationBar.js +19 -20
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationItem.js +6 -5
- package/lib/{NavigationBar → esm/NavigationBar}/NavigationSubMenu.js +1 -2
- package/lib/esm/NavigationBar/collapseItems.js +37 -0
- package/lib/{NavigationBar → esm/NavigationBar}/resolveItemSelection.js +1 -1
- package/lib/{OrderedList → esm/OrderedList}/Item.js +10 -6
- package/lib/{OrderedList → esm/OrderedList}/ItemBase.js +5 -5
- package/lib/{OrderedList → esm/OrderedList}/OrderedList.js +8 -8
- package/lib/{OrderedList → esm/OrderedList}/OrderedListBase.js +5 -5
- package/lib/{Paragraph → esm/Paragraph}/Paragraph.js +8 -16
- package/lib/{PreviewCard → esm/PreviewCard}/PreviewCard.js +10 -7
- package/lib/{PriceLockup → esm/PriceLockup}/PriceLockup.js +59 -69
- package/lib/{Progress → esm/Progress}/ProgressBar.js +6 -6
- package/lib/esm/QuantitySelector/styles.js +9 -0
- package/lib/{Ribbon → esm/Ribbon}/Ribbon.js +31 -57
- package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonImage.js +3 -4
- package/lib/esm/SkeletonProvider/SkeletonTypography.js +37 -0
- package/lib/{Span → esm/Span}/Span.js +7 -6
- package/lib/{Spinner → esm/Spinner}/Spinner.js +18 -8
- package/lib/{Spinner → esm/Spinner}/SpinnerContent.js +6 -5
- package/lib/{StoryCard → esm/StoryCard}/StoryCard.js +10 -7
- package/lib/{Table → esm/Table}/Cell.js +16 -45
- package/lib/esm/Table/Row.js +34 -0
- package/lib/{Table → esm/Table}/Table.js +18 -20
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/ExpandCollapse.js +15 -8
- package/lib/{TermsAndConditions → esm/TermsAndConditions}/TermsAndConditions.js +22 -9
- package/lib/{Testimonial → esm/Testimonial}/Testimonial.js +26 -10
- package/lib/{Toast → esm/Toast}/Toast.js +15 -67
- package/lib/{Video → esm/Video}/ControlBar/ControlBar.js +18 -8
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoButton/VideoButton.js +7 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoMenu/VideoMenu.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +14 -7
- package/lib/{Video → esm/Video}/ControlBar/Controls/VolumeSlider/VolumeSlider.js +10 -6
- package/lib/{Video → esm/Video}/MiddleControlButton/MiddleControlButton.js +6 -5
- package/lib/{Video → esm/Video}/Video.js +28 -12
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPicker.js +21 -46
- package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerThumbnail.js +19 -54
- package/lib/{WaffleGrid → esm/WaffleGrid}/WaffleGrid.js +14 -7
- package/lib/{WebVideo → esm/WebVideo}/WebVideo.js +14 -9
- package/lib/{baseExports.js → esm/baseExports.js} +1 -1
- package/lib/{index.js → esm/index.js} +1 -2
- package/lib/{shared → esm/shared}/FullBleedContent/FullBleedContent.js +5 -5
- package/lib/{shared → esm/shared}/VideoSplash/SplashButton/SplashButton.js +9 -6
- package/lib/{shared → esm/shared}/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +17 -8
- package/lib/{shared → esm/shared}/VideoSplash/VideoSplash.js +6 -5
- package/lib/{utils → esm/utils}/index.js +1 -2
- package/lib/{utils → esm/utils}/scrollToAnchor.js +2 -2
- package/lib/{utils → esm/utils}/ssr.js +8 -4
- package/lib/{utils → esm/utils}/useOverlaidPosition.js +2 -4
- package/package.json +17 -16
- package/src/Badge/Badge.jsx +4 -3
- package/src/BlockQuote/BlockQuote.jsx +2 -3
- package/src/Breadcrumbs/Breadcrumbs.jsx +2 -3
- package/src/Breadcrumbs/Item/Item.jsx +2 -3
- package/src/Callout/Callout.jsx +2 -4
- package/src/Card/Card.jsx +1 -3
- package/src/Card/CardContent.jsx +2 -3
- package/src/Card/CardFooter.jsx +2 -3
- package/src/Countdown/Countdown.jsx +62 -36
- package/src/Countdown/Segment.jsx +1 -3
- package/src/DatePicker/CalendarContainer.jsx +1 -3
- package/src/DatePicker/DatePicker.jsx +2 -3
- package/src/DatePicker/reactDatesCss.js +1 -3
- package/src/Disclaimer/Disclaimer.jsx +2 -3
- package/src/Footnote/Footnote.jsx +2 -10
- package/src/Footnote/FootnoteLink.jsx +2 -3
- package/src/NavigationBar/NavigationBar.jsx +2 -3
- package/src/NavigationBar/NavigationItem.jsx +2 -3
- package/src/OrderedList/Item.jsx +2 -3
- package/src/OrderedList/ItemBase.jsx +1 -3
- package/src/OrderedList/OrderedList.jsx +2 -3
- package/src/OrderedList/OrderedListBase.jsx +1 -3
- package/src/Paragraph/Paragraph.jsx +2 -4
- package/src/PreviewCard/PreviewCard.jsx +1 -3
- package/src/PriceLockup/PriceLockup.jsx +2 -3
- package/src/Progress/ProgressBar.jsx +1 -3
- package/src/QuantitySelector/styles.js +1 -3
- package/src/Ribbon/Ribbon.jsx +2 -3
- package/src/Span/Span.jsx +2 -4
- package/src/Spinner/Spinner.jsx +2 -3
- package/src/Spinner/SpinnerContent.jsx +2 -3
- package/src/StoryCard/StoryCard.jsx +1 -3
- package/src/Table/Cell.jsx +4 -5
- package/src/Table/Row.jsx +13 -2
- package/src/Table/Table.jsx +14 -5
- package/src/TermsAndConditions/ExpandCollapse.jsx +6 -4
- package/src/TermsAndConditions/TermsAndConditions.jsx +2 -3
- package/src/Testimonial/Testimonial.jsx +2 -3
- package/src/Toast/Toast.jsx +2 -3
- package/src/Video/ControlBar/ControlBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +2 -4
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -4
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +2 -4
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +2 -4
- package/src/Video/Video.jsx +2 -4
- package/src/VideoPicker/VideoPicker.jsx +2 -4
- package/src/VideoPicker/VideoPickerThumbnail.jsx +1 -3
- package/src/WaffleGrid/WaffleGrid.jsx +2 -3
- package/src/WebVideo/WebVideo.jsx +3 -4
- package/src/baseExports.js +1 -0
- package/src/index.js +1 -2
- package/src/shared/FullBleedContent/FullBleedContent.jsx +1 -3
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +1 -3
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +1 -4
- package/src/shared/VideoSplash/VideoSplash.jsx +2 -3
- package/src/utils/index.js +1 -3
- package/src/utils/ssr.js +10 -3
- package/types/Callout.d.ts +2 -1
- package/types/Tooltip.d.ts +1 -0
- package/lib/DatePicker/reactDatesCss.js +0 -830
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -116
- package/lib/ExpandCollapseMini/index.js +0 -2
- package/lib/QuantitySelector/styles.js +0 -18
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib/Table/Row.js +0 -19
- package/lib/utils/theming/styled-components.js +0 -26
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +0 -72
- package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +0 -104
- package/src/ExpandCollapseMini/index.js +0 -3
- package/src/utils/theming/styled-components.js +0 -23
- /package/lib/{Badge → esm/Badge}/index.js +0 -0
- /package/lib/{BlockQuote → esm/BlockQuote}/index.js +0 -0
- /package/lib/{Breadcrumbs → esm/Breadcrumbs}/index.js +0 -0
- /package/lib/{Callout → esm/Callout}/index.js +0 -0
- /package/lib/{Card → esm/Card}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/constants.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/dictionary.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/index.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/types.js +0 -0
- /package/lib/{Countdown → esm/Countdown}/useCountdown.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/dictionary.js +0 -0
- /package/lib/{DatePicker → esm/DatePicker}/index.js +0 -0
- /package/lib/{Disclaimer → esm/Disclaimer}/index.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/dictionary.js +0 -0
- /package/lib/{Footnote → esm/Footnote}/index.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/IconButton.js +0 -0
- /package/lib/{IconButton → esm/IconButton}/index.js +0 -0
- /package/lib/{Image → esm/Image}/Image.js +0 -0
- /package/lib/{Image → esm/Image}/index.js +0 -0
- /package/lib/{Image → esm/Image}/server.js +0 -0
- /package/lib/{List → esm/List}/List.js +0 -0
- /package/lib/{List → esm/List}/ListItem.js +0 -0
- /package/lib/{List → esm/List}/index.js +0 -0
- /package/lib/{NavigationBar → esm/NavigationBar}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/OptimizeImage.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getFallbackUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getImageUrls.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/getOptimizedUrl.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/hasWebpSupport.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/index.js +0 -0
- /package/lib/{OptimizeImage → esm/OptimizeImage}/utils/isSvgUrl.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/constants.js +0 -0
- /package/lib/{OrderedList → esm/OrderedList}/index.js +0 -0
- /package/lib/{Paragraph → esm/Paragraph}/index.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/AuthorDate.js +0 -0
- /package/lib/{PreviewCard → esm/PreviewCard}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/index.js +0 -0
- /package/lib/{PriceLockup → esm/PriceLockup}/tokens.js +0 -0
- /package/lib/{Progress → esm/Progress}/index.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/QuantitySelector.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/SideButton.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/dictionary.js +0 -0
- /package/lib/{QuantitySelector → esm/QuantitySelector}/index.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/ResponsiveImage.js +0 -0
- /package/lib/{ResponsiveImage → esm/ResponsiveImage}/index.js +0 -0
- /package/lib/{Ribbon → esm/Ribbon}/index.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/SkeletonProvider.js +0 -0
- /package/lib/{SkeletonProvider → esm/SkeletonProvider}/index.js +0 -0
- /package/lib/{Span → esm/Span}/index.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/constants.js +0 -0
- /package/lib/{Spinner → esm/Spinner}/index.js +0 -0
- /package/lib/{StoryCard → esm/StoryCard}/index.js +0 -0
- /package/lib/{Table → esm/Table}/Body.js +0 -0
- /package/lib/{Table → esm/Table}/Header.js +0 -0
- /package/lib/{Table → esm/Table}/SubHeading.js +0 -0
- /package/lib/{Table → esm/Table}/index.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/dictionary.js +0 -0
- /package/lib/{TermsAndConditions → esm/TermsAndConditions}/index.js +0 -0
- /package/lib/{Testimonial → esm/Testimonial}/index.js +0 -0
- /package/lib/{Toast → esm/Toast}/index.js +0 -0
- /package/lib/{Video → esm/Video}/index.js +0 -0
- /package/lib/{Video → esm/Video}/videoText.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoPickerPlayer.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/VideoSlider.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/index.js +0 -0
- /package/lib/{VideoPicker → esm/VideoPicker}/videoPropType.js +0 -0
- /package/lib/{WaffleGrid → esm/WaffleGrid}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/index.js +0 -0
- /package/lib/{WebVideo → esm/WebVideo}/utils/index.js +0 -0
- /package/lib/{server.js → esm/server.js} +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/ConditionalWrapper.js +0 -0
- /package/lib/{shared → esm/shared}/ConditionalWrapper/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/getFullBleedBorderRadius.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/index.js +0 -0
- /package/lib/{shared → esm/shared}/FullBleedContent/useFullBleedContentProps.js +0 -0
- /package/lib/{shared → esm/shared}/VideoSplash/helpers.js +0 -0
- /package/lib/{utils → esm/utils}/isElementFocusable.js +0 -0
- /package/lib/{utils → esm/utils}/logger.js +0 -0
- /package/lib/{utils → esm/utils}/media.js +0 -0
- /package/lib/{utils → esm/utils}/renderStructuredContent.js +0 -0
- /package/lib/{utils → esm/utils}/theming/get-theme-from-server.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-client-theme.js +0 -0
- /package/lib/{utils → esm/utils}/theming/with-server-theme.js +0 -0
- /package/lib/{utils → esm/utils}/transforms.js +0 -0
- /package/lib/{utils → esm/utils}/useTypographyTheme.js +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { ExpandCollapse, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
-
import ExpandCollapseMiniControl from './ExpandCollapseMiniControl';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const ExpandCollapseMini = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
7
|
-
let {
|
|
8
|
-
children,
|
|
9
|
-
onToggle = () => {},
|
|
10
|
-
tokens = {},
|
|
11
|
-
nativeID,
|
|
12
|
-
initialOpen = false,
|
|
13
|
-
...rest
|
|
14
|
-
} = _ref;
|
|
15
|
-
const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel';
|
|
16
|
-
const handleChange = (openPanels, event) => {
|
|
17
|
-
if (typeof onToggle === 'function') {
|
|
18
|
-
const isOpen = openPanels.length > 0;
|
|
19
|
-
onToggle(event, isOpen);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
return /*#__PURE__*/_jsx(ExpandCollapse, {
|
|
23
|
-
onChange: handleChange,
|
|
24
|
-
tokens: tokens,
|
|
25
|
-
initialOpen: initialOpen ? [expandCollapeMiniPanelId] : [],
|
|
26
|
-
children: expandProps => /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
|
|
27
|
-
...expandProps,
|
|
28
|
-
panelId: expandCollapeMiniPanelId,
|
|
29
|
-
variant: {
|
|
30
|
-
mini: true
|
|
31
|
-
},
|
|
32
|
-
controlTokens: {
|
|
33
|
-
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
34
|
-
icon: null,
|
|
35
|
-
borderColor: 'transparent',
|
|
36
|
-
textLine: 'none',
|
|
37
|
-
backgroundColor: 'transparent'
|
|
38
|
-
}
|
|
39
|
-
// TODO refactor
|
|
40
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
41
|
-
,
|
|
42
|
-
control: pressableState => /*#__PURE__*/_jsx(ExpandCollapseMiniControl, {
|
|
43
|
-
pressableState: pressableState,
|
|
44
|
-
...rest
|
|
45
|
-
}),
|
|
46
|
-
controlRef: ref,
|
|
47
|
-
nativeID: nativeID,
|
|
48
|
-
children: children
|
|
49
|
-
})
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
ExpandCollapseMini.displayName = 'ExpandCollapseMini';
|
|
53
|
-
ExpandCollapseMini.propTypes = {
|
|
54
|
-
...ExpandCollapseMiniControl.propTypes,
|
|
55
|
-
/**
|
|
56
|
-
* Function to call on pressing the panel's control, which should open or close the panel.
|
|
57
|
-
*/
|
|
58
|
-
onToggle: PropTypes.func,
|
|
59
|
-
/**
|
|
60
|
-
* ID for DOM element on web
|
|
61
|
-
*/
|
|
62
|
-
nativeID: PropTypes.string,
|
|
63
|
-
/**
|
|
64
|
-
* Children nodes that can be added
|
|
65
|
-
*/
|
|
66
|
-
children: PropTypes.node.isRequired,
|
|
67
|
-
/**
|
|
68
|
-
* Controls if the panel and the content is opened by default on the first load
|
|
69
|
-
*/
|
|
70
|
-
initialOpen: PropTypes.bool,
|
|
71
|
-
tokens: getTokensPropType('ExpandCollapseMini')
|
|
72
|
-
};
|
|
73
|
-
export default ExpandCollapseMini;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { selectSystemProps, Link, useThemeTokens } from '@telus-uds/components-base';
|
|
4
|
-
import { htmlAttrs } from '../utils';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
7
|
-
|
|
8
|
-
// The ExpandCollapseControl has all the appropriate role, a11y, press handling etc
|
|
9
|
-
// and a more appropriate press area, defer interaction handling to it.
|
|
10
|
-
const presentationOnly = {
|
|
11
|
-
accessibilityRole: null,
|
|
12
|
-
// Treat as regular flow content with the Control
|
|
13
|
-
pointerEvents: 'none',
|
|
14
|
-
// Stop RNW from stopping clicks from bubbling to Control
|
|
15
|
-
focusable: false // Stop RNW from setting tabIndex={0}: focus goes to Control only
|
|
16
|
-
};
|
|
17
|
-
const selectLinkTokens = _ref => {
|
|
18
|
-
let {
|
|
19
|
-
color,
|
|
20
|
-
textLine,
|
|
21
|
-
lineHeight,
|
|
22
|
-
fontSize
|
|
23
|
-
} = _ref;
|
|
24
|
-
return {
|
|
25
|
-
color,
|
|
26
|
-
textLine,
|
|
27
|
-
blockLineHeight: lineHeight,
|
|
28
|
-
blockFontSize: fontSize
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
const ExpandCollapseMiniControl = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
32
|
-
let {
|
|
33
|
-
pressableState,
|
|
34
|
-
collapseTitle,
|
|
35
|
-
expandTitle = collapseTitle,
|
|
36
|
-
iconPosition = 'right',
|
|
37
|
-
tokens,
|
|
38
|
-
variant = {},
|
|
39
|
-
...rest
|
|
40
|
-
} = _ref2;
|
|
41
|
-
const {
|
|
42
|
-
expanded,
|
|
43
|
-
hover,
|
|
44
|
-
focus
|
|
45
|
-
} = pressableState || {};
|
|
46
|
-
// we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
47
|
-
const {
|
|
48
|
-
outerBorderColor
|
|
49
|
-
} = useThemeTokens('Link', {}, {}, {
|
|
50
|
-
focus
|
|
51
|
-
});
|
|
52
|
-
const {
|
|
53
|
-
size,
|
|
54
|
-
icon,
|
|
55
|
-
...themeTokens
|
|
56
|
-
} = useThemeTokens('ExpandCollapseMiniControl', tokens, variant, {
|
|
57
|
-
expanded,
|
|
58
|
-
focus
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// Choose hover styles when any part of Control is hoverred
|
|
62
|
-
const appearance = {
|
|
63
|
-
...variant,
|
|
64
|
-
hover
|
|
65
|
-
};
|
|
66
|
-
const getTokens = linkState => {
|
|
67
|
-
const {
|
|
68
|
-
hover: linkHover
|
|
69
|
-
} = linkState || {};
|
|
70
|
-
const isHovered = hover || linkHover;
|
|
71
|
-
if (isHovered) {
|
|
72
|
-
// Include vertical icon animation on hover alongside built-in Link theme, the size is size4
|
|
73
|
-
return {
|
|
74
|
-
iconTranslateY: (expanded ? -1 : 1) * size
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
return {};
|
|
78
|
-
};
|
|
79
|
-
return /*#__PURE__*/_jsx(Link, {
|
|
80
|
-
variant: appearance,
|
|
81
|
-
icon: icon,
|
|
82
|
-
iconPosition: iconPosition,
|
|
83
|
-
tokens: linkState => ({
|
|
84
|
-
...getTokens(linkState),
|
|
85
|
-
...selectLinkTokens(themeTokens),
|
|
86
|
-
outerBorderColor
|
|
87
|
-
}),
|
|
88
|
-
ref: ref,
|
|
89
|
-
...presentationOnly,
|
|
90
|
-
...selectProps(rest),
|
|
91
|
-
children: expanded ? expandTitle : collapseTitle
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
ExpandCollapseMiniControl.displayName = 'ExpandCollapseMiniControl';
|
|
95
|
-
ExpandCollapseMiniControl.propTypes = {
|
|
96
|
-
...selectedSystemPropTypes,
|
|
97
|
-
...Link.propTypes,
|
|
98
|
-
/**
|
|
99
|
-
* Optional function to call on pressing the panel's control, in addition to opening or closing the panel
|
|
100
|
-
*/
|
|
101
|
-
onPress: PropTypes.func,
|
|
102
|
-
/**
|
|
103
|
-
* ExpandCollapseMiniControl title when expanded
|
|
104
|
-
*/
|
|
105
|
-
expandTitle: PropTypes.string.isRequired,
|
|
106
|
-
/**
|
|
107
|
-
* ExpandCollapseMiniControl title when collapsed
|
|
108
|
-
*/
|
|
109
|
-
collapseTitle: PropTypes.string.isRequired,
|
|
110
|
-
/**
|
|
111
|
-
* React Native's `Pressable`'s state object
|
|
112
|
-
*/
|
|
113
|
-
pressableState: PropTypes.object,
|
|
114
|
-
variant: PropTypes.object
|
|
115
|
-
};
|
|
116
|
-
export default ExpandCollapseMiniControl;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { styledComponents } from '../utils';
|
|
2
|
-
const {
|
|
3
|
-
styled
|
|
4
|
-
} = styledComponents;
|
|
5
|
-
export const InputField = styled.div`
|
|
6
|
-
order: 1;
|
|
7
|
-
text-align: center;
|
|
8
|
-
z-index: 10;
|
|
9
|
-
input {
|
|
10
|
-
text-align: center;
|
|
11
|
-
}
|
|
12
|
-
`;
|
|
13
|
-
export const InputWrapper = styled.div`
|
|
14
|
-
text-align: start;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: row;
|
|
17
|
-
flex-wrap: nowrap;
|
|
18
|
-
`;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
var _Skeleton$propTypes, _Skeleton$propTypes2, _Skeleton$propTypes3, _Skeleton$propTypes4, _Skeleton$propTypes5;
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
import { Skeleton } from '@telus-uds/components-base';
|
|
5
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
const SkeletonTypography = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
7
|
-
let {
|
|
8
|
-
show,
|
|
9
|
-
size,
|
|
10
|
-
sizeIndex,
|
|
11
|
-
sizePixels,
|
|
12
|
-
characters,
|
|
13
|
-
lines,
|
|
14
|
-
children
|
|
15
|
-
} = _ref;
|
|
16
|
-
if (!show) {
|
|
17
|
-
return children;
|
|
18
|
-
}
|
|
19
|
-
return /*#__PURE__*/_jsx(Skeleton, {
|
|
20
|
-
size: size,
|
|
21
|
-
sizeIndex: sizeIndex,
|
|
22
|
-
sizePixels: sizePixels,
|
|
23
|
-
characters: characters,
|
|
24
|
-
lines: lines,
|
|
25
|
-
ref: ref
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
SkeletonTypography.displayName = 'SkeletonTypography';
|
|
29
|
-
SkeletonTypography.propTypes = {
|
|
30
|
-
show: PropTypes.bool.isRequired,
|
|
31
|
-
children: PropTypes.node,
|
|
32
|
-
size: (_Skeleton$propTypes = Skeleton.propTypes) === null || _Skeleton$propTypes === void 0 ? void 0 : _Skeleton$propTypes.size,
|
|
33
|
-
sizeIndex: (_Skeleton$propTypes2 = Skeleton.propTypes) === null || _Skeleton$propTypes2 === void 0 ? void 0 : _Skeleton$propTypes2.sizeIndex,
|
|
34
|
-
sizePixels: (_Skeleton$propTypes3 = Skeleton.propTypes) === null || _Skeleton$propTypes3 === void 0 ? void 0 : _Skeleton$propTypes3.sizePixels,
|
|
35
|
-
characters: (_Skeleton$propTypes4 = Skeleton.propTypes) === null || _Skeleton$propTypes4 === void 0 ? void 0 : _Skeleton$propTypes4.characters,
|
|
36
|
-
lines: (_Skeleton$propTypes5 = Skeleton.propTypes) === null || _Skeleton$propTypes5 === void 0 ? void 0 : _Skeleton$propTypes5.lines
|
|
37
|
-
};
|
|
38
|
-
export default SkeletonTypography;
|
package/lib/Table/Row.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const Row = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
5
|
-
let {
|
|
6
|
-
children
|
|
7
|
-
} = _ref;
|
|
8
|
-
return /*#__PURE__*/_jsx("tr", {
|
|
9
|
-
ref: ref,
|
|
10
|
-
children: React.Children.map(children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
|
|
11
|
-
isFirstInRow: index === 0
|
|
12
|
-
}))
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
Row.displayName = 'Row';
|
|
16
|
-
Row.propTypes = {
|
|
17
|
-
children: PropTypes.node
|
|
18
|
-
};
|
|
19
|
-
export default Row;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currently, `styled` is only available as the default export in `styled-components`.
|
|
3
|
-
* In transpiled/CommonJS environments, that works as expected, but it breaks server-side ESM usage of `styled-components`.
|
|
4
|
-
*
|
|
5
|
-
* To make `styled-components` work server-side, instead of:
|
|
6
|
-
*
|
|
7
|
-
* import styled from 'styled-components';
|
|
8
|
-
*
|
|
9
|
-
* We must write:
|
|
10
|
-
*
|
|
11
|
-
* import styledWrapper from 'styled-components';
|
|
12
|
-
* const styled = styledWrapper.default;
|
|
13
|
-
*
|
|
14
|
-
* This approach is confusing and not a viable option for code that should run in both browser and server.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import _styled, { css, keyframes, createGlobalStyle, ServerStyleSheet } from 'styled-components';
|
|
18
|
-
const styled = typeof _styled === 'function' ? _styled : _styled.default;
|
|
19
|
-
const styledComponents = {
|
|
20
|
-
styled,
|
|
21
|
-
css,
|
|
22
|
-
keyframes,
|
|
23
|
-
createGlobalStyle,
|
|
24
|
-
ServerStyleSheet
|
|
25
|
-
};
|
|
26
|
-
export default styledComponents;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { ExpandCollapse, getTokensPropType } from '@telus-uds/components-base'
|
|
4
|
-
import ExpandCollapseMiniControl from './ExpandCollapseMiniControl'
|
|
5
|
-
|
|
6
|
-
const ExpandCollapseMini = React.forwardRef(
|
|
7
|
-
({ children, onToggle = () => {}, tokens = {}, nativeID, initialOpen = false, ...rest }, ref) => {
|
|
8
|
-
const expandCollapeMiniPanelId = 'ExpandCollapseMiniPanel'
|
|
9
|
-
const handleChange = (openPanels, event) => {
|
|
10
|
-
if (typeof onToggle === 'function') {
|
|
11
|
-
const isOpen = openPanels.length > 0
|
|
12
|
-
onToggle(event, isOpen)
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<ExpandCollapse
|
|
18
|
-
onChange={handleChange}
|
|
19
|
-
tokens={tokens}
|
|
20
|
-
initialOpen={initialOpen ? [expandCollapeMiniPanelId] : []}
|
|
21
|
-
>
|
|
22
|
-
{(expandProps) => (
|
|
23
|
-
<ExpandCollapse.Panel
|
|
24
|
-
{...expandProps}
|
|
25
|
-
panelId={expandCollapeMiniPanelId}
|
|
26
|
-
variant={{ mini: true }}
|
|
27
|
-
controlTokens={{
|
|
28
|
-
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
29
|
-
icon: null,
|
|
30
|
-
borderColor: 'transparent',
|
|
31
|
-
textLine: 'none',
|
|
32
|
-
backgroundColor: 'transparent'
|
|
33
|
-
}}
|
|
34
|
-
// TODO refactor
|
|
35
|
-
// eslint-disable-next-line react/no-unstable-nested-components
|
|
36
|
-
control={(pressableState) => (
|
|
37
|
-
<ExpandCollapseMiniControl pressableState={pressableState} {...rest} />
|
|
38
|
-
)}
|
|
39
|
-
controlRef={ref}
|
|
40
|
-
nativeID={nativeID}
|
|
41
|
-
>
|
|
42
|
-
{children}
|
|
43
|
-
</ExpandCollapse.Panel>
|
|
44
|
-
)}
|
|
45
|
-
</ExpandCollapse>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
ExpandCollapseMini.displayName = 'ExpandCollapseMini'
|
|
50
|
-
|
|
51
|
-
ExpandCollapseMini.propTypes = {
|
|
52
|
-
...ExpandCollapseMiniControl.propTypes,
|
|
53
|
-
/**
|
|
54
|
-
* Function to call on pressing the panel's control, which should open or close the panel.
|
|
55
|
-
*/
|
|
56
|
-
onToggle: PropTypes.func,
|
|
57
|
-
/**
|
|
58
|
-
* ID for DOM element on web
|
|
59
|
-
*/
|
|
60
|
-
nativeID: PropTypes.string,
|
|
61
|
-
/**
|
|
62
|
-
* Children nodes that can be added
|
|
63
|
-
*/
|
|
64
|
-
children: PropTypes.node.isRequired,
|
|
65
|
-
/**
|
|
66
|
-
* Controls if the panel and the content is opened by default on the first load
|
|
67
|
-
*/
|
|
68
|
-
initialOpen: PropTypes.bool,
|
|
69
|
-
tokens: getTokensPropType('ExpandCollapseMini')
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export default ExpandCollapseMini
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import PropTypes from 'prop-types'
|
|
3
|
-
import { selectSystemProps, Link, useThemeTokens } from '@telus-uds/components-base'
|
|
4
|
-
import { htmlAttrs } from '../utils'
|
|
5
|
-
|
|
6
|
-
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
7
|
-
|
|
8
|
-
// The ExpandCollapseControl has all the appropriate role, a11y, press handling etc
|
|
9
|
-
// and a more appropriate press area, defer interaction handling to it.
|
|
10
|
-
const presentationOnly = {
|
|
11
|
-
accessibilityRole: null, // Treat as regular flow content with the Control
|
|
12
|
-
pointerEvents: 'none', // Stop RNW from stopping clicks from bubbling to Control
|
|
13
|
-
focusable: false // Stop RNW from setting tabIndex={0}: focus goes to Control only
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const selectLinkTokens = ({ color, textLine, lineHeight, fontSize }) => ({
|
|
17
|
-
color,
|
|
18
|
-
textLine,
|
|
19
|
-
blockLineHeight: lineHeight,
|
|
20
|
-
blockFontSize: fontSize
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
const ExpandCollapseMiniControl = React.forwardRef(
|
|
24
|
-
(
|
|
25
|
-
{
|
|
26
|
-
pressableState,
|
|
27
|
-
collapseTitle,
|
|
28
|
-
expandTitle = collapseTitle,
|
|
29
|
-
iconPosition = 'right',
|
|
30
|
-
tokens,
|
|
31
|
-
variant = {},
|
|
32
|
-
...rest
|
|
33
|
-
},
|
|
34
|
-
ref
|
|
35
|
-
) => {
|
|
36
|
-
const { expanded, hover, focus } = pressableState || {}
|
|
37
|
-
// we only want focus outline when focusing, if user is pressing we don't want the border.
|
|
38
|
-
const { outerBorderColor } = useThemeTokens('Link', {}, {}, { focus })
|
|
39
|
-
const { size, icon, ...themeTokens } = useThemeTokens(
|
|
40
|
-
'ExpandCollapseMiniControl',
|
|
41
|
-
tokens,
|
|
42
|
-
variant,
|
|
43
|
-
{ expanded, focus }
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
// Choose hover styles when any part of Control is hoverred
|
|
47
|
-
const appearance = { ...variant, hover }
|
|
48
|
-
|
|
49
|
-
const getTokens = (linkState) => {
|
|
50
|
-
const { hover: linkHover } = linkState || {}
|
|
51
|
-
const isHovered = hover || linkHover
|
|
52
|
-
if (isHovered) {
|
|
53
|
-
// Include vertical icon animation on hover alongside built-in Link theme, the size is size4
|
|
54
|
-
return { iconTranslateY: (expanded ? -1 : 1) * size }
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return {}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<Link
|
|
62
|
-
variant={appearance}
|
|
63
|
-
icon={icon}
|
|
64
|
-
iconPosition={iconPosition}
|
|
65
|
-
tokens={(linkState) => ({
|
|
66
|
-
...getTokens(linkState),
|
|
67
|
-
...selectLinkTokens(themeTokens),
|
|
68
|
-
outerBorderColor
|
|
69
|
-
})}
|
|
70
|
-
ref={ref}
|
|
71
|
-
{...presentationOnly}
|
|
72
|
-
{...selectProps(rest)}
|
|
73
|
-
>
|
|
74
|
-
{expanded ? expandTitle : collapseTitle}
|
|
75
|
-
</Link>
|
|
76
|
-
)
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
ExpandCollapseMiniControl.displayName = 'ExpandCollapseMiniControl'
|
|
81
|
-
|
|
82
|
-
ExpandCollapseMiniControl.propTypes = {
|
|
83
|
-
...selectedSystemPropTypes,
|
|
84
|
-
...Link.propTypes,
|
|
85
|
-
/**
|
|
86
|
-
* Optional function to call on pressing the panel's control, in addition to opening or closing the panel
|
|
87
|
-
*/
|
|
88
|
-
onPress: PropTypes.func,
|
|
89
|
-
/**
|
|
90
|
-
* ExpandCollapseMiniControl title when expanded
|
|
91
|
-
*/
|
|
92
|
-
expandTitle: PropTypes.string.isRequired,
|
|
93
|
-
/**
|
|
94
|
-
* ExpandCollapseMiniControl title when collapsed
|
|
95
|
-
*/
|
|
96
|
-
collapseTitle: PropTypes.string.isRequired,
|
|
97
|
-
/**
|
|
98
|
-
* React Native's `Pressable`'s state object
|
|
99
|
-
*/
|
|
100
|
-
pressableState: PropTypes.object,
|
|
101
|
-
variant: PropTypes.object
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export default ExpandCollapseMiniControl
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Currently, `styled` is only available as the default export in `styled-components`.
|
|
3
|
-
* In transpiled/CommonJS environments, that works as expected, but it breaks server-side ESM usage of `styled-components`.
|
|
4
|
-
*
|
|
5
|
-
* To make `styled-components` work server-side, instead of:
|
|
6
|
-
*
|
|
7
|
-
* import styled from 'styled-components';
|
|
8
|
-
*
|
|
9
|
-
* We must write:
|
|
10
|
-
*
|
|
11
|
-
* import styledWrapper from 'styled-components';
|
|
12
|
-
* const styled = styledWrapper.default;
|
|
13
|
-
*
|
|
14
|
-
* This approach is confusing and not a viable option for code that should run in both browser and server.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import _styled, { css, keyframes, createGlobalStyle, ServerStyleSheet } from 'styled-components'
|
|
18
|
-
|
|
19
|
-
const styled = typeof _styled === 'function' ? _styled : _styled.default
|
|
20
|
-
|
|
21
|
-
const styledComponents = { styled, css, keyframes, createGlobalStyle, ServerStyleSheet }
|
|
22
|
-
|
|
23
|
-
export default styledComponents
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|