@telus-uds/components-web 2.11.0 → 2.13.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +38 -2
  2. package/component-docs.json +123 -35
  3. package/lib/Autocomplete/Loading.js +5 -10
  4. package/lib/Autocomplete/dictionary.js +2 -2
  5. package/lib/Card/Card.js +2 -0
  6. package/lib/DatePicker/DatePicker.js +6 -0
  7. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +5 -10
  8. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
  9. package/lib/Footnote/FootnoteLink.js +1 -2
  10. package/lib/NavigationBar/NavigationSubMenu.js +4 -8
  11. package/lib/PriceLockup/PriceLockup.js +6 -1
  12. package/lib/Spinner/Spinner.js +10 -1
  13. package/lib/Spinner/SpinnerContent.js +8 -0
  14. package/lib/Table/Cell.js +62 -91
  15. package/lib/Table/Header.js +4 -1
  16. package/lib/Table/SubHeading.js +4 -1
  17. package/lib/Table/Table.js +2 -1
  18. package/lib/TermsAndConditions/ExpandCollapse.js +31 -13
  19. package/lib/TermsAndConditions/TermsAndConditions.js +21 -6
  20. package/lib/VideoPicker/VideoPickerPlayer.js +4 -2
  21. package/lib/VideoPicker/VideoPickerThumbnail.js +103 -60
  22. package/lib/VideoPicker/VideoSlider.js +2 -2
  23. package/lib-module/Autocomplete/Loading.js +6 -12
  24. package/lib-module/Autocomplete/dictionary.js +2 -2
  25. package/lib-module/Card/Card.js +2 -0
  26. package/lib-module/DatePicker/DatePicker.js +7 -1
  27. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -11
  28. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
  29. package/lib-module/Footnote/FootnoteLink.js +1 -2
  30. package/lib-module/NavigationBar/NavigationSubMenu.js +5 -9
  31. package/lib-module/PriceLockup/PriceLockup.js +7 -2
  32. package/lib-module/Spinner/Spinner.js +10 -1
  33. package/lib-module/Spinner/SpinnerContent.js +8 -0
  34. package/lib-module/Table/Cell.js +65 -90
  35. package/lib-module/Table/Header.js +4 -1
  36. package/lib-module/Table/SubHeading.js +4 -1
  37. package/lib-module/Table/Table.js +2 -1
  38. package/lib-module/TermsAndConditions/ExpandCollapse.js +33 -15
  39. package/lib-module/TermsAndConditions/TermsAndConditions.js +22 -7
  40. package/lib-module/VideoPicker/VideoPickerPlayer.js +4 -2
  41. package/lib-module/VideoPicker/VideoPickerThumbnail.js +103 -61
  42. package/lib-module/VideoPicker/VideoSlider.js +2 -2
  43. package/package.json +3 -3
  44. package/src/Autocomplete/Loading.jsx +2 -5
  45. package/src/Autocomplete/dictionary.js +2 -2
  46. package/src/Card/Card.jsx +12 -8
  47. package/src/DatePicker/DatePicker.jsx +8 -1
  48. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +9 -6
  49. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +21 -4
  50. package/src/Footnote/FootnoteLink.jsx +1 -2
  51. package/src/NavigationBar/NavigationSubMenu.jsx +3 -4
  52. package/src/PriceLockup/PriceLockup.jsx +7 -2
  53. package/src/Spinner/Spinner.jsx +9 -1
  54. package/src/Spinner/SpinnerContent.jsx +13 -1
  55. package/src/Table/Cell.jsx +58 -78
  56. package/src/Table/Header.jsx +6 -1
  57. package/src/Table/SubHeading.jsx +4 -1
  58. package/src/Table/Table.jsx +10 -2
  59. package/src/TermsAndConditions/ExpandCollapse.jsx +36 -14
  60. package/src/TermsAndConditions/TermsAndConditions.jsx +18 -6
  61. package/src/VideoPicker/VideoPickerPlayer.jsx +2 -2
  62. package/src/VideoPicker/VideoPickerThumbnail.jsx +51 -30
  63. package/src/VideoPicker/VideoSlider.jsx +2 -2
  64. package/types/BaseProvider.d.ts +25 -0
  65. package/types/index.d.ts +1 -1
@@ -1,6 +1,6 @@
1
- import React, { forwardRef } from 'react';
1
+ import React, { forwardRef, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { ExpandCollapse as ExpandCollapseBase, Icon, useThemeTokensCallback } from '@telus-uds/components-base';
3
+ import { ExpandCollapse as ExpandCollapseBase, IconButton, useThemeTokensCallback } from '@telus-uds/components-base';
4
4
  import styled from 'styled-components';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,12 +23,9 @@ const ExpandCollapseIconContainer = /*#__PURE__*/styled.div.withConfig({
23
23
  } = _ref;
24
24
  return {
25
25
  alignItems: tokens.expandIconContainerAlignItems,
26
- border: `${tokens.expandIconContainerBorder}px solid ${tokens.expandIconContainerBorderColor}`,
27
- borderRadius: '50%',
28
- display: 'flex',
29
- height: tokens.expandIconContainerHeight,
30
26
  justifyContent: tokens.expandIconContainerJustifyContent,
31
- margin: `${tokens.expandIconContainerMarginX}px ${tokens.expandIconContainerMarginY}px`,
27
+ marginLeft: `${tokens.expandIconContainerMarginY}px`,
28
+ marginRight: `${tokens.expandIconContainerMarginY}px`,
32
29
  width: tokens.expandIconContainerWidth
33
30
  };
34
31
  });
@@ -41,7 +38,7 @@ const ExpandCollapseTitle = /*#__PURE__*/styled.h4.withConfig({
41
38
  } = _ref2;
42
39
  return {
43
40
  color: tokens.expandTitleColor,
44
- fontFamily: `${tokens.listFontName}${tokens.listFontWeight}normal`,
41
+ fontFamily: `${tokens.expandTitleFontName}${tokens.expandTitleFontWeight}normal`,
45
42
  fontSize: tokens.expandTitleFontSize,
46
43
  lineHeight: tokens.expandTitleLineHeight,
47
44
  margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
@@ -59,8 +56,21 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
59
56
  expandContentPaddingBottom,
60
57
  expandContentPaddingLeft,
61
58
  expandContentPaddingRight,
62
- expandContentPaddingTop
59
+ expandContentPaddingTop,
60
+ contentBorderColor,
61
+ contentMarginBottom,
62
+ expandTitlePaddingLeft,
63
+ expandTitleBorder,
64
+ expandTitleBorderColor,
65
+ expandTitleUnderline
63
66
  } = getTokens();
67
+ const [expand, setExpand] = useState(false);
68
+
69
+ const handleExpandToggle = (expandProps, event, expanded) => {
70
+ expandProps.onToggle('ExpandCollapsePanel', event);
71
+ setExpand(!expanded);
72
+ };
73
+
64
74
  return /*#__PURE__*/_jsx(ExpandCollapseBase, {
65
75
  tokens: {
66
76
  borderWidth: expandBaseBorderWidth
@@ -68,7 +78,12 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
68
78
  children: expandProps => /*#__PURE__*/_jsx(ExpandCollapseBase.Panel, { ...expandProps,
69
79
  panelId: "ExpandCollapsePanel",
70
80
  controlTokens: {
71
- icon: null
81
+ icon: null,
82
+ backgroundColor: 'transparent',
83
+ paddingLeft: expandTitlePaddingLeft,
84
+ borderColor: expandTitleBorderColor,
85
+ borderWidth: expandTitleBorder,
86
+ textLine: expandTitleUnderline
72
87
  } // TODO refactor
73
88
  // eslint-disable-next-line react/no-unstable-nested-components
74
89
  ,
@@ -82,15 +97,16 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
82
97
  expanded
83
98
  });
84
99
  return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
85
- onClick: event => expandProps.onToggle('ExpandCollapsePanel', event),
100
+ onClick: event => handleExpandToggle(expandProps, event, expanded),
86
101
  ref: ref,
87
102
  children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
88
103
  tokens: getTokens(),
89
- children: /*#__PURE__*/_jsx(Icon, {
104
+ children: /*#__PURE__*/_jsx(IconButton, {
90
105
  icon: icon,
91
106
  variant: {
92
107
  size: 'small'
93
- }
108
+ },
109
+ onClick: event => handleExpandToggle(expandProps, event, expanded)
94
110
  })
95
111
  }), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
96
112
  tokens: getTokens(),
@@ -102,9 +118,11 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
102
118
  contentPaddingBottom: expandContentPaddingBottom,
103
119
  contentPaddingLeft: expandContentPaddingLeft,
104
120
  contentPaddingRight: expandContentPaddingRight,
105
- contentPaddingTop: expandContentPaddingTop
121
+ contentPaddingTop: expandContentPaddingTop,
122
+ borderColor: contentBorderColor,
123
+ marginBottom: contentMarginBottom
106
124
  },
107
- children: children
125
+ children: expand ? children : null
108
126
  })
109
127
  });
110
128
  });
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens } from '@telus-uds/components-base';
4
+ import { Box, Divider, selectSystemProps, Typography, useCopy, useThemeTokens, useViewport } from '@telus-uds/components-base';
5
5
  import ExpandCollapse from './ExpandCollapse';
6
6
  import OrderedListBase from '../OrderedList/OrderedListBase';
7
7
  import { htmlAttrs, media, renderStructuredContent } from '../utils';
@@ -47,7 +47,8 @@ const Unordered = /*#__PURE__*/styled.ul.withConfig({
47
47
  return {
48
48
  listStyleType: 'none',
49
49
  margin: 0,
50
- padding: tokens.unorderedPadding
50
+ padding: 0,
51
+ paddingTop: tokens.unorderedPadding
51
52
  };
52
53
  });
53
54
  const ListItem = /*#__PURE__*/styled(OrderedListBase.Item).withConfig({
@@ -113,9 +114,16 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
113
114
  });
114
115
  const hasIndexedContent = indexedContent.length > 0;
115
116
  const hasNonIndexedContent = nonIndexedContent.length > 0;
116
- const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant);
117
+ const viewport = useViewport();
118
+ const themeTokens = useThemeTokens('TermsAndConditions', tokens, variant, {
119
+ viewport
120
+ });
117
121
  return /*#__PURE__*/_jsxs("div", { ...selectProps(rest),
118
- children: [/*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(ExpandCollapse, {
122
+ children: [/*#__PURE__*/_jsx(Divider, {
123
+ tokens: {
124
+ color: themeTokens.dividerColor
125
+ }
126
+ }), /*#__PURE__*/_jsx(ExpandCollapse, {
119
127
  collapseTitle: getCopy('headingView'),
120
128
  expandTitle: getCopy('headingHide'),
121
129
  ref: ref,
@@ -137,8 +145,11 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
137
145
  children: /*#__PURE__*/_jsx(Typography, {
138
146
  block: true,
139
147
  heading: true,
140
- variant: {
141
- size: 'h4'
148
+ tokens: {
149
+ fontName: themeTokens.expandTitleFontName,
150
+ fontWeight: themeTokens.expandTitleFontWeight,
151
+ fontSize: themeTokens.titleFontSize,
152
+ lineHeight: themeTokens.titleLineHeight
142
153
  },
143
154
  children: getCopy('nonIndexedTitle')
144
155
  })
@@ -154,7 +165,11 @@ const TermsAndConditions = /*#__PURE__*/forwardRef((_ref6, ref) => {
154
165
  })]
155
166
  })]
156
167
  })
157
- }), /*#__PURE__*/_jsx(Divider, {})]
168
+ }), /*#__PURE__*/_jsx(Divider, {
169
+ tokens: {
170
+ color: themeTokens.dividerColor
171
+ }
172
+ })]
158
173
  });
159
174
  });
160
175
  TermsAndConditions.displayName = 'TermsAndConditions';
@@ -26,11 +26,13 @@ const VideoPickerPlayer = _ref => {
26
26
  space: 2,
27
27
  children: [/*#__PURE__*/_jsx(Typography, {
28
28
  variant: {
29
- size: 'h2',
30
- colour: 'secondary'
29
+ size: 'h3'
31
30
  },
32
31
  children: video.title
33
32
  }), /*#__PURE__*/_jsx(Typography, {
33
+ variant: {
34
+ colour: 'default'
35
+ },
34
36
  children: video.description
35
37
  })]
36
38
  })]
@@ -4,7 +4,7 @@ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
4
4
  import PropTypes from 'prop-types';
5
5
  import { viewports } from '@telus-uds/system-constants';
6
6
  import styled from 'styled-components';
7
- import { StackView, Typography, useViewport, horizontalScrollUtils, useThemeTokens } from '@telus-uds/components-base';
7
+ import { StackView, Typography, useViewport, horizontalScrollUtils, useThemeTokensCallback } from '@telus-uds/components-base';
8
8
  import { getTimestamp } from '../shared/VideoSplash/helpers';
9
9
  import { VideoPropType, RefPropType } from './videoPropType';
10
10
  import VideoSplash from '../shared/VideoSplash/VideoSplash';
@@ -42,37 +42,45 @@ const createReactNativeStyles = _ref => {
42
42
  });
43
43
  };
44
44
 
45
- const VideoThumbnail = /*#__PURE__*/styled.div.withConfig({
46
- displayName: "VideoPickerThumbnail__VideoThumbnail",
45
+ const ImageContainer = /*#__PURE__*/styled.div.withConfig({
46
+ displayName: "VideoPickerThumbnail__ImageContainer",
47
47
  componentId: "components-web__sc-1glxurq-0"
48
- })(["position:relative;width:", ";flex-shrink:0;* button{display:none;}&::before{content:'';display:block;padding-bottom:56.25%;}&::after{content:'';border:", "px solid;border-color:", ";border-radius:", "px;position:absolute;top:0;left:0;right:0;bottom:0;}& > div{border-radius:", "px;}"], props => props.layout === 'vertical' ? '100%' : '144px', _ref2 => {
48
+ })(["padding:", ";border:", ";border-radius:", "px;"], props => `${props.outerBorderGap}px`, props => `${props.outerBorderWidth}px solid ${props.outerBorderColor}`, _ref2 => {
49
49
  let {
50
- borderWidth
50
+ outerBorderRadius
51
51
  } = _ref2;
52
- return borderWidth;
53
- }, _ref3 => {
52
+ return outerBorderRadius;
53
+ });
54
+ const VideoThumbnail = /*#__PURE__*/styled.div.withConfig({
55
+ displayName: "VideoPickerThumbnail__VideoThumbnail",
56
+ componentId: "components-web__sc-1glxurq-1"
57
+ })(["position:relative;width:", ";flex-shrink:0;* button{display:none;}&::before{content:'';display:block;padding-bottom:56.25%;}&::after{content:'';border:", "px solid;border-color:", ";border-radius:", "px;position:absolute;top:0;left:0;right:0;bottom:0;}& > div{border-radius:", "px;}"], props => props.layout === 'vertical' ? '100%' : '144px', _ref3 => {
54
58
  let {
55
- isPlaying,
56
- borderColor
59
+ borderWidth
57
60
  } = _ref3;
58
- return isPlaying ? borderColor : 'transparent';
61
+ return borderWidth;
59
62
  }, _ref4 => {
60
63
  let {
61
- borderRadius
64
+ borderColor
62
65
  } = _ref4;
63
- return borderRadius;
66
+ return borderColor;
64
67
  }, _ref5 => {
65
68
  let {
66
69
  borderRadius
67
70
  } = _ref5;
68
71
  return borderRadius;
72
+ }, _ref6 => {
73
+ let {
74
+ borderRadius
75
+ } = _ref6;
76
+ return borderRadius;
69
77
  });
70
78
  const ThumbnailTitleContainer = /*#__PURE__*/styled.div.withConfig({
71
79
  displayName: "VideoPickerThumbnail__ThumbnailTitleContainer",
72
- componentId: "components-web__sc-1glxurq-1"
80
+ componentId: "components-web__sc-1glxurq-2"
73
81
  })(["display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;"]);
74
82
 
75
- const VideoPickerThumbnail = _ref6 => {
83
+ const VideoPickerThumbnail = _ref7 => {
76
84
  let {
77
85
  videoPlayerRef,
78
86
  selectedVideoId,
@@ -83,56 +91,59 @@ const VideoPickerThumbnail = _ref6 => {
83
91
  itemPositions,
84
92
  index,
85
93
  width = '100%'
86
- } = _ref6;
94
+ } = _ref7;
87
95
  const viewport = useViewport();
88
- const {
89
- titleColor,
90
- subTitleColor,
91
- ...themeTokens
92
- } = useThemeTokens('VideoPickerThumbnail');
93
- const rnStyles = createReactNativeStyles(themeTokens);
96
+ const getTokens = useThemeTokensCallback('VideoPickerThumbnail', {}, {});
94
97
  const {
95
98
  timestamp
96
99
  } = getTimestamp(video.videoLength, video.copy);
97
100
  const isPlaying = selectedVideoId === video.videoId;
98
101
 
99
- const renderThumbnailImage = () => /*#__PURE__*/_jsx(VideoThumbnail, { ...themeTokens,
100
- isPlaying: isPlaying,
101
- layout: layout,
102
- children: /*#__PURE__*/_jsx(VideoSplash, {
103
- simpleMode: true,
104
- poster: video.posterSrc || `https://img.youtube.com/vi/${video.videoId}/maxresdefault.jpg`,
105
- videoLength: video.videoLength,
106
- copy: video.copy
107
- })
108
- });
102
+ const renderThumbnailImage = themeTokens => {
103
+ return /*#__PURE__*/_jsx(VideoThumbnail, { ...themeTokens,
104
+ isPlaying: isPlaying,
105
+ layout: layout,
106
+ children: /*#__PURE__*/_jsx(VideoSplash, {
107
+ simpleMode: true,
108
+ poster: video.posterSrc || `https://img.youtube.com/vi/${video.videoId}/maxresdefault.jpg`,
109
+ videoLength: video.videoLength,
110
+ copy: video.copy
111
+ })
112
+ });
113
+ };
109
114
 
110
- const renderThumbnailInfo = () => /*#__PURE__*/_jsxs(StackView, {
111
- space: 2,
112
- tokens: {
113
- flexShrink: 1
114
- },
115
- children: [/*#__PURE__*/_jsx(ThumbnailTitleContainer, {
116
- viewport: viewport,
117
- children: /*#__PURE__*/_jsx(Typography, {
115
+ const renderThumbnailInfo = _ref8 => {
116
+ let {
117
+ titleColor,
118
+ subTitleColor
119
+ } = _ref8;
120
+ return /*#__PURE__*/_jsxs(StackView, {
121
+ space: 2,
122
+ tokens: {
123
+ flexShrink: 1
124
+ },
125
+ children: [/*#__PURE__*/_jsx(ThumbnailTitleContainer, {
126
+ viewport: viewport,
127
+ children: /*#__PURE__*/_jsx(Typography, {
128
+ variant: {
129
+ bold: true
130
+ },
131
+ tokens: {
132
+ color: titleColor
133
+ },
134
+ children: video.title
135
+ })
136
+ }), viewport !== viewports.xs && /*#__PURE__*/_jsx(Typography, {
118
137
  variant: {
119
- bold: true
138
+ size: 'micro'
120
139
  },
121
140
  tokens: {
122
- color: isPlaying ? titleColor : 'none'
141
+ color: subTitleColor
123
142
  },
124
- children: video.title
125
- })
126
- }), viewport !== viewports.xs && /*#__PURE__*/_jsx(Typography, {
127
- variant: {
128
- size: 'micro'
129
- },
130
- tokens: {
131
- color: subTitleColor
132
- },
133
- children: timestamp
134
- })]
135
- });
143
+ children: timestamp
144
+ })]
145
+ });
146
+ };
136
147
 
137
148
  const handleLayout = itemPositions !== undefined ? getItemPositionLayoutHandler(itemPositions.positions, index) : undefined;
138
149
 
@@ -155,14 +166,45 @@ const VideoPickerThumbnail = _ref6 => {
155
166
  accessibilityState: {
156
167
  checked: isPlaying
157
168
  },
158
- style: [rnStyles.container, layout === 'horizontal' && rnStyles.horizontal, isFramed && rnStyles.framed, isFramed && index > 0 && rnStyles.framedLine, {
159
- width
160
- }],
161
- children: /*#__PURE__*/_jsxs(StackView, {
162
- space: layout === 'vertical' ? 2 : 3,
163
- direction: layout === 'vertical' ? 'column' : 'row',
164
- children: [renderThumbnailImage(), renderThumbnailInfo()]
165
- })
169
+ style: _ref9 => {
170
+ let {
171
+ hovered: hover,
172
+ focused: focus,
173
+ pressed
174
+ } = _ref9;
175
+ const themeTokens = getTokens({
176
+ hover,
177
+ focus,
178
+ pressed,
179
+ selected: isPlaying
180
+ });
181
+ const rnStyles = createReactNativeStyles(themeTokens);
182
+ return [rnStyles.container, layout === 'horizontal' && rnStyles.horizontal, isFramed && rnStyles.framed, isFramed && index > 0 && rnStyles.framedLine, {
183
+ width
184
+ }, {
185
+ outline: 'none'
186
+ }];
187
+ },
188
+ children: _ref10 => {
189
+ let {
190
+ hovered: hover,
191
+ focused: focus,
192
+ pressed
193
+ } = _ref10;
194
+ const themeTokens = getTokens({
195
+ hover,
196
+ focus,
197
+ pressed,
198
+ selected: isPlaying
199
+ });
200
+ return /*#__PURE__*/_jsxs(StackView, {
201
+ space: layout === 'vertical' ? 2 : 3,
202
+ direction: layout === 'vertical' ? 'column' : 'row',
203
+ children: [/*#__PURE__*/_jsx(ImageContainer, { ...themeTokens,
204
+ children: renderThumbnailImage(themeTokens)
205
+ }), renderThumbnailInfo(themeTokens)]
206
+ });
207
+ }
166
208
  }, video.videoId);
167
209
  };
168
210
 
@@ -30,7 +30,7 @@ const VideoSlider = _ref => {
30
30
  setContainerWidth(width);
31
31
  };
32
32
 
33
- const itemsGap = 24; // '4' on spacing scale
33
+ const itemsGap = 32; // '5' on spacing scale
34
34
 
35
35
  const itemsCount = viewport === 'lg' || viewport === 'xl' ? 4 : 3;
36
36
  const itemGapPortioned = (itemsCount - 1) * itemsGap / itemsCount;
@@ -40,7 +40,7 @@ const VideoSlider = _ref => {
40
40
  );
41
41
 
42
42
  const content = /*#__PURE__*/_jsx(StackView, {
43
- space: 4,
43
+ space: 5,
44
44
  direction: "row",
45
45
  accessibilityRole: "radiogroup",
46
46
  tokens: {
package/package.json CHANGED
@@ -5,14 +5,14 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.52.0",
8
+ "@telus-uds/components-base": "1.54.0",
9
9
  "@telus-uds/system-constants": "^1.2.1",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
12
12
  "react-dates": "^21.8.0",
13
13
  "react-helmet-async": "^1.3.0",
14
14
  "react-moment-proptypes": "^1.8.1",
15
- "@telus-uds/system-theme-tokens": "^2.35.0",
15
+ "@telus-uds/system-theme-tokens": "^2.37.0",
16
16
  "prop-types": "^15.7.2",
17
17
  "lodash.throttle": "^4.1.1",
18
18
  "react-youtube": "^10.1.0",
@@ -63,5 +63,5 @@
63
63
  "skip": true
64
64
  },
65
65
  "types": "types/index.d.ts",
66
- "version": "2.11.0"
66
+ "version": "2.13.0"
67
67
  }
@@ -1,15 +1,12 @@
1
1
  import React from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { Box, StackView, Typography } from '@telus-uds/components-base'
3
+ import { Box, StackView } from '@telus-uds/components-base'
4
4
  import Spinner from '../Spinner'
5
5
 
6
6
  const Loading = ({ label }) => (
7
7
  <Box space={3}>
8
8
  <StackView direction="row" space={2} tokens={{ alignItems: 'center' }}>
9
- <Spinner inline={true} show={true} size="small" />
10
- <Typography variant={{ size: 'small' }} accessibilityLiveRegion="polite">
11
- {label}
12
- </Typography>
9
+ <Spinner inline={true} show={true} label={label} labelPosition="right" />
13
10
  </StackView>
14
11
  </Box>
15
12
  )
@@ -1,12 +1,12 @@
1
1
  export default {
2
2
  en: {
3
3
  hasResults: 'Some results are available',
4
- loading: 'Loading suggestions...',
4
+ loading: 'Searching...',
5
5
  noResults: 'No results found'
6
6
  },
7
7
  fr: {
8
8
  hasResults: 'Quelques suggestions sont disponible',
9
- loading: 'Chargement en cours...',
9
+ loading: 'Recherche...',
10
10
  noResults: 'Aucun résultat trouvé'
11
11
  }
12
12
  }
package/src/Card/Card.jsx CHANGED
@@ -23,18 +23,22 @@ import FullBleedContent, {
23
23
  const selectCardBaseTokens = ({
24
24
  backgroundColor,
25
25
  borderColor,
26
+ gradient,
26
27
  borderWidth,
27
28
  borderRadius,
28
29
  shadow,
29
30
  minWidth
30
- }) => ({
31
- backgroundColor,
32
- borderColor,
33
- borderWidth,
34
- borderRadius,
35
- shadow,
36
- minWidth
37
- })
31
+ }) => {
32
+ return {
33
+ backgroundColor,
34
+ borderColor,
35
+ gradient,
36
+ borderWidth,
37
+ borderRadius,
38
+ shadow,
39
+ minWidth
40
+ }
41
+ }
38
42
 
39
43
  // Passes React Native-oriented system props through UDS Card
40
44
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, useState } from 'react'
1
+ import React, { forwardRef, useEffect, useState } from 'react'
2
2
  import PropTypes from 'prop-types'
3
3
  import styled from 'styled-components'
4
4
  import momentPropTypes from 'react-moment-proptypes'
@@ -43,6 +43,7 @@ const getResponsiveCircleSize = (inline = false, viewport = 'md') => {
43
43
 
44
44
  return responsiveCircleSize
45
45
  }
46
+
46
47
  const MonthCenterContainer = styled.div({
47
48
  display: 'flex',
48
49
  justifyContent: 'center'
@@ -104,6 +105,12 @@ const DatePicker = forwardRef(
104
105
  const [isFocused, setIsFocused] = useState(false)
105
106
  const [isClickedInside, setIsClickedInside] = useState(false)
106
107
  const getCopy = useCopy({ dictionary, copy })
108
+ useEffect(() => {
109
+ if (!moment(date).isSame(inputDate)) {
110
+ setInputDate(date)
111
+ setInputText(date instanceof moment ? date.format(dateFormat) : '')
112
+ }
113
+ }, [date, inputDate])
107
114
  const onFocusChange = ({ focused }) => {
108
115
  if (!isClickedInside) {
109
116
  setIsFocused(focused)
@@ -1,12 +1,9 @@
1
1
  import React, { forwardRef } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { ExpandCollapse, useThemeTokens } from '@telus-uds/components-base'
3
+ import { ExpandCollapse } from '@telus-uds/components-base'
4
4
  import ExpandCollapseMiniControl from './ExpandCollapseMiniControl'
5
5
 
6
6
  const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest }, ref) => {
7
- const { variant } = rest
8
- const { borderWidth } = useThemeTokens('ExpandCollapseMini', tokens, variant)
9
-
10
7
  const handleChange = (openPanels, event) => {
11
8
  if (typeof onToggle === 'function') {
12
9
  const isOpen = openPanels.length > 0
@@ -15,13 +12,19 @@ const ExpandCollapseMini = forwardRef(({ children, onToggle, tokens, ...rest },
15
12
  }
16
13
 
17
14
  return (
18
- <ExpandCollapse tokens={{ borderWidth }} onChange={handleChange}>
15
+ <ExpandCollapse onChange={handleChange}>
19
16
  {(expandProps) => (
20
17
  <ExpandCollapse.Panel
21
18
  {...expandProps}
22
19
  panelId="ExpandCollapseMiniPanel"
23
20
  variant={{ mini: true }}
24
- controlTokens={{ icon: null }}
21
+ controlTokens={{
22
+ // Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
23
+ icon: null,
24
+ borderColor: 'transparent',
25
+ textLine: 'none',
26
+ backgroundColor: 'transparent'
27
+ }}
25
28
  // TODO refactor
26
29
  // eslint-disable-next-line react/no-unstable-nested-components
27
30
  control={(pressableState) => (
@@ -13,6 +13,13 @@ const presentationOnly = {
13
13
  focusable: false // Stop RNW from setting tabIndex={0}: focus goes to Control only
14
14
  }
15
15
 
16
+ const selectLinkTokens = ({ color, textLine, lineHeight, fontSize }) => ({
17
+ color,
18
+ textLine,
19
+ blockLineHeight: lineHeight,
20
+ blockFontSize: fontSize
21
+ })
22
+
16
23
  const ExpandCollapseMiniControl = ({
17
24
  pressableState,
18
25
  collapseTitle,
@@ -22,9 +29,15 @@ const ExpandCollapseMiniControl = ({
22
29
  variant = {},
23
30
  ...rest
24
31
  }) => {
25
- const { expanded, hover } = pressableState || {}
26
-
27
- const { size, icon } = useThemeTokens('ExpandCollapseMiniControl', tokens, variant, { expanded })
32
+ const { expanded, hover, focus } = pressableState || {}
33
+ // we only want focus outline when focusing, if user is pressing we don't want the border.
34
+ const { outerBorderColor } = useThemeTokens('Link', {}, {}, { focus })
35
+ const { size, icon, ...themeTokens } = useThemeTokens(
36
+ 'ExpandCollapseMiniControl',
37
+ tokens,
38
+ variant,
39
+ { expanded, focus }
40
+ )
28
41
 
29
42
  // Choose hover styles when any part of Control is hoverred
30
43
  const appearance = { ...variant, hover }
@@ -45,7 +58,11 @@ const ExpandCollapseMiniControl = ({
45
58
  variant={appearance}
46
59
  icon={icon}
47
60
  iconPosition={iconPosition}
48
- tokens={(linkState) => ({ ...getTokens(linkState), outerBorderWidth: 0 })}
61
+ tokens={(linkState) => ({
62
+ ...getTokens(linkState),
63
+ ...selectLinkTokens(themeTokens),
64
+ outerBorderColor
65
+ })}
49
66
  {...presentationOnly}
50
67
  {...selectProps(rest)}
51
68
  >
@@ -123,8 +123,7 @@ FootnoteLink.propTypes = {
123
123
  }
124
124
 
125
125
  FootnoteLink.defaultProps = {
126
- copy: 'en',
127
- fontSize: 'smaller'
126
+ copy: 'en'
128
127
  }
129
128
 
130
129
  export default FootnoteLink
@@ -1,6 +1,6 @@
1
1
  import React, { useRef } from 'react'
2
2
  import PropTypes from 'prop-types'
3
- import { Icon, Spacer, useResponsiveProp, useThemeTokens } from '@telus-uds/components-base'
3
+ import { Icon, useResponsiveProp, useThemeTokens } from '@telus-uds/components-base'
4
4
  import NavigationItem from './NavigationItem'
5
5
  import Listbox from '../Listbox'
6
6
  import useOverlaidPosition from '../utils/useOverlaidPosition'
@@ -61,12 +61,11 @@ const NavigationSubMenu = ({
61
61
  >
62
62
  {({ textStyles }) => [
63
63
  children,
64
- <Spacer key={`${id}_spacer`} space={1} direction="row" />,
65
64
  <Icon
66
65
  key={`${id}_icon`}
67
66
  icon={icoMenu}
68
- variant={{ size: 'small' }}
69
- tokens={{ color: textStyles[0]?.color, size: textStyles[0]?.fontSize }}
67
+ variant={{ size: 'micro' }}
68
+ tokens={{ color: textStyles[0]?.color }}
70
69
  />
71
70
  ]}
72
71
  </NavigationItem>