@telus-uds/components-web 2.28.0 → 2.30.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 CHANGED
@@ -1,12 +1,40 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Mon, 08 Jan 2024 20:08:06 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 29 Jan 2024 18:26:01 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.30.0
8
+
9
+ Mon, 29 Jan 2024 18:26:01 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Add "use client" directive to Image (wlsdud194@hotmail.com)
14
+ - Bump @telus-uds/components-base to v1.75.0
15
+ - Bump @telus-uds/system-theme-tokens to v2.50.1
16
+
17
+ ### Patches
18
+
19
+ - fix termsAndCondition component visual states (guillermo.peitzner@telus.com)
20
+
21
+ ## 2.29.0
22
+
23
+ Thu, 18 Jan 2024 22:55:53 GMT
24
+
25
+ ### Minor changes
26
+
27
+ - prop for footer to handle mobile (ben@mcloughlin.dev)
28
+ - Bump @telus-uds/components-base to v1.74.0
29
+ - Bump @telus-uds/system-theme-tokens to v2.50.0
30
+
31
+ ### Patches
32
+
33
+ - fix hardcorded french label from datepicker (guillermo.peitzner@telus.com)
34
+
7
35
  ## 2.28.0
8
36
 
9
- Mon, 08 Jan 2024 20:08:06 GMT
37
+ Mon, 08 Jan 2024 20:16:06 GMT
10
38
 
11
39
  ### Minor changes
12
40
 
@@ -323,7 +323,7 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
323
323
  onChange: onChangeInput,
324
324
  tooltip: tooltip,
325
325
  hintPosition: hintPosition,
326
- label: ((_dictionary$copy = _dictionary.default[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription) ?? label,
326
+ label: label ?? ((_dictionary$copy = _dictionary.default[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription),
327
327
  value: inputText,
328
328
  validation: validation,
329
329
  inactive: disabled,
@@ -30,7 +30,8 @@ const StyledFootnote = /*#__PURE__*/_styledComponents.default.div.withConfig({
30
30
  footnoteBackground,
31
31
  isVisible,
32
32
  footnoteBorderTop,
33
- isScrollable
33
+ isScrollable,
34
+ isMobileFullScreen
34
35
  } = _ref;
35
36
  return {
36
37
  position: 'fixed',
@@ -49,7 +50,7 @@ const StyledFootnote = /*#__PURE__*/_styledComponents.default.div.withConfig({
49
50
  },
50
51
  zIndex: 99999,
51
52
  visibility: isVisible ? 'visible' : 'hidden',
52
- ...(0, _utils.media)().from('md').css({
53
+ ...(0, _utils.media)().from(isMobileFullScreen ? 'md' : 'xs').css({
53
54
  top: 'auto',
54
55
  bottom: 0,
55
56
  height: 'auto',
@@ -262,6 +263,7 @@ const Footnote = props => {
262
263
  isOpen,
263
264
  tokens,
264
265
  variant = {},
266
+ isMobileFullScreen = true,
265
267
  dictionary = _dictionary.default,
266
268
  ...rest
267
269
  } = props;
@@ -507,6 +509,7 @@ const Footnote = props => {
507
509
  footnoteBackground: footnoteBackground,
508
510
  footnoteBorderTop: `${footnoteBorderTopSizeMd}px solid ${footnoteBorderColorMd}`,
509
511
  isScrollable: isScrollable,
512
+ isMobileFullScreen: isMobileFullScreen,
510
513
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentContainer, {
511
514
  maxWidth: maxWidth,
512
515
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledFootnoteHeader, {
@@ -609,13 +612,18 @@ Footnote.propTypes = {
609
612
  dictionary: _propTypes.default.shape({
610
613
  en: dictionaryContentShape,
611
614
  fr: dictionaryContentShape
612
- })
615
+ }),
616
+ /**
617
+ * A boolean flag used to disable isMobileFullScreen of Footnote for mobile view
618
+ */
619
+ isMobileFullScreen: _propTypes.default.bool
613
620
  };
614
621
  Footnote.defaultProps = {
615
622
  isOpen: false,
616
623
  number: undefined,
617
624
  content: undefined,
618
- copy: 'en'
625
+ copy: 'en',
626
+ isMobileFullScreen: true
619
627
  };
620
628
  var _default = Footnote;
621
629
  exports.default = _default;
@@ -87,6 +87,7 @@ const FootnoteLink = _ref2 => {
87
87
  "aria-label": getCopy('a11yLabel'),
88
88
  ref: refs[index],
89
89
  onClick: event => handleOnClick(event, index),
90
+ tabIndex: 0,
90
91
  ...selectProps(rest),
91
92
  ...themeTokens,
92
93
  fontSize: fontSize,
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ 'use client';
2
3
 
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
@@ -52,12 +52,32 @@ const ExpandCollapseTitle = /*#__PURE__*/_styledComponents.default.h4.withConfig
52
52
  margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
53
53
  };
54
54
  });
55
- const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
55
+ const getIconButtonTokens = _ref3 => {
56
+ let {
57
+ icon,
58
+ iconBackgroundColor,
59
+ iconBorderColor,
60
+ iconColor,
61
+ iconOuterBorderColor,
62
+ iconOuterBorderGap,
63
+ iconOuterBorderWidth
64
+ } = _ref3;
65
+ return {
66
+ icon,
67
+ backgroundColor: iconBackgroundColor,
68
+ borderColor: iconBorderColor,
69
+ iconColor,
70
+ outerBorderColor: iconOuterBorderColor,
71
+ outerBorderGap: iconOuterBorderGap,
72
+ outerBorderWidth: iconOuterBorderWidth
73
+ };
74
+ };
75
+ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
56
76
  let {
57
77
  children,
58
78
  collapseTitle,
59
79
  expandTitle = collapseTitle
60
- } = _ref3;
80
+ } = _ref4;
61
81
  const getTokens = (0, _componentsBase.useThemeTokensCallback)('TermsAndConditions', {}, {});
62
82
  const {
63
83
  expandBaseBorderWidth,
@@ -94,20 +114,17 @@ const ExpandCollapse = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
94
114
  const {
95
115
  expanded
96
116
  } = pressableState || {};
97
- const {
98
- icon
99
- } = getTokens({
100
- expanded
101
- });
117
+ const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
102
118
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ExpandCollapseControl, {
103
119
  ref: ref,
104
120
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseIconContainer, {
105
121
  tokens: getTokens(),
106
122
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.IconButton, {
107
- icon: icon,
108
123
  variant: {
109
124
  size: 'small'
110
- }
125
+ },
126
+ tokens: iconTokens,
127
+ focusable: false
111
128
  })
112
129
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandCollapseTitle, {
113
130
  tokens: getTokens(),
@@ -316,7 +316,7 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref3, ref) => {
316
316
  onChange: onChangeInput,
317
317
  tooltip: tooltip,
318
318
  hintPosition: hintPosition,
319
- label: ((_dictionary$copy = dictionary[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription) ?? label,
319
+ label: label ?? ((_dictionary$copy = dictionary[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription),
320
320
  value: inputText,
321
321
  validation: validation,
322
322
  inactive: disabled,
@@ -22,7 +22,8 @@ const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
22
22
  footnoteBackground,
23
23
  isVisible,
24
24
  footnoteBorderTop,
25
- isScrollable
25
+ isScrollable,
26
+ isMobileFullScreen
26
27
  } = _ref;
27
28
  return {
28
29
  position: 'fixed',
@@ -41,7 +42,7 @@ const StyledFootnote = /*#__PURE__*/styled.div.withConfig({
41
42
  },
42
43
  zIndex: 99999,
43
44
  visibility: isVisible ? 'visible' : 'hidden',
44
- ...media().from('md').css({
45
+ ...media().from(isMobileFullScreen ? 'md' : 'xs').css({
45
46
  top: 'auto',
46
47
  bottom: 0,
47
48
  height: 'auto',
@@ -254,6 +255,7 @@ const Footnote = props => {
254
255
  isOpen,
255
256
  tokens,
256
257
  variant = {},
258
+ isMobileFullScreen = true,
257
259
  dictionary = defaultDictionary,
258
260
  ...rest
259
261
  } = props;
@@ -499,6 +501,7 @@ const Footnote = props => {
499
501
  footnoteBackground: footnoteBackground,
500
502
  footnoteBorderTop: `${footnoteBorderTopSizeMd}px solid ${footnoteBorderColorMd}`,
501
503
  isScrollable: isScrollable,
504
+ isMobileFullScreen: isMobileFullScreen,
502
505
  children: /*#__PURE__*/_jsxs(ContentContainer, {
503
506
  maxWidth: maxWidth,
504
507
  children: [/*#__PURE__*/_jsx(StyledFootnoteHeader, {
@@ -601,12 +604,17 @@ Footnote.propTypes = {
601
604
  dictionary: PropTypes.shape({
602
605
  en: dictionaryContentShape,
603
606
  fr: dictionaryContentShape
604
- })
607
+ }),
608
+ /**
609
+ * A boolean flag used to disable isMobileFullScreen of Footnote for mobile view
610
+ */
611
+ isMobileFullScreen: PropTypes.bool
605
612
  };
606
613
  Footnote.defaultProps = {
607
614
  isOpen: false,
608
615
  number: undefined,
609
616
  content: undefined,
610
- copy: 'en'
617
+ copy: 'en',
618
+ isMobileFullScreen: true
611
619
  };
612
620
  export default Footnote;
@@ -81,6 +81,7 @@ const FootnoteLink = _ref2 => {
81
81
  "aria-label": getCopy('a11yLabel'),
82
82
  ref: refs[index],
83
83
  onClick: event => handleOnClick(event, index),
84
+ tabIndex: 0,
84
85
  ...selectProps(rest),
85
86
  ...themeTokens,
86
87
  fontSize: fontSize,
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import Image from './Image';
2
4
  import withClientTheme from '../utils/theming/with-client-theme';
3
5
 
@@ -44,12 +44,32 @@ const ExpandCollapseTitle = /*#__PURE__*/styled.h4.withConfig({
44
44
  margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
45
45
  };
46
46
  });
47
- const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
47
+ const getIconButtonTokens = _ref3 => {
48
+ let {
49
+ icon,
50
+ iconBackgroundColor,
51
+ iconBorderColor,
52
+ iconColor,
53
+ iconOuterBorderColor,
54
+ iconOuterBorderGap,
55
+ iconOuterBorderWidth
56
+ } = _ref3;
57
+ return {
58
+ icon,
59
+ backgroundColor: iconBackgroundColor,
60
+ borderColor: iconBorderColor,
61
+ iconColor,
62
+ outerBorderColor: iconOuterBorderColor,
63
+ outerBorderGap: iconOuterBorderGap,
64
+ outerBorderWidth: iconOuterBorderWidth
65
+ };
66
+ };
67
+ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref4, ref) => {
48
68
  let {
49
69
  children,
50
70
  collapseTitle,
51
71
  expandTitle = collapseTitle
52
- } = _ref3;
72
+ } = _ref4;
53
73
  const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {});
54
74
  const {
55
75
  expandBaseBorderWidth,
@@ -86,20 +106,17 @@ const ExpandCollapse = /*#__PURE__*/forwardRef((_ref3, ref) => {
86
106
  const {
87
107
  expanded
88
108
  } = pressableState || {};
89
- const {
90
- icon
91
- } = getTokens({
92
- expanded
93
- });
109
+ const iconTokens = getIconButtonTokens(getTokens(pressableState || {}));
94
110
  return /*#__PURE__*/_jsxs(ExpandCollapseControl, {
95
111
  ref: ref,
96
112
  children: [/*#__PURE__*/_jsx(ExpandCollapseIconContainer, {
97
113
  tokens: getTokens(),
98
114
  children: /*#__PURE__*/_jsx(IconButton, {
99
- icon: icon,
100
115
  variant: {
101
116
  size: 'small'
102
- }
117
+ },
118
+ tokens: iconTokens,
119
+ focusable: false
103
120
  })
104
121
  }), /*#__PURE__*/_jsx(ExpandCollapseTitle, {
105
122
  tokens: getTokens(),
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  ],
6
6
  "dependencies": {
7
7
  "@gorhom/portal": "^1.0.14",
8
- "@telus-uds/components-base": "1.73.0",
8
+ "@telus-uds/components-base": "1.75.0",
9
9
  "@telus-uds/system-constants": "^1.3.0",
10
10
  "fscreen": "^1.2.0",
11
11
  "lodash.omit": "^4.5.0",
@@ -13,7 +13,7 @@
13
13
  "react-dates": "^21.8.0",
14
14
  "react-helmet-async": "^1.3.0",
15
15
  "react-moment-proptypes": "^1.8.1",
16
- "@telus-uds/system-theme-tokens": "^2.49.0",
16
+ "@telus-uds/system-theme-tokens": "^2.50.1",
17
17
  "prop-types": "^15.7.2",
18
18
  "lodash.throttle": "^4.1.1",
19
19
  "react-youtube": "^10.1.0",
@@ -83,5 +83,5 @@
83
83
  "skip": true
84
84
  },
85
85
  "types": "types/index.d.ts",
86
- "version": "2.28.0"
86
+ "version": "2.30.0"
87
87
  }
@@ -288,7 +288,7 @@ const DatePicker = forwardRef(
288
288
  onChange={onChangeInput}
289
289
  tooltip={tooltip}
290
290
  hintPosition={hintPosition}
291
- label={dictionary[copy]?.roleDescription ?? label}
291
+ label={label ?? dictionary[copy]?.roleDescription}
292
292
  value={inputText}
293
293
  validation={validation}
294
294
  inactive={disabled}
@@ -26,7 +26,7 @@ const GlobalBodyScrollLock = createGlobalStyle({
26
26
  })
27
27
 
28
28
  const StyledFootnote = styled.div(
29
- ({ footnoteBackground, isVisible, footnoteBorderTop, isScrollable }) => ({
29
+ ({ footnoteBackground, isVisible, footnoteBorderTop, isScrollable, isMobileFullScreen }) => ({
30
30
  position: 'fixed',
31
31
  overflowY: isVisible && isScrollable ? 'scroll' : 'hidden',
32
32
  top: 0,
@@ -43,13 +43,15 @@ const StyledFootnote = styled.div(
43
43
  },
44
44
  zIndex: 99999,
45
45
  visibility: isVisible ? 'visible' : 'hidden',
46
- ...media().from('md').css({
47
- top: 'auto',
48
- bottom: 0,
49
- height: 'auto',
50
- maxHeight: '50vh',
51
- borderTop: footnoteBorderTop
52
- })
46
+ ...media()
47
+ .from(isMobileFullScreen ? 'md' : 'xs')
48
+ .css({
49
+ top: 'auto',
50
+ bottom: 0,
51
+ height: 'auto',
52
+ maxHeight: '50vh',
53
+ borderTop: footnoteBorderTop
54
+ })
53
55
  }),
54
56
  ({ isOpen }) => {
55
57
  if (isOpen) {
@@ -217,6 +219,7 @@ const Footnote = (props) => {
217
219
  isOpen,
218
220
  tokens,
219
221
  variant = {},
222
+ isMobileFullScreen = true,
220
223
  dictionary = defaultDictionary,
221
224
  ...rest
222
225
  } = props
@@ -488,6 +491,7 @@ const Footnote = (props) => {
488
491
  footnoteBackground={footnoteBackground}
489
492
  footnoteBorderTop={`${footnoteBorderTopSizeMd}px solid ${footnoteBorderColorMd}`}
490
493
  isScrollable={isScrollable}
494
+ isMobileFullScreen={isMobileFullScreen}
491
495
  >
492
496
  <ContentContainer maxWidth={maxWidth}>
493
497
  <StyledFootnoteHeader ref={headerRef} viewport={viewport}>
@@ -588,14 +592,19 @@ Footnote.propTypes = {
588
592
  dictionary: PropTypes.shape({
589
593
  en: dictionaryContentShape,
590
594
  fr: dictionaryContentShape
591
- })
595
+ }),
596
+ /**
597
+ * A boolean flag used to disable isMobileFullScreen of Footnote for mobile view
598
+ */
599
+ isMobileFullScreen: PropTypes.bool
592
600
  }
593
601
 
594
602
  Footnote.defaultProps = {
595
603
  isOpen: false,
596
604
  number: undefined,
597
605
  content: undefined,
598
- copy: 'en'
606
+ copy: 'en',
607
+ isMobileFullScreen: true
599
608
  }
600
609
 
601
610
  export default Footnote
@@ -80,6 +80,7 @@ const FootnoteLink = ({
80
80
  key={num}
81
81
  ref={refs[index]}
82
82
  onClick={(event) => handleOnClick(event, index)}
83
+ tabIndex={0}
83
84
  {...selectProps(rest)}
84
85
  {...themeTokens}
85
86
  fontSize={fontSize}
@@ -1,3 +1,5 @@
1
+ 'use client'
2
+
1
3
  import Image from './Image'
2
4
  import withClientTheme from '../utils/theming/with-client-theme'
3
5
 
@@ -31,6 +31,24 @@ const ExpandCollapseTitle = styled.h4(({ tokens }) => ({
31
31
  margin: `${tokens.expandTitleMarginX}px ${tokens.expandTitleMarginY}px`
32
32
  }))
33
33
 
34
+ const getIconButtonTokens = ({
35
+ icon,
36
+ iconBackgroundColor,
37
+ iconBorderColor,
38
+ iconColor,
39
+ iconOuterBorderColor,
40
+ iconOuterBorderGap,
41
+ iconOuterBorderWidth
42
+ }) => ({
43
+ icon,
44
+ backgroundColor: iconBackgroundColor,
45
+ borderColor: iconBorderColor,
46
+ iconColor,
47
+ outerBorderColor: iconOuterBorderColor,
48
+ outerBorderGap: iconOuterBorderGap,
49
+ outerBorderWidth: iconOuterBorderWidth
50
+ })
51
+
34
52
  const ExpandCollapse = forwardRef(
35
53
  ({ children, collapseTitle, expandTitle = collapseTitle }, ref) => {
36
54
  const getTokens = useThemeTokensCallback('TermsAndConditions', {}, {})
@@ -69,13 +87,13 @@ const ExpandCollapse = forwardRef(
69
87
  // eslint-disable-next-line react/no-unstable-nested-components
70
88
  control={(pressableState) => {
71
89
  const { expanded } = pressableState || {}
72
- const { icon } = getTokens({ expanded })
90
+ const iconTokens = getIconButtonTokens(getTokens(pressableState || {}))
73
91
 
74
92
  return (
75
93
  <ExpandCollapseControl ref={ref}>
76
94
  <ExpandCollapseIconContainer tokens={getTokens()}>
77
95
  {/* Can use `Icon` instead of `IconButton` but `Icon` does not have required stylistic variants */}
78
- <IconButton icon={icon} variant={{ size: 'small' }} />
96
+ <IconButton variant={{ size: 'small' }} tokens={iconTokens} focusable={false} />
79
97
  </ExpandCollapseIconContainer>
80
98
  <ExpandCollapseTitle tokens={getTokens()}>
81
99
  {expanded ? expandTitle : collapseTitle}