@telus-uds/components-base 1.34.2 → 1.36.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 +24 -2
- package/component-docs.json +69 -32
- package/lib/Icon/IconText.js +13 -3
- package/lib/IconButton/IconButton.js +1 -1
- package/lib/Link/ChevronLink.js +4 -0
- package/lib/Link/LinkBase.js +17 -6
- package/lib-module/Icon/IconText.js +16 -3
- package/lib-module/IconButton/IconButton.js +1 -1
- package/lib-module/Link/ChevronLink.js +4 -0
- package/lib-module/Link/LinkBase.js +17 -6
- package/package.json +3 -3
- package/src/Icon/IconText.jsx +11 -7
- package/src/IconButton/IconButton.jsx +1 -1
- package/src/Link/ChevronLink.jsx +4 -1
- package/src/Link/LinkBase.jsx +17 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 20 Apr 2023 19:05:54 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.36.0
|
|
8
|
+
|
|
9
|
+
Thu, 20 Apr 2023 19:05:54 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- added adjustments to IconText (kyle.king2@telus.com)
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v2.21.0
|
|
15
|
+
|
|
16
|
+
### Patches
|
|
17
|
+
|
|
18
|
+
- dependency version fix (srikanthkhari@gmail.com)
|
|
19
|
+
|
|
20
|
+
## 1.35.0
|
|
21
|
+
|
|
22
|
+
Wed, 19 Apr 2023 18:49:51 GMT
|
|
23
|
+
|
|
24
|
+
### Minor changes
|
|
25
|
+
|
|
26
|
+
- Add Flex tokens to Card Content (carlos.jeronimo@telus.com)
|
|
27
|
+
- Bump @telus-uds/system-theme-tokens to v2.20.0
|
|
28
|
+
|
|
7
29
|
## 1.34.2
|
|
8
30
|
|
|
9
|
-
Wed, 19 Apr 2023 11:
|
|
31
|
+
Wed, 19 Apr 2023 11:32:31 GMT
|
|
10
32
|
|
|
11
33
|
### Patches
|
|
12
34
|
|
package/component-docs.json
CHANGED
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"Image": {
|
|
37
37
|
"borderRadius": "radius"
|
|
38
38
|
},
|
|
39
|
+
"Spinner": {
|
|
40
|
+
"fullScreenOverLayBackground": "color",
|
|
41
|
+
"size": "size",
|
|
42
|
+
"thickness": "border"
|
|
43
|
+
},
|
|
39
44
|
"Callout": {
|
|
40
45
|
"background": "color",
|
|
41
46
|
"gap": "size",
|
|
@@ -234,7 +239,11 @@
|
|
|
234
239
|
"paddingRight": "size",
|
|
235
240
|
"paddingTop": "size",
|
|
236
241
|
"minWidth": "size",
|
|
237
|
-
"shadow": "shadow"
|
|
242
|
+
"shadow": "shadow",
|
|
243
|
+
"contentAlignItems": "flexAlign",
|
|
244
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
245
|
+
"contentFlexGrow": "integer",
|
|
246
|
+
"contentFlexShrink": "integer"
|
|
238
247
|
},
|
|
239
248
|
"PreviewCard": {
|
|
240
249
|
"flex": "integer",
|
|
@@ -315,6 +324,8 @@
|
|
|
315
324
|
"labelMarginLeft": "size"
|
|
316
325
|
},
|
|
317
326
|
"ChevronLink": {
|
|
327
|
+
"height": "size",
|
|
328
|
+
"textLineHeight": "lineHeight",
|
|
318
329
|
"color": "color",
|
|
319
330
|
"outerBorderColor": "color",
|
|
320
331
|
"leftIcon": "icon",
|
|
@@ -813,6 +824,10 @@
|
|
|
813
824
|
"paddingTop": "size",
|
|
814
825
|
"minWidth": "size",
|
|
815
826
|
"shadow": "shadow",
|
|
827
|
+
"contentAlignItems": "flexAlign",
|
|
828
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
829
|
+
"contentFlexGrow": "integer",
|
|
830
|
+
"contentFlexShrink": "integer",
|
|
816
831
|
"radioCheckedBackgroundColor": "color",
|
|
817
832
|
"radioCheckedSize": "size",
|
|
818
833
|
"radioInputBackgroundColor": "color",
|
|
@@ -3264,7 +3279,11 @@
|
|
|
3264
3279
|
"paddingRight": "size",
|
|
3265
3280
|
"paddingTop": "size",
|
|
3266
3281
|
"minWidth": "size",
|
|
3267
|
-
"shadow": "shadow"
|
|
3282
|
+
"shadow": "shadow",
|
|
3283
|
+
"contentAlignItems": "flexAlign",
|
|
3284
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
3285
|
+
"contentFlexGrow": "integer",
|
|
3286
|
+
"contentFlexShrink": "integer"
|
|
3268
3287
|
}
|
|
3269
3288
|
},
|
|
3270
3289
|
"required": false,
|
|
@@ -6947,7 +6966,11 @@
|
|
|
6947
6966
|
"paddingRight": "size",
|
|
6948
6967
|
"paddingTop": "size",
|
|
6949
6968
|
"minWidth": "size",
|
|
6950
|
-
"shadow": "shadow"
|
|
6969
|
+
"shadow": "shadow",
|
|
6970
|
+
"contentAlignItems": "flexAlign",
|
|
6971
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
6972
|
+
"contentFlexGrow": "integer",
|
|
6973
|
+
"contentFlexShrink": "integer"
|
|
6951
6974
|
}
|
|
6952
6975
|
},
|
|
6953
6976
|
"required": false,
|
|
@@ -7556,6 +7579,10 @@
|
|
|
7556
7579
|
"paddingTop": "size",
|
|
7557
7580
|
"minWidth": "size",
|
|
7558
7581
|
"shadow": "shadow",
|
|
7582
|
+
"contentAlignItems": "flexAlign",
|
|
7583
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
7584
|
+
"contentFlexGrow": "integer",
|
|
7585
|
+
"contentFlexShrink": "integer",
|
|
7559
7586
|
"radioCheckedBackgroundColor": "color",
|
|
7560
7587
|
"radioCheckedSize": "size",
|
|
7561
7588
|
"radioInputBackgroundColor": "color",
|
|
@@ -12420,6 +12447,8 @@
|
|
|
12420
12447
|
"type": {
|
|
12421
12448
|
"name": "custom",
|
|
12422
12449
|
"raw": {
|
|
12450
|
+
"height": "size",
|
|
12451
|
+
"textLineHeight": "lineHeight",
|
|
12423
12452
|
"color": "color",
|
|
12424
12453
|
"outerBorderColor": "color",
|
|
12425
12454
|
"leftIcon": "icon",
|
|
@@ -12501,6 +12530,39 @@
|
|
|
12501
12530
|
"required": false,
|
|
12502
12531
|
"description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of Link."
|
|
12503
12532
|
},
|
|
12533
|
+
"iconProps": {
|
|
12534
|
+
"defaultValue": {
|
|
12535
|
+
"value": "{}",
|
|
12536
|
+
"computed": false
|
|
12537
|
+
},
|
|
12538
|
+
"type": {
|
|
12539
|
+
"name": "exact",
|
|
12540
|
+
"value": {
|
|
12541
|
+
"variant": {
|
|
12542
|
+
"name": "custom",
|
|
12543
|
+
"raw": "variantProp.propType",
|
|
12544
|
+
"required": false
|
|
12545
|
+
},
|
|
12546
|
+
"tokens": {
|
|
12547
|
+
"name": "custom",
|
|
12548
|
+
"raw": "getTokensPropType('Icon')",
|
|
12549
|
+
"required": false
|
|
12550
|
+
},
|
|
12551
|
+
"accessibilityLabel": {
|
|
12552
|
+
"name": "string",
|
|
12553
|
+
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
12554
|
+
"required": false
|
|
12555
|
+
},
|
|
12556
|
+
"scalesWithText": {
|
|
12557
|
+
"name": "bool",
|
|
12558
|
+
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
12559
|
+
"required": false
|
|
12560
|
+
}
|
|
12561
|
+
}
|
|
12562
|
+
},
|
|
12563
|
+
"required": false,
|
|
12564
|
+
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
12565
|
+
},
|
|
12504
12566
|
"tokens": {
|
|
12505
12567
|
"defaultValue": {
|
|
12506
12568
|
"value": "{}",
|
|
@@ -12560,35 +12622,6 @@
|
|
|
12560
12622
|
"required": false,
|
|
12561
12623
|
"description": ""
|
|
12562
12624
|
},
|
|
12563
|
-
"iconProps": {
|
|
12564
|
-
"type": {
|
|
12565
|
-
"name": "exact",
|
|
12566
|
-
"value": {
|
|
12567
|
-
"variant": {
|
|
12568
|
-
"name": "custom",
|
|
12569
|
-
"raw": "variantProp.propType",
|
|
12570
|
-
"required": false
|
|
12571
|
-
},
|
|
12572
|
-
"tokens": {
|
|
12573
|
-
"name": "custom",
|
|
12574
|
-
"raw": "getTokensPropType('Icon')",
|
|
12575
|
-
"required": false
|
|
12576
|
-
},
|
|
12577
|
-
"accessibilityLabel": {
|
|
12578
|
-
"name": "string",
|
|
12579
|
-
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
12580
|
-
"required": false
|
|
12581
|
-
},
|
|
12582
|
-
"scalesWithText": {
|
|
12583
|
-
"name": "bool",
|
|
12584
|
-
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
12585
|
-
"required": false
|
|
12586
|
-
}
|
|
12587
|
-
}
|
|
12588
|
-
},
|
|
12589
|
-
"required": false,
|
|
12590
|
-
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
12591
|
-
},
|
|
12592
12625
|
"icon": {
|
|
12593
12626
|
"type": {
|
|
12594
12627
|
"name": "elementType"
|
|
@@ -13018,6 +13051,10 @@
|
|
|
13018
13051
|
"paddingTop": "size",
|
|
13019
13052
|
"minWidth": "size",
|
|
13020
13053
|
"shadow": "shadow",
|
|
13054
|
+
"contentAlignItems": "flexAlign",
|
|
13055
|
+
"contentJustifyContent": "flexJustifyContent",
|
|
13056
|
+
"contentFlexGrow": "integer",
|
|
13057
|
+
"contentFlexShrink": "integer",
|
|
13021
13058
|
"radioCheckedBackgroundColor": "color",
|
|
13022
13059
|
"radioCheckedSize": "size",
|
|
13023
13060
|
"radioInputBackgroundColor": "color",
|
package/lib/Icon/IconText.js
CHANGED
|
@@ -54,15 +54,25 @@ const IconText = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
54
54
|
// See abandoned issue https://github.com/facebook/react-native/issues/6529
|
|
55
55
|
|
|
56
56
|
const size = iconProps === null || iconProps === void 0 ? void 0 : (_iconProps$tokens = iconProps.tokens) === null || _iconProps$tokens === void 0 ? void 0 : _iconProps$tokens.size;
|
|
57
|
-
const
|
|
57
|
+
const iconAdjustedAndriod = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
58
58
|
style: {
|
|
59
59
|
transform: [{
|
|
60
60
|
translateY: size * 0.2
|
|
61
61
|
}]
|
|
62
62
|
},
|
|
63
63
|
children: iconContent
|
|
64
|
-
})
|
|
65
|
-
|
|
64
|
+
});
|
|
65
|
+
const iconAdjustedIOS = /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
66
|
+
style: {
|
|
67
|
+
transform: [{
|
|
68
|
+
translateY: size * 0.01
|
|
69
|
+
}]
|
|
70
|
+
},
|
|
71
|
+
children: iconContent
|
|
72
|
+
});
|
|
73
|
+
const mobile = _Platform.default.OS === 'android' ? iconAdjustedAndriod : iconAdjustedIOS;
|
|
74
|
+
const adjustedContainer = _Platform.default.OS === 'web' ? iconContent : mobile;
|
|
75
|
+
return (0, _StackView.getStackedContent)(iconPosition === 'left' ? [adjustedContainer, children] : [children, adjustedContainer], {
|
|
66
76
|
space,
|
|
67
77
|
direction: 'row'
|
|
68
78
|
});
|
package/lib/Link/ChevronLink.js
CHANGED
|
@@ -45,9 +45,13 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
45
45
|
leftIcon,
|
|
46
46
|
rightIcon,
|
|
47
47
|
iconDisplace,
|
|
48
|
+
height,
|
|
49
|
+
textLineHeight,
|
|
48
50
|
...otherTokens
|
|
49
51
|
} = getChevronTokens(linkState);
|
|
50
52
|
return { ...(0, _utils.selectTokens)('Link', otherTokens),
|
|
53
|
+
height,
|
|
54
|
+
textLineHeight,
|
|
51
55
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
52
56
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
|
53
57
|
};
|
package/lib/Link/LinkBase.js
CHANGED
|
@@ -62,10 +62,16 @@ const selectOuterBorderStyles = _ref => {
|
|
|
62
62
|
|
|
63
63
|
const selectTextStyles = _ref2 => {
|
|
64
64
|
let {
|
|
65
|
-
color
|
|
65
|
+
color,
|
|
66
|
+
textLineHeight,
|
|
67
|
+
blockFontSize
|
|
66
68
|
} = _ref2;
|
|
67
69
|
return {
|
|
68
70
|
color,
|
|
71
|
+
...(0, _ThemeProvider.applyTextStyles)({
|
|
72
|
+
lineHeight: textLineHeight,
|
|
73
|
+
blockFontSize
|
|
74
|
+
}),
|
|
69
75
|
..._Platform.default.select({
|
|
70
76
|
web: {
|
|
71
77
|
// TODO: https://github.com/telus/universal-design-system/issues/487
|
|
@@ -83,9 +89,9 @@ const selectBlockStyles = (_ref3, themeOptions) => {
|
|
|
83
89
|
blockFontName
|
|
84
90
|
} = _ref3;
|
|
85
91
|
return (0, _ThemeProvider.applyTextStyles)({
|
|
92
|
+
lineHeight: blockLineHeight,
|
|
86
93
|
fontWeight: blockFontWeight,
|
|
87
94
|
fontSize: blockFontSize,
|
|
88
|
-
lineHeight: blockLineHeight,
|
|
89
95
|
fontName: blockFontName,
|
|
90
96
|
themeOptions
|
|
91
97
|
});
|
|
@@ -153,7 +159,7 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
153
159
|
href,
|
|
154
160
|
icon,
|
|
155
161
|
iconPosition = icon ? 'left' : undefined,
|
|
156
|
-
iconProps,
|
|
162
|
+
iconProps = {},
|
|
157
163
|
variant,
|
|
158
164
|
tokens = {},
|
|
159
165
|
children,
|
|
@@ -198,10 +204,15 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
198
204
|
,
|
|
199
205
|
ref: ref,
|
|
200
206
|
style: linkState => {
|
|
201
|
-
const
|
|
207
|
+
const {
|
|
208
|
+
height,
|
|
209
|
+
...themeTokens
|
|
210
|
+
} = resolveLinkTokens(linkState);
|
|
202
211
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
203
212
|
const decorationStyles = selectDecorationStyles(themeTokens);
|
|
204
|
-
return [
|
|
213
|
+
return [height ? {
|
|
214
|
+
height
|
|
215
|
+
} : {}, outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
205
216
|
},
|
|
206
217
|
children: linkState => {
|
|
207
218
|
const themeTokens = resolveLinkTokens(linkState);
|
|
@@ -267,7 +278,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
267
278
|
justifyContent: 'flex-start'
|
|
268
279
|
},
|
|
269
280
|
baseline: {
|
|
270
|
-
alignSelf: '
|
|
281
|
+
alignSelf: 'center'
|
|
271
282
|
}
|
|
272
283
|
});
|
|
273
284
|
|
|
@@ -36,15 +36,28 @@ const IconText = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
const size = iconProps === null || iconProps === void 0 ? void 0 : (_iconProps$tokens = iconProps.tokens) === null || _iconProps$tokens === void 0 ? void 0 : _iconProps$tokens.size;
|
|
39
|
-
|
|
39
|
+
|
|
40
|
+
const iconAdjustedAndriod = /*#__PURE__*/_jsx(View, {
|
|
40
41
|
style: {
|
|
41
42
|
transform: [{
|
|
42
43
|
translateY: size * 0.2
|
|
43
44
|
}]
|
|
44
45
|
},
|
|
45
46
|
children: iconContent
|
|
46
|
-
})
|
|
47
|
-
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const iconAdjustedIOS = /*#__PURE__*/_jsx(View, {
|
|
50
|
+
style: {
|
|
51
|
+
transform: [{
|
|
52
|
+
translateY: size * 0.01
|
|
53
|
+
}]
|
|
54
|
+
},
|
|
55
|
+
children: iconContent
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
const mobile = Platform.OS === 'android' ? iconAdjustedAndriod : iconAdjustedIOS;
|
|
59
|
+
const adjustedContainer = Platform.OS === 'web' ? iconContent : mobile;
|
|
60
|
+
return getStackedContent(iconPosition === 'left' ? [adjustedContainer, children] : [children, adjustedContainer], {
|
|
48
61
|
space,
|
|
49
62
|
direction: 'row'
|
|
50
63
|
});
|
|
@@ -27,9 +27,13 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
27
27
|
leftIcon,
|
|
28
28
|
rightIcon,
|
|
29
29
|
iconDisplace,
|
|
30
|
+
height,
|
|
31
|
+
textLineHeight,
|
|
30
32
|
...otherTokens
|
|
31
33
|
} = getChevronTokens(linkState);
|
|
32
34
|
return { ...selectTokens('Link', otherTokens),
|
|
35
|
+
height,
|
|
36
|
+
textLineHeight,
|
|
33
37
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
34
38
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
|
35
39
|
};
|
|
@@ -37,10 +37,16 @@ const selectOuterBorderStyles = _ref => {
|
|
|
37
37
|
|
|
38
38
|
const selectTextStyles = _ref2 => {
|
|
39
39
|
let {
|
|
40
|
-
color
|
|
40
|
+
color,
|
|
41
|
+
textLineHeight,
|
|
42
|
+
blockFontSize
|
|
41
43
|
} = _ref2;
|
|
42
44
|
return {
|
|
43
45
|
color,
|
|
46
|
+
...applyTextStyles({
|
|
47
|
+
lineHeight: textLineHeight,
|
|
48
|
+
blockFontSize
|
|
49
|
+
}),
|
|
44
50
|
...Platform.select({
|
|
45
51
|
web: {
|
|
46
52
|
// TODO: https://github.com/telus/universal-design-system/issues/487
|
|
@@ -58,9 +64,9 @@ const selectBlockStyles = (_ref3, themeOptions) => {
|
|
|
58
64
|
blockFontName
|
|
59
65
|
} = _ref3;
|
|
60
66
|
return applyTextStyles({
|
|
67
|
+
lineHeight: blockLineHeight,
|
|
61
68
|
fontWeight: blockFontWeight,
|
|
62
69
|
fontSize: blockFontSize,
|
|
63
|
-
lineHeight: blockLineHeight,
|
|
64
70
|
fontName: blockFontName,
|
|
65
71
|
themeOptions
|
|
66
72
|
});
|
|
@@ -128,7 +134,7 @@ const LinkBase = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
|
128
134
|
href,
|
|
129
135
|
icon,
|
|
130
136
|
iconPosition = icon ? 'left' : undefined,
|
|
131
|
-
iconProps,
|
|
137
|
+
iconProps = {},
|
|
132
138
|
variant,
|
|
133
139
|
tokens = {},
|
|
134
140
|
children,
|
|
@@ -170,10 +176,15 @@ const LinkBase = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
|
170
176
|
,
|
|
171
177
|
ref: ref,
|
|
172
178
|
style: linkState => {
|
|
173
|
-
const
|
|
179
|
+
const {
|
|
180
|
+
height,
|
|
181
|
+
...themeTokens
|
|
182
|
+
} = resolveLinkTokens(linkState);
|
|
174
183
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
175
184
|
const decorationStyles = selectDecorationStyles(themeTokens);
|
|
176
|
-
return [
|
|
185
|
+
return [height ? {
|
|
186
|
+
height
|
|
187
|
+
} : {}, outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
177
188
|
},
|
|
178
189
|
children: linkState => {
|
|
179
190
|
const themeTokens = resolveLinkTokens(linkState);
|
|
@@ -238,7 +249,7 @@ const staticStyles = StyleSheet.create({
|
|
|
238
249
|
justifyContent: 'flex-start'
|
|
239
250
|
},
|
|
240
251
|
baseline: {
|
|
241
|
-
alignSelf: '
|
|
252
|
+
alignSelf: 'center'
|
|
242
253
|
}
|
|
243
254
|
});
|
|
244
255
|
export default withLinkRouter(LinkBase);
|
package/package.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"@floating-ui/react-native": "^0.8.1",
|
|
12
12
|
"@gorhom/portal": "^1.0.14",
|
|
13
13
|
"@telus-uds/system-constants": "^1.2.0",
|
|
14
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
14
|
+
"@telus-uds/system-theme-tokens": "^2.21.0",
|
|
15
15
|
"airbnb-prop-types": "^2.16.0",
|
|
16
16
|
"lodash.debounce": "^4.0.8",
|
|
17
17
|
"lodash.merge": "^4.6.2",
|
|
18
18
|
"prop-types": "^15.7.2",
|
|
19
19
|
"react-native-picker-select": "^8.0.4",
|
|
20
|
-
"semver": "
|
|
20
|
+
"semver": "7.3.5"
|
|
21
21
|
},
|
|
22
22
|
"description": "Base components",
|
|
23
23
|
"devDependencies": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"standard-engine": {
|
|
73
73
|
"skip": true
|
|
74
74
|
},
|
|
75
|
-
"version": "1.
|
|
75
|
+
"version": "1.36.0"
|
|
76
76
|
}
|
package/src/Icon/IconText.jsx
CHANGED
|
@@ -23,15 +23,19 @@ const IconText = forwardRef(
|
|
|
23
23
|
// Inline images on Android are always baseline-aligned which makes them look misaligned - offset it.
|
|
24
24
|
// See abandoned issue https://github.com/facebook/react-native/issues/6529
|
|
25
25
|
const size = iconProps?.tokens?.size
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const iconAdjustedAndriod = (
|
|
27
|
+
<View style={{ transform: [{ translateY: size * 0.2 }] }}>{iconContent}</View>
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const iconAdjustedIOS = (
|
|
31
|
+
<View style={{ transform: [{ translateY: size * 0.01 }] }}>{iconContent}</View>
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
const mobile = Platform.OS === 'android' ? iconAdjustedAndriod : iconAdjustedIOS
|
|
35
|
+
const adjustedContainer = Platform.OS === 'web' ? iconContent : mobile
|
|
32
36
|
|
|
33
37
|
return getStackedContent(
|
|
34
|
-
iconPosition === 'left' ? [
|
|
38
|
+
iconPosition === 'left' ? [adjustedContainer, children] : [children, adjustedContainer],
|
|
35
39
|
{ space, direction: 'row' }
|
|
36
40
|
)
|
|
37
41
|
}
|
package/src/Link/ChevronLink.jsx
CHANGED
|
@@ -15,9 +15,12 @@ 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 { leftIcon, rightIcon, iconDisplace, ...otherTokens } =
|
|
18
|
+
const { leftIcon, rightIcon, iconDisplace, height, textLineHeight, ...otherTokens } =
|
|
19
|
+
getChevronTokens(linkState)
|
|
19
20
|
return {
|
|
20
21
|
...selectTokens('Link', otherTokens),
|
|
22
|
+
height,
|
|
23
|
+
textLineHeight,
|
|
21
24
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
22
25
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
|
23
26
|
}
|
package/src/Link/LinkBase.jsx
CHANGED
|
@@ -42,24 +42,27 @@ const selectOuterBorderStyles = ({
|
|
|
42
42
|
}
|
|
43
43
|
: {}
|
|
44
44
|
|
|
45
|
-
const selectTextStyles = ({ color }) =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
45
|
+
const selectTextStyles = ({ color, textLineHeight, blockFontSize }) => {
|
|
46
|
+
return {
|
|
47
|
+
color,
|
|
48
|
+
...applyTextStyles({ lineHeight: textLineHeight, blockFontSize }),
|
|
49
|
+
...Platform.select({
|
|
50
|
+
web: {
|
|
51
|
+
// TODO: https://github.com/telus/universal-design-system/issues/487
|
|
52
|
+
transition: 'color 200ms'
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
}
|
|
54
57
|
|
|
55
58
|
const selectBlockStyles = (
|
|
56
59
|
{ blockFontWeight, blockFontSize, blockLineHeight, blockFontName },
|
|
57
60
|
themeOptions
|
|
58
61
|
) =>
|
|
59
62
|
applyTextStyles({
|
|
63
|
+
lineHeight: blockLineHeight,
|
|
60
64
|
fontWeight: blockFontWeight,
|
|
61
65
|
fontSize: blockFontSize,
|
|
62
|
-
lineHeight: blockLineHeight,
|
|
63
66
|
fontName: blockFontName,
|
|
64
67
|
themeOptions
|
|
65
68
|
})
|
|
@@ -111,7 +114,7 @@ const LinkBase = forwardRef(
|
|
|
111
114
|
href,
|
|
112
115
|
icon,
|
|
113
116
|
iconPosition = icon ? 'left' : undefined,
|
|
114
|
-
iconProps,
|
|
117
|
+
iconProps = {},
|
|
115
118
|
variant,
|
|
116
119
|
tokens = {},
|
|
117
120
|
children,
|
|
@@ -147,11 +150,12 @@ const LinkBase = forwardRef(
|
|
|
147
150
|
inlineFlex={hasIcon} // assuming links without icons should be inline (even if they are long)
|
|
148
151
|
ref={ref}
|
|
149
152
|
style={(linkState) => {
|
|
150
|
-
const themeTokens = resolveLinkTokens(linkState)
|
|
153
|
+
const { height, ...themeTokens } = resolveLinkTokens(linkState)
|
|
151
154
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens)
|
|
152
155
|
const decorationStyles = selectDecorationStyles(themeTokens)
|
|
153
156
|
|
|
154
157
|
return [
|
|
158
|
+
height ? { height } : {},
|
|
155
159
|
outerBorderStyles,
|
|
156
160
|
blockLeftStyle,
|
|
157
161
|
decorationStyles,
|
|
@@ -222,7 +226,7 @@ const staticStyles = StyleSheet.create({
|
|
|
222
226
|
justifyContent: 'flex-start'
|
|
223
227
|
},
|
|
224
228
|
baseline: {
|
|
225
|
-
alignSelf: '
|
|
229
|
+
alignSelf: 'center'
|
|
226
230
|
}
|
|
227
231
|
})
|
|
228
232
|
|