@telus-uds/components-base 3.0.0 → 3.1.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.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,33 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 31 Jan 2025 20:49:19 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 10 Feb 2025 17:30:58 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 3.1.0
8
+
9
+ Mon, 10 Feb 2025 17:30:58 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - `TabsItem`: Add new tokens & design (sergio.ramirez@telus.com)
14
+ - `Listbox`: Include export type members for component. (jaime.tuyuc@telus.com)
15
+ - Bump @telus-uds/system-theme-tokens to v4.1.0
16
+
17
+ ### Patches
18
+
19
+ - `Notification`: remove flex 1 as it was breaking notification on IOS (kristina.kirpichnikova@telus.com)
20
+ - Carousel: may throw a runtime error regarding `outline` property (shahzaibkhalidmalik@outlook.com)
21
+ - `Modal`: fix conditional platform rendering (guillermo.peitzner@telus.com)
22
+ - `ChevronLink`: fix icon resize on IOS after font size increase (kristina.kirpichnikova@telus.com)
23
+ - `ExpandCollapse`: Fix when have another ExpandCollapse nested (Mauricio.BatresMontejo@telus.com)
24
+ - `LinkBase`: fix icon alignment (guillermo.peitzner@telus.com)
25
+ - `TextInputBase`: fix rendering on mobile devices and default value rendering (guillermo.peitzner@telus.com)
26
+ - `MultiSelectFilter`: add token to modify icon color background (Mauricio.BatresMontejo@telus.com)
27
+
7
28
  ## 3.0.0
8
29
 
9
- Fri, 31 Jan 2025 20:49:19 GMT
30
+ Fri, 31 Jan 2025 20:53:28 GMT
10
31
 
11
32
  ### Major changes
12
33
 
@@ -41,12 +41,7 @@ const staticStyles = _StyleSheet.default.create({
41
41
  alignItems: 'center',
42
42
  position: 'relative',
43
43
  top: 0,
44
- left: 0,
45
- ..._Platform.default.select({
46
- web: {
47
- outline: 'none'
48
- }
49
- })
44
+ left: 0
50
45
  },
51
46
  animationControlButton: {
52
47
  position: 'absolute',
@@ -752,7 +747,11 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) => {
752
747
  refocus: refocus,
753
748
  width: containerLayout.width,
754
749
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
755
- style: [staticStyles.root],
750
+ style: [staticStyles.root, {
751
+ ...(_Platform.default.OS === 'web' ? {
752
+ outline: 'none'
753
+ } : {})
754
+ }],
756
755
  onLayout: onContainerLayout,
757
756
  ref: ref,
758
757
  ...systemProps,
@@ -9,6 +9,8 @@ var _Animated = _interopRequireDefault(require("react-native-web/dist/cjs/export
9
9
  var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
10
10
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
11
11
  var _Text = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Text"));
12
+ var _StyleSheet = _interopRequireDefault(require("react-native-web/dist/cjs/exports/StyleSheet"));
13
+ var _ScrollView = _interopRequireDefault(require("react-native-web/dist/cjs/exports/ScrollView"));
12
14
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
15
  var _airbnbPropTypes = _interopRequireDefault(require("airbnb-prop-types"));
14
16
  var _Control = _interopRequireDefault(require("./Control"));
@@ -127,7 +129,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
127
129
  expanded: isExpanded
128
130
  });
129
131
  const handleControlPress = event => {
130
- onToggle(panelId, event);
132
+ onToggle?.(panelId, event);
131
133
  if (onPress) onPress(panelId, event);
132
134
  };
133
135
  const onContainerLayout = event => {
@@ -149,7 +151,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
149
151
  const panelAccessibilityLabel = `${panelId} ${getCopy('panel')}`;
150
152
  const subPanelAccessibilityLabel = `${panelId} ${getCopy('subPanel')}`;
151
153
  return content ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
152
- style: selectContentPanelStyles(themeTokens),
154
+ style: [selectContentPanelStyles(themeTokens), staticStyles.panelContainer],
153
155
  accessibilityLabel: panelAccessibilityLabel,
154
156
  children: typeof children === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
155
157
  style: selectTextStyles(themeTokens),
@@ -158,7 +160,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
158
160
  }) : children
159
161
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
160
162
  ref: ref,
161
- style: themeTokens,
163
+ style: [themeTokens, staticStyles.container],
162
164
  accessibilityLabel: panelAccessibilityLabel,
163
165
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
164
166
  style: selectControlPanelStyles(themeTokens),
@@ -178,7 +180,7 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
178
180
  marginLeft: themeTokens.contentPaddingLeft,
179
181
  marginRight: themeTokens.contentPaddingRight
180
182
  }
181
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.View, {
183
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Animated.default.ScrollView, {
182
184
  ref: animatedRef,
183
185
  style: animatedStyles,
184
186
  ...focusabilityProps,
@@ -187,12 +189,22 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
187
189
  style: {
188
190
  ..._Platform.default.select({
189
191
  default: {
190
- flex: 1
192
+ flex: 1,
193
+ overflow: 'hidden'
191
194
  },
192
- web: {}
195
+ web: {
196
+ overflow: 'hidden'
197
+ }
193
198
  })
194
199
  },
195
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
200
+ children: _Platform.default.OS === 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
201
+ style: selectContainerStyles(themeTokens),
202
+ accessibilityLabel: subPanelAccessibilityLabel,
203
+ children: children
204
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, {
205
+ onContentSizeChange: (_, height) => {
206
+ setContainerHeight(height);
207
+ },
196
208
  style: selectContainerStyles(themeTokens),
197
209
  accessibilityLabel: subPanelAccessibilityLabel,
198
210
  children: children
@@ -202,6 +214,16 @@ const ExpandCollapsePanel = /*#__PURE__*/_react.default.forwardRef((_ref5, ref)
202
214
  });
203
215
  });
204
216
  ExpandCollapsePanel.displayName = 'ExpandCollapsePanel';
217
+ const staticStyles = _StyleSheet.default.create({
218
+ container: {
219
+ flex: 1,
220
+ justifyContent: 'flex-start'
221
+ },
222
+ panelContainer: {
223
+ flexGrow: 1,
224
+ alignSelf: 'stretch'
225
+ }
226
+ });
205
227
  ExpandCollapsePanel.propTypes = {
206
228
  ...selectedSystemPropTypes,
207
229
  variant: _utils.variantProp.propType,
@@ -7,6 +7,7 @@ exports.iconComponentPropTypes = exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _Platform = _interopRequireDefault(require("react-native-web/dist/cjs/exports/Platform"));
9
9
  var _View = _interopRequireDefault(require("react-native-web/dist/cjs/exports/View"));
10
+ var _useWindowDimensions = _interopRequireDefault(require("react-native-web/dist/cjs/exports/useWindowDimensions"));
10
11
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
12
  var _ThemeProvider = require("../ThemeProvider");
12
13
  var _utils = require("../utils");
@@ -23,7 +24,10 @@ const Icon = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
23
24
  dataSet
24
25
  } = _ref;
25
26
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Icon', tokens, variant);
26
- const size = scalesWithText ? (0, _utils.scaleWithText)(themeTokens.size) : themeTokens.size;
27
+ const {
28
+ fontScale
29
+ } = (0, _useWindowDimensions.default)();
30
+ const size = scalesWithText ? themeTokens.size * fontScale : themeTokens.size;
27
31
  const iconContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
28
32
  title: accessibilityLabel,
29
33
  size: size,
@@ -103,7 +103,7 @@ const selectIconTokens = _ref5 => {
103
103
  * The base equation is: X/4 + Y/4 - 4 - |X - Y| = Z
104
104
  * where X = blockFontSize, Y = iconSize and Z = translateY
105
105
  */
106
- const translateY = iconTranslateY ?? blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize);
106
+ const translateY = iconTranslateY && iconTranslateY !== 0 ? iconTranslateY : blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize);
107
107
  return {
108
108
  color,
109
109
  translateX: iconTranslateX,
@@ -230,12 +230,10 @@ const Modal = /*#__PURE__*/_react.default.forwardRef((_ref5, ref) => {
230
230
  confirmButtonVariant: confirmButtonVariant,
231
231
  cancelButtonText: cancelButtonText,
232
232
  cancelButtonType: cancelButtonType,
233
- children: _Platform.default !== 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, {
233
+ children: _Platform.default.OS !== 'web' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ScrollView.default, {
234
234
  style: selectScrollViewStyles,
235
235
  children: children
236
- }) : {
237
- children
238
- }
236
+ }) : children
239
237
  })]
240
238
  })
241
239
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TouchableWithoutFeedback.default, {
@@ -112,6 +112,7 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
112
112
  headerFontColor,
113
113
  headerFontSize,
114
114
  buttonDirection,
115
+ buttonIconBackgroundColor,
115
116
  headerFontWeight,
116
117
  headerLineHeight,
117
118
  subHeaderFontWeight,
@@ -155,7 +156,8 @@ const MultiSelectFilter = /*#__PURE__*/_react.default.forwardRef((_ref3, ref) =>
155
156
  paddingTop: labelPaddingTop,
156
157
  paddingBottom: labelPaddingBottom,
157
158
  paddingLeft: labelPaddingLeft,
158
- paddingRight: labelPaddingRight
159
+ paddingRight: labelPaddingRight,
160
+ iconBackground: buttonIconBackgroundColor
159
161
  };
160
162
  const getButtonDropdownTokens = (0, _ThemeProvider.useThemeTokensCallback)('ButtonDropdown', dropdownTokens, variant);
161
163
  const getButtonTokens = buttonState => (0, _utils.selectTokens)('ButtonDropdown', getButtonDropdownTokens(buttonState));
@@ -188,7 +188,6 @@ const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible, view
188
188
  },
189
189
  contentContainerStyles: {
190
190
  contentContainer: {
191
- flex: 1,
192
191
  flexDirection: 'row',
193
192
  flexShrink: 1,
194
193
  justifyContent: 'space-between',
@@ -68,7 +68,9 @@ const selectContainerStyles = _ref3 => {
68
68
  borderWidth = 0,
69
69
  borderRadius,
70
70
  paddingHorizontal = 0,
71
- paddingVertical = 0
71
+ paddingVertical = 0,
72
+ marginHorizontal = 0,
73
+ marginVertical = 0
72
74
  } = _ref3;
73
75
  return {
74
76
  backgroundColor,
@@ -76,7 +78,9 @@ const selectContainerStyles = _ref3 => {
76
78
  borderWidth,
77
79
  borderRadius,
78
80
  paddingHorizontal: paddingHorizontal - borderWidth,
79
- paddingVertical: paddingVertical - borderWidth
81
+ paddingVertical: paddingVertical - borderWidth,
82
+ marginHorizontal,
83
+ marginVertical
80
84
  };
81
85
  };
82
86
 
@@ -370,32 +370,6 @@ const TextInputBase = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
370
370
  ...themeTokens,
371
371
  height
372
372
  }, themeOptions, inactive, type, buttons?.length, themeTokens.buttonSize, buttonsGapSize, isPassword, iconLeftWidth, iconLeftGap, direction);
373
- const {
374
- minHeight = 0,
375
- maxHeight = Infinity
376
- } = nativeInputStyle;
377
- const [inputHeight, setInputHeight] = _react.default.useState(minHeight || 0);
378
-
379
- /* get the new height between the limits and update
380
- the state with the new height */
381
- const measureHeightWeb = _react.default.useCallback(() => {
382
- const el = inputRef.current;
383
- const scrollHeight = el.scrollHeight || 0;
384
- let newHeight = Math.max(scrollHeight, minHeight);
385
- newHeight = Math.min(newHeight, maxHeight);
386
- setInputHeight(newHeight);
387
- }, [inputRef, minHeight, maxHeight]);
388
-
389
- /* restores the height and the value first to then
390
- calculate the height correctly */
391
- _react.default.useEffect(() => {
392
- if (_Platform.default.OS === 'web' && inputRef.current) {
393
- const el = inputRef.current;
394
- el.style.height = 'auto';
395
- el.value = currentValue;
396
- measureHeightWeb();
397
- }
398
- }, [currentValue, measureHeightWeb, inputRef]);
399
373
  const shouldShowSubmitIcon = submitIcon && direction === 'left' && !inactive;
400
374
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
401
375
  style: selectOuterBorderStyles(themeTokens),
@@ -415,10 +389,7 @@ const TextInputBase = /*#__PURE__*/_react.default.forwardRef((_ref8, ref) => {
415
389
  ref: inputRef,
416
390
  keyboardType: isNumeric ? 'numeric' : 'default',
417
391
  inputMode: isNumeric ? 'numeric' : undefined,
418
- style: {
419
- ...nativeInputStyle,
420
- height: Math.max(inputHeight, minHeight)
421
- },
392
+ style: nativeInputStyle,
422
393
  secureTextEntry: isPassword && !showPassword,
423
394
  ...inputProps
424
395
  }), IconComponent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
@@ -34,12 +34,7 @@ const staticStyles = StyleSheet.create({
34
34
  alignItems: 'center',
35
35
  position: 'relative',
36
36
  top: 0,
37
- left: 0,
38
- ...Platform.select({
39
- web: {
40
- outline: 'none'
41
- }
42
- })
37
+ left: 0
43
38
  },
44
39
  animationControlButton: {
45
40
  position: 'absolute',
@@ -745,7 +740,11 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
745
740
  refocus: refocus,
746
741
  width: containerLayout.width,
747
742
  children: [/*#__PURE__*/_jsxs(View, {
748
- style: [staticStyles.root],
743
+ style: [staticStyles.root, {
744
+ ...(Platform.OS === 'web' ? {
745
+ outline: 'none'
746
+ } : {})
747
+ }],
749
748
  onLayout: onContainerLayout,
750
749
  ref: ref,
751
750
  ...systemProps,
@@ -3,6 +3,8 @@ import Animated from "react-native-web/dist/exports/Animated";
3
3
  import Platform from "react-native-web/dist/exports/Platform";
4
4
  import View from "react-native-web/dist/exports/View";
5
5
  import Text from "react-native-web/dist/exports/Text";
6
+ import StyleSheet from "react-native-web/dist/exports/StyleSheet";
7
+ import ScrollView from "react-native-web/dist/exports/ScrollView";
6
8
  import PropTypes from 'prop-types';
7
9
  import ABBPropTypes from 'airbnb-prop-types';
8
10
  import ExpandCollapseControl from './Control';
@@ -120,7 +122,7 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
120
122
  expanded: isExpanded
121
123
  });
122
124
  const handleControlPress = event => {
123
- onToggle(panelId, event);
125
+ onToggle?.(panelId, event);
124
126
  if (onPress) onPress(panelId, event);
125
127
  };
126
128
  const onContainerLayout = event => {
@@ -142,7 +144,7 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
142
144
  const panelAccessibilityLabel = `${panelId} ${getCopy('panel')}`;
143
145
  const subPanelAccessibilityLabel = `${panelId} ${getCopy('subPanel')}`;
144
146
  return content ? /*#__PURE__*/_jsx(View, {
145
- style: selectContentPanelStyles(themeTokens),
147
+ style: [selectContentPanelStyles(themeTokens), staticStyles.panelContainer],
146
148
  accessibilityLabel: panelAccessibilityLabel,
147
149
  children: typeof children === 'string' ? /*#__PURE__*/_jsx(Text, {
148
150
  style: selectTextStyles(themeTokens),
@@ -151,7 +153,7 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
151
153
  }) : children
152
154
  }) : /*#__PURE__*/_jsxs(View, {
153
155
  ref: ref,
154
- style: themeTokens,
156
+ style: [themeTokens, staticStyles.container],
155
157
  accessibilityLabel: panelAccessibilityLabel,
156
158
  children: [/*#__PURE__*/_jsx(View, {
157
159
  style: selectControlPanelStyles(themeTokens),
@@ -171,7 +173,7 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
171
173
  marginLeft: themeTokens.contentPaddingLeft,
172
174
  marginRight: themeTokens.contentPaddingRight
173
175
  }
174
- }), /*#__PURE__*/_jsx(Animated.View, {
176
+ }), /*#__PURE__*/_jsx(Animated.ScrollView, {
175
177
  ref: animatedRef,
176
178
  style: animatedStyles,
177
179
  ...focusabilityProps,
@@ -180,12 +182,22 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
180
182
  style: {
181
183
  ...Platform.select({
182
184
  default: {
183
- flex: 1
185
+ flex: 1,
186
+ overflow: 'hidden'
184
187
  },
185
- web: {}
188
+ web: {
189
+ overflow: 'hidden'
190
+ }
186
191
  })
187
192
  },
188
- children: /*#__PURE__*/_jsx(View, {
193
+ children: Platform.OS === 'web' ? /*#__PURE__*/_jsx(View, {
194
+ style: selectContainerStyles(themeTokens),
195
+ accessibilityLabel: subPanelAccessibilityLabel,
196
+ children: children
197
+ }) : /*#__PURE__*/_jsx(ScrollView, {
198
+ onContentSizeChange: (_, height) => {
199
+ setContainerHeight(height);
200
+ },
189
201
  style: selectContainerStyles(themeTokens),
190
202
  accessibilityLabel: subPanelAccessibilityLabel,
191
203
  children: children
@@ -195,6 +207,16 @@ const ExpandCollapsePanel = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
195
207
  });
196
208
  });
197
209
  ExpandCollapsePanel.displayName = 'ExpandCollapsePanel';
210
+ const staticStyles = StyleSheet.create({
211
+ container: {
212
+ flex: 1,
213
+ justifyContent: 'flex-start'
214
+ },
215
+ panelContainer: {
216
+ flexGrow: 1,
217
+ alignSelf: 'stretch'
218
+ }
219
+ });
198
220
  ExpandCollapsePanel.propTypes = {
199
221
  ...selectedSystemPropTypes,
200
222
  variant: variantProp.propType,
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import Platform from "react-native-web/dist/exports/Platform";
3
3
  import View from "react-native-web/dist/exports/View";
4
+ import useWindowDimensions from "react-native-web/dist/exports/useWindowDimensions";
4
5
  import PropTypes from 'prop-types';
5
6
  import { useThemeTokens } from '../ThemeProvider';
6
- import { getTokensPropType, scaleWithText, variantProp } from '../utils';
7
+ import { getTokensPropType, variantProp } from '../utils';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
9
10
  let {
@@ -16,7 +17,10 @@ const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
16
17
  dataSet
17
18
  } = _ref;
18
19
  const themeTokens = useThemeTokens('Icon', tokens, variant);
19
- const size = scalesWithText ? scaleWithText(themeTokens.size) : themeTokens.size;
20
+ const {
21
+ fontScale
22
+ } = useWindowDimensions();
23
+ const size = scalesWithText ? themeTokens.size * fontScale : themeTokens.size;
20
24
  const iconContent = /*#__PURE__*/_jsx(IconComponent, {
21
25
  title: accessibilityLabel,
22
26
  size: size,
@@ -96,7 +96,7 @@ const selectIconTokens = _ref5 => {
96
96
  * The base equation is: X/4 + Y/4 - 4 - |X - Y| = Z
97
97
  * where X = blockFontSize, Y = iconSize and Z = translateY
98
98
  */
99
- const translateY = iconTranslateY ?? blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize);
99
+ const translateY = iconTranslateY && iconTranslateY !== 0 ? iconTranslateY : blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize);
100
100
  return {
101
101
  color,
102
102
  translateX: iconTranslateX,
@@ -223,12 +223,10 @@ const Modal = /*#__PURE__*/React.forwardRef((_ref5, ref) => {
223
223
  confirmButtonVariant: confirmButtonVariant,
224
224
  cancelButtonText: cancelButtonText,
225
225
  cancelButtonType: cancelButtonType,
226
- children: Platform !== 'web' ? /*#__PURE__*/_jsx(ScrollView, {
226
+ children: Platform.OS !== 'web' ? /*#__PURE__*/_jsx(ScrollView, {
227
227
  style: selectScrollViewStyles,
228
228
  children: children
229
- }) : {
230
- children
231
- }
229
+ }) : children
232
230
  })]
233
231
  })
234
232
  }), /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
@@ -105,6 +105,7 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
105
105
  headerFontColor,
106
106
  headerFontSize,
107
107
  buttonDirection,
108
+ buttonIconBackgroundColor,
108
109
  headerFontWeight,
109
110
  headerLineHeight,
110
111
  subHeaderFontWeight,
@@ -148,7 +149,8 @@ const MultiSelectFilter = /*#__PURE__*/React.forwardRef((_ref3, ref) => {
148
149
  paddingTop: labelPaddingTop,
149
150
  paddingBottom: labelPaddingBottom,
150
151
  paddingLeft: labelPaddingLeft,
151
- paddingRight: labelPaddingRight
152
+ paddingRight: labelPaddingRight,
153
+ iconBackground: buttonIconBackgroundColor
152
154
  };
153
155
  const getButtonDropdownTokens = useThemeTokensCallback('ButtonDropdown', dropdownTokens, variant);
154
156
  const getButtonTokens = buttonState => selectTokens('ButtonDropdown', getButtonDropdownTokens(buttonState));
@@ -181,7 +181,6 @@ const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible, view
181
181
  },
182
182
  contentContainerStyles: {
183
183
  contentContainer: {
184
- flex: 1,
185
184
  flexDirection: 'row',
186
185
  flexShrink: 1,
187
186
  justifyContent: 'space-between',
@@ -61,7 +61,9 @@ const selectContainerStyles = _ref3 => {
61
61
  borderWidth = 0,
62
62
  borderRadius,
63
63
  paddingHorizontal = 0,
64
- paddingVertical = 0
64
+ paddingVertical = 0,
65
+ marginHorizontal = 0,
66
+ marginVertical = 0
65
67
  } = _ref3;
66
68
  return {
67
69
  backgroundColor,
@@ -69,7 +71,9 @@ const selectContainerStyles = _ref3 => {
69
71
  borderWidth,
70
72
  borderRadius,
71
73
  paddingHorizontal: paddingHorizontal - borderWidth,
72
- paddingVertical: paddingVertical - borderWidth
74
+ paddingVertical: paddingVertical - borderWidth,
75
+ marginHorizontal,
76
+ marginVertical
73
77
  };
74
78
  };
75
79
 
@@ -363,32 +363,6 @@ const TextInputBase = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
363
363
  ...themeTokens,
364
364
  height
365
365
  }, themeOptions, inactive, type, buttons?.length, themeTokens.buttonSize, buttonsGapSize, isPassword, iconLeftWidth, iconLeftGap, direction);
366
- const {
367
- minHeight = 0,
368
- maxHeight = Infinity
369
- } = nativeInputStyle;
370
- const [inputHeight, setInputHeight] = React.useState(minHeight || 0);
371
-
372
- /* get the new height between the limits and update
373
- the state with the new height */
374
- const measureHeightWeb = React.useCallback(() => {
375
- const el = inputRef.current;
376
- const scrollHeight = el.scrollHeight || 0;
377
- let newHeight = Math.max(scrollHeight, minHeight);
378
- newHeight = Math.min(newHeight, maxHeight);
379
- setInputHeight(newHeight);
380
- }, [inputRef, minHeight, maxHeight]);
381
-
382
- /* restores the height and the value first to then
383
- calculate the height correctly */
384
- React.useEffect(() => {
385
- if (Platform.OS === 'web' && inputRef.current) {
386
- const el = inputRef.current;
387
- el.style.height = 'auto';
388
- el.value = currentValue;
389
- measureHeightWeb();
390
- }
391
- }, [currentValue, measureHeightWeb, inputRef]);
392
366
  const shouldShowSubmitIcon = submitIcon && direction === 'left' && !inactive;
393
367
  return /*#__PURE__*/_jsxs(View, {
394
368
  style: selectOuterBorderStyles(themeTokens),
@@ -408,10 +382,7 @@ const TextInputBase = /*#__PURE__*/React.forwardRef((_ref8, ref) => {
408
382
  ref: inputRef,
409
383
  keyboardType: isNumeric ? 'numeric' : 'default',
410
384
  inputMode: isNumeric ? 'numeric' : undefined,
411
- style: {
412
- ...nativeInputStyle,
413
- height: Math.max(inputHeight, minHeight)
414
- },
385
+ style: nativeInputStyle,
415
386
  secureTextEntry: isPassword && !showPassword,
416
387
  ...inputProps
417
388
  }), IconComponent && /*#__PURE__*/_jsx(View, {
package/lib/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@react-native-picker/picker": "^2.9.0",
14
14
  "@telus-uds/system-constants": "^3.0.0",
15
- "@telus-uds/system-theme-tokens": "^4.0.0",
15
+ "@telus-uds/system-theme-tokens": "^4.1.0",
16
16
  "airbnb-prop-types": "^2.16.0",
17
17
  "css-mediaquery": "^0.1.2",
18
18
  "expo-document-picker": "^13.0.1",
@@ -83,6 +83,6 @@
83
83
  "standard-engine": {
84
84
  "skip": true
85
85
  },
86
- "version": "3.0.0",
86
+ "version": "3.1.0",
87
87
  "types": "types/index.d.ts"
88
88
  }
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@react-native-picker/picker": "^2.9.0",
14
14
  "@telus-uds/system-constants": "^3.0.0",
15
- "@telus-uds/system-theme-tokens": "^4.0.0",
15
+ "@telus-uds/system-theme-tokens": "^4.1.0",
16
16
  "airbnb-prop-types": "^2.16.0",
17
17
  "css-mediaquery": "^0.1.2",
18
18
  "expo-document-picker": "^13.0.1",
@@ -83,6 +83,6 @@
83
83
  "standard-engine": {
84
84
  "skip": true
85
85
  },
86
- "version": "3.0.0",
86
+ "version": "3.1.0",
87
87
  "types": "types/index.d.ts"
88
88
  }
@@ -47,12 +47,7 @@ const staticStyles = StyleSheet.create({
47
47
  alignItems: 'center',
48
48
  position: 'relative',
49
49
  top: 0,
50
- left: 0,
51
- ...Platform.select({
52
- web: {
53
- outline: 'none'
54
- }
55
- })
50
+ left: 0
56
51
  },
57
52
  animationControlButton: {
58
53
  position: 'absolute',
@@ -872,7 +867,12 @@ const Carousel = React.forwardRef(
872
867
  width={containerLayout.width}
873
868
  >
874
869
  <View
875
- style={[staticStyles.root]}
870
+ style={[
871
+ staticStyles.root,
872
+ {
873
+ ...(Platform.OS === 'web' ? { outline: 'none' } : {})
874
+ }
875
+ ]}
876
876
  onLayout={onContainerLayout}
877
877
  ref={ref}
878
878
  {...systemProps}
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { Animated, Platform, View, Text } from 'react-native'
2
+ import { Animated, Platform, View, Text, StyleSheet, ScrollView } from 'react-native'
3
3
  import PropTypes from 'prop-types'
4
4
  import ABBPropTypes from 'airbnb-prop-types'
5
5
 
@@ -117,7 +117,7 @@ const ExpandCollapsePanel = React.forwardRef(
117
117
  })
118
118
 
119
119
  const handleControlPress = (event) => {
120
- onToggle(panelId, event)
120
+ onToggle?.(panelId, event)
121
121
  if (onPress) onPress(panelId, event)
122
122
  }
123
123
 
@@ -141,7 +141,7 @@ const ExpandCollapsePanel = React.forwardRef(
141
141
 
142
142
  return content ? (
143
143
  <View
144
- style={selectContentPanelStyles(themeTokens)}
144
+ style={[selectContentPanelStyles(themeTokens), staticStyles.panelContainer]}
145
145
  accessibilityLabel={panelAccessibilityLabel}
146
146
  >
147
147
  {typeof children === 'string' ? (
@@ -156,7 +156,11 @@ const ExpandCollapsePanel = React.forwardRef(
156
156
  )}
157
157
  </View>
158
158
  ) : (
159
- <View ref={ref} style={themeTokens} accessibilityLabel={panelAccessibilityLabel}>
159
+ <View
160
+ ref={ref}
161
+ style={[themeTokens, staticStyles.container]}
162
+ accessibilityLabel={panelAccessibilityLabel}
163
+ >
160
164
  <View style={selectControlPanelStyles(themeTokens)}>
161
165
  <ExpandCollapseControl
162
166
  {...selectedProps}
@@ -179,32 +183,58 @@ const ExpandCollapsePanel = React.forwardRef(
179
183
  }}
180
184
  />
181
185
  )}
182
- <Animated.View ref={animatedRef} style={animatedStyles} {...focusabilityProps}>
186
+ <Animated.ScrollView ref={animatedRef} style={animatedStyles} {...focusabilityProps}>
183
187
  <View
184
188
  onLayout={onContainerLayout}
185
189
  style={{
186
190
  ...Platform.select({
187
191
  default: {
188
- flex: 1
192
+ flex: 1,
193
+ overflow: 'hidden'
189
194
  },
190
- web: {}
195
+ web: {
196
+ overflow: 'hidden'
197
+ }
191
198
  })
192
199
  }}
193
200
  >
194
- <View
195
- style={selectContainerStyles(themeTokens)}
196
- accessibilityLabel={subPanelAccessibilityLabel}
197
- >
198
- {children}
199
- </View>
201
+ {Platform.OS === 'web' ? (
202
+ <View
203
+ style={selectContainerStyles(themeTokens)}
204
+ accessibilityLabel={subPanelAccessibilityLabel}
205
+ >
206
+ {children}
207
+ </View>
208
+ ) : (
209
+ <ScrollView
210
+ onContentSizeChange={(_, height) => {
211
+ setContainerHeight(height)
212
+ }}
213
+ style={selectContainerStyles(themeTokens)}
214
+ accessibilityLabel={subPanelAccessibilityLabel}
215
+ >
216
+ {children}
217
+ </ScrollView>
218
+ )}
200
219
  </View>
201
- </Animated.View>
220
+ </Animated.ScrollView>
202
221
  </View>
203
222
  )
204
223
  }
205
224
  )
206
225
  ExpandCollapsePanel.displayName = 'ExpandCollapsePanel'
207
226
 
227
+ const staticStyles = StyleSheet.create({
228
+ container: {
229
+ flex: 1,
230
+ justifyContent: 'flex-start'
231
+ },
232
+ panelContainer: {
233
+ flexGrow: 1,
234
+ alignSelf: 'stretch'
235
+ }
236
+ })
237
+
208
238
  ExpandCollapsePanel.propTypes = {
209
239
  ...selectedSystemPropTypes,
210
240
  variant: variantProp.propType,
package/src/Icon/Icon.jsx CHANGED
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
- import { Platform, View } from 'react-native'
2
+ import { Platform, View, useWindowDimensions } from 'react-native'
3
3
  import PropTypes from 'prop-types'
4
4
 
5
5
  import { useThemeTokens } from '../ThemeProvider'
6
- import { getTokensPropType, scaleWithText, variantProp } from '../utils'
6
+ import { getTokensPropType, variantProp } from '../utils'
7
7
 
8
8
  const Icon = React.forwardRef(
9
9
  (
@@ -19,8 +19,9 @@ const Icon = React.forwardRef(
19
19
  ref
20
20
  ) => {
21
21
  const themeTokens = useThemeTokens('Icon', tokens, variant)
22
+ const { fontScale } = useWindowDimensions()
22
23
 
23
- const size = scalesWithText ? scaleWithText(themeTokens.size) : themeTokens.size
24
+ const size = scalesWithText ? themeTokens.size * fontScale : themeTokens.size
24
25
 
25
26
  const iconContent = (
26
27
  <IconComponent title={accessibilityLabel} size={size} color={themeTokens.color} />
@@ -89,7 +89,9 @@ const selectIconTokens = ({ color, iconSize, blockFontSize, iconTranslateX, icon
89
89
  * where X = blockFontSize, Y = iconSize and Z = translateY
90
90
  */
91
91
  const translateY =
92
- iconTranslateY ?? blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize)
92
+ iconTranslateY && iconTranslateY !== 0
93
+ ? iconTranslateY
94
+ : blockFontSize / 4 + iconSize / 4 - 4 - Math.abs(iconSize - blockFontSize)
93
95
  return {
94
96
  color,
95
97
  translateX: iconTranslateX,
@@ -241,10 +241,10 @@ const Modal = React.forwardRef(
241
241
  cancelButtonText={cancelButtonText}
242
242
  cancelButtonType={cancelButtonType}
243
243
  >
244
- {Platform !== 'web' ? (
244
+ {Platform.OS !== 'web' ? (
245
245
  <ScrollView style={selectScrollViewStyles}>{children}</ScrollView>
246
246
  ) : (
247
- { children }
247
+ children
248
248
  )}
249
249
  </ModalContent>
250
250
  </View>
@@ -109,6 +109,7 @@ const MultiSelectFilter = React.forwardRef(
109
109
  headerFontColor,
110
110
  headerFontSize,
111
111
  buttonDirection,
112
+ buttonIconBackgroundColor,
112
113
  headerFontWeight,
113
114
  headerLineHeight,
114
115
  subHeaderFontWeight,
@@ -151,7 +152,8 @@ const MultiSelectFilter = React.forwardRef(
151
152
  paddingTop: labelPaddingTop,
152
153
  paddingBottom: labelPaddingBottom,
153
154
  paddingLeft: labelPaddingLeft,
154
- paddingRight: labelPaddingRight
155
+ paddingRight: labelPaddingRight,
156
+ iconBackground: buttonIconBackgroundColor
155
157
  }
156
158
  const getButtonDropdownTokens = useThemeTokensCallback(
157
159
  'ButtonDropdown',
@@ -169,7 +169,6 @@ const getDefaultStyles = (themeTokens, themeOptions, maxWidth, dismissible, view
169
169
  },
170
170
  contentContainerStyles: {
171
171
  contentContainer: {
172
- flex: 1,
173
172
  flexDirection: 'row',
174
173
  flexShrink: 1,
175
174
  justifyContent: 'space-between',
@@ -60,14 +60,18 @@ const selectContainerStyles = ({
60
60
  borderWidth = 0,
61
61
  borderRadius,
62
62
  paddingHorizontal = 0,
63
- paddingVertical = 0
63
+ paddingVertical = 0,
64
+ marginHorizontal = 0,
65
+ marginVertical = 0
64
66
  }) => ({
65
67
  backgroundColor,
66
68
  borderColor,
67
69
  borderWidth,
68
70
  borderRadius,
69
71
  paddingHorizontal: paddingHorizontal - borderWidth,
70
- paddingVertical: paddingVertical - borderWidth
72
+ paddingVertical: paddingVertical - borderWidth,
73
+ marginHorizontal,
74
+ marginVertical
71
75
  })
72
76
 
73
77
  /**
@@ -361,32 +361,6 @@ const TextInputBase = React.forwardRef(
361
361
  direction
362
362
  )
363
363
 
364
- const { minHeight = 0, maxHeight = Infinity } = nativeInputStyle
365
- const [inputHeight, setInputHeight] = React.useState(minHeight || 0)
366
-
367
- /* get the new height between the limits and update
368
- the state with the new height */
369
- const measureHeightWeb = React.useCallback(() => {
370
- const el = inputRef.current
371
- const scrollHeight = el.scrollHeight || 0
372
-
373
- let newHeight = Math.max(scrollHeight, minHeight)
374
- newHeight = Math.min(newHeight, maxHeight)
375
-
376
- setInputHeight(newHeight)
377
- }, [inputRef, minHeight, maxHeight])
378
-
379
- /* restores the height and the value first to then
380
- calculate the height correctly */
381
- React.useEffect(() => {
382
- if (Platform.OS === 'web' && inputRef.current) {
383
- const el = inputRef.current
384
- el.style.height = 'auto'
385
- el.value = currentValue
386
- measureHeightWeb()
387
- }
388
- }, [currentValue, measureHeightWeb, inputRef])
389
-
390
364
  const shouldShowSubmitIcon = submitIcon && direction === 'left' && !inactive
391
365
 
392
366
  return (
@@ -413,10 +387,7 @@ const TextInputBase = React.forwardRef(
413
387
  ref={inputRef}
414
388
  keyboardType={isNumeric ? 'numeric' : 'default'}
415
389
  inputMode={isNumeric ? 'numeric' : undefined}
416
- style={{
417
- ...nativeInputStyle,
418
- height: Math.max(inputHeight, minHeight)
419
- }}
390
+ style={nativeInputStyle}
420
391
  secureTextEntry={isPassword && !showPassword}
421
392
  {...inputProps}
422
393
  />
@@ -0,0 +1,60 @@
1
+ type ListboxTokens = {
2
+ groupBorderRadius?: number | string
3
+ groupBorderWidth?: number | string
4
+ groupFontSize?: number
5
+ groupFontName?: string
6
+ groupFontWeight?: string
7
+ groupColor?: string
8
+ groupBorderColor?: string
9
+ groupBackgroundColor?: string
10
+ groupPaddingTop?: number
11
+ groupPaddingBottom?: number
12
+ groupPaddingLeft?: number
13
+ groupPaddingRight?: number
14
+ groupIcon?: string
15
+ itemDisplay?: boolean
16
+ itemFontName?: string
17
+ itemFontWeight?: string
18
+ itemFontSize?: number
19
+ itemPaddingTop?: number
20
+ itemPaddingBottom?: number
21
+ itemPaddingLeft?: number
22
+ itemPaddingRight?: number
23
+ itemColor?: string
24
+ itemBackgroundColor?: string
25
+ itemBorderLeftColor?: string
26
+ itemBorderLeftWidth?: number | string
27
+ itemBorderWidth?: number | string
28
+ itemTextDecoration?: string
29
+ itemOutline?: number | string
30
+ shadow?: string
31
+ itemBorderRightColor?: string
32
+ itemBorderBottomColor?: string
33
+ itemBorderTopColor?: string
34
+ itemBorderRightWidth?: number | string
35
+ itemBorderBottomWidth?: number | string
36
+ itemBorderTopWidth?: number | string
37
+ itemBorderRadius?: number | string
38
+ minWidth?: number
39
+ minHeight?: number
40
+ itemHeight?: number
41
+ groupHeight?: number
42
+ lineHeight?: number
43
+ }
44
+
45
+ type ListboxItems = {
46
+ label: string
47
+ href: string
48
+ tokens?: ListboxTokens
49
+ }
50
+
51
+ export interface ListboxProps {
52
+ items: ListboxItems[]
53
+ firstItemRef?: object
54
+ parentRef?: object
55
+ LinkRouter?: React.ElementType
56
+ linkRouterProps?: object
57
+ tokens?: ListboxTokens
58
+ selectedId?: string
59
+ onClose?: () => void
60
+ }
package/types/index.d.ts CHANGED
@@ -75,4 +75,7 @@ export { TypographyProps, TypographyVariants, TypographyTokens } from './Typogra
75
75
  export { default as Portal } from './Portal'
76
76
  export { PortalProps } from './Portal'
77
77
 
78
+ export { default as Listbox } from './Listbox'
79
+ export { ListboxProps, ListboxTokens } from './Listbox'
80
+
78
81
  export * from './Common'