@telus-uds/components-web 3.2.0 → 3.3.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/CHANGELOG.md +31 -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 +26 -28
- 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 +90 -64
- package/lib/PriceLockup/tokens.js +6 -2
- 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 +22 -13
- 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 +15 -4
- package/src/PriceLockup/tokens.js +15 -3
- 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/types/common.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This log was last generated on Fri, 10 Jan 2025 21:41:25 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.3.0
|
|
8
|
+
|
|
9
|
+
Fri, 10 Jan 2025 21:41:25 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- "Search: iconLeftGap value added in the testTheme file for TextInput in Search" (35577399+JoshHC@users.noreply.github.com)
|
|
14
|
+
- `Docs`: fixed camelcase and hardcoded path for components (kristina.kirpichnikova@telus.com)
|
|
15
|
+
- `DatePicker`: update component to enable custom date formats (eduardo.pereira1@telus.com)
|
|
16
|
+
- `PriceLockup`: new tokens `centsPaddingTop` and `currencySymbolPaddingTop` added to the component to match with Koodo design in the micro variant (35577399+JoshHC@users.noreply.github.com)
|
|
17
|
+
- Bump @telus-uds/components-base to v2.4.0
|
|
18
|
+
- Bump @telus-uds/system-theme-tokens to v3.3.0
|
|
19
|
+
|
|
20
|
+
### Patches
|
|
21
|
+
|
|
22
|
+
- "`DatePicker`: calendar position issue rendered incorrectly fixed" (35577399+JoshHC@users.noreply.github.com)
|
|
23
|
+
|
|
24
|
+
## 3.2.1
|
|
25
|
+
|
|
26
|
+
Thu, 19 Dec 2024 05:02:20 GMT
|
|
27
|
+
|
|
28
|
+
### Patches
|
|
29
|
+
|
|
30
|
+
- `List`: fix TELUS, Koodo & Public Mobile styles (sergio.ramirez@telus.com)
|
|
31
|
+
- `Breadcrumbs`: fix layout shift due to performance issues (guillermo.peitzner@telus.com)
|
|
32
|
+
- `styled-components` may break SSR in Next.js Pages Router app (shahzaibkhalidmalik@outlook.com)
|
|
33
|
+
- Bump @telus-uds/components-base to v2.3.0
|
|
34
|
+
- Bump @telus-uds/system-theme-tokens to v3.2.0
|
|
35
|
+
|
|
7
36
|
## 3.2.0
|
|
8
37
|
|
|
9
|
-
Fri, 06 Dec 2024 02:03
|
|
38
|
+
Fri, 06 Dec 2024 02:06:03 GMT
|
|
10
39
|
|
|
11
40
|
### Minor changes
|
|
12
41
|
|
package/lib/Badge/Badge.js
CHANGED
|
@@ -1,34 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import { selectSystemProps, Typography, getTokensPropType, useThemeTokens } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs, transformGradient } from '../utils';
|
|
4
|
+
import { htmlAttrs, transformGradient, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const BadgeContainer = styled.div`
|
|
11
|
+
background: ${_ref => {
|
|
12
12
|
let {
|
|
13
13
|
background
|
|
14
14
|
} = _ref;
|
|
15
15
|
return background;
|
|
16
|
-
}
|
|
16
|
+
}};
|
|
17
|
+
border: ${_ref2 => {
|
|
17
18
|
let {
|
|
18
19
|
border
|
|
19
20
|
} = _ref2;
|
|
20
21
|
return border;
|
|
21
|
-
}
|
|
22
|
+
}};
|
|
23
|
+
display: inline-flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
padding: ${_ref3 => {
|
|
22
26
|
let {
|
|
23
27
|
padding
|
|
24
28
|
} = _ref3;
|
|
25
29
|
return padding;
|
|
26
|
-
}
|
|
30
|
+
}};
|
|
31
|
+
border-radius: ${_ref4 => {
|
|
27
32
|
let {
|
|
28
33
|
radius
|
|
29
34
|
} = _ref4;
|
|
30
35
|
return radius;
|
|
31
|
-
}
|
|
36
|
+
}};
|
|
37
|
+
width: fit-content;
|
|
38
|
+
${_ref5 => {
|
|
32
39
|
let {
|
|
33
40
|
isOutlineOffer,
|
|
34
41
|
isAlternative,
|
|
@@ -40,7 +47,8 @@ const BadgeContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
40
47
|
-webkit-background-clip: text;
|
|
41
48
|
${gradient && '-webkit-text-fill-color: transparent;'}
|
|
42
49
|
}`;
|
|
43
|
-
}
|
|
50
|
+
}}
|
|
51
|
+
`;
|
|
44
52
|
const fontSizeMapping = {
|
|
45
53
|
12: 'micro',
|
|
46
54
|
14: 'small',
|
|
@@ -1,53 +1,67 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Link, selectSystemProps, StackView, Typography, useTheme, useThemeTokens, useResponsiveThemeTokens, createMediaQueryStyles, withLinkRouter, useViewport, getTokensPropType, StyleSheet } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
5
|
-
import { htmlAttrs, transformGradient } from '../utils';
|
|
4
|
+
import { htmlAttrs, transformGradient, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const BlockQuoteContainer = styled.blockquote`
|
|
11
|
+
margin: 0;
|
|
12
|
+
position: relative;
|
|
13
|
+
padding-left: ${_ref => {
|
|
12
14
|
let {
|
|
13
15
|
paddingLeft
|
|
14
16
|
} = _ref;
|
|
15
17
|
return `${paddingLeft}px`;
|
|
16
|
-
}
|
|
18
|
+
}};
|
|
19
|
+
padding-right: ${_ref2 => {
|
|
17
20
|
let {
|
|
18
21
|
paddingRight
|
|
19
22
|
} = _ref2;
|
|
20
23
|
return `${paddingRight}px`;
|
|
21
|
-
}
|
|
24
|
+
}};
|
|
25
|
+
padding-bottom: ${_ref3 => {
|
|
22
26
|
let {
|
|
23
27
|
paddingBottom
|
|
24
28
|
} = _ref3;
|
|
25
29
|
return `${paddingBottom}px`;
|
|
26
|
-
}
|
|
30
|
+
}};
|
|
31
|
+
padding-top: ${_ref4 => {
|
|
27
32
|
let {
|
|
28
33
|
paddingTop
|
|
29
34
|
} = _ref4;
|
|
30
35
|
return `${paddingTop}px`;
|
|
31
|
-
}
|
|
36
|
+
}};
|
|
37
|
+
&::before {
|
|
38
|
+
content: '';
|
|
39
|
+
left: 0;
|
|
40
|
+
top: 0;
|
|
41
|
+
position: absolute;
|
|
42
|
+
height: 100%;
|
|
43
|
+
width: ${_ref5 => {
|
|
32
44
|
let {
|
|
33
45
|
width
|
|
34
46
|
} = _ref5;
|
|
35
47
|
return `${width}px`;
|
|
36
|
-
}
|
|
48
|
+
}};
|
|
49
|
+
background: ${_ref6 => {
|
|
37
50
|
let {
|
|
38
51
|
backgroundGradient
|
|
39
52
|
} = _ref6;
|
|
40
53
|
return backgroundGradient && transformGradient(backgroundGradient);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
54
|
+
}};
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const QuoteContainer = styled.div`
|
|
58
|
+
margin-bottom: ${_ref7 => {
|
|
46
59
|
let {
|
|
47
60
|
marginBottom
|
|
48
61
|
} = _ref7;
|
|
49
62
|
return `${marginBottom}px`;
|
|
50
|
-
}
|
|
63
|
+
}};
|
|
64
|
+
`;
|
|
51
65
|
const selectTitleHeadingTokens = themeTokens => ({
|
|
52
66
|
fontSize: themeTokens.titleHeadingFontSize,
|
|
53
67
|
fontName: themeTokens.titleHeadingFontName,
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React, { createElement as _createElement } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { Helmet, HelmetProvider } from 'react-helmet-async';
|
|
5
4
|
import { isEqual } from 'lodash';
|
|
6
5
|
import { componentPropType, selectSystemProps, unpackFragment, withLinkRouter, getTokensPropType, useThemeTokens, useViewport } from '@telus-uds/components-base';
|
|
7
|
-
import { htmlAttrs } from '../utils';
|
|
6
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
8
7
|
import Item from './Item/Item';
|
|
9
8
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
9
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
const {
|
|
11
|
+
styled
|
|
12
|
+
} = styledComponents;
|
|
13
|
+
const StyledList = styled.ol({
|
|
15
14
|
display: 'flex',
|
|
16
15
|
flexDirection: 'row',
|
|
17
16
|
flexWrap: 'wrap',
|
|
@@ -135,15 +134,9 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
135
134
|
const [optionsHidden, setOptionsHidden] = React.useState(false);
|
|
136
135
|
const [itemsToBeRendered, setItemsToBeRendered] = React.useState([]);
|
|
137
136
|
const viewport = useViewport();
|
|
138
|
-
React.
|
|
139
|
-
if (optionsHidden) {
|
|
140
|
-
if (viewport !== 'xs' && !isEqual(itemsToBeRendered, activeRoutes)) {
|
|
141
|
-
setItemsToBeRendered(activeRoutes);
|
|
142
|
-
}
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
137
|
+
const newItems = React.useMemo(() => {
|
|
145
138
|
if (viewport === 'xs' && activeRoutes.length >= MAX_ITEMS_ON_XS_VIEWPORT) {
|
|
146
|
-
|
|
139
|
+
return [...activeRoutes.slice(0, 2), {
|
|
147
140
|
path: '#',
|
|
148
141
|
breadcrumbName: '...',
|
|
149
142
|
onPress: event => {
|
|
@@ -152,12 +145,25 @@ const Breadcrumbs = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
152
145
|
},
|
|
153
146
|
isExpander: true
|
|
154
147
|
}, activeRoutes[activeRoutes.length - 1]];
|
|
155
|
-
|
|
156
|
-
|
|
148
|
+
}
|
|
149
|
+
return activeRoutes;
|
|
150
|
+
}, [viewport, activeRoutes]);
|
|
151
|
+
React.useEffect(() => {
|
|
152
|
+
if (optionsHidden) {
|
|
153
|
+
if (viewport !== 'xs' && !isEqual(itemsToBeRendered, activeRoutes)) {
|
|
154
|
+
setItemsToBeRendered(activeRoutes);
|
|
155
|
+
}
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (viewport === 'xs' && activeRoutes.length >= MAX_ITEMS_ON_XS_VIEWPORT) {
|
|
159
|
+
if (!isEqual(itemsToBeRendered, newItems)) {
|
|
160
|
+
setItemsToBeRendered(newItems);
|
|
161
|
+
setOptionsHidden(true);
|
|
162
|
+
}
|
|
157
163
|
} else if (!isEqual(itemsToBeRendered, activeRoutes)) {
|
|
158
164
|
setItemsToBeRendered(activeRoutes);
|
|
159
165
|
}
|
|
160
|
-
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered]);
|
|
166
|
+
}, [viewport, activeRoutes, optionsHidden, itemsToBeRendered, newItems]);
|
|
161
167
|
const items = getItems(itemsToBeRendered, params, !children);
|
|
162
168
|
const themeTokens = useThemeTokens('Breadcrumbs', tokens, variant);
|
|
163
169
|
const metadata = /*#__PURE__*/_jsx(HelmetProvider, {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { Link, Typography, applyTextStyles, clickProps, selectSystemProps, useThemeTokens } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs } from '../../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../../utils';
|
|
6
5
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const StyledItemContainer = styled.li({
|
|
12
11
|
display: 'inline-block',
|
|
13
12
|
paddingLeft: _ref => {
|
|
14
13
|
let {
|
|
@@ -25,10 +24,7 @@ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
|
|
|
25
24
|
},
|
|
26
25
|
marginBottom: '8px'
|
|
27
26
|
});
|
|
28
|
-
const IconContainer =
|
|
29
|
-
displayName: "Item__IconContainer",
|
|
30
|
-
componentId: "components-web__sc-1rfdaul-1"
|
|
31
|
-
})({
|
|
27
|
+
const IconContainer = styled.span({
|
|
32
28
|
display: 'inline-block',
|
|
33
29
|
paddingLeft: _ref3 => {
|
|
34
30
|
let {
|
package/lib/Callout/Callout.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
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, getTokensPropType } from '@telus-uds/components-base';
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
8
10
|
const getAlignment = (rounded, textAlignToFlex) => {
|
|
9
11
|
if (textAlignToFlex) {
|
|
10
12
|
switch (textAlignToFlex) {
|
|
@@ -30,10 +32,7 @@ const verticalAlignToFlex = verticalAlign => {
|
|
|
30
32
|
return 'top';
|
|
31
33
|
}
|
|
32
34
|
};
|
|
33
|
-
const CalloutContainer =
|
|
34
|
-
displayName: "Callout__CalloutContainer",
|
|
35
|
-
componentId: "components-web__sc-1a7ptx-0"
|
|
36
|
-
})(_ref => {
|
|
35
|
+
const CalloutContainer = styled.div(_ref => {
|
|
37
36
|
let {
|
|
38
37
|
rounded,
|
|
39
38
|
verticalAlign,
|
package/lib/Card/Card.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Card as CardBase, getTokensPropType, paddingProp, responsiveProps, selectSystemProps, StackView, useThemeTokens, useThemeTokensCallback, variantProp, a11yProps, viewProps, PressableCardBase, useResponsiveProp } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import { styledComponents } from '../utils';
|
|
5
5
|
import CardContent from './CardContent';
|
|
6
6
|
import CardFooter from './CardFooter';
|
|
7
7
|
import FullBleedContent, { getFullBleedBorderRadius, useFullBleedContentProps } from '../shared/FullBleedContent';
|
|
@@ -10,6 +10,9 @@ import ConditionalWrapper from '../shared/ConditionalWrapper';
|
|
|
10
10
|
// Passes React Native-oriented system props through UDS Card
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
13
|
+
const {
|
|
14
|
+
styled
|
|
15
|
+
} = styledComponents;
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* A basic card component, unstyled by default.
|
|
@@ -40,10 +43,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
|
|
|
40
43
|
* ## Accessibility
|
|
41
44
|
* `Card` component accepts all the standard accessibility props.
|
|
42
45
|
*/
|
|
43
|
-
const DynamicWidthContainer =
|
|
44
|
-
displayName: "Card__DynamicWidthContainer",
|
|
45
|
-
componentId: "components-web__sc-1elbtwd-0"
|
|
46
|
-
})(_ref => {
|
|
46
|
+
const DynamicWidthContainer = styled.div(_ref => {
|
|
47
47
|
let {
|
|
48
48
|
width,
|
|
49
49
|
display,
|
package/lib/Card/CardContent.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { getTokensPropType, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const CardContentContainer = styled.div(_ref => {
|
|
12
11
|
let {
|
|
13
12
|
borderRadius,
|
|
14
13
|
paddingBottom,
|
package/lib/Card/CardFooter.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { getTokensPropType, paddingProp, selectSystemProps, useThemeTokens, useViewport, variantProp } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
5
|
-
import { htmlAttrs } from '../utils';
|
|
4
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const CardFooterContainer = styled.div(_ref => {
|
|
12
11
|
let {
|
|
13
12
|
backgroundColor,
|
|
14
13
|
borderRadius,
|
|
@@ -2,19 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { Spacer, StackView, Typography, selectSystemProps, useViewport, useTheme, useThemeTokens, useResponsiveThemeTokens, createMediaQueryStyles, applyTextStyles, getTokensPropType, StyleSheet } from '@telus-uds/components-base';
|
|
4
4
|
import { viewports } from '@telus-uds/system-constants';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
5
|
// Reading these from the RN palette since they will be used to generate
|
|
7
6
|
// the `Typography` tokens
|
|
8
|
-
import { htmlAttrs, transformGradient } from '../utils';
|
|
7
|
+
import { htmlAttrs, transformGradient, styledComponents } from '../utils';
|
|
9
8
|
import Segment from './Segment';
|
|
10
9
|
import useCountdown from './useCountdown';
|
|
11
10
|
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
12
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const {
|
|
14
|
+
styled
|
|
15
|
+
} = styledComponents;
|
|
16
|
+
const Container = styled.div(_ref => {
|
|
18
17
|
let {
|
|
19
18
|
variant: {
|
|
20
19
|
feature,
|
package/lib/Countdown/Segment.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { StackView, Typography, useCopy } from '@telus-uds/components-base';
|
|
4
|
-
import
|
|
4
|
+
import { styledComponents } from '../utils';
|
|
5
5
|
import dictionary from './dictionary';
|
|
6
6
|
import { countdownVariantPropType, dictionaryContentShape } from './types';
|
|
7
7
|
// !TODO: put this back
|
|
8
8
|
import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants';
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
const {
|
|
11
|
+
styled
|
|
12
|
+
} = styledComponents;
|
|
9
13
|
|
|
10
14
|
// Pads with zeros on the left if it's a single digit number
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
15
|
const pad = function (number) {
|
|
13
16
|
let segmentWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
14
17
|
return String(number).padStart(segmentWidth, '0');
|
|
15
18
|
};
|
|
16
|
-
const Container =
|
|
17
|
-
displayName: "Segment__Container",
|
|
18
|
-
componentId: "components-web__sc-yrh35y-0"
|
|
19
|
-
})(_ref => {
|
|
19
|
+
const Container = styled.div(_ref => {
|
|
20
20
|
let {
|
|
21
21
|
segmentFontSize,
|
|
22
22
|
segmentWidth = 2,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { styledComponents } from '../utils';
|
|
2
2
|
import defaultReactDatesCss from './reactDatesCss';
|
|
3
3
|
|
|
4
4
|
// calendarDayDefaultHeight and calendarDayDefaultWidth
|
|
5
5
|
// refer to circle size when selected, focused, or hovered and is passed with getResponsiveCircleSize in DatePicker
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
const {
|
|
8
|
+
styled
|
|
9
|
+
} = styledComponents;
|
|
10
|
+
const CalendarContainer = styled.div(_ref => {
|
|
11
11
|
let {
|
|
12
12
|
daySize,
|
|
13
13
|
remainingTokens,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import momentPropTypes from 'react-moment-proptypes';
|
|
5
4
|
import 'react-dates/initialize';
|
|
6
5
|
import { SingleDatePicker, DayPickerSingleDateController } from 'react-dates';
|
|
@@ -9,11 +8,12 @@ import moment from 'moment';
|
|
|
9
8
|
import { isUndefined, throttle } from 'lodash';
|
|
10
9
|
import CalendarContainer from './CalendarContainer';
|
|
11
10
|
import dictionary from './dictionary';
|
|
12
|
-
import { htmlAttrs } from '../utils';
|
|
11
|
+
import { htmlAttrs, styledComponents } from '../utils';
|
|
13
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
const {
|
|
14
|
+
styled
|
|
15
|
+
} = styledComponents;
|
|
14
16
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
|
|
15
|
-
const dateFormat = 'DD / MM / YYYY';
|
|
16
|
-
const dateFormatWithoutSpaces = 'DD/MM/YYYY';
|
|
17
17
|
const getResponsiveDaySize = function () {
|
|
18
18
|
let inline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
19
19
|
let viewport = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md';
|
|
@@ -30,24 +30,15 @@ const getResponsiveCircleSize = function () {
|
|
|
30
30
|
}
|
|
31
31
|
return inline ? 44 : 26;
|
|
32
32
|
};
|
|
33
|
-
const MonthCenterContainer =
|
|
34
|
-
displayName: "DatePicker__MonthCenterContainer",
|
|
35
|
-
componentId: "components-web__sc-mz8fi3-0"
|
|
36
|
-
})({
|
|
33
|
+
const MonthCenterContainer = styled.div({
|
|
37
34
|
display: 'flex',
|
|
38
35
|
justifyContent: 'center'
|
|
39
36
|
});
|
|
40
|
-
const DateInputWrapper =
|
|
41
|
-
displayName: "DatePicker__DateInputWrapper",
|
|
42
|
-
componentId: "components-web__sc-mz8fi3-1"
|
|
43
|
-
})({
|
|
37
|
+
const DateInputWrapper = styled.div({
|
|
44
38
|
display: 'flex',
|
|
45
39
|
flexDirection: 'column'
|
|
46
40
|
});
|
|
47
|
-
const PortalPositionedContainer =
|
|
48
|
-
displayName: "DatePicker__PortalPositionedContainer",
|
|
49
|
-
componentId: "components-web__sc-mz8fi3-2"
|
|
50
|
-
})({
|
|
41
|
+
const PortalPositionedContainer = styled.div({
|
|
51
42
|
position: 'absolute',
|
|
52
43
|
left: _ref => {
|
|
53
44
|
let {
|
|
@@ -62,7 +53,6 @@ const PortalPositionedContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
62
53
|
return `${top}px`;
|
|
63
54
|
}
|
|
64
55
|
});
|
|
65
|
-
const validDatePattern = /^([0-2][0-9]|3[0-1])(\/)(0[1-9]|1[0-2])\2(\d{4})$/;
|
|
66
56
|
const getInitialVisibleMonth = (initialVisibleMonth, inputDate) => {
|
|
67
57
|
if (initialVisibleMonth === '' || inputDate instanceof moment) {
|
|
68
58
|
return null;
|
|
@@ -97,6 +87,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
97
87
|
copy = 'en',
|
|
98
88
|
id,
|
|
99
89
|
date,
|
|
90
|
+
dateFormat = 'DD / MM / YYYY',
|
|
100
91
|
feedback,
|
|
101
92
|
inline = false,
|
|
102
93
|
isDayDisabled,
|
|
@@ -111,12 +102,13 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
111
102
|
disabled = false,
|
|
112
103
|
prevTestID = '',
|
|
113
104
|
nextTestID = '',
|
|
114
|
-
placeholder =
|
|
105
|
+
placeholder = dateFormat,
|
|
115
106
|
initialVisibleMonth = '',
|
|
116
107
|
...rest
|
|
117
108
|
} = _ref3;
|
|
118
109
|
const [inputDate, setInputDate] = React.useState(date instanceof moment ? date : undefined);
|
|
119
110
|
const [inputText, setInputText] = React.useState(date instanceof moment ? date.format(dateFormat) : '');
|
|
111
|
+
const dateFormatWithoutSpaces = dateFormat.replace(/\s/g, '');
|
|
120
112
|
const textInputRef = React.useRef();
|
|
121
113
|
const prevButtonRef = React.useRef();
|
|
122
114
|
const [datePickerPosition, setDatePickerPosition] = React.useState({
|
|
@@ -143,7 +135,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
143
135
|
});
|
|
144
136
|
|
|
145
137
|
// Initial call to set the position
|
|
146
|
-
|
|
138
|
+
throttledUpdate();
|
|
147
139
|
|
|
148
140
|
// Register event listeners
|
|
149
141
|
window.addEventListener('resize', throttledUpdate);
|
|
@@ -172,7 +164,7 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
172
164
|
setInputDate(date);
|
|
173
165
|
setInputText(date instanceof moment ? date.format(dateFormat) : '');
|
|
174
166
|
}
|
|
175
|
-
}, [date, inputDate]);
|
|
167
|
+
}, [date, inputDate, dateFormat]);
|
|
176
168
|
React.useEffect(() => {
|
|
177
169
|
let timeoutId;
|
|
178
170
|
if (prevButtonRef.current && isFocused) {
|
|
@@ -241,7 +233,9 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
241
233
|
}
|
|
242
234
|
};
|
|
243
235
|
const handleValidation = inputValidation => {
|
|
244
|
-
|
|
236
|
+
const momentDate = moment(inputText, dateFormat, true);
|
|
237
|
+
const isValidDate = momentDate.isValid();
|
|
238
|
+
if (!isValidDate && inputText !== '') {
|
|
245
239
|
return 'error';
|
|
246
240
|
}
|
|
247
241
|
if (inputValidation === 'error' || inputValidation === 'success') {
|
|
@@ -252,10 +246,11 @@ const DatePicker = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
252
246
|
const viewport = useViewport();
|
|
253
247
|
const daySize = getResponsiveDaySize(inline, viewport);
|
|
254
248
|
const circleSize = getResponsiveCircleSize(inline, viewport);
|
|
255
|
-
const HiddenInputFieldContainer =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
249
|
+
const HiddenInputFieldContainer = styled.div`
|
|
250
|
+
height: ${props => props.height};
|
|
251
|
+
width: ${props => props.width};
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
`;
|
|
259
254
|
const {
|
|
260
255
|
hiddenInputFieldContainerHeight,
|
|
261
256
|
hiddenInputFieldContainerWidth,
|
|
@@ -449,8 +444,11 @@ DatePicker.propTypes = {
|
|
|
449
444
|
*/
|
|
450
445
|
date: momentPropTypes.momentObj,
|
|
451
446
|
/**
|
|
452
|
-
* A
|
|
453
|
-
|
|
447
|
+
* A Moment instance representing the currently selected date, i.e. `moment()`
|
|
448
|
+
*/
|
|
449
|
+
dateFormat: PropTypes.string,
|
|
450
|
+
/**
|
|
451
|
+
* Optional date format for the date input. If not set, the default value will be `DD / MM / YYYY`
|
|
454
452
|
*/
|
|
455
453
|
feedback: PropTypes.string,
|
|
456
454
|
/**
|
|
@@ -505,7 +503,7 @@ DatePicker.propTypes = {
|
|
|
505
503
|
*/
|
|
506
504
|
nextTestID: PropTypes.string,
|
|
507
505
|
/**
|
|
508
|
-
* Optional placeholder for the date input. If not set the default value will be
|
|
506
|
+
* Optional placeholder for the date input. If not set, the default value will be equal to the `dateFormat` prop
|
|
509
507
|
*/
|
|
510
508
|
placeholder: PropTypes.string,
|
|
511
509
|
/**
|