@telus-uds/components-base 1.45.0 → 1.47.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,38 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Sat, 27 May 2023 00:37:34 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 02 Jun 2023 00:27:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.47.0
8
+
9
+ Fri, 02 Jun 2023 00:27:36 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Override Search tokens with inactive variant if inactive is true (wlsdud194@hotmail.com)
14
+ - New variants added for the typography component (35577399+JoshHC@users.noreply.github.com)
15
+ - ExpandCollapse theme changes (akshay.pandey1@telus.com)
16
+ - `Box`: Introduce new `border` related tokens (shahzaibkhalidmalik@outlook.com)
17
+ - Bump @telus-uds/system-theme-tokens to v2.29.0
18
+
19
+ ### Patches
20
+
21
+ - Remove unnecessary ChevronLink changes ("textLineHeight") (kyle.king2@telus.com)
22
+
23
+ ## 1.46.0
24
+
25
+ Tue, 30 May 2023 02:46:46 GMT
26
+
27
+ ### Minor changes
28
+
29
+ - Standardized RadioCardGroup (wlsdud194@hotmail.com)
30
+ - Button outer width is no longer set to 0 if token width = 0 (wlsdud194@hotmail.com)
31
+ - fix:list overflowing (samuraix221@hotmail.com)
32
+
7
33
  ## 1.45.0
8
34
 
9
- Sat, 27 May 2023 00:37:34 GMT
35
+ Sat, 27 May 2023 00:44:50 GMT
10
36
 
11
37
  ### Minor changes
12
38
 
@@ -290,7 +290,13 @@
290
290
  },
291
291
  "Box": {
292
292
  "backgroundColor": "color",
293
- "gradient": "gradient"
293
+ "gradient": "gradient",
294
+ "borderWidth": "border",
295
+ "borderColor": "color",
296
+ "borderTopLeftRadius": "radius",
297
+ "borderTopRightRadius": "radius",
298
+ "borderBottomLeftRadius": "radius",
299
+ "borderBottomRightRadius": "radius"
294
300
  },
295
301
  "Button": {
296
302
  "borderColor": "color",
@@ -499,7 +505,6 @@
499
505
  },
500
506
  "ChevronLink": {
501
507
  "fontSize": "fontSize",
502
- "textLineHeight": "lineHeight",
503
508
  "color": "color",
504
509
  "outerBorderColor": "color",
505
510
  "leftIcon": "icon",
@@ -594,7 +599,21 @@
594
599
  },
595
600
  "ExpandCollapseMiniControl": {
596
601
  "size": "size",
597
- "icon": "icon"
602
+ "icon": "icon",
603
+ "iconColor": "color",
604
+ "iconSize": "size",
605
+ "iconGap": "size",
606
+ "iconPaddingTop": "size",
607
+ "iconPosition": "position",
608
+ "verticalAlign": "verticalAlign",
609
+ "justifyContent": "flexJustifyContent",
610
+ "paddingLeft": "size",
611
+ "paddingRight": "size",
612
+ "paddingTop": "size",
613
+ "paddingBottom": "size",
614
+ "borderWidth": "border",
615
+ "borderColor": "color",
616
+ "backgroundColor": "color"
598
617
  },
599
618
  "ExpandCollapsePanel": {
600
619
  "expandDuration": "duration",
@@ -608,7 +627,21 @@
608
627
  "borderRadius": "radius",
609
628
  "borderWidth": "border",
610
629
  "expandDividerColor": "color",
611
- "expanddDividerWidth": "size"
630
+ "expandDividerWidth": "size"
631
+ },
632
+ "ExpandCollapseMiniPanel": {
633
+ "expandDuration": "duration",
634
+ "collapseDuration": "duration",
635
+ "contentPaddingLeft": "size",
636
+ "contentPaddingRight": "size",
637
+ "contentPaddingTop": "size",
638
+ "contentPaddingBottom": "size",
639
+ "marginBottom": "size",
640
+ "borderColor": "color",
641
+ "borderRadius": "radius",
642
+ "borderWidth": "border",
643
+ "expandDividerColor": "color",
644
+ "expandDividerWidth": "size"
612
645
  },
613
646
  "Feedback": {
614
647
  "backgroundColor": "color",
@@ -3327,6 +3360,13 @@
3327
3360
  "required": false,
3328
3361
  "description": "Array of the ids of currently open groups"
3329
3362
  },
3363
+ "isMiniExpandCollapse": {
3364
+ "defaultValue": {
3365
+ "value": "false",
3366
+ "computed": false
3367
+ },
3368
+ "required": false
3369
+ },
3330
3370
  "variant": {
3331
3371
  "type": {
3332
3372
  "name": "objectOf",
@@ -3363,7 +3403,7 @@
3363
3403
  "borderRadius": "radius",
3364
3404
  "borderWidth": "border",
3365
3405
  "expandDividerColor": "color",
3366
- "expanddDividerWidth": "size"
3406
+ "expandDividerWidth": "size"
3367
3407
  }
3368
3408
  },
3369
3409
  "required": false,
@@ -3711,7 +3751,13 @@
3711
3751
  "name": "custom",
3712
3752
  "raw": {
3713
3753
  "backgroundColor": "color",
3714
- "gradient": "gradient"
3754
+ "gradient": "gradient",
3755
+ "borderWidth": "border",
3756
+ "borderColor": "color",
3757
+ "borderTopLeftRadius": "radius",
3758
+ "borderTopRightRadius": "radius",
3759
+ "borderBottomLeftRadius": "radius",
3760
+ "borderBottomRightRadius": "radius"
3715
3761
  }
3716
3762
  },
3717
3763
  "required": false,
@@ -4259,6 +4305,13 @@
4259
4305
  "required": false,
4260
4306
  "description": "Array of the ids of currently open groups"
4261
4307
  },
4308
+ "isMiniExpandCollapse": {
4309
+ "defaultValue": {
4310
+ "value": "false",
4311
+ "computed": false
4312
+ },
4313
+ "required": false
4314
+ },
4262
4315
  "variant": {
4263
4316
  "type": {
4264
4317
  "name": "objectOf",
@@ -4295,7 +4348,7 @@
4295
4348
  "borderRadius": "radius",
4296
4349
  "borderWidth": "border",
4297
4350
  "expandDividerColor": "color",
4298
- "expanddDividerWidth": "size"
4351
+ "expandDividerWidth": "size"
4299
4352
  }
4300
4353
  },
4301
4354
  "required": false,
@@ -13183,7 +13236,6 @@
13183
13236
  "name": "custom",
13184
13237
  "raw": {
13185
13238
  "fontSize": "fontSize",
13186
- "textLineHeight": "lineHeight",
13187
13239
  "color": "color",
13188
13240
  "outerBorderColor": "color",
13189
13241
  "leftIcon": "icon",
package/lib/Box/Box.js CHANGED
@@ -33,28 +33,41 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
33
33
  * @typedef {import('../utils/props/spacingProps.js').SpacingOptions} SpacingOptions
34
34
  */
35
35
 
36
- const selectBoxStyles = tokens => {
37
- let styles = {
38
- backgroundColor: tokens.backgroundColor
36
+ const selectBoxStyles = _ref => {
37
+ let {
38
+ backgroundColor,
39
+ gradient,
40
+ borderWidth,
41
+ borderColor,
42
+ borderTopLeftRadius,
43
+ borderTopRightRadius,
44
+ borderBottomLeftRadius,
45
+ borderBottomRightRadius,
46
+ ...rest
47
+ } = _ref;
48
+ const styles = {
49
+ backgroundColor,
50
+ borderWidth,
51
+ borderColor,
52
+ borderTopLeftRadius,
53
+ borderTopRightRadius,
54
+ borderBottomLeftRadius,
55
+ borderBottomRightRadius
39
56
  };
40
57
 
41
- if (tokens.gradient) {
58
+ if (gradient) {
42
59
  const {
43
- gradient: {
44
- angle,
45
- stops: [stopOne, stopTwo]
46
- }
47
- } = tokens;
48
- styles = { ...styles,
49
- backgroundImage: `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`
50
- };
60
+ angle,
61
+ stops: [stopOne, stopTwo]
62
+ } = gradient;
63
+ styles.backgroundImage = `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`;
51
64
  }
52
65
 
53
66
  const paddings = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom']; // Only set on styles if token provided because we spread this object after the spacing scale values
54
67
 
55
68
  paddings.forEach(side => {
56
- if (tokens[side]) {
57
- styles[side] = tokens[side];
69
+ if (rest[side]) {
70
+ styles[side] = rest[side];
58
71
  }
59
72
  });
60
73
  return styles;
@@ -126,7 +139,7 @@ const selectBoxStyles = tokens => {
126
139
  */
127
140
 
128
141
 
129
- const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
142
+ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
130
143
  let {
131
144
  space,
132
145
  horizontal = space,
@@ -145,7 +158,7 @@ const Box = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
145
158
  testID,
146
159
  dataSet,
147
160
  ...rest
148
- } = _ref;
161
+ } = _ref2;
149
162
  const props = {
150
163
  accessibilityRole,
151
164
  ...(0, _utils.getA11yPropsFromHtmlTag)(tag, accessibilityRole),
@@ -81,7 +81,7 @@ const selectOuterSizeStyles = _ref3 => {
81
81
  });
82
82
  const sizeStyles = {}; // Apply width/height tokens: number === pixels, string === explicit units e.g. %
83
83
 
84
- if (typeof width === 'number' || typeof height === 'number') {
84
+ if (typeof width === 'number' && width > 0 || typeof height === 'number' && height > 0) {
85
85
  sizeStyles.width = width ? width + outerBorderOffset * 2 : width;
86
86
  sizeStyles.height = height ? height + outerBorderOffset * 2 : height;
87
87
  return sizeStyles;
@@ -84,9 +84,10 @@ const ExpandCollapseControl = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) =
84
84
  tokens,
85
85
  accessibilityRole = 'button',
86
86
  variant,
87
+ isMiniExpandCollapse = false,
87
88
  ...rest
88
89
  } = _ref3;
89
- const getTokens = (0, _ThemeProvider.useThemeTokensCallback)('ExpandCollapseControl', tokens, variant);
90
+ const getTokens = (0, _ThemeProvider.useThemeTokensCallback)(isMiniExpandCollapse ? 'ExpandCollapseMiniControl' : 'ExpandCollapseControl', tokens, variant);
90
91
  const selectedProps = selectProps({
91
92
  accessibilityRole,
92
93
  ...rest,
@@ -70,6 +70,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
70
70
  children,
71
71
  tokens,
72
72
  variant,
73
+ isMiniExpandCollapse = false,
73
74
  controlRef,
74
75
  ...rest
75
76
  } = _ref2;
@@ -80,7 +81,7 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
80
81
  expanded: isExpanded
81
82
  }
82
83
  });
83
- const themeTokens = (0, _ThemeProvider.useThemeTokens)('ExpandCollapsePanel', tokens, variant, {
84
+ const themeTokens = (0, _ThemeProvider.useThemeTokens)(isMiniExpandCollapse ? 'ExpandCollapseMiniPanel' : 'ExpandCollapsePanel', tokens, variant, {
84
85
  expanded: isExpanded
85
86
  });
86
87
 
@@ -116,11 +117,12 @@ const ExpandCollapsePanel = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) =>
116
117
  variant: variant,
117
118
  onPress: handleControlPress,
118
119
  ref: controlRef,
120
+ isMiniExpandCollapse: isMiniExpandCollapse,
119
121
  children: control
120
122
  }), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
121
123
  style: {
122
124
  borderTopColor: themeTokens.expandDividerColor,
123
- borderTopWidth: themeTokens.expanddDividerWidth,
125
+ borderTopWidth: themeTokens.expandDividerWidth,
124
126
  marginLeft: themeTokens.contentPaddingLeft,
125
127
  marginRight: themeTokens.contentPaddingRight
126
128
  }
@@ -46,7 +46,6 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
46
46
  rightIcon,
47
47
  iconDisplace,
48
48
  height,
49
- textLineHeight,
50
49
  fontSize,
51
50
  ...otherTokens
52
51
  } = getChevronTokens(linkState);
@@ -54,7 +53,6 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
54
53
  return { ...linkTokens,
55
54
  height,
56
55
  blockFontSize: tokens.fontSize ?? fontSize,
57
- textLineHeight,
58
56
  icon: direction === 'right' ? rightIcon : leftIcon,
59
57
  iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
60
58
  };
@@ -63,13 +63,11 @@ const selectOuterBorderStyles = _ref => {
63
63
  const selectTextStyles = _ref2 => {
64
64
  let {
65
65
  color,
66
- textLineHeight,
67
66
  blockFontSize
68
67
  } = _ref2;
69
68
  return {
70
69
  color,
71
70
  ...(0, _ThemeProvider.applyTextStyles)({
72
- lineHeight: textLineHeight,
73
71
  blockFontSize
74
72
  }),
75
73
  ..._Platform.default.select({
package/lib/List/List.js CHANGED
@@ -68,6 +68,10 @@ const List = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
68
68
 
69
69
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
70
70
  ref: ref,
71
+ style: {
72
+ flexShrink: 1,
73
+ flex: 1
74
+ },
71
75
  accessibilityRole: accessibilityRole,
72
76
  ...selectProps(rest),
73
77
  children: items
@@ -108,7 +108,10 @@ const Search = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
108
108
  initialValue,
109
109
  onChange
110
110
  });
111
- const themeTokens = (0, _ThemeProvider.useThemeTokens)('Search', tokens, variant);
111
+ const themeTokens = (0, _ThemeProvider.useThemeTokens)('Search', tokens, {
112
+ inactive,
113
+ ...variant
114
+ });
112
115
  const buttonTokens = (0, _ThemeProvider.useThemeTokens)('SearchButton', tokens, variant);
113
116
  const getThemeTokens = (0, _ThemeProvider.useThemeTokensCallback)('Search', tokens, variant);
114
117
  const getButtonTokens = (0, _ThemeProvider.useThemeTokensCallback)('SearchButton', tokens, variant); // TODO: support overriding the a11y props using a custom dictionary
@@ -13,28 +13,41 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
13
13
  * @typedef {import('../utils/props/spacingProps.js').SpacingOptions} SpacingOptions
14
14
  */
15
15
 
16
- const selectBoxStyles = tokens => {
17
- let styles = {
18
- backgroundColor: tokens.backgroundColor
16
+ const selectBoxStyles = _ref => {
17
+ let {
18
+ backgroundColor,
19
+ gradient,
20
+ borderWidth,
21
+ borderColor,
22
+ borderTopLeftRadius,
23
+ borderTopRightRadius,
24
+ borderBottomLeftRadius,
25
+ borderBottomRightRadius,
26
+ ...rest
27
+ } = _ref;
28
+ const styles = {
29
+ backgroundColor,
30
+ borderWidth,
31
+ borderColor,
32
+ borderTopLeftRadius,
33
+ borderTopRightRadius,
34
+ borderBottomLeftRadius,
35
+ borderBottomRightRadius
19
36
  };
20
37
 
21
- if (tokens.gradient) {
38
+ if (gradient) {
22
39
  const {
23
- gradient: {
24
- angle,
25
- stops: [stopOne, stopTwo]
26
- }
27
- } = tokens;
28
- styles = { ...styles,
29
- backgroundImage: `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`
30
- };
40
+ angle,
41
+ stops: [stopOne, stopTwo]
42
+ } = gradient;
43
+ styles.backgroundImage = `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`;
31
44
  }
32
45
 
33
46
  const paddings = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom']; // Only set on styles if token provided because we spread this object after the spacing scale values
34
47
 
35
48
  paddings.forEach(side => {
36
- if (tokens[side]) {
37
- styles[side] = tokens[side];
49
+ if (rest[side]) {
50
+ styles[side] = rest[side];
38
51
  }
39
52
  });
40
53
  return styles;
@@ -106,7 +119,7 @@ const selectBoxStyles = tokens => {
106
119
  */
107
120
 
108
121
 
109
- const Box = /*#__PURE__*/forwardRef((_ref, ref) => {
122
+ const Box = /*#__PURE__*/forwardRef((_ref2, ref) => {
110
123
  let {
111
124
  space,
112
125
  horizontal = space,
@@ -125,7 +138,7 @@ const Box = /*#__PURE__*/forwardRef((_ref, ref) => {
125
138
  testID,
126
139
  dataSet,
127
140
  ...rest
128
- } = _ref;
141
+ } = _ref2;
129
142
  const props = {
130
143
  accessibilityRole,
131
144
  ...getA11yPropsFromHtmlTag(tag, accessibilityRole),
@@ -57,7 +57,7 @@ const selectOuterSizeStyles = _ref3 => {
57
57
  });
58
58
  const sizeStyles = {}; // Apply width/height tokens: number === pixels, string === explicit units e.g. %
59
59
 
60
- if (typeof width === 'number' || typeof height === 'number') {
60
+ if (typeof width === 'number' && width > 0 || typeof height === 'number' && height > 0) {
61
61
  sizeStyles.width = width ? width + outerBorderOffset * 2 : width;
62
62
  sizeStyles.height = height ? height + outerBorderOffset * 2 : height;
63
63
  return sizeStyles;
@@ -66,9 +66,10 @@ const ExpandCollapseControl = /*#__PURE__*/forwardRef((_ref3, ref) => {
66
66
  tokens,
67
67
  accessibilityRole = 'button',
68
68
  variant,
69
+ isMiniExpandCollapse = false,
69
70
  ...rest
70
71
  } = _ref3;
71
- const getTokens = useThemeTokensCallback('ExpandCollapseControl', tokens, variant);
72
+ const getTokens = useThemeTokensCallback(isMiniExpandCollapse ? 'ExpandCollapseMiniControl' : 'ExpandCollapseControl', tokens, variant);
72
73
  const selectedProps = selectProps({
73
74
  accessibilityRole,
74
75
  ...rest,
@@ -48,6 +48,7 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef((_ref2, ref) => {
48
48
  children,
49
49
  tokens,
50
50
  variant,
51
+ isMiniExpandCollapse = false,
51
52
  controlRef,
52
53
  ...rest
53
54
  } = _ref2;
@@ -58,7 +59,7 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef((_ref2, ref) => {
58
59
  expanded: isExpanded
59
60
  }
60
61
  });
61
- const themeTokens = useThemeTokens('ExpandCollapsePanel', tokens, variant, {
62
+ const themeTokens = useThemeTokens(isMiniExpandCollapse ? 'ExpandCollapseMiniPanel' : 'ExpandCollapsePanel', tokens, variant, {
62
63
  expanded: isExpanded
63
64
  });
64
65
 
@@ -94,11 +95,12 @@ const ExpandCollapsePanel = /*#__PURE__*/forwardRef((_ref2, ref) => {
94
95
  variant: variant,
95
96
  onPress: handleControlPress,
96
97
  ref: controlRef,
98
+ isMiniExpandCollapse: isMiniExpandCollapse,
97
99
  children: control
98
100
  }), isExpanded && /*#__PURE__*/_jsx(View, {
99
101
  style: {
100
102
  borderTopColor: themeTokens.expandDividerColor,
101
- borderTopWidth: themeTokens.expanddDividerWidth,
103
+ borderTopWidth: themeTokens.expandDividerWidth,
102
104
  marginLeft: themeTokens.contentPaddingLeft,
103
105
  marginRight: themeTokens.contentPaddingRight
104
106
  }
@@ -28,7 +28,6 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
28
28
  rightIcon,
29
29
  iconDisplace,
30
30
  height,
31
- textLineHeight,
32
31
  fontSize,
33
32
  ...otherTokens
34
33
  } = getChevronTokens(linkState);
@@ -36,7 +35,6 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
36
35
  return { ...linkTokens,
37
36
  height,
38
37
  blockFontSize: tokens.fontSize ?? fontSize,
39
- textLineHeight,
40
38
  icon: direction === 'right' ? rightIcon : leftIcon,
41
39
  iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
42
40
  };
@@ -38,13 +38,11 @@ const selectOuterBorderStyles = _ref => {
38
38
  const selectTextStyles = _ref2 => {
39
39
  let {
40
40
  color,
41
- textLineHeight,
42
41
  blockFontSize
43
42
  } = _ref2;
44
43
  return {
45
44
  color,
46
45
  ...applyTextStyles({
47
- lineHeight: textLineHeight,
48
46
  blockFontSize
49
47
  }),
50
48
  ...Platform.select({
@@ -47,6 +47,10 @@ const List = /*#__PURE__*/forwardRef((_ref, ref) => {
47
47
  });
48
48
  return /*#__PURE__*/_jsx(View, {
49
49
  ref: ref,
50
+ style: {
51
+ flexShrink: 1,
52
+ flex: 1
53
+ },
50
54
  accessibilityRole: accessibilityRole,
51
55
  ...selectProps(rest),
52
56
  children: items
@@ -85,7 +85,10 @@ const Search = /*#__PURE__*/forwardRef((_ref3, ref) => {
85
85
  initialValue,
86
86
  onChange
87
87
  });
88
- const themeTokens = useThemeTokens('Search', tokens, variant);
88
+ const themeTokens = useThemeTokens('Search', tokens, {
89
+ inactive,
90
+ ...variant
91
+ });
89
92
  const buttonTokens = useThemeTokens('SearchButton', tokens, variant);
90
93
  const getThemeTokens = useThemeTokensCallback('Search', tokens, variant);
91
94
  const getButtonTokens = useThemeTokensCallback('SearchButton', tokens, variant); // TODO: support overriding the a11y props using a custom dictionary
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "@floating-ui/react-native": "^0.8.1",
12
12
  "@gorhom/portal": "^1.0.14",
13
13
  "@telus-uds/system-constants": "^1.2.1",
14
- "@telus-uds/system-theme-tokens": "^2.28.0",
14
+ "@telus-uds/system-theme-tokens": "^2.29.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "lodash.debounce": "^4.0.8",
17
17
  "lodash.merge": "^4.6.2",
@@ -72,5 +72,5 @@
72
72
  "standard-engine": {
73
73
  "skip": true
74
74
  },
75
- "version": "1.45.0"
75
+ "version": "1.47.0"
76
76
  }
package/src/Box/Box.jsx CHANGED
@@ -23,26 +23,39 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
23
23
  * @typedef {import('../utils/props/spacingProps.js').SpacingOptions} SpacingOptions
24
24
  */
25
25
 
26
- const selectBoxStyles = (tokens) => {
27
- let styles = { backgroundColor: tokens.backgroundColor }
28
- if (tokens.gradient) {
26
+ const selectBoxStyles = ({
27
+ backgroundColor,
28
+ gradient,
29
+ borderWidth,
30
+ borderColor,
31
+ borderTopLeftRadius,
32
+ borderTopRightRadius,
33
+ borderBottomLeftRadius,
34
+ borderBottomRightRadius,
35
+ ...rest
36
+ }) => {
37
+ const styles = {
38
+ backgroundColor,
39
+ borderWidth,
40
+ borderColor,
41
+ borderTopLeftRadius,
42
+ borderTopRightRadius,
43
+ borderBottomLeftRadius,
44
+ borderBottomRightRadius
45
+ }
46
+ if (gradient) {
29
47
  const {
30
- gradient: {
31
- angle,
32
- stops: [stopOne, stopTwo]
33
- }
34
- } = tokens
35
- styles = {
36
- ...styles,
37
- backgroundImage: `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`
38
- }
48
+ angle,
49
+ stops: [stopOne, stopTwo]
50
+ } = gradient
51
+ styles.backgroundImage = `linear-gradient(${angle}deg, ${stopOne.color}, 75% , ${stopTwo.color})`
39
52
  }
40
53
 
41
54
  const paddings = ['paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom']
42
55
  // Only set on styles if token provided because we spread this object after the spacing scale values
43
56
  paddings.forEach((side) => {
44
- if (tokens[side]) {
45
- styles[side] = tokens[side]
57
+ if (rest[side]) {
58
+ styles[side] = rest[side]
46
59
  }
47
60
  })
48
61
  return styles
@@ -55,7 +55,7 @@ const selectOuterSizeStyles = ({ outerBorderGap, outerBorderWidth, width, height
55
55
  const outerBorderOffset = getOuterBorderOffset({ outerBorderGap, outerBorderWidth })
56
56
  const sizeStyles = {}
57
57
  // Apply width/height tokens: number === pixels, string === explicit units e.g. %
58
- if (typeof width === 'number' || typeof height === 'number') {
58
+ if ((typeof width === 'number' && width > 0) || (typeof height === 'number' && height > 0)) {
59
59
  sizeStyles.width = width ? width + outerBorderOffset * 2 : width
60
60
  sizeStyles.height = height ? height + outerBorderOffset * 2 : height
61
61
  return sizeStyles
@@ -52,10 +52,23 @@ function selectIconTokens(tokens) {
52
52
 
53
53
  const ExpandCollapseControl = forwardRef(
54
54
  (
55
- { onPress, isExpanded, children, tokens, accessibilityRole = 'button', variant, ...rest },
55
+ {
56
+ onPress,
57
+ isExpanded,
58
+ children,
59
+ tokens,
60
+ accessibilityRole = 'button',
61
+ variant,
62
+ isMiniExpandCollapse = false,
63
+ ...rest
64
+ },
56
65
  ref
57
66
  ) => {
58
- const getTokens = useThemeTokensCallback('ExpandCollapseControl', tokens, variant)
67
+ const getTokens = useThemeTokensCallback(
68
+ isMiniExpandCollapse ? 'ExpandCollapseMiniControl' : 'ExpandCollapseControl',
69
+ tokens,
70
+ variant
71
+ )
59
72
 
60
73
  const selectedProps = selectProps({
61
74
  accessibilityRole,
@@ -51,6 +51,7 @@ const ExpandCollapsePanel = forwardRef(
51
51
  children,
52
52
  tokens,
53
53
  variant,
54
+ isMiniExpandCollapse = false,
54
55
  controlRef,
55
56
  ...rest
56
57
  },
@@ -67,9 +68,14 @@ const ExpandCollapsePanel = forwardRef(
67
68
  }
68
69
  })
69
70
 
70
- const themeTokens = useThemeTokens('ExpandCollapsePanel', tokens, variant, {
71
- expanded: isExpanded
72
- })
71
+ const themeTokens = useThemeTokens(
72
+ isMiniExpandCollapse ? 'ExpandCollapseMiniPanel' : 'ExpandCollapsePanel',
73
+ tokens,
74
+ variant,
75
+ {
76
+ expanded: isExpanded
77
+ }
78
+ )
73
79
 
74
80
  const handleControlPress = (event) => {
75
81
  onToggle(panelId, event)
@@ -100,6 +106,7 @@ const ExpandCollapsePanel = forwardRef(
100
106
  variant={variant}
101
107
  onPress={handleControlPress}
102
108
  ref={controlRef}
109
+ isMiniExpandCollapse={isMiniExpandCollapse}
103
110
  >
104
111
  {control}
105
112
  </ExpandCollapseControl>
@@ -107,7 +114,7 @@ const ExpandCollapsePanel = forwardRef(
107
114
  <View
108
115
  style={{
109
116
  borderTopColor: themeTokens.expandDividerColor,
110
- borderTopWidth: themeTokens.expanddDividerWidth,
117
+ borderTopWidth: themeTokens.expandDividerWidth,
111
118
  marginLeft: themeTokens.contentPaddingLeft,
112
119
  marginRight: themeTokens.contentPaddingRight
113
120
  }}
@@ -15,22 +15,15 @@ const ChevronLink = forwardRef(
15
15
  ({ direction = 'right', children, tokens = {}, variant, dataSet, ...linkProps }, ref) => {
16
16
  const getChevronTokens = useThemeTokensCallback('ChevronLink', tokens, variant)
17
17
  const applyChevronTokens = (linkState) => {
18
- const {
19
- leftIcon,
20
- rightIcon,
21
- iconDisplace,
22
- height,
23
- textLineHeight,
24
- fontSize,
25
- ...otherTokens
26
- } = getChevronTokens(linkState)
18
+ const { leftIcon, rightIcon, iconDisplace, height, fontSize, ...otherTokens } =
19
+ getChevronTokens(linkState)
20
+
27
21
  const linkTokens = selectTokens('Link', otherTokens)
28
22
 
29
23
  return {
30
24
  ...linkTokens,
31
25
  height,
32
26
  blockFontSize: tokens.fontSize ?? fontSize,
33
- textLineHeight,
34
27
  icon: direction === 'right' ? rightIcon : leftIcon,
35
28
  iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
36
29
  }
@@ -42,10 +42,10 @@ const selectOuterBorderStyles = ({
42
42
  }
43
43
  : {}
44
44
 
45
- const selectTextStyles = ({ color, textLineHeight, blockFontSize }) => {
45
+ const selectTextStyles = ({ color, blockFontSize }) => {
46
46
  return {
47
47
  color,
48
- ...applyTextStyles({ lineHeight: textLineHeight, blockFontSize }),
48
+ ...applyTextStyles({ blockFontSize }),
49
49
  ...Platform.select({
50
50
  web: {
51
51
  // TODO: https://github.com/telus/universal-design-system/issues/487
@@ -168,7 +168,6 @@ const LinkBase = forwardRef(
168
168
  const themeTokens = resolveLinkTokens(linkState)
169
169
  const textStyles = selectTextStyles(themeTokens)
170
170
  const iconTokens = selectIconTokens(themeTokens)
171
-
172
171
  // TODO: may need to apply some smarter text inheritance here if inline to avoid native
173
172
  // issues like double-application of line heights breaking align-items: baseline
174
173
  const blockTextStyles = selectBlockStyles(themeTokens, themeOptions)
package/src/List/List.jsx CHANGED
@@ -42,7 +42,12 @@ const List = forwardRef(
42
42
  })
43
43
 
44
44
  return (
45
- <View ref={ref} accessibilityRole={accessibilityRole} {...selectProps(rest)}>
45
+ <View
46
+ ref={ref}
47
+ style={{ flexShrink: 1, flex: 1 }}
48
+ accessibilityRole={accessibilityRole}
49
+ {...selectProps(rest)}
50
+ >
46
51
  {items}
47
52
  </View>
48
53
  )
@@ -81,9 +81,8 @@ const Search = forwardRef(
81
81
  onChange
82
82
  })
83
83
 
84
- const themeTokens = useThemeTokens('Search', tokens, variant)
84
+ const themeTokens = useThemeTokens('Search', tokens, { inactive, ...variant })
85
85
  const buttonTokens = useThemeTokens('SearchButton', tokens, variant)
86
-
87
86
  const getThemeTokens = useThemeTokensCallback('Search', tokens, variant)
88
87
  const getButtonTokens = useThemeTokensCallback('SearchButton', tokens, variant)
89
88