@telus-uds/components-base 1.39.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 +12 -2
- package/component-docs.json +175 -6
- package/lib/A11yInfoProvider/index.js +0 -8
- package/lib/Typography/Typography.js +14 -0
- package/lib-module/A11yInfoProvider/index.js +0 -7
- package/lib-module/Typography/Typography.js +14 -0
- package/package.json +2 -2
- package/src/A11yInfoProvider/index.jsx +0 -10
- package/src/Typography/Typography.jsx +13 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
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
|
+
|
|
7
17
|
## 1.39.0
|
|
8
18
|
|
|
9
|
-
Mon, 01 May 2023 22:
|
|
19
|
+
Mon, 01 May 2023 22:09:07 GMT
|
|
10
20
|
|
|
11
21
|
### Minor changes
|
|
12
22
|
|
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",
|
|
@@ -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",
|
|
@@ -1408,8 +1506,14 @@
|
|
|
1408
1506
|
"flexShrink": "integer"
|
|
1409
1507
|
},
|
|
1410
1508
|
"Breadcrumbs": {
|
|
1509
|
+
"fontWeight": "fontWeight",
|
|
1510
|
+
"fontName": "fontName",
|
|
1511
|
+
"fontSize": "fontSize",
|
|
1512
|
+
"color": "color",
|
|
1513
|
+
"currentColor": "color",
|
|
1411
1514
|
"icon": "icon",
|
|
1412
1515
|
"iconColor": "color",
|
|
1516
|
+
"iconSize": "size",
|
|
1413
1517
|
"iconPadding": "size",
|
|
1414
1518
|
"listItemPadding": "size"
|
|
1415
1519
|
},
|
|
@@ -2019,6 +2123,60 @@
|
|
|
2019
2123
|
"type": "state"
|
|
2020
2124
|
}
|
|
2021
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
|
+
},
|
|
2022
2180
|
"Notification": {
|
|
2023
2181
|
"system": {
|
|
2024
2182
|
"values": [
|
|
@@ -10298,6 +10456,17 @@
|
|
|
10298
10456
|
"required": false,
|
|
10299
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)"
|
|
10300
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
|
+
},
|
|
10301
10470
|
"tokens": {
|
|
10302
10471
|
"type": {
|
|
10303
10472
|
"name": "custom",
|
|
@@ -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, {
|
|
@@ -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, {
|
|
@@ -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
|
|
|
@@ -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
|
*
|