@telus-uds/components-base 1.38.0 → 1.40.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 +22 -2
- package/component-docs.json +182 -11
- package/lib/A11yInfoProvider/index.js +0 -8
- package/lib/Link/ChevronLink.js +5 -2
- package/lib/Link/LinkBase.js +3 -8
- package/lib/List/ListItem.js +3 -10
- package/lib/List/ListItemBase.js +25 -4
- package/lib/Typography/Typography.js +14 -0
- package/lib-module/A11yInfoProvider/index.js +0 -7
- package/lib-module/Link/ChevronLink.js +5 -2
- package/lib-module/Link/LinkBase.js +3 -8
- package/lib-module/List/ListItem.js +3 -10
- package/lib-module/List/ListItemBase.js +24 -5
- package/lib-module/Typography/Typography.js +14 -0
- package/package.json +2 -2
- package/src/A11yInfoProvider/index.jsx +0 -10
- package/src/Link/ChevronLink.jsx +14 -4
- package/src/Link/LinkBase.jsx +2 -3
- package/src/List/ListItem.jsx +1 -3
- package/src/List/ListItemBase.jsx +20 -4
- package/src/Typography/Typography.jsx +13 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Change Log - @telus-uds/components-base
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 09 May 2023 00:20:29 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 1.40.0
|
|
8
|
+
|
|
9
|
+
Tue, 09 May 2023 00:20:29 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Added 'strikeThrough' property (kyle.king2@telus.com)
|
|
14
|
+
- remove screenReaderChanged event from A11yInfoProvider and event tracking (mauricio.batresmontejo@telus.com)
|
|
15
|
+
- Bump @telus-uds/system-theme-tokens to v2.25.0
|
|
16
|
+
|
|
17
|
+
## 1.39.0
|
|
18
|
+
|
|
19
|
+
Mon, 01 May 2023 22:09:07 GMT
|
|
20
|
+
|
|
21
|
+
### Minor changes
|
|
22
|
+
|
|
23
|
+
- added adjustments to IconText (kyle.king2@telus.com)
|
|
24
|
+
- list component standardization (akshay.pandey1@telus.com)
|
|
25
|
+
- Bump @telus-uds/system-theme-tokens to v2.24.0
|
|
26
|
+
|
|
7
27
|
## 1.38.0
|
|
8
28
|
|
|
9
|
-
Thu, 27 Apr 2023 14:
|
|
29
|
+
Thu, 27 Apr 2023 14:41:57 GMT
|
|
10
30
|
|
|
11
31
|
### Minor changes
|
|
12
32
|
|
package/component-docs.json
CHANGED
|
@@ -23,6 +23,39 @@
|
|
|
23
23
|
"detailsContainerPadding": "size",
|
|
24
24
|
"playIconContainerBackground": "color"
|
|
25
25
|
},
|
|
26
|
+
"VideoPickerThumbnail": {
|
|
27
|
+
"splashButtonRadius": "radius",
|
|
28
|
+
"borderWidth": "border",
|
|
29
|
+
"borderColor": "color",
|
|
30
|
+
"borderRadius": "radius",
|
|
31
|
+
"pressablePaddingVertical": "size",
|
|
32
|
+
"pressablePaddingHorizontal": "size",
|
|
33
|
+
"pressableBorderTopWidth": "border",
|
|
34
|
+
"pressableBorderTopColor": "color",
|
|
35
|
+
"pressablePaddingBottom": "size",
|
|
36
|
+
"titleColor": "color",
|
|
37
|
+
"subTitleColor": "color"
|
|
38
|
+
},
|
|
39
|
+
"VideoPickerSlider": {
|
|
40
|
+
"previousIcon": "icon",
|
|
41
|
+
"nextIcon": "icon"
|
|
42
|
+
},
|
|
43
|
+
"VideoPicker": {
|
|
44
|
+
"framedMaxHeight": "size",
|
|
45
|
+
"framedContainerBackgroundColor": "color",
|
|
46
|
+
"framedContainerBorderWidth": "border",
|
|
47
|
+
"framedContainerBorderColor": "color",
|
|
48
|
+
"framedContainerBorderRadius": "radius",
|
|
49
|
+
"framedContainerPadding": "size",
|
|
50
|
+
"stackViewDividerColor": "color"
|
|
51
|
+
},
|
|
52
|
+
"Disclaimer": {
|
|
53
|
+
"color": "color",
|
|
54
|
+
"fontName": "fontName",
|
|
55
|
+
"fontWeight": "fontWeight",
|
|
56
|
+
"fontSize": "fontSize",
|
|
57
|
+
"lineHeight": "lineHeight"
|
|
58
|
+
},
|
|
26
59
|
"Table": {
|
|
27
60
|
"tablePaddingBottom": "size",
|
|
28
61
|
"cellHeadingBackground": "color",
|
|
@@ -35,7 +68,10 @@
|
|
|
35
68
|
"cellPaddingTop": "size",
|
|
36
69
|
"cellPaddingRight": "size",
|
|
37
70
|
"cellPaddingLeft": "size",
|
|
38
|
-
"cellPaddingBottom": "size"
|
|
71
|
+
"cellPaddingBottom": "size",
|
|
72
|
+
"fontWeight": "fontWeight",
|
|
73
|
+
"fontName": "fontName",
|
|
74
|
+
"fontSize": "fontSize"
|
|
39
75
|
},
|
|
40
76
|
"Image": {
|
|
41
77
|
"borderRadius": "radius"
|
|
@@ -121,7 +157,10 @@
|
|
|
121
157
|
"FootnoteLink": {
|
|
122
158
|
"lineHeight": "lineHeight",
|
|
123
159
|
"paddingLeft": "size",
|
|
124
|
-
"paddingRight": "size"
|
|
160
|
+
"paddingRight": "size",
|
|
161
|
+
"color": "color",
|
|
162
|
+
"fontName": "fontName",
|
|
163
|
+
"fontWeight": "fontWeight"
|
|
125
164
|
},
|
|
126
165
|
"WaffleGrid": {
|
|
127
166
|
"rowBorderWidth": "border",
|
|
@@ -166,9 +205,12 @@
|
|
|
166
205
|
"closeButtonMarginRight": "size",
|
|
167
206
|
"closeButtonMarginBottom": "size",
|
|
168
207
|
"closeButtonWidth": "size",
|
|
169
|
-
"closeButtonIconSize": "size"
|
|
208
|
+
"closeButtonIconSize": "size",
|
|
209
|
+
"closeIcon": "icon"
|
|
170
210
|
},
|
|
171
211
|
"PriceLockup": {
|
|
212
|
+
"fontName": "fontName",
|
|
213
|
+
"fontWeight": "fontWeight",
|
|
172
214
|
"footnoteMarginTop": "size",
|
|
173
215
|
"footnoteGap": "size",
|
|
174
216
|
"bottomTextMarginTop": "size",
|
|
@@ -176,9 +218,36 @@
|
|
|
176
218
|
"bottomLinksMarginLeft": "size",
|
|
177
219
|
"topTextMarginBottom": "size",
|
|
178
220
|
"strikeThroughHeight": "size",
|
|
179
|
-
"
|
|
221
|
+
"strikeThroughColor": "color",
|
|
180
222
|
"fontColor": "color",
|
|
181
|
-
"dividerColor": "color"
|
|
223
|
+
"dividerColor": "color",
|
|
224
|
+
"topTextFontSize": "fontSize",
|
|
225
|
+
"topTextLineHeight": "lineHeight",
|
|
226
|
+
"currencySymbolFontSize": "fontSize",
|
|
227
|
+
"currencySymbolLineHeight": "lineHeight",
|
|
228
|
+
"currencySymbolFontName": "fontName",
|
|
229
|
+
"currencySymbolFontWeight": "fontWeight",
|
|
230
|
+
"amountFontSize": "fontSize",
|
|
231
|
+
"amountLineHeight": "lineHeight",
|
|
232
|
+
"amountLetterSpacing": "letterSpacing",
|
|
233
|
+
"amountFontWeight": "fontWeight",
|
|
234
|
+
"amountFontName": "fontName",
|
|
235
|
+
"centsFontSize": "fontSize",
|
|
236
|
+
"centsLineHeight": "lineHeight",
|
|
237
|
+
"centsFontName": "fontName",
|
|
238
|
+
"centsFontWeight": "fontWeight",
|
|
239
|
+
"topTextFontName": "fontName",
|
|
240
|
+
"topTextFontWeight": "fontWeight",
|
|
241
|
+
"rateFontSize": "fontSize",
|
|
242
|
+
"rateLineHeight": "lineHeight",
|
|
243
|
+
"rateFontName": "fontName",
|
|
244
|
+
"rateFontWeight": "fontWeight",
|
|
245
|
+
"bottomTextFontSize": "fontSize",
|
|
246
|
+
"bottomTextLineHeight": "lineHeight",
|
|
247
|
+
"footnoteLinkColor": "color",
|
|
248
|
+
"footnoteLinkFontName": "fontName",
|
|
249
|
+
"footnoteLinkFontWeight": "fontWeight",
|
|
250
|
+
"footnoteLinkFontSize": "fontSize"
|
|
182
251
|
},
|
|
183
252
|
"ActivityIndicator": {
|
|
184
253
|
"size": "size",
|
|
@@ -414,7 +483,7 @@
|
|
|
414
483
|
"labelMarginLeft": "size"
|
|
415
484
|
},
|
|
416
485
|
"ChevronLink": {
|
|
417
|
-
"
|
|
486
|
+
"fontSize": "fontSize",
|
|
418
487
|
"textLineHeight": "lineHeight",
|
|
419
488
|
"color": "color",
|
|
420
489
|
"outerBorderColor": "color",
|
|
@@ -718,6 +787,32 @@
|
|
|
718
787
|
"closeIconSize": "size",
|
|
719
788
|
"closePadding": "size"
|
|
720
789
|
},
|
|
790
|
+
"NavigationBar": {
|
|
791
|
+
"alignSelf": "flexAlign",
|
|
792
|
+
"backgroundColor": "color",
|
|
793
|
+
"borderColor": "color",
|
|
794
|
+
"borderRadius": "radius",
|
|
795
|
+
"borderWidth": "border",
|
|
796
|
+
"color": "color",
|
|
797
|
+
"fontName": "fontName",
|
|
798
|
+
"fontSize": "fontSize",
|
|
799
|
+
"fontWeight": "fontWeight",
|
|
800
|
+
"lineHeight": "lineHeight",
|
|
801
|
+
"minWidth": "size",
|
|
802
|
+
"opacity": "opacity",
|
|
803
|
+
"outerBackgroundColor": "color",
|
|
804
|
+
"outerBorderColor": "color",
|
|
805
|
+
"outerBorderGap": "size",
|
|
806
|
+
"outerBorderWidth": "border",
|
|
807
|
+
"paddingBottom": "size",
|
|
808
|
+
"paddingLeft": "size",
|
|
809
|
+
"paddingRight": "size",
|
|
810
|
+
"paddingTop": "size",
|
|
811
|
+
"shadow": "shadow",
|
|
812
|
+
"textAlign": "flexJustifyContent",
|
|
813
|
+
"width": "size",
|
|
814
|
+
"icoMenu": "icon"
|
|
815
|
+
},
|
|
721
816
|
"Notification": {
|
|
722
817
|
"backgroundColor": "color",
|
|
723
818
|
"borderBottomWidth": "border",
|
|
@@ -1001,7 +1096,10 @@
|
|
|
1001
1096
|
"curveWidth": "size",
|
|
1002
1097
|
"curveAfterBackgroundColor": "color",
|
|
1003
1098
|
"curveAfterHeight": "size",
|
|
1004
|
-
"gradient": "gradient"
|
|
1099
|
+
"gradient": "gradient",
|
|
1100
|
+
"fontColor": "color",
|
|
1101
|
+
"borderRadiusBottomLeft": "size",
|
|
1102
|
+
"borderRadiusBottomRight": "size"
|
|
1005
1103
|
},
|
|
1006
1104
|
"Search": {
|
|
1007
1105
|
"backgroundColor": "color",
|
|
@@ -1360,9 +1458,7 @@
|
|
|
1360
1458
|
"animationColorBefore": "color",
|
|
1361
1459
|
"animationColorAfter": "color",
|
|
1362
1460
|
"animationDivColorBefore": "color",
|
|
1363
|
-
"animationDivColorAfter": "color"
|
|
1364
|
-
"animationFillColorBefore": "color",
|
|
1365
|
-
"animationFillColorAfter": "color"
|
|
1461
|
+
"animationDivColorAfter": "color"
|
|
1366
1462
|
},
|
|
1367
1463
|
"ToggleSwitch": {
|
|
1368
1464
|
"borderColor": "color",
|
|
@@ -1410,8 +1506,14 @@
|
|
|
1410
1506
|
"flexShrink": "integer"
|
|
1411
1507
|
},
|
|
1412
1508
|
"Breadcrumbs": {
|
|
1509
|
+
"fontWeight": "fontWeight",
|
|
1510
|
+
"fontName": "fontName",
|
|
1511
|
+
"fontSize": "fontSize",
|
|
1512
|
+
"color": "color",
|
|
1513
|
+
"currentColor": "color",
|
|
1413
1514
|
"icon": "icon",
|
|
1414
1515
|
"iconColor": "color",
|
|
1516
|
+
"iconSize": "size",
|
|
1415
1517
|
"iconPadding": "size",
|
|
1416
1518
|
"listItemPadding": "size"
|
|
1417
1519
|
},
|
|
@@ -2021,6 +2123,60 @@
|
|
|
2021
2123
|
"type": "state"
|
|
2022
2124
|
}
|
|
2023
2125
|
},
|
|
2126
|
+
"NavigationBar": {
|
|
2127
|
+
"focus": {
|
|
2128
|
+
"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.",
|
|
2129
|
+
"values": [
|
|
2130
|
+
true
|
|
2131
|
+
],
|
|
2132
|
+
"type": "state",
|
|
2133
|
+
"platforms": [
|
|
2134
|
+
"rn"
|
|
2135
|
+
]
|
|
2136
|
+
},
|
|
2137
|
+
"pressed": {
|
|
2138
|
+
"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.",
|
|
2139
|
+
"values": [
|
|
2140
|
+
true
|
|
2141
|
+
],
|
|
2142
|
+
"type": "state"
|
|
2143
|
+
},
|
|
2144
|
+
"hover": {
|
|
2145
|
+
"description": "Currently web only. Applies when an interactive component's hover handler is triggered, such as on mouseover.",
|
|
2146
|
+
"values": [
|
|
2147
|
+
true
|
|
2148
|
+
],
|
|
2149
|
+
"type": "state",
|
|
2150
|
+
"platforms": [
|
|
2151
|
+
"rn"
|
|
2152
|
+
]
|
|
2153
|
+
},
|
|
2154
|
+
"selected": {
|
|
2155
|
+
"description": "Applies while an interactive component is the currently selected one in a set of states or components, for example a button in a `ButtonGroup`.",
|
|
2156
|
+
"values": [
|
|
2157
|
+
true
|
|
2158
|
+
],
|
|
2159
|
+
"type": "state"
|
|
2160
|
+
},
|
|
2161
|
+
"expanded": {
|
|
2162
|
+
"description": "Applies when an ExpandCollapse panel is open and the content inside is visible",
|
|
2163
|
+
"values": [
|
|
2164
|
+
true
|
|
2165
|
+
],
|
|
2166
|
+
"type": "state"
|
|
2167
|
+
},
|
|
2168
|
+
"viewport": {
|
|
2169
|
+
"description": "The size label for the current screen viewport based on the current screen width",
|
|
2170
|
+
"values": [
|
|
2171
|
+
"xs",
|
|
2172
|
+
"sm",
|
|
2173
|
+
"md",
|
|
2174
|
+
"lg",
|
|
2175
|
+
"xl"
|
|
2176
|
+
],
|
|
2177
|
+
"type": "state"
|
|
2178
|
+
}
|
|
2179
|
+
},
|
|
2024
2180
|
"Notification": {
|
|
2025
2181
|
"system": {
|
|
2026
2182
|
"values": [
|
|
@@ -10300,6 +10456,17 @@
|
|
|
10300
10456
|
"required": false,
|
|
10301
10457
|
"description": "Works the same as css text-align, note that RN doesn't support \"start\" or \"end\" (see https://reactnative.dev/docs/text-style-props#textalign)\nJustify is known to make text harder to read, especially for people with dyslexia (see https://developer.mozilla.org/en-US/docs/Web/CSS/text-align#accessibility_concerns)"
|
|
10302
10458
|
},
|
|
10459
|
+
"strikeThrough": {
|
|
10460
|
+
"defaultValue": {
|
|
10461
|
+
"value": "false",
|
|
10462
|
+
"computed": false
|
|
10463
|
+
},
|
|
10464
|
+
"type": {
|
|
10465
|
+
"name": "bool"
|
|
10466
|
+
},
|
|
10467
|
+
"required": false,
|
|
10468
|
+
"description": "Renders the text with \"text-decoration: 'line-through'\" applied."
|
|
10469
|
+
},
|
|
10303
10470
|
"tokens": {
|
|
10304
10471
|
"type": {
|
|
10305
10472
|
"name": "custom",
|
|
@@ -12810,10 +12977,14 @@
|
|
|
12810
12977
|
"description": ""
|
|
12811
12978
|
},
|
|
12812
12979
|
"tokens": {
|
|
12980
|
+
"defaultValue": {
|
|
12981
|
+
"value": "{}",
|
|
12982
|
+
"computed": false
|
|
12983
|
+
},
|
|
12813
12984
|
"type": {
|
|
12814
12985
|
"name": "custom",
|
|
12815
12986
|
"raw": {
|
|
12816
|
-
"
|
|
12987
|
+
"fontSize": "fontSize",
|
|
12817
12988
|
"textLineHeight": "lineHeight",
|
|
12818
12989
|
"color": "color",
|
|
12819
12990
|
"outerBorderColor": "color",
|
|
@@ -39,8 +39,6 @@ const A11yInfoProvider = _ref => {
|
|
|
39
39
|
|
|
40
40
|
const motionSubscription = _AccessibilityInfo.default.addEventListener('reduceMotionChanged', setReduceMotionEnabled);
|
|
41
41
|
|
|
42
|
-
const screenReaderSubscription = _AccessibilityInfo.default.addEventListener('screenReaderChanged', setScreenReaderEnabled);
|
|
43
|
-
|
|
44
42
|
const setInitialA11yInfo = async () => {
|
|
45
43
|
const [initialReduceMotionEnabled, initialScreenReaderEnabled] = await Promise.all([_AccessibilityInfo.default.isReduceMotionEnabled(), _AccessibilityInfo.default.isScreenReaderEnabled()]); // Browsers can't detect screen readers; in RNW isScreenReaderEnabled() is always `true`
|
|
46
44
|
// https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/AccessibilityInfo/index.js#L14
|
|
@@ -61,12 +59,6 @@ const A11yInfoProvider = _ref => {
|
|
|
61
59
|
} else if (typeof _AccessibilityInfo.default.removeEventListener === 'function') {
|
|
62
60
|
_AccessibilityInfo.default.removeEventListener('reduceMotionChanged', setReduceMotionEnabled);
|
|
63
61
|
}
|
|
64
|
-
|
|
65
|
-
if (typeof (screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove) === 'function') {
|
|
66
|
-
screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove();
|
|
67
|
-
} else if (typeof _AccessibilityInfo.default.removeEventListener === 'function') {
|
|
68
|
-
_AccessibilityInfo.default.removeEventListener('screenReaderChanged', setScreenReaderEnabled);
|
|
69
|
-
}
|
|
70
62
|
};
|
|
71
63
|
}, []);
|
|
72
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ReducedMotionContext.Provider, {
|
package/lib/Link/ChevronLink.js
CHANGED
|
@@ -33,7 +33,7 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
33
33
|
let {
|
|
34
34
|
direction = 'right',
|
|
35
35
|
children,
|
|
36
|
-
tokens,
|
|
36
|
+
tokens = {},
|
|
37
37
|
variant,
|
|
38
38
|
dataSet,
|
|
39
39
|
...linkProps
|
|
@@ -47,10 +47,13 @@ const ChevronLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
47
47
|
iconDisplace,
|
|
48
48
|
height,
|
|
49
49
|
textLineHeight,
|
|
50
|
+
fontSize,
|
|
50
51
|
...otherTokens
|
|
51
52
|
} = getChevronTokens(linkState);
|
|
52
|
-
|
|
53
|
+
const linkTokens = (0, _utils.selectTokens)('Link', otherTokens);
|
|
54
|
+
return { ...linkTokens,
|
|
53
55
|
height,
|
|
56
|
+
blockFontSize: tokens.fontSize ?? fontSize,
|
|
54
57
|
textLineHeight,
|
|
55
58
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
56
59
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
package/lib/Link/LinkBase.js
CHANGED
|
@@ -204,15 +204,10 @@ const LinkBase = /*#__PURE__*/(0, _react.forwardRef)((_ref6, ref) => {
|
|
|
204
204
|
,
|
|
205
205
|
ref: ref,
|
|
206
206
|
style: linkState => {
|
|
207
|
-
const
|
|
208
|
-
height,
|
|
209
|
-
...themeTokens
|
|
210
|
-
} = resolveLinkTokens(linkState);
|
|
207
|
+
const themeTokens = resolveLinkTokens(linkState);
|
|
211
208
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
212
209
|
const decorationStyles = selectDecorationStyles(themeTokens);
|
|
213
|
-
return [
|
|
214
|
-
height
|
|
215
|
-
} : {}, outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
210
|
+
return [outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
216
211
|
},
|
|
217
212
|
children: linkState => {
|
|
218
213
|
const themeTokens = resolveLinkTokens(linkState);
|
|
@@ -278,7 +273,7 @@ const staticStyles = _StyleSheet.default.create({
|
|
|
278
273
|
justifyContent: 'flex-start'
|
|
279
274
|
},
|
|
280
275
|
baseline: {
|
|
281
|
-
alignSelf: '
|
|
276
|
+
alignSelf: 'baseline'
|
|
282
277
|
}
|
|
283
278
|
});
|
|
284
279
|
|
package/lib/List/ListItem.js
CHANGED
|
@@ -9,8 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _ListItemBase = _interopRequireDefault(require("./ListItemBase"));
|
|
11
11
|
|
|
12
|
-
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
13
|
-
|
|
14
12
|
var _ThemeProvider = require("../ThemeProvider");
|
|
15
13
|
|
|
16
14
|
var _utils = require("../utils");
|
|
@@ -35,17 +33,12 @@ const ListItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
35
33
|
...listItemProps
|
|
36
34
|
} = _ref;
|
|
37
35
|
const themeTokens = (0, _ThemeProvider.useThemeTokens)('List', tokens, variant);
|
|
38
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemBase.default, {
|
|
39
37
|
tokens: themeTokens,
|
|
40
38
|
ref: ref,
|
|
41
39
|
...listItemProps,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
size: 'h4',
|
|
45
|
-
bold: true
|
|
46
|
-
},
|
|
47
|
-
children: title
|
|
48
|
-
}), children]
|
|
40
|
+
title: title,
|
|
41
|
+
children: children
|
|
49
42
|
});
|
|
50
43
|
});
|
|
51
44
|
ListItem.displayName = 'ListItem';
|
package/lib/List/ListItemBase.js
CHANGED
|
@@ -21,6 +21,8 @@ var _ListItemContent = _interopRequireDefault(require("./ListItemContent"));
|
|
|
21
21
|
|
|
22
22
|
var _ListItemMark = _interopRequireDefault(require("./ListItemMark"));
|
|
23
23
|
|
|
24
|
+
var _Typography = _interopRequireDefault(require("../Typography"));
|
|
25
|
+
|
|
24
26
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
25
27
|
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -66,6 +68,7 @@ const ListItemBase = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
66
68
|
iconSize,
|
|
67
69
|
showDivider,
|
|
68
70
|
children,
|
|
71
|
+
title,
|
|
69
72
|
isLastItem,
|
|
70
73
|
accessibilityRole = _Platform.default.select({
|
|
71
74
|
web: 'listitem',
|
|
@@ -105,15 +108,30 @@ const ListItemBase = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
|
|
|
105
108
|
iconColor,
|
|
106
109
|
iconSize,
|
|
107
110
|
isLastItem
|
|
108
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
111
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
112
|
+
style: [{
|
|
113
|
+
flexDirection: 'row',
|
|
114
|
+
flex: 'wrap'
|
|
115
|
+
}, !title && {
|
|
116
|
+
alignItems: 'center'
|
|
117
|
+
}],
|
|
109
118
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemMark.default, {
|
|
110
119
|
tokens: tokens,
|
|
111
120
|
icon: icon,
|
|
112
121
|
iconColor: iconColor,
|
|
113
122
|
iconSize: iconSize
|
|
114
|
-
}), /*#__PURE__*/(0, _jsxRuntime.
|
|
115
|
-
|
|
116
|
-
children:
|
|
123
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
|
|
124
|
+
style: staticStyles.titleAndContentContainer,
|
|
125
|
+
children: [Boolean(title) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
126
|
+
variant: {
|
|
127
|
+
size: 'h4',
|
|
128
|
+
bold: true
|
|
129
|
+
},
|
|
130
|
+
children: title
|
|
131
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ListItemContent.default, {
|
|
132
|
+
tokens: tokens,
|
|
133
|
+
children: children
|
|
134
|
+
})]
|
|
117
135
|
})]
|
|
118
136
|
})
|
|
119
137
|
});
|
|
@@ -123,6 +141,9 @@ ListItemBase.displayName = 'ListItem';
|
|
|
123
141
|
const staticStyles = _StyleSheet.default.create({
|
|
124
142
|
itemContainer: {
|
|
125
143
|
flexDirection: 'row'
|
|
144
|
+
},
|
|
145
|
+
titleAndContentContainer: {
|
|
146
|
+
flexDirection: 'column'
|
|
126
147
|
}
|
|
127
148
|
});
|
|
128
149
|
|
|
@@ -71,6 +71,7 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
71
71
|
align = undefined,
|
|
72
72
|
tokens,
|
|
73
73
|
dataSet,
|
|
74
|
+
strikeThrough = false,
|
|
74
75
|
...rest
|
|
75
76
|
} = _ref2;
|
|
76
77
|
const viewport = (0, _ViewportProvider.useViewport)();
|
|
@@ -117,16 +118,24 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
|
|
|
117
118
|
return resetTagStyling(children);
|
|
118
119
|
};
|
|
119
120
|
|
|
121
|
+
const textDecorationLine = strikeThrough ? 'line-through' : 'none';
|
|
122
|
+
const textStyles = resolvedTextProps.style ? { ...resolvedTextProps.style,
|
|
123
|
+
textDecorationLine
|
|
124
|
+
} : {
|
|
125
|
+
textDecorationLine
|
|
126
|
+
};
|
|
120
127
|
return block ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
|
|
121
128
|
ref: ref,
|
|
122
129
|
...containerProps,
|
|
123
130
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, { ...resolvedTextProps,
|
|
131
|
+
style: textStyles,
|
|
124
132
|
children: sanitizeChildren(children)
|
|
125
133
|
})
|
|
126
134
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
|
|
127
135
|
ref: ref,
|
|
128
136
|
...containerProps,
|
|
129
137
|
...resolvedTextProps,
|
|
138
|
+
style: textStyles,
|
|
130
139
|
children: sanitizeChildren(children)
|
|
131
140
|
});
|
|
132
141
|
});
|
|
@@ -136,6 +145,11 @@ Typography.propTypes = { ...selectedContainerPropTypes,
|
|
|
136
145
|
tokens: (0, _utils2.getTokensPropType)('Typography'),
|
|
137
146
|
variant: _utils2.variantProp.propType,
|
|
138
147
|
|
|
148
|
+
/**
|
|
149
|
+
* Renders the text with "text-decoration: 'line-through'" applied.
|
|
150
|
+
*/
|
|
151
|
+
strikeThrough: _propTypes.default.bool,
|
|
152
|
+
|
|
139
153
|
/**
|
|
140
154
|
* Renders the text as a semantic heading. If a html heading tag is provided, uses that tag on Web.
|
|
141
155
|
*
|
|
@@ -20,7 +20,6 @@ const A11yInfoProvider = _ref => {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const motionSubscription = AccessibilityInfo.addEventListener('reduceMotionChanged', setReduceMotionEnabled);
|
|
23
|
-
const screenReaderSubscription = AccessibilityInfo.addEventListener('screenReaderChanged', setScreenReaderEnabled);
|
|
24
23
|
|
|
25
24
|
const setInitialA11yInfo = async () => {
|
|
26
25
|
const [initialReduceMotionEnabled, initialScreenReaderEnabled] = await Promise.all([AccessibilityInfo.isReduceMotionEnabled(), AccessibilityInfo.isScreenReaderEnabled()]); // Browsers can't detect screen readers; in RNW isScreenReaderEnabled() is always `true`
|
|
@@ -42,12 +41,6 @@ const A11yInfoProvider = _ref => {
|
|
|
42
41
|
} else if (typeof AccessibilityInfo.removeEventListener === 'function') {
|
|
43
42
|
AccessibilityInfo.removeEventListener('reduceMotionChanged', setReduceMotionEnabled);
|
|
44
43
|
}
|
|
45
|
-
|
|
46
|
-
if (typeof (screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove) === 'function') {
|
|
47
|
-
screenReaderSubscription === null || screenReaderSubscription === void 0 ? void 0 : screenReaderSubscription.remove();
|
|
48
|
-
} else if (typeof AccessibilityInfo.removeEventListener === 'function') {
|
|
49
|
-
AccessibilityInfo.removeEventListener('screenReaderChanged', setScreenReaderEnabled);
|
|
50
|
-
}
|
|
51
44
|
};
|
|
52
45
|
}, []);
|
|
53
46
|
return /*#__PURE__*/_jsx(ReducedMotionContext.Provider, {
|
|
@@ -15,7 +15,7 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
15
15
|
let {
|
|
16
16
|
direction = 'right',
|
|
17
17
|
children,
|
|
18
|
-
tokens,
|
|
18
|
+
tokens = {},
|
|
19
19
|
variant,
|
|
20
20
|
dataSet,
|
|
21
21
|
...linkProps
|
|
@@ -29,10 +29,13 @@ const ChevronLink = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
29
29
|
iconDisplace,
|
|
30
30
|
height,
|
|
31
31
|
textLineHeight,
|
|
32
|
+
fontSize,
|
|
32
33
|
...otherTokens
|
|
33
34
|
} = getChevronTokens(linkState);
|
|
34
|
-
|
|
35
|
+
const linkTokens = selectTokens('Link', otherTokens);
|
|
36
|
+
return { ...linkTokens,
|
|
35
37
|
height,
|
|
38
|
+
blockFontSize: tokens.fontSize ?? fontSize,
|
|
36
39
|
textLineHeight,
|
|
37
40
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
38
41
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
|
@@ -176,15 +176,10 @@ const LinkBase = /*#__PURE__*/forwardRef((_ref6, ref) => {
|
|
|
176
176
|
,
|
|
177
177
|
ref: ref,
|
|
178
178
|
style: linkState => {
|
|
179
|
-
const
|
|
180
|
-
height,
|
|
181
|
-
...themeTokens
|
|
182
|
-
} = resolveLinkTokens(linkState);
|
|
179
|
+
const themeTokens = resolveLinkTokens(linkState);
|
|
183
180
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens);
|
|
184
181
|
const decorationStyles = selectDecorationStyles(themeTokens);
|
|
185
|
-
return [
|
|
186
|
-
height
|
|
187
|
-
} : {}, outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
182
|
+
return [outerBorderStyles, blockLeftStyle, decorationStyles, hasIcon && staticStyles.rowContainer];
|
|
188
183
|
},
|
|
189
184
|
children: linkState => {
|
|
190
185
|
const themeTokens = resolveLinkTokens(linkState);
|
|
@@ -249,7 +244,7 @@ const staticStyles = StyleSheet.create({
|
|
|
249
244
|
justifyContent: 'flex-start'
|
|
250
245
|
},
|
|
251
246
|
baseline: {
|
|
252
|
-
alignSelf: '
|
|
247
|
+
alignSelf: 'baseline'
|
|
253
248
|
}
|
|
254
249
|
});
|
|
255
250
|
export default withLinkRouter(LinkBase);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import ListItemBase from './ListItemBase';
|
|
3
|
-
import Typography from '../Typography';
|
|
4
3
|
import { useThemeTokens } from '../ThemeProvider';
|
|
5
4
|
import { variantProp } from '../utils';
|
|
6
5
|
/**
|
|
@@ -8,7 +7,6 @@ import { variantProp } from '../utils';
|
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
10
|
const ListItem = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
13
11
|
let {
|
|
14
12
|
tokens,
|
|
@@ -18,17 +16,12 @@ const ListItem = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
18
16
|
...listItemProps
|
|
19
17
|
} = _ref;
|
|
20
18
|
const themeTokens = useThemeTokens('List', tokens, variant);
|
|
21
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/_jsx(ListItemBase, {
|
|
22
20
|
tokens: themeTokens,
|
|
23
21
|
ref: ref,
|
|
24
22
|
...listItemProps,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
size: 'h4',
|
|
28
|
-
bold: true
|
|
29
|
-
},
|
|
30
|
-
children: title
|
|
31
|
-
}), children]
|
|
23
|
+
title: title,
|
|
24
|
+
children: children
|
|
32
25
|
});
|
|
33
26
|
});
|
|
34
27
|
ListItem.displayName = 'ListItem';
|
|
@@ -6,8 +6,8 @@ import PropTypes from 'prop-types';
|
|
|
6
6
|
import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps } from '../utils';
|
|
7
7
|
import ListItemContent from './ListItemContent';
|
|
8
8
|
import ListItemMark from './ListItemMark';
|
|
9
|
+
import Typography from '../Typography';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
|
|
13
13
|
|
|
@@ -46,6 +46,7 @@ const ListItemBase = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
46
46
|
iconSize,
|
|
47
47
|
showDivider,
|
|
48
48
|
children,
|
|
49
|
+
title,
|
|
49
50
|
isLastItem,
|
|
50
51
|
accessibilityRole = Platform.select({
|
|
51
52
|
web: 'listitem',
|
|
@@ -85,15 +86,30 @@ const ListItemBase = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
85
86
|
iconColor,
|
|
86
87
|
iconSize,
|
|
87
88
|
isLastItem
|
|
88
|
-
}) : /*#__PURE__*/_jsxs(
|
|
89
|
+
}) : /*#__PURE__*/_jsxs(View, {
|
|
90
|
+
style: [{
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
flex: 'wrap'
|
|
93
|
+
}, !title && {
|
|
94
|
+
alignItems: 'center'
|
|
95
|
+
}],
|
|
89
96
|
children: [/*#__PURE__*/_jsx(ListItemMark, {
|
|
90
97
|
tokens: tokens,
|
|
91
98
|
icon: icon,
|
|
92
99
|
iconColor: iconColor,
|
|
93
100
|
iconSize: iconSize
|
|
94
|
-
}), /*#__PURE__*/
|
|
95
|
-
|
|
96
|
-
children:
|
|
101
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
102
|
+
style: staticStyles.titleAndContentContainer,
|
|
103
|
+
children: [Boolean(title) && /*#__PURE__*/_jsx(Typography, {
|
|
104
|
+
variant: {
|
|
105
|
+
size: 'h4',
|
|
106
|
+
bold: true
|
|
107
|
+
},
|
|
108
|
+
children: title
|
|
109
|
+
}), /*#__PURE__*/_jsx(ListItemContent, {
|
|
110
|
+
tokens: tokens,
|
|
111
|
+
children: children
|
|
112
|
+
})]
|
|
97
113
|
})]
|
|
98
114
|
})
|
|
99
115
|
});
|
|
@@ -102,6 +118,9 @@ ListItemBase.displayName = 'ListItem';
|
|
|
102
118
|
const staticStyles = StyleSheet.create({
|
|
103
119
|
itemContainer: {
|
|
104
120
|
flexDirection: 'row'
|
|
121
|
+
},
|
|
122
|
+
titleAndContentContainer: {
|
|
123
|
+
flexDirection: 'column'
|
|
105
124
|
}
|
|
106
125
|
});
|
|
107
126
|
ListItemBase.propTypes = { ...selectedSystemPropTypes,
|
|
@@ -50,6 +50,7 @@ const Typography = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
50
50
|
align = undefined,
|
|
51
51
|
tokens,
|
|
52
52
|
dataSet,
|
|
53
|
+
strikeThrough = false,
|
|
53
54
|
...rest
|
|
54
55
|
} = _ref2;
|
|
55
56
|
const viewport = useViewport();
|
|
@@ -95,16 +96,24 @@ const Typography = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
95
96
|
return resetTagStyling(children);
|
|
96
97
|
};
|
|
97
98
|
|
|
99
|
+
const textDecorationLine = strikeThrough ? 'line-through' : 'none';
|
|
100
|
+
const textStyles = resolvedTextProps.style ? { ...resolvedTextProps.style,
|
|
101
|
+
textDecorationLine
|
|
102
|
+
} : {
|
|
103
|
+
textDecorationLine
|
|
104
|
+
};
|
|
98
105
|
return block ? /*#__PURE__*/_jsx(View, {
|
|
99
106
|
ref: ref,
|
|
100
107
|
...containerProps,
|
|
101
108
|
children: /*#__PURE__*/_jsx(Text, { ...resolvedTextProps,
|
|
109
|
+
style: textStyles,
|
|
102
110
|
children: sanitizeChildren(children)
|
|
103
111
|
})
|
|
104
112
|
}) : /*#__PURE__*/_jsx(Text, {
|
|
105
113
|
ref: ref,
|
|
106
114
|
...containerProps,
|
|
107
115
|
...resolvedTextProps,
|
|
116
|
+
style: textStyles,
|
|
108
117
|
children: sanitizeChildren(children)
|
|
109
118
|
});
|
|
110
119
|
});
|
|
@@ -114,6 +123,11 @@ Typography.propTypes = { ...selectedContainerPropTypes,
|
|
|
114
123
|
tokens: getTokensPropType('Typography'),
|
|
115
124
|
variant: variantProp.propType,
|
|
116
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Renders the text with "text-decoration: 'line-through'" applied.
|
|
128
|
+
*/
|
|
129
|
+
strikeThrough: PropTypes.bool,
|
|
130
|
+
|
|
117
131
|
/**
|
|
118
132
|
* Renders the text as a semantic heading. If a html heading tag is provided, uses that tag on Web.
|
|
119
133
|
*
|
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.0",
|
|
14
|
-
"@telus-uds/system-theme-tokens": "^2.
|
|
14
|
+
"@telus-uds/system-theme-tokens": "^2.25.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.
|
|
75
|
+
"version": "1.40.0"
|
|
76
76
|
}
|
|
@@ -20,10 +20,6 @@ const A11yInfoProvider = ({ children }) => {
|
|
|
20
20
|
'reduceMotionChanged',
|
|
21
21
|
setReduceMotionEnabled
|
|
22
22
|
)
|
|
23
|
-
const screenReaderSubscription = AccessibilityInfo.addEventListener(
|
|
24
|
-
'screenReaderChanged',
|
|
25
|
-
setScreenReaderEnabled
|
|
26
|
-
)
|
|
27
23
|
|
|
28
24
|
const setInitialA11yInfo = async () => {
|
|
29
25
|
const [initialReduceMotionEnabled, initialScreenReaderEnabled] = await Promise.all([
|
|
@@ -50,12 +46,6 @@ const A11yInfoProvider = ({ children }) => {
|
|
|
50
46
|
} else if (typeof AccessibilityInfo.removeEventListener === 'function') {
|
|
51
47
|
AccessibilityInfo.removeEventListener('reduceMotionChanged', setReduceMotionEnabled)
|
|
52
48
|
}
|
|
53
|
-
|
|
54
|
-
if (typeof screenReaderSubscription?.remove === 'function') {
|
|
55
|
-
screenReaderSubscription?.remove()
|
|
56
|
-
} else if (typeof AccessibilityInfo.removeEventListener === 'function') {
|
|
57
|
-
AccessibilityInfo.removeEventListener('screenReaderChanged', setScreenReaderEnabled)
|
|
58
|
-
}
|
|
59
49
|
}
|
|
60
50
|
}, [])
|
|
61
51
|
|
package/src/Link/ChevronLink.jsx
CHANGED
|
@@ -12,14 +12,24 @@ import LinkBase from './LinkBase'
|
|
|
12
12
|
* ChevronLink is not intended to be deeply themable; variants passed to ChevronLink are forwarded to Link.
|
|
13
13
|
*/
|
|
14
14
|
const ChevronLink = forwardRef(
|
|
15
|
-
({ direction = 'right', children, tokens, variant, dataSet, ...linkProps }, ref) => {
|
|
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
|
-
|
|
18
|
+
const {
|
|
19
|
+
leftIcon,
|
|
20
|
+
rightIcon,
|
|
21
|
+
iconDisplace,
|
|
22
|
+
height,
|
|
23
|
+
textLineHeight,
|
|
24
|
+
fontSize,
|
|
25
|
+
...otherTokens
|
|
26
|
+
} = getChevronTokens(linkState)
|
|
27
|
+
const linkTokens = selectTokens('Link', otherTokens)
|
|
28
|
+
|
|
20
29
|
return {
|
|
21
|
-
...
|
|
30
|
+
...linkTokens,
|
|
22
31
|
height,
|
|
32
|
+
blockFontSize: tokens.fontSize ?? fontSize,
|
|
23
33
|
textLineHeight,
|
|
24
34
|
icon: direction === 'right' ? rightIcon : leftIcon,
|
|
25
35
|
iconTranslateX: iconDisplace * (direction === 'right' ? 1 : -1) || 0
|
package/src/Link/LinkBase.jsx
CHANGED
|
@@ -150,12 +150,11 @@ const LinkBase = forwardRef(
|
|
|
150
150
|
inlineFlex={hasIcon} // assuming links without icons should be inline (even if they are long)
|
|
151
151
|
ref={ref}
|
|
152
152
|
style={(linkState) => {
|
|
153
|
-
const
|
|
153
|
+
const themeTokens = resolveLinkTokens(linkState)
|
|
154
154
|
const outerBorderStyles = selectOuterBorderStyles(themeTokens)
|
|
155
155
|
const decorationStyles = selectDecorationStyles(themeTokens)
|
|
156
156
|
|
|
157
157
|
return [
|
|
158
|
-
height ? { height } : {},
|
|
159
158
|
outerBorderStyles,
|
|
160
159
|
blockLeftStyle,
|
|
161
160
|
decorationStyles,
|
|
@@ -226,7 +225,7 @@ const staticStyles = StyleSheet.create({
|
|
|
226
225
|
justifyContent: 'flex-start'
|
|
227
226
|
},
|
|
228
227
|
baseline: {
|
|
229
|
-
alignSelf: '
|
|
228
|
+
alignSelf: 'baseline'
|
|
230
229
|
}
|
|
231
230
|
})
|
|
232
231
|
|
package/src/List/ListItem.jsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import ListItemBase from './ListItemBase'
|
|
4
|
-
import Typography from '../Typography'
|
|
5
4
|
import { useThemeTokens } from '../ThemeProvider'
|
|
6
5
|
import { variantProp } from '../utils'
|
|
7
6
|
|
|
@@ -11,8 +10,7 @@ import { variantProp } from '../utils'
|
|
|
11
10
|
const ListItem = forwardRef(({ tokens, variant, children, title, ...listItemProps }, ref) => {
|
|
12
11
|
const themeTokens = useThemeTokens('List', tokens, variant)
|
|
13
12
|
return (
|
|
14
|
-
<ListItemBase tokens={themeTokens} ref={ref} {...listItemProps}>
|
|
15
|
-
{Boolean(title) && <Typography variant={{ size: 'h4', bold: true }}>{title}</Typography>}
|
|
13
|
+
<ListItemBase tokens={themeTokens} ref={ref} {...listItemProps} title={title}>
|
|
16
14
|
{children}
|
|
17
15
|
</ListItemBase>
|
|
18
16
|
)
|
|
@@ -5,6 +5,7 @@ import { a11yProps, getTokensPropType, selectSystemProps, variantProp, viewProps
|
|
|
5
5
|
|
|
6
6
|
import ListItemContent from './ListItemContent'
|
|
7
7
|
import ListItemMark from './ListItemMark'
|
|
8
|
+
import Typography from '../Typography'
|
|
8
9
|
|
|
9
10
|
const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
|
|
10
11
|
|
|
@@ -31,6 +32,7 @@ const ListItemBase = forwardRef(
|
|
|
31
32
|
iconSize,
|
|
32
33
|
showDivider,
|
|
33
34
|
children,
|
|
35
|
+
title,
|
|
34
36
|
isLastItem,
|
|
35
37
|
accessibilityRole = Platform.select({ web: 'listitem', default: undefined }),
|
|
36
38
|
...rest
|
|
@@ -69,10 +71,23 @@ const ListItemBase = forwardRef(
|
|
|
69
71
|
{typeof children === 'function' ? (
|
|
70
72
|
children({ tokens, icon, iconColor, iconSize, isLastItem })
|
|
71
73
|
) : (
|
|
72
|
-
|
|
74
|
+
<View
|
|
75
|
+
style={[
|
|
76
|
+
{
|
|
77
|
+
flexDirection: 'row',
|
|
78
|
+
flex: 'wrap'
|
|
79
|
+
},
|
|
80
|
+
!title && { alignItems: 'center' }
|
|
81
|
+
]}
|
|
82
|
+
>
|
|
73
83
|
<ListItemMark tokens={tokens} icon={icon} iconColor={iconColor} iconSize={iconSize} />
|
|
74
|
-
<
|
|
75
|
-
|
|
84
|
+
<View style={staticStyles.titleAndContentContainer}>
|
|
85
|
+
{Boolean(title) && (
|
|
86
|
+
<Typography variant={{ size: 'h4', bold: true }}>{title}</Typography>
|
|
87
|
+
)}
|
|
88
|
+
<ListItemContent tokens={tokens}>{children}</ListItemContent>
|
|
89
|
+
</View>
|
|
90
|
+
</View>
|
|
76
91
|
)}
|
|
77
92
|
</View>
|
|
78
93
|
)
|
|
@@ -83,7 +98,8 @@ ListItemBase.displayName = 'ListItem'
|
|
|
83
98
|
const staticStyles = StyleSheet.create({
|
|
84
99
|
itemContainer: {
|
|
85
100
|
flexDirection: 'row'
|
|
86
|
-
}
|
|
101
|
+
},
|
|
102
|
+
titleAndContentContainer: { flexDirection: 'column' }
|
|
87
103
|
})
|
|
88
104
|
|
|
89
105
|
ListItemBase.propTypes = {
|
|
@@ -53,6 +53,7 @@ const Typography = forwardRef(
|
|
|
53
53
|
align = undefined,
|
|
54
54
|
tokens,
|
|
55
55
|
dataSet,
|
|
56
|
+
strikeThrough = false,
|
|
56
57
|
...rest
|
|
57
58
|
},
|
|
58
59
|
ref
|
|
@@ -100,12 +101,18 @@ const Typography = forwardRef(
|
|
|
100
101
|
return resetTagStyling(children)
|
|
101
102
|
}
|
|
102
103
|
|
|
104
|
+
const textDecorationLine = strikeThrough ? 'line-through' : 'none'
|
|
105
|
+
const textStyles = resolvedTextProps.style
|
|
106
|
+
? { ...resolvedTextProps.style, textDecorationLine }
|
|
107
|
+
: { textDecorationLine }
|
|
103
108
|
return block ? (
|
|
104
109
|
<View ref={ref} {...containerProps}>
|
|
105
|
-
<Text {...resolvedTextProps}
|
|
110
|
+
<Text {...resolvedTextProps} style={textStyles}>
|
|
111
|
+
{sanitizeChildren(children)}
|
|
112
|
+
</Text>
|
|
106
113
|
</View>
|
|
107
114
|
) : (
|
|
108
|
-
<Text ref={ref} {...containerProps} {...resolvedTextProps}>
|
|
115
|
+
<Text ref={ref} {...containerProps} {...resolvedTextProps} style={textStyles}>
|
|
109
116
|
{sanitizeChildren(children)}
|
|
110
117
|
</Text>
|
|
111
118
|
)
|
|
@@ -118,6 +125,10 @@ Typography.propTypes = {
|
|
|
118
125
|
...selectedTextPropTypes,
|
|
119
126
|
tokens: getTokensPropType('Typography'),
|
|
120
127
|
variant: variantProp.propType,
|
|
128
|
+
/**
|
|
129
|
+
* Renders the text with "text-decoration: 'line-through'" applied.
|
|
130
|
+
*/
|
|
131
|
+
strikeThrough: PropTypes.bool,
|
|
121
132
|
/**
|
|
122
133
|
* Renders the text as a semantic heading. If a html heading tag is provided, uses that tag on Web.
|
|
123
134
|
*
|