@telus-uds/components-web 2.10.0 → 2.12.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 (60) hide show
  1. package/CHANGELOG.md +33 -2
  2. package/component-docs.json +76 -11
  3. package/lib/BlockQuote/BlockQuote.js +4 -1
  4. package/lib/Card/Card.js +2 -0
  5. package/lib/DatePicker/DatePicker.js +23 -12
  6. package/lib/ExpandCollapseMini/ExpandCollapseMini.js +5 -10
  7. package/lib/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
  8. package/lib/Footnote/FootnoteLink.js +1 -2
  9. package/lib/Listbox/GroupControl.js +44 -28
  10. package/lib/Listbox/Listbox.js +54 -47
  11. package/lib/Listbox/ListboxGroup.js +36 -20
  12. package/lib/Listbox/ListboxItem.js +14 -51
  13. package/lib/Listbox/ListboxOverlay.js +1 -1
  14. package/lib/PriceLockup/PriceLockup.js +6 -1
  15. package/lib/Video/ControlBar/ControlBar.js +13 -10
  16. package/lib/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  17. package/lib/VideoPicker/VideoPicker.js +1 -1
  18. package/lib/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  19. package/lib/utils/index.js +3 -3
  20. package/lib-module/BlockQuote/BlockQuote.js +4 -1
  21. package/lib-module/Card/Card.js +2 -0
  22. package/lib-module/DatePicker/DatePicker.js +23 -12
  23. package/lib-module/ExpandCollapseMini/ExpandCollapseMini.js +6 -11
  24. package/lib-module/ExpandCollapseMini/ExpandCollapseMiniControl.js +32 -7
  25. package/lib-module/Footnote/FootnoteLink.js +1 -2
  26. package/lib-module/Listbox/GroupControl.js +45 -29
  27. package/lib-module/Listbox/Listbox.js +54 -46
  28. package/lib-module/Listbox/ListboxGroup.js +37 -21
  29. package/lib-module/Listbox/ListboxItem.js +15 -51
  30. package/lib-module/Listbox/ListboxOverlay.js +1 -1
  31. package/lib-module/PriceLockup/PriceLockup.js +7 -2
  32. package/lib-module/Video/ControlBar/ControlBar.js +14 -11
  33. package/lib-module/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.js +4 -1
  34. package/lib-module/VideoPicker/VideoPicker.js +1 -1
  35. package/lib-module/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.js +14 -2
  36. package/lib-module/utils/index.js +1 -1
  37. package/package.json +3 -3
  38. package/src/BlockQuote/BlockQuote.jsx +13 -1
  39. package/src/Card/Card.jsx +12 -8
  40. package/src/DatePicker/DatePicker.jsx +22 -12
  41. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +9 -6
  42. package/src/ExpandCollapseMini/ExpandCollapseMiniControl.jsx +21 -4
  43. package/src/Footnote/FootnoteLink.jsx +1 -2
  44. package/src/Listbox/GroupControl.jsx +50 -33
  45. package/src/Listbox/Listbox.jsx +59 -50
  46. package/src/Listbox/ListboxGroup.jsx +34 -19
  47. package/src/Listbox/ListboxItem.jsx +26 -48
  48. package/src/Listbox/ListboxOverlay.jsx +1 -1
  49. package/src/PriceLockup/PriceLockup.jsx +7 -2
  50. package/src/Video/ControlBar/ControlBar.jsx +17 -13
  51. package/src/Video/ControlBar/Controls/VideoProgressBar/VideoProgressBar.jsx +2 -1
  52. package/src/VideoPicker/VideoPicker.jsx +1 -1
  53. package/src/shared/VideoSplash/SplashButtonWithDetails/SplashButtonWithDetails.jsx +8 -1
  54. package/src/utils/index.js +1 -1
  55. package/lib/Listbox/PressableItem.js +0 -149
  56. package/lib/utils/htmlAttrs.js +0 -33
  57. package/lib-module/Listbox/PressableItem.js +0 -128
  58. package/lib-module/utils/htmlAttrs.js +0 -22
  59. package/src/Listbox/PressableItem.jsx +0 -121
  60. package/src/utils/htmlAttrs.js +0 -29
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import styled from 'styled-components';
3
3
  import PropTypes from 'prop-types';
4
- import { Icon, Spacer, useThemeTokens } from '@telus-uds/components-base';
4
+ import { Icon, Spacer, useThemeTokens, useListboxContext } from '@telus-uds/components-base';
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  const StyledControlWrapper = /*#__PURE__*/styled.div.withConfig({
@@ -9,32 +9,41 @@ const StyledControlWrapper = /*#__PURE__*/styled.div.withConfig({
9
9
  componentId: "components-web__sc-1r7ts3q-0"
10
10
  })(_ref => {
11
11
  let {
12
- focus,
13
- tokens
12
+ groupFontName,
13
+ groupFontWeight,
14
+ groupFontSize,
15
+ groupColor,
16
+ groupBackgroundColor,
17
+ groupBorderColor,
18
+ groupBorderWidth,
19
+ groupBorderRadius,
20
+ groupPaddingLeft,
21
+ groupPaddingRight,
22
+ groupPaddingTop,
23
+ groupPaddingBottom,
24
+ itemTextDecoration,
25
+ itemOutline,
26
+ groupHeight
14
27
  } = _ref;
15
28
  return {
16
- fontFamily: `${tokens.groupFontName}${tokens.groupFontWeight}normal`,
17
- fontSize: tokens.groupFontSize,
18
- color: tokens.groupColor,
19
- textDecoration: tokens.itemTextDecoration,
20
- backgroundColor: tokens.groupBackgroundColor,
21
- outline: tokens.itemOutline,
29
+ fontFamily: `${groupFontName}${groupFontWeight}normal`,
30
+ fontSize: groupFontSize,
31
+ color: groupColor,
32
+ textDecoration: itemTextDecoration,
33
+ backgroundColor: groupBackgroundColor,
34
+ outline: itemOutline,
22
35
  width: '100%',
36
+ height: groupHeight,
23
37
  display: 'flex',
38
+ alignItems: 'center',
24
39
  justifyContent: 'space-between',
25
- ...(focus ? {
26
- border: `${tokens.groupBorderWidth} solid ${tokens.groupBorderColor}`,
27
- borderRadius: tokens.groupBorderRadius,
28
- paddingLeft: `calc(${tokens.groupPaddingLeft}px - ${tokens.groupBorderWidth}px)`,
29
- paddingRight: `calc(${tokens.groupPaddingRight}px - ${tokens.groupBorderWidth}px)`,
30
- paddingTop: `calc(${tokens.groupPaddingTop}px - ${tokens.groupBorderWidth}px)`,
31
- paddingBottom: `calc(${tokens.groupPaddingBottom}px - ${tokens.groupBorderWidth}px)`
32
- } : {
33
- paddingLeft: tokens.groupPaddingLeft,
34
- paddingRight: tokens.groupPaddingRight,
35
- paddingTop: tokens.groupPaddingTop,
36
- paddingBottom: tokens.groupPaddingBottom
37
- })
40
+ boxSizing: 'border-box',
41
+ border: `${groupBorderWidth}px solid ${groupBorderColor}`,
42
+ borderRadius: groupBorderRadius,
43
+ paddingLeft: groupPaddingLeft - groupBorderWidth,
44
+ paddingRight: groupPaddingRight - groupBorderWidth,
45
+ paddingTop: groupPaddingTop - groupBorderWidth,
46
+ paddingBottom: groupPaddingBottom - groupBorderWidth
38
47
  };
39
48
  });
40
49
 
@@ -44,24 +53,31 @@ const GroupControl = _ref2 => {
44
53
  pressed,
45
54
  hover,
46
55
  focus,
47
- current,
48
- label
56
+ label,
57
+ id
49
58
  } = _ref2;
50
- const tokens = useThemeTokens('ListBox', {}, {}, {
59
+ const {
60
+ selectedId,
61
+ setSelectedId
62
+ } = useListboxContext();
63
+ const tokens = useThemeTokens('Listbox', {}, {}, {
51
64
  expanded,
52
65
  pressed,
53
66
  hover,
54
- current,
67
+ current: selectedId === id && id !== undefined,
55
68
  focus
56
69
  });
57
70
  return /*#__PURE__*/_jsxs(StyledControlWrapper, {
58
- focus,
59
- tokens,
71
+ onClick: () => setSelectedId(id),
72
+ ...tokens,
60
73
  children: [label, /*#__PURE__*/_jsx(Spacer, {
61
74
  space: 1,
62
75
  direction: "row"
63
76
  }), /*#__PURE__*/_jsx(Icon, {
64
77
  icon: tokens.groupIcon,
78
+ tokens: {
79
+ color: tokens.groupColor
80
+ },
65
81
  variant: {
66
82
  size: 'micro'
67
83
  }
@@ -70,11 +86,11 @@ const GroupControl = _ref2 => {
70
86
  };
71
87
 
72
88
  GroupControl.propTypes = {
89
+ id: PropTypes.string,
73
90
  expanded: PropTypes.bool,
74
91
  pressed: PropTypes.bool,
75
92
  hover: PropTypes.bool,
76
93
  focus: PropTypes.bool,
77
- current: PropTypes.bool,
78
94
  label: PropTypes.string
79
95
  };
80
96
  export default GroupControl;
@@ -1,11 +1,10 @@
1
1
  import React, { useCallback, useEffect, useRef, useState } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import styled from 'styled-components';
4
- import { ExpandCollapse, withLinkRouter } from '@telus-uds/components-base';
4
+ import { ExpandCollapse, useThemeTokens, withLinkRouter, ListboxContext } from '@telus-uds/components-base';
5
5
  import ListboxGroup from './ListboxGroup';
6
6
  import ListboxItem from './ListboxItem';
7
7
  import DropdownOverlay from './ListboxOverlay';
8
- import resolveItemSelection from '../NavigationBar/resolveItemSelection';
9
8
  import { createElement as _createElement } from "react";
10
9
  import { jsx as _jsx } from "react/jsx-runtime";
11
10
  const StyledList = /*#__PURE__*/styled.ul.withConfig({
@@ -26,12 +25,19 @@ const Listbox = _ref => {
26
25
  // focus will be moved to this one once within the menu
27
26
  parentRef = null,
28
27
  // to return focus to after leaving the last menu item
29
- selectedId,
28
+ selectedId: defaultSelectedId,
30
29
  LinkRouter,
31
30
  itemRouterProps,
32
- onClose
31
+ onClose,
32
+ variant,
33
+ tokens
33
34
  } = _ref;
34
- const initialOpen = getInitialOpen(items, selectedId); // We need to keep track of each item's ref in order to be able to
35
+ const initialOpen = getInitialOpen(items, defaultSelectedId);
36
+ const [selectedId, setSelectedId] = useState(defaultSelectedId);
37
+ const {
38
+ minHeight,
39
+ minWidth
40
+ } = useThemeTokens('Listbox', variant, tokens); // We need to keep track of each item's ref in order to be able to
35
41
  // focus on a specific item via keyboard navigation
36
42
 
37
43
  const itemRefs = useRef([]);
@@ -76,48 +82,50 @@ const Listbox = _ref => {
76
82
  window.removeEventListener('touchstart', onClose);
77
83
  };
78
84
  }, [onClose, handleKeydown]);
79
- return /*#__PURE__*/_jsx(ExpandCollapse, {
80
- initialOpen: initialOpen,
81
- maxOpen: 1,
82
- children: expandProps => /*#__PURE__*/_jsx(StyledList, {
83
- role: "listbox",
84
- children: items.map((item, index) => {
85
- const {
86
- id,
87
- label,
88
- items: nestedItems
89
- } = item;
90
- const {
91
- itemId,
92
- selected
93
- } = resolveItemSelection({
94
- id,
95
- label,
96
- items: nestedItems
97
- }, selectedId); // Give `firstItemRef` to the first focusable item
85
+ return /*#__PURE__*/_jsx(ListboxContext.Provider, {
86
+ value: {
87
+ selectedId,
88
+ setSelectedId
89
+ },
90
+ children: /*#__PURE__*/_jsx(ExpandCollapse, {
91
+ initialOpen: initialOpen,
92
+ maxOpen: 1,
93
+ children: expandProps => /*#__PURE__*/_jsx(StyledList, {
94
+ role: "listbox",
95
+ style: {
96
+ minHeight,
97
+ minWidth
98
+ },
99
+ children: items.map((item, index) => {
100
+ const {
101
+ id,
102
+ label,
103
+ items: nestedItems
104
+ } = item;
105
+ const itemId = id ?? label; // Give `firstItemRef` to the first focusable item
98
106
 
99
- const itemRef = index === 0 && !itemId !== selectedId || index === 1 && items[0].id === selectedId ? firstItemRef : ref => {
100
- itemRefs.current[index] = ref;
101
- return ref;
102
- };
103
- return nestedItems ? /*#__PURE__*/_createElement(ListboxGroup, { ...item,
104
- selectedId: selectedId,
105
- key: itemId,
106
- expandProps: expandProps,
107
- LinkRouter: LinkRouter,
108
- itemRouterProps: itemRouterProps,
109
- prevItemRef: itemRefs.current[index - 1] ?? null,
110
- nextItemRef: itemRefs.current[index + 1] ?? null,
111
- ref: itemRef
112
- }) : /*#__PURE__*/_createElement(ListboxItem, { ...item,
113
- selected: selected,
114
- key: itemId,
115
- LinkRouter: LinkRouter,
116
- itemRouterProps: itemRouterProps,
117
- prevItemRef: itemRefs.current[index - 1] ?? null,
118
- nextItemRef: itemRefs.current[index + 1] ?? null,
119
- ref: itemRef
120
- });
107
+ const itemRef = index === 0 && !itemId !== selectedId || index === 1 && items[0].id === selectedId ? firstItemRef : ref => {
108
+ itemRefs.current[index] = ref;
109
+ return ref;
110
+ };
111
+ return nestedItems ? /*#__PURE__*/_createElement(ListboxGroup, { ...item,
112
+ expandProps: expandProps,
113
+ LinkRouter: LinkRouter,
114
+ itemRouterProps: itemRouterProps,
115
+ prevItemRef: itemRefs.current[index - 1] ?? null,
116
+ nextItemRef: itemRefs.current[index + 1] ?? null,
117
+ ref: itemRef,
118
+ key: itemId
119
+ }) : /*#__PURE__*/_createElement(ListboxItem, { ...item,
120
+ key: itemId,
121
+ id: itemId,
122
+ LinkRouter: LinkRouter,
123
+ itemRouterProps: itemRouterProps,
124
+ prevItemRef: itemRefs.current[index - 1] ?? null,
125
+ nextItemRef: itemRefs.current[index + 1] ?? null,
126
+ ref: itemRef
127
+ });
128
+ })
121
129
  })
122
130
  })
123
131
  });
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable react/require-default-props */
2
2
  import React, { forwardRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
- import { ExpandCollapse, withLinkRouter } from '@telus-uds/components-base';
4
+ import { ExpandCollapse, withLinkRouter, useListboxContext } from '@telus-uds/components-base';
5
5
  import styled from 'styled-components';
6
6
  import ListboxItem from './ListboxItem';
7
7
  import GroupControl from './GroupControl';
@@ -33,7 +33,6 @@ const ListboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
33
33
  id,
34
34
  label,
35
35
  items,
36
- selectedId,
37
36
  LinkRouter,
38
37
  linkRouterProps,
39
38
  expandProps,
@@ -41,7 +40,10 @@ const ListboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
41
40
  nextItemRef,
42
41
  prevItemRef
43
42
  } = _ref;
44
- // TODO: implement keyboard navigation via refs for grouped items separately here
43
+ const {
44
+ selectedId
45
+ } = useListboxContext(); // TODO: implement keyboard navigation via refs for grouped items separately here
46
+
45
47
  return /*#__PURE__*/_jsx(StyledGroupWrapper, {
46
48
  role: "option",
47
49
  children: /*#__PURE__*/_jsx(ExpandCollapse.Panel, {
@@ -51,11 +53,17 @@ const ListboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
51
53
  paddingLeft: 'none',
52
54
  paddingRight: 'none',
53
55
  paddingTop: 'none',
54
- paddingBottom: 'none'
56
+ paddingBottom: 'none',
57
+ backgroundColor: 'transparent',
58
+ borderColor: 'transparent',
59
+ textLine: 'none',
60
+ borderWidth: 0
55
61
  } // TODO refactor
56
62
  // eslint-disable-next-line react/no-unstable-nested-components
57
63
  ,
58
- control: controlProps => /*#__PURE__*/_jsx(GroupControl, { ...controlProps,
64
+ control: controlProps => /*#__PURE__*/_jsx(GroupControl, {
65
+ id: id ?? label,
66
+ ...controlProps,
59
67
  label: label
60
68
  }),
61
69
  ...expandProps,
@@ -63,25 +71,33 @@ const ListboxGroup = /*#__PURE__*/forwardRef((_ref, ref) => {
63
71
  contentPaddingLeft: 'none',
64
72
  contentPaddingRight: 'none',
65
73
  contentPaddingTop: 'none',
66
- contentPaddingBottom: 'none'
74
+ contentPaddingBottom: 'none',
75
+ borderColor: 'transparent',
76
+ borderRadius: 0,
77
+ borderWidth: 0,
78
+ marginBottom: 0
67
79
  },
68
80
  controlRef: ref,
69
81
  children: /*#__PURE__*/_jsx(StyledList, {
70
- children: items.map((item, index) => /*#__PURE__*/_jsx(ListboxItem, { ...item,
71
- selected: item.id === selectedId,
72
- isChild: true,
73
- LinkRouter: LinkRouter,
74
- linkRouterProps: linkRouterProps,
75
- ...(index === 0 && {
76
- prevItemRef
77
- }),
78
- ...(index === items.length - 1 && {
79
- nextItemRef
80
- }),
81
- ...(index === items.length - 1 && {
82
- onBlur: onLastItemBlur
83
- })
84
- }, item.label))
82
+ children: items.map((item, index) => {
83
+ return /*#__PURE__*/_jsx(ListboxItem, {
84
+ id: item.id ?? item.label,
85
+ ...item,
86
+ selected: item.id && item.id === selectedId || item.label && item.label === selectedId,
87
+ isChild: true,
88
+ LinkRouter: LinkRouter,
89
+ linkRouterProps: linkRouterProps,
90
+ ...(index === 0 && {
91
+ prevItemRef
92
+ }),
93
+ ...(index === items.length - 1 && {
94
+ nextItemRef
95
+ }),
96
+ ...(index === items.length - 1 && {
97
+ onBlur: onLastItemBlur
98
+ })
99
+ }, item.label);
100
+ })
85
101
  })
86
102
  })
87
103
  });
@@ -2,9 +2,8 @@
2
2
  import React, { forwardRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import styled from 'styled-components';
5
- import { selectSystemProps, withLinkRouter, useThemeTokens } from '@telus-uds/components-base';
5
+ import { selectSystemProps, withLinkRouter, useThemeTokensCallback, PressableItem } from '@telus-uds/components-base';
6
6
  import { htmlAttrs } from '../utils';
7
- import PressableItem from './PressableItem';
8
7
  import { jsx as _jsx } from "react/jsx-runtime";
9
8
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([htmlAttrs]);
10
9
  const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
@@ -23,48 +22,10 @@ const StyledItemContainer = /*#__PURE__*/styled.li.withConfig({
23
22
  margin: 0
24
23
  }
25
24
  });
26
-
27
- const getSelectedItemStyles = _ref2 => {
28
- let {
29
- tokens
30
- } = _ref2;
31
- return {
32
- display: tokens.itemDisplay,
33
- fontFamily: `${tokens.itemFontName}${tokens.itemFontWeight}normal`,
34
- fontSize: tokens.itemFontSize,
35
- paddingTop: tokens.itemPaddingTop,
36
- paddingBottom: tokens.itemPaddingBottom,
37
- paddingLeft: tokens.itemPaddingLeft,
38
- paddingRight: tokens.itemPaddingRight,
39
- color: tokens.itemColor,
40
- textDecoration: tokens.itemTextDecoration,
41
- backgroundColor: tokens.itemBackgroundColor,
42
- outline: tokens.itemOutline,
43
- borderWidth: tokens.itemBorderWidth,
44
- width: '100%'
45
- };
46
- };
47
-
48
- const SelectedItem = /*#__PURE__*/styled.div.withConfig({
49
- displayName: "ListboxItem__SelectedItem",
50
- componentId: "components-web__sc-tlroet-1"
51
- })(_ref3 => {
52
- let {
53
- isChild,
54
- tokens
55
- } = _ref3;
56
- return { ...getSelectedItemStyles({
57
- tokens
58
- }),
59
- borderLeft: isChild ? `${tokens.itemBorderLeftWidth}px solid ${tokens.itemBorderLeftColor}` : 'none'
60
- };
61
- });
62
- const ListboxItem = /*#__PURE__*/forwardRef((_ref4, ref) => {
25
+ const ListboxItem = /*#__PURE__*/forwardRef((_ref2, ref) => {
63
26
  let {
64
27
  href,
65
28
  label,
66
- onPress,
67
- selected = false,
68
29
  isChild = false,
69
30
  onBlur,
70
31
  nextItemRef,
@@ -73,21 +34,22 @@ const ListboxItem = /*#__PURE__*/forwardRef((_ref4, ref) => {
73
34
  variant = {},
74
35
  LinkRouter,
75
36
  linkRouterProps,
37
+ id,
38
+ onPress = () => {},
76
39
  ...rest
77
- } = _ref4;
78
- const selectedProps = selectProps(rest);
79
- const systemTokens = useThemeTokens('ListBox', tokens, variant, {
40
+ } = _ref2;
41
+ const selectedProps = selectProps({
42
+ href,
43
+ ...rest
44
+ });
45
+ const getTokens = useThemeTokensCallback('Listbox', tokens, variant, {
80
46
  isChild
81
47
  });
82
48
  return /*#__PURE__*/_jsx(StyledItemContainer, {
83
49
  isChild: isChild,
84
50
  ...selectedProps,
85
51
  role: "option",
86
- children: selected ? /*#__PURE__*/_jsx(SelectedItem, {
87
- isChild: isChild,
88
- tokens: systemTokens,
89
- children: label
90
- }) : /*#__PURE__*/_jsx(PressableItem, {
52
+ children: /*#__PURE__*/_jsx(PressableItem, {
91
53
  href: href,
92
54
  isChild: isChild,
93
55
  onPress: onPress,
@@ -95,6 +57,9 @@ const ListboxItem = /*#__PURE__*/forwardRef((_ref4, ref) => {
95
57
  nextItemRef: nextItemRef,
96
58
  prevItemRef: prevItemRef,
97
59
  ref: ref,
60
+ tokens: getTokens,
61
+ selectedProps: selectedProps,
62
+ id: id,
98
63
  children: label
99
64
  })
100
65
  });
@@ -107,7 +72,6 @@ ListboxItem.propTypes = { ...selectedSystemPropTypes,
107
72
  label: PropTypes.node.isRequired,
108
73
  nextItemRef: PropTypes.object,
109
74
  prevItemRef: PropTypes.object,
110
- onPress: PropTypes.func,
111
- selected: PropTypes.bool
75
+ onPress: PropTypes.func
112
76
  };
113
77
  export default withLinkRouter(ListboxItem);
@@ -31,7 +31,7 @@ const DropdownOverlay = /*#__PURE__*/forwardRef((_ref, ref) => {
31
31
  minWidth,
32
32
  onLayout
33
33
  } = _ref;
34
- const systemTokens = useThemeTokens('ListBox', {}, {});
34
+ const systemTokens = useThemeTokens('Listbox', {}, {});
35
35
  return /*#__PURE__*/_jsx(WebPortal, {
36
36
  children: /*#__PURE__*/_jsx(View, {
37
37
  ref: ref,
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { A11yText, Divider, selectSystemProps, Typography, useThemeTokens, useViewport } from '@telus-uds/components-base';
3
+ import { A11yText, Divider, selectSystemProps, Typography, useThemeTokens, useViewport, getTokensPropType } from '@telus-uds/components-base';
4
4
  import styled from 'styled-components';
5
5
  import FootnoteLink from '../Footnote/FootnoteLink';
6
6
  import getTypographyTokens from './tokens';
@@ -293,6 +293,11 @@ PriceLockup.propTypes = { ...selectedSystemPropTypes,
293
293
  *
294
294
  * **Note:** a11yText will override strikethrough price, so it must include price (ie. "was 50 dollars per month")
295
295
  */
296
- a11yText: PropTypes.string
296
+ a11yText: PropTypes.string,
297
+
298
+ /**
299
+ * `PriceLockup` tokens
300
+ */
301
+ tokens: getTokensPropType('PriceLockup')
297
302
  };
298
303
  export default PriceLockup;
@@ -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.1",
8
+ "@telus-uds/components-base": "1.53.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.34.0",
15
+ "@telus-uds/system-theme-tokens": "^2.36.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.10.0"
66
+ "version": "2.12.0"
67
67
  }