@telus-uds/components-web 3.0.1 → 3.2.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 +0 -0
- package/lib/Badge/index.js +0 -0
- package/lib/BlockQuote/BlockQuote.js +56 -10
- package/lib/BlockQuote/index.js +0 -0
- package/lib/Breadcrumbs/Breadcrumbs.js +0 -0
- package/lib/Breadcrumbs/Item/Item.js +0 -0
- package/lib/Breadcrumbs/index.js +0 -0
- package/lib/Callout/Callout.js +0 -0
- package/lib/Callout/index.js +0 -0
- package/lib/Card/Card.js +0 -0
- package/lib/Card/CardContent.js +0 -0
- package/lib/Card/CardFooter.js +0 -0
- package/lib/Card/index.js +0 -0
- package/lib/Countdown/Countdown.js +78 -6
- package/lib/Countdown/Segment.js +6 -0
- package/lib/Countdown/constants.js +0 -0
- package/lib/Countdown/dictionary.js +0 -0
- package/lib/Countdown/index.js +0 -0
- package/lib/Countdown/types.js +0 -0
- package/lib/Countdown/useCountdown.js +0 -0
- package/lib/DatePicker/CalendarContainer.js +0 -0
- package/lib/DatePicker/DatePicker.js +0 -0
- package/lib/DatePicker/dictionary.js +0 -0
- package/lib/DatePicker/index.js +0 -0
- package/lib/DatePicker/reactDatesCss.js +0 -0
- package/lib/Disclaimer/Disclaimer.js +0 -0
- package/lib/Disclaimer/index.js +0 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMini.js +0 -0
- package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +0 -0
- package/lib/ExpandCollapseMini/index.js +0 -0
- package/lib/Footnote/Footnote.js +0 -0
- package/lib/Footnote/FootnoteLink.js +0 -0
- package/lib/Footnote/dictionary.js +0 -0
- package/lib/Footnote/index.js +0 -0
- package/lib/IconButton/IconButton.js +0 -0
- package/lib/IconButton/index.js +0 -0
- package/lib/Image/Image.js +0 -0
- package/lib/Image/index.js +0 -0
- package/lib/Image/server.js +0 -0
- package/lib/List/List.js +0 -0
- package/lib/List/ListItem.js +0 -0
- package/lib/List/index.js +0 -0
- package/lib/NavigationBar/NavigationBar.js +69 -15
- package/lib/NavigationBar/NavigationItem.js +0 -0
- package/lib/NavigationBar/NavigationSubMenu.js +0 -0
- package/lib/NavigationBar/collapseItems.js +0 -0
- package/lib/NavigationBar/index.js +0 -0
- package/lib/NavigationBar/resolveItemSelection.js +0 -0
- package/lib/OptimizeImage/OptimizeImage.js +0 -0
- package/lib/OptimizeImage/index.js +0 -0
- package/lib/OptimizeImage/utils/getFallbackUrl.js +0 -0
- package/lib/OptimizeImage/utils/getImageUrls.js +0 -0
- package/lib/OptimizeImage/utils/getOptimizedUrl.js +0 -0
- package/lib/OptimizeImage/utils/hasWebpSupport.js +0 -0
- package/lib/OptimizeImage/utils/index.js +0 -0
- package/lib/OptimizeImage/utils/isSvgUrl.js +0 -0
- package/lib/OrderedList/Item.js +0 -0
- package/lib/OrderedList/ItemBase.js +0 -0
- package/lib/OrderedList/OrderedList.js +0 -0
- package/lib/OrderedList/OrderedListBase.js +0 -0
- package/lib/OrderedList/constants.js +0 -0
- package/lib/OrderedList/index.js +0 -0
- package/lib/Paragraph/Paragraph.js +0 -0
- package/lib/Paragraph/index.js +0 -0
- package/lib/PreviewCard/AuthorDate.js +0 -0
- package/lib/PreviewCard/PreviewCard.js +0 -0
- package/lib/PreviewCard/index.js +0 -0
- package/lib/PriceLockup/PriceLockup.js +0 -0
- package/lib/PriceLockup/index.js +0 -0
- package/lib/PriceLockup/tokens.js +0 -0
- package/lib/Progress/ProgressBar.js +11 -1
- package/lib/Progress/index.js +0 -0
- package/lib/QuantitySelector/QuantitySelector.js +1 -1
- package/lib/QuantitySelector/SideButton.js +0 -0
- package/lib/QuantitySelector/dictionary.js +0 -0
- package/lib/QuantitySelector/index.js +0 -0
- package/lib/QuantitySelector/styles.js +0 -0
- package/lib/ResponsiveImage/ResponsiveImage.js +9 -3
- package/lib/ResponsiveImage/index.js +0 -0
- package/lib/Ribbon/Ribbon.js +0 -0
- package/lib/Ribbon/index.js +0 -0
- package/lib/SkeletonProvider/SkeletonImage.js +0 -0
- package/lib/SkeletonProvider/SkeletonProvider.js +0 -0
- package/lib/SkeletonProvider/SkeletonTypography.js +0 -0
- package/lib/SkeletonProvider/index.js +0 -0
- package/lib/Span/Span.js +0 -0
- package/lib/Span/index.js +0 -0
- package/lib/Spinner/Spinner.js +0 -0
- package/lib/Spinner/SpinnerContent.js +0 -0
- package/lib/Spinner/constants.js +0 -0
- package/lib/Spinner/index.js +0 -0
- package/lib/StoryCard/StoryCard.js +0 -0
- package/lib/StoryCard/index.js +0 -0
- package/lib/Table/Body.js +0 -0
- package/lib/Table/Cell.js +0 -0
- package/lib/Table/Header.js +0 -0
- package/lib/Table/Row.js +0 -0
- package/lib/Table/SubHeading.js +0 -0
- package/lib/Table/Table.js +0 -0
- package/lib/Table/index.js +0 -0
- package/lib/TermsAndConditions/ExpandCollapse.js +0 -0
- package/lib/TermsAndConditions/TermsAndConditions.js +0 -0
- package/lib/TermsAndConditions/dictionary.js +0 -0
- package/lib/TermsAndConditions/index.js +0 -0
- package/lib/Testimonial/Testimonial.js +0 -0
- package/lib/Testimonial/index.js +0 -0
- package/lib/Toast/Toast.js +0 -0
- package/lib/Toast/index.js +0 -0
- package/lib/Video/ControlBar/ControlBar.js +0 -0
- package/lib/Video/ControlBar/Controls/VideoButton/VideoButton.js +0 -0
- package/lib/Video/ControlBar/Controls/VideoMenu/VideoMenu.js +0 -0
- package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +3 -0
- package/lib/Video/ControlBar/Controls/VolumeSlider/VolumeSlider.js +0 -0
- package/lib/Video/MiddleControlButton/MiddleControlButton.js +0 -0
- package/lib/Video/Video.js +0 -0
- package/lib/Video/index.js +0 -0
- package/lib/Video/videoText.js +0 -0
- package/lib/VideoPicker/VideoPicker.js +0 -0
- package/lib/VideoPicker/VideoPickerPlayer.js +0 -0
- package/lib/VideoPicker/VideoPickerThumbnail.js +0 -0
- package/lib/VideoPicker/VideoSlider.js +0 -0
- package/lib/VideoPicker/index.js +0 -0
- package/lib/VideoPicker/videoPropType.js +0 -0
- package/lib/WaffleGrid/WaffleGrid.js +0 -0
- package/lib/WaffleGrid/index.js +0 -0
- package/lib/WebVideo/WebVideo.js +0 -0
- package/lib/WebVideo/index.js +0 -0
- package/lib/WebVideo/utils/index.js +0 -0
- package/lib/baseExports.js +0 -0
- package/lib/index.js +0 -0
- package/lib/server.js +0 -0
- package/lib/shared/ConditionalWrapper/ConditionalWrapper.js +0 -0
- package/lib/shared/ConditionalWrapper/index.js +0 -0
- package/lib/shared/FullBleedContent/FullBleedContent.js +0 -0
- package/lib/shared/FullBleedContent/getFullBleedBorderRadius.js +0 -0
- package/lib/shared/FullBleedContent/index.js +0 -0
- package/lib/shared/FullBleedContent/useFullBleedContentProps.js +0 -0
- package/lib/shared/VideoSplash/SplashButton/SplashButton.js +0 -0
- package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +0 -0
- package/lib/shared/VideoSplash/VideoSplash.js +0 -0
- package/lib/shared/VideoSplash/helpers.js +0 -0
- package/lib/utils/index.js +3 -2
- package/lib/utils/isElementFocusable.js +0 -0
- package/lib/utils/logger.js +0 -0
- package/lib/utils/media.js +0 -0
- package/lib/utils/renderStructuredContent.js +0 -0
- package/lib/utils/scrollToAnchor.js +19 -0
- package/lib/utils/ssr.js +0 -0
- package/lib/utils/theming/get-theme-from-server.js +0 -0
- package/lib/utils/theming/with-client-theme.js +0 -0
- package/lib/utils/theming/with-server-theme.js +0 -0
- package/lib/utils/transforms.js +0 -0
- package/lib/utils/useOverlaidPosition.js +0 -0
- package/lib/utils/useTypographyTheme.js +0 -0
- package/package.json +3 -3
- package/src/BlockQuote/BlockQuote.jsx +73 -11
- package/src/Countdown/Countdown.jsx +90 -6
- package/src/Countdown/Segment.jsx +8 -2
- package/src/NavigationBar/NavigationBar.jsx +53 -12
- package/src/Progress/ProgressBar.jsx +11 -2
- package/src/QuantitySelector/QuantitySelector.jsx +1 -1
- package/src/ResponsiveImage/ResponsiveImage.jsx +12 -5
- package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +5 -1
- package/src/utils/index.js +5 -2
- package/src/utils/scrollToAnchor.js +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,41 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-web
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 06 Dec 2024 02:03:26 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 3.2.0
|
|
8
|
+
|
|
9
|
+
Fri, 06 Dec 2024 02:03:26 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- `NavigationBar`: enable hash navigation (guillermo.peitzner@telus.com)
|
|
14
|
+
- `ChevronLink`, `Search` & `ResponsiveImage`: new `dataSet` prop added to the components to allow the capability to pass data (35577399+JoshHC@users.noreply.github.com)
|
|
15
|
+
- Bump @telus-uds/components-base to v2.2.0
|
|
16
|
+
|
|
17
|
+
### Patches
|
|
18
|
+
|
|
19
|
+
- `QuantitySelector`: render hint when no label is provided (guillermo.peitzner@telus.com)
|
|
20
|
+
|
|
21
|
+
## 3.1.0
|
|
22
|
+
|
|
23
|
+
Mon, 02 Dec 2024 20:29:26 GMT
|
|
24
|
+
|
|
25
|
+
### Minor changes
|
|
26
|
+
|
|
27
|
+
- `Progress`: Added rules for `subtle` and `inverse` variants. Deprecated `inactive` and `negative` appearances and moved them to `style` appearances. Enabled `offset` object for controlling the position of the `ProgressBar` component. (jaime.tuyuc@telus.com)
|
|
28
|
+
- `Blockquote`: refactor to use media query stylesheet (Mauricio.BatresMontejo@telus.com)
|
|
29
|
+
- `CountDown`: refactor component to use media-query-stylesheet (Mauricio.BatresMontejo@telus.com)
|
|
30
|
+
- `ChevronLink`, `Search` & `ResponsiveImage`: new contentful props data-contentful-field-id and data-contentful-entry-id added to the components (35577399+JoshHC@users.noreply.github.com)
|
|
31
|
+
- `Modal`: update component to enable heading bottom border and content spacing (eduardo.pereira1@telus.com)
|
|
32
|
+
- `Video`: new tokens remainingTimestampMarginRight and remainingTimestampMarginLeft added to match with the visual design intention (35577399+JoshHC@users.noreply.github.com)
|
|
33
|
+
- Bump @telus-uds/components-base to v2.1.0
|
|
34
|
+
- Bump @telus-uds/system-theme-tokens to v3.1.0
|
|
35
|
+
|
|
7
36
|
## 3.0.1
|
|
8
37
|
|
|
9
|
-
Sat, 23 Nov 2024 01:
|
|
38
|
+
Sat, 23 Nov 2024 01:40:21 GMT
|
|
10
39
|
|
|
11
40
|
### Patches
|
|
12
41
|
|
package/lib/Badge/Badge.js
CHANGED
|
File without changes
|
package/lib/Badge/index.js
CHANGED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Link, selectSystemProps, StackView, Typography, useThemeTokens, withLinkRouter, useViewport, getTokensPropType } from '@telus-uds/components-base';
|
|
3
|
+
import { Link, selectSystemProps, StackView, Typography, useTheme, useThemeTokens, useResponsiveThemeTokens, createMediaQueryStyles, withLinkRouter, useViewport, getTokensPropType, StyleSheet } from '@telus-uds/components-base';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { htmlAttrs, transformGradient } from '../utils';
|
|
6
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -48,6 +48,12 @@ const QuoteContainer = /*#__PURE__*/styled.div.withConfig({
|
|
|
48
48
|
} = _ref7;
|
|
49
49
|
return `${marginBottom}px`;
|
|
50
50
|
});
|
|
51
|
+
const selectTitleHeadingTokens = themeTokens => ({
|
|
52
|
+
fontSize: themeTokens.titleHeadingFontSize,
|
|
53
|
+
fontName: themeTokens.titleHeadingFontName,
|
|
54
|
+
fontWeight: themeTokens.titleHeadingFontWeight,
|
|
55
|
+
lineHeight: themeTokens.titleHeadingLineHeight
|
|
56
|
+
});
|
|
51
57
|
const BlockQuote = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
52
58
|
let {
|
|
53
59
|
children,
|
|
@@ -62,6 +68,15 @@ const BlockQuote = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
|
62
68
|
...rest
|
|
63
69
|
} = _ref8;
|
|
64
70
|
const viewport = useViewport();
|
|
71
|
+
const {
|
|
72
|
+
themeOptions: {
|
|
73
|
+
enableMediaQueryStyleSheet
|
|
74
|
+
}
|
|
75
|
+
} = useTheme();
|
|
76
|
+
const useTokens = enableMediaQueryStyleSheet ? useResponsiveThemeTokens : useThemeTokens;
|
|
77
|
+
const themeTokens = useTokens('BlockQuote', tokens, variant, !enableMediaQueryStyleSheet && {
|
|
78
|
+
viewport
|
|
79
|
+
});
|
|
65
80
|
const {
|
|
66
81
|
color,
|
|
67
82
|
paddingTop,
|
|
@@ -83,16 +98,46 @@ const BlockQuote = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
|
83
98
|
linkFontName,
|
|
84
99
|
linkFontWeight,
|
|
85
100
|
linkLineHeight
|
|
86
|
-
} =
|
|
87
|
-
|
|
88
|
-
|
|
101
|
+
} = themeTokens;
|
|
102
|
+
let titleHeadingStyles;
|
|
103
|
+
let titleHeadingMediaIds;
|
|
104
|
+
if (enableMediaQueryStyleSheet) {
|
|
105
|
+
const {
|
|
106
|
+
transformedTitleHeadingThemeTokens
|
|
107
|
+
} = Object.entries(themeTokens).reduce((acc, _ref9) => {
|
|
108
|
+
let [vp, viewportTokens] = _ref9;
|
|
109
|
+
acc.transformedTitleHeadingThemeTokens[vp] = {
|
|
110
|
+
fontSize: viewportTokens.titleHeadingFontSize,
|
|
111
|
+
fontName: viewportTokens.titleHeadingFontName,
|
|
112
|
+
fontWeight: viewportTokens.titleHeadingFontWeight,
|
|
113
|
+
lineHeight: viewportTokens.titleHeadingLineHeight
|
|
114
|
+
};
|
|
115
|
+
return acc;
|
|
116
|
+
}, {
|
|
117
|
+
transformedTitleHeadingThemeTokens: {}
|
|
118
|
+
});
|
|
119
|
+
const titleHeadingMediaQueryStyles = createMediaQueryStyles(transformedTitleHeadingThemeTokens);
|
|
120
|
+
const {
|
|
121
|
+
ids,
|
|
122
|
+
styles
|
|
123
|
+
} = StyleSheet.create({
|
|
124
|
+
titleHeading: {
|
|
125
|
+
...selectTitleHeadingTokens(themeTokens[viewport]),
|
|
126
|
+
...titleHeadingMediaQueryStyles
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
titleHeadingStyles = styles.titleHeading;
|
|
130
|
+
titleHeadingMediaIds = ids.titleHeading;
|
|
131
|
+
} else {
|
|
132
|
+
titleHeadingStyles = {
|
|
133
|
+
fontSize: titleHeadingFontSize,
|
|
134
|
+
fontName: titleHeadingFontName,
|
|
135
|
+
fontWeight: titleHeadingFontWeight,
|
|
136
|
+
lineHeight: titleHeadingLineHeight
|
|
137
|
+
};
|
|
138
|
+
}
|
|
89
139
|
const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle;
|
|
90
|
-
const titleTokens = textStyle === 'heading' ? {
|
|
91
|
-
fontSize: titleHeadingFontSize,
|
|
92
|
-
fontName: titleHeadingFontName,
|
|
93
|
-
fontWeight: titleHeadingFontWeight,
|
|
94
|
-
lineHeight: titleHeadingLineHeight
|
|
95
|
-
} : {
|
|
140
|
+
const titleTokens = textStyle === 'heading' ? titleHeadingStyles : {
|
|
96
141
|
fontSize: titleFontSize,
|
|
97
142
|
fontName: titleFontName,
|
|
98
143
|
fontWeight: titleFontWeight,
|
|
@@ -134,6 +179,7 @@ const BlockQuote = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
|
|
|
134
179
|
color,
|
|
135
180
|
...titleTokens
|
|
136
181
|
},
|
|
182
|
+
media: titleHeadingMediaIds,
|
|
137
183
|
variant: {
|
|
138
184
|
size: mappedTextSize
|
|
139
185
|
},
|
package/lib/BlockQuote/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Breadcrumbs/index.js
CHANGED
|
File without changes
|
package/lib/Callout/Callout.js
CHANGED
|
File without changes
|
package/lib/Callout/index.js
CHANGED
|
File without changes
|
package/lib/Card/Card.js
CHANGED
|
File without changes
|
package/lib/Card/CardContent.js
CHANGED
|
File without changes
|
package/lib/Card/CardFooter.js
CHANGED
|
File without changes
|
package/lib/Card/index.js
CHANGED
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { Spacer, StackView, Typography, selectSystemProps, useViewport, useThemeTokens, applyTextStyles, getTokensPropType } from '@telus-uds/components-base';
|
|
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
5
|
import styled from 'styled-components';
|
|
6
6
|
// Reading these from the RN palette since they will be used to generate
|
|
@@ -87,12 +87,82 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
87
87
|
if (noDivider && !label) {
|
|
88
88
|
throw new Error('`noDivider` variant can only be used with `label` enabled!');
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const {
|
|
91
|
+
themeOptions
|
|
92
|
+
} = useTheme();
|
|
93
|
+
const {
|
|
94
|
+
enableMediaQueryStyleSheet
|
|
95
|
+
} = themeOptions;
|
|
96
|
+
const useTokens = enableMediaQueryStyleSheet ? useResponsiveThemeTokens : useThemeTokens;
|
|
97
|
+
const themeTokens = useTokens('Countdown', tokens, variant, !enableMediaQueryStyleSheet && {
|
|
91
98
|
viewport
|
|
92
99
|
});
|
|
93
100
|
const segmentFontSize = themeTokens.textFontSize;
|
|
94
101
|
const semanticGradient = themeTokens.containerGradient && transformGradient(themeTokens.containerGradient);
|
|
95
102
|
const mainTextTokens = getMainTextTokens(themeTokens);
|
|
103
|
+
const labelTokens = getLabelTokens(themeTokens);
|
|
104
|
+
let labelStyles;
|
|
105
|
+
let labelMediaIds;
|
|
106
|
+
let mainTextStyles;
|
|
107
|
+
let mainTextMediaIds;
|
|
108
|
+
let containerStyles;
|
|
109
|
+
let containerMediaIds;
|
|
110
|
+
if (enableMediaQueryStyleSheet) {
|
|
111
|
+
const {
|
|
112
|
+
transformedLabelThemeTokens,
|
|
113
|
+
transformedMainTextThemeTokens,
|
|
114
|
+
transformedContainerThemeTokens
|
|
115
|
+
} = Object.entries(themeTokens).reduce((acc, _ref4) => {
|
|
116
|
+
let [vp, viewportTokens] = _ref4;
|
|
117
|
+
acc.transformedLabelThemeTokens[vp] = {
|
|
118
|
+
fontSize: viewportTokens.labelFontSize,
|
|
119
|
+
lineHeight: viewportTokens.labelLineHeight
|
|
120
|
+
};
|
|
121
|
+
acc.transformedMainTextThemeTokens[vp] = {
|
|
122
|
+
fontSize: viewportTokens.textFontSize,
|
|
123
|
+
lineHeight: viewportTokens.textLineHeight
|
|
124
|
+
};
|
|
125
|
+
acc.transformedContainerThemeTokens[vp] = {
|
|
126
|
+
containerPaddingBottomTop: viewportTokens.containerPaddingBottomTop,
|
|
127
|
+
containerPaddingLeftRight: viewportTokens.containerPaddingLeftRight
|
|
128
|
+
};
|
|
129
|
+
return acc;
|
|
130
|
+
}, {
|
|
131
|
+
transformedLabelThemeTokens: {},
|
|
132
|
+
transformedMainTextThemeTokens: {},
|
|
133
|
+
transformedContainerThemeTokens: {}
|
|
134
|
+
});
|
|
135
|
+
const labelMediaQueryStyles = createMediaQueryStyles(transformedLabelThemeTokens);
|
|
136
|
+
const mainTestMediaQueryStyles = createMediaQueryStyles(transformedMainTextThemeTokens);
|
|
137
|
+
const containerMediaQueryStyles = createMediaQueryStyles(transformedContainerThemeTokens);
|
|
138
|
+
const {
|
|
139
|
+
ids,
|
|
140
|
+
styles
|
|
141
|
+
} = StyleSheet.create({
|
|
142
|
+
label: {
|
|
143
|
+
...themeTokens[viewport],
|
|
144
|
+
...labelMediaQueryStyles
|
|
145
|
+
},
|
|
146
|
+
mainText: {
|
|
147
|
+
...themeTokens[viewport],
|
|
148
|
+
...mainTestMediaQueryStyles
|
|
149
|
+
},
|
|
150
|
+
container: {
|
|
151
|
+
...themeTokens[viewport],
|
|
152
|
+
...containerMediaQueryStyles
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
labelStyles = getLabelTokens(styles.label);
|
|
156
|
+
labelMediaIds = ids.label;
|
|
157
|
+
mainTextStyles = getMainTextTokens(styles.mainText);
|
|
158
|
+
mainTextMediaIds = ids.mainText;
|
|
159
|
+
containerStyles = styles.container;
|
|
160
|
+
containerMediaIds = ids.container;
|
|
161
|
+
} else {
|
|
162
|
+
labelStyles = labelTokens;
|
|
163
|
+
mainTextStyles = mainTextTokens;
|
|
164
|
+
containerStyles = themeTokens;
|
|
165
|
+
}
|
|
96
166
|
const divider = noDivider === true ?
|
|
97
167
|
/*#__PURE__*/
|
|
98
168
|
// StackView-based subcontainer adds a 1-step space on the each side of the divider
|
|
@@ -103,11 +173,12 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
103
173
|
tokens: mainTextTokens,
|
|
104
174
|
children: ":"
|
|
105
175
|
});
|
|
106
|
-
const labelTokens = getLabelTokens(themeTokens);
|
|
107
176
|
const segmentProps = {
|
|
108
177
|
copy,
|
|
109
|
-
labelTokens,
|
|
110
|
-
numberTokens:
|
|
178
|
+
labelTokens: labelStyles,
|
|
179
|
+
numberTokens: mainTextStyles,
|
|
180
|
+
labelMediaIds,
|
|
181
|
+
mainTextMediaIds,
|
|
111
182
|
segmentFontSize,
|
|
112
183
|
variant
|
|
113
184
|
};
|
|
@@ -119,8 +190,9 @@ const Countdown = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
|
|
|
119
190
|
variant: variant,
|
|
120
191
|
...selectProps(rest),
|
|
121
192
|
tabIndex: 0,
|
|
122
|
-
themeTokens:
|
|
193
|
+
themeTokens: containerStyles,
|
|
123
194
|
gradient: semanticGradient,
|
|
195
|
+
media: containerMediaIds,
|
|
124
196
|
children: /*#__PURE__*/_jsxs(StackView, {
|
|
125
197
|
direction: "row",
|
|
126
198
|
space: 1,
|
package/lib/Countdown/Segment.js
CHANGED
|
@@ -45,6 +45,8 @@ const Segment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
45
45
|
labelTokens,
|
|
46
46
|
number,
|
|
47
47
|
numberTokens,
|
|
48
|
+
labelMediaIds,
|
|
49
|
+
mainTextMediaIds,
|
|
48
50
|
segmentWidth = 2,
|
|
49
51
|
variant = {}
|
|
50
52
|
} = _ref2;
|
|
@@ -70,9 +72,11 @@ const Segment = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
70
72
|
},
|
|
71
73
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
72
74
|
tokens: numberTokens,
|
|
75
|
+
media: mainTextMediaIds,
|
|
73
76
|
children: pad(number, segmentWidth)
|
|
74
77
|
}), label && /*#__PURE__*/_jsx(Typography, {
|
|
75
78
|
tokens: labelTokens,
|
|
79
|
+
media: labelMediaIds,
|
|
76
80
|
children: getCopy(number === 1 ? labelKey : `${labelKey}s`)
|
|
77
81
|
})]
|
|
78
82
|
})
|
|
@@ -90,6 +94,8 @@ Segment.propTypes = {
|
|
|
90
94
|
number: PropTypes.number,
|
|
91
95
|
numberTokens: PropTypes.object,
|
|
92
96
|
segmentWidth: PropTypes.number,
|
|
97
|
+
labelMediaIds: PropTypes.string,
|
|
98
|
+
mainTextMediaIds: PropTypes.string,
|
|
93
99
|
variant: countdownVariantPropType
|
|
94
100
|
};
|
|
95
101
|
export default Segment;
|
|
File without changes
|
|
File without changes
|
package/lib/Countdown/index.js
CHANGED
|
File without changes
|
package/lib/Countdown/types.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/DatePicker/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Disclaimer/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Footnote/Footnote.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/Footnote/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/IconButton/index.js
CHANGED
|
File without changes
|
package/lib/Image/Image.js
CHANGED
|
File without changes
|
package/lib/Image/index.js
CHANGED
|
File without changes
|
package/lib/Image/server.js
CHANGED
|
File without changes
|
package/lib/List/List.js
CHANGED
|
File without changes
|
package/lib/List/ListItem.js
CHANGED
|
File without changes
|
package/lib/List/index.js
CHANGED
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var _withLinkRouter$propT, _withLinkRouter$propT2, _withLinkRouter$propT3, _withLinkRouter$propT4;
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
-
import { selectSystemProps, StackView, Typography, useResponsiveProp, withLinkRouter } from '@telus-uds/components-base';
|
|
4
|
+
import { selectSystemProps, StackView, Typography, useHash, useInputValue, useResponsiveProp, withLinkRouter } from '@telus-uds/components-base';
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
import { htmlAttrs } from '../utils';
|
|
6
|
+
import { htmlAttrs, scrollToAnchor } from '../utils';
|
|
7
7
|
import NavigationItem from './NavigationItem';
|
|
8
8
|
import NavigationSubMenu from './NavigationSubMenu';
|
|
9
9
|
import collapseItems from './collapseItems';
|
|
@@ -33,18 +33,56 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
33
33
|
heading,
|
|
34
34
|
headingLevel = 'h1',
|
|
35
35
|
items,
|
|
36
|
-
onChange
|
|
36
|
+
onChange,
|
|
37
37
|
selectedId,
|
|
38
|
+
value,
|
|
38
39
|
LinkRouter,
|
|
39
40
|
linkRouterProps,
|
|
40
41
|
...rest
|
|
41
42
|
} = _ref;
|
|
43
|
+
const {
|
|
44
|
+
currentValue,
|
|
45
|
+
setValue
|
|
46
|
+
} = useInputValue({
|
|
47
|
+
value,
|
|
48
|
+
initialValue: selectedId,
|
|
49
|
+
onChange
|
|
50
|
+
});
|
|
51
|
+
useHash((hash, event) => {
|
|
52
|
+
let hashItem = hash && items.find(_ref2 => {
|
|
53
|
+
let {
|
|
54
|
+
href
|
|
55
|
+
} = _ref2;
|
|
56
|
+
return hash === href;
|
|
57
|
+
});
|
|
58
|
+
if (!hashItem) {
|
|
59
|
+
const parentItem = items.find(_ref3 => {
|
|
60
|
+
let {
|
|
61
|
+
items: parentItems
|
|
62
|
+
} = _ref3;
|
|
63
|
+
return parentItems === null || parentItems === void 0 ? void 0 : parentItems.some(_ref4 => {
|
|
64
|
+
let {
|
|
65
|
+
href
|
|
66
|
+
} = _ref4;
|
|
67
|
+
return hash === href;
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
hashItem = parentItem === null || parentItem === void 0 ? void 0 : parentItem.items.find(_ref5 => {
|
|
71
|
+
let {
|
|
72
|
+
href
|
|
73
|
+
} = _ref5;
|
|
74
|
+
return hash === href;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const hashId = hashItem && (hashItem.id || hashItem.label);
|
|
78
|
+
if (hashId) setValue(hashId, event);
|
|
79
|
+
}, [items, setValue]);
|
|
42
80
|
const direction = useResponsiveProp({
|
|
43
81
|
xs: 'column',
|
|
44
82
|
sm: 'row'
|
|
45
83
|
});
|
|
46
84
|
const itemsForViewport = useResponsiveProp({
|
|
47
|
-
xs: collapseItems(items,
|
|
85
|
+
xs: collapseItems(items, currentValue),
|
|
48
86
|
lg: items
|
|
49
87
|
});
|
|
50
88
|
const openOverlayRef = React.useRef(null);
|
|
@@ -118,7 +156,7 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
118
156
|
heading: headingLevel,
|
|
119
157
|
children: heading
|
|
120
158
|
})
|
|
121
|
-
}), itemsForViewport === null || itemsForViewport === void 0 ? void 0 : itemsForViewport.map((
|
|
159
|
+
}), itemsForViewport === null || itemsForViewport === void 0 ? void 0 : itemsForViewport.map((_ref6, index) => {
|
|
122
160
|
let {
|
|
123
161
|
href,
|
|
124
162
|
label,
|
|
@@ -129,38 +167,50 @@ const NavigationBar = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
129
167
|
linkRouterProps: itemLinkRouterProps,
|
|
130
168
|
items: nestedItems,
|
|
131
169
|
...itemRest
|
|
132
|
-
} =
|
|
170
|
+
} = _ref6;
|
|
133
171
|
const itemId = id ?? label;
|
|
134
172
|
const handleClick = event => {
|
|
135
173
|
if (nestedItems) {
|
|
136
174
|
setOpenSubMenuId(openSubMenuId !== itemId ? itemId : null);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (href !== null && href !== void 0 && href.startsWith('#')) {
|
|
178
|
+
scrollToAnchor(href, event, () => setValue(itemId, event));
|
|
179
|
+
} else {
|
|
180
|
+
setValue(itemId, event);
|
|
137
181
|
}
|
|
138
182
|
onClick === null || onClick === void 0 || onClick(event);
|
|
139
|
-
onChange === null || onChange === void 0 || onChange(itemId, event);
|
|
140
183
|
};
|
|
141
184
|
const ItemComponent = nestedItems ? NavigationSubMenu : NavigationItem;
|
|
142
185
|
const isOpen = itemId === openSubMenuId;
|
|
186
|
+
const scrollableNestedItems = (nestedItems === null || nestedItems === void 0 ? void 0 : nestedItems.map(item => ({
|
|
187
|
+
...item,
|
|
188
|
+
onPress: event => {
|
|
189
|
+
const nestedItemId = item.id ?? item.label;
|
|
190
|
+
scrollToAnchor(item.href, event, () => setValue(nestedItemId, event));
|
|
191
|
+
}
|
|
192
|
+
}))) ?? nestedItems;
|
|
143
193
|
return /*#__PURE__*/_jsx(ItemComponent, {
|
|
144
194
|
ref: itemRef,
|
|
145
195
|
href: href,
|
|
146
196
|
onClick: handleClick
|
|
147
197
|
// TODO: refactor to pass selected ID via context
|
|
148
198
|
,
|
|
149
|
-
selectedId:
|
|
199
|
+
selectedId: currentValue,
|
|
150
200
|
index: index,
|
|
151
201
|
LinkRouter: ItemLinkRouter,
|
|
152
202
|
linkRouterProps: {
|
|
153
203
|
...linkRouterProps,
|
|
154
204
|
...itemLinkRouterProps
|
|
155
205
|
},
|
|
156
|
-
items:
|
|
157
|
-
selected: itemId ===
|
|
206
|
+
items: scrollableNestedItems,
|
|
207
|
+
selected: itemId === currentValue,
|
|
158
208
|
itemsContainerRef: itemsRef,
|
|
159
209
|
...itemRest,
|
|
160
|
-
...(
|
|
210
|
+
...(scrollableNestedItems && {
|
|
161
211
|
isOpen
|
|
162
212
|
}),
|
|
163
|
-
...(
|
|
213
|
+
...(scrollableNestedItems && isOpen && {
|
|
164
214
|
openOverlayRef
|
|
165
215
|
}),
|
|
166
216
|
children: label
|
|
@@ -177,7 +227,7 @@ NavigationBar.propTypes = {
|
|
|
177
227
|
*
|
|
178
228
|
* Each `item` object must contain:
|
|
179
229
|
* - `heading` - user-facing text in the tab link
|
|
180
|
-
* - `href` - the URL of the page linked to.
|
|
230
|
+
* - `href` - the URL of the page linked to.
|
|
181
231
|
* - `id` - a stable, unique identifier of the page within the set. Not written into the HTML.
|
|
182
232
|
*/
|
|
183
233
|
items: PropTypes.arrayOf(PropTypes.shape({
|
|
@@ -208,13 +258,17 @@ NavigationBar.propTypes = {
|
|
|
208
258
|
*/
|
|
209
259
|
headingLevel: PropTypes.oneOf(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
|
|
210
260
|
/**
|
|
211
|
-
*
|
|
261
|
+
* Initial selected item ID
|
|
212
262
|
*/
|
|
213
|
-
selectedId: PropTypes.string
|
|
263
|
+
selectedId: PropTypes.string,
|
|
214
264
|
/**
|
|
215
265
|
* Optional function to be called on pressing a link
|
|
216
266
|
*/
|
|
217
267
|
onChange: PropTypes.func,
|
|
268
|
+
/**
|
|
269
|
+
* Controlled value for selected item ID
|
|
270
|
+
*/
|
|
271
|
+
value: PropTypes.string,
|
|
218
272
|
/**
|
|
219
273
|
* Accesibility role for stackview
|
|
220
274
|
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/OrderedList/Item.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/OrderedList/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/Paragraph/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/lib/PreviewCard/index.js
CHANGED
|
File without changes
|
|
File without changes
|
package/lib/PriceLockup/index.js
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -44,11 +44,13 @@ const Gradient = /*#__PURE__*/styled.div.attrs({
|
|
|
44
44
|
* `gradient` is being used here to provide gradient filling.
|
|
45
45
|
*
|
|
46
46
|
*/
|
|
47
|
+
|
|
47
48
|
const ProgressBar = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
48
49
|
let {
|
|
49
50
|
percentage,
|
|
50
51
|
tokens,
|
|
51
52
|
variant,
|
|
53
|
+
offset,
|
|
52
54
|
...rest
|
|
53
55
|
} = _ref2;
|
|
54
56
|
const themeTokens = useThemeTokens('ProgressBar', tokens, variant);
|
|
@@ -58,6 +60,7 @@ const ProgressBar = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
58
60
|
tokens: tokens,
|
|
59
61
|
variant: variant,
|
|
60
62
|
ref: ref,
|
|
63
|
+
offset: offset,
|
|
61
64
|
...selectedProps,
|
|
62
65
|
children: themeTokens.gradient && /*#__PURE__*/_jsx(Gradient, {
|
|
63
66
|
...themeTokens
|
|
@@ -78,6 +81,13 @@ ProgressBar.propTypes = {
|
|
|
78
81
|
/**
|
|
79
82
|
* ProgressBar variant.
|
|
80
83
|
*/
|
|
81
|
-
variant: variantProp.propType
|
|
84
|
+
variant: variantProp.propType,
|
|
85
|
+
/**
|
|
86
|
+
* Offset position.
|
|
87
|
+
*/
|
|
88
|
+
offset: PropTypes.shape({
|
|
89
|
+
items: PropTypes.number,
|
|
90
|
+
current: PropTypes.number
|
|
91
|
+
})
|
|
82
92
|
};
|
|
83
93
|
export default ProgressBar;
|