@telus-uds/components-base 1.14.1 → 1.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Wed, 17 Aug 2022 20:48:46 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 23 Aug 2022 19:30:28 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.14.2
8
+
9
+ Tue, 23 Aug 2022 19:30:28 GMT
10
+
11
+ ### Patches
12
+
13
+ - fix: remove extra icons from pagination (ruslan.bredikhin@nearform.com)
14
+ - Bump @telus-uds/system-theme-tokens to v2.4.0
15
+
7
16
  ## 1.14.1
8
17
 
9
- Wed, 17 Aug 2022 20:48:46 GMT
18
+ Wed, 17 Aug 2022 20:50:59 GMT
10
19
 
11
20
  ### Patches
12
21
 
@@ -1157,6 +1157,16 @@
1157
1157
  true
1158
1158
  ],
1159
1159
  "type": "state"
1160
+ },
1161
+ "width": {
1162
+ "description": "The width of the modal",
1163
+ "values": [
1164
+ "s",
1165
+ "m",
1166
+ "l",
1167
+ "xl"
1168
+ ],
1169
+ "type": "state"
1160
1170
  }
1161
1171
  },
1162
1172
  "Notification": {
@@ -33,12 +33,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
33
33
 
34
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
 
36
- const selectIconTokens = (_ref, direction) => {
36
+ // We need to drop the icon here since it gets rendered via children and not
37
+ // `ButtonBase` in order to tap into the state of the button
38
+ const selectButtonTokens = _ref => {
39
+ let {
40
+ icon: _,
41
+ ...rest
42
+ } = _ref;
43
+ return (0, _utils.selectTokens)('Button', rest);
44
+ };
45
+
46
+ const selectIconTokens = (_ref2, direction) => {
37
47
  let {
38
48
  color,
39
49
  iconSize,
40
50
  iconDisplace
41
- } = _ref;
51
+ } = _ref2;
42
52
  return {
43
53
  color,
44
54
  size: iconSize,
@@ -50,7 +60,7 @@ const directionToSide = {
50
60
  previous: 'left',
51
61
  next: 'right'
52
62
  };
53
- const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
63
+ const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
54
64
  let {
55
65
  direction = 'previous',
56
66
  onPress,
@@ -59,7 +69,7 @@ const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
59
69
  variant,
60
70
  tokens,
61
71
  ...props
62
- } = _ref2;
72
+ } = _ref3;
63
73
  const viewport = (0, _ViewportProvider.useViewport)();
64
74
  const buttonVariant = {
65
75
  direction,
@@ -75,7 +85,7 @@ const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
75
85
  icon
76
86
  } = getTokens(tokens, buttonVariant);
77
87
 
78
- const getButtonTokens = buttonState => (0, _utils.selectTokens)('Button', getTokens(buttonState));
88
+ const getButtonTokens = buttonState => selectButtonTokens(getTokens(buttonState));
79
89
 
80
90
  const getIconTokens = buttonState => selectIconTokens(getTokens(buttonState), direction);
81
91
 
@@ -101,11 +111,11 @@ const SideButton = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
101
111
  ref: ref,
102
112
  ...buttonProps,
103
113
  tokens: getButtonTokens,
104
- children: _ref3 => {
114
+ children: _ref4 => {
105
115
  let {
106
116
  textStyles,
107
117
  ...buttonState
108
- } = _ref3;
118
+ } = _ref4;
109
119
  const iconProps = {
110
120
  tokens: getIconTokens(buttonState)
111
121
  };
@@ -7,15 +7,25 @@ import { useThemeTokensCallback } from '../ThemeProvider';
7
7
  import { useViewport } from '../ViewportProvider';
8
8
  import { copyPropTypes, hrefAttrsProp, linkProps, selectTokens, withLinkRouter } from '../utils';
9
9
  import dictionary from './dictionary';
10
- import useCopy from '../utils/useCopy';
10
+ import useCopy from '../utils/useCopy'; // We need to drop the icon here since it gets rendered via children and not
11
+ // `ButtonBase` in order to tap into the state of the button
12
+
11
13
  import { jsx as _jsx } from "react/jsx-runtime";
12
14
 
13
- const selectIconTokens = (_ref, direction) => {
15
+ const selectButtonTokens = _ref => {
16
+ let {
17
+ icon: _,
18
+ ...rest
19
+ } = _ref;
20
+ return selectTokens('Button', rest);
21
+ };
22
+
23
+ const selectIconTokens = (_ref2, direction) => {
14
24
  let {
15
25
  color,
16
26
  iconSize,
17
27
  iconDisplace
18
- } = _ref;
28
+ } = _ref2;
19
29
  return {
20
30
  color,
21
31
  size: iconSize,
@@ -27,7 +37,7 @@ const directionToSide = {
27
37
  previous: 'left',
28
38
  next: 'right'
29
39
  };
30
- const SideButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
40
+ const SideButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
31
41
  let {
32
42
  direction = 'previous',
33
43
  onPress,
@@ -36,7 +46,7 @@ const SideButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
36
46
  variant,
37
47
  tokens,
38
48
  ...props
39
- } = _ref2;
49
+ } = _ref3;
40
50
  const viewport = useViewport();
41
51
  const buttonVariant = {
42
52
  direction,
@@ -52,7 +62,7 @@ const SideButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
52
62
  icon
53
63
  } = getTokens(tokens, buttonVariant);
54
64
 
55
- const getButtonTokens = buttonState => selectTokens('Button', getTokens(buttonState));
65
+ const getButtonTokens = buttonState => selectButtonTokens(getTokens(buttonState));
56
66
 
57
67
  const getIconTokens = buttonState => selectIconTokens(getTokens(buttonState), direction);
58
68
 
@@ -76,11 +86,11 @@ const SideButton = /*#__PURE__*/forwardRef((_ref2, ref) => {
76
86
  ref: ref,
77
87
  ...buttonProps,
78
88
  tokens: getButtonTokens,
79
- children: _ref3 => {
89
+ children: _ref4 => {
80
90
  let {
81
91
  textStyles,
82
92
  ...buttonState
83
- } = _ref3;
93
+ } = _ref4;
84
94
  const iconProps = {
85
95
  tokens: getIconTokens(buttonState)
86
96
  };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "airbnb-prop-types": "^2.16.0",
11
11
  "@telus-uds/system-constants": "^1.0.4",
12
- "@telus-uds/system-theme-tokens": "^2.3.0",
12
+ "@telus-uds/system-theme-tokens": "^2.4.0",
13
13
  "lodash.debounce": "^4.0.8",
14
14
  "lodash.merge": "^4.6.2",
15
15
  "prop-types": "^15.7.2",
@@ -71,5 +71,5 @@
71
71
  "standard-engine": {
72
72
  "skip": true
73
73
  },
74
- "version": "1.14.1"
74
+ "version": "1.14.2"
75
75
  }
@@ -12,6 +12,9 @@ import { copyPropTypes, hrefAttrsProp, linkProps, selectTokens, withLinkRouter }
12
12
  import dictionary from './dictionary'
13
13
  import useCopy from '../utils/useCopy'
14
14
 
15
+ // We need to drop the icon here since it gets rendered via children and not
16
+ // `ButtonBase` in order to tap into the state of the button
17
+ const selectButtonTokens = ({ icon: _, ...rest }) => selectTokens('Button', rest)
15
18
  const selectIconTokens = ({ color, iconSize, iconDisplace }, direction) => {
16
19
  return {
17
20
  color,
@@ -35,7 +38,7 @@ const SideButton = forwardRef(
35
38
 
36
39
  const { icon } = getTokens(tokens, buttonVariant)
37
40
 
38
- const getButtonTokens = (buttonState) => selectTokens('Button', getTokens(buttonState))
41
+ const getButtonTokens = (buttonState) => selectButtonTokens(getTokens(buttonState))
39
42
  const getIconTokens = (buttonState) => selectIconTokens(getTokens(buttonState), direction)
40
43
 
41
44
  const label = direction === 'previous' ? getCopy('previousText') : getCopy('nextText')