@telus-uds/components-web 2.43.0 → 3.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 +26 -0
- package/CHANGELOG.md +21 -2
- package/babel.config.cjs +4 -0
- package/jest.config.cjs +29 -0
- package/lib/Badge/Badge.js +21 -29
- package/lib/Badge/index.js +2 -10
- package/lib/BlockQuote/BlockQuote.js +31 -39
- package/lib/BlockQuote/index.js +2 -10
- package/lib/Breadcrumbs/Breadcrumbs.js +39 -49
- package/lib/Breadcrumbs/Item/Item.js +26 -34
- package/lib/Breadcrumbs/index.js +1 -13
- package/lib/Callout/Callout.js +19 -27
- package/lib/Callout/index.js +2 -10
- package/lib/Card/Card.js +44 -54
- package/lib/Card/CardContent.js +17 -25
- package/lib/Card/CardFooter.js +16 -24
- package/lib/Card/index.js +2 -10
- package/lib/Countdown/Countdown.js +34 -42
- package/lib/Countdown/Segment.js +26 -34
- package/lib/Countdown/constants.js +4 -14
- package/lib/Countdown/dictionary.js +2 -9
- package/lib/Countdown/index.js +2 -10
- package/lib/Countdown/types.js +18 -28
- package/lib/Countdown/useCountdown.js +4 -11
- package/lib/DatePicker/CalendarContainer.js +6 -12
- package/lib/DatePicker/DatePicker.js +105 -101
- package/lib/DatePicker/dictionary.js +1 -8
- package/lib/DatePicker/index.js +2 -10
- package/lib/DatePicker/reactDatesCss.js +3 -10
- package/lib/Disclaimer/Disclaimer.js +15 -23
- package/lib/Disclaimer/index.js +1 -13
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +16 -24
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +17 -26
- package/lib/ExpandCollapseMini/index.js +2 -10
- package/lib/Footnote/Footnote.js +85 -95
- package/lib/Footnote/FootnoteLink.js +25 -33
- package/lib/Footnote/dictionary.js +2 -9
- package/lib/Footnote/index.js +4 -12
- package/lib/IconButton/IconButton.js +12 -20
- package/lib/IconButton/index.js +2 -10
- package/lib/Image/Image.js +17 -25
- package/lib/Image/index.js +6 -18
- package/lib/Image/server.js +4 -12
- package/lib/List/List.js +2 -9
- package/lib/List/ListItem.js +10 -18
- package/lib/List/index.js +4 -12
- package/lib/NavigationBar/NavigationBar.js +51 -59
- package/lib/NavigationBar/NavigationItem.js +19 -27
- package/lib/NavigationBar/NavigationSubMenu.js +34 -40
- package/lib/NavigationBar/collapseItems.js +1 -11
- package/lib/NavigationBar/index.js +4 -12
- package/lib/NavigationBar/resolveItemSelection.js +1 -8
- package/lib/OptimizeImage/OptimizeImage.js +26 -34
- package/lib/OptimizeImage/index.js +2 -10
- package/lib/OptimizeImage/utils/getFallbackUrl.js +3 -10
- package/lib/OptimizeImage/utils/getImageUrls.js +9 -16
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +3 -10
- package/lib/OptimizeImage/utils/hasWebpSupport.js +1 -7
- package/lib/OptimizeImage/utils/index.js +5 -34
- package/lib/OptimizeImage/utils/isSvgUrl.js +1 -7
- package/lib/OrderedList/Item.js +28 -36
- package/lib/OrderedList/ItemBase.js +8 -16
- package/lib/OrderedList/OrderedList.js +22 -30
- package/lib/OrderedList/OrderedListBase.js +12 -20
- package/lib/OrderedList/constants.js +1 -8
- package/lib/OrderedList/index.js +4 -12
- package/lib/Paragraph/Paragraph.js +22 -30
- package/lib/Paragraph/index.js +2 -10
- package/lib/PreviewCard/AuthorDate.js +17 -21
- package/lib/PreviewCard/PreviewCard.js +40 -49
- package/lib/PreviewCard/index.js +2 -10
- package/lib/PriceLockup/PriceLockup.js +56 -64
- package/lib/PriceLockup/index.js +2 -10
- package/lib/PriceLockup/tokens.js +2 -9
- package/lib/Progress/ProgressBar.js +17 -24
- package/lib/Progress/index.js +4 -12
- package/lib/QuantitySelector/QuantitySelector.js +55 -63
- package/lib/QuantitySelector/SideButton.js +15 -23
- package/lib/QuantitySelector/dictionary.js +2 -9
- package/lib/QuantitySelector/index.js +2 -10
- package/lib/QuantitySelector/styles.js +4 -13
- package/lib/ResponsiveImage/ResponsiveImage.js +29 -37
- package/lib/ResponsiveImage/index.js +2 -10
- package/lib/Ribbon/Ribbon.js +22 -30
- package/lib/Ribbon/index.js +2 -10
- package/lib/SkeletonProvider/SkeletonImage.js +14 -22
- package/lib/SkeletonProvider/SkeletonProvider.js +17 -25
- package/lib/SkeletonProvider/SkeletonTypography.js +14 -22
- package/lib/SkeletonProvider/index.js +2 -10
- package/lib/Span/Span.js +23 -31
- package/lib/Span/index.js +2 -10
- package/lib/Spinner/Spinner.js +43 -51
- package/lib/Spinner/SpinnerContent.js +21 -29
- package/lib/Spinner/constants.js +4 -14
- package/lib/Spinner/index.js +2 -10
- package/lib/StoryCard/StoryCard.js +40 -49
- package/lib/StoryCard/index.js +2 -10
- package/lib/Table/Body.js +7 -15
- package/lib/Table/Cell.js +28 -38
- package/lib/Table/Header.js +11 -19
- package/lib/Table/Row.js +8 -16
- package/lib/Table/SubHeading.js +10 -18
- package/lib/Table/Table.js +26 -35
- package/lib/Table/index.js +12 -20
- package/lib/TermsAndConditions/ExpandCollapse.js +22 -30
- package/lib/TermsAndConditions/TermsAndConditions.js +52 -60
- package/lib/TermsAndConditions/dictionary.js +2 -9
- package/lib/TermsAndConditions/index.js +1 -13
- package/lib/Testimonial/Testimonial.js +37 -45
- package/lib/Testimonial/index.js +2 -10
- package/lib/Toast/Toast.js +32 -42
- package/lib/Toast/index.js +2 -10
- package/lib/Video/ControlBar/ControlBar.js +73 -81
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +16 -24
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +27 -35
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +27 -36
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +30 -38
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +16 -24
- package/lib/Video/Video.js +74 -83
- package/lib/Video/index.js +2 -10
- package/lib/Video/videoText.js +1 -8
- package/lib/VideoPicker/VideoPicker.js +43 -53
- package/lib/VideoPicker/VideoPickerPlayer.js +17 -25
- package/lib/VideoPicker/VideoPickerThumbnail.js +38 -46
- package/lib/VideoPicker/VideoSlider.js +17 -26
- package/lib/VideoPicker/index.js +2 -10
- package/lib/VideoPicker/videoPropType.js +9 -18
- package/lib/WaffleGrid/WaffleGrid.js +33 -43
- package/lib/WaffleGrid/index.js +2 -10
- package/lib/WebVideo/WebVideo.js +42 -52
- package/lib/WebVideo/index.js +2 -10
- package/lib/WebVideo/utils/index.js +3 -11
- package/lib/baseExports.js +18 -431
- package/lib/index.js +38 -323
- package/lib/server.js +4 -12
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +9 -17
- package/lib/shared/ConditionalWrapper/index.js +2 -10
- package/lib/shared/FullBleedContent/FullBleedContent.js +21 -29
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +1 -8
- package/lib/shared/FullBleedContent/index.js +4 -24
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +4 -11
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +19 -27
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +27 -35
- package/lib/shared/VideoSplash/VideoSplash.js +24 -32
- package/lib/shared/VideoSplash/helpers.js +5 -14
- package/lib/utils/index.js +10 -75
- package/lib/utils/isElementFocusable.js +1 -8
- package/lib/utils/logger.js +6 -15
- package/lib/utils/media.js +5 -11
- package/lib/utils/renderStructuredContent.js +8 -15
- package/lib/utils/ssr.js +5 -12
- package/lib/utils/theming/get-theme-from-server.js +2 -10
- package/lib/utils/theming/with-client-theme.js +9 -17
- package/lib/utils/theming/with-server-theme.js +11 -19
- package/lib/utils/transforms.js +3 -11
- package/lib/utils/useOverlaidPosition.js +15 -23
- package/lib/utils/useTypographyTheme.js +6 -13
- package/package.json +18 -20
- package/src/Card/Card.jsx +2 -2
- package/src/DatePicker/DatePicker.jsx +17 -4
- package/src/PreviewCard/AuthorDate.jsx +5 -3
- package/src/utils/logger.js +2 -2
- package/lib-module/Badge/Badge.js +0 -121
- package/lib-module/Badge/index.js +0 -2
- package/lib-module/BlockQuote/BlockQuote.js +0 -204
- package/lib-module/BlockQuote/index.js +0 -2
- package/lib-module/Breadcrumbs/Breadcrumbs.js +0 -250
- package/lib-module/Breadcrumbs/Item/Item.js +0 -175
- package/lib-module/Breadcrumbs/index.js +0 -1
- package/lib-module/Callout/Callout.js +0 -135
- package/lib-module/Callout/index.js +0 -2
- package/lib-module/Card/Card.js +0 -251
- package/lib-module/Card/CardContent.js +0 -90
- package/lib-module/Card/CardFooter.js +0 -78
- package/lib-module/Card/index.js +0 -2
- package/lib-module/Countdown/Countdown.js +0 -169
- package/lib-module/Countdown/Segment.js +0 -96
- package/lib-module/Countdown/constants.js +0 -4
- package/lib-module/Countdown/dictionary.js +0 -22
- package/lib-module/Countdown/index.js +0 -2
- package/lib-module/Countdown/types.js +0 -24
- package/lib-module/Countdown/useCountdown.js +0 -26
- package/lib-module/DatePicker/CalendarContainer.js +0 -208
- package/lib-module/DatePicker/DatePicker.js +0 -506
- package/lib-module/DatePicker/dictionary.js +0 -119
- package/lib-module/DatePicker/index.js +0 -2
- package/lib-module/DatePicker/reactDatesCss.js +0 -3
- package/lib-module/Disclaimer/Disclaimer.js +0 -54
- package/lib-module/Disclaimer/index.js +0 -1
- package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +0 -73
- package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -117
- package/lib-module/ExpandCollapseMini/index.js +0 -2
- package/lib-module/Footnote/Footnote.js +0 -632
- package/lib-module/Footnote/FootnoteLink.js +0 -118
- package/lib-module/Footnote/dictionary.js +0 -12
- package/lib-module/Footnote/index.js +0 -4
- package/lib-module/IconButton/IconButton.js +0 -55
- package/lib-module/IconButton/index.js +0 -2
- package/lib-module/Image/Image.js +0 -83
- package/lib-module/Image/index.js +0 -9
- package/lib-module/Image/server.js +0 -4
- package/lib-module/List/List.js +0 -2
- package/lib-module/List/ListItem.js +0 -28
- package/lib-module/List/index.js +0 -4
- package/lib-module/NavigationBar/NavigationBar.js +0 -224
- package/lib-module/NavigationBar/NavigationItem.js +0 -87
- package/lib-module/NavigationBar/NavigationSubMenu.js +0 -162
- package/lib-module/NavigationBar/collapseItems.js +0 -41
- package/lib-module/NavigationBar/index.js +0 -4
- package/lib-module/NavigationBar/resolveItemSelection.js +0 -16
- package/lib-module/OptimizeImage/OptimizeImage.js +0 -92
- package/lib-module/OptimizeImage/index.js +0 -2
- package/lib-module/OptimizeImage/utils/getFallbackUrl.js +0 -7
- package/lib-module/OptimizeImage/utils/getImageUrls.js +0 -12
- package/lib-module/OptimizeImage/utils/getOptimizedUrl.js +0 -17
- package/lib-module/OptimizeImage/utils/hasWebpSupport.js +0 -28
- package/lib-module/OptimizeImage/utils/index.js +0 -5
- package/lib-module/OptimizeImage/utils/isSvgUrl.js +0 -3
- package/lib-module/OrderedList/Item.js +0 -145
- package/lib-module/OrderedList/ItemBase.js +0 -27
- package/lib-module/OrderedList/OrderedList.js +0 -86
- package/lib-module/OrderedList/OrderedListBase.js +0 -45
- package/lib-module/OrderedList/constants.js +0 -2
- package/lib-module/OrderedList/index.js +0 -4
- package/lib-module/Paragraph/Paragraph.js +0 -90
- package/lib-module/Paragraph/index.js +0 -2
- package/lib-module/PreviewCard/AuthorDate.js +0 -57
- package/lib-module/PreviewCard/PreviewCard.js +0 -209
- package/lib-module/PreviewCard/index.js +0 -2
- package/lib-module/PriceLockup/PriceLockup.js +0 -335
- package/lib-module/PriceLockup/index.js +0 -2
- package/lib-module/PriceLockup/tokens.js +0 -55
- package/lib-module/Progress/ProgressBar.js +0 -83
- package/lib-module/Progress/index.js +0 -4
- package/lib-module/QuantitySelector/QuantitySelector.js +0 -261
- package/lib-module/QuantitySelector/SideButton.js +0 -70
- package/lib-module/QuantitySelector/dictionary.js +0 -26
- package/lib-module/QuantitySelector/index.js +0 -2
- package/lib-module/QuantitySelector/styles.js +0 -9
- package/lib-module/ResponsiveImage/ResponsiveImage.js +0 -95
- package/lib-module/ResponsiveImage/index.js +0 -2
- package/lib-module/Ribbon/Ribbon.js +0 -216
- package/lib-module/Ribbon/index.js +0 -2
- package/lib-module/SkeletonProvider/SkeletonImage.js +0 -39
- package/lib-module/SkeletonProvider/SkeletonProvider.js +0 -57
- package/lib-module/SkeletonProvider/SkeletonTypography.js +0 -38
- package/lib-module/SkeletonProvider/index.js +0 -2
- package/lib-module/Span/Span.js +0 -72
- package/lib-module/Span/index.js +0 -2
- package/lib-module/Spinner/Spinner.js +0 -215
- package/lib-module/Spinner/SpinnerContent.js +0 -94
- package/lib-module/Spinner/constants.js +0 -4
- package/lib-module/Spinner/index.js +0 -2
- package/lib-module/StoryCard/StoryCard.js +0 -212
- package/lib-module/StoryCard/index.js +0 -2
- package/lib-module/Table/Body.js +0 -17
- package/lib-module/Table/Cell.js +0 -176
- package/lib-module/Table/Header.js +0 -25
- package/lib-module/Table/Row.js +0 -19
- package/lib-module/Table/SubHeading.js +0 -23
- package/lib-module/Table/Table.js +0 -114
- package/lib-module/Table/index.js +0 -12
- package/lib-module/TermsAndConditions/ExpandCollapse.js +0 -153
- package/lib-module/TermsAndConditions/TermsAndConditions.js +0 -277
- package/lib-module/TermsAndConditions/dictionary.js +0 -16
- package/lib-module/TermsAndConditions/index.js +0 -1
- package/lib-module/Testimonial/Testimonial.js +0 -234
- package/lib-module/Testimonial/index.js +0 -2
- package/lib-module/Toast/Toast.js +0 -158
- package/lib-module/Toast/index.js +0 -2
- package/lib-module/Video/ControlBar/ControlBar.js +0 -288
- package/lib-module/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -70
- package/lib-module/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -163
- package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +0 -203
- package/lib-module/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -191
- package/lib-module/Video/MiddleControlButton/MiddleControlButton.js +0 -71
- package/lib-module/Video/Video.js +0 -959
- package/lib-module/Video/index.js +0 -2
- package/lib-module/Video/videoText.js +0 -55
- package/lib-module/VideoPicker/VideoPicker.js +0 -190
- package/lib-module/VideoPicker/VideoPickerPlayer.js +0 -48
- package/lib-module/VideoPicker/VideoPickerThumbnail.js +0 -218
- package/lib-module/VideoPicker/VideoSlider.js +0 -82
- package/lib-module/VideoPicker/index.js +0 -2
- package/lib-module/VideoPicker/videoPropType.js +0 -10
- package/lib-module/WaffleGrid/WaffleGrid.js +0 -157
- package/lib-module/WaffleGrid/index.js +0 -2
- package/lib-module/WebVideo/WebVideo.js +0 -191
- package/lib-module/WebVideo/index.js +0 -2
- package/lib-module/WebVideo/utils/index.js +0 -50
- package/lib-module/baseExports.js +0 -19
- package/lib-module/index.js +0 -40
- package/lib-module/server.js +0 -5
- package/lib-module/shared/ConditionalWrapper/ConditionalWrapper.js +0 -22
- package/lib-module/shared/ConditionalWrapper/index.js +0 -2
- package/lib-module/shared/FullBleedContent/FullBleedContent.js +0 -101
- package/lib-module/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -55
- package/lib-module/shared/FullBleedContent/index.js +0 -4
- package/lib-module/shared/FullBleedContent/useFullBleedContentProps.js +0 -55
- package/lib-module/shared/VideoSplash/SplashButton/SplashButton.js +0 -84
- package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -223
- package/lib-module/shared/VideoSplash/VideoSplash.js +0 -65
- package/lib-module/shared/VideoSplash/helpers.js +0 -23
- package/lib-module/utils/index.js +0 -10
- package/lib-module/utils/isElementFocusable.js +0 -8
- package/lib-module/utils/logger.js +0 -18
- package/lib-module/utils/media.js +0 -39
- package/lib-module/utils/renderStructuredContent.js +0 -66
- package/lib-module/utils/ssr.js +0 -37
- package/lib-module/utils/theming/get-theme-from-server.js +0 -16
- package/lib-module/utils/theming/with-client-theme.js +0 -24
- package/lib-module/utils/theming/with-server-theme.js +0 -26
- package/lib-module/utils/transforms.js +0 -4
- package/lib-module/utils/useOverlaidPosition.js +0 -216
- package/lib-module/utils/useTypographyTheme.js +0 -24
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Box, Divider, PressableCardBase, selectSystemProps, Spacer, StackView, StackWrap, Typography, hrefAttrsProp, a11yProps, focusHandlerProps, viewProps, withLinkRouter, useThemeTokens, useThemeTokensCallback, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
2
6
|
|
|
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 _FullBleedContent = _interopRequireWildcard(require("../shared/FullBleedContent"));
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
7
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
17
|
-
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
|
|
18
10
|
|
|
19
11
|
// Stop changes to the card's inner border width causing the size and
|
|
20
12
|
// apparent position of the full bleed image to change.
|
|
21
|
-
const FullBleedOffsetOuter = /*#__PURE__*/
|
|
13
|
+
const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
|
|
22
14
|
displayName: "StoryCard__FullBleedOffsetOuter",
|
|
23
15
|
componentId: "components-web__sc-yhvivu-0"
|
|
24
16
|
})(_ref => {
|
|
@@ -30,7 +22,7 @@ const FullBleedOffsetOuter = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
30
22
|
marginTop: borderOffset * 2
|
|
31
23
|
};
|
|
32
24
|
});
|
|
33
|
-
const FullBleedOffsetInner = /*#__PURE__*/
|
|
25
|
+
const FullBleedOffsetInner = /*#__PURE__*/styled.div.withConfig({
|
|
34
26
|
displayName: "StoryCard__FullBleedOffsetInner",
|
|
35
27
|
componentId: "components-web__sc-yhvivu-1"
|
|
36
28
|
})(_ref2 => {
|
|
@@ -54,7 +46,7 @@ const FullBleedOffsetInner = /*#__PURE__*/_styledComponents.default.div.withConf
|
|
|
54
46
|
* - Use `href` to set the target URL
|
|
55
47
|
* - Use `fullBleedContent` to set the thumbnail image
|
|
56
48
|
*/
|
|
57
|
-
const StoryCard = /*#__PURE__*/
|
|
49
|
+
const StoryCard = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
58
50
|
let {
|
|
59
51
|
tag,
|
|
60
52
|
date,
|
|
@@ -72,18 +64,18 @@ const StoryCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
72
64
|
fullBleedContentPosition,
|
|
73
65
|
contentStackDirection,
|
|
74
66
|
fullBleedContentProps
|
|
75
|
-
} =
|
|
67
|
+
} = useFullBleedContentProps({
|
|
76
68
|
...fullBleedContent,
|
|
77
69
|
position: 'bottom'
|
|
78
70
|
});
|
|
79
|
-
const generalTokens =
|
|
80
|
-
const getTokens =
|
|
71
|
+
const generalTokens = useThemeTokens('StoryCard', tokens, variant);
|
|
72
|
+
const getTokens = useThemeTokensCallback('StoryCard', tokens, variant);
|
|
81
73
|
const getPressableCardTokens = cardState => getTokens(cardState);
|
|
82
74
|
const {
|
|
83
75
|
hrefAttrs,
|
|
84
76
|
rest: unusedRest
|
|
85
|
-
} =
|
|
86
|
-
return /*#__PURE__*/(
|
|
77
|
+
} = hrefAttrsProp.bundle(rest);
|
|
78
|
+
return /*#__PURE__*/_jsx(PressableCardBase, {
|
|
87
79
|
ref: ref,
|
|
88
80
|
onPress: onPress,
|
|
89
81
|
href: href,
|
|
@@ -98,14 +90,14 @@ const StoryCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
98
90
|
|
|
99
91
|
// Stop content jumping around as border size changes
|
|
100
92
|
const borderOffset = borderWidth - generalTokens.borderWidth;
|
|
101
|
-
const fullBleedBorderRadius =
|
|
102
|
-
return /*#__PURE__*/(
|
|
93
|
+
const fullBleedBorderRadius = getFullBleedBorderRadius(borderRadius + borderOffset, fullBleedContentPosition);
|
|
94
|
+
return /*#__PURE__*/_jsxs(StackView, {
|
|
103
95
|
direction: contentStackDirection,
|
|
104
96
|
tokens: {
|
|
105
97
|
justifyContent: 'space-between',
|
|
106
98
|
flexGrow: 1
|
|
107
99
|
},
|
|
108
|
-
children: [/*#__PURE__*/(
|
|
100
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
109
101
|
horizontal: {
|
|
110
102
|
xs: 4,
|
|
111
103
|
lg: 5,
|
|
@@ -120,13 +112,13 @@ const StoryCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
120
112
|
subtract: borderOffset
|
|
121
113
|
}
|
|
122
114
|
},
|
|
123
|
-
children: [/*#__PURE__*/(
|
|
115
|
+
children: [/*#__PURE__*/_jsxs(StackWrap, {
|
|
124
116
|
space: 1,
|
|
125
117
|
tokens: {
|
|
126
118
|
justifyContent: 'space-between',
|
|
127
119
|
alignItems: 'baseline'
|
|
128
120
|
},
|
|
129
|
-
children: [Boolean(tag) && /*#__PURE__*/(
|
|
121
|
+
children: [Boolean(tag) && /*#__PURE__*/_jsx(Typography, {
|
|
130
122
|
variant: {
|
|
131
123
|
size: 'eyebrow'
|
|
132
124
|
},
|
|
@@ -135,35 +127,35 @@ const StoryCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
135
127
|
/*#__PURE__*/
|
|
136
128
|
// TODO: get user locale and apply date formatting: "MMM DD, YYYY" for `en` and "YYYY-MM-DD" for `fr`
|
|
137
129
|
// Get locale based on decision of https://github.com/telus/universal-design-system/issues/715
|
|
138
|
-
(
|
|
130
|
+
_jsx(Typography, {
|
|
139
131
|
variant: {
|
|
140
132
|
size: 'small'
|
|
141
133
|
},
|
|
142
134
|
children: date
|
|
143
135
|
})]
|
|
144
|
-
}), /*#__PURE__*/(
|
|
136
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
145
137
|
space: 2
|
|
146
|
-
}), /*#__PURE__*/(
|
|
138
|
+
}), /*#__PURE__*/_jsx(Divider, {
|
|
147
139
|
variant: {
|
|
148
140
|
decorative: true
|
|
149
141
|
}
|
|
150
|
-
}), /*#__PURE__*/(
|
|
142
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
151
143
|
space: 3
|
|
152
|
-
}), /*#__PURE__*/(
|
|
144
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
153
145
|
variant: {
|
|
154
146
|
size: 'h3'
|
|
155
147
|
},
|
|
156
148
|
children: title
|
|
157
|
-
}), /*#__PURE__*/(
|
|
149
|
+
}), /*#__PURE__*/_jsx(Spacer, {
|
|
158
150
|
space: 2
|
|
159
|
-
}), /*#__PURE__*/(
|
|
151
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
160
152
|
children: description
|
|
161
153
|
})]
|
|
162
|
-
}), Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && /*#__PURE__*/(
|
|
154
|
+
}), Boolean(fullBleedContentProps.src || fullBleedContentProps.content) && /*#__PURE__*/_jsx(FullBleedOffsetOuter, {
|
|
163
155
|
borderOffset: borderOffset,
|
|
164
|
-
children: /*#__PURE__*/(
|
|
156
|
+
children: /*#__PURE__*/_jsx(FullBleedOffsetInner, {
|
|
165
157
|
borderOffset: borderOffset,
|
|
166
|
-
children: /*#__PURE__*/(
|
|
158
|
+
children: /*#__PURE__*/_jsx(FullBleedContent, {
|
|
167
159
|
borderRadius: fullBleedBorderRadius,
|
|
168
160
|
...fullBleedContentProps
|
|
169
161
|
})
|
|
@@ -176,7 +168,7 @@ const StoryCard = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
|
|
|
176
168
|
StoryCard.displayName = 'StoryCard';
|
|
177
169
|
StoryCard.propTypes = {
|
|
178
170
|
...selectedSystemPropTypes,
|
|
179
|
-
tokens:
|
|
171
|
+
tokens: getTokensPropType('StoryCard'),
|
|
180
172
|
/**
|
|
181
173
|
* The URL of the story to be navigated to. Note that `Video` component does not play well when used within
|
|
182
174
|
* a `StoryCard` with `href` prop set (the volume and progress sliders can be clicked but are not draggable).
|
|
@@ -184,37 +176,36 @@ StoryCard.propTypes = {
|
|
|
184
176
|
*
|
|
185
177
|
* @see https://github.com/telus/allium-design-system/issues/6
|
|
186
178
|
*/
|
|
187
|
-
href:
|
|
179
|
+
href: PropTypes.string,
|
|
188
180
|
/**
|
|
189
181
|
* Optional function to be called on press e.g. for within-page navigation.
|
|
190
182
|
*/
|
|
191
|
-
onPress:
|
|
183
|
+
onPress: PropTypes.func,
|
|
192
184
|
/**
|
|
193
185
|
* Text stating the category of the content.
|
|
194
186
|
*/
|
|
195
|
-
tag:
|
|
187
|
+
tag: PropTypes.string,
|
|
196
188
|
/**
|
|
197
189
|
* Text stating the date a story was published.
|
|
198
190
|
*/
|
|
199
|
-
date:
|
|
191
|
+
date: PropTypes.string.isRequired,
|
|
200
192
|
/**
|
|
201
193
|
* Text stating the title or headline of the story.
|
|
202
194
|
*/
|
|
203
|
-
title:
|
|
195
|
+
title: PropTypes.string.isRequired,
|
|
204
196
|
/**
|
|
205
197
|
* Text giving a short description of the story. One paragraph of plain text.
|
|
206
198
|
*/
|
|
207
|
-
description:
|
|
199
|
+
description: PropTypes.string.isRequired,
|
|
208
200
|
/**
|
|
209
201
|
* Full bleed image to be placed on the card, deprecated in favor of `fullBleedContent`.
|
|
210
202
|
*
|
|
211
203
|
* @deprecated
|
|
212
204
|
*/
|
|
213
|
-
fullBleedImage:
|
|
205
|
+
fullBleedImage: PropTypes.exact(FullBleedContent.propTypes || {}),
|
|
214
206
|
/**
|
|
215
207
|
* Full bleed image to be placed on the card.
|
|
216
208
|
*/
|
|
217
|
-
fullBleedContent:
|
|
209
|
+
fullBleedContent: PropTypes.exact(FullBleedContent.propTypes || {})
|
|
218
210
|
};
|
|
219
|
-
|
|
220
|
-
exports.default = _default;
|
|
211
|
+
export default withLinkRouter(StoryCard);
|
package/lib/StoryCard/index.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _StoryCard = _interopRequireDefault(require("./StoryCard"));
|
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
var _default = _StoryCard.default;
|
|
10
|
-
exports.default = _default;
|
|
1
|
+
import StoryCard from './StoryCard';
|
|
2
|
+
export default StoryCard;
|
package/lib/Table/Body.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
const Body = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
+
const Body = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
12
5
|
let {
|
|
13
6
|
children
|
|
14
7
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/(
|
|
8
|
+
return /*#__PURE__*/_jsx("tbody", {
|
|
16
9
|
ref: ref,
|
|
17
10
|
children: children
|
|
18
11
|
});
|
|
19
12
|
});
|
|
20
13
|
Body.displayName = 'Body';
|
|
21
14
|
Body.propTypes = {
|
|
22
|
-
children:
|
|
15
|
+
children: PropTypes.node
|
|
23
16
|
};
|
|
24
|
-
|
|
25
|
-
exports.default = _default;
|
|
17
|
+
export default Body;
|
package/lib/Table/Cell.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
10
|
-
var _componentsBase = require("@telus-uds/components-base");
|
|
11
|
-
var _Table = require("./Table");
|
|
12
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Typography, useThemeTokens, applyShadowToken } from '@telus-uds/components-base';
|
|
5
|
+
import { useTableContext } from './Table';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
7
|
const HEADER_TYPE = {
|
|
17
8
|
HEADING: 'heading',
|
|
18
9
|
SUBHEADING: 'subHeading',
|
|
@@ -24,9 +15,9 @@ const stickyStyles = _ref => {
|
|
|
24
15
|
stickyBackgroundColor,
|
|
25
16
|
type
|
|
26
17
|
} = _ref;
|
|
27
|
-
return
|
|
18
|
+
return 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
19
|
};
|
|
29
|
-
const sharedStyles = /*#__PURE__*/
|
|
20
|
+
const sharedStyles = /*#__PURE__*/css(["", ""], _ref2 => {
|
|
30
21
|
let {
|
|
31
22
|
isSticky,
|
|
32
23
|
align,
|
|
@@ -40,13 +31,13 @@ const sharedStyles = /*#__PURE__*/(0, _styledComponents.css)(["", ""], _ref2 =>
|
|
|
40
31
|
stickyBackgroundColor,
|
|
41
32
|
type
|
|
42
33
|
} = _ref2;
|
|
43
|
-
return
|
|
34
|
+
return css(["text-align:", ";min-width:", "px;padding:", "px ", "px ", "px ", "px;background-color:", ";", ";"], align, cellMinWidth, cellPaddingTop, cellPaddingRight, cellPaddingBottom, cellPaddingLeft, cellBackground, isSticky && stickyStyles({
|
|
44
35
|
type,
|
|
45
36
|
cellStickyShadow,
|
|
46
37
|
stickyBackgroundColor
|
|
47
38
|
}));
|
|
48
39
|
});
|
|
49
|
-
const createStyledCell = htmlElement =>
|
|
40
|
+
const createStyledCell = htmlElement => styled[htmlElement].withConfig({
|
|
50
41
|
displayName: "Cell__createStyledCell",
|
|
51
42
|
componentId: "components-web__sc-ltgfic-0"
|
|
52
43
|
})(["", ";box-shadow:", ";", ""], sharedStyles, _ref3 => {
|
|
@@ -65,7 +56,7 @@ const createStyledCell = htmlElement => _styledComponents.default[htmlElement].w
|
|
|
65
56
|
});
|
|
66
57
|
const StyledHeaderCell = createStyledCell('th');
|
|
67
58
|
const StyledDataCell = createStyledCell('td');
|
|
68
|
-
const Cell = /*#__PURE__*/
|
|
59
|
+
const Cell = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
|
69
60
|
let {
|
|
70
61
|
children,
|
|
71
62
|
isFirstInRow,
|
|
@@ -78,7 +69,7 @@ const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
78
69
|
isScrollable: isTableScrollable,
|
|
79
70
|
tokens: tableTokens,
|
|
80
71
|
spacing
|
|
81
|
-
} =
|
|
72
|
+
} = useTableContext();
|
|
82
73
|
const themeTokens = {
|
|
83
74
|
...tableTokens,
|
|
84
75
|
...cellTokens
|
|
@@ -99,7 +90,7 @@ const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
99
90
|
stickyBackgroundColor,
|
|
100
91
|
fontColor,
|
|
101
92
|
display
|
|
102
|
-
} =
|
|
93
|
+
} = useThemeTokens('Table', themeTokens, {
|
|
103
94
|
spacing,
|
|
104
95
|
type,
|
|
105
96
|
text
|
|
@@ -109,7 +100,7 @@ const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
109
100
|
isSticky: isTableScrollable && isFirstInRow,
|
|
110
101
|
cellBackground,
|
|
111
102
|
cellMinWidth,
|
|
112
|
-
cellStickyShadow:
|
|
103
|
+
cellStickyShadow: applyShadowToken(cellStickyShadow).boxShadow,
|
|
113
104
|
cellPaddingTop,
|
|
114
105
|
cellPaddingRight,
|
|
115
106
|
cellPaddingLeft,
|
|
@@ -128,39 +119,39 @@ const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
128
119
|
};
|
|
129
120
|
switch (type) {
|
|
130
121
|
case HEADER_TYPE.HEADING:
|
|
131
|
-
return /*#__PURE__*/(
|
|
122
|
+
return /*#__PURE__*/_jsx(StyledHeaderCell, {
|
|
132
123
|
scope: "col",
|
|
133
124
|
...sharedProps,
|
|
134
125
|
type: type,
|
|
135
|
-
children: /*#__PURE__*/(
|
|
126
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
136
127
|
tokens: typographyTokens,
|
|
137
128
|
children: children
|
|
138
129
|
})
|
|
139
130
|
});
|
|
140
131
|
case HEADER_TYPE.SUBHEADING:
|
|
141
|
-
return /*#__PURE__*/(
|
|
132
|
+
return /*#__PURE__*/_jsx(StyledHeaderCell, {
|
|
142
133
|
scope: "col",
|
|
143
134
|
...sharedProps,
|
|
144
135
|
type: type,
|
|
145
|
-
children: /*#__PURE__*/(
|
|
136
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
146
137
|
tokens: typographyTokens,
|
|
147
138
|
children: children
|
|
148
139
|
})
|
|
149
140
|
});
|
|
150
141
|
case HEADER_TYPE.ROWHEADING:
|
|
151
|
-
return /*#__PURE__*/(
|
|
142
|
+
return /*#__PURE__*/_jsx(StyledHeaderCell, {
|
|
152
143
|
scope: "row",
|
|
153
144
|
...sharedProps,
|
|
154
145
|
type: type,
|
|
155
|
-
children: /*#__PURE__*/(
|
|
146
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
156
147
|
tokens: typographyTokens,
|
|
157
148
|
children: children
|
|
158
149
|
})
|
|
159
150
|
});
|
|
160
151
|
default:
|
|
161
|
-
return /*#__PURE__*/(
|
|
152
|
+
return /*#__PURE__*/_jsx(StyledDataCell, {
|
|
162
153
|
...sharedProps,
|
|
163
|
-
children: /*#__PURE__*/(
|
|
154
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
164
155
|
tokens: typographyTokens,
|
|
165
156
|
children: children
|
|
166
157
|
})
|
|
@@ -169,18 +160,17 @@ const Cell = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
|
|
|
169
160
|
});
|
|
170
161
|
Cell.displayName = 'Cell';
|
|
171
162
|
Cell.propTypes = {
|
|
172
|
-
type:
|
|
173
|
-
tokens:
|
|
174
|
-
children:
|
|
163
|
+
type: PropTypes.oneOf(['default', 'heading', 'subHeading', 'rowHeading']),
|
|
164
|
+
tokens: PropTypes.object,
|
|
165
|
+
children: PropTypes.node,
|
|
175
166
|
/**
|
|
176
167
|
* @ignore
|
|
177
168
|
* Used internally for making the first column sticky
|
|
178
169
|
*/
|
|
179
|
-
isFirstInRow:
|
|
170
|
+
isFirstInRow: PropTypes.bool,
|
|
180
171
|
/**
|
|
181
172
|
* Defines the text alignment within the cell
|
|
182
173
|
*/
|
|
183
|
-
align:
|
|
174
|
+
align: PropTypes.oneOf(['left', 'center', 'right'])
|
|
184
175
|
};
|
|
185
|
-
|
|
186
|
-
exports.default = _default;
|
|
176
|
+
export default Cell;
|
package/lib/Table/Header.js
CHANGED
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const Header = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Row from './Row';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const Header = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
13
6
|
let {
|
|
14
7
|
children
|
|
15
8
|
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(
|
|
9
|
+
return /*#__PURE__*/_jsx("thead", {
|
|
17
10
|
ref: ref,
|
|
18
|
-
children: /*#__PURE__*/(
|
|
19
|
-
children:
|
|
11
|
+
children: /*#__PURE__*/_jsx(Row, {
|
|
12
|
+
children: React.Children.map(children, child =>
|
|
20
13
|
/*#__PURE__*/
|
|
21
14
|
// TO DO: pass type as a variant instead of prop
|
|
22
|
-
|
|
15
|
+
React.cloneElement(child, {
|
|
23
16
|
type: 'heading'
|
|
24
17
|
}))
|
|
25
18
|
})
|
|
@@ -27,7 +20,6 @@ const Header = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
|
27
20
|
});
|
|
28
21
|
Header.displayName = 'Header';
|
|
29
22
|
Header.propTypes = {
|
|
30
|
-
children:
|
|
23
|
+
children: PropTypes.node
|
|
31
24
|
};
|
|
32
|
-
|
|
33
|
-
exports.default = _default;
|
|
25
|
+
export default Header;
|
package/lib/Table/Row.js
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
const Row = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
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) => {
|
|
12
5
|
let {
|
|
13
6
|
children
|
|
14
7
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/(
|
|
8
|
+
return /*#__PURE__*/_jsx("tr", {
|
|
16
9
|
ref: ref,
|
|
17
|
-
children:
|
|
10
|
+
children: React.Children.map(children, (child, index) => /*#__PURE__*/React.cloneElement(child, {
|
|
18
11
|
isFirstInRow: index === 0
|
|
19
12
|
}))
|
|
20
13
|
});
|
|
21
14
|
});
|
|
22
15
|
Row.displayName = 'Row';
|
|
23
16
|
Row.propTypes = {
|
|
24
|
-
children:
|
|
17
|
+
children: PropTypes.node
|
|
25
18
|
};
|
|
26
|
-
|
|
27
|
-
exports.default = _default;
|
|
19
|
+
export default Row;
|
package/lib/Table/SubHeading.js
CHANGED
|
@@ -1,31 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
const Header = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Row from './Row';
|
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const Header = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
13
6
|
let {
|
|
14
7
|
children
|
|
15
8
|
} = _ref;
|
|
16
|
-
return /*#__PURE__*/(
|
|
9
|
+
return /*#__PURE__*/_jsx(Row, {
|
|
17
10
|
ref: ref,
|
|
18
|
-
children:
|
|
11
|
+
children: React.Children.map(children, child =>
|
|
19
12
|
/*#__PURE__*/
|
|
20
13
|
// TO DO: pass type as a variant instead of prop
|
|
21
|
-
|
|
14
|
+
React.cloneElement(child, {
|
|
22
15
|
type: 'subHeading'
|
|
23
16
|
}))
|
|
24
17
|
});
|
|
25
18
|
});
|
|
26
19
|
Header.displayName = 'Header';
|
|
27
20
|
Header.propTypes = {
|
|
28
|
-
children:
|
|
21
|
+
children: PropTypes.node
|
|
29
22
|
};
|
|
30
|
-
|
|
31
|
-
exports.default = _default;
|
|
23
|
+
export default Header;
|