@telus-uds/components-base 3.2.0 → 3.3.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 +20 -2
- package/lib/cjs/Card/CardBase.js +2 -1
- package/lib/cjs/Carousel/Carousel.js +202 -51
- package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +1 -15
- package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -6
- package/lib/cjs/ExpandCollapse/Control.js +3 -1
- package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +1 -1
- package/lib/cjs/List/ListItemBase.js +1 -2
- package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +2 -2
- package/lib/cjs/TextInput/TextArea.js +10 -1
- package/lib/cjs/Typography/Typography.js +8 -2
- package/lib/esm/Card/CardBase.js +2 -1
- package/lib/esm/Carousel/Carousel.js +203 -52
- package/lib/esm/Carousel/CarouselItem/CarouselItem.js +2 -16
- package/lib/esm/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -6
- package/lib/esm/ExpandCollapse/Control.js +3 -1
- package/lib/esm/ExpandCollapseMini/ExpandCollapseMini.js +1 -1
- package/lib/esm/List/ListItemBase.js +1 -2
- package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +2 -2
- package/lib/esm/TextInput/TextArea.js +10 -1
- package/lib/esm/Typography/Typography.js +8 -2
- package/lib/package.json +1 -1
- package/package.json +1 -1
- package/src/Card/CardBase.jsx +2 -1
- package/src/Carousel/Carousel.jsx +200 -55
- package/src/Carousel/CarouselItem/CarouselItem.jsx +1 -7
- package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +5 -4
- package/src/ExpandCollapse/Control.jsx +3 -1
- package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +1 -1
- package/src/List/ListItemBase.jsx +1 -2
- package/src/MultiSelectFilter/MultiSelectFilter.jsx +1 -1
- package/src/TextInput/TextArea.jsx +11 -1
- package/src/Typography/Typography.jsx +8 -2
|
@@ -29,7 +29,7 @@ const ExpandCollapseMini = React.forwardRef(
|
|
|
29
29
|
// Remove unwanted look and feel from ExpandCollapse(background pressed, focus border and text underline)
|
|
30
30
|
icon: null,
|
|
31
31
|
borderColor: 'transparent',
|
|
32
|
-
textLine: 'none',
|
|
32
|
+
textLine: tokens.textLine ?? 'none',
|
|
33
33
|
backgroundColor: 'transparent'
|
|
34
34
|
}}
|
|
35
35
|
// TODO refactor
|
|
@@ -275,9 +275,9 @@ const MultiSelectFilter = React.forwardRef(
|
|
|
275
275
|
{subtitle}
|
|
276
276
|
</Typography>
|
|
277
277
|
</Row>
|
|
278
|
-
<Spacer space={4} />
|
|
279
278
|
</>
|
|
280
279
|
)}
|
|
280
|
+
<Spacer space={4} />
|
|
281
281
|
<View style={styles.options}>
|
|
282
282
|
<ScrollView onLayout={handleScrollViewLayout}>
|
|
283
283
|
<Row distribute="between" onLayout={handleRowLayout}>
|
|
@@ -54,6 +54,8 @@ const TextArea = React.forwardRef(({ tokens, variant = {}, ...rest }, ref) => {
|
|
|
54
54
|
const themeTokens = useThemeTokens('TextArea', tokens, variant)
|
|
55
55
|
const [inputHeight, setInputHeight] = React.useState()
|
|
56
56
|
|
|
57
|
+
const isUpdatingHeight = React.useRef(false)
|
|
58
|
+
|
|
57
59
|
// adjust the text area's height as new lines are added to the content
|
|
58
60
|
const onHeightChange = ({
|
|
59
61
|
nativeEvent: {
|
|
@@ -61,8 +63,16 @@ const TextArea = React.forwardRef(({ tokens, variant = {}, ...rest }, ref) => {
|
|
|
61
63
|
}
|
|
62
64
|
}) => {
|
|
63
65
|
// on native this is happens out of the box
|
|
64
|
-
if (Platform.OS === 'web') {
|
|
66
|
+
if (Platform.OS === 'web' && !isUpdatingHeight.current) {
|
|
67
|
+
isUpdatingHeight.current = true
|
|
65
68
|
setInputHeight(height)
|
|
69
|
+
// setTimeout is used to “wait” for the next update cycle before allowing a new height adjustment,
|
|
70
|
+
// avoiding multiple updates in the same render and preventing a possible infinite loop or constant re-renders.
|
|
71
|
+
setTimeout(() => {
|
|
72
|
+
isUpdatingHeight.current = false
|
|
73
|
+
}, 0)
|
|
74
|
+
} else {
|
|
75
|
+
setInputHeight(null)
|
|
66
76
|
}
|
|
67
77
|
}
|
|
68
78
|
|
|
@@ -138,6 +138,12 @@ const Typography = React.forwardRef(
|
|
|
138
138
|
: styles
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Added to maintain previous behavior, as the 'auto' value for the 'align' prop now defaults to 'inherit' on the web,
|
|
143
|
+
* maintaining the previous behavior that was changed in the Text component of react-native.
|
|
144
|
+
*/
|
|
145
|
+
const resolvedAlign = Platform.OS === 'web' && align === 'auto' ? 'inherit' : align
|
|
146
|
+
|
|
141
147
|
let textStyles
|
|
142
148
|
let mediaIds
|
|
143
149
|
|
|
@@ -146,7 +152,7 @@ const Typography = React.forwardRef(
|
|
|
146
152
|
(acc, [vp, viewportTokens]) => {
|
|
147
153
|
acc[vp] = selectTextStyles(
|
|
148
154
|
{
|
|
149
|
-
textAlign:
|
|
155
|
+
textAlign: resolvedAlign,
|
|
150
156
|
textDecorationLine,
|
|
151
157
|
...viewportTokens
|
|
152
158
|
},
|
|
@@ -177,7 +183,7 @@ const Typography = React.forwardRef(
|
|
|
177
183
|
} else {
|
|
178
184
|
textStyles = selectTextStyles(
|
|
179
185
|
{
|
|
180
|
-
textAlign:
|
|
186
|
+
textAlign: resolvedAlign,
|
|
181
187
|
textDecorationLine,
|
|
182
188
|
...themeTokens
|
|
183
189
|
},
|