@telus-uds/components-web 2.10.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 (45) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/component-docs.json +12 -0
  3. package/lib/BlockQuote/BlockQuote.js +4 -1
  4. package/lib/DatePicker/DatePicker.js +23 -12
  5. package/lib/Listbox/GroupControl.js +44 -28
  6. package/lib/Listbox/Listbox.js +54 -47
  7. package/lib/Listbox/ListboxGroup.js +36 -20
  8. package/lib/Listbox/ListboxItem.js +14 -51
  9. package/lib/Listbox/ListboxOverlay.js +1 -1
  10. package/lib/Video/ControlBar/ControlBar.js +13 -10
  11. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  12. package/lib/VideoPicker/VideoPicker.js +1 -1
  13. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  14. package/lib/utils/index.js +3 -3
  15. package/lib-module/BlockQuote/BlockQuote.js +4 -1
  16. package/lib-module/DatePicker/DatePicker.js +23 -12
  17. package/lib-module/Listbox/GroupControl.js +45 -29
  18. package/lib-module/Listbox/Listbox.js +54 -46
  19. package/lib-module/Listbox/ListboxGroup.js +37 -21
  20. package/lib-module/Listbox/ListboxItem.js +15 -51
  21. package/lib-module/Listbox/ListboxOverlay.js +1 -1
  22. package/lib-module/Video/ControlBar/ControlBar.js +14 -11
  23. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  24. package/lib-module/VideoPicker/VideoPicker.js +1 -1
  25. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  26. package/lib-module/utils/index.js +1 -1
  27. package/package.json +3 -3
  28. package/src/BlockQuote/BlockQuote.jsx +13 -1
  29. package/src/DatePicker/DatePicker.jsx +22 -12
  30. package/src/Listbox/GroupControl.jsx +50 -33
  31. package/src/Listbox/Listbox.jsx +59 -50
  32. package/src/Listbox/ListboxGroup.jsx +34 -19
  33. package/src/Listbox/ListboxItem.jsx +26 -48
  34. package/src/Listbox/ListboxOverlay.jsx +1 -1
  35. package/src/Video/ControlBar/ControlBar.jsx +17 -13
  36. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -1
  37. package/src/VideoPicker/VideoPicker.jsx +1 -1
  38. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +8 -1
  39. package/src/utils/index.js +1 -1
  40. package/lib/Listbox/PressableItem.js +0 -149
  41. package/lib/utils/htmlAttrs.js +0 -33
  42. package/lib-module/Listbox/PressableItem.js +0 -128
  43. package/lib-module/utils/htmlAttrs.js +0 -22
  44. package/src/Listbox/PressableItem.jsx +0 -121
  45. package/src/utils/htmlAttrs.js +0 -29
package/CHANGELOG.md CHANGED
@@ -1,12 +1,27 @@
1
1
  # Change Log - @telus-uds/components-web
2
2
 
3
- This log was last generated on Tue, 20 Jun 2023 16:00:54 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 21 Jun 2023 20:33:00 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 2.11.0
8
+
9
+ Wed, 21 Jun 2023 20:33:00 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Adjusted component implementations for 'Video' components to allow for custom height, playing appearance state and custom fontWeight for SplashButtonWithDetails (kyle.king2@telus.com)
14
+ - Standardized Listbox (wlsdud194@hotmail.com)
15
+ - Bump @telus-uds/components-base to v1.52.0
16
+ - Bump @telus-uds/system-theme-tokens to v2.35.0
17
+
18
+ ### Patches
19
+
20
+ - Fixes where `frame` mode in `VideoPicker` is used, render short video titles for `md` viewport. (shahzaibkhalidmalik@outlook.com)
21
+
7
22
  ## 2.10.0
8
23
 
9
- Tue, 20 Jun 2023 16:00:54 GMT
24
+ Tue, 20 Jun 2023 16:09:24 GMT
10
25
 
11
26
  ### Minor changes
12
27
 
@@ -793,6 +793,17 @@
793
793
  "required": false,
794
794
  "description": "Use to visually mark an input as valid or invalid."
795
795
  },
796
+ "disabled": {
797
+ "defaultValue": {
798
+ "value": "false",
799
+ "computed": false
800
+ },
801
+ "type": {
802
+ "name": "bool"
803
+ },
804
+ "required": false,
805
+ "description": "Disable the input which will not open the calendar picker"
806
+ },
796
807
  "id": {
797
808
  "type": {
798
809
  "name": "string"
@@ -12632,6 +12643,7 @@
12632
12643
  "dotWidth": "size",
12633
12644
  "dotBorderWidth": "border",
12634
12645
  "timelineContainerDirection": "direction",
12646
+ "timelineConnectorColor": "color",
12635
12647
  "timelineColor": "color",
12636
12648
  "connectorWidth": "size",
12637
12649
  "connectorHeight": "size",
@@ -140,7 +140,10 @@ const BlockQuote = _ref8 => {
140
140
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Typography, {
141
141
  tokens: {
142
142
  color,
143
- fontWeight: '500'
143
+ fontName: linkFontName,
144
+ fontSize: linkFontSize,
145
+ fontWeight: linkFontWeight,
146
+ lineHeight: linkLineHeight
144
147
  },
145
148
  children: link
146
149
  });
@@ -125,6 +125,7 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
125
125
  tokens,
126
126
  variant = {},
127
127
  validation,
128
+ disabled,
128
129
  ...rest
129
130
  } = _ref;
130
131
  const [inputDate, setInputDate] = (0, _react.useState)(date instanceof _moment.default ? date : undefined);
@@ -149,21 +150,23 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
149
150
  };
150
151
 
151
152
  const handleFocus = event => {
152
- if (event.target.tagName === 'INPUT') {
153
+ if (event.target.tagName === 'INPUT' && !disabled) {
153
154
  setIsFocused(true);
154
155
  }
155
156
  };
156
157
 
157
158
  const handleMouseDown = event => {
158
- if (event.target.tagName === 'INPUT') {
159
- setIsClickedInside(true);
160
- setIsFocused(true);
161
- } else if (event.target.tagName === 'path') {
162
- // needed to handle the case where the user clicks on the tooltip icon
163
- setIsClickedInside(true);
164
- event.stopPropagation();
165
- } else {
166
- event.stopPropagation();
159
+ if (!disabled) {
160
+ if (event.target.tagName === 'INPUT') {
161
+ setIsClickedInside(true);
162
+ setIsFocused(true);
163
+ } else if (event.target.tagName === 'path') {
164
+ // needed to handle the case where the user clicks on the tooltip icon
165
+ setIsClickedInside(true);
166
+ event.stopPropagation();
167
+ } else {
168
+ event.stopPropagation();
169
+ }
167
170
  }
168
171
  };
169
172
 
@@ -308,8 +311,10 @@ const DatePicker = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
308
311
  label: ((_dictionary$copy = _dictionary.default[copy]) === null || _dictionary$copy === void 0 ? void 0 : _dictionary$copy.roleDescription) ?? label,
309
312
  value: inputText,
310
313
  validation: validation,
314
+ inactive: disabled,
311
315
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SingleDatePicker.default, {
312
316
  date: inputDate,
317
+ disabled: disabled,
313
318
  onDateChange: onChange,
314
319
  focused: isFocused,
315
320
  onFocusChange: onFocusChange,
@@ -406,7 +411,12 @@ DatePicker.propTypes = { ...selectedSystemPropTypes,
406
411
  /**
407
412
  * Use to visually mark an input as valid or invalid.
408
413
  */
409
- validation: _propTypes.default.oneOf(['error', 'success'])
414
+ validation: _propTypes.default.oneOf(['error', 'success']),
415
+
416
+ /**
417
+ * Disable the input which will not open the calendar picker
418
+ */
419
+ disabled: _propTypes.default.bool
410
420
  };
411
421
  DatePicker.defaultProps = {
412
422
  copy: 'en',
@@ -419,7 +429,8 @@ DatePicker.defaultProps = {
419
429
  hintPosition: 'inline',
420
430
  tooltip: undefined,
421
431
  onDateChange: () => {},
422
- validation: undefined
432
+ validation: undefined,
433
+ disabled: false
423
434
  };
424
435
  var _default = DatePicker;
425
436
  exports.default = _default;
@@ -22,32 +22,41 @@ const StyledControlWrapper = /*#__PURE__*/_styledComponents.default.div.withConf
22
22
  componentId: "components-web__sc-1r7ts3q-0"
23
23
  })(_ref => {
24
24
  let {
25
- focus,
26
- tokens
25
+ groupFontName,
26
+ groupFontWeight,
27
+ groupFontSize,
28
+ groupColor,
29
+ groupBackgroundColor,
30
+ groupBorderColor,
31
+ groupBorderWidth,
32
+ groupBorderRadius,
33
+ groupPaddingLeft,
34
+ groupPaddingRight,
35
+ groupPaddingTop,
36
+ groupPaddingBottom,
37
+ itemTextDecoration,
38
+ itemOutline,
39
+ groupHeight
27
40
  } = _ref;
28
41
  return {
29
- fontFamily: `${tokens.groupFontName}${tokens.groupFontWeight}normal`,
30
- fontSize: tokens.groupFontSize,
31
- color: tokens.groupColor,
32
- textDecoration: tokens.itemTextDecoration,
33
- backgroundColor: tokens.groupBackgroundColor,
34
- outline: tokens.itemOutline,
42
+ fontFamily: `${groupFontName}${groupFontWeight}normal`,
43
+ fontSize: groupFontSize,
44
+ color: groupColor,
45
+ textDecoration: itemTextDecoration,
46
+ backgroundColor: groupBackgroundColor,
47
+ outline: itemOutline,
35
48
  width: '100%',
49
+ height: groupHeight,
36
50
  display: 'flex',
51
+ alignItems: 'center',
37
52
  justifyContent: 'space-between',
38
- ...(focus ? {
39
- border: `${tokens.groupBorderWidth} solid ${tokens.groupBorderColor}`,
40
- borderRadius: tokens.groupBorderRadius,
41
- paddingLeft: `calc(${tokens.groupPaddingLeft}px - ${tokens.groupBorderWidth}px)`,
42
- paddingRight: `calc(${tokens.groupPaddingRight}px - ${tokens.groupBorderWidth}px)`,
43
- paddingTop: `calc(${tokens.groupPaddingTop}px - ${tokens.groupBorderWidth}px)`,
44
- paddingBottom: `calc(${tokens.groupPaddingBottom}px - ${tokens.groupBorderWidth}px)`
45
- } : {
46
- paddingLeft: tokens.groupPaddingLeft,
47
- paddingRight: tokens.groupPaddingRight,
48
- paddingTop: tokens.groupPaddingTop,
49
- paddingBottom: tokens.groupPaddingBottom
50
- })
53
+ boxSizing: 'border-box',
54
+ border: `${groupBorderWidth}px solid ${groupBorderColor}`,
55
+ borderRadius: groupBorderRadius,
56
+ paddingLeft: groupPaddingLeft - groupBorderWidth,
57
+ paddingRight: groupPaddingRight - groupBorderWidth,
58
+ paddingTop: groupPaddingTop - groupBorderWidth,
59
+ paddingBottom: groupPaddingBottom - groupBorderWidth
51
60
  };
52
61
  });
53
62
 
@@ -57,24 +66,31 @@ const GroupControl = _ref2 => {
57
66
  pressed,
58
67
  hover,
59
68
  focus,
60
- current,
61
- label
69
+ label,
70
+ id
62
71
  } = _ref2;
63
- const tokens = (0, _componentsBase.useThemeTokens)('ListBox', {}, {}, {
72
+ const {
73
+ selectedId,
74
+ setSelectedId
75
+ } = (0, _componentsBase.useListboxContext)();
76
+ const tokens = (0, _componentsBase.useThemeTokens)('Listbox', {}, {}, {
64
77
  expanded,
65
78
  pressed,
66
79
  hover,
67
- current,
80
+ current: selectedId === id && id !== undefined,
68
81
  focus
69
82
  });
70
83
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledControlWrapper, {
71
- focus,
72
- tokens,
84
+ onClick: () => setSelectedId(id),
85
+ ...tokens,
73
86
  children: [label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Spacer, {
74
87
  space: 1,
75
88
  direction: "row"
76
89
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.Icon, {
77
90
  icon: tokens.groupIcon,
91
+ tokens: {
92
+ color: tokens.groupColor
93
+ },
78
94
  variant: {
79
95
  size: 'micro'
80
96
  }
@@ -83,11 +99,11 @@ const GroupControl = _ref2 => {
83
99
  };
84
100
 
85
101
  GroupControl.propTypes = {
102
+ id: _propTypes.default.string,
86
103
  expanded: _propTypes.default.bool,
87
104
  pressed: _propTypes.default.bool,
88
105
  hover: _propTypes.default.bool,
89
106
  focus: _propTypes.default.bool,
90
- current: _propTypes.default.bool,
91
107
  label: _propTypes.default.string
92
108
  };
93
109
  var _default = GroupControl;
@@ -19,8 +19,6 @@ var _ListboxItem = _interopRequireDefault(require("./ListboxItem"));
19
19
 
20
20
  var _ListboxOverlay = _interopRequireDefault(require("./ListboxOverlay"));
21
21
 
22
- var _resolveItemSelection = _interopRequireDefault(require("../NavigationBar/resolveItemSelection"));
23
-
24
22
  var _jsxRuntime = require("react/jsx-runtime");
25
23
 
26
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -47,12 +45,19 @@ const Listbox = _ref => {
47
45
  // focus will be moved to this one once within the menu
48
46
  parentRef = null,
49
47
  // to return focus to after leaving the last menu item
50
- selectedId,
48
+ selectedId: defaultSelectedId,
51
49
  LinkRouter,
52
50
  itemRouterProps,
53
- onClose
51
+ onClose,
52
+ variant,
53
+ tokens
54
54
  } = _ref;
55
- const initialOpen = getInitialOpen(items, selectedId); // We need to keep track of each item's ref in order to be able to
55
+ const initialOpen = getInitialOpen(items, defaultSelectedId);
56
+ const [selectedId, setSelectedId] = (0, _react.useState)(defaultSelectedId);
57
+ const {
58
+ minHeight,
59
+ minWidth
60
+ } = (0, _componentsBase.useThemeTokens)('Listbox', variant, tokens); // We need to keep track of each item's ref in order to be able to
56
61
  // focus on a specific item via keyboard navigation
57
62
 
58
63
  const itemRefs = (0, _react.useRef)([]);
@@ -97,48 +102,50 @@ const Listbox = _ref => {
97
102
  window.removeEventListener('touchstart', onClose);
98
103
  };
99
104
  }, [onClose, handleKeydown]);
100
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
101
- initialOpen: initialOpen,
102
- maxOpen: 1,
103
- children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
104
- role: "listbox",
105
- children: items.map((item, index) => {
106
- const {
107
- id,
108
- label,
109
- items: nestedItems
110
- } = item;
111
- const {
112
- itemId,
113
- selected
114
- } = (0, _resolveItemSelection.default)({
115
- id,
116
- label,
117
- items: nestedItems
118
- }, selectedId); // Give `firstItemRef` to the first focusable item
119
-
120
- const itemRef = index === 0 && !itemId !== selectedId || index === 1 && items[0].id === selectedId ? firstItemRef : ref => {
121
- itemRefs.current[index] = ref;
122
- return ref;
123
- };
124
- return nestedItems ? /*#__PURE__*/(0, _react.createElement)(_ListboxGroup.default, { ...item,
125
- selectedId: selectedId,
126
- key: itemId,
127
- expandProps: expandProps,
128
- LinkRouter: LinkRouter,
129
- itemRouterProps: itemRouterProps,
130
- prevItemRef: itemRefs.current[index - 1] ?? null,
131
- nextItemRef: itemRefs.current[index + 1] ?? null,
132
- ref: itemRef
133
- }) : /*#__PURE__*/(0, _react.createElement)(_ListboxItem.default, { ...item,
134
- selected: selected,
135
- key: itemId,
136
- LinkRouter: LinkRouter,
137
- itemRouterProps: itemRouterProps,
138
- prevItemRef: itemRefs.current[index - 1] ?? null,
139
- nextItemRef: itemRefs.current[index + 1] ?? null,
140
- ref: itemRef
141
- });
105
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ListboxContext.Provider, {
106
+ value: {
107
+ selectedId,
108
+ setSelectedId
109
+ },
110
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse, {
111
+ initialOpen: initialOpen,
112
+ maxOpen: 1,
113
+ children: expandProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
114
+ role: "listbox",
115
+ style: {
116
+ minHeight,
117
+ minWidth
118
+ },
119
+ children: items.map((item, index) => {
120
+ const {
121
+ id,
122
+ label,
123
+ items: nestedItems
124
+ } = item;
125
+ const itemId = id ?? label; // Give `firstItemRef` to the first focusable item
126
+
127
+ const itemRef = index === 0 && !itemId !== selectedId || index === 1 && items[0].id === selectedId ? firstItemRef : ref => {
128
+ itemRefs.current[index] = ref;
129
+ return ref;
130
+ };
131
+ return nestedItems ? /*#__PURE__*/(0, _react.createElement)(_ListboxGroup.default, { ...item,
132
+ expandProps: expandProps,
133
+ LinkRouter: LinkRouter,
134
+ itemRouterProps: itemRouterProps,
135
+ prevItemRef: itemRefs.current[index - 1] ?? null,
136
+ nextItemRef: itemRefs.current[index + 1] ?? null,
137
+ ref: itemRef,
138
+ key: itemId
139
+ }) : /*#__PURE__*/(0, _react.createElement)(_ListboxItem.default, { ...item,
140
+ key: itemId,
141
+ id: itemId,
142
+ LinkRouter: LinkRouter,
143
+ itemRouterProps: itemRouterProps,
144
+ prevItemRef: itemRefs.current[index - 1] ?? null,
145
+ nextItemRef: itemRefs.current[index + 1] ?? null,
146
+ ref: itemRef
147
+ });
148
+ })
142
149
  })
143
150
  })
144
151
  });
@@ -55,7 +55,6 @@ const ListboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
55
55
  id,
56
56
  label,
57
57
  items,
58
- selectedId,
59
58
  LinkRouter,
60
59
  linkRouterProps,
61
60
  expandProps,
@@ -63,7 +62,10 @@ const ListboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
63
62
  nextItemRef,
64
63
  prevItemRef
65
64
  } = _ref;
66
- // TODO: implement keyboard navigation via refs for grouped items separately here
65
+ const {
66
+ selectedId
67
+ } = (0, _componentsBase.useListboxContext)(); // TODO: implement keyboard navigation via refs for grouped items separately here
68
+
67
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledGroupWrapper, {
68
70
  role: "option",
69
71
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.ExpandCollapse.Panel, {
@@ -73,11 +75,17 @@ const ListboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
73
75
  paddingLeft: 'none',
74
76
  paddingRight: 'none',
75
77
  paddingTop: 'none',
76
- paddingBottom: 'none'
78
+ paddingBottom: 'none',
79
+ backgroundColor: 'transparent',
80
+ borderColor: 'transparent',
81
+ textLine: 'none',
82
+ borderWidth: 0
77
83
  } // TODO refactor
78
84
  // eslint-disable-next-line react/no-unstable-nested-components
79
85
  ,
80
- control: controlProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupControl.default, { ...controlProps,
86
+ control: controlProps => /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupControl.default, {
87
+ id: id ?? label,
88
+ ...controlProps,
81
89
  label: label
82
90
  }),
83
91
  ...expandProps,
@@ -85,25 +93,33 @@ const ListboxGroup = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
85
93
  contentPaddingLeft: 'none',
86
94
  contentPaddingRight: 'none',
87
95
  contentPaddingTop: 'none',
88
- contentPaddingBottom: 'none'
96
+ contentPaddingBottom: 'none',
97
+ borderColor: 'transparent',
98
+ borderRadius: 0,
99
+ borderWidth: 0,
100
+ marginBottom: 0
89
101
  },
90
102
  controlRef: ref,
91
103
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
92
- children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListboxItem.default, { ...item,
93
- selected: item.id === selectedId,
94
- isChild: true,
95
- LinkRouter: LinkRouter,
96
- linkRouterProps: linkRouterProps,
97
- ...(index === 0 && {
98
- prevItemRef
99
- }),
100
- ...(index === items.length - 1 && {
101
- nextItemRef
102
- }),
103
- ...(index === items.length - 1 && {
104
- onBlur: onLastItemBlur
105
- })
106
- }, item.label))
104
+ children: items.map((item, index) => {
105
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListboxItem.default, {
106
+ id: item.id ?? item.label,
107
+ ...item,
108
+ selected: item.id && item.id === selectedId || item.label && item.label === selectedId,
109
+ isChild: true,
110
+ LinkRouter: LinkRouter,
111
+ linkRouterProps: linkRouterProps,
112
+ ...(index === 0 && {
113
+ prevItemRef
114
+ }),
115
+ ...(index === items.length - 1 && {
116
+ nextItemRef
117
+ }),
118
+ ...(index === items.length - 1 && {
119
+ onBlur: onLastItemBlur
120
+ })
121
+ }, item.label);
122
+ })
107
123
  })
108
124
  })
109
125
  });
@@ -15,8 +15,6 @@ var _componentsBase = require("@telus-uds/components-base");
15
15
 
16
16
  var _utils = require("../utils");
17
17
 
18
- var _PressableItem = _interopRequireDefault(require("./PressableItem"));
19
-
20
18
  var _jsxRuntime = require("react/jsx-runtime");
21
19
 
22
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -45,48 +43,10 @@ const StyledItemContainer = /*#__PURE__*/_styledComponents.default.li.withConfig
45
43
  }
46
44
  });
47
45
 
48
- const getSelectedItemStyles = _ref2 => {
49
- let {
50
- tokens
51
- } = _ref2;
52
- return {
53
- display: tokens.itemDisplay,
54
- fontFamily: `${tokens.itemFontName}${tokens.itemFontWeight}normal`,
55
- fontSize: tokens.itemFontSize,
56
- paddingTop: tokens.itemPaddingTop,
57
- paddingBottom: tokens.itemPaddingBottom,
58
- paddingLeft: tokens.itemPaddingLeft,
59
- paddingRight: tokens.itemPaddingRight,
60
- color: tokens.itemColor,
61
- textDecoration: tokens.itemTextDecoration,
62
- backgroundColor: tokens.itemBackgroundColor,
63
- outline: tokens.itemOutline,
64
- borderWidth: tokens.itemBorderWidth,
65
- width: '100%'
66
- };
67
- };
68
-
69
- const SelectedItem = /*#__PURE__*/_styledComponents.default.div.withConfig({
70
- displayName: "ListboxItem__SelectedItem",
71
- componentId: "components-web__sc-tlroet-1"
72
- })(_ref3 => {
73
- let {
74
- isChild,
75
- tokens
76
- } = _ref3;
77
- return { ...getSelectedItemStyles({
78
- tokens
79
- }),
80
- borderLeft: isChild ? `${tokens.itemBorderLeftWidth}px solid ${tokens.itemBorderLeftColor}` : 'none'
81
- };
82
- });
83
-
84
- const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
46
+ const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
85
47
  let {
86
48
  href,
87
49
  label,
88
- onPress,
89
- selected = false,
90
50
  isChild = false,
91
51
  onBlur,
92
52
  nextItemRef,
@@ -95,21 +55,22 @@ const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
95
55
  variant = {},
96
56
  LinkRouter,
97
57
  linkRouterProps,
58
+ id,
59
+ onPress = () => {},
60
+ ...rest
61
+ } = _ref2;
62
+ const selectedProps = selectProps({
63
+ href,
98
64
  ...rest
99
- } = _ref4;
100
- const selectedProps = selectProps(rest);
101
- const systemTokens = (0, _componentsBase.useThemeTokens)('ListBox', tokens, variant, {
65
+ });
66
+ const getTokens = (0, _componentsBase.useThemeTokensCallback)('Listbox', tokens, variant, {
102
67
  isChild
103
68
  });
104
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledItemContainer, {
105
70
  isChild: isChild,
106
71
  ...selectedProps,
107
72
  role: "option",
108
- children: selected ? /*#__PURE__*/(0, _jsxRuntime.jsx)(SelectedItem, {
109
- isChild: isChild,
110
- tokens: systemTokens,
111
- children: label
112
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_PressableItem.default, {
73
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_componentsBase.PressableItem, {
113
74
  href: href,
114
75
  isChild: isChild,
115
76
  onPress: onPress,
@@ -117,6 +78,9 @@ const ListboxItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
117
78
  nextItemRef: nextItemRef,
118
79
  prevItemRef: prevItemRef,
119
80
  ref: ref,
81
+ tokens: getTokens,
82
+ selectedProps: selectedProps,
83
+ id: id,
120
84
  children: label
121
85
  })
122
86
  });
@@ -129,8 +93,7 @@ ListboxItem.propTypes = { ...selectedSystemPropTypes,
129
93
  label: _propTypes.default.node.isRequired,
130
94
  nextItemRef: _propTypes.default.object,
131
95
  prevItemRef: _propTypes.default.object,
132
- onPress: _propTypes.default.func,
133
- selected: _propTypes.default.bool
96
+ onPress: _propTypes.default.func
134
97
  };
135
98
 
136
99
  var _default = (0, _componentsBase.withLinkRouter)(ListboxItem);
@@ -52,7 +52,7 @@ const DropdownOverlay = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
52
52
  minWidth,
53
53
  onLayout
54
54
  } = _ref;
55
- const systemTokens = (0, _componentsBase.useThemeTokens)('ListBox', {}, {});
55
+ const systemTokens = (0, _componentsBase.useThemeTokens)('Listbox', {}, {});
56
56
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_WebPortal.default, {
57
57
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
58
58
  ref: ref,
@@ -57,13 +57,14 @@ const StyledControlBar = /*#__PURE__*/_styledComponents.default.div.withConfig({
57
57
  componentId: "components-web__sc-13y61ky-1"
58
58
  })(_ref2 => {
59
59
  let {
60
- padding
60
+ padding,
61
+ height
61
62
  } = _ref2;
62
63
  return {
63
64
  boxSizing: 'border-box',
64
65
  position: 'absolute',
65
66
  width: '100%',
66
- height: 56,
67
+ height,
67
68
  padding,
68
69
  bottom: 0,
69
70
  backgroundColor: 'rgba(42, 44, 46, 0.85)',
@@ -141,21 +142,23 @@ const ControlBar = _ref4 => {
141
142
  variant,
142
143
  ...rest
143
144
  } = _ref4;
145
+ const viewport = (0, _componentsBase.useViewport)();
144
146
  const {
145
147
  paddingTop,
146
148
  paddingBottom,
147
- paddingLeft: paddingLeftDefault,
148
- paddingRight: paddingRightDefault,
149
- paddingLeftCompactMode,
150
- paddingRightCompactMode,
149
+ paddingLeft,
150
+ paddingRight,
151
151
  menuBottom,
152
152
  menuRight,
153
153
  menuMarginLeft,
154
154
  captionsIcon,
155
155
  settingsIcon,
156
156
  minimizeIcon,
157
- maximizeIcon
158
- } = (0, _componentsBase.useThemeTokens)('VideoControlBar', tokens, variant);
157
+ maximizeIcon,
158
+ height
159
+ } = (0, _componentsBase.useThemeTokens)('VideoControlBar', tokens, variant, {
160
+ viewport
161
+ });
159
162
 
160
163
  const parseVideoQuality = () => {
161
164
  return sources.map(source => {
@@ -184,8 +187,6 @@ const ControlBar = _ref4 => {
184
187
  return parsed;
185
188
  };
186
189
 
187
- const paddingLeft = videoPlayerWidth > compactModeThreshold ? paddingLeftDefault : paddingLeftCompactMode;
188
- const paddingRight = videoPlayerWidth > compactModeThreshold ? paddingRightDefault : paddingRightCompactMode;
189
190
  const menuContainerStyleProps = {
190
191
  menuBottom,
191
192
  menuRight,
@@ -197,10 +198,12 @@ const ControlBar = _ref4 => {
197
198
  ...selectProps(rest),
198
199
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledControlBar, {
199
200
  padding: `${paddingTop}px ${paddingRight}px ${paddingBottom}px ${paddingLeft}px`,
201
+ height: `${height}px`,
200
202
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(VideoProgressBarContainer, {
201
203
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_VideoProgressBar.default, {
202
204
  copy: copy,
203
205
  videoPlayer: videoPlayer,
206
+ playing: videoPlaying,
204
207
  videoLength: videoLength,
205
208
  videoCurrentTime: videoCurrentTime,
206
209
  videoBufferEnd: videoBufferEnd,