@telus-uds/components-base 1.78.0 → 1.79.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 CHANGED
@@ -1,12 +1,37 @@
1
1
  # Change Log - @telus-uds/components-base
2
2
 
3
- This log was last generated on Fri, 23 Feb 2024 19:32:18 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 06 Mar 2024 00:02:37 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 1.79.0
8
+
9
+ Wed, 06 Mar 2024 00:02:37 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - adjusting Typography to use the new token gradient (hoss.agina@telus.com)
14
+ - Bump @telus-uds/system-theme-tokens to v2.53.0
15
+
16
+ ### Patches
17
+
18
+ - prevent onchange event from being fired twice on select component (guillermo.peitzner@telus.com)
19
+ - fix step-tracker component visual states (guillermo.peitzner@telus.com)
20
+
21
+ ## 1.78.1
22
+
23
+ Thu, 29 Feb 2024 00:05:08 GMT
24
+
25
+ ### Patches
26
+
27
+ - fix notification component icon alignment" (guillermo.peitzner@telus.com)
28
+ - fix box component background image on mobile devices (guillermo.peitzner@telus.com)
29
+ - fix carousel component icon background color (guillermo.peitzner@telus.com)
30
+ - Bump @telus-uds/system-theme-tokens to v2.52.1
31
+
7
32
  ## 1.78.0
8
33
 
9
- Fri, 23 Feb 2024 19:32:18 GMT
34
+ Fri, 23 Feb 2024 19:39:17 GMT
10
35
 
11
36
  ### Minor changes
12
37
 
package/lib/Box/Box.js CHANGED
@@ -92,7 +92,9 @@ const setBackgroundImage = _ref2 => {
92
92
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
93
93
  style: containedViewStyle,
94
94
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Image.default, {
95
- source: src,
95
+ source: {
96
+ uri: src
97
+ },
96
98
  alt: alt,
97
99
  style: staticStyles.containedImage,
98
100
  accessibilityIgnoresInvertColors: true
@@ -101,7 +103,9 @@ const setBackgroundImage = _ref2 => {
101
103
  });
102
104
  }
103
105
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageBackground.default, {
104
- source: src,
106
+ source: {
107
+ uri: src
108
+ },
105
109
  alt: alt,
106
110
  style: staticStyles.backgroundImageContainer,
107
111
  resizeMode: backgroundImageResizeMode,
@@ -70,6 +70,14 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
70
70
  }
71
71
  return styles;
72
72
  };
73
+ const selectIconStyles = _ref => {
74
+ let {
75
+ iconBackgroundColor
76
+ } = _ref;
77
+ return {
78
+ backgroundColor: iconBackgroundColor
79
+ };
80
+ };
73
81
  const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_utils.a11yProps, _utils.viewProps]);
74
82
 
75
83
  /**
@@ -126,7 +134,7 @@ const [selectProps, selectedSystemPropTypes] = (0, _utils.selectSystemProps)([_u
126
134
  - `spaceBetweenSlideAndPreviousNextNavigation` - Horizontal space between slide and previous/next navigational buttons
127
135
  - `spaceBetweenSlideAndPanelNavigation` - Vertical space between slide area and panel navigation area
128
136
  */
129
- const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
137
+ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref2, ref) => {
130
138
  let {
131
139
  tokens,
132
140
  variant,
@@ -157,7 +165,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
157
165
  accessibilityLiveRegion = 'polite',
158
166
  copy,
159
167
  ...rest
160
- } = _ref;
168
+ } = _ref2;
161
169
  const viewport = (0, _ViewportProvider.useViewport)();
162
170
  const themeTokens = (0, _ThemeProvider.useThemeTokens)('Carousel', tokens, variant, {
163
171
  viewport
@@ -214,7 +222,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
214
222
  const animatedY = _react.default.useRef(0);
215
223
  const isFirstSlide = !activeIndex;
216
224
  const isLastSlide = activeIndex + 1 >= children.length;
217
- const onContainerLayout = _ref2 => {
225
+ const onContainerLayout = _ref3 => {
218
226
  let {
219
227
  nativeEvent: {
220
228
  layout: {
@@ -223,7 +231,7 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
223
231
  width
224
232
  }
225
233
  }
226
- } = _ref2;
234
+ } = _ref3;
227
235
  return setContainerLayout(prevState => ({
228
236
  ...prevState,
229
237
  x,
@@ -231,14 +239,14 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
231
239
  width
232
240
  }));
233
241
  };
234
- const onPreviousNextNavigationButtonLayout = _ref3 => {
242
+ const onPreviousNextNavigationButtonLayout = _ref4 => {
235
243
  let {
236
244
  nativeEvent: {
237
245
  layout: {
238
246
  width
239
247
  }
240
248
  }
241
- } = _ref3;
249
+ } = _ref4;
242
250
  return setPreviousNextNavigationButtonWidth(width);
243
251
  };
244
252
  const updateOffset = _react.default.useCallback(() => {
@@ -350,16 +358,16 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
350
358
  }
351
359
  }), [containerLayout.width, updateIndex, updateOffset, animate, isSwipeAllowed, activeIndex, minDistanceForAction, handleAnimationStart, minDistanceToCapture, pan.x]);
352
360
  _react.default.useEffect(() => {
353
- pan.x.addListener(_ref4 => {
361
+ pan.x.addListener(_ref5 => {
354
362
  let {
355
363
  value
356
- } = _ref4;
364
+ } = _ref5;
357
365
  animatedX.current = value;
358
366
  });
359
- pan.y.addListener(_ref5 => {
367
+ pan.y.addListener(_ref6 => {
360
368
  let {
361
369
  value
362
- } = _ref5;
370
+ } = _ref6;
363
371
  animatedY.current = value;
364
372
  });
365
373
  return () => {
@@ -453,7 +461,8 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
453
461
  icon: previousIcon,
454
462
  onPress: goToPrev,
455
463
  variant: previousNextIconButtonVariants,
456
- accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex)
464
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex),
465
+ tokens: selectIconStyles(themeTokens)
457
466
  })
458
467
  }) : null, Boolean(skipLinkHref) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SkipLink.default, {
459
468
  ref: firstFocusRef,
@@ -499,7 +508,8 @@ const Carousel = /*#__PURE__*/_react.default.forwardRef((_ref, ref) => {
499
508
  icon: nextIcon,
500
509
  onPress: goToNext,
501
510
  variant: previousNextIconButtonVariants,
502
- accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2)
511
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2),
512
+ tokens: selectIconStyles(themeTokens)
503
513
  })
504
514
  }) : null]
505
515
  }), showPanelNavigation ? activePanelNavigation : null]
@@ -49,7 +49,7 @@ const selectIconContainerStyles = _ref2 => {
49
49
  } = _ref2;
50
50
  return {
51
51
  paddingRight: iconGap,
52
- placeContent: 'center'
52
+ placeContent: 'start'
53
53
  };
54
54
  };
55
55
  const selectDismissIconProps = _ref3 => {
@@ -255,7 +255,7 @@ const Select = /*#__PURE__*/(0, _react.forwardRef)((_ref8, ref) => {
255
255
  onBlur: handleBlur,
256
256
  onMouseOver: handleMouseOver,
257
257
  onMouseOut: handleMouseOut,
258
- onChange: setValue,
258
+ onChange: e => setValue(e, null),
259
259
  value: currentValue,
260
260
  inactive: inactive,
261
261
  placeholder: placeholder !== undefined ? {
@@ -209,11 +209,11 @@ const Step = _ref8 => {
209
209
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_View.default, {
210
210
  style: [staticStyles.knob, selectKnobStyles(themeTokens, isCompleted, isCurrent)],
211
211
  testID: getStepTestID(isCompleted, isCurrent),
212
- children: [(isCompleted && completedIcon || isCurrent && !completedIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
213
- style: selectCurrentInnerStyles(themeTokens)
214
- }), isCurrent && completedIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
212
+ children: [isCompleted && completedIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
215
213
  icon: completedIcon,
216
214
  tokens: selectCompletedIconTokens(themeTokens)
215
+ }), (isCurrent && completedIcon || isCurrent && !completedIcon) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
216
+ style: selectCurrentInnerStyles(themeTokens)
217
217
  })]
218
218
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_View.default, {
219
219
  style: [staticStyles.connector, !isLast && selectConnectorStyles(themeTokens, isCompleted)]
@@ -30,7 +30,8 @@ const selectTextStyles = (_ref, themeOptions) => {
30
30
  textAlign,
31
31
  textTransform,
32
32
  letterSpacing,
33
- textDecorationLine
33
+ textDecorationLine,
34
+ gradient
34
35
  } = _ref;
35
36
  return (0, _utils.applyTextStyles)({
36
37
  fontWeight,
@@ -42,7 +43,8 @@ const selectTextStyles = (_ref, themeOptions) => {
42
43
  textAlign,
43
44
  textTransform,
44
45
  letterSpacing,
45
- textDecorationLine
46
+ textDecorationLine,
47
+ gradient
46
48
  });
47
49
  };
48
50
 
@@ -74,6 +76,36 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
74
76
  });
75
77
  const maxFontSizeMultiplier = enableMediaQueryStyleSheet ? (0, _utils2.getMaxFontMultiplier)(themeTokens[viewport]) : (0, _utils2.getMaxFontMultiplier)(themeTokens);
76
78
  const textDecorationLine = strikeThrough ? 'line-through' : 'none';
79
+ const generateGradientString = gradientObj => {
80
+ let gradientStr = '';
81
+ const {
82
+ type,
83
+ angle,
84
+ stops: [stopOne, stopTwo],
85
+ specification
86
+ } = gradientObj;
87
+ if (type === 'radial') {
88
+ gradientStr = `radial-gradient(${specification}`;
89
+ gradientStr += `, ${stopOne.color} ${stopOne.stop * 100}%, ${stopTwo.color} ${stopTwo.stop * 100}%`;
90
+ } else if (type === 'linear') {
91
+ gradientStr = `linear-gradient(${angle}deg`;
92
+ if (angle === 135) {
93
+ gradientStr += `, ${stopOne.color}, 75%, ${stopTwo.color}`;
94
+ } else {
95
+ gradientStr += `, ${stopOne.color}, ${stopTwo.color}`;
96
+ }
97
+ }
98
+ gradientStr += ')';
99
+ return gradientStr;
100
+ };
101
+ const getStyleWithGradient = styles => {
102
+ return styles.gradient ? {
103
+ ...styles,
104
+ color: 'transparent',
105
+ backgroundImage: generateGradientString(styles.gradient),
106
+ backgroundClip: 'text'
107
+ } : styles;
108
+ };
77
109
  let textStyles;
78
110
  let mediaIds;
79
111
  if (enableMediaQueryStyleSheet) {
@@ -144,7 +176,7 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
144
176
  ...containerProps,
145
177
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Text.default, {
146
178
  ...resolvedTextProps,
147
- style: textStyles,
179
+ style: getStyleWithGradient(textStyles),
148
180
  dataSet: dataSetValue,
149
181
  children: sanitizeChildren(children)
150
182
  })
@@ -152,7 +184,7 @@ const Typography = /*#__PURE__*/(0, _react.forwardRef)((_ref2, ref) => {
152
184
  ref: ref,
153
185
  ...containerProps,
154
186
  ...resolvedTextProps,
155
- style: textStyles,
187
+ style: getStyleWithGradient(textStyles),
156
188
  dataSet: dataSetValue,
157
189
  children: sanitizeChildren(children)
158
190
  });
@@ -84,7 +84,9 @@ const setBackgroundImage = _ref2 => {
84
84
  children: [/*#__PURE__*/_jsx(View, {
85
85
  style: containedViewStyle,
86
86
  children: /*#__PURE__*/_jsx(Image, {
87
- source: src,
87
+ source: {
88
+ uri: src
89
+ },
88
90
  alt: alt,
89
91
  style: staticStyles.containedImage,
90
92
  accessibilityIgnoresInvertColors: true
@@ -93,7 +95,9 @@ const setBackgroundImage = _ref2 => {
93
95
  });
94
96
  }
95
97
  return /*#__PURE__*/_jsx(ImageBackground, {
96
- source: src,
98
+ source: {
99
+ uri: src
100
+ },
97
101
  alt: alt,
98
102
  style: staticStyles.backgroundImageContainer,
99
103
  resizeMode: backgroundImageResizeMode,
@@ -64,6 +64,14 @@ const selectPreviousNextNavigationButtonStyles = (previousNextNavigationButtonWi
64
64
  }
65
65
  return styles;
66
66
  };
67
+ const selectIconStyles = _ref => {
68
+ let {
69
+ iconBackgroundColor
70
+ } = _ref;
71
+ return {
72
+ backgroundColor: iconBackgroundColor
73
+ };
74
+ };
67
75
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps]);
68
76
 
69
77
  /**
@@ -120,7 +128,7 @@ const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, vie
120
128
  - `spaceBetweenSlideAndPreviousNextNavigation` - Horizontal space between slide and previous/next navigational buttons
121
129
  - `spaceBetweenSlideAndPanelNavigation` - Vertical space between slide area and panel navigation area
122
130
  */
123
- const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
131
+ const Carousel = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
124
132
  let {
125
133
  tokens,
126
134
  variant,
@@ -151,7 +159,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
151
159
  accessibilityLiveRegion = 'polite',
152
160
  copy,
153
161
  ...rest
154
- } = _ref;
162
+ } = _ref2;
155
163
  const viewport = useViewport();
156
164
  const themeTokens = useThemeTokens('Carousel', tokens, variant, {
157
165
  viewport
@@ -208,7 +216,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
208
216
  const animatedY = React.useRef(0);
209
217
  const isFirstSlide = !activeIndex;
210
218
  const isLastSlide = activeIndex + 1 >= children.length;
211
- const onContainerLayout = _ref2 => {
219
+ const onContainerLayout = _ref3 => {
212
220
  let {
213
221
  nativeEvent: {
214
222
  layout: {
@@ -217,7 +225,7 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
217
225
  width
218
226
  }
219
227
  }
220
- } = _ref2;
228
+ } = _ref3;
221
229
  return setContainerLayout(prevState => ({
222
230
  ...prevState,
223
231
  x,
@@ -225,14 +233,14 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
225
233
  width
226
234
  }));
227
235
  };
228
- const onPreviousNextNavigationButtonLayout = _ref3 => {
236
+ const onPreviousNextNavigationButtonLayout = _ref4 => {
229
237
  let {
230
238
  nativeEvent: {
231
239
  layout: {
232
240
  width
233
241
  }
234
242
  }
235
- } = _ref3;
243
+ } = _ref4;
236
244
  return setPreviousNextNavigationButtonWidth(width);
237
245
  };
238
246
  const updateOffset = React.useCallback(() => {
@@ -344,16 +352,16 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
344
352
  }
345
353
  }), [containerLayout.width, updateIndex, updateOffset, animate, isSwipeAllowed, activeIndex, minDistanceForAction, handleAnimationStart, minDistanceToCapture, pan.x]);
346
354
  React.useEffect(() => {
347
- pan.x.addListener(_ref4 => {
355
+ pan.x.addListener(_ref5 => {
348
356
  let {
349
357
  value
350
- } = _ref4;
358
+ } = _ref5;
351
359
  animatedX.current = value;
352
360
  });
353
- pan.y.addListener(_ref5 => {
361
+ pan.y.addListener(_ref6 => {
354
362
  let {
355
363
  value
356
- } = _ref5;
364
+ } = _ref6;
357
365
  animatedY.current = value;
358
366
  });
359
367
  return () => {
@@ -447,7 +455,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
447
455
  icon: previousIcon,
448
456
  onPress: goToPrev,
449
457
  variant: previousNextIconButtonVariants,
450
- accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex)
458
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex),
459
+ tokens: selectIconStyles(themeTokens)
451
460
  })
452
461
  }) : null, Boolean(skipLinkHref) && /*#__PURE__*/_jsx(SkipLink, {
453
462
  ref: firstFocusRef,
@@ -493,7 +502,8 @@ const Carousel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
493
502
  icon: nextIcon,
494
503
  onPress: goToNext,
495
504
  variant: previousNextIconButtonVariants,
496
- accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2)
505
+ accessibilityLabel: getCopyWithPlaceholders('iconButtonLabel').replace('%{targetStep}', activeIndex + 2),
506
+ tokens: selectIconStyles(themeTokens)
497
507
  })
498
508
  }) : null]
499
509
  }), showPanelNavigation ? activePanelNavigation : null]
@@ -41,7 +41,7 @@ const selectIconContainerStyles = _ref2 => {
41
41
  } = _ref2;
42
42
  return {
43
43
  paddingRight: iconGap,
44
- placeContent: 'center'
44
+ placeContent: 'start'
45
45
  };
46
46
  };
47
47
  const selectDismissIconProps = _ref3 => {
@@ -247,7 +247,7 @@ const Select = /*#__PURE__*/forwardRef((_ref8, ref) => {
247
247
  onBlur: handleBlur,
248
248
  onMouseOver: handleMouseOver,
249
249
  onMouseOut: handleMouseOut,
250
- onChange: setValue,
250
+ onChange: e => setValue(e, null),
251
251
  value: currentValue,
252
252
  inactive: inactive,
253
253
  placeholder: placeholder !== undefined ? {
@@ -203,11 +203,11 @@ const Step = _ref8 => {
203
203
  }), /*#__PURE__*/_jsxs(View, {
204
204
  style: [staticStyles.knob, selectKnobStyles(themeTokens, isCompleted, isCurrent)],
205
205
  testID: getStepTestID(isCompleted, isCurrent),
206
- children: [(isCompleted && completedIcon || isCurrent && !completedIcon) && /*#__PURE__*/_jsx(View, {
207
- style: selectCurrentInnerStyles(themeTokens)
208
- }), isCurrent && completedIcon && /*#__PURE__*/_jsx(Icon, {
206
+ children: [isCompleted && completedIcon && /*#__PURE__*/_jsx(Icon, {
209
207
  icon: completedIcon,
210
208
  tokens: selectCompletedIconTokens(themeTokens)
209
+ }), (isCurrent && completedIcon || isCurrent && !completedIcon) && /*#__PURE__*/_jsx(View, {
210
+ style: selectCurrentInnerStyles(themeTokens)
211
211
  })]
212
212
  }), /*#__PURE__*/_jsx(View, {
213
213
  style: [staticStyles.connector, !isLast && selectConnectorStyles(themeTokens, isCompleted)]
@@ -22,7 +22,8 @@ const selectTextStyles = (_ref, themeOptions) => {
22
22
  textAlign,
23
23
  textTransform,
24
24
  letterSpacing,
25
- textDecorationLine
25
+ textDecorationLine,
26
+ gradient
26
27
  } = _ref;
27
28
  return applyTextStyles({
28
29
  fontWeight,
@@ -34,7 +35,8 @@ const selectTextStyles = (_ref, themeOptions) => {
34
35
  textAlign,
35
36
  textTransform,
36
37
  letterSpacing,
37
- textDecorationLine
38
+ textDecorationLine,
39
+ gradient
38
40
  });
39
41
  };
40
42
 
@@ -66,6 +68,36 @@ const Typography = /*#__PURE__*/forwardRef((_ref2, ref) => {
66
68
  });
67
69
  const maxFontSizeMultiplier = enableMediaQueryStyleSheet ? getMaxFontMultiplier(themeTokens[viewport]) : getMaxFontMultiplier(themeTokens);
68
70
  const textDecorationLine = strikeThrough ? 'line-through' : 'none';
71
+ const generateGradientString = gradientObj => {
72
+ let gradientStr = '';
73
+ const {
74
+ type,
75
+ angle,
76
+ stops: [stopOne, stopTwo],
77
+ specification
78
+ } = gradientObj;
79
+ if (type === 'radial') {
80
+ gradientStr = `radial-gradient(${specification}`;
81
+ gradientStr += `, ${stopOne.color} ${stopOne.stop * 100}%, ${stopTwo.color} ${stopTwo.stop * 100}%`;
82
+ } else if (type === 'linear') {
83
+ gradientStr = `linear-gradient(${angle}deg`;
84
+ if (angle === 135) {
85
+ gradientStr += `, ${stopOne.color}, 75%, ${stopTwo.color}`;
86
+ } else {
87
+ gradientStr += `, ${stopOne.color}, ${stopTwo.color}`;
88
+ }
89
+ }
90
+ gradientStr += ')';
91
+ return gradientStr;
92
+ };
93
+ const getStyleWithGradient = styles => {
94
+ return styles.gradient ? {
95
+ ...styles,
96
+ color: 'transparent',
97
+ backgroundImage: generateGradientString(styles.gradient),
98
+ backgroundClip: 'text'
99
+ } : styles;
100
+ };
69
101
  let textStyles;
70
102
  let mediaIds;
71
103
  if (enableMediaQueryStyleSheet) {
@@ -136,7 +168,7 @@ const Typography = /*#__PURE__*/forwardRef((_ref2, ref) => {
136
168
  ...containerProps,
137
169
  children: /*#__PURE__*/_jsx(Text, {
138
170
  ...resolvedTextProps,
139
- style: textStyles,
171
+ style: getStyleWithGradient(textStyles),
140
172
  dataSet: dataSetValue,
141
173
  children: sanitizeChildren(children)
142
174
  })
@@ -144,7 +176,7 @@ const Typography = /*#__PURE__*/forwardRef((_ref2, ref) => {
144
176
  ref: ref,
145
177
  ...containerProps,
146
178
  ...resolvedTextProps,
147
- style: textStyles,
179
+ style: getStyleWithGradient(textStyles),
148
180
  dataSet: dataSetValue,
149
181
  children: sanitizeChildren(children)
150
182
  });
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.3.0",
14
- "@telus-uds/system-theme-tokens": "^2.52.0",
14
+ "@telus-uds/system-theme-tokens": "^2.53.0",
15
15
  "airbnb-prop-types": "^2.16.0",
16
16
  "css-mediaquery": "^0.1.2",
17
17
  "expo-linear-gradient": "^12.5.0",
@@ -85,6 +85,6 @@
85
85
  "standard-engine": {
86
86
  "skip": true
87
87
  },
88
- "version": "1.78.0",
88
+ "version": "1.79.0",
89
89
  "types": "types/index.d.ts"
90
90
  }
package/src/Box/Box.jsx CHANGED
@@ -94,7 +94,7 @@ const setBackgroundImage = ({
94
94
  <View style={staticStyles.containedContainer}>
95
95
  <View style={containedViewStyle}>
96
96
  <Image
97
- source={src}
97
+ source={{ uri: src }}
98
98
  alt={alt}
99
99
  style={staticStyles.containedImage}
100
100
  accessibilityIgnoresInvertColors
@@ -106,7 +106,7 @@ const setBackgroundImage = ({
106
106
  }
107
107
  return (
108
108
  <ImageBackground
109
- source={src}
109
+ source={{ uri: src }}
110
110
  alt={alt}
111
111
  style={staticStyles.backgroundImageContainer}
112
112
  resizeMode={backgroundImageResizeMode}
@@ -81,6 +81,8 @@ const selectPreviousNextNavigationButtonStyles = (
81
81
  return styles
82
82
  }
83
83
 
84
+ const selectIconStyles = ({ iconBackgroundColor }) => ({ backgroundColor: iconBackgroundColor })
85
+
84
86
  const [selectProps, selectedSystemPropTypes] = selectSystemProps([a11yProps, viewProps])
85
87
 
86
88
  /**
@@ -509,6 +511,7 @@ const Carousel = React.forwardRef(
509
511
  '%{targetStep}',
510
512
  activeIndex
511
513
  )}
514
+ tokens={selectIconStyles(themeTokens)}
512
515
  />
513
516
  </View>
514
517
  ) : null}
@@ -570,6 +573,7 @@ const Carousel = React.forwardRef(
570
573
  '%{targetStep}',
571
574
  activeIndex + 2
572
575
  )}
576
+ tokens={selectIconStyles(themeTokens)}
573
577
  />
574
578
  </View>
575
579
  ) : null}
@@ -51,7 +51,7 @@ const selectIconProps = ({ iconSize, iconColor }) => ({
51
51
 
52
52
  const selectIconContainerStyles = ({ iconGap }) => ({
53
53
  paddingRight: iconGap,
54
- placeContent: 'center'
54
+ placeContent: 'start'
55
55
  })
56
56
 
57
57
  const selectDismissIconProps = ({ dismissIconSize, dismissIconColor }) => ({
@@ -241,7 +241,7 @@ const Select = forwardRef(
241
241
  onBlur={handleBlur}
242
242
  onMouseOver={handleMouseOver}
243
243
  onMouseOut={handleMouseOut}
244
- onChange={setValue}
244
+ onChange={(e) => setValue(e, null)}
245
245
  value={currentValue}
246
246
  inactive={inactive}
247
247
  placeholder={
@@ -172,12 +172,12 @@ const Step = ({ label, name, status = 0, stepCount = 0, stepIndex = 0, tokens, .
172
172
  style={[staticStyles.knob, selectKnobStyles(themeTokens, isCompleted, isCurrent)]}
173
173
  testID={getStepTestID(isCompleted, isCurrent)}
174
174
  >
175
- {((isCompleted && completedIcon) || (isCurrent && !completedIcon)) && (
176
- <View style={selectCurrentInnerStyles(themeTokens)} />
177
- )}
178
- {isCurrent && completedIcon && (
175
+ {isCompleted && completedIcon && (
179
176
  <Icon icon={completedIcon} tokens={selectCompletedIconTokens(themeTokens)} />
180
177
  )}
178
+ {((isCurrent && completedIcon) || (isCurrent && !completedIcon)) && (
179
+ <View style={selectCurrentInnerStyles(themeTokens)} />
180
+ )}
181
181
  </View>
182
182
  <View
183
183
  style={[
@@ -35,7 +35,8 @@ const selectTextStyles = (
35
35
  textAlign,
36
36
  textTransform,
37
37
  letterSpacing,
38
- textDecorationLine
38
+ textDecorationLine,
39
+ gradient
39
40
  },
40
41
  themeOptions
41
42
  ) =>
@@ -49,7 +50,8 @@ const selectTextStyles = (
49
50
  textAlign,
50
51
  textTransform,
51
52
  letterSpacing,
52
- textDecorationLine
53
+ textDecorationLine,
54
+ gradient
53
55
  })
54
56
 
55
57
  // General-purpose flexible theme-neutral base component for text
@@ -87,6 +89,45 @@ const Typography = forwardRef(
87
89
  : getMaxFontMultiplier(themeTokens)
88
90
  const textDecorationLine = strikeThrough ? 'line-through' : 'none'
89
91
 
92
+ const generateGradientString = (gradientObj) => {
93
+ let gradientStr = ''
94
+
95
+ const {
96
+ type,
97
+ angle,
98
+ stops: [stopOne, stopTwo],
99
+ specification
100
+ } = gradientObj
101
+
102
+ if (type === 'radial') {
103
+ gradientStr = `radial-gradient(${specification}`
104
+ gradientStr += `, ${stopOne.color} ${stopOne.stop * 100}%, ${stopTwo.color} ${
105
+ stopTwo.stop * 100
106
+ }%`
107
+ } else if (type === 'linear') {
108
+ gradientStr = `linear-gradient(${angle}deg`
109
+ if (angle === 135) {
110
+ gradientStr += `, ${stopOne.color}, 75%, ${stopTwo.color}`
111
+ } else {
112
+ gradientStr += `, ${stopOne.color}, ${stopTwo.color}`
113
+ }
114
+ }
115
+
116
+ gradientStr += ')'
117
+ return gradientStr
118
+ }
119
+
120
+ const getStyleWithGradient = (styles) => {
121
+ return styles.gradient
122
+ ? {
123
+ ...styles,
124
+ color: 'transparent',
125
+ backgroundImage: generateGradientString(styles.gradient),
126
+ backgroundClip: 'text'
127
+ }
128
+ : styles
129
+ }
130
+
90
131
  let textStyles
91
132
  let mediaIds
92
133
 
@@ -161,7 +202,11 @@ const Typography = forwardRef(
161
202
 
162
203
  return block ? (
163
204
  <View ref={ref} {...containerProps}>
164
- <Text {...resolvedTextProps} style={textStyles} dataSet={dataSetValue}>
205
+ <Text
206
+ {...resolvedTextProps}
207
+ style={getStyleWithGradient(textStyles)}
208
+ dataSet={dataSetValue}
209
+ >
165
210
  {sanitizeChildren(children)}
166
211
  </Text>
167
212
  </View>
@@ -170,7 +215,7 @@ const Typography = forwardRef(
170
215
  ref={ref}
171
216
  {...containerProps}
172
217
  {...resolvedTextProps}
173
- style={textStyles}
218
+ style={getStyleWithGradient(textStyles)}
174
219
  dataSet={dataSetValue}
175
220
  >
176
221
  {sanitizeChildren(children)}