@telus-uds/components-web 4.19.1 → 5.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +12 -0
- package/CHANGELOG.md +16 -1
- package/lib/cjs/Badge/Badge.js +26 -27
- package/lib/cjs/BlockQuote/BlockQuote.js +24 -25
- package/lib/cjs/Breadcrumbs/{Item/Item.js → BreadcrumbItem.js} +36 -37
- package/lib/cjs/Breadcrumbs/Breadcrumbs.js +8 -10
- package/lib/cjs/Callout/Callout.js +24 -25
- package/lib/cjs/Card/Card.js +79 -89
- package/lib/cjs/Card/CardContent.js +53 -29
- package/lib/cjs/Card/CardFooter.js +28 -18
- package/lib/cjs/Countdown/Countdown.js +7 -8
- package/lib/cjs/Countdown/Segment.js +10 -11
- package/lib/cjs/Countdown/dictionary.js +2 -2
- package/lib/cjs/Countdown/types.js +2 -6
- package/lib/cjs/Countdown/useCountdown.js +2 -2
- package/lib/cjs/DatePicker/CalendarContainer.js +66 -67
- package/lib/cjs/DatePicker/DatePicker.js +27 -28
- package/lib/cjs/DatePicker/dictionary.js +3 -4
- package/lib/cjs/DatePicker/reactDatesCss.js +2 -3
- package/lib/cjs/Disclaimer/Disclaimer.js +28 -13
- package/lib/cjs/Footnote/Footnote.js +108 -109
- package/lib/cjs/Footnote/FootnoteLink.js +28 -19
- package/lib/cjs/Footnote/dictionary.js +2 -2
- package/lib/cjs/IconButton/IconButton.js +3 -4
- package/lib/cjs/Image/Image.js +9 -3
- package/lib/cjs/Image/server.js +4 -6
- package/lib/cjs/List/List.js +7 -3
- package/lib/cjs/List/ListItem.js +3 -4
- package/lib/cjs/NavigationBar/NavigationBar.js +8 -9
- package/lib/cjs/NavigationBar/NavigationItem.js +10 -11
- package/lib/cjs/NavigationBar/NavigationSubMenu.js +10 -11
- package/lib/cjs/NavigationBar/collapseItems.js +2 -2
- package/lib/cjs/NavigationBar/resolveItemSelection.js +2 -2
- package/lib/cjs/OptimizeImage/OptimizeImage.js +6 -8
- package/lib/cjs/OptimizeImage/utils/getFallbackUrl.js +3 -4
- package/lib/cjs/OptimizeImage/utils/getImageUrls.js +9 -10
- package/lib/cjs/OptimizeImage/utils/getOptimizedUrl.js +3 -4
- package/lib/cjs/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/lib/cjs/OptimizeImage/utils/index.js +8 -9
- package/lib/cjs/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/lib/cjs/OrderedList/OrderedList.js +6 -9
- package/lib/cjs/OrderedList/OrderedListBase.js +4 -7
- package/lib/cjs/OrderedList/{Item.js → OrderedListItem.js} +46 -39
- package/lib/cjs/OrderedList/{ItemBase.js → OrderedListItemBase.js} +7 -7
- package/lib/cjs/OrderedList/constants.js +0 -1
- package/lib/cjs/Paragraph/Paragraph.js +10 -11
- package/lib/cjs/PreviewCard/PreviewCard.js +18 -27
- package/lib/cjs/PreviewCard/{AuthorDate.js → PreviewCardAuthorDate.js} +6 -6
- package/lib/cjs/PriceLockup/PriceLockup.js +61 -60
- package/lib/cjs/PriceLockup/dictionary.js +2 -2
- package/lib/cjs/PriceLockup/tokens.js +3 -3
- package/lib/cjs/Progress/ProgressBar.js +14 -17
- package/lib/cjs/QuantitySelector/QuantitySelector.js +8 -9
- package/lib/cjs/QuantitySelector/{SideButton.js → QuantitySelectorSideButton.js} +5 -6
- package/lib/cjs/QuantitySelector/dictionary.js +2 -2
- package/lib/cjs/ResponsiveImage/ResponsiveImage.js +3 -4
- package/lib/cjs/Ribbon/Ribbon.js +56 -65
- package/lib/cjs/SkeletonProvider/SkeletonImage.js +3 -4
- package/lib/cjs/SkeletonProvider/SkeletonProvider.js +10 -10
- package/lib/cjs/SkeletonProvider/SkeletonTypography.js +3 -4
- package/lib/cjs/Span/Span.js +6 -7
- package/lib/cjs/Spinner/Spinner.js +29 -29
- package/lib/cjs/Spinner/SpinnerContent.js +6 -7
- package/lib/cjs/StoryCard/StoryCard.js +17 -22
- package/lib/cjs/Table/Table.js +32 -25
- package/lib/cjs/Table/{Body.js → TableBody.js} +5 -6
- package/lib/cjs/Table/{Cell.js → TableCell.js} +59 -61
- package/lib/cjs/Table/{Header.js → TableHeader.js} +7 -8
- package/lib/cjs/Table/{Row.js → TableRow.js} +18 -19
- package/lib/cjs/Table/{SubHeading.js → TableSubHeading.js} +7 -8
- package/lib/cjs/TermsAndConditions/ExpandCollapse.js +18 -19
- package/lib/cjs/TermsAndConditions/TermsAndConditions.js +44 -44
- package/lib/cjs/TermsAndConditions/dictionary.js +2 -2
- package/lib/cjs/Testimonial/Testimonial.js +24 -31
- package/lib/cjs/Toast/Toast.js +28 -30
- package/lib/cjs/Video/ControlBar/ControlBar.js +48 -47
- package/lib/cjs/Video/ControlBar/Controls/VideoButton/VideoButton.js +6 -6
- package/lib/cjs/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +30 -32
- package/lib/cjs/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +35 -35
- package/lib/cjs/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +42 -42
- package/lib/cjs/Video/MiddleControlButton/MiddleControlButton.js +15 -15
- package/lib/cjs/Video/Video.js +27 -29
- package/lib/cjs/Video/videoText.js +3 -4
- package/lib/cjs/VideoPicker/VideoPicker.js +37 -33
- package/lib/cjs/VideoPicker/VideoPickerPlayer.js +5 -6
- package/lib/cjs/VideoPicker/VideoPickerThumbnail.js +28 -25
- package/lib/cjs/VideoPicker/VideoSlider.js +3 -4
- package/lib/cjs/WaffleGrid/WaffleGrid.js +51 -50
- package/lib/cjs/WebVideo/WebVideo.js +7 -8
- package/lib/cjs/baseExports.js +84 -0
- package/lib/cjs/index.js +179 -105
- package/lib/cjs/server.js +2 -3
- package/lib/cjs/shared/ConditionalWrapper/ConditionalWrapper.js +3 -3
- package/lib/cjs/shared/FullBleedContent/FullBleedContent.js +28 -22
- package/lib/cjs/shared/FullBleedContent/getFullBleedBorderRadius.js +2 -2
- package/lib/cjs/shared/FullBleedContent/index.js +11 -10
- package/lib/cjs/shared/FullBleedContent/useFullBleedContentProps.js +2 -2
- package/lib/cjs/shared/VideoSplash/SplashButton/SplashButton.js +9 -9
- package/lib/cjs/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +50 -50
- package/lib/cjs/shared/VideoSplash/VideoSplash.js +12 -12
- package/lib/cjs/shared/VideoSplash/helpers.js +2 -3
- package/lib/cjs/utils/index.js +14 -15
- package/lib/cjs/utils/isElementFocusable.js +2 -2
- package/lib/cjs/utils/logger.js +2 -6
- package/lib/cjs/utils/media.js +1 -1
- package/lib/cjs/utils/renderStructuredContent.js +3 -4
- package/lib/cjs/utils/scrollToAnchor.js +2 -2
- package/lib/cjs/utils/ssr.js +2 -2
- package/lib/cjs/utils/theming/get-theme-from-server.js +2 -3
- package/lib/cjs/utils/theming/with-client-theme.js +2 -2
- package/lib/cjs/utils/theming/with-server-theme.js +4 -4
- package/lib/cjs/utils/transforms.js +2 -5
- package/lib/cjs/utils/useOverlaidPosition.js +2 -2
- package/lib/cjs/utils/useTypographyTheme.js +2 -2
- package/lib/esm/Badge/Badge.js +25 -26
- package/lib/esm/BlockQuote/BlockQuote.js +23 -24
- package/lib/esm/Breadcrumbs/{Item/Item.js → BreadcrumbItem.js} +35 -36
- package/lib/esm/Breadcrumbs/Breadcrumbs.js +6 -7
- package/lib/esm/Callout/Callout.js +23 -24
- package/lib/esm/Card/Card.js +63 -71
- package/lib/esm/Card/CardContent.js +52 -28
- package/lib/esm/Card/CardFooter.js +27 -18
- package/lib/esm/Countdown/Countdown.js +4 -5
- package/lib/esm/Countdown/Segment.js +8 -9
- package/lib/esm/Countdown/dictionary.js +1 -1
- package/lib/esm/Countdown/types.js +1 -5
- package/lib/esm/Countdown/useCountdown.js +2 -3
- package/lib/esm/DatePicker/CalendarContainer.js +64 -65
- package/lib/esm/DatePicker/DatePicker.js +18 -19
- package/lib/esm/DatePicker/dictionary.js +2 -3
- package/lib/esm/DatePicker/reactDatesCss.js +1 -2
- package/lib/esm/Disclaimer/Disclaimer.js +27 -12
- package/lib/esm/Footnote/Footnote.js +104 -104
- package/lib/esm/Footnote/FootnoteLink.js +26 -17
- package/lib/esm/Footnote/dictionary.js +1 -1
- package/lib/esm/IconButton/IconButton.js +2 -3
- package/lib/esm/Image/Image.js +10 -1
- package/lib/esm/Image/server.js +4 -4
- package/lib/esm/List/List.js +2 -2
- package/lib/esm/List/ListItem.js +2 -3
- package/lib/esm/NavigationBar/NavigationBar.js +5 -6
- package/lib/esm/NavigationBar/NavigationItem.js +9 -10
- package/lib/esm/NavigationBar/NavigationSubMenu.js +7 -8
- package/lib/esm/NavigationBar/collapseItems.js +2 -3
- package/lib/esm/NavigationBar/resolveItemSelection.js +2 -3
- package/lib/esm/OptimizeImage/OptimizeImage.js +4 -6
- package/lib/esm/OptimizeImage/utils/getFallbackUrl.js +2 -2
- package/lib/esm/OptimizeImage/utils/getImageUrls.js +3 -3
- package/lib/esm/OptimizeImage/utils/getOptimizedUrl.js +2 -2
- package/lib/esm/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/lib/esm/OptimizeImage/utils/index.js +4 -4
- package/lib/esm/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/lib/esm/OrderedList/OrderedList.js +4 -7
- package/lib/esm/OrderedList/OrderedListBase.js +3 -6
- package/lib/esm/OrderedList/{Item.js → OrderedListItem.js} +45 -38
- package/lib/esm/OrderedList/{ItemBase.js → OrderedListItemBase.js} +5 -6
- package/lib/esm/OrderedList/constants.js +0 -1
- package/lib/esm/Paragraph/Paragraph.js +9 -10
- package/lib/esm/PreviewCard/PreviewCard.js +16 -21
- package/lib/esm/PreviewCard/{AuthorDate.js → PreviewCardAuthorDate.js} +4 -5
- package/lib/esm/PriceLockup/PriceLockup.js +57 -56
- package/lib/esm/PriceLockup/dictionary.js +1 -1
- package/lib/esm/PriceLockup/tokens.js +1 -1
- package/lib/esm/Progress/ProgressBar.js +13 -16
- package/lib/esm/QuantitySelector/QuantitySelector.js +6 -7
- package/lib/esm/QuantitySelector/{SideButton.js → QuantitySelectorSideButton.js} +4 -5
- package/lib/esm/QuantitySelector/dictionary.js +1 -1
- package/lib/esm/ResponsiveImage/ResponsiveImage.js +2 -3
- package/lib/esm/Ribbon/Ribbon.js +55 -64
- package/lib/esm/SkeletonProvider/SkeletonImage.js +2 -3
- package/lib/esm/SkeletonProvider/SkeletonProvider.js +6 -7
- package/lib/esm/SkeletonProvider/SkeletonTypography.js +2 -3
- package/lib/esm/Span/Span.js +5 -6
- package/lib/esm/Spinner/Spinner.js +24 -24
- package/lib/esm/Spinner/SpinnerContent.js +5 -6
- package/lib/esm/StoryCard/StoryCard.js +15 -16
- package/lib/esm/Table/Table.js +31 -24
- package/lib/esm/Table/{Body.js → TableBody.js} +4 -5
- package/lib/esm/Table/{Cell.js → TableCell.js} +57 -58
- package/lib/esm/Table/{Header.js → TableHeader.js} +6 -7
- package/lib/esm/Table/{Row.js → TableRow.js} +17 -18
- package/lib/esm/Table/{SubHeading.js → TableSubHeading.js} +6 -7
- package/lib/esm/TermsAndConditions/ExpandCollapse.js +18 -19
- package/lib/esm/TermsAndConditions/TermsAndConditions.js +40 -40
- package/lib/esm/TermsAndConditions/dictionary.js +1 -1
- package/lib/esm/Testimonial/Testimonial.js +22 -29
- package/lib/esm/Toast/Toast.js +26 -27
- package/lib/esm/Video/ControlBar/ControlBar.js +33 -33
- package/lib/esm/Video/ControlBar/Controls/VideoButton/VideoButton.js +5 -6
- package/lib/esm/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +28 -31
- package/lib/esm/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +33 -34
- package/lib/esm/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +38 -39
- package/lib/esm/Video/MiddleControlButton/MiddleControlButton.js +14 -15
- package/lib/esm/Video/Video.js +19 -21
- package/lib/esm/Video/videoText.js +2 -3
- package/lib/esm/VideoPicker/VideoPicker.js +32 -27
- package/lib/esm/VideoPicker/VideoPickerPlayer.js +3 -4
- package/lib/esm/VideoPicker/VideoPickerThumbnail.js +26 -23
- package/lib/esm/VideoPicker/VideoSlider.js +2 -3
- package/lib/esm/WaffleGrid/WaffleGrid.js +49 -46
- package/lib/esm/WebVideo/WebVideo.js +5 -6
- package/lib/esm/baseExports.js +1 -1
- package/lib/esm/index.js +46 -37
- package/lib/esm/server.js +1 -2
- package/lib/esm/shared/ConditionalWrapper/ConditionalWrapper.js +2 -3
- package/lib/esm/shared/FullBleedContent/FullBleedContent.js +25 -20
- package/lib/esm/shared/FullBleedContent/getFullBleedBorderRadius.js +2 -3
- package/lib/esm/shared/FullBleedContent/index.js +3 -4
- package/lib/esm/shared/FullBleedContent/useFullBleedContentProps.js +3 -5
- package/lib/esm/shared/VideoSplash/SplashButton/SplashButton.js +8 -9
- package/lib/esm/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +48 -49
- package/lib/esm/shared/VideoSplash/VideoSplash.js +8 -9
- package/lib/esm/shared/VideoSplash/helpers.js +1 -1
- package/lib/esm/utils/index.js +7 -7
- package/lib/esm/utils/isElementFocusable.js +2 -3
- package/lib/esm/utils/logger.js +0 -4
- package/lib/esm/utils/media.js +1 -1
- package/lib/esm/utils/renderStructuredContent.js +2 -3
- package/lib/esm/utils/scrollToAnchor.js +2 -3
- package/lib/esm/utils/ssr.js +2 -3
- package/lib/esm/utils/theming/get-theme-from-server.js +1 -1
- package/lib/esm/utils/theming/with-client-theme.js +2 -3
- package/lib/esm/utils/theming/with-server-theme.js +3 -4
- package/lib/esm/utils/transforms.js +1 -4
- package/lib/esm/utils/useOverlaidPosition.js +2 -3
- package/lib/esm/utils/useTypographyTheme.js +2 -3
- package/package.json +13 -22
- package/src/Badge/Badge.jsx +18 -20
- package/src/BlockQuote/BlockQuote.jsx +16 -18
- package/src/Breadcrumbs/{Item/Item.jsx → BreadcrumbItem.jsx} +20 -21
- package/src/Breadcrumbs/Breadcrumbs.jsx +6 -9
- package/src/Callout/Callout.jsx +16 -18
- package/src/Card/Card.jsx +59 -80
- package/src/Card/CardContent.jsx +52 -28
- package/src/Card/CardFooter.jsx +26 -12
- package/src/Countdown/Countdown.jsx +3 -5
- package/src/Countdown/Segment.jsx +6 -8
- package/src/Countdown/dictionary.js +1 -1
- package/src/Countdown/types.js +0 -2
- package/src/Countdown/useCountdown.js +1 -3
- package/src/DatePicker/CalendarContainer.jsx +65 -67
- package/src/DatePicker/DatePicker.jsx +17 -19
- package/src/DatePicker/dictionary.js +1 -3
- package/src/DatePicker/reactDatesCss.js +1 -3
- package/src/Disclaimer/Disclaimer.jsx +15 -8
- package/src/Footnote/Footnote.jsx +104 -93
- package/src/Footnote/FootnoteLink.jsx +16 -13
- package/src/Footnote/dictionary.js +1 -1
- package/src/IconButton/IconButton.jsx +1 -3
- package/src/Image/Image.jsx +9 -1
- package/src/Image/server.js +4 -4
- package/src/List/List.jsx +2 -2
- package/src/List/ListItem.jsx +1 -3
- package/src/NavigationBar/NavigationBar.jsx +4 -6
- package/src/NavigationBar/NavigationItem.jsx +6 -8
- package/src/NavigationBar/NavigationSubMenu.jsx +7 -8
- package/src/NavigationBar/collapseItems.js +1 -3
- package/src/NavigationBar/resolveItemSelection.js +1 -3
- package/src/OptimizeImage/OptimizeImage.jsx +3 -6
- package/src/OptimizeImage/utils/getFallbackUrl.js +2 -2
- package/src/OptimizeImage/utils/getImageUrls.js +3 -3
- package/src/OptimizeImage/utils/getOptimizedUrl.js +2 -9
- package/src/OptimizeImage/utils/hasWebpSupport.js +1 -1
- package/src/OptimizeImage/utils/index.js +4 -4
- package/src/OptimizeImage/utils/isSvgUrl.js +1 -1
- package/src/OrderedList/OrderedList.jsx +3 -8
- package/src/OrderedList/OrderedListBase.jsx +2 -7
- package/src/OrderedList/{Item.jsx → OrderedListItem.jsx} +44 -32
- package/src/OrderedList/{ItemBase.jsx → OrderedListItemBase.jsx} +4 -4
- package/src/OrderedList/constants.js +0 -1
- package/src/Paragraph/Paragraph.jsx +7 -9
- package/src/PreviewCard/PreviewCard.jsx +16 -32
- package/src/PreviewCard/{AuthorDate.jsx → PreviewCardAuthorDate.jsx} +3 -5
- package/src/PriceLockup/PriceLockup.jsx +33 -31
- package/src/PriceLockup/dictionary.js +1 -1
- package/src/PriceLockup/tokens.js +1 -1
- package/src/Progress/ProgressBar.jsx +33 -30
- package/src/QuantitySelector/QuantitySelector.jsx +5 -7
- package/src/QuantitySelector/{SideButton.jsx → QuantitySelectorSideButton.jsx} +3 -4
- package/src/QuantitySelector/dictionary.js +1 -1
- package/src/ResponsiveImage/ResponsiveImage.jsx +1 -3
- package/src/Ribbon/Ribbon.jsx +35 -44
- package/src/SkeletonProvider/SkeletonImage.jsx +1 -3
- package/src/SkeletonProvider/SkeletonProvider.jsx +5 -9
- package/src/SkeletonProvider/SkeletonTypography.jsx +1 -3
- package/src/Span/Span.jsx +11 -11
- package/src/Spinner/Spinner.jsx +17 -19
- package/src/Spinner/SpinnerContent.jsx +4 -6
- package/src/StoryCard/StoryCard.jsx +15 -16
- package/src/Table/Table.jsx +81 -75
- package/src/Table/{Body.jsx → TableBody.jsx} +3 -5
- package/src/Table/{Cell.jsx → TableCell.jsx} +69 -65
- package/src/Table/{Header.jsx → TableHeader.jsx} +6 -8
- package/src/Table/{Row.jsx → TableRow.jsx} +11 -12
- package/src/Table/{SubHeading.jsx → TableSubHeading.jsx} +6 -8
- package/src/TermsAndConditions/ExpandCollapse.jsx +18 -19
- package/src/TermsAndConditions/TermsAndConditions.jsx +37 -37
- package/src/TermsAndConditions/dictionary.js +1 -1
- package/src/Testimonial/Testimonial.jsx +20 -28
- package/src/Toast/Toast.jsx +36 -35
- package/src/Video/ControlBar/ControlBar.jsx +28 -25
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +4 -6
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +26 -30
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +31 -33
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +40 -40
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +10 -12
- package/src/Video/Video.jsx +697 -683
- package/src/Video/videoText.js +1 -3
- package/src/VideoPicker/VideoPicker.jsx +37 -25
- package/src/VideoPicker/VideoPickerPlayer.jsx +2 -4
- package/src/VideoPicker/VideoPickerThumbnail.jsx +26 -15
- package/src/VideoPicker/VideoSlider.jsx +1 -3
- package/src/WaffleGrid/WaffleGrid.jsx +31 -27
- package/src/WebVideo/WebVideo.jsx +4 -6
- package/src/baseExports.js +27 -13
- package/src/index.js +46 -37
- package/src/server.js +1 -2
- package/src/shared/ConditionalWrapper/ConditionalWrapper.jsx +1 -3
- package/src/shared/FullBleedContent/FullBleedContent.jsx +26 -19
- package/src/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -3
- package/src/shared/FullBleedContent/index.js +3 -8
- package/src/shared/FullBleedContent/useFullBleedContentProps.js +2 -5
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +5 -7
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +25 -25
- package/src/shared/VideoSplash/VideoSplash.jsx +7 -9
- package/src/shared/VideoSplash/helpers.js +1 -1
- package/src/utils/index.js +7 -7
- package/src/utils/isElementFocusable.js +1 -3
- package/src/utils/logger.js +0 -5
- package/src/utils/media.js +1 -1
- package/src/utils/renderStructuredContent.jsx +1 -3
- package/src/utils/scrollToAnchor.js +1 -3
- package/src/utils/ssr.js +1 -3
- package/src/utils/theming/get-theme-from-server.js +1 -1
- package/src/utils/theming/with-client-theme.jsx +1 -3
- package/src/utils/theming/with-server-theme.jsx +2 -4
- package/src/utils/transforms.js +0 -2
- package/src/utils/useOverlaidPosition.js +1 -3
- package/src/utils/useTypographyTheme.js +1 -3
- package/types/Autocomplete.d.ts +1 -3
- package/types/Badge.d.ts +1 -3
- package/types/BaseProvider.d.ts +1 -3
- package/types/BlockQuote.d.ts +1 -3
- package/types/Box.d.ts +1 -3
- package/types/BreadcrumbItem.d.ts +1 -3
- package/types/Breadcrumbs.d.ts +2 -4
- package/types/Callout.d.ts +1 -3
- package/types/Card.d.ts +1 -3
- package/types/Cell.d.ts +1 -3
- package/types/ControlBar.d.ts +1 -3
- package/types/Countdown.d.ts +1 -3
- package/types/DatePicker.d.ts +1 -3
- package/types/FileUpload.d.ts +1 -3
- package/types/Footnote.d.ts +1 -3
- package/types/FootnoteLink.d.ts +1 -3
- package/types/Listbox.d.ts +1 -3
- package/types/MiddleControlButton.d.ts +1 -3
- package/types/MultiSelectFilter.d.ts +1 -3
- package/types/PriceLockup.d.ts +1 -3
- package/types/QuantitySelector.d.ts +1 -3
- package/types/Ribbon.d.ts +1 -3
- package/types/Spinner.d.ts +1 -3
- package/types/Table.d.ts +1 -3
- package/types/Tooltip.d.ts +1 -3
- package/types/TooltipButton.d.ts +1 -3
- package/types/Typography.d.ts +1 -3
- package/types/Video.d.ts +1 -3
- package/types/VideoButton.d.ts +1 -3
- package/types/VideoMenu.d.ts +1 -3
- package/types/VideoProgressBar.d.ts +1 -3
- package/types/VolumeSlider.d.ts +1 -3
- package/types/WebVideo.d.ts +1 -3
- package/lib/cjs/Badge/index.js +0 -9
- package/lib/cjs/BlockQuote/index.js +0 -9
- package/lib/cjs/Breadcrumbs/index.js +0 -13
- package/lib/cjs/Callout/index.js +0 -9
- package/lib/cjs/Card/index.js +0 -9
- package/lib/cjs/Countdown/index.js +0 -9
- package/lib/cjs/DatePicker/index.js +0 -9
- package/lib/cjs/Disclaimer/index.js +0 -13
- package/lib/cjs/Footnote/index.js +0 -11
- package/lib/cjs/IconButton/index.js +0 -9
- package/lib/cjs/Image/index.js +0 -20
- package/lib/cjs/List/index.js +0 -17
- package/lib/cjs/NavigationBar/index.js +0 -11
- package/lib/cjs/OptimizeImage/index.js +0 -9
- package/lib/cjs/OrderedList/index.js +0 -17
- package/lib/cjs/Paragraph/index.js +0 -9
- package/lib/cjs/PreviewCard/index.js +0 -9
- package/lib/cjs/PriceLockup/index.js +0 -9
- package/lib/cjs/Progress/index.js +0 -11
- package/lib/cjs/QuantitySelector/index.js +0 -9
- package/lib/cjs/ResponsiveImage/index.js +0 -9
- package/lib/cjs/Ribbon/index.js +0 -9
- package/lib/cjs/SkeletonProvider/index.js +0 -9
- package/lib/cjs/Span/index.js +0 -9
- package/lib/cjs/Spinner/index.js +0 -9
- package/lib/cjs/StoryCard/index.js +0 -9
- package/lib/cjs/Table/index.js +0 -24
- package/lib/cjs/TermsAndConditions/index.js +0 -13
- package/lib/cjs/Testimonial/index.js +0 -9
- package/lib/cjs/Toast/index.js +0 -9
- package/lib/cjs/Video/index.js +0 -9
- package/lib/cjs/VideoPicker/index.js +0 -9
- package/lib/cjs/WaffleGrid/index.js +0 -9
- package/lib/cjs/WebVideo/index.js +0 -9
- package/lib/cjs/shared/ConditionalWrapper/index.js +0 -9
- package/lib/esm/Badge/index.js +0 -2
- package/lib/esm/BlockQuote/index.js +0 -2
- package/lib/esm/Breadcrumbs/index.js +0 -1
- package/lib/esm/Callout/index.js +0 -2
- package/lib/esm/Card/index.js +0 -2
- package/lib/esm/Countdown/index.js +0 -2
- package/lib/esm/DatePicker/index.js +0 -2
- package/lib/esm/Disclaimer/index.js +0 -1
- package/lib/esm/Footnote/index.js +0 -4
- package/lib/esm/IconButton/index.js +0 -2
- package/lib/esm/Image/index.js +0 -9
- package/lib/esm/List/index.js +0 -5
- package/lib/esm/NavigationBar/index.js +0 -4
- package/lib/esm/OptimizeImage/index.js +0 -2
- package/lib/esm/OrderedList/index.js +0 -5
- package/lib/esm/Paragraph/index.js +0 -2
- package/lib/esm/PreviewCard/index.js +0 -2
- package/lib/esm/PriceLockup/index.js +0 -2
- package/lib/esm/Progress/index.js +0 -4
- package/lib/esm/QuantitySelector/index.js +0 -2
- package/lib/esm/ResponsiveImage/index.js +0 -2
- package/lib/esm/Ribbon/index.js +0 -2
- package/lib/esm/SkeletonProvider/index.js +0 -2
- package/lib/esm/Span/index.js +0 -2
- package/lib/esm/Spinner/index.js +0 -2
- package/lib/esm/StoryCard/index.js +0 -2
- package/lib/esm/Table/index.js +0 -17
- package/lib/esm/TermsAndConditions/index.js +0 -1
- package/lib/esm/Testimonial/index.js +0 -2
- package/lib/esm/Toast/index.js +0 -2
- package/lib/esm/Video/index.js +0 -2
- package/lib/esm/VideoPicker/index.js +0 -2
- package/lib/esm/WaffleGrid/index.js +0 -2
- package/lib/esm/WebVideo/index.js +0 -2
- package/lib/esm/shared/ConditionalWrapper/index.js +0 -2
- package/src/Badge/index.js +0 -3
- package/src/BlockQuote/index.js +0 -3
- package/src/Breadcrumbs/index.js +0 -1
- package/src/Callout/index.js +0 -3
- package/src/Card/index.js +0 -3
- package/src/Countdown/index.js +0 -3
- package/src/DatePicker/index.js +0 -3
- package/src/Disclaimer/index.js +0 -1
- package/src/Footnote/index.js +0 -6
- package/src/IconButton/index.js +0 -3
- package/src/Image/index.js +0 -10
- package/src/List/index.js +0 -8
- package/src/NavigationBar/index.js +0 -6
- package/src/OptimizeImage/index.js +0 -3
- package/src/OrderedList/index.js +0 -8
- package/src/Paragraph/index.js +0 -3
- package/src/PreviewCard/index.js +0 -3
- package/src/PriceLockup/index.js +0 -3
- package/src/Progress/index.js +0 -6
- package/src/QuantitySelector/index.js +0 -3
- package/src/ResponsiveImage/index.js +0 -3
- package/src/Ribbon/index.js +0 -3
- package/src/SkeletonProvider/index.js +0 -3
- package/src/Span/index.js +0 -3
- package/src/Spinner/index.js +0 -3
- package/src/StoryCard/index.js +0 -3
- package/src/Table/index.js +0 -20
- package/src/TermsAndConditions/index.js +0 -1
- package/src/Testimonial/index.js +0 -3
- package/src/Toast/index.js +0 -3
- package/src/Video/index.js +0 -3
- package/src/VideoPicker/index.js +0 -3
- package/src/WaffleGrid/index.js +0 -3
- package/src/WebVideo/index.js +0 -3
- package/src/shared/ConditionalWrapper/index.js +0 -3
package/src/Table/Table.jsx
CHANGED
|
@@ -14,14 +14,14 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs])
|
|
|
14
14
|
|
|
15
15
|
const StyledContainer = styled.div`
|
|
16
16
|
overflow: auto;
|
|
17
|
-
padding-bottom: ${(props) => (props
|
|
17
|
+
padding-bottom: ${(props) => (props.$isScrollable ? `${props.$tablePaddingBottom}px` : 0)};
|
|
18
18
|
`
|
|
19
19
|
|
|
20
20
|
const StyledTable = styled.table`
|
|
21
21
|
margin: 0;
|
|
22
22
|
padding: 0;
|
|
23
|
-
width: ${({ fullWidth, tableWidth }) => (fullWidth ? '100%' : `${tableWidth}px`)};
|
|
24
|
-
border: ${(props) => `${props
|
|
23
|
+
width: ${({ $fullWidth, $tableWidth }) => ($fullWidth ? '100%' : `${$tableWidth}px`)};
|
|
24
|
+
border: ${(props) => `${props.$borderWidth}px solid ${props.$borderColor}`};
|
|
25
25
|
border-collapse: collapse;
|
|
26
26
|
`
|
|
27
27
|
|
|
@@ -38,91 +38,97 @@ export const useTableContext = () => React.useContext(TableContext)
|
|
|
38
38
|
* - Right-align prices and numbers that display decimal points
|
|
39
39
|
*
|
|
40
40
|
* ### Building up a `Table`
|
|
41
|
-
* - Use `
|
|
42
|
-
* - Use `
|
|
43
|
-
* - Use `
|
|
44
|
-
* - Use `
|
|
41
|
+
* - Use `TableHeader` and `TableBody` as direct children of `Table`
|
|
42
|
+
* - Use `TableSubHeading` to render an intermediate data heading row
|
|
43
|
+
* - Use `TableRow` and `TableCell` to build up the tabular data
|
|
44
|
+
* - Use `TableCell`'s `type` prop to visually mark it as a row heading (`type="rowHeading"`)
|
|
45
45
|
*/
|
|
46
|
-
const Table = (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
const { tablePaddingBottom, borderColor, borderWidth } = themeTokens
|
|
57
|
-
const containerRef = React.useRef()
|
|
58
|
-
const tableRef = React.useRef()
|
|
46
|
+
export const Table = React.forwardRef(
|
|
47
|
+
(
|
|
48
|
+
{ children, spacing = 'default', fullWidth = true, text = 'medium', tokens, variant, ...rest },
|
|
49
|
+
ref
|
|
50
|
+
) => {
|
|
51
|
+
const themeTokens = useThemeTokens('Table', tokens, variant)
|
|
52
|
+
const { tablePaddingBottom, borderColor, borderWidth } = themeTokens
|
|
53
|
+
const internalRef = React.useRef()
|
|
54
|
+
const containerRef = ref ?? internalRef
|
|
55
|
+
const tableRef = React.useRef()
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
const [containerWidth, setContainerWidth] = React.useState(0)
|
|
58
|
+
const [tableWidth, setTableWidth] = React.useState(0)
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
60
|
+
useSafeLayoutEffect(() => {
|
|
61
|
+
const updateDimensions = () => {
|
|
62
|
+
const containerClientWidth = containerRef.current?.clientWidth
|
|
63
|
+
const responsiveTableWidth = fullWidth
|
|
64
|
+
? containerClientWidth
|
|
65
|
+
: tableRef.current?.clientWidth
|
|
66
|
+
setContainerWidth(containerClientWidth)
|
|
67
|
+
setTableWidth(responsiveTableWidth)
|
|
68
|
+
}
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
const throttledUpdateDimensions = throttle(updateDimensions, 100, { leading: false })
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
updateDimensions()
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
// a pretty naive way of repeating the measurement after the fonts are loaded
|
|
75
|
+
window.addEventListener('load', updateDimensions)
|
|
76
|
+
window.addEventListener('resize', throttledUpdateDimensions)
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
return () => {
|
|
79
|
+
window.removeEventListener('load', updateDimensions)
|
|
80
|
+
window.removeEventListener('resize', throttledUpdateDimensions)
|
|
81
|
+
}
|
|
82
|
+
}, [])
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
>
|
|
92
|
-
<TableContext.Provider
|
|
93
|
-
value={{
|
|
94
|
-
text,
|
|
95
|
-
isScrollable,
|
|
96
|
-
tokens,
|
|
97
|
-
spacing,
|
|
98
|
-
variant,
|
|
99
|
-
themeTokens
|
|
100
|
-
}}
|
|
84
|
+
const isScrollable = tableWidth > containerWidth
|
|
85
|
+
return (
|
|
86
|
+
<StyledContainer
|
|
87
|
+
ref={containerRef}
|
|
88
|
+
$isScrollable={isScrollable}
|
|
89
|
+
$tablePaddingBottom={tablePaddingBottom}
|
|
101
90
|
>
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
91
|
+
<TableContext.Provider
|
|
92
|
+
value={{
|
|
93
|
+
text,
|
|
94
|
+
isScrollable,
|
|
95
|
+
tokens,
|
|
96
|
+
spacing,
|
|
97
|
+
variant,
|
|
98
|
+
themeTokens
|
|
99
|
+
}}
|
|
110
100
|
>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
101
|
+
<StyledTable
|
|
102
|
+
$borderColor={borderColor}
|
|
103
|
+
$borderWidth={borderWidth}
|
|
104
|
+
$tableWidth={tableWidth}
|
|
105
|
+
cellSpacing={0}
|
|
106
|
+
ref={tableRef}
|
|
107
|
+
$fullWidth={fullWidth}
|
|
108
|
+
{...selectProps(rest)}
|
|
109
|
+
>
|
|
110
|
+
{children}
|
|
111
|
+
</StyledTable>
|
|
112
|
+
</TableContext.Provider>
|
|
113
|
+
</StyledContainer>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
Table.displayName = 'Table'
|
|
117
119
|
|
|
118
120
|
Table.propTypes = {
|
|
119
121
|
...selectedSystemPropTypes,
|
|
122
|
+
/** Theme tokens for Table */
|
|
120
123
|
tokens: getTokensPropType('Table'),
|
|
124
|
+
/** Table content (rows, headers, etc) */
|
|
121
125
|
children: PropTypes.node,
|
|
122
|
-
/**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
/** Sets text style */
|
|
127
|
+
text: PropTypes.oneOf(['medium', 'small']),
|
|
128
|
+
/** Table spacing variant */
|
|
129
|
+
spacing: PropTypes.oneOf(['default', 'compact']),
|
|
130
|
+
/** If true, table takes 100% width of container */
|
|
131
|
+
fullWidth: PropTypes.bool,
|
|
132
|
+
/** Variant for Table styling */
|
|
133
|
+
variant: PropTypes.object
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
export default Table
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
export const TableBody = React.forwardRef(({ children }, ref) => {
|
|
5
5
|
return <tbody ref={ref}>{children}</tbody>
|
|
6
6
|
})
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
TableBody.displayName = 'TableBody'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
TableBody.propTypes = {
|
|
11
11
|
children: PropTypes.node
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
export default Body
|
|
@@ -33,57 +33,63 @@ const stickyStyles = ({ cellStickyShadow, stickyBackgroundColor, type }) => css`
|
|
|
33
33
|
`
|
|
34
34
|
const sharedStyles = css`
|
|
35
35
|
${({
|
|
36
|
-
isSticky,
|
|
37
|
-
align,
|
|
38
|
-
cellPaddingTop,
|
|
39
|
-
cellPaddingRight,
|
|
40
|
-
cellPaddingBottom,
|
|
41
|
-
cellPaddingLeft,
|
|
42
|
-
cellBorderWidth,
|
|
43
|
-
cellBorderColor,
|
|
44
|
-
cellBorderTopWidth,
|
|
45
|
-
cellMinWidth,
|
|
46
|
-
cellBackground,
|
|
47
|
-
cellStickyShadow,
|
|
48
|
-
stickyBackgroundColor,
|
|
49
|
-
cellBottomLeftBorderRadius,
|
|
50
|
-
cellBottomRightBorderRadius,
|
|
51
|
-
cellTopLeftBorderRadius,
|
|
52
|
-
cellTopRightBorderRadius,
|
|
53
|
-
type
|
|
36
|
+
$isSticky,
|
|
37
|
+
$align,
|
|
38
|
+
$cellPaddingTop,
|
|
39
|
+
$cellPaddingRight,
|
|
40
|
+
$cellPaddingBottom,
|
|
41
|
+
$cellPaddingLeft,
|
|
42
|
+
$cellBorderWidth,
|
|
43
|
+
$cellBorderColor,
|
|
44
|
+
$cellBorderTopWidth,
|
|
45
|
+
$cellMinWidth,
|
|
46
|
+
$cellBackground,
|
|
47
|
+
$cellStickyShadow,
|
|
48
|
+
$stickyBackgroundColor,
|
|
49
|
+
$cellBottomLeftBorderRadius,
|
|
50
|
+
$cellBottomRightBorderRadius,
|
|
51
|
+
$cellTopLeftBorderRadius,
|
|
52
|
+
$cellTopRightBorderRadius,
|
|
53
|
+
$type
|
|
54
54
|
}) => css`
|
|
55
|
-
text-align: ${align};
|
|
56
|
-
min-width: ${cellMinWidth}px;
|
|
57
|
-
padding: ${cellPaddingTop}px ${cellPaddingRight}px ${cellPaddingBottom}px
|
|
58
|
-
|
|
59
|
-
${
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
border-
|
|
67
|
-
border-
|
|
55
|
+
text-align: ${$align};
|
|
56
|
+
min-width: ${$cellMinWidth}px;
|
|
57
|
+
padding: ${$cellPaddingTop}px ${$cellPaddingRight}px ${$cellPaddingBottom}px
|
|
58
|
+
${$cellPaddingLeft}px;
|
|
59
|
+
background-color: ${$cellBackground};
|
|
60
|
+
${$isSticky &&
|
|
61
|
+
stickyStyles({
|
|
62
|
+
type: $type,
|
|
63
|
+
cellStickyShadow: $cellStickyShadow,
|
|
64
|
+
stickyBackgroundColor: $stickyBackgroundColor
|
|
65
|
+
})};
|
|
66
|
+
border-style: ${$cellBorderWidth || $cellBorderTopWidth ? 'solid' : 'none'};
|
|
67
|
+
border-color: ${$cellBorderColor};
|
|
68
|
+
border-width: ${$cellBorderWidth}px;
|
|
69
|
+
border-top-width: ${$cellBorderTopWidth || $cellBorderWidth}px;
|
|
70
|
+
border-bottom-left-radius: ${$cellBottomLeftBorderRadius}px;
|
|
71
|
+
border-bottom-right-radius: ${$cellBottomRightBorderRadius}px;
|
|
72
|
+
border-top-left-radius: ${$cellTopLeftBorderRadius}px;
|
|
73
|
+
border-top-right-radius: ${$cellTopRightBorderRadius}px;
|
|
68
74
|
`}
|
|
69
75
|
`
|
|
70
76
|
const createStyledCell = (htmlElement) => styled[htmlElement]`
|
|
71
77
|
${sharedStyles};
|
|
72
|
-
box-shadow: ${({ cellBoxShadowColor, type }) => {
|
|
73
|
-
return type === HEADER_TYPE.HEADING
|
|
74
|
-
? `inset 0 1px 0 ${cellBoxShadowColor}, inset 0 -1px 0 ${cellBoxShadowColor}`
|
|
75
|
-
: `inset 0 1px 0 ${cellBoxShadowColor}`
|
|
78
|
+
box-shadow: ${({ $cellBoxShadowColor, $type }) => {
|
|
79
|
+
return $type === HEADER_TYPE.HEADING
|
|
80
|
+
? `inset 0 1px 0 ${$cellBoxShadowColor}, inset 0 -1px 0 ${$cellBoxShadowColor}`
|
|
81
|
+
: `inset 0 1px 0 ${$cellBoxShadowColor}`
|
|
76
82
|
}};
|
|
77
|
-
${({ display }) =>
|
|
78
|
-
display &&
|
|
83
|
+
${({ $display }) =>
|
|
84
|
+
$display &&
|
|
79
85
|
`*:not(:empty) {
|
|
80
|
-
display: ${display};
|
|
86
|
+
display: ${$display};
|
|
81
87
|
}`}
|
|
82
88
|
`
|
|
83
89
|
const StyledHeaderCell = createStyledCell('th')
|
|
84
90
|
const StyledDataCell = createStyledCell('td')
|
|
85
91
|
|
|
86
|
-
const
|
|
92
|
+
export const TableCell = React.forwardRef(
|
|
87
93
|
({ children, isFirstInRow, align = 'left', tokens: cellTokens, type = 'default' }, ref) => {
|
|
88
94
|
const {
|
|
89
95
|
text,
|
|
@@ -120,25 +126,25 @@ const Cell = React.forwardRef(
|
|
|
120
126
|
} = useThemeTokens('Table', themeTokens, { spacing, type, text, ...variant })
|
|
121
127
|
|
|
122
128
|
const sharedProps = {
|
|
123
|
-
align,
|
|
124
|
-
isSticky: isTableScrollable && isFirstInRow,
|
|
125
|
-
cellBackground,
|
|
126
|
-
cellMinWidth,
|
|
127
|
-
cellStickyShadow: applyShadowToken(cellStickyShadow).boxShadow,
|
|
128
|
-
cellPaddingTop,
|
|
129
|
-
cellPaddingRight,
|
|
130
|
-
cellPaddingLeft,
|
|
131
|
-
cellPaddingBottom,
|
|
132
|
-
cellBorderWidth,
|
|
133
|
-
cellBorderColor,
|
|
134
|
-
cellBorderTopWidth,
|
|
135
|
-
cellTopLeftBorderRadius,
|
|
136
|
-
cellTopRightBorderRadius,
|
|
137
|
-
cellBottomLeftBorderRadius,
|
|
138
|
-
cellBottomRightBorderRadius,
|
|
139
|
-
stickyBackgroundColor,
|
|
140
|
-
cellBoxShadowColor,
|
|
141
|
-
display,
|
|
129
|
+
$align: align,
|
|
130
|
+
$isSticky: isTableScrollable && isFirstInRow,
|
|
131
|
+
$cellBackground: cellBackground,
|
|
132
|
+
$cellMinWidth: cellMinWidth,
|
|
133
|
+
$cellStickyShadow: applyShadowToken(cellStickyShadow).boxShadow,
|
|
134
|
+
$cellPaddingTop: cellPaddingTop,
|
|
135
|
+
$cellPaddingRight: cellPaddingRight,
|
|
136
|
+
$cellPaddingLeft: cellPaddingLeft,
|
|
137
|
+
$cellPaddingBottom: cellPaddingBottom,
|
|
138
|
+
$cellBorderWidth: cellBorderWidth,
|
|
139
|
+
$cellBorderColor: cellBorderColor,
|
|
140
|
+
$cellBorderTopWidth: cellBorderTopWidth,
|
|
141
|
+
$cellTopLeftBorderRadius: cellTopLeftBorderRadius,
|
|
142
|
+
$cellTopRightBorderRadius: cellTopRightBorderRadius,
|
|
143
|
+
$cellBottomLeftBorderRadius: cellBottomLeftBorderRadius,
|
|
144
|
+
$cellBottomRightBorderRadius: cellBottomRightBorderRadius,
|
|
145
|
+
$stickyBackgroundColor: stickyBackgroundColor,
|
|
146
|
+
$cellBoxShadowColor: cellBoxShadowColor,
|
|
147
|
+
$display: display,
|
|
142
148
|
ref
|
|
143
149
|
}
|
|
144
150
|
|
|
@@ -153,21 +159,21 @@ const Cell = React.forwardRef(
|
|
|
153
159
|
switch (type) {
|
|
154
160
|
case HEADER_TYPE.HEADING:
|
|
155
161
|
return (
|
|
156
|
-
<StyledHeaderCell scope="col" {...sharedProps} type={type}>
|
|
162
|
+
<StyledHeaderCell scope="col" {...sharedProps} $type={type}>
|
|
157
163
|
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
158
164
|
</StyledHeaderCell>
|
|
159
165
|
)
|
|
160
166
|
|
|
161
167
|
case HEADER_TYPE.SUBHEADING:
|
|
162
168
|
return (
|
|
163
|
-
<StyledHeaderCell scope="col" {...sharedProps} type={type}>
|
|
169
|
+
<StyledHeaderCell scope="col" {...sharedProps} $type={type}>
|
|
164
170
|
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
165
171
|
</StyledHeaderCell>
|
|
166
172
|
)
|
|
167
173
|
|
|
168
174
|
case HEADER_TYPE.ROWHEADING:
|
|
169
175
|
return (
|
|
170
|
-
<StyledHeaderCell scope="row" {...sharedProps} type={type}>
|
|
176
|
+
<StyledHeaderCell scope="row" {...sharedProps} $type={type}>
|
|
171
177
|
<Typography tokens={typographyTokens}>{children}</Typography>
|
|
172
178
|
</StyledHeaderCell>
|
|
173
179
|
)
|
|
@@ -182,9 +188,9 @@ const Cell = React.forwardRef(
|
|
|
182
188
|
}
|
|
183
189
|
)
|
|
184
190
|
|
|
185
|
-
|
|
191
|
+
TableCell.displayName = 'TableCell'
|
|
186
192
|
|
|
187
|
-
|
|
193
|
+
TableCell.propTypes = {
|
|
188
194
|
type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
189
195
|
tokens: PropTypes.object,
|
|
190
196
|
children: PropTypes.node,
|
|
@@ -200,5 +206,3 @@ Cell.propTypes = {
|
|
|
200
206
|
*/
|
|
201
207
|
align: PropTypes.oneOf(['left', 'center', 'right'])
|
|
202
208
|
}
|
|
203
|
-
|
|
204
|
-
export default Cell
|
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { getTokensPropType } from '@telus-uds/components-base'
|
|
4
|
-
import
|
|
4
|
+
import { TableRow } from './TableRow'
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
export const TableHeader = React.forwardRef(({ children, tokens }, ref) => {
|
|
7
7
|
return (
|
|
8
8
|
<thead ref={ref}>
|
|
9
|
-
<
|
|
9
|
+
<TableRow tokens={tokens}>
|
|
10
10
|
{React.Children.map(children, (child) =>
|
|
11
11
|
// TO DO: pass type as a variant instead of prop
|
|
12
12
|
React.cloneElement(child, { type: 'heading' })
|
|
13
13
|
)}
|
|
14
|
-
</
|
|
14
|
+
</TableRow>
|
|
15
15
|
</thead>
|
|
16
16
|
)
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
TableHeader.displayName = 'TableHeader'
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
TableHeader.propTypes = {
|
|
22
22
|
children: PropTypes.node,
|
|
23
23
|
tokens: getTokensPropType('Table')
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
export default Header
|
|
@@ -5,21 +5,22 @@ import { useTableContext } from './Table'
|
|
|
5
5
|
|
|
6
6
|
const StyledTR = styled.tr`
|
|
7
7
|
&:hover {
|
|
8
|
-
background-color: ${({ tokens }) => tokens?.rowHoverBackgroundColor} !important;
|
|
8
|
+
background-color: ${({ $tokens }) => $tokens?.rowHoverBackgroundColor} !important;
|
|
9
9
|
}
|
|
10
|
-
border-style: ${({ tokens }) =>
|
|
11
|
-
tokens?.rowBorderWidth || tokens?.rowBorderTopWidth ? 'solid' : 'none'};
|
|
12
|
-
border-color: ${({ tokens }) => tokens?.rowBorderColor};
|
|
13
|
-
border-width: ${({ tokens }) => `${tokens?.rowBorderWidth}` || 0}px;
|
|
14
|
-
border-top-width: ${({ tokens }) =>
|
|
10
|
+
border-style: ${({ $tokens }) =>
|
|
11
|
+
$tokens?.rowBorderWidth || $tokens?.rowBorderTopWidth ? 'solid' : 'none'};
|
|
12
|
+
border-color: ${({ $tokens }) => $tokens?.rowBorderColor};
|
|
13
|
+
border-width: ${({ $tokens }) => `${$tokens?.rowBorderWidth}` || 0}px;
|
|
14
|
+
border-top-width: ${({ $tokens }) =>
|
|
15
|
+
`${$tokens?.rowBorderTopWidth}` || $tokens?.rowBorderWidth}px;
|
|
15
16
|
`
|
|
16
17
|
|
|
17
|
-
const
|
|
18
|
+
export const TableRow = React.forwardRef(({ children, tokens: rowTokens }, ref) => {
|
|
18
19
|
const { themeTokens } = useTableContext()
|
|
19
20
|
const mergedTokens = { ...themeTokens, ...rowTokens }
|
|
20
21
|
|
|
21
22
|
return (
|
|
22
|
-
<StyledTR ref={ref} tokens={mergedTokens}>
|
|
23
|
+
<StyledTR ref={ref} $tokens={mergedTokens}>
|
|
23
24
|
{React.Children.map(children, (child, index) =>
|
|
24
25
|
React.cloneElement(child, { isFirstInRow: index === 0 })
|
|
25
26
|
)}
|
|
@@ -27,9 +28,9 @@ const Row = React.forwardRef(({ children, tokens: rowTokens }, ref) => {
|
|
|
27
28
|
)
|
|
28
29
|
})
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
TableRow.displayName = 'TableRow'
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
TableRow.propTypes = {
|
|
33
34
|
tokens: PropTypes.shape({
|
|
34
35
|
borderColor: PropTypes.string,
|
|
35
36
|
topBorderWidth: PropTypes.string,
|
|
@@ -40,5 +41,3 @@ Row.propTypes = {
|
|
|
40
41
|
}),
|
|
41
42
|
children: PropTypes.node
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
export default Row
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import { getTokensPropType } from '@telus-uds/components-base'
|
|
4
|
-
import
|
|
4
|
+
import { TableRow } from './TableRow'
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
export const TableSubHeading = React.forwardRef(({ children, tokens }, ref) => {
|
|
7
7
|
return (
|
|
8
|
-
<
|
|
8
|
+
<TableRow ref={ref} tokens={tokens}>
|
|
9
9
|
{React.Children.map(children, (child) =>
|
|
10
10
|
// TO DO: pass type as a variant instead of prop
|
|
11
11
|
React.cloneElement(child, { type: 'subHeading' })
|
|
12
12
|
)}
|
|
13
|
-
</
|
|
13
|
+
</TableRow>
|
|
14
14
|
)
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
TableSubHeading.displayName = 'TableSubHeading'
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
TableSubHeading.propTypes = {
|
|
20
20
|
children: PropTypes.node,
|
|
21
21
|
tokens: getTokensPropType('Table')
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
export default Header
|
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import {
|
|
4
4
|
ExpandCollapse as ExpandCollapseBase,
|
|
5
|
+
ExpandCollapsePanel,
|
|
5
6
|
IconButton,
|
|
6
7
|
useThemeTokensCallback
|
|
7
8
|
} from '@telus-uds/components-base'
|
|
@@ -15,20 +16,20 @@ const ExpandCollapseControl = styled.div({
|
|
|
15
16
|
justifyContent: 'flex-start'
|
|
16
17
|
})
|
|
17
18
|
|
|
18
|
-
const ExpandCollapseIconContainer = styled.div(({ tokens }) => ({
|
|
19
|
-
alignItems: tokens.expandIconContainerAlignItems,
|
|
20
|
-
justifyContent: tokens.expandIconContainerJustifyContent,
|
|
21
|
-
marginLeft: `${tokens.expandIconContainerMarginY}px`,
|
|
22
|
-
marginRight: `${tokens.expandIconContainerMarginY}px`,
|
|
23
|
-
width: tokens.expandIconContainerWidth
|
|
19
|
+
const ExpandCollapseIconContainer = styled.div(({ $tokens }) => ({
|
|
20
|
+
alignItems: $tokens.expandIconContainerAlignItems,
|
|
21
|
+
justifyContent: $tokens.expandIconContainerJustifyContent,
|
|
22
|
+
marginLeft: `${$tokens.expandIconContainerMarginY}px`,
|
|
23
|
+
marginRight: `${$tokens.expandIconContainerMarginY}px`,
|
|
24
|
+
width: $tokens.expandIconContainerWidth
|
|
24
25
|
}))
|
|
25
26
|
|
|
26
|
-
const ExpandCollapseTitle = styled.h4(({ tokens }) => ({
|
|
27
|
-
color: tokens.expandTitleColor,
|
|
28
|
-
fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
|
|
29
|
-
fontSize: tokens.expandTitleFontSize,
|
|
30
|
-
lineHeight: tokens.expandTitleLineHeight,
|
|
31
|
-
margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
|
|
27
|
+
const ExpandCollapseTitle = styled.h4(({ $tokens }) => ({
|
|
28
|
+
color: $tokens.expandTitleColor,
|
|
29
|
+
fontFamily: `${$tokens.expandTitleFontName}${$tokens.expandTitleFontWeight}normal`,
|
|
30
|
+
fontSize: $tokens.expandTitleFontSize,
|
|
31
|
+
lineHeight: $tokens.expandTitleLineHeight,
|
|
32
|
+
margin: `${$tokens.expandTitleMarginX}px ${$tokens.expandTitleMarginY}px`
|
|
32
33
|
}))
|
|
33
34
|
|
|
34
35
|
const getIconButtonTokens = ({
|
|
@@ -49,7 +50,7 @@ const getIconButtonTokens = ({
|
|
|
49
50
|
outerBorderWidth: iconOuterBorderWidth
|
|
50
51
|
})
|
|
51
52
|
|
|
52
|
-
const ExpandCollapse = React.forwardRef(
|
|
53
|
+
export const ExpandCollapse = React.forwardRef(
|
|
53
54
|
({ children, collapseTitle, expandTitle = collapseTitle, expandLabel, collapseLabel }, ref) => {
|
|
54
55
|
const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {})
|
|
55
56
|
const {
|
|
@@ -73,7 +74,7 @@ const ExpandCollapse = React.forwardRef(
|
|
|
73
74
|
}}
|
|
74
75
|
>
|
|
75
76
|
{(expandProps) => (
|
|
76
|
-
<
|
|
77
|
+
<ExpandCollapsePanel
|
|
77
78
|
{...expandProps}
|
|
78
79
|
panelId="ExpandCollapsePanel"
|
|
79
80
|
controlTokens={{
|
|
@@ -93,7 +94,7 @@ const ExpandCollapse = React.forwardRef(
|
|
|
93
94
|
|
|
94
95
|
return (
|
|
95
96
|
<ExpandCollapseControl ref={ref}>
|
|
96
|
-
<ExpandCollapseIconContainer tokens={getTokens()}>
|
|
97
|
+
<ExpandCollapseIconContainer $tokens={getTokens()}>
|
|
97
98
|
{/*
|
|
98
99
|
Can use `Icon` instead of `IconButton` but `Icon` does not have required stylistic variants
|
|
99
100
|
Setting `accessibilityRole` to `none` for `IconButton` to render as a `div` instead of `button` to avoid nested `buttons`
|
|
@@ -106,7 +107,7 @@ const ExpandCollapse = React.forwardRef(
|
|
|
106
107
|
accessibilityRole="none"
|
|
107
108
|
/>
|
|
108
109
|
</ExpandCollapseIconContainer>
|
|
109
|
-
<ExpandCollapseTitle tokens={getTokens()}>
|
|
110
|
+
<ExpandCollapseTitle $tokens={getTokens()}>
|
|
110
111
|
{expanded ? expandTitle : collapseTitle}
|
|
111
112
|
</ExpandCollapseTitle>
|
|
112
113
|
</ExpandCollapseControl>
|
|
@@ -123,7 +124,7 @@ const ExpandCollapse = React.forwardRef(
|
|
|
123
124
|
}}
|
|
124
125
|
>
|
|
125
126
|
{children}
|
|
126
|
-
</
|
|
127
|
+
</ExpandCollapsePanel>
|
|
127
128
|
)}
|
|
128
129
|
</ExpandCollapseBase>
|
|
129
130
|
)
|
|
@@ -139,5 +140,3 @@ ExpandCollapse.propTypes = {
|
|
|
139
140
|
collapseLabel: PropTypes.string,
|
|
140
141
|
expandLabel: PropTypes.string
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
-
export default ExpandCollapse
|