@telus-uds/components-web 3.2.0 → 3.2.1
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/CHANGELOG.md +14 -2
- package/lib/Badge/Badge.js +19 -11
- package/lib/BlockQuote/BlockQuote.js +31 -17
- package/lib/Breadcrumbs/Breadcrumbs.js +23 -17
- package/lib/Breadcrumbs/Item/Item.js +6 -10
- package/lib/Callout/Callout.js +5 -6
- package/lib/Card/Card.js +5 -5
- package/lib/Card/CardContent.js +5 -6
- package/lib/Card/CardFooter.js +5 -6
- package/lib/Countdown/Countdown.js +5 -6
- package/lib/Countdown/Segment.js +6 -6
- package/lib/DatePicker/CalendarContainer.js +5 -5
- package/lib/DatePicker/DatePicker.js +12 -18
- package/lib/DatePicker/reactDatesCss.js +829 -2
- package/lib/Disclaimer/Disclaimer.js +5 -6
- package/lib/Footnote/Footnote.js +15 -39
- package/lib/Footnote/FootnoteLink.js +5 -6
- package/lib/NavigationBar/NavigationBar.js +5 -6
- package/lib/NavigationBar/NavigationItem.js +5 -6
- package/lib/OrderedList/Item.js +7 -11
- package/lib/OrderedList/ItemBase.js +5 -5
- package/lib/OrderedList/OrderedList.js +5 -6
- package/lib/OrderedList/OrderedListBase.js +5 -5
- package/lib/Paragraph/Paragraph.js +16 -8
- package/lib/PreviewCard/PreviewCard.js +7 -10
- package/lib/PriceLockup/PriceLockup.js +64 -54
- package/lib/Progress/ProgressBar.js +6 -6
- package/lib/QuantitySelector/styles.js +18 -9
- package/lib/Ribbon/Ribbon.js +57 -31
- package/lib/Span/Span.js +6 -7
- package/lib/Spinner/Spinner.js +8 -18
- package/lib/Spinner/SpinnerContent.js +5 -6
- package/lib/StoryCard/StoryCard.js +7 -10
- package/lib/Table/Cell.js +43 -12
- package/lib/Table/Table.js +15 -11
- package/lib/TermsAndConditions/ExpandCollapse.js +7 -13
- package/lib/TermsAndConditions/TermsAndConditions.js +9 -22
- package/lib/Testimonial/Testimonial.js +10 -26
- package/lib/Toast/Toast.js +64 -13
- package/lib/Video/ControlBar/ControlBar.js +8 -18
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +5 -6
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +7 -14
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +7 -14
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +6 -10
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +5 -6
- package/lib/Video/Video.js +10 -26
- package/lib/VideoPicker/VideoPicker.js +44 -20
- package/lib/VideoPicker/VideoPickerThumbnail.js +52 -18
- package/lib/WaffleGrid/WaffleGrid.js +7 -14
- package/lib/WebVideo/WebVideo.js +9 -14
- package/lib/index.js +1 -1
- package/lib/shared/FullBleedContent/FullBleedContent.js +5 -5
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +6 -9
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +8 -17
- package/lib/shared/VideoSplash/VideoSplash.js +5 -6
- package/lib/utils/index.js +2 -1
- package/lib/utils/ssr.js +4 -1
- package/lib/utils/theming/styled-components.js +26 -0
- package/package.json +3 -3
- package/src/Badge/Badge.jsx +3 -2
- package/src/BlockQuote/BlockQuote.jsx +3 -2
- package/src/Breadcrumbs/Breadcrumbs.jsx +23 -13
- package/src/Breadcrumbs/Item/Item.jsx +3 -2
- package/src/Callout/Callout.jsx +3 -2
- package/src/Card/Card.jsx +3 -1
- package/src/Card/CardContent.jsx +3 -2
- package/src/Card/CardFooter.jsx +3 -2
- package/src/Countdown/Countdown.jsx +3 -2
- package/src/Countdown/Segment.jsx +3 -1
- package/src/DatePicker/CalendarContainer.jsx +3 -1
- package/src/DatePicker/DatePicker.jsx +3 -2
- package/src/DatePicker/reactDatesCss.js +3 -1
- package/src/Disclaimer/Disclaimer.jsx +3 -2
- package/src/Footnote/Footnote.jsx +9 -2
- package/src/Footnote/FootnoteLink.jsx +3 -2
- package/src/NavigationBar/NavigationBar.jsx +3 -2
- package/src/NavigationBar/NavigationItem.jsx +3 -2
- package/src/OrderedList/Item.jsx +4 -3
- package/src/OrderedList/ItemBase.jsx +3 -1
- package/src/OrderedList/OrderedList.jsx +3 -2
- package/src/OrderedList/OrderedListBase.jsx +3 -1
- package/src/Paragraph/Paragraph.jsx +3 -2
- package/src/PreviewCard/PreviewCard.jsx +3 -1
- package/src/PriceLockup/PriceLockup.jsx +3 -2
- package/src/Progress/ProgressBar.jsx +3 -1
- package/src/QuantitySelector/styles.js +3 -1
- package/src/Ribbon/Ribbon.jsx +3 -2
- package/src/Span/Span.jsx +3 -2
- package/src/Spinner/Spinner.jsx +3 -2
- package/src/Spinner/SpinnerContent.jsx +3 -2
- package/src/StoryCard/StoryCard.jsx +3 -1
- package/src/Table/Cell.jsx +3 -1
- package/src/Table/Table.jsx +3 -2
- package/src/TermsAndConditions/ExpandCollapse.jsx +3 -1
- package/src/TermsAndConditions/TermsAndConditions.jsx +3 -2
- package/src/Testimonial/Testimonial.jsx +3 -2
- package/src/Toast/Toast.jsx +3 -2
- package/src/Video/ControlBar/ControlBar.jsx +3 -3
- package/src/Video/ControlBar/Controls/VideoButton/VideoButton.jsx +4 -3
- package/src/Video/ControlBar/Controls/VideoMenu/VideoMenu.jsx +3 -3
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +3 -3
- package/src/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.jsx +3 -3
- package/src/Video/MiddleControlButton/MiddleControlButton.jsx +4 -3
- package/src/Video/Video.jsx +3 -2
- package/src/VideoPicker/VideoPicker.jsx +3 -2
- package/src/VideoPicker/VideoPickerThumbnail.jsx +3 -1
- package/src/WaffleGrid/WaffleGrid.jsx +3 -2
- package/src/WebVideo/WebVideo.jsx +4 -3
- package/src/index.js +1 -1
- package/src/shared/FullBleedContent/FullBleedContent.jsx +3 -2
- package/src/shared/VideoSplash/SplashButton/SplashButton.jsx +3 -1
- package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +4 -2
- package/src/shared/VideoSplash/VideoSplash.jsx +3 -2
- package/src/utils/index.js +3 -1
- package/src/utils/ssr.js +2 -1
- package/src/utils/theming/styled-components.js +23 -0
package/lib/Ribbon/Ribbon.js
CHANGED
|
@@ -1,109 +1,135 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { selectSystemProps, Typography, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const {
|
|
7
|
+
styled
|
|
8
|
+
} = styledComponents;
|
|
7
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const RibbonWrapper =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})(["width:fit-content;position:", ";z-index:1;left:", ";top:", ";"], _ref => {
|
|
10
|
+
const RibbonWrapper = styled.div`
|
|
11
|
+
width: fit-content;
|
|
12
|
+
position: ${_ref => {
|
|
12
13
|
let {
|
|
13
14
|
left,
|
|
14
15
|
top
|
|
15
16
|
} = _ref;
|
|
16
17
|
return left ?? top ? 'absolute' : 'relative';
|
|
17
|
-
}
|
|
18
|
+
}};
|
|
19
|
+
z-index: 1;
|
|
20
|
+
left: ${_ref2 => {
|
|
18
21
|
let {
|
|
19
22
|
left
|
|
20
23
|
} = _ref2;
|
|
21
24
|
return left && `${left}px`;
|
|
22
|
-
}
|
|
25
|
+
}};
|
|
26
|
+
top: ${_ref3 => {
|
|
23
27
|
let {
|
|
24
28
|
top
|
|
25
29
|
} = _ref3;
|
|
26
30
|
return top && `${top}px`;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
}};
|
|
32
|
+
`;
|
|
33
|
+
const RibbonContainer = styled.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
background: ${_ref4 => {
|
|
32
37
|
let {
|
|
33
38
|
backgroundColor
|
|
34
39
|
} = _ref4;
|
|
35
40
|
return backgroundColor;
|
|
36
|
-
}
|
|
41
|
+
}};
|
|
42
|
+
padding: ${_ref5 => {
|
|
37
43
|
let {
|
|
38
44
|
padding
|
|
39
45
|
} = _ref5;
|
|
40
46
|
return `${padding}`;
|
|
41
|
-
}
|
|
47
|
+
}};
|
|
48
|
+
border-radius: ${_ref6 => {
|
|
42
49
|
let {
|
|
43
50
|
borderRadius
|
|
44
51
|
} = _ref6;
|
|
45
52
|
return borderRadius;
|
|
46
|
-
}
|
|
53
|
+
}};
|
|
54
|
+
width: fit-content;
|
|
55
|
+
box-shadow: ${_ref7 => {
|
|
47
56
|
let {
|
|
48
57
|
boxShadow,
|
|
49
58
|
shouldWrap
|
|
50
59
|
} = _ref7;
|
|
51
60
|
return shouldWrap && boxShadow;
|
|
52
|
-
}
|
|
61
|
+
}};
|
|
62
|
+
border-bottom-right-radius: ${_ref8 => {
|
|
53
63
|
let {
|
|
54
64
|
borderRadiusBottomLeft
|
|
55
65
|
} = _ref8;
|
|
56
66
|
return borderRadiusBottomLeft;
|
|
57
|
-
}
|
|
67
|
+
}};
|
|
68
|
+
border-bottom-left-radius: ${_ref9 => {
|
|
58
69
|
let {
|
|
59
70
|
borderRadiusBottomRight
|
|
60
71
|
} = _ref9;
|
|
61
72
|
return borderRadiusBottomRight;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})(["background:", ";width:", ";height:", ";margin-top:-", ";border-radius:0 0 0 100%;position:relative;z-index:-1;overflow:hidden;&::after{content:'';border-bottom-left-radius:", ";position:absolute;height:", ";background:", ";width:", ";}"], _ref10 => {
|
|
73
|
+
}};
|
|
74
|
+
`;
|
|
75
|
+
const RibbonCurve = styled.div`
|
|
76
|
+
background: ${_ref10 => {
|
|
67
77
|
let {
|
|
68
78
|
curveBackgroundColor
|
|
69
79
|
} = _ref10;
|
|
70
80
|
return curveBackgroundColor;
|
|
71
|
-
}
|
|
81
|
+
}};
|
|
82
|
+
width: ${_ref11 => {
|
|
72
83
|
let {
|
|
73
84
|
curveWidth
|
|
74
85
|
} = _ref11;
|
|
75
86
|
return curveWidth;
|
|
76
|
-
}
|
|
87
|
+
}};
|
|
88
|
+
height: ${_ref12 => {
|
|
77
89
|
let {
|
|
78
90
|
curveHeight
|
|
79
91
|
} = _ref12;
|
|
80
92
|
return curveHeight;
|
|
81
|
-
}
|
|
93
|
+
}};
|
|
94
|
+
margin-top: -${_ref13 => {
|
|
82
95
|
let {
|
|
83
96
|
curveMarginTop
|
|
84
97
|
} = _ref13;
|
|
85
98
|
return curveMarginTop;
|
|
86
|
-
}
|
|
99
|
+
}};
|
|
100
|
+
border-radius: 0 0 0 100%;
|
|
101
|
+
position: relative;
|
|
102
|
+
z-index: -1;
|
|
103
|
+
overflow: hidden;
|
|
104
|
+
&::after {
|
|
105
|
+
content: '';
|
|
106
|
+
border-bottom-left-radius: ${_ref14 => {
|
|
87
107
|
let {
|
|
88
108
|
curveAfterRadius
|
|
89
109
|
} = _ref14;
|
|
90
110
|
return curveAfterRadius;
|
|
91
|
-
}
|
|
111
|
+
}};
|
|
112
|
+
position: absolute;
|
|
113
|
+
height: ${_ref15 => {
|
|
92
114
|
let {
|
|
93
115
|
curveAfterHeight
|
|
94
116
|
} = _ref15;
|
|
95
117
|
return curveAfterHeight;
|
|
96
|
-
}
|
|
118
|
+
}};
|
|
119
|
+
background: ${_ref16 => {
|
|
97
120
|
let {
|
|
98
121
|
curveAfterBackgroundColor
|
|
99
122
|
} = _ref16;
|
|
100
123
|
return curveAfterBackgroundColor;
|
|
101
|
-
}
|
|
124
|
+
}};
|
|
125
|
+
width: ${_ref17 => {
|
|
102
126
|
let {
|
|
103
127
|
curveAfterWidth
|
|
104
128
|
} = _ref17;
|
|
105
129
|
return curveAfterWidth;
|
|
106
|
-
}
|
|
130
|
+
}};
|
|
131
|
+
}
|
|
132
|
+
`;
|
|
107
133
|
const Ribbon = /*#__PURE__*/React.forwardRef((_ref18, ref) => {
|
|
108
134
|
let {
|
|
109
135
|
children,
|
package/lib/Span/Span.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { getTokensPropType, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs, useTypographyTheme } from '../utils';
|
|
4
|
+
import { htmlAttrs, useTypographyTheme, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const {
|
|
7
|
+
styled
|
|
8
|
+
} = styledComponents;
|
|
7
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const StyledSpan =
|
|
9
|
-
displayName: "Span__StyledSpan",
|
|
10
|
-
componentId: "components-web__sc-o7sihn-0"
|
|
11
|
-
})(["", "};"], _ref => {
|
|
10
|
+
const StyledSpan = styled.span`${_ref => {
|
|
12
11
|
let {
|
|
13
12
|
flex
|
|
14
13
|
} = _ref;
|
|
15
14
|
return flex ? 'display: inline-flex' : '';
|
|
16
|
-
}
|
|
15
|
+
}}};`;
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
18
|
* Text as an HTML ```<span>``` element.
|
package/lib/Spinner/Spinner.js
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { selectSystemProps, useScrollBlocking, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
5
4
|
import { Portal } from '@gorhom/portal';
|
|
6
5
|
import SpinnerContent from './SpinnerContent';
|
|
7
|
-
import { htmlAttrs, media } from '../utils';
|
|
6
|
+
import { htmlAttrs, media, styledComponents } from '../utils';
|
|
8
7
|
import { BACKDROP_OPACITY, BACKDROP_Z_INDEX } from './constants';
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const {
|
|
10
|
+
styled
|
|
11
|
+
} = styledComponents;
|
|
10
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const SpinnerContainer =
|
|
12
|
-
displayName: "Spinner__SpinnerContainer",
|
|
13
|
-
componentId: "components-web__sc-116rqck-0"
|
|
14
|
-
})(_ref => {
|
|
13
|
+
const SpinnerContainer = styled.div(_ref => {
|
|
15
14
|
let {
|
|
16
15
|
inline,
|
|
17
16
|
fullScreen
|
|
@@ -30,19 +29,13 @@ const SpinnerContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
30
29
|
})
|
|
31
30
|
};
|
|
32
31
|
});
|
|
33
|
-
const ContentOverlay =
|
|
34
|
-
displayName: "Spinner__ContentOverlay",
|
|
35
|
-
componentId: "components-web__sc-116rqck-1"
|
|
36
|
-
})({
|
|
32
|
+
const ContentOverlay = styled.div({
|
|
37
33
|
position: 'absolute',
|
|
38
34
|
width: '100%',
|
|
39
35
|
height: '100%',
|
|
40
36
|
zIndex: BACKDROP_Z_INDEX
|
|
41
37
|
});
|
|
42
|
-
const FullscreenOverlay =
|
|
43
|
-
displayName: "Spinner__FullscreenOverlay",
|
|
44
|
-
componentId: "components-web__sc-116rqck-2"
|
|
45
|
-
})(_ref2 => {
|
|
38
|
+
const FullscreenOverlay = styled.div(_ref2 => {
|
|
46
39
|
let {
|
|
47
40
|
fullScreenOverLayBackground
|
|
48
41
|
} = _ref2;
|
|
@@ -56,10 +49,7 @@ const FullscreenOverlay = /*#__PURE__*/styled.div.withConfig({
|
|
|
56
49
|
backgroundColor: fullScreenOverLayBackground
|
|
57
50
|
};
|
|
58
51
|
});
|
|
59
|
-
const OpaqueContainer =
|
|
60
|
-
displayName: "Spinner__OpaqueContainer",
|
|
61
|
-
componentId: "components-web__sc-116rqck-3"
|
|
62
|
-
})({
|
|
52
|
+
const OpaqueContainer = styled.div({
|
|
63
53
|
opacity: BACKDROP_OPACITY
|
|
64
54
|
});
|
|
65
55
|
const recursiveMap = (children, fn) => React.Children.map(children, child => {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { ActivityIndicator, StackView, Typography, selectSystemProps } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
6
5
|
import { BACKDROP_Z_INDEX, LARGE } from './constants';
|
|
7
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
8
10
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
-
const Container =
|
|
10
|
-
displayName: "SpinnerContent__Container",
|
|
11
|
-
componentId: "components-web__sc-1c8bd8e-0"
|
|
12
|
-
})(_ref => {
|
|
11
|
+
const Container = styled.div(_ref => {
|
|
13
12
|
let {
|
|
14
13
|
overlay
|
|
15
14
|
} = _ref;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
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
|
|
4
|
+
import { styledComponents } from '../utils';
|
|
5
5
|
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
6
10
|
|
|
7
11
|
// Passes React Native-oriented system props through UDS PressableCardBase
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, focusHandlerProps, viewProps]);
|
|
10
13
|
|
|
11
14
|
// Stop changes to the card's inner border width causing the size and
|
|
12
15
|
// apparent position of the full bleed image to change.
|
|
13
|
-
const FullBleedOffsetOuter =
|
|
14
|
-
displayName: "StoryCard__FullBleedOffsetOuter",
|
|
15
|
-
componentId: "components-web__sc-yhvivu-0"
|
|
16
|
-
})(_ref => {
|
|
16
|
+
const FullBleedOffsetOuter = styled.div(_ref => {
|
|
17
17
|
let {
|
|
18
18
|
borderOffset
|
|
19
19
|
} = _ref;
|
|
@@ -22,10 +22,7 @@ const FullBleedOffsetOuter = /*#__PURE__*/styled.div.withConfig({
|
|
|
22
22
|
marginTop: borderOffset * 2
|
|
23
23
|
};
|
|
24
24
|
});
|
|
25
|
-
const FullBleedOffsetInner =
|
|
26
|
-
displayName: "StoryCard__FullBleedOffsetInner",
|
|
27
|
-
componentId: "components-web__sc-yhvivu-1"
|
|
28
|
-
})(_ref2 => {
|
|
25
|
+
const FullBleedOffsetInner = styled.div(_ref2 => {
|
|
29
26
|
let {
|
|
30
27
|
borderOffset
|
|
31
28
|
} = _ref2;
|
package/lib/Table/Cell.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
3
|
import { Typography, useThemeTokens, applyShadowToken } from '@telus-uds/components-base';
|
|
4
|
+
import { styledComponents } from '../utils';
|
|
5
5
|
import { useTableContext } from './Table';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
styled,
|
|
9
|
+
css
|
|
10
|
+
} = styledComponents;
|
|
7
11
|
const HEADER_TYPE = {
|
|
8
12
|
HEADING: 'heading',
|
|
9
13
|
SUBHEADING: 'subHeading',
|
|
@@ -15,9 +19,28 @@ const stickyStyles = _ref => {
|
|
|
15
19
|
stickyBackgroundColor,
|
|
16
20
|
type
|
|
17
21
|
} = _ref;
|
|
18
|
-
return css
|
|
22
|
+
return css`
|
|
23
|
+
position: sticky;
|
|
24
|
+
left: 0; // needed for sticky to work
|
|
25
|
+
z-index: 2;
|
|
26
|
+
clip-path: inset(0 -8px 0 0); // use clip path to cut off the shadow rendered below
|
|
27
|
+
// Override default cell background with stickyBackgroundColor with an exception to subheading and heading
|
|
28
|
+
${type !== HEADER_TYPE.SUBHEADING && type !== HEADER_TYPE.HEADING ? `background-color: ${stickyBackgroundColor};` : undefined}
|
|
29
|
+
&::before {
|
|
30
|
+
// use a pseudo element for the sticky shadow, since we already use shadows for inner cells border
|
|
31
|
+
content: '';
|
|
32
|
+
box-shadow: ${cellStickyShadow};
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0;
|
|
35
|
+
left: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
bottom: 0;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
19
41
|
};
|
|
20
|
-
const sharedStyles =
|
|
42
|
+
const sharedStyles = css`
|
|
43
|
+
${_ref2 => {
|
|
21
44
|
let {
|
|
22
45
|
isSticky,
|
|
23
46
|
align,
|
|
@@ -31,29 +54,37 @@ const sharedStyles = /*#__PURE__*/css(["", ""], _ref2 => {
|
|
|
31
54
|
stickyBackgroundColor,
|
|
32
55
|
type
|
|
33
56
|
} = _ref2;
|
|
34
|
-
return css
|
|
57
|
+
return css`
|
|
58
|
+
text-align: ${align};
|
|
59
|
+
min-width: ${cellMinWidth}px;
|
|
60
|
+
padding: ${cellPaddingTop}px ${cellPaddingRight}px ${cellPaddingBottom}px ${cellPaddingLeft}px;
|
|
61
|
+
background-color: ${cellBackground};
|
|
62
|
+
${isSticky && stickyStyles({
|
|
35
63
|
type,
|
|
36
64
|
cellStickyShadow,
|
|
37
65
|
stickyBackgroundColor
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
66
|
+
})};
|
|
67
|
+
`;
|
|
68
|
+
}}
|
|
69
|
+
`;
|
|
70
|
+
const createStyledCell = htmlElement => styled[htmlElement]`
|
|
71
|
+
${sharedStyles};
|
|
72
|
+
box-shadow: ${_ref3 => {
|
|
44
73
|
let {
|
|
45
74
|
cellBoxShadowColor,
|
|
46
75
|
type
|
|
47
76
|
} = _ref3;
|
|
48
77
|
return type === HEADER_TYPE.HEADING ? `inset 0 1px 0 ${cellBoxShadowColor}, inset 0 -1px 0 ${cellBoxShadowColor}` : `inset 0 1px 0 ${cellBoxShadowColor}`;
|
|
49
|
-
}
|
|
78
|
+
}};
|
|
79
|
+
${_ref4 => {
|
|
50
80
|
let {
|
|
51
81
|
display
|
|
52
82
|
} = _ref4;
|
|
53
83
|
return display && `*:not(:empty) {
|
|
54
84
|
display: ${display};
|
|
55
85
|
}`;
|
|
56
|
-
}
|
|
86
|
+
}}
|
|
87
|
+
`;
|
|
57
88
|
const StyledHeaderCell = createStyledCell('th');
|
|
58
89
|
const StyledDataCell = createStyledCell('td');
|
|
59
90
|
const Cell = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
|
package/lib/Table/Table.js
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { selectSystemProps, useSafeLayoutEffect, useThemeTokens, getTokensPropType } from '@telus-uds/components-base';
|
|
5
4
|
import throttle from 'lodash.throttle';
|
|
6
|
-
import { htmlAttrs } from '../utils';
|
|
5
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
8
10
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
-
const StyledContainer =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const StyledTable =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const StyledContainer = styled.div`
|
|
12
|
+
overflow: auto;
|
|
13
|
+
padding-bottom: ${props => props.isScrollable ? `${props.tablePaddingBottom}px` : 0};
|
|
14
|
+
`;
|
|
15
|
+
const StyledTable = styled.table`
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
width: ${_ref => {
|
|
17
19
|
let {
|
|
18
20
|
fullWidth,
|
|
19
21
|
tableWidth
|
|
20
22
|
} = _ref;
|
|
21
23
|
return fullWidth ? '100%' : `${tableWidth}px`;
|
|
22
|
-
}
|
|
24
|
+
}};
|
|
25
|
+
border: ${props => `${props.borderWidth}px solid ${props.borderColor}`};
|
|
26
|
+
`;
|
|
23
27
|
const TableContext = /*#__PURE__*/React.createContext({});
|
|
24
28
|
export const useTableContext = () => React.useContext(TableContext);
|
|
25
29
|
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import { styledComponents } from '../utils';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const {
|
|
7
|
+
styled
|
|
8
|
+
} = styledComponents;
|
|
9
|
+
const ExpandCollapseControl = styled.div({
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
cursor: 'pointer',
|
|
12
12
|
display: 'flex',
|
|
13
13
|
flex: 1,
|
|
14
14
|
justifyContent: 'flex-start'
|
|
15
15
|
});
|
|
16
|
-
const ExpandCollapseIconContainer =
|
|
17
|
-
displayName: "ExpandCollapse__ExpandCollapseIconContainer",
|
|
18
|
-
componentId: "components-web__sc-1l2mmq7-1"
|
|
19
|
-
})(_ref => {
|
|
16
|
+
const ExpandCollapseIconContainer = styled.div(_ref => {
|
|
20
17
|
let {
|
|
21
18
|
tokens
|
|
22
19
|
} = _ref;
|
|
@@ -28,10 +25,7 @@ const ExpandCollapseIconContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
28
25
|
width: tokens.expandIconContainerWidth
|
|
29
26
|
};
|
|
30
27
|
});
|
|
31
|
-
const ExpandCollapseTitle =
|
|
32
|
-
displayName: "ExpandCollapse__ExpandCollapseTitle",
|
|
33
|
-
componentId: "components-web__sc-1l2mmq7-2"
|
|
34
|
-
})(_ref2 => {
|
|
28
|
+
const ExpandCollapseTitle = styled.h4(_ref2 => {
|
|
35
29
|
let {
|
|
36
30
|
tokens
|
|
37
31
|
} = _ref2;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport, getTokensPropType, useTheme, useResponsiveThemeTokens, createMediaQueryStyles, StyleSheet } from '@telus-uds/components-base';
|
|
5
4
|
import ExpandCollapse from './ExpandCollapse';
|
|
6
5
|
import OrderedListBase from '../OrderedList/OrderedListBase';
|
|
7
|
-
import { htmlAttrs, media, renderStructuredContent } from '../utils';
|
|
6
|
+
import { htmlAttrs, media, renderStructuredContent, styledComponents } from '../utils';
|
|
8
7
|
import defaultDictionary from './dictionary';
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const {
|
|
10
|
+
styled
|
|
11
|
+
} = styledComponents;
|
|
10
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const ContentContainer =
|
|
12
|
-
displayName: "TermsAndConditions__ContentContainer",
|
|
13
|
-
componentId: "components-web__sc-1199epn-0"
|
|
14
|
-
})(_ref => {
|
|
13
|
+
const ContentContainer = styled.div(_ref => {
|
|
15
14
|
let {
|
|
16
15
|
tokens
|
|
17
16
|
} = _ref;
|
|
@@ -24,10 +23,7 @@ const ContentContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
24
23
|
})
|
|
25
24
|
};
|
|
26
25
|
});
|
|
27
|
-
const Ordered =
|
|
28
|
-
displayName: "TermsAndConditions__Ordered",
|
|
29
|
-
componentId: "components-web__sc-1199epn-1"
|
|
30
|
-
})(_ref2 => {
|
|
26
|
+
const Ordered = styled(OrderedListBase)(_ref2 => {
|
|
31
27
|
let {
|
|
32
28
|
tokens
|
|
33
29
|
} = _ref2;
|
|
@@ -36,10 +32,7 @@ const Ordered = /*#__PURE__*/styled(OrderedListBase).withConfig({
|
|
|
36
32
|
padding: tokens.orderedPadding
|
|
37
33
|
};
|
|
38
34
|
});
|
|
39
|
-
const Unordered =
|
|
40
|
-
displayName: "TermsAndConditions__Unordered",
|
|
41
|
-
componentId: "components-web__sc-1199epn-2"
|
|
42
|
-
})(_ref3 => {
|
|
35
|
+
const Unordered = styled.ul(_ref3 => {
|
|
43
36
|
let {
|
|
44
37
|
tokens
|
|
45
38
|
} = _ref3;
|
|
@@ -50,10 +43,7 @@ const Unordered = /*#__PURE__*/styled.ul.withConfig({
|
|
|
50
43
|
paddingTop: tokens.unorderedPadding
|
|
51
44
|
};
|
|
52
45
|
});
|
|
53
|
-
const ListItem =
|
|
54
|
-
displayName: "TermsAndConditions__ListItem",
|
|
55
|
-
componentId: "components-web__sc-1199epn-3"
|
|
56
|
-
})(_ref4 => {
|
|
46
|
+
const ListItem = styled(OrderedListBase.Item)(_ref4 => {
|
|
57
47
|
let {
|
|
58
48
|
tokens
|
|
59
49
|
} = _ref4;
|
|
@@ -74,10 +64,7 @@ const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
|
|
|
74
64
|
wordBreak: 'break-word'
|
|
75
65
|
};
|
|
76
66
|
});
|
|
77
|
-
const NonIndexedContentTitle =
|
|
78
|
-
displayName: "TermsAndConditions__NonIndexedContentTitle",
|
|
79
|
-
componentId: "components-web__sc-1199epn-4"
|
|
80
|
-
})(_ref5 => {
|
|
67
|
+
const NonIndexedContentTitle = styled.div(_ref5 => {
|
|
81
68
|
let {
|
|
82
69
|
tokens
|
|
83
70
|
} = _ref5;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { Icon, selectSystemProps, Typography, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
5
4
|
import Image from '../Image';
|
|
6
|
-
import { htmlAttrs } from '../utils';
|
|
5
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
7
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
8
10
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
9
|
-
const TestimonialContainer =
|
|
10
|
-
displayName: "Testimonial__TestimonialContainer",
|
|
11
|
-
componentId: "components-web__sc-1az53gr-0"
|
|
12
|
-
})(_ref => {
|
|
11
|
+
const TestimonialContainer = styled.figure(_ref => {
|
|
13
12
|
let {
|
|
14
13
|
testimonialContainerGap
|
|
15
14
|
} = _ref;
|
|
@@ -20,10 +19,7 @@ const TestimonialContainer = /*#__PURE__*/styled.figure.withConfig({
|
|
|
20
19
|
margin: 0
|
|
21
20
|
};
|
|
22
21
|
});
|
|
23
|
-
const QuoteContainer =
|
|
24
|
-
displayName: "Testimonial__QuoteContainer",
|
|
25
|
-
componentId: "components-web__sc-1az53gr-1"
|
|
26
|
-
})(_ref2 => {
|
|
22
|
+
const QuoteContainer = styled.div(_ref2 => {
|
|
27
23
|
let {
|
|
28
24
|
quoteContainerGap
|
|
29
25
|
} = _ref2;
|
|
@@ -33,10 +29,7 @@ const QuoteContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
33
29
|
gap: quoteContainerGap
|
|
34
30
|
};
|
|
35
31
|
});
|
|
36
|
-
const Divider =
|
|
37
|
-
displayName: "Testimonial__Divider",
|
|
38
|
-
componentId: "components-web__sc-1az53gr-2"
|
|
39
|
-
})(_ref3 => {
|
|
32
|
+
const Divider = styled.div(_ref3 => {
|
|
40
33
|
let {
|
|
41
34
|
dividerBorder,
|
|
42
35
|
dividerBackgroundColor
|
|
@@ -47,23 +40,14 @@ const Divider = /*#__PURE__*/styled.div.withConfig({
|
|
|
47
40
|
width: '100%'
|
|
48
41
|
};
|
|
49
42
|
});
|
|
50
|
-
const BlockQuote =
|
|
51
|
-
displayName: "Testimonial__BlockQuote",
|
|
52
|
-
componentId: "components-web__sc-1az53gr-3"
|
|
53
|
-
})({
|
|
43
|
+
const BlockQuote = styled.blockquote({
|
|
54
44
|
margin: 0
|
|
55
45
|
});
|
|
56
|
-
const AuthorInfoContainer =
|
|
57
|
-
displayName: "Testimonial__AuthorInfoContainer",
|
|
58
|
-
componentId: "components-web__sc-1az53gr-4"
|
|
59
|
-
})({
|
|
46
|
+
const AuthorInfoContainer = styled.div({
|
|
60
47
|
display: 'flex',
|
|
61
48
|
flexDirection: 'column'
|
|
62
49
|
});
|
|
63
|
-
const Figcaption =
|
|
64
|
-
displayName: "Testimonial__Figcaption",
|
|
65
|
-
componentId: "components-web__sc-1az53gr-5"
|
|
66
|
-
})(_ref4 => {
|
|
50
|
+
const Figcaption = styled.figcaption(_ref4 => {
|
|
67
51
|
let {
|
|
68
52
|
figcaptionGap
|
|
69
53
|
} = _ref4;
|