@telus-uds/components-web 2.9.0 → 2.11.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 (90) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/component-docs.json +94 -81
  3. package/lib/BlockQuote/BlockQuote.js +53 -5
  4. package/lib/Callout/Callout.js +12 -0
  5. package/lib/DatePicker/CalendarContainer.js +24 -0
  6. package/lib/DatePicker/DatePicker.js +26 -9
  7. package/lib/Disclaimer/Disclaimer.js +0 -4
  8. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +4 -0
  9. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +16 -0
  10. package/lib/IconButton/IconButton.js +8 -0
  11. package/lib/Listbox/GroupControl.js +44 -28
  12. package/lib/Listbox/Listbox.js +62 -47
  13. package/lib/Listbox/ListboxGroup.js +36 -20
  14. package/lib/Listbox/ListboxItem.js +14 -51
  15. package/lib/Listbox/ListboxOverlay.js +1 -1
  16. package/lib/NavigationBar/NavigationBar.js +4 -0
  17. package/lib/OrderedList/Item.js +4 -0
  18. package/lib/Paragraph/Paragraph.js +4 -0
  19. package/lib/PreviewCard/AuthorDate.js +7 -0
  20. package/lib/PriceLockup/PriceLockup.js +48 -0
  21. package/lib/QuantitySelector/QuantitySelector.js +51 -0
  22. package/lib/Span/Span.js +4 -0
  23. package/lib/Table/Table.js +4 -0
  24. package/lib/Toast/Toast.js +16 -0
  25. package/lib/Video/ControlBar/ControlBar.js +13 -10
  26. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  27. package/lib/VideoPicker/VideoPicker.js +1 -1
  28. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  29. package/lib/utils/index.js +3 -3
  30. package/lib-module/BlockQuote/BlockQuote.js +54 -6
  31. package/lib-module/Callout/Callout.js +12 -0
  32. package/lib-module/DatePicker/CalendarContainer.js +24 -0
  33. package/lib-module/DatePicker/DatePicker.js +26 -9
  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/IconButton/IconButton.js +8 -0
  38. package/lib-module/Listbox/GroupControl.js +45 -29
  39. package/lib-module/Listbox/Listbox.js +62 -46
  40. package/lib-module/Listbox/ListboxGroup.js +37 -21
  41. package/lib-module/Listbox/ListboxItem.js +15 -51
  42. package/lib-module/Listbox/ListboxOverlay.js +1 -1
  43. package/lib-module/NavigationBar/NavigationBar.js +4 -0
  44. package/lib-module/OrderedList/Item.js +4 -0
  45. package/lib-module/Paragraph/Paragraph.js +4 -0
  46. package/lib-module/PreviewCard/AuthorDate.js +7 -0
  47. package/lib-module/PriceLockup/PriceLockup.js +48 -0
  48. package/lib-module/QuantitySelector/QuantitySelector.js +51 -0
  49. package/lib-module/Span/Span.js +4 -0
  50. package/lib-module/Table/Table.js +4 -0
  51. package/lib-module/Toast/Toast.js +16 -0
  52. package/lib-module/Video/ControlBar/ControlBar.js +14 -11
  53. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  54. package/lib-module/VideoPicker/VideoPicker.js +1 -1
  55. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  56. package/lib-module/utils/index.js +1 -1
  57. package/package.json +3 -3
  58. package/src/BlockQuote/BlockQuote.jsx +66 -7
  59. package/src/Callout/Callout.jsx +9 -0
  60. package/src/DatePicker/CalendarContainer.jsx +24 -0
  61. package/src/DatePicker/DatePicker.jsx +25 -9
  62. package/src/Disclaimer/Disclaimer.jsx +0 -3
  63. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +3 -0
  64. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +12 -0
  65. package/src/IconButton/IconButton.jsx +6 -0
  66. package/src/Listbox/GroupControl.jsx +50 -33
  67. package/src/Listbox/Listbox.jsx +65 -50
  68. package/src/Listbox/ListboxGroup.jsx +34 -19
  69. package/src/Listbox/ListboxItem.jsx +26 -48
  70. package/src/Listbox/ListboxOverlay.jsx +1 -1
  71. package/src/NavigationBar/NavigationBar.jsx +3 -0
  72. package/src/OrderedList/Item.jsx +3 -0
  73. package/src/Paragraph/Paragraph.jsx +3 -0
  74. package/src/PreviewCard/AuthorDate.jsx +6 -0
  75. package/src/PriceLockup/PriceLockup.jsx +37 -0
  76. package/src/QuantitySelector/QuantitySelector.jsx +39 -0
  77. package/src/Span/Span.jsx +3 -0
  78. package/src/Table/Table.jsx +3 -0
  79. package/src/Toast/Toast.jsx +12 -0
  80. package/src/Video/ControlBar/ControlBar.jsx +17 -13
  81. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -1
  82. package/src/VideoPicker/VideoPicker.jsx +1 -1
  83. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +8 -1
  84. package/src/utils/index.js +1 -1
  85. package/lib/Listbox/PressableItem.js +0 -149
  86. package/lib/utils/htmlAttrs.js +0 -33
  87. package/lib-module/Listbox/PressableItem.js +0 -128
  88. package/lib-module/utils/htmlAttrs.js +0 -22
  89. package/src/Listbox/PressableItem.jsx +0 -121
  90. package/src/utils/htmlAttrs.js +0 -29
@@ -235,16 +235,64 @@ const PriceLockup = _ref12 => {
235
235
  };
236
236
 
237
237
  PriceLockup.propTypes = { ...selectedSystemPropTypes,
238
+
239
+ /**
240
+ * Size of the component
241
+ *
242
+ * Small for pricing in product catalogue pages, medium for pricing in product comparison cards and large for pricing in banners and promo cards
243
+ */
238
244
  size: PropTypes.oneOf(['small', 'medium', 'large']),
245
+
246
+ /**
247
+ * If currency symbol other than `$` to be used
248
+ */
239
249
  currencySymbol: PropTypes.string,
250
+
251
+ /**
252
+ * Shows additional info above the price
253
+ */
240
254
  topText: PropTypes.string,
255
+
256
+ /**
257
+ * Monetary value (including decimals separated by ".")
258
+ */
241
259
  price: PropTypes.string.isRequired,
260
+
261
+ /**
262
+ * Shows month/year unit
263
+ */
242
264
  rateText: PropTypes.string,
265
+
266
+ /**
267
+ * Shows additional info below the price with a `Divider`
268
+ */
243
269
  bottomText: PropTypes.string,
270
+
271
+ /**
272
+ * Displays which side the currency should apperar (left, right)
273
+ */
244
274
  signDirection: PropTypes.oneOf(['right', 'left']),
275
+
276
+ /**
277
+ * Shows additional link for context
278
+ */
245
279
  footnoteLinks: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
280
+
281
+ /**
282
+ * Function to be called when a footnote link is clicked
283
+ */
246
284
  onClickFootnote: PropTypes.func,
285
+
286
+ /**
287
+ * To show price savings comparison
288
+ */
247
289
  strikeThrough: PropTypes.bool,
290
+
291
+ /**
292
+ * To provide a11y text for `PriceLockup` component
293
+ *
294
+ * **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
295
+ */
248
296
  a11yText: PropTypes.string
249
297
  };
250
298
  export default PriceLockup;
@@ -199,25 +199,76 @@ const dictionaryContentShape = PropTypes.shape({
199
199
  }).isRequired
200
200
  });
201
201
  QuantitySelector.propTypes = {
202
+ /**
203
+ * The id of the input field
204
+ */
202
205
  id: PropTypes.string,
206
+
207
+ /**
208
+ * The minimum number allowed
209
+ */
203
210
  minNumber: PropTypes.number,
211
+
212
+ /**
213
+ * The maximum number allowed
214
+ */
204
215
  maxNumber: PropTypes.number,
216
+
217
+ /**
218
+ * The callback function that is called when the value of the input field changes
219
+ */
205
220
  onChange: PropTypes.func,
221
+
222
+ /**
223
+ * The default value of the input field
224
+ */
206
225
  defaultValue: PropTypes.number,
226
+
227
+ /**
228
+ * The label of the input field
229
+ */
207
230
  label: PropTypes.string,
231
+
232
+ /**
233
+ * The hint of the input field
234
+ */
208
235
  hint: PropTypes.string,
236
+
237
+ /**
238
+ * The position of the hint. Could be shown along side the label or below it
239
+ */
209
240
  hintPosition: PropTypes.oneOf(['inline', 'below']),
241
+
242
+ /**
243
+ * Adds a question mark which will display a tooltip when clicked
244
+ */
210
245
  tooltip: PropTypes.string,
246
+
247
+ /**
248
+ * The accessibility label of the input field
249
+ */
211
250
  accessibilityLabel: PropTypes.string,
251
+
252
+ /**
253
+ * The dictionary object containing the content for the input field
254
+ */
212
255
  dictionary: PropTypes.shape({
213
256
  en: dictionaryContentShape,
214
257
  fr: dictionaryContentShape
215
258
  }),
259
+
260
+ /**
261
+ * The language to use for the copy.
262
+ */
216
263
  copy: PropTypes.oneOfType([PropTypes.oneOf(['en', 'fr'])]),
217
264
  variant: PropTypes.exact({
218
265
  alternative: PropTypes.bool
219
266
  }),
220
267
  tokens: PropTypes.oneOf([PropTypes.object, PropTypes.func]),
268
+
269
+ /**
270
+ * Sets `data-testid` attribute on the input field for testing purposes.
271
+ */
221
272
  testID: PropTypes.string
222
273
  };
223
274
  QuantitySelector.defaultProps = {
@@ -42,6 +42,10 @@ const Span = _ref2 => {
42
42
 
43
43
  Span.propTypes = { ...selectedSystemPropTypes,
44
44
  children: PropTypes.node.isRequired,
45
+
46
+ /**
47
+ * Adds `data-testid` attribute for testing
48
+ */
45
49
  testID: PropTypes.string,
46
50
 
47
51
  /**
@@ -97,6 +97,10 @@ const Table = _ref2 => {
97
97
 
98
98
  Table.propTypes = { ...selectedSystemPropTypes,
99
99
  children: PropTypes.node,
100
+
101
+ /**
102
+ * Sets text style
103
+ */
100
104
  text: PropTypes.oneOf(['medium', 'small'])
101
105
  };
102
106
  export default Table;
@@ -125,9 +125,25 @@ const Toast = _ref3 => {
125
125
  };
126
126
 
127
127
  Toast.propTypes = { ...selectedSystemPropTypes,
128
+
129
+ /**
130
+ * If true, the toast will be displayed
131
+ */
128
132
  toast: PropTypes.bool,
133
+
134
+ /**
135
+ * The copy to display in the toast
136
+ */
129
137
  copy: PropTypes.string.isRequired,
138
+
139
+ /**
140
+ * The headline to display in the toast (before copy)
141
+ */
130
142
  headline: PropTypes.string,
143
+
144
+ /**
145
+ * The link to display in the toast (after copy)
146
+ */
131
147
  link: PropTypes.shape({
132
148
  href: PropTypes.string.isRequired,
133
149
  text: PropTypes.string.isRequired,
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { StackView, useThemeTokens, selectSystemProps, Icon } from '@telus-uds/components-base';
4
+ import { StackView, useThemeTokens, selectSystemProps, Icon, useViewport } from '@telus-uds/components-base';
5
5
  import VideoProgressBar from './Controls/VideoProgressBar/VideoProgressBar';
6
6
  import VolumeSlider from './Controls/VolumeSlider/VolumeSlider';
7
7
  import VideoButton from './Controls/VideoButton/VideoButton';
@@ -37,13 +37,14 @@ const StyledControlBar = /*#__PURE__*/styled.div.withConfig({
37
37
  componentId: "components-web__sc-13y61ky-1"
38
38
  })(_ref2 => {
39
39
  let {
40
- padding
40
+ padding,
41
+ height
41
42
  } = _ref2;
42
43
  return {
43
44
  boxSizing: 'border-box',
44
45
  position: 'absolute',
45
46
  width: '100%',
46
- height: 56,
47
+ height,
47
48
  padding,
48
49
  bottom: 0,
49
50
  backgroundColor: 'rgba(42, 44, 46, 0.85)',
@@ -119,21 +120,23 @@ const ControlBar = _ref4 => {
119
120
  variant,
120
121
  ...rest
121
122
  } = _ref4;
123
+ const viewport = useViewport();
122
124
  const {
123
125
  paddingTop,
124
126
  paddingBottom,
125
- paddingLeft: paddingLeftDefault,
126
- paddingRight: paddingRightDefault,
127
- paddingLeftCompactMode,
128
- paddingRightCompactMode,
127
+ paddingLeft,
128
+ paddingRight,
129
129
  menuBottom,
130
130
  menuRight,
131
131
  menuMarginLeft,
132
132
  captionsIcon,
133
133
  settingsIcon,
134
134
  minimizeIcon,
135
- maximizeIcon
136
- } = useThemeTokens('VideoControlBar', tokens, variant);
135
+ maximizeIcon,
136
+ height
137
+ } = useThemeTokens('VideoControlBar', tokens, variant, {
138
+ viewport
139
+ });
137
140
 
138
141
  const parseVideoQuality = () => {
139
142
  return sources.map(source => {
@@ -162,8 +165,6 @@ const ControlBar = _ref4 => {
162
165
  return parsed;
163
166
  };
164
167
 
165
- const paddingLeft = videoPlayerWidth > compactModeThreshold ? paddingLeftDefault : paddingLeftCompactMode;
166
- const paddingRight = videoPlayerWidth > compactModeThreshold ? paddingRightDefault : paddingRightCompactMode;
167
168
  const menuContainerStyleProps = {
168
169
  menuBottom,
169
170
  menuRight,
@@ -175,10 +176,12 @@ const ControlBar = _ref4 => {
175
176
  ...selectProps(rest),
176
177
  children: /*#__PURE__*/_jsxs(StyledControlBar, {
177
178
  padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
179
+ height: `${height}px`,
178
180
  children: [/*#__PURE__*/_jsx(VideoProgressBarContainer, {
179
181
  children: /*#__PURE__*/_jsx(VideoProgressBar, {
180
182
  copy: copy,
181
183
  videoPlayer: videoPlayer,
184
+ playing: videoPlaying,
182
185
  videoLength: videoLength,
183
186
  videoCurrentTime: videoCurrentTime,
184
187
  videoBufferEnd: videoBufferEnd,
@@ -122,6 +122,7 @@ const VideoProgressBar = _ref5 => {
122
122
  videoLength,
123
123
  videoCurrentTime,
124
124
  videoBufferEnd,
125
+ playing,
125
126
  setSeek,
126
127
  resetInactivityTimer,
127
128
  tokens,
@@ -137,7 +138,9 @@ const VideoProgressBar = _ref5 => {
137
138
  trackGradientStart,
138
139
  trackGradientEnd,
139
140
  rangeBackground
140
- } = useThemeTokens('VideoProgressBar', tokens, variant);
141
+ } = useThemeTokens('VideoProgressBar', tokens, variant, {
142
+ playing
143
+ });
141
144
  const videoProgressBar = /*#__PURE__*/React.createRef();
142
145
 
143
146
  const handleVideoSkip = () => {
@@ -87,7 +87,7 @@ const VideoPicker = _ref6 => {
87
87
  setCurrentVideoId(selectedVideo);
88
88
  }, [selectedVideo]); // `frame` variant should only work on larger screens
89
89
 
90
- const isFramed = frame && [viewports.md, viewports.lg, viewports.xl].includes(viewport);
90
+ const isFramed = frame && [viewports.lg, viewports.xl].includes(viewport);
91
91
  const hasSlider = !frame && [viewports.md, viewports.lg, viewports.xl].includes(viewport);
92
92
  const listElements = videoList.map((video, index) => /*#__PURE__*/_jsx(VideoPickerThumbnail, {
93
93
  video: video,
@@ -157,14 +157,25 @@ const selectButtonContentTokens = _ref14 => {
157
157
  };
158
158
  };
159
159
 
160
- const SplashButtonWithDetails = _ref15 => {
160
+ const getLabelTokens = _ref15 => {
161
+ let {
162
+ labelFontName: fontName,
163
+ labelFontWeight: fontWeight
164
+ } = _ref15;
165
+ return {
166
+ fontName,
167
+ fontWeight
168
+ };
169
+ };
170
+
171
+ const SplashButtonWithDetails = _ref16 => {
161
172
  let {
162
173
  label,
163
174
  tokens,
164
175
  variant,
165
176
  copy,
166
177
  videoLength
167
- } = _ref15;
178
+ } = _ref16;
168
179
  const {
169
180
  buttonContentChildrenBackground
170
181
  } = useThemeTokens('SplashButtonWithDetails', tokens, variant, {
@@ -191,6 +202,7 @@ const SplashButtonWithDetails = _ref15 => {
191
202
  variant: {
192
203
  bold: true
193
204
  },
205
+ tokens: getLabelTokens(themeTokens),
194
206
  children: label
195
207
  }), /*#__PURE__*/_jsx(Typography, {
196
208
  variant: {
@@ -1,7 +1,7 @@
1
+ import { htmlAttrs } from '@telus-uds/components-base';
1
2
  import { warn, deprecate } from './logger';
2
3
  import { transformGradient } from './transforms';
3
4
  import useTypographyTheme from './useTypographyTheme';
4
- import htmlAttrs from './htmlAttrs';
5
5
  import media from './media';
6
6
  import ssrStyles from './ssr';
7
7
  import renderStructuredContent from './renderStructuredContent';
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.51.0",
8
+ "@telus-uds/components-base": "1.52.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.33.0",
15
+ "@telus-uds/system-theme-tokens": "^2.35.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.9.0"
66
+ "version": "2.11.0"
67
67
  }
@@ -6,7 +6,8 @@ import {
6
6
  StackView,
7
7
  Typography,
8
8
  useThemeTokens,
9
- withLinkRouter
9
+ withLinkRouter,
10
+ useViewport
10
11
  } from '@telus-uds/components-base'
11
12
  import styled from 'styled-components'
12
13
  import { htmlAttrs, transformGradient } from '../utils'
@@ -48,6 +49,7 @@ const BlockQuote = ({
48
49
  variant,
49
50
  ...rest
50
51
  }) => {
52
+ const viewport = useViewport()
51
53
  const {
52
54
  color,
53
55
  paddingTop,
@@ -56,16 +58,49 @@ const BlockQuote = ({
56
58
  paddingRight,
57
59
  marginBottom,
58
60
  width,
59
- backgroundGradient
60
- } = useThemeTokens('BlockQuote', tokens, variant)
61
-
61
+ backgroundGradient,
62
+ titleHeadingFontSize,
63
+ titleHeadingFontName,
64
+ titleHeadingFontWeight,
65
+ titleHeadingLineHeight,
66
+ titleFontSize,
67
+ titleFontName,
68
+ titleFontWeight,
69
+ titleLineHeight,
70
+ linkFontSize,
71
+ linkFontName,
72
+ linkFontWeight,
73
+ linkLineHeight
74
+ } = useThemeTokens('BlockQuote', tokens, variant, {
75
+ viewport
76
+ })
62
77
  const mappedTextSize = textStyle === 'heading' ? 'h3' : textStyle
78
+ const titleTokens =
79
+ textStyle === 'heading'
80
+ ? {
81
+ fontSize: titleHeadingFontSize,
82
+ fontName: titleHeadingFontName,
83
+ fontWeight: titleHeadingFontWeight,
84
+ lineHeight: titleHeadingLineHeight
85
+ }
86
+ : {
87
+ fontSize: titleFontSize,
88
+ fontName: titleFontName,
89
+ fontWeight: titleFontWeight,
90
+ lineHeight: titleLineHeight
91
+ }
63
92
  const renderLink = () => {
64
93
  if (linkHref) {
65
94
  return (
66
95
  <Link
67
96
  href={linkHref}
68
- tokens={{ blockFontWeight: '500', color }}
97
+ tokens={{
98
+ blockFontSize: linkFontSize,
99
+ blockFontName: linkFontName,
100
+ blockFontWeight: linkFontWeight,
101
+ blockLineHeight: linkLineHeight,
102
+ color
103
+ }}
69
104
  variant={{ alternative: true }}
70
105
  LinkRouter={LinkRouter}
71
106
  linkRouterProps={linkRouterProps}
@@ -75,12 +110,24 @@ const BlockQuote = ({
75
110
  )
76
111
  }
77
112
 
78
- return <Typography tokens={{ color, fontWeight: '500' }}>{link}</Typography>
113
+ return (
114
+ <Typography
115
+ tokens={{
116
+ color,
117
+ fontName: linkFontName,
118
+ fontSize: linkFontSize,
119
+ fontWeight: linkFontWeight,
120
+ lineHeight: linkLineHeight
121
+ }}
122
+ >
123
+ {link}
124
+ </Typography>
125
+ )
79
126
  }
80
127
 
81
128
  const renderQuote = () => {
82
129
  const quote = (
83
- <Typography tokens={{ color, fontWeight: '400' }} variant={{ size: mappedTextSize }}>
130
+ <Typography tokens={{ color, ...titleTokens }} variant={{ size: mappedTextSize }}>
84
131
  {children}
85
132
  </Typography>
86
133
  )
@@ -121,9 +168,21 @@ BlockQuote.propTypes = {
121
168
  ...selectedSystemPropTypes,
122
169
  ...withLinkRouter.propTypes,
123
170
  children: PropTypes.node.isRequired,
171
+ /**
172
+ * External source's identifier (e.g. author's name)
173
+ */
124
174
  link: PropTypes.string,
175
+ /**
176
+ * External source's URL
177
+ */
125
178
  linkHref: PropTypes.string,
179
+ /**
180
+ * To provide additional information about the source, rendered underneath `link`
181
+ */
126
182
  additionalInfo: PropTypes.string,
183
+ /**
184
+ * Whether to render BlockQuote as a heading size of `h3` or large text size
185
+ */
127
186
  textStyle: PropTypes.oneOf(['large', 'heading'])
128
187
  }
129
188
 
@@ -91,9 +91,18 @@ const Callout = ({
91
91
 
92
92
  Callout.propTypes = {
93
93
  ...selectedSystemPropTypes,
94
+ /**
95
+ * Icon to display on the left side of the Callout
96
+ */
94
97
  icon: PropTypes.elementType,
95
98
  children: PropTypes.node.isRequired,
99
+ /**
100
+ * To change the horizontal alignment of the Callout's text
101
+ */
96
102
  textAlignToFlex: PropTypes.oneOf(['center', 'left']),
103
+ /**
104
+ * To change the vertical alignment of the Callout's icon
105
+ */
97
106
  verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom'])
98
107
  }
99
108
 
@@ -164,6 +164,30 @@ const CalendarContainer = styled.div(
164
164
  }
165
165
  }
166
166
 
167
+ .CalendarDay
168
+ .CalendarDay__default
169
+ .CalendarDay__selected
170
+ .CalendarDay__blocked_out_of_range{
171
+ background: ${remainingTokens.calendarDaySelectedDisabledBackground};
172
+ color: ${remainingTokens.calendarDaySelectedDisabledColor};
173
+ text-decoration: none;
174
+ z-index: 0;
175
+ &:before {
176
+ content: '';
177
+ position: absolute;
178
+ top: 50%;
179
+ left: 50%;
180
+ transform: translate(-50%, -50%);
181
+ height: ${calendarDayDefaultHeight}px;
182
+ border: 1px solid ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
183
+ width: ${calendarDayDefaultWidth}px;
184
+ border-radius: 50%;
185
+ background: ${remainingTokens.calendarDaySelectedDisabledContentBackgroundColor};
186
+ transition: all 0.3s;
187
+ z-index: -1;
188
+ }
189
+ }
190
+
167
191
  .CalendarDay__blocked_out_of_range,
168
192
  .CalendarDay__blocked_out_of_range:active,
169
193
  .CalendarDay__blocked_out_of_range:hover,
@@ -91,6 +91,7 @@ const DatePicker = forwardRef(
91
91
  tokens,
92
92
  variant = {},
93
93
  validation,
94
+ disabled,
94
95
  ...rest
95
96
  },
96
97
  ref
@@ -109,15 +110,23 @@ const DatePicker = forwardRef(
109
110
  }
110
111
  setIsClickedInside(false)
111
112
  }
112
- const handleFocus = () => {
113
- setIsFocused(true)
113
+ const handleFocus = (event) => {
114
+ if (event.target.tagName === 'INPUT' && !disabled) {
115
+ setIsFocused(true)
116
+ }
114
117
  }
115
118
  const handleMouseDown = (event) => {
116
- if (event.target.tagName === 'INPUT') {
117
- setIsClickedInside(true)
118
- setIsFocused(true)
119
- } else {
120
- event.stopPropagation()
119
+ if (!disabled) {
120
+ if (event.target.tagName === 'INPUT') {
121
+ setIsClickedInside(true)
122
+ setIsFocused(true)
123
+ } else if (event.target.tagName === 'path') {
124
+ // needed to handle the case where the user clicks on the tooltip icon
125
+ setIsClickedInside(true)
126
+ event.stopPropagation()
127
+ } else {
128
+ event.stopPropagation()
129
+ }
121
130
  }
122
131
  }
123
132
  const onChange = (value) => {
@@ -247,9 +256,11 @@ const DatePicker = forwardRef(
247
256
  label={dictionary[copy]?.roleDescription ?? label}
248
257
  value={inputText}
249
258
  validation={validation}
259
+ inactive={disabled}
250
260
  >
251
261
  <SingleDatePicker
252
262
  date={inputDate}
263
+ disabled={disabled}
253
264
  onDateChange={onChange}
254
265
  focused={isFocused}
255
266
  onFocusChange={onFocusChange}
@@ -341,7 +352,11 @@ DatePicker.propTypes = {
341
352
  /**
342
353
  * Use to visually mark an input as valid or invalid.
343
354
  */
344
- validation: PropTypes.oneOf(['error', 'success'])
355
+ validation: PropTypes.oneOf(['error', 'success']),
356
+ /**
357
+ * Disable the input which will not open the calendar picker
358
+ */
359
+ disabled: PropTypes.bool
345
360
  }
346
361
 
347
362
  DatePicker.defaultProps = {
@@ -355,7 +370,8 @@ DatePicker.defaultProps = {
355
370
  hintPosition: 'inline',
356
371
  tooltip: undefined,
357
372
  onDateChange: () => {},
358
- validation: undefined
373
+ validation: undefined,
374
+ disabled: false
359
375
  }
360
376
 
361
377
  export default DatePicker
@@ -30,9 +30,6 @@ const Disclaimer = ({ children, ...rest }) => {
30
30
 
31
31
  Disclaimer.propTypes = {
32
32
  ...selectedSystemPropTypes,
33
- /**
34
- * The content
35
- */
36
33
  children: PropTypes.node.isRequired
37
34
  }
38
35
 
@@ -39,6 +39,9 @@ ExpandCollapseMini.displayName = 'ExpandCollapseMini'
39
39
 
40
40
  ExpandCollapseMini.propTypes = {
41
41
  ...ExpandCollapseMiniControl.propTypes,
42
+ /**
43
+ * Function to call on pressing the panel's control, which should open or close the panel.
44
+ */
42
45
  onToggle: PropTypes.func,
43
46
  children: PropTypes.node.isRequired
44
47
  }
@@ -57,9 +57,21 @@ const ExpandCollapseMiniControl = ({
57
57
  ExpandCollapseMiniControl.propTypes = {
58
58
  ...selectedSystemPropTypes,
59
59
  ...Link.propTypes,
60
+ /**
61
+ * Optional function to call on pressing the panel's control, in addition to opening or closing the panel
62
+ */
60
63
  onPress: PropTypes.func,
64
+ /**
65
+ * ExpandCollapseMiniControl title when expanded
66
+ */
61
67
  expandTitle: PropTypes.string.isRequired,
68
+ /**
69
+ * ExpandCollapseMiniControl title when collapsed
70
+ */
62
71
  collapseTitle: PropTypes.string.isRequired,
72
+ /**
73
+ * React Native's `Pressable`'s state object
74
+ */
63
75
  pressableState: PropTypes.object,
64
76
  variant: PropTypes.object
65
77
  }
@@ -36,8 +36,14 @@ IconButton.displayName = 'IconButton'
36
36
  const propsWithoutIcon = ({ icon, ...props }) => props
37
37
  IconButton.propTypes = {
38
38
  ...propsWithoutIcon(IconButtonBase.propTypes),
39
+ /**
40
+ * To set the icon to a multi-brand compatabile icon
41
+ */
39
42
  // eslint-disable-next-line react/require-default-props
40
43
  action: PropTypes.oneOf(multiBrandIconNames),
44
+ /**
45
+ * To set a custom icon
46
+ */
41
47
  icon: PropTypes.func
42
48
  }
43
49