@telus-uds/components-base 1.59.0 → 1.59.1

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 Tue, 08 Aug 2023 23:51:39 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 21 Aug 2023 19:02:53 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.59.1
8
+
9
+ Mon, 21 Aug 2023 19:02:53 GMT
10
+
11
+ ### Patches
12
+
13
+ - Synced up event propagation to the relevant element taking `id` (shahzaibkhalidmalik@outlook.com)
14
+ - fixes on tooltip component (mauricio.batresmontejo@telus.com)
15
+
7
16
  ## 1.59.0
8
17
 
9
- Tue, 08 Aug 2023 23:51:39 GMT
18
+ Wed, 09 Aug 2023 00:02:59 GMT
10
19
 
11
20
  ### Minor changes
12
21
 
@@ -9128,6 +9128,13 @@
9128
9128
  },
9129
9129
  "required": false,
9130
9130
  "description": ""
9131
+ },
9132
+ "nativeSubmitBtnID": {
9133
+ "type": {
9134
+ "name": "string"
9135
+ },
9136
+ "required": false,
9137
+ "description": "ID for Submit button element on web"
9131
9138
  }
9132
9139
  },
9133
9140
  "attributes": {
@@ -13,6 +13,8 @@ var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Vi
13
13
 
14
14
  var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
15
15
 
16
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
17
+
16
18
  var _propTypes = _interopRequireDefault(require("prop-types"));
17
19
 
18
20
  var _ThemeProvider = require("../ThemeProvider");
@@ -150,11 +152,11 @@ const ExpandCollapseControl = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) =
150
152
  } = getControlTokens(pressableState);
151
153
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
152
154
  children: [IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
153
- style: selectIconContainerStyles(themeTokens),
155
+ style: [selectIconContainerStyles(themeTokens), staticStyles.bubblePointerEvents],
154
156
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, { ...selectIconTokens(themeTokens)
155
157
  })
156
158
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
157
- style: selectTextContainerStyles(themeTokens),
159
+ style: [selectTextContainerStyles(themeTokens), staticStyles.bubblePointerEvents],
158
160
  children: typeof children === 'function' ? children(getControlState(pressableState)) : children
159
161
  })]
160
162
  });
@@ -162,6 +164,13 @@ const ExpandCollapseControl = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) =
162
164
  });
163
165
  });
164
166
  ExpandCollapseControl.displayName = 'ExpandCollapseControl';
167
+
168
+ const staticStyles = _StyleSheet.default.create({
169
+ bubblePointerEvents: {
170
+ pointerEvents: 'none'
171
+ }
172
+ });
173
+
165
174
  ExpandCollapseControl.propTypes = { ...selectedSystemPropTypes,
166
175
  tokens: (0, _utils.getTokensPropType)('ExpandCollapseControl'),
167
176
  variant: _utils.variantProp.propType,
@@ -107,7 +107,12 @@ const selectInnerStyle = _ref2 => {
107
107
  paddingLeft: calculatePadding(paddingLeft, borderLeftWidth),
108
108
  paddingRight: calculatePadding(paddingRight, borderRightWidth),
109
109
  paddingTop: calculatePadding(paddingTop, borderTopWidth),
110
- paddingBottom: calculatePadding(paddingBottom, borderBottomWidth)
110
+ paddingBottom: calculatePadding(paddingBottom, borderBottomWidth),
111
+ ..._Platform.default.select({
112
+ web: {
113
+ pointerEvents: 'none'
114
+ }
115
+ })
111
116
  };
112
117
  };
113
118
  /**
@@ -98,6 +98,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
98
98
  copy = 'en',
99
99
  tokens,
100
100
  variant,
101
+ nativeSubmitBtnID,
101
102
  ...rest
102
103
  } = _ref3;
103
104
  const {
@@ -195,6 +196,7 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
195
196
  tokens: buttonState => selectButtonTokens(getButtonTokens({ ...buttonState,
196
197
  priority: 'high'
197
198
  })),
199
+ nativeID: nativeSubmitBtnID,
198
200
  children: buttonState => /*#__PURE__*/(0, _jsxRuntime.jsx)(SubmitButtonIcon, { ...selectIconTokens(getButtonTokens({ ...buttonState,
199
201
  priority: 'high'
200
202
  }))
@@ -262,7 +264,12 @@ Search.propTypes = { ...selectedContainerPropTypes,
262
264
  submitButtonAccessibilityLabel: _propTypes.default.string
263
265
  })]),
264
266
  tokens: (0, _utils.getTokensPropType)('Search'),
265
- variant: _utils.variantProp.propType
267
+ variant: _utils.variantProp.propType,
268
+
269
+ /**
270
+ * ID for Submit button element on web
271
+ */
272
+ nativeSubmitBtnID: _propTypes.default.string
266
273
  };
267
274
  var _default = Search;
268
275
  exports.default = _default;
package/lib/Tabs/Tabs.js CHANGED
@@ -132,6 +132,7 @@ const Tabs = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
132
132
  const itemProps = selectItemProps(itemRest);
133
133
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_TabsItem.default, {
134
134
  ref: itemRef,
135
+ id: itemId,
135
136
  href: href,
136
137
  variant: variant,
137
138
  tokens: itemTokens,
@@ -122,6 +122,7 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
122
122
  accessibilityState = accessibilityRole === 'tab' ? {
123
123
  selected
124
124
  } : undefined,
125
+ id,
125
126
  ...rawRest
126
127
  } = _ref4;
127
128
 
@@ -187,6 +188,7 @@ const TabsItem = /*#__PURE__*/(0, _react.forwardRef)((_ref4, ref) => {
187
188
  href: href,
188
189
  style: getPressableStyle,
189
190
  onLayout: handleLayout,
191
+ nativeID: id,
190
192
  ...selectedProps,
191
193
  children: pressableState => {
192
194
  const {
@@ -234,7 +236,8 @@ TabsItem.propTypes = { ...selectedSystemPropTypes,
234
236
  index: _propTypes.default.number,
235
237
  selected: _propTypes.default.bool,
236
238
  itemPositions: itemPositionsPropType,
237
- children: _propTypes.default.string
239
+ children: _propTypes.default.string,
240
+ id: _propTypes.default.string
238
241
  };
239
242
 
240
243
  const staticStyles = _StyleSheet.default.create({
@@ -250,7 +253,12 @@ const staticStyles = _StyleSheet.default.create({
250
253
  container: {
251
254
  flexGrow: 1,
252
255
  alignItems: 'center',
253
- justifyContent: 'center'
256
+ justifyContent: 'center',
257
+ ..._Platform.default.select({
258
+ web: {
259
+ pointerEvents: 'none'
260
+ }
261
+ })
254
262
  }
255
263
  });
256
264
 
@@ -125,14 +125,14 @@ const selectArrowStyles = (_ref4, _ref5) => {
125
125
  },
126
126
  left: {
127
127
  right: verticalOffset,
128
- top: tooltipHeight / 2 - horizontalOffset,
128
+ top: tooltipHeight <= 45 ? tooltipHeight / 2 - horizontalOffset : tooltipHeight - (tooltipHeight - 10),
129
129
  transform: [{
130
130
  rotateZ: '-45deg'
131
131
  }]
132
132
  },
133
133
  right: {
134
134
  left: verticalOffset,
135
- top: tooltipHeight / 2 - horizontalOffset,
135
+ top: tooltipHeight <= 45 ? tooltipHeight / 2 - horizontalOffset : tooltipHeight - (tooltipHeight - 10),
136
136
  transform: [{
137
137
  rotateZ: '135deg'
138
138
  }]
@@ -101,7 +101,7 @@ function getTooltipPosition(position, _ref2) {
101
101
  right: windowWidth - (controlX + controlWidth / 2 + tooltipWidth / 2)
102
102
  };
103
103
  const verticalBounds = {
104
- top: controlY + controlHeight / 2 - tooltipHeight / 2,
104
+ top: controlY,
105
105
  bottom: windowHeight - (controlY + controlHeight / 2 + tooltipHeight / 2)
106
106
  }; // calculate absolute coordinates for each of the potential positions (relative to window)
107
107
 
@@ -2,6 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import Pressable from "react-native-web/dist/exports/Pressable";
3
3
  import View from "react-native-web/dist/exports/View";
4
4
  import Platform from "react-native-web/dist/exports/Platform";
5
+ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
5
6
  import PropTypes from 'prop-types';
6
7
  import { useThemeTokensCallback, verticalAlignRow } from '../ThemeProvider';
7
8
  import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps } from '../utils';
@@ -131,11 +132,11 @@ const ExpandCollapseControl = /*#__PURE__*/forwardRef((_ref4, ref) => {
131
132
  } = getControlTokens(pressableState);
132
133
  return /*#__PURE__*/_jsxs(_Fragment, {
133
134
  children: [IconComponent && /*#__PURE__*/_jsx(View, {
134
- style: selectIconContainerStyles(themeTokens),
135
+ style: [selectIconContainerStyles(themeTokens), staticStyles.bubblePointerEvents],
135
136
  children: /*#__PURE__*/_jsx(IconComponent, { ...selectIconTokens(themeTokens)
136
137
  })
137
138
  }), /*#__PURE__*/_jsx(View, {
138
- style: selectTextContainerStyles(themeTokens),
139
+ style: [selectTextContainerStyles(themeTokens), staticStyles.bubblePointerEvents],
139
140
  children: typeof children === 'function' ? children(getControlState(pressableState)) : children
140
141
  })]
141
142
  });
@@ -143,6 +144,11 @@ const ExpandCollapseControl = /*#__PURE__*/forwardRef((_ref4, ref) => {
143
144
  });
144
145
  });
145
146
  ExpandCollapseControl.displayName = 'ExpandCollapseControl';
147
+ const staticStyles = StyleSheet.create({
148
+ bubblePointerEvents: {
149
+ pointerEvents: 'none'
150
+ }
151
+ });
146
152
  ExpandCollapseControl.propTypes = { ...selectedSystemPropTypes,
147
153
  tokens: getTokensPropType('ExpandCollapseControl'),
148
154
  variant: variantProp.propType,
@@ -84,7 +84,12 @@ const selectInnerStyle = _ref2 => {
84
84
  paddingLeft: calculatePadding(paddingLeft, borderLeftWidth),
85
85
  paddingRight: calculatePadding(paddingRight, borderRightWidth),
86
86
  paddingTop: calculatePadding(paddingTop, borderTopWidth),
87
- paddingBottom: calculatePadding(paddingBottom, borderBottomWidth)
87
+ paddingBottom: calculatePadding(paddingBottom, borderBottomWidth),
88
+ ...Platform.select({
89
+ web: {
90
+ pointerEvents: 'none'
91
+ }
92
+ })
88
93
  };
89
94
  };
90
95
  /**
@@ -75,6 +75,7 @@ const Search = /*#__PURE__*/forwardRef((_ref3, ref) => {
75
75
  copy = 'en',
76
76
  tokens,
77
77
  variant,
78
+ nativeSubmitBtnID,
78
79
  ...rest
79
80
  } = _ref3;
80
81
  const {
@@ -172,6 +173,7 @@ const Search = /*#__PURE__*/forwardRef((_ref3, ref) => {
172
173
  tokens: buttonState => selectButtonTokens(getButtonTokens({ ...buttonState,
173
174
  priority: 'high'
174
175
  })),
176
+ nativeID: nativeSubmitBtnID,
175
177
  children: buttonState => /*#__PURE__*/_jsx(SubmitButtonIcon, { ...selectIconTokens(getButtonTokens({ ...buttonState,
176
178
  priority: 'high'
177
179
  }))
@@ -239,6 +241,11 @@ Search.propTypes = { ...selectedContainerPropTypes,
239
241
  submitButtonAccessibilityLabel: PropTypes.string
240
242
  })]),
241
243
  tokens: getTokensPropType('Search'),
242
- variant: variantProp.propType
244
+ variant: variantProp.propType,
245
+
246
+ /**
247
+ * ID for Submit button element on web
248
+ */
249
+ nativeSubmitBtnID: PropTypes.string
243
250
  };
244
251
  export default Search;
@@ -110,6 +110,7 @@ const Tabs = /*#__PURE__*/forwardRef((_ref, ref) => {
110
110
  const itemProps = selectItemProps(itemRest);
111
111
  return /*#__PURE__*/_jsx(TabsItem, {
112
112
  ref: itemRef,
113
+ id: itemId,
113
114
  href: href,
114
115
  variant: variant,
115
116
  tokens: itemTokens,
@@ -98,6 +98,7 @@ const TabsItem = /*#__PURE__*/forwardRef((_ref4, ref) => {
98
98
  accessibilityState = accessibilityRole === 'tab' ? {
99
99
  selected
100
100
  } : undefined,
101
+ id,
101
102
  ...rawRest
102
103
  } = _ref4;
103
104
  // Convert onClick etc to onPress etc if used in an integration
@@ -160,6 +161,7 @@ const TabsItem = /*#__PURE__*/forwardRef((_ref4, ref) => {
160
161
  href: href,
161
162
  style: getPressableStyle,
162
163
  onLayout: handleLayout,
164
+ nativeID: id,
163
165
  ...selectedProps,
164
166
  children: pressableState => {
165
167
  const {
@@ -207,7 +209,8 @@ TabsItem.propTypes = { ...selectedSystemPropTypes,
207
209
  index: PropTypes.number,
208
210
  selected: PropTypes.bool,
209
211
  itemPositions: itemPositionsPropType,
210
- children: PropTypes.string
212
+ children: PropTypes.string,
213
+ id: PropTypes.string
211
214
  };
212
215
  const staticStyles = StyleSheet.create({
213
216
  center: {
@@ -222,7 +225,12 @@ const staticStyles = StyleSheet.create({
222
225
  container: {
223
226
  flexGrow: 1,
224
227
  alignItems: 'center',
225
- justifyContent: 'center'
228
+ justifyContent: 'center',
229
+ ...Platform.select({
230
+ web: {
231
+ pointerEvents: 'none'
232
+ }
233
+ })
226
234
  }
227
235
  });
228
236
  export default withLinkRouter(TabsItem);
@@ -97,14 +97,14 @@ const selectArrowStyles = (_ref4, _ref5) => {
97
97
  },
98
98
  left: {
99
99
  right: verticalOffset,
100
- top: tooltipHeight / 2 - horizontalOffset,
100
+ top: tooltipHeight <= 45 ? tooltipHeight / 2 - horizontalOffset : tooltipHeight - (tooltipHeight - 10),
101
101
  transform: [{
102
102
  rotateZ: '-45deg'
103
103
  }]
104
104
  },
105
105
  right: {
106
106
  left: verticalOffset,
107
- top: tooltipHeight / 2 - horizontalOffset,
107
+ top: tooltipHeight <= 45 ? tooltipHeight / 2 - horizontalOffset : tooltipHeight - (tooltipHeight - 10),
108
108
  transform: [{
109
109
  rotateZ: '135deg'
110
110
  }]
@@ -94,7 +94,7 @@ function getTooltipPosition(position, _ref2) {
94
94
  right: windowWidth - (controlX + controlWidth / 2 + tooltipWidth / 2)
95
95
  };
96
96
  const verticalBounds = {
97
- top: controlY + controlHeight / 2 - tooltipHeight / 2,
97
+ top: controlY,
98
98
  bottom: windowHeight - (controlY + controlHeight / 2 + tooltipHeight / 2)
99
99
  }; // calculate absolute coordinates for each of the potential positions (relative to window)
100
100
 
package/package.json CHANGED
@@ -72,5 +72,5 @@
72
72
  "standard-engine": {
73
73
  "skip": true
74
74
  },
75
- "version": "1.59.0"
75
+ "version": "1.59.1"
76
76
  }
@@ -1,5 +1,5 @@
1
1
  import React, { forwardRef } from 'react'
2
- import { Pressable, View, Platform } from 'react-native'
2
+ import { Pressable, View, Platform, StyleSheet } from 'react-native'
3
3
  import PropTypes from 'prop-types'
4
4
 
5
5
  import { useThemeTokensCallback, verticalAlignRow } from '../ThemeProvider'
@@ -101,11 +101,15 @@ const ExpandCollapseControl = forwardRef(
101
101
  return (
102
102
  <>
103
103
  {IconComponent && (
104
- <View style={selectIconContainerStyles(themeTokens)}>
104
+ <View
105
+ style={[selectIconContainerStyles(themeTokens), staticStyles.bubblePointerEvents]}
106
+ >
105
107
  <IconComponent {...selectIconTokens(themeTokens)} />
106
108
  </View>
107
109
  )}
108
- <View style={selectTextContainerStyles(themeTokens)}>
110
+ <View
111
+ style={[selectTextContainerStyles(themeTokens), staticStyles.bubblePointerEvents]}
112
+ >
109
113
  {typeof children === 'function'
110
114
  ? children(getControlState(pressableState))
111
115
  : children}
@@ -119,6 +123,12 @@ const ExpandCollapseControl = forwardRef(
119
123
  )
120
124
  ExpandCollapseControl.displayName = 'ExpandCollapseControl'
121
125
 
126
+ const staticStyles = StyleSheet.create({
127
+ bubblePointerEvents: {
128
+ pointerEvents: 'none'
129
+ }
130
+ })
131
+
122
132
  ExpandCollapseControl.propTypes = {
123
133
  ...selectedSystemPropTypes,
124
134
  tokens: getTokensPropType('ExpandCollapseControl'),
@@ -86,7 +86,12 @@ const selectInnerStyle = ({
86
86
  paddingLeft: calculatePadding(paddingLeft, borderLeftWidth),
87
87
  paddingRight: calculatePadding(paddingRight, borderRightWidth),
88
88
  paddingTop: calculatePadding(paddingTop, borderTopWidth),
89
- paddingBottom: calculatePadding(paddingBottom, borderBottomWidth)
89
+ paddingBottom: calculatePadding(paddingBottom, borderBottomWidth),
90
+ ...Platform.select({
91
+ web: {
92
+ pointerEvents: 'none'
93
+ }
94
+ })
90
95
  })
91
96
 
92
97
  /**
@@ -71,6 +71,7 @@ const Search = forwardRef(
71
71
  copy = 'en',
72
72
  tokens,
73
73
  variant,
74
+ nativeSubmitBtnID,
74
75
  ...rest
75
76
  },
76
77
  ref
@@ -173,6 +174,7 @@ const Search = forwardRef(
173
174
  tokens={(buttonState) =>
174
175
  selectButtonTokens(getButtonTokens({ ...buttonState, priority: 'high' }))
175
176
  }
177
+ nativeID={nativeSubmitBtnID}
176
178
  >
177
179
  {(buttonState) => (
178
180
  <SubmitButtonIcon
@@ -242,7 +244,11 @@ Search.propTypes = {
242
244
  })
243
245
  ]),
244
246
  tokens: getTokensPropType('Search'),
245
- variant: variantProp.propType
247
+ variant: variantProp.propType,
248
+ /**
249
+ * ID for Submit button element on web
250
+ */
251
+ nativeSubmitBtnID: PropTypes.string
246
252
  }
247
253
 
248
254
  export default Search
package/src/Tabs/Tabs.jsx CHANGED
@@ -127,6 +127,7 @@ const Tabs = forwardRef(
127
127
  <TabsItem
128
128
  ref={itemRef}
129
129
  key={itemId}
130
+ id={itemId}
130
131
  href={href}
131
132
  variant={variant}
132
133
  tokens={itemTokens}
@@ -91,6 +91,7 @@ const TabsItem = forwardRef(
91
91
  ? 'page'
92
92
  : undefined,
93
93
  accessibilityState = accessibilityRole === 'tab' ? { selected } : undefined,
94
+ id,
94
95
  ...rawRest
95
96
  },
96
97
  ref
@@ -150,6 +151,7 @@ const TabsItem = forwardRef(
150
151
  href={href}
151
152
  style={getPressableStyle}
152
153
  onLayout={handleLayout}
154
+ nativeID={id}
153
155
  {...selectedProps}
154
156
  >
155
157
  {(pressableState) => {
@@ -199,7 +201,8 @@ TabsItem.propTypes = {
199
201
  index: PropTypes.number,
200
202
  selected: PropTypes.bool,
201
203
  itemPositions: itemPositionsPropType,
202
- children: PropTypes.string
204
+ children: PropTypes.string,
205
+ id: PropTypes.string
203
206
  }
204
207
 
205
208
  const staticStyles = StyleSheet.create({
@@ -215,7 +218,12 @@ const staticStyles = StyleSheet.create({
215
218
  container: {
216
219
  flexGrow: 1,
217
220
  alignItems: 'center',
218
- justifyContent: 'center'
221
+ justifyContent: 'center',
222
+ ...Platform.select({
223
+ web: {
224
+ pointerEvents: 'none'
225
+ }
226
+ })
219
227
  }
220
228
  })
221
229
 
@@ -61,12 +61,18 @@ const selectArrowStyles = (
61
61
  },
62
62
  left: {
63
63
  right: verticalOffset,
64
- top: tooltipHeight / 2 - horizontalOffset,
64
+ top:
65
+ tooltipHeight <= 45
66
+ ? tooltipHeight / 2 - horizontalOffset
67
+ : tooltipHeight - (tooltipHeight - 10),
65
68
  transform: [{ rotateZ: '-45deg' }]
66
69
  },
67
70
  right: {
68
71
  left: verticalOffset,
69
- top: tooltipHeight / 2 - horizontalOffset,
72
+ top:
73
+ tooltipHeight <= 45
74
+ ? tooltipHeight / 2 - horizontalOffset
75
+ : tooltipHeight - (tooltipHeight - 10),
70
76
  transform: [{ rotateZ: '135deg' }]
71
77
  }
72
78
  }
@@ -71,7 +71,7 @@ function getTooltipPosition(
71
71
  }
72
72
 
73
73
  const verticalBounds = {
74
- top: controlY + controlHeight / 2 - tooltipHeight / 2,
74
+ top: controlY,
75
75
  bottom: windowHeight - (controlY + controlHeight / 2 + tooltipHeight / 2)
76
76
  }
77
77