@telus-uds/components-web 2.8.1 → 2.10.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 (75) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/component-docs.json +106 -84
  3. package/lib/BlockQuote/BlockQuote.js +49 -4
  4. package/lib/Callout/Callout.js +12 -0
  5. package/lib/Countdown/Countdown.js +34 -25
  6. package/lib/Countdown/Segment.js +2 -0
  7. package/lib/Countdown/constants.js +3 -3
  8. package/lib/DatePicker/CalendarContainer.js +24 -0
  9. package/lib/DatePicker/DatePicker.js +8 -2
  10. package/lib/Disclaimer/Disclaimer.js +0 -4
  11. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
  12. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
  13. package/lib/Footnote/Footnote.js +28 -11
  14. package/lib/IconButton/IconButton.js +8 -0
  15. package/lib/Listbox/Listbox.js +8 -0
  16. package/lib/Modal/ModalContent.js +0 -1
  17. package/lib/NavigationBar/NavigationBar.js +4 -0
  18. package/lib/OrderedList/Item.js +4 -0
  19. package/lib/Paragraph/Paragraph.js +4 -0
  20. package/lib/PreviewCard/AuthorDate.js +7 -0
  21. package/lib/PreviewCard/PreviewCard.js +3 -6
  22. package/lib/PriceLockup/PriceLockup.js +48 -0
  23. package/lib/QuantitySelector/QuantitySelector.js +51 -0
  24. package/lib/Span/Span.js +4 -0
  25. package/lib/Table/Table.js +4 -0
  26. package/lib/Toast/Toast.js +32 -2
  27. package/lib-module/BlockQuote/BlockQuote.js +50 -5
  28. package/lib-module/Callout/Callout.js +12 -0
  29. package/lib-module/Countdown/Countdown.js +34 -25
  30. package/lib-module/Countdown/Segment.js +3 -1
  31. package/lib-module/Countdown/constants.js +2 -2
  32. package/lib-module/DatePicker/CalendarContainer.js +24 -0
  33. package/lib-module/DatePicker/DatePicker.js +8 -2
  34. package/lib-module/Disclaimer/Disclaimer.js +0 -4
  35. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
  36. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
  37. package/lib-module/Footnote/Footnote.js +28 -11
  38. package/lib-module/IconButton/IconButton.js +8 -0
  39. package/lib-module/Listbox/Listbox.js +8 -0
  40. package/lib-module/Modal/ModalContent.js +0 -1
  41. package/lib-module/NavigationBar/NavigationBar.js +4 -0
  42. package/lib-module/OrderedList/Item.js +4 -0
  43. package/lib-module/Paragraph/Paragraph.js +4 -0
  44. package/lib-module/PreviewCard/AuthorDate.js +7 -0
  45. package/lib-module/PreviewCard/PreviewCard.js +3 -6
  46. package/lib-module/PriceLockup/PriceLockup.js +48 -0
  47. package/lib-module/QuantitySelector/QuantitySelector.js +51 -0
  48. package/lib-module/Span/Span.js +4 -0
  49. package/lib-module/Table/Table.js +4 -0
  50. package/lib-module/Toast/Toast.js +33 -3
  51. package/package.json +3 -3
  52. package/src/BlockQuote/BlockQuote.jsx +53 -6
  53. package/src/Callout/Callout.jsx +9 -0
  54. package/src/Countdown/Countdown.jsx +34 -23
  55. package/src/Countdown/Segment.jsx +2 -1
  56. package/src/Countdown/constants.js +1 -1
  57. package/src/DatePicker/CalendarContainer.jsx +24 -0
  58. package/src/DatePicker/DatePicker.jsx +8 -2
  59. package/src/Disclaimer/Disclaimer.jsx +0 -3
  60. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +3 -0
  61. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +12 -0
  62. package/src/Footnote/Footnote.jsx +44 -17
  63. package/src/IconButton/IconButton.jsx +6 -0
  64. package/src/Listbox/Listbox.jsx +6 -0
  65. package/src/Modal/ModalContent.jsx +0 -1
  66. package/src/NavigationBar/NavigationBar.jsx +3 -0
  67. package/src/OrderedList/Item.jsx +3 -0
  68. package/src/Paragraph/Paragraph.jsx +3 -0
  69. package/src/PreviewCard/AuthorDate.jsx +6 -0
  70. package/src/PreviewCard/PreviewCard.jsx +3 -7
  71. package/src/PriceLockup/PriceLockup.jsx +37 -0
  72. package/src/QuantitySelector/QuantitySelector.jsx +39 -0
  73. package/src/Span/Span.jsx +3 -0
  74. package/src/Table/Table.jsx +3 -0
  75. package/src/Toast/Toast.jsx +27 -4
@@ -219,25 +219,76 @@ const dictionaryContentShape = _propTypes.default.shape({
219
219
  });
220
220
 
221
221
  QuantitySelector.propTypes = {
222
+ /**
223
+ * The id of the input field
224
+ */
222
225
  id: _propTypes.default.string,
226
+
227
+ /**
228
+ * The minimum number allowed
229
+ */
223
230
  minNumber: _propTypes.default.number,
231
+
232
+ /**
233
+ * The maximum number allowed
234
+ */
224
235
  maxNumber: _propTypes.default.number,
236
+
237
+ /**
238
+ * The callback function that is called when the value of the input field changes
239
+ */
225
240
  onChange: _propTypes.default.func,
241
+
242
+ /**
243
+ * The default value of the input field
244
+ */
226
245
  defaultValue: _propTypes.default.number,
246
+
247
+ /**
248
+ * The label of the input field
249
+ */
227
250
  label: _propTypes.default.string,
251
+
252
+ /**
253
+ * The hint of the input field
254
+ */
228
255
  hint: _propTypes.default.string,
256
+
257
+ /**
258
+ * The position of the hint. Could be shown along side the label or below it
259
+ */
229
260
  hintPosition: _propTypes.default.oneOf(['inline', 'below']),
261
+
262
+ /**
263
+ * Adds a question mark which will display a tooltip when clicked
264
+ */
230
265
  tooltip: _propTypes.default.string,
266
+
267
+ /**
268
+ * The accessibility label of the input field
269
+ */
231
270
  accessibilityLabel: _propTypes.default.string,
271
+
272
+ /**
273
+ * The dictionary object containing the content for the input field
274
+ */
232
275
  dictionary: _propTypes.default.shape({
233
276
  en: dictionaryContentShape,
234
277
  fr: dictionaryContentShape
235
278
  }),
279
+
280
+ /**
281
+ * The language to use for the copy.
282
+ */
236
283
  copy: _propTypes.default.oneOfType([_propTypes.default.oneOf(['en', 'fr'])]),
237
284
  variant: _propTypes.default.exact({
238
285
  alternative: _propTypes.default.bool
239
286
  }),
240
287
  tokens: _propTypes.default.oneOf([_propTypes.default.object, _propTypes.default.func]),
288
+
289
+ /**
290
+ * Sets `data-testid` attribute on the input field for testing purposes.
291
+ */
241
292
  testID: _propTypes.default.string
242
293
  };
243
294
  QuantitySelector.defaultProps = {
package/lib/Span/Span.js CHANGED
@@ -59,6 +59,10 @@ const Span = _ref2 => {
59
59
 
60
60
  Span.propTypes = { ...selectedSystemPropTypes,
61
61
  children: _propTypes.default.node.isRequired,
62
+
63
+ /**
64
+ * Adds `data-testid` attribute for testing
65
+ */
62
66
  testID: _propTypes.default.string,
63
67
 
64
68
  /**
@@ -124,6 +124,10 @@ const Table = _ref2 => {
124
124
 
125
125
  Table.propTypes = { ...selectedSystemPropTypes,
126
126
  children: _propTypes.default.node,
127
+
128
+ /**
129
+ * Sets text style
130
+ */
127
131
  text: _propTypes.default.oneOf(['medium', 'small'])
128
132
  };
129
133
  var _default = Table;
@@ -61,6 +61,8 @@ const Toast = _ref3 => {
61
61
  variant = {},
62
62
  ...rest
63
63
  } = _ref3;
64
+ // viewport hook added to work adjust the padding to different sizes
65
+ const viewport = (0, _componentsBase.useViewport)();
64
66
  const {
65
67
  containerBackgroundColor,
66
68
  containerGap,
@@ -73,8 +75,11 @@ const Toast = _ref3 => {
73
75
  animationBackgroundColorBefore,
74
76
  animationBackgroundColorAfter,
75
77
  animationColorBefore,
76
- animationColorAfter
77
- } = (0, _componentsBase.useThemeTokens)('Toast', tokens, variant); // inherit ChevronLink tokens for animation colors
78
+ animationColorAfter,
79
+ chevronlinkFontWeight
80
+ } = (0, _componentsBase.useThemeTokens)('Toast', tokens, variant, {
81
+ viewport
82
+ }); // inherit ChevronLink tokens for animation colors
78
83
 
79
84
  const {
80
85
  color: chevronDefaultColor
@@ -111,15 +116,24 @@ const Toast = _ref3 => {
111
116
  inverse: true
112
117
  },
113
118
  children: headline
119
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
120
+ space: 2,
121
+ direction: "row"
114
122
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
115
123
  variant: {
116
124
  inverse: true
117
125
  },
118
126
  children: copy
127
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
128
+ space: 2,
129
+ direction: "row"
119
130
  }), link && /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ChevronLink, {
120
131
  variant: {
121
132
  inverse: true
122
133
  },
134
+ tokens: {
135
+ blockFontWeight: chevronlinkFontWeight
136
+ },
123
137
  href: link.href,
124
138
  LinkRouter: link.LinkRouter,
125
139
  linkRouterProps: link.linkRouterProps,
@@ -129,9 +143,25 @@ const Toast = _ref3 => {
129
143
  };
130
144
 
131
145
  Toast.propTypes = { ...selectedSystemPropTypes,
146
+
147
+ /**
148
+ * If true, the toast will be displayed
149
+ */
132
150
  toast: _propTypes.default.bool,
151
+
152
+ /**
153
+ * The copy to display in the toast
154
+ */
133
155
  copy: _propTypes.default.string.isRequired,
156
+
157
+ /**
158
+ * The headline to display in the toast (before copy)
159
+ */
134
160
  headline: _propTypes.default.string,
161
+
162
+ /**
163
+ * The link to display in the toast (after copy)
164
+ */
135
165
  link: _propTypes.default.shape({
136
166
  href: _propTypes.default.string.isRequired,
137
167
  text: _propTypes.default.string.isRequired,
@@ -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 } from '@telus-uds/components-base';
3
+ import { Link, selectSystemProps, StackView, Typography, useThemeTokens, withLinkRouter, useViewport } 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 } from "react/jsx-runtime";
@@ -63,6 +63,7 @@ const BlockQuote = _ref8 => {
63
63
  variant,
64
64
  ...rest
65
65
  } = _ref8;
66
+ const viewport = useViewport();
66
67
  const {
67
68
  color,
68
69
  paddingTop,
@@ -71,16 +72,44 @@ const BlockQuote = _ref8 => {
71
72
  paddingRight,
72
73
  marginBottom,
73
74
  width,
74
- backgroundGradient
75
- } = useThemeTokens('BlockQuote', tokens, variant);
75
+ backgroundGradient,
76
+ titleHeadingFontSize,
77
+ titleHeadingFontName,
78
+ titleHeadingFontWeight,
79
+ titleHeadingLineHeight,
80
+ titleFontSize,
81
+ titleFontName,
82
+ titleFontWeight,
83
+ titleLineHeight,
84
+ linkFontSize,
85
+ linkFontName,
86
+ linkFontWeight,
87
+ linkLineHeight
88
+ } = useThemeTokens('BlockQuote', tokens, variant, {
89
+ viewport
90
+ });
76
91
  const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle;
92
+ const titleTokens = textStyle === 'heading' ? {
93
+ fontSize: titleHeadingFontSize,
94
+ fontName: titleHeadingFontName,
95
+ fontWeight: titleHeadingFontWeight,
96
+ lineHeight: titleHeadingLineHeight
97
+ } : {
98
+ fontSize: titleFontSize,
99
+ fontName: titleFontName,
100
+ fontWeight: titleFontWeight,
101
+ lineHeight: titleLineHeight
102
+ };
77
103
 
78
104
  const renderLink = () => {
79
105
  if (linkHref) {
80
106
  return /*#__PURE__*/_jsx(Link, {
81
107
  href: linkHref,
82
108
  tokens: {
83
- blockFontWeight: '500',
109
+ blockFontSize: linkFontSize,
110
+ blockFontName: linkFontName,
111
+ blockFontWeight: linkFontWeight,
112
+ blockLineHeight: linkLineHeight,
84
113
  color
85
114
  },
86
115
  variant: {
@@ -105,7 +134,7 @@ const BlockQuote = _ref8 => {
105
134
  const quote = /*#__PURE__*/_jsx(Typography, {
106
135
  tokens: {
107
136
  color,
108
- fontWeight: '400'
137
+ ...titleTokens
109
138
  },
110
139
  variant: {
111
140
  size: mappedTextSize
@@ -148,9 +177,25 @@ const BlockQuote = _ref8 => {
148
177
  BlockQuote.propTypes = { ...selectedSystemPropTypes,
149
178
  ...withLinkRouter.propTypes,
150
179
  children: PropTypes.node.isRequired,
180
+
181
+ /**
182
+ * External source's identifier (e.g. author's name)
183
+ */
151
184
  link: PropTypes.string,
185
+
186
+ /**
187
+ * External source's URL
188
+ */
152
189
  linkHref: PropTypes.string,
190
+
191
+ /**
192
+ * To provide additional information about the source, rendered underneath `link`
193
+ */
153
194
  additionalInfo: PropTypes.string,
195
+
196
+ /**
197
+ * Whether to render BlockQuote as a heading size of `h3` or large text size
198
+ */
154
199
  textStyle: PropTypes.oneOf(['large', 'heading'])
155
200
  };
156
201
  export default BlockQuote;
@@ -122,9 +122,21 @@ const Callout = _ref2 => {
122
122
  };
123
123
 
124
124
  Callout.propTypes = { ...selectedSystemPropTypes,
125
+
126
+ /**
127
+ * Icon to display on the left side of the Callout
128
+ */
125
129
  icon: PropTypes.elementType,
126
130
  children: PropTypes.node.isRequired,
131
+
132
+ /**
133
+ * To change the horizontal alignment of the Callout's text
134
+ */
127
135
  textAlignToFlex: PropTypes.oneOf(['center', 'left']),
136
+
137
+ /**
138
+ * To change the vertical alignment of the Callout's icon
139
+ */
128
140
  verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
129
141
  };
130
142
  export default Callout;
@@ -26,12 +26,15 @@ const Container = /*#__PURE__*/styled.div.withConfig({
26
26
  themeTokens,
27
27
  gradient
28
28
  } = _ref;
29
- return { ...(large || feature && {
29
+ return { ...(large || feature ? {
30
30
  display: 'flex',
31
31
  flex: 0
32
- }),
32
+ } : {}),
33
33
  ...(feature && {
34
34
  borderRadius: themeTokens.containerBorderRadius,
35
+ borderColor: themeTokens.containerBorderColor,
36
+ borderStyle: 'solid',
37
+ borderWidth: `${themeTokens.containerBorderWidth}px`,
35
38
  justifyContent: 'center',
36
39
  paddingBottom: `${themeTokens.containerPaddingBottomTop}px`,
37
40
  paddingLeft: `${themeTokens.containerPaddingLeftRight}px`,
@@ -39,38 +42,44 @@ const Container = /*#__PURE__*/styled.div.withConfig({
39
42
  paddingTop: `${themeTokens.containerPaddingBottomTop}px`,
40
43
  width: 'fit-content'
41
44
  }),
42
- ...(feature && !inverse && {
43
- background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`,
44
- border: `${themeTokens.containerInverseBorder}px solid transparent`
45
- }),
46
- ...(feature && inverse && {
47
- border: `${themeTokens.containerInverseBorder}px solid ${themeTokens.inverseBorderColor}`
45
+ ...(feature && !inverse && gradient && {
46
+ background: `linear-gradient(#fff 0 0) padding-box, ${gradient} border-box`
48
47
  })
49
48
  };
50
49
  });
51
50
 
52
51
  const getLabelTokens = themeTokens => ({
53
52
  color: themeTokens.labelBorderColor,
54
- fontWeight: themeTokens.textTimerFontWeight,
55
- fontSize: `${themeTokens.labelFontSize}`,
56
- lineHeight: `${themeTokens.labelLineHeight}`
53
+ fontSize: themeTokens.labelFontSize,
54
+ fontWeight: themeTokens.labelFontWeight,
55
+ lineHeight: themeTokens.labelLineHeight
57
56
  });
58
57
 
59
- const getMainTextTokens = themeTokens => ({
60
- color: themeTokens.labelBorderColor,
61
- fontWeight: themeTokens.textTimerFontWeight,
62
- fontSize: themeTokens.textFontSize,
63
- lineHeight: themeTokens.textLineHeight
64
- });
58
+ const getMainTextTokens = _ref2 => {
59
+ let {
60
+ labelBorderColor,
61
+ textTimerFontWeight,
62
+ textFontSize,
63
+ textLineHeight,
64
+ textTimerFontName
65
+ } = _ref2;
66
+ return {
67
+ color: labelBorderColor,
68
+ lineHeight: textLineHeight,
69
+ fontWeight: textTimerFontWeight,
70
+ fontSize: textFontSize,
71
+ fontName: textTimerFontName
72
+ };
73
+ };
65
74
 
66
- const Countdown = /*#__PURE__*/forwardRef((_ref2, ref) => {
75
+ const Countdown = /*#__PURE__*/forwardRef((_ref3, ref) => {
67
76
  let {
68
77
  copy = 'en',
69
78
  targetTime,
70
79
  tokens,
71
80
  variant = {},
72
81
  ...rest
73
- } = _ref2;
82
+ } = _ref3;
74
83
  const [days, hours, minutes, seconds] = useCountdown(targetTime);
75
84
  const viewport = useViewport();
76
85
  const {
@@ -95,13 +104,13 @@ const Countdown = /*#__PURE__*/forwardRef((_ref2, ref) => {
95
104
  // StackView-based subcontainer adds a 1-step space on the each side of the divider
96
105
  _jsx(Spacer, {
97
106
  direction: "row",
98
- space: (feature || large) && viewport !== viewports.xs ? 7 : 2
107
+ space: (feature || large) && viewport !== viewports.xs ? 4 : 1
99
108
  }) : /*#__PURE__*/_jsx(Typography, {
100
109
  tokens: mainTextTokens,
101
110
  children: ":"
102
111
  });
103
112
  const labelTokens = getLabelTokens(themeTokens);
104
- const commonProps = {
113
+ const segmentProps = {
105
114
  copy,
106
115
  labelTokens,
107
116
  numberTokens: mainTextTokens,
@@ -125,21 +134,21 @@ const Countdown = /*#__PURE__*/forwardRef((_ref2, ref) => {
125
134
  labelKey: "day",
126
135
  number: days,
127
136
  segmentWidth: String(days).length,
128
- ...commonProps
137
+ ...segmentProps
129
138
  }), divider, /*#__PURE__*/_jsx(Segment, {
130
139
  labelKey: "hour",
131
140
  number: hours,
132
- ...commonProps,
141
+ ...segmentProps,
133
142
  ...applyTextStyles(themeTokens)
134
143
  }), divider, /*#__PURE__*/_jsx(Segment, {
135
144
  labelKey: "minute",
136
145
  number: minutes,
137
- ...commonProps,
146
+ ...segmentProps,
138
147
  ...applyTextStyles(themeTokens)
139
148
  }), divider, /*#__PURE__*/_jsx(Segment, {
140
149
  labelKey: "second",
141
150
  number: seconds,
142
- ...commonProps,
151
+ ...segmentProps,
143
152
  ...applyTextStyles(themeTokens)
144
153
  })]
145
154
  })
@@ -3,7 +3,8 @@ import PropTypes from 'prop-types';
3
3
  import { StackView, Typography, useCopy } from '@telus-uds/components-base';
4
4
  import styled from 'styled-components';
5
5
  import dictionary from './dictionary';
6
- import { countdownVariantPropType, dictionaryContentShape } from './types';
6
+ import { countdownVariantPropType, dictionaryContentShape } from './types'; // !TODO: put this back
7
+
7
8
  import { SEGMENT_WIDTH_TO_FONT_SIZE_RATIO } from './constants'; // Pads with zeros on the left if it's a single digit number
8
9
 
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,6 +30,7 @@ const Container = /*#__PURE__*/styled.div.withConfig({
29
30
  justifyContent: 'space-evenly',
30
31
  display: 'inline-flex',
31
32
  ...(feature && {
33
+ // This is required because when the numbers for Countdown change, the character widths will change and thereby effecting the container demensions.
32
34
  width: `${segmentFontSize * SEGMENT_WIDTH_TO_FONT_SIZE_RATIO * segmentWidth}px`,
33
35
  display: 'flex'
34
36
  })
@@ -1,4 +1,4 @@
1
1
  export const DEFAULT_FONT_SIZE = 16;
2
2
  export const LARGE_FONT_SIZE = 64;
3
- export const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
4
- export const XS_FONT_SIZE = 28;
3
+ export const XS_FONT_SIZE = 28;
4
+ export const SEGMENT_WIDTH_TO_FONT_SIZE_RATIO = 0.8;
@@ -162,6 +162,30 @@ const CalendarContainer = /*#__PURE__*/styled.div.withConfig({
162
162
  }
163
163
  }
164
164
 
165
+ .CalendarDay
166
+ .CalendarDay__default
167
+ .CalendarDay__selected
168
+ .CalendarDay__blocked_out_of_range{
169
+ background: ${remainingTokens.calendarDaySelectedDisabledBackground};
170
+ color: ${remainingTokens.calendarDaySelectedDisabledColor};
171
+ text-decoration: none;
172
+ z-index: 0;
173
+ &:before {
174
+ content: '';
175
+ position: absolute;
176
+ top: 50%;
177
+ left: 50%;
178
+ transform: translate(-50%, -50%);
179
+ height: ${calendarDayDefaultHeight}px;
180
+ border: 1px solid ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
181
+ width: ${calendarDayDefaultWidth}px;
182
+ border-radius: 50%;
183
+ background: ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
184
+ transition: all 0.3s;
185
+ z-index: -1;
186
+ }
187
+ }
188
+
165
189
  .CalendarDay__blocked_out_of_range,
166
190
  .CalendarDay__blocked_out_of_range:active,
167
191
  .CalendarDay__blocked_out_of_range:hover,
@@ -122,14 +122,20 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
122
122
  setIsClickedInside(false);
123
123
  };
124
124
 
125
- const handleFocus = () => {
126
- setIsFocused(true);
125
+ const handleFocus = event => {
126
+ if (event.target.tagName === 'INPUT') {
127
+ setIsFocused(true);
128
+ }
127
129
  };
128
130
 
129
131
  const handleMouseDown = event => {
130
132
  if (event.target.tagName === 'INPUT') {
131
133
  setIsClickedInside(true);
132
134
  setIsFocused(true);
135
+ } else if (event.target.tagName === 'path') {
136
+ // needed to handle the case where the user clicks on the tooltip icon
137
+ setIsClickedInside(true);
138
+ event.stopPropagation();
133
139
  } else {
134
140
  event.stopPropagation();
135
141
  }
@@ -45,10 +45,6 @@ const Disclaimer = _ref2 => {
45
45
  };
46
46
 
47
47
  Disclaimer.propTypes = { ...selectedSystemPropTypes,
48
-
49
- /**
50
- * The content
51
- */
52
48
  children: PropTypes.node.isRequired
53
49
  };
54
50
  export default Disclaimer;
@@ -50,6 +50,10 @@ const ExpandCollapseMini = /*#__PURE__*/forwardRef((_ref, ref) => {
50
50
  });
51
51
  ExpandCollapseMini.displayName = 'ExpandCollapseMini';
52
52
  ExpandCollapseMini.propTypes = { ...ExpandCollapseMiniControl.propTypes,
53
+
54
+ /**
55
+ * Function to call on pressing the panel's control, which should open or close the panel.
56
+ */
53
57
  onToggle: PropTypes.func,
54
58
  children: PropTypes.node.isRequired
55
59
  };
@@ -71,9 +71,25 @@ const ExpandCollapseMiniControl = _ref => {
71
71
 
72
72
  ExpandCollapseMiniControl.propTypes = { ...selectedSystemPropTypes,
73
73
  ...Link.propTypes,
74
+
75
+ /**
76
+ * Optional function to call on pressing the panel's control, in addition to opening or closing the panel
77
+ */
74
78
  onPress: PropTypes.func,
79
+
80
+ /**
81
+ * ExpandCollapseMiniControl title when expanded
82
+ */
75
83
  expandTitle: PropTypes.string.isRequired,
84
+
85
+ /**
86
+ * ExpandCollapseMiniControl title when collapsed
87
+ */
76
88
  collapseTitle: PropTypes.string.isRequired,
89
+
90
+ /**
91
+ * React Native's `Pressable`'s state object
92
+ */
77
93
  pressableState: PropTypes.object,
78
94
  variant: PropTypes.object
79
95
  };
@@ -172,6 +172,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
172
172
  let {
173
173
  closeButtonBorder,
174
174
  closeButtonHeight,
175
+ closeButtonBackgroundColor,
175
176
  closeButtonMargin,
176
177
  closeButtonWidth
177
178
  } = _ref9;
@@ -181,7 +182,7 @@ const CloseButton = /*#__PURE__*/styled.button.withConfig({
181
182
  cursor: 'pointer',
182
183
  display: 'flex',
183
184
  justifyContent: 'center',
184
- backgroundColor: 'white',
185
+ backgroundColor: closeButtonBackgroundColor,
185
186
  border: closeButtonBorder,
186
187
  height: closeButtonHeight,
187
188
  margin: closeButtonMargin,
@@ -209,10 +210,16 @@ const StyledCustomContentContainer = /*#__PURE__*/styled.div.withConfig({
209
210
  componentId: "components-web__sc-1563bo5-8"
210
211
  })(_ref11 => {
211
212
  let {
212
- color
213
+ listItemColor,
214
+ listItemFontSize,
215
+ listItemLineHeight,
216
+ listItemPaddingLeft
213
217
  } = _ref11;
214
218
  return {
215
- color,
219
+ fontSize: listItemFontSize,
220
+ lineHeight: listItemLineHeight,
221
+ paddingLeft: listItemPaddingLeft,
222
+ color: listItemColor,
216
223
  fontFamily: 'HelveticaNow400normal'
217
224
  };
218
225
  });
@@ -279,8 +286,6 @@ const Footnote = props => {
279
286
  footnoteHeaderPaddingBottom,
280
287
  headerLineHeight,
281
288
  headerFontSize,
282
- headerFontName,
283
- headerFontWeight,
284
289
  listPaddingLeft,
285
290
  listItemMarkerFontSize,
286
291
  listItemMarkerLineHeight,
@@ -290,6 +295,7 @@ const Footnote = props => {
290
295
  listItemPaddingLeft,
291
296
  closeButtonBorderSize,
292
297
  closeButtonBorderColor,
298
+ closeButtonBackgroundColor,
293
299
  closeButtonHeight,
294
300
  closeButtonMarginTop,
295
301
  closeButtonMarginLeft,
@@ -458,6 +464,10 @@ const Footnote = props => {
458
464
 
459
465
  if ( /*#__PURE__*/React.isValidElement(data.content)) {
460
466
  return /*#__PURE__*/_jsx(StyledCustomContentContainer, {
467
+ listItemColor: listItemColor,
468
+ listItemFontSize: listItemFontSize,
469
+ listItemLineHeight: listItemLineHeight,
470
+ listItemPaddingLeft: listItemPaddingLeft,
461
471
  ref: contentRef,
462
472
  children: data.content
463
473
  });
@@ -475,6 +485,10 @@ const Footnote = props => {
475
485
  listItemLineHeight: listItemLineHeight,
476
486
  listItemPaddingLeft: listItemPaddingLeft,
477
487
  children: /*#__PURE__*/_jsx(Typography, {
488
+ tokens: {
489
+ fontSize: listItemFontSize,
490
+ lineHeight: listItemLineHeight
491
+ },
478
492
  children: renderStructuredContent(data.content)
479
493
  })
480
494
  })
@@ -501,17 +515,20 @@ const Footnote = props => {
501
515
  footnoteHeaderPaddingTop: footnoteHeaderPaddingTop,
502
516
  footnoteHeaderPaddingBottom: footnoteHeaderPaddingBottom,
503
517
  headerMargin: headerMargin,
504
- children: [/*#__PURE__*/_jsx("h2", {
505
- style: {
506
- fontSize: `${headerFontSize}px`,
507
- lineHeight: `${headerLineHeight}px`,
508
- fontFamily: `${headerFontName}${headerFontWeight}normal`
518
+ children: [/*#__PURE__*/_jsx(Typography, {
519
+ tokens: {
520
+ fontSize: headerFontSize,
521
+ lineHeight: headerLineHeight
522
+ },
523
+ variant: {
524
+ size: 'h4'
509
525
  },
510
526
  children: getCopy('heading')
511
527
  }), /*#__PURE__*/_jsx(CloseButton, {
512
- closeButtonBorder: `${closeButtonBorderSize}px solid ${closeButtonBorderColor}`,
528
+ closeButtonBorder: `${closeButtonBorderSize} solid ${closeButtonBorderColor}`,
513
529
  closeButtonWidth: `${closeButtonWidth}px`,
514
530
  closeButtonHeight: `${closeButtonHeight}px`,
531
+ closeButtonBackgroundColor: closeButtonBackgroundColor,
515
532
  closeButtonMargin: `${closeButtonMarginTop}px ${closeButtonMarginRight}px ${closeButtonMarginBottom}px ${closeButtonMarginLeft}px`,
516
533
  onClick: event => {
517
534
  closeFootnote(event, {
@@ -42,8 +42,16 @@ const propsWithoutIcon = _ref2 => {
42
42
  };
43
43
 
44
44
  IconButton.propTypes = { ...propsWithoutIcon(IconButtonBase.propTypes),
45
+
46
+ /**
47
+ * To set the icon to a multi-brand compatabile icon
48
+ */
45
49
  // eslint-disable-next-line react/require-default-props
46
50
  action: PropTypes.oneOf(multiBrandIconNames),
51
+
52
+ /**
53
+ * To set a custom icon
54
+ */
47
55
  icon: PropTypes.func
48
56
  };
49
57
  IconButton.defaultProps = {
@@ -135,7 +135,15 @@ Listbox.propTypes = { ...withLinkRouter.propTypes,
135
135
  * the last menu item.
136
136
  */
137
137
  parentRef: PropTypes.object,
138
+
139
+ /**
140
+ * `Listbox` items
141
+ */
138
142
  items: PropTypes.array,
143
+
144
+ /**
145
+ * To select an item by default
146
+ */
139
147
  selectedId: PropTypes.string
140
148
  };
141
149
  Listbox.Overlay = DropdownOverlay;