@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.
Files changed (33) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/lib/cjs/Card/CardBase.js +2 -1
  3. package/lib/cjs/Carousel/Carousel.js +202 -51
  4. package/lib/cjs/Carousel/CarouselItem/CarouselItem.js +1 -15
  5. package/lib/cjs/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -6
  6. package/lib/cjs/ExpandCollapse/Control.js +3 -1
  7. package/lib/cjs/ExpandCollapseMini/ExpandCollapseMini.js +1 -1
  8. package/lib/cjs/List/ListItemBase.js +1 -2
  9. package/lib/cjs/MultiSelectFilter/MultiSelectFilter.js +2 -2
  10. package/lib/cjs/TextInput/TextArea.js +10 -1
  11. package/lib/cjs/Typography/Typography.js +8 -2
  12. package/lib/esm/Card/CardBase.js +2 -1
  13. package/lib/esm/Carousel/Carousel.js +203 -52
  14. package/lib/esm/Carousel/CarouselItem/CarouselItem.js +2 -16
  15. package/lib/esm/Carousel/CarouselStepTracker/CarouselStepTracker.js +6 -6
  16. package/lib/esm/ExpandCollapse/Control.js +3 -1
  17. package/lib/esm/ExpandCollapseMini/ExpandCollapseMini.js +1 -1
  18. package/lib/esm/List/ListItemBase.js +1 -2
  19. package/lib/esm/MultiSelectFilter/MultiSelectFilter.js +2 -2
  20. package/lib/esm/TextInput/TextArea.js +10 -1
  21. package/lib/esm/Typography/Typography.js +8 -2
  22. package/lib/package.json +1 -1
  23. package/package.json +1 -1
  24. package/src/Card/CardBase.jsx +2 -1
  25. package/src/Carousel/Carousel.jsx +200 -55
  26. package/src/Carousel/CarouselItem/CarouselItem.jsx +1 -7
  27. package/src/Carousel/CarouselStepTracker/CarouselStepTracker.jsx +5 -4
  28. package/src/ExpandCollapse/Control.jsx +3 -1
  29. package/src/ExpandCollapseMini/ExpandCollapseMini.jsx +1 -1
  30. package/src/List/ListItemBase.jsx +1 -2
  31. package/src/MultiSelectFilter/MultiSelectFilter.jsx +1 -1
  32. package/src/TextInput/TextArea.jsx +11 -1
  33. 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
@@ -110,8 +110,7 @@ const staticStyles = StyleSheet.create({
110
110
  titleAndContentContainer: {
111
111
  flexDirection: 'column',
112
112
  flexShrink: 1,
113
- flexGrow: 1,
114
- textAlign: 'justify'
113
+ flexGrow: 1
115
114
  }
116
115
  })
117
116
 
@@ -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: align,
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: align,
186
+ textAlign: resolvedAlign,
181
187
  textDecorationLine,
182
188
  ...themeTokens
183
189
  },