@telus-uds/components-base 1.35.0 → 1.37.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 +145 -34
- package/lib/Icon/IconText.js +13 -3
- package/lib/IconButton/IconButton.js +4 -3
- 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 +4 -3
- 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 +3 -2
- 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 Mon, 24 Apr 2023 21:33:59 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.37.0
|
|
8
|
+
|
|
9
|
+
Mon, 24 Apr 2023 21:33:59 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- conditionally render Icon based on it being defined (kyle.king2@telus.com)
|
|
14
|
+
- Bump @telus-uds/system-theme-tokens to v2.22.0
|
|
15
|
+
|
|
16
|
+
## 1.36.0
|
|
17
|
+
|
|
18
|
+
Thu, 20 Apr 2023 19:13:33 GMT
|
|
19
|
+
|
|
20
|
+
### Minor changes
|
|
21
|
+
|
|
22
|
+
- added adjustments to IconText (kyle.king2@telus.com)
|
|
23
|
+
- Bump @telus-uds/system-theme-tokens to v2.21.0
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- dependency version fix (srikanthkhari@gmail.com)
|
|
28
|
+
|
|
7
29
|
## 1.35.0
|
|
8
30
|
|
|
9
|
-
Wed, 19 Apr 2023 18:
|
|
31
|
+
Wed, 19 Apr 2023 18:49:51 GMT
|
|
10
32
|
|
|
11
33
|
### Minor changes
|
|
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",
|
|
@@ -114,6 +119,16 @@
|
|
|
114
119
|
"paddingTop": "size",
|
|
115
120
|
"paddingBottom": "size"
|
|
116
121
|
},
|
|
122
|
+
"BlockQuote": {
|
|
123
|
+
"color": "color",
|
|
124
|
+
"backgroundGradient": "gradient",
|
|
125
|
+
"paddingLeft": "size",
|
|
126
|
+
"paddingRight": "size",
|
|
127
|
+
"paddingTop": "size",
|
|
128
|
+
"paddingBottom": "size",
|
|
129
|
+
"marginBottom": "size",
|
|
130
|
+
"width": "size"
|
|
131
|
+
},
|
|
117
132
|
"Box": {
|
|
118
133
|
"backgroundColor": "color",
|
|
119
134
|
"gradient": "gradient"
|
|
@@ -319,6 +334,8 @@
|
|
|
319
334
|
"labelMarginLeft": "size"
|
|
320
335
|
},
|
|
321
336
|
"ChevronLink": {
|
|
337
|
+
"height": "size",
|
|
338
|
+
"textLineHeight": "lineHeight",
|
|
322
339
|
"color": "color",
|
|
323
340
|
"outerBorderColor": "color",
|
|
324
341
|
"leftIcon": "icon",
|
|
@@ -489,6 +506,7 @@
|
|
|
489
506
|
"space": "integer"
|
|
490
507
|
},
|
|
491
508
|
"IconButton": {
|
|
509
|
+
"icon": "icon",
|
|
492
510
|
"backgroundColor": "color",
|
|
493
511
|
"borderRadius": "radius",
|
|
494
512
|
"borderColor": "color",
|
|
@@ -543,6 +561,38 @@
|
|
|
543
561
|
"itemIconColor": "color",
|
|
544
562
|
"listGutter": "size"
|
|
545
563
|
},
|
|
564
|
+
"ListBox": {
|
|
565
|
+
"groupBorderRadius": "radius",
|
|
566
|
+
"groupBorderWidth": "border",
|
|
567
|
+
"groupFontSize": "size",
|
|
568
|
+
"groupFontName": "fontName",
|
|
569
|
+
"groupFontWeight": "fontWeight",
|
|
570
|
+
"groupColor": "color",
|
|
571
|
+
"groupBorderColor": "color",
|
|
572
|
+
"groupBackgroundColor": "color",
|
|
573
|
+
"groupPaddingTop": "size",
|
|
574
|
+
"groupPaddingBottom": "size",
|
|
575
|
+
"groupPaddingLeft": "size",
|
|
576
|
+
"groupPaddingRight": "size",
|
|
577
|
+
"groupIcon": "icon",
|
|
578
|
+
"itemDisplay": "show",
|
|
579
|
+
"itemFontName": "fontName",
|
|
580
|
+
"itemFontWeight": "fontWeight",
|
|
581
|
+
"itemFontSize": "size",
|
|
582
|
+
"itemPaddingTop": "size",
|
|
583
|
+
"itemPaddingBottom": "size",
|
|
584
|
+
"itemPaddingLeft": "size",
|
|
585
|
+
"itemPaddingRight": "size",
|
|
586
|
+
"itemColor": "color",
|
|
587
|
+
"itemBackgroundColor": "color",
|
|
588
|
+
"itemBorderBackgroundColor": "color",
|
|
589
|
+
"itemBorderLeftColor": "color",
|
|
590
|
+
"itemBorderLeftWidth": "border",
|
|
591
|
+
"itemBorderWidth": "border",
|
|
592
|
+
"itemTextDecoration": "textLine",
|
|
593
|
+
"itemOutline": "border",
|
|
594
|
+
"shadow": "shadow"
|
|
595
|
+
},
|
|
546
596
|
"OrderedList": {
|
|
547
597
|
"headerFontWeight": "fontWeight",
|
|
548
598
|
"headerFontName": "fontName",
|
|
@@ -1707,6 +1757,56 @@
|
|
|
1707
1757
|
"type": "state"
|
|
1708
1758
|
}
|
|
1709
1759
|
},
|
|
1760
|
+
"ListBox": {
|
|
1761
|
+
"focus": {
|
|
1762
|
+
"description": "Currently only web has good support for this. Applies when an interactive component's focus handler is triggered, such as keyboard tabbing or selection.",
|
|
1763
|
+
"values": [
|
|
1764
|
+
true
|
|
1765
|
+
],
|
|
1766
|
+
"type": "state",
|
|
1767
|
+
"platforms": [
|
|
1768
|
+
"rn"
|
|
1769
|
+
]
|
|
1770
|
+
},
|
|
1771
|
+
"hover": {
|
|
1772
|
+
"description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
|
|
1773
|
+
"values": [
|
|
1774
|
+
true
|
|
1775
|
+
],
|
|
1776
|
+
"type": "state",
|
|
1777
|
+
"platforms": [
|
|
1778
|
+
"rn"
|
|
1779
|
+
]
|
|
1780
|
+
},
|
|
1781
|
+
"pressed": {
|
|
1782
|
+
"description": "Applies while an interactive component is being physically pressed. Most visible on touchscreen taps; in React Native Web, this is visible on web mouse clicks only if the pressable is held down.",
|
|
1783
|
+
"values": [
|
|
1784
|
+
true
|
|
1785
|
+
],
|
|
1786
|
+
"type": "state"
|
|
1787
|
+
},
|
|
1788
|
+
"expanded": {
|
|
1789
|
+
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
1790
|
+
"values": [
|
|
1791
|
+
true
|
|
1792
|
+
],
|
|
1793
|
+
"type": "state"
|
|
1794
|
+
},
|
|
1795
|
+
"current": {
|
|
1796
|
+
"description": "When the current item is selected",
|
|
1797
|
+
"values": [
|
|
1798
|
+
true
|
|
1799
|
+
],
|
|
1800
|
+
"type": "state"
|
|
1801
|
+
},
|
|
1802
|
+
"isChild": {
|
|
1803
|
+
"description": "when the item is child of another child",
|
|
1804
|
+
"values": [
|
|
1805
|
+
true
|
|
1806
|
+
],
|
|
1807
|
+
"type": "state"
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1710
1810
|
"Modal": {
|
|
1711
1811
|
"maxWidth": {
|
|
1712
1812
|
"description": "Whether a modal should expand responsively to the maximum of 8 layout columns width",
|
|
@@ -5148,14 +5248,11 @@
|
|
|
5148
5248
|
"docs": {
|
|
5149
5249
|
"description": "A pressable themeless base component that handles pressable states and passes tokens\nbased on these to an outer border and a base Card component. Not intended to be used in\napps or sites directly: build themed components on top of this.",
|
|
5150
5250
|
"props": {
|
|
5151
|
-
"
|
|
5251
|
+
"variant": {
|
|
5152
5252
|
"defaultValue": {
|
|
5153
|
-
"value": "
|
|
5253
|
+
"value": "{}",
|
|
5154
5254
|
"computed": false
|
|
5155
5255
|
},
|
|
5156
|
-
"required": false
|
|
5157
|
-
},
|
|
5158
|
-
"variant": {
|
|
5159
5256
|
"type": {
|
|
5160
5257
|
"name": "objectOf",
|
|
5161
5258
|
"value": {
|
|
@@ -5176,10 +5273,18 @@
|
|
|
5176
5273
|
"required": false,
|
|
5177
5274
|
"description": ""
|
|
5178
5275
|
},
|
|
5276
|
+
"accessibilityRole": {
|
|
5277
|
+
"defaultValue": {
|
|
5278
|
+
"value": "href ? 'link' : 'button'",
|
|
5279
|
+
"computed": false
|
|
5280
|
+
},
|
|
5281
|
+
"required": false
|
|
5282
|
+
},
|
|
5179
5283
|
"tokens": {
|
|
5180
5284
|
"type": {
|
|
5181
5285
|
"name": "custom",
|
|
5182
5286
|
"raw": {
|
|
5287
|
+
"icon": "icon",
|
|
5183
5288
|
"backgroundColor": "color",
|
|
5184
5289
|
"borderRadius": "radius",
|
|
5185
5290
|
"borderColor": "color",
|
|
@@ -12440,6 +12545,8 @@
|
|
|
12440
12545
|
"type": {
|
|
12441
12546
|
"name": "custom",
|
|
12442
12547
|
"raw": {
|
|
12548
|
+
"height": "size",
|
|
12549
|
+
"textLineHeight": "lineHeight",
|
|
12443
12550
|
"color": "color",
|
|
12444
12551
|
"outerBorderColor": "color",
|
|
12445
12552
|
"leftIcon": "icon",
|
|
@@ -12521,6 +12628,39 @@
|
|
|
12521
12628
|
"required": false,
|
|
12522
12629
|
"description": "When `icon` is provided, use `iconPosition` to place the Icon to the left or right side of Link."
|
|
12523
12630
|
},
|
|
12631
|
+
"iconProps": {
|
|
12632
|
+
"defaultValue": {
|
|
12633
|
+
"value": "{}",
|
|
12634
|
+
"computed": false
|
|
12635
|
+
},
|
|
12636
|
+
"type": {
|
|
12637
|
+
"name": "exact",
|
|
12638
|
+
"value": {
|
|
12639
|
+
"variant": {
|
|
12640
|
+
"name": "custom",
|
|
12641
|
+
"raw": "variantProp.propType",
|
|
12642
|
+
"required": false
|
|
12643
|
+
},
|
|
12644
|
+
"tokens": {
|
|
12645
|
+
"name": "custom",
|
|
12646
|
+
"raw": "getTokensPropType('Icon')",
|
|
12647
|
+
"required": false
|
|
12648
|
+
},
|
|
12649
|
+
"accessibilityLabel": {
|
|
12650
|
+
"name": "string",
|
|
12651
|
+
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
12652
|
+
"required": false
|
|
12653
|
+
},
|
|
12654
|
+
"scalesWithText": {
|
|
12655
|
+
"name": "bool",
|
|
12656
|
+
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
12657
|
+
"required": false
|
|
12658
|
+
}
|
|
12659
|
+
}
|
|
12660
|
+
},
|
|
12661
|
+
"required": false,
|
|
12662
|
+
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
12663
|
+
},
|
|
12524
12664
|
"tokens": {
|
|
12525
12665
|
"defaultValue": {
|
|
12526
12666
|
"value": "{}",
|
|
@@ -12580,35 +12720,6 @@
|
|
|
12580
12720
|
"required": false,
|
|
12581
12721
|
"description": ""
|
|
12582
12722
|
},
|
|
12583
|
-
"iconProps": {
|
|
12584
|
-
"type": {
|
|
12585
|
-
"name": "exact",
|
|
12586
|
-
"value": {
|
|
12587
|
-
"variant": {
|
|
12588
|
-
"name": "custom",
|
|
12589
|
-
"raw": "variantProp.propType",
|
|
12590
|
-
"required": false
|
|
12591
|
-
},
|
|
12592
|
-
"tokens": {
|
|
12593
|
-
"name": "custom",
|
|
12594
|
-
"raw": "getTokensPropType('Icon')",
|
|
12595
|
-
"required": false
|
|
12596
|
-
},
|
|
12597
|
-
"accessibilityLabel": {
|
|
12598
|
-
"name": "string",
|
|
12599
|
-
"description": "Descriptive label used in web SVG title tag for accessibility",
|
|
12600
|
-
"required": false
|
|
12601
|
-
},
|
|
12602
|
-
"scalesWithText": {
|
|
12603
|
-
"name": "bool",
|
|
12604
|
-
"description": "controls whether the icon size should be proportionate to any accessibility-related font scaling.",
|
|
12605
|
-
"required": false
|
|
12606
|
-
}
|
|
12607
|
-
}
|
|
12608
|
-
},
|
|
12609
|
-
"required": false,
|
|
12610
|
-
"description": "Optional variant that may be passed down to the link's icon if there is one"
|
|
12611
|
-
},
|
|
12612
12723
|
"icon": {
|
|
12613
12724
|
"type": {
|
|
12614
12725
|
"name": "elementType"
|
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
|
});
|
|
@@ -86,7 +86,7 @@ const selectInnerStyle = _ref2 => {
|
|
|
86
86
|
const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
87
87
|
let {
|
|
88
88
|
tokens,
|
|
89
|
-
variant,
|
|
89
|
+
variant = {},
|
|
90
90
|
icon: IconComponent,
|
|
91
91
|
href,
|
|
92
92
|
hrefAttrs,
|
|
@@ -134,7 +134,8 @@ const IconButton = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
134
134
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
|
|
135
135
|
icon: IconComponent,
|
|
136
136
|
title: selectedProps.accessibilityLabel,
|
|
137
|
-
tokens: (0, _utils.selectTokens)('Icon', themeTokens, 'icon')
|
|
137
|
+
tokens: (0, _utils.selectTokens)('Icon', themeTokens, 'icon'),
|
|
138
|
+
variant: variant
|
|
138
139
|
})
|
|
139
140
|
});
|
|
140
141
|
}
|
|
@@ -152,7 +153,7 @@ IconButton.propTypes = { ...selectedSystemPropTypes,
|
|
|
152
153
|
|
|
153
154
|
const staticStyles = _StyleSheet.default.create({
|
|
154
155
|
outer: {
|
|
155
|
-
alignSelf: '
|
|
156
|
+
alignSelf: 'baseline'
|
|
156
157
|
}
|
|
157
158
|
});
|
|
158
159
|
|
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
|
});
|
|
@@ -63,7 +63,7 @@ const selectInnerStyle = _ref2 => {
|
|
|
63
63
|
const IconButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
64
64
|
let {
|
|
65
65
|
tokens,
|
|
66
|
-
variant,
|
|
66
|
+
variant = {},
|
|
67
67
|
icon: IconComponent,
|
|
68
68
|
href,
|
|
69
69
|
hrefAttrs,
|
|
@@ -109,7 +109,8 @@ const IconButton = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
109
109
|
children: /*#__PURE__*/_jsx(Icon, {
|
|
110
110
|
icon: IconComponent,
|
|
111
111
|
title: selectedProps.accessibilityLabel,
|
|
112
|
-
tokens: selectTokens('Icon', themeTokens, 'icon')
|
|
112
|
+
tokens: selectTokens('Icon', themeTokens, 'icon'),
|
|
113
|
+
variant: variant
|
|
113
114
|
})
|
|
114
115
|
});
|
|
115
116
|
}
|
|
@@ -126,7 +127,7 @@ IconButton.propTypes = { ...selectedSystemPropTypes,
|
|
|
126
127
|
};
|
|
127
128
|
const staticStyles = StyleSheet.create({
|
|
128
129
|
outer: {
|
|
129
|
-
alignSelf: '
|
|
130
|
+
alignSelf: 'baseline'
|
|
130
131
|
}
|
|
131
132
|
});
|
|
132
133
|
export default withLinkRouter(IconButton);
|
|
@@ -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.22.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.37.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
|
}
|
|
@@ -54,7 +54,7 @@ const IconButton = forwardRef(
|
|
|
54
54
|
(
|
|
55
55
|
{
|
|
56
56
|
tokens,
|
|
57
|
-
variant,
|
|
57
|
+
variant = {},
|
|
58
58
|
icon: IconComponent,
|
|
59
59
|
href,
|
|
60
60
|
hrefAttrs,
|
|
@@ -93,6 +93,7 @@ const IconButton = forwardRef(
|
|
|
93
93
|
icon={IconComponent}
|
|
94
94
|
title={selectedProps.accessibilityLabel}
|
|
95
95
|
tokens={selectTokens('Icon', themeTokens, 'icon')}
|
|
96
|
+
variant={variant}
|
|
96
97
|
/>
|
|
97
98
|
</View>
|
|
98
99
|
)
|
|
@@ -115,7 +116,7 @@ IconButton.propTypes = {
|
|
|
115
116
|
|
|
116
117
|
const staticStyles = StyleSheet.create({
|
|
117
118
|
outer: {
|
|
118
|
-
alignSelf: '
|
|
119
|
+
alignSelf: 'baseline'
|
|
119
120
|
}
|
|
120
121
|
})
|
|
121
122
|
|
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
|
|