@widergy/mobile-ui 2.10.0 → 2.12.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,3 +1,17 @@
1
+ # [2.12.0](https://github.com/widergy/mobile-ui/compare/v2.11.0...v2.12.0) (2026-04-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * [AUTO-208] Test id's implementation to form fields ([#492](https://github.com/widergy/mobile-ui/issues/492)) ([7ac3c8b](https://github.com/widergy/mobile-ui/commit/7ac3c8b58a46f554e9bafbd88b4fb24ac6695d50))
7
+
8
+ # [2.11.0](https://github.com/widergy/mobile-ui/compare/v2.10.0...v2.11.0) (2026-04-13)
9
+
10
+
11
+ ### Features
12
+
13
+ * [UGGC-95] UTCoupon ([#493](https://github.com/widergy/mobile-ui/issues/493)) ([11a3367](https://github.com/widergy/mobile-ui/commit/11a336717acfe31e146288981360481b5ad73268))
14
+
1
15
  # [2.10.0](https://github.com/widergy/mobile-ui/compare/v2.9.7...v2.10.0) (2026-04-13)
2
16
 
3
17
 
@@ -22,6 +22,7 @@ class FilePicker extends Component {
22
22
  handleShowPicker = async () => {
23
23
  const {
24
24
  allowedTypes = DEFAULT_ALLOWED_TYPES,
25
+ dataTestId,
25
26
  onMaxSizeError,
26
27
  onError,
27
28
  onChange,
@@ -102,11 +103,13 @@ class FilePicker extends Component {
102
103
  };
103
104
 
104
105
  render() {
105
- const { error, title, filePlaceholder, style, withMarkdownTitle, markdownStyles, disabled } = this.props;
106
+ const { error, title, filePlaceholder, style, withMarkdownTitle, markdownStyles, disabled, dataTestId } =
107
+ this.props;
106
108
  const { fileName } = this.state;
107
109
  return (
108
110
  <View style={style}>
109
111
  <Picker
112
+ dataTestId={dataTestId}
110
113
  icon={UPLOAD_ICON}
111
114
  error={error}
112
115
  onAdd={this.handleShowPicker}
@@ -13,6 +13,7 @@ import styles from './styles';
13
13
 
14
14
  const Picker = ({
15
15
  maxFiles,
16
+ dataTestId,
16
17
  disabled = false,
17
18
  error,
18
19
  filePlaceholder,
@@ -32,9 +33,11 @@ const Picker = ({
32
33
  ) : (
33
34
  uploadedFiles.map((file, index) => (
34
35
  <UploadedFile
36
+ dataTestId={dataTestId}
35
37
  disabled={disabled}
36
38
  file={file}
37
39
  filePlaceholder={filePlaceholder}
40
+ index={index}
38
41
  key={file.name}
39
42
  onDelete={() => onDelete(index)}
40
43
  />
@@ -44,6 +47,7 @@ const Picker = ({
44
47
  {uploadedFiles.length < maxFiles && (
45
48
  <UTButton
46
49
  colorTheme="primary"
50
+ dataTestId={dataTestId ? `${dataTestId}.uploadButton` : undefined}
47
51
  disabled={disabled}
48
52
  Icon="IconUpload"
49
53
  onPress={onAdd}
@@ -72,6 +76,7 @@ const Picker = ({
72
76
 
73
77
  Picker.propTypes = {
74
78
  maxFiles: number,
79
+ dataTestId: string,
75
80
  disabled: bool,
76
81
  error: string,
77
82
  filePlaceholder: string,
@@ -1,4 +1,4 @@
1
- import { string, bool, func, object } from 'prop-types';
1
+ import { string, bool, func, number, object } from 'prop-types';
2
2
  import { View } from 'react-native';
3
3
  import React from 'react';
4
4
 
@@ -11,9 +11,16 @@ import UTLabel from '../../../UTLabel';
11
11
  import { bytesFormater } from './utils';
12
12
  import styles from './styles';
13
13
 
14
- const UploadedFiles = ({ disabled = false, file, filePlaceholder, onDelete }) => {
14
+ const UploadedFiles = ({
15
+ dataTestId,
16
+ disabled = false,
17
+ file,
18
+ filePlaceholder,
19
+ index,
20
+ onDelete
21
+ }) => {
15
22
  return (
16
- <Surface style={styles.container}>
23
+ <Surface style={styles.container} testID={dataTestId ? `${dataTestId}.preview.${index}` : undefined}>
17
24
  <UTIcon name="IconCheck" size={32} colorTheme="accent" shade="04" />
18
25
  <View style={styles.texts}>
19
26
  <UTLabel numberOfLines={1} weight="medium">
@@ -23,15 +30,25 @@ const UploadedFiles = ({ disabled = false, file, filePlaceholder, onDelete }) =>
23
30
  {bytesFormater(file.size)}
24
31
  </UTLabel>
25
32
  </View>
26
- {!disabled && <UTButton Icon="IconTrash" colorTheme="primary" variant="text" onPress={onDelete} />}
33
+ {!disabled && (
34
+ <UTButton
35
+ dataTestId={dataTestId ? `${dataTestId}.delete.${index}` : undefined}
36
+ Icon="IconTrash"
37
+ colorTheme="primary"
38
+ variant="text"
39
+ onPress={onDelete}
40
+ />
41
+ )}
27
42
  </Surface>
28
43
  );
29
44
  };
30
45
 
31
46
  UploadedFiles.propTypes = {
47
+ dataTestId: string,
32
48
  disabled: bool,
33
49
  file: object,
34
50
  filePlaceholder: string,
51
+ index: number,
35
52
  onDelete: func
36
53
  };
37
54
 
@@ -29,6 +29,7 @@ import styles from './styles';
29
29
  const MultipleFilePicker = ({
30
30
  allowedPDFUploadSizes,
31
31
  allowedTypes,
32
+ dataTestId,
32
33
  disabled,
33
34
  enabledInputs: { camera, files, gallery } = { files: true },
34
35
  error,
@@ -401,8 +402,9 @@ const MultipleFilePicker = ({
401
402
  };
402
403
 
403
404
  return (
404
- <View style={style}>
405
+ <View style={style} testID={dataTestId}>
405
406
  <Picker
407
+ dataTestId={dataTestId}
406
408
  disabled={disabled}
407
409
  error={error}
408
410
  filePlaceholder={filePlaceholder}
@@ -421,25 +423,29 @@ const MultipleFilePicker = ({
421
423
  Icon: 'IconCamera',
422
424
  onPress: onPickCamera,
423
425
  show: camera,
426
+ testIdModifier: 'camera',
424
427
  text: 'Cámara'
425
428
  },
426
429
  {
427
430
  Icon: 'IconPhoto',
428
431
  onPress: onPickGallery,
429
432
  show: gallery,
433
+ testIdModifier: 'gallery',
430
434
  text: 'Fotos'
431
435
  },
432
436
  {
433
437
  Icon: 'IconFileArrowRight',
434
438
  onPress: onPickFiles,
435
439
  show: files,
440
+ testIdModifier: 'files',
436
441
  text: 'Archivos'
437
442
  }
438
443
  ].map(
439
- ({ Icon, onPress, show, text }) =>
444
+ ({ Icon, onPress, show, testIdModifier, text }) =>
440
445
  show && (
441
446
  <UTButton
442
447
  colorTheme="secondary"
448
+ dataTestId={dataTestId ? `${dataTestId}.${testIdModifier}` : undefined}
443
449
  Icon={Icon}
444
450
  key={text}
445
451
  onPress={onPress}
@@ -11,6 +11,7 @@ import { withTheme, themeType } from '../../theming';
11
11
  import styles from './styles';
12
12
 
13
13
  const Picker = ({
14
+ dataTestId,
14
15
  icon,
15
16
  error,
16
17
  onAdd,
@@ -35,7 +36,13 @@ const Picker = ({
35
36
  </Label>
36
37
  )}
37
38
  <View style={styles.fieldInput}>
38
- <Touchable borderless style={styles.touchable} disabled={disabled} onPress={onAdd}>
39
+ <Touchable
40
+ borderless
41
+ style={styles.touchable}
42
+ dataTestId={dataTestId}
43
+ disabled={disabled}
44
+ onPress={onAdd}
45
+ >
39
46
  <Input
40
47
  backgroundColor="transparent"
41
48
  value={fileName}
@@ -59,6 +66,7 @@ const Picker = ({
59
66
  );
60
67
 
61
68
  Picker.propTypes = {
69
+ dataTestId: string,
62
70
  icon: string.isRequired,
63
71
  error: oneOfType([string, bool]),
64
72
  onAdd: func.isRequired,
@@ -18,12 +18,12 @@ class RadioGroup extends Component {
18
18
  onOptionChange(option && option[keyField]);
19
19
  };
20
20
 
21
- renderOptions = option => {
21
+ renderOptions = (option, index) => {
22
22
  const { selectedOption, radioProps, keyField, disabled, dataTestId } = this.props;
23
23
  return (
24
24
  <RadioButton
25
25
  style={styles.radio}
26
- dataTestId={dataTestId ? `${dataTestId}.radioButton_${option.id}` : undefined}
26
+ dataTestId={dataTestId ? `${dataTestId}.button.${index}` : undefined}
27
27
  option={option}
28
28
  key={option.id}
29
29
  label={option.label}
@@ -0,0 +1,69 @@
1
+ # UTCoupon
2
+
3
+ Tarjeta de cupón seleccionable usada en flujos de pedidos. Muestra imagen de marca, nombre del producto, condiciones de uso, fecha de vencimiento y precio. Soporta tres estados: default, activo y agotado.
4
+
5
+ La forma de ticket (recortes elípticos en los bordes laterales) se implementa con SVG.
6
+
7
+ ## Props
8
+
9
+ | Prop | Tipo | Default | Descripción |
10
+ | ------------ | --------------------------- | ------- | ------------------------------------------------------------------------------------------ |
11
+ | `image` | `number \| { uri: string }` | — | Fuente de imagen para la sección izquierda (misma forma que `Image` source de RN) |
12
+ | `detail` | `string` | — | Texto pequeño superior (ej. municipio, código de producto) |
13
+ | `title` | `string` | — | Texto principal central (ej. "Carga 11Kg") |
14
+ | `subtitle` | `string` | — | Texto secundario inferior (ej. "1 uso mensualmente") |
15
+ | `value` | `string` | — | Texto de la sección derecha (ej. "$2.500") |
16
+ | `active` | `bool` | `false` | Estado seleccionado: borde azul. Mutuamente excluyente con `disabled`. |
17
+ | `disabled` | `bool` | `false` | Estado agotado: overlay gris, `onPress` deshabilitado. Mutuamente excluyente con `active`. |
18
+ | `onPress` | `func` | — | Callback de selección. Se ignora si `disabled` es `true`. |
19
+ | `style` | `shape` | `{}` | Overrides de estilo por subelemento (ver tabla de llaves). |
20
+ | `dataTestId` | `string` | — | ID raíz; los subelementos añaden sufijos automáticamente. |
21
+
22
+ ## Uso
23
+
24
+ ```jsx
25
+ import { UTCoupon } from '@widergy/mobile-ui';
26
+
27
+ // Default
28
+ <UTCoupon
29
+ image={require('./assets/logo.png')}
30
+ detail="Mun. Las Condes"
31
+ title="Carga 11Kg"
32
+ subtitle="1 uso mensualmente"
33
+ value="$2.500"
34
+ onPress={() => handleSelect(coupon)}
35
+ />
36
+
37
+ // Activo (seleccionado)
38
+ <UTCoupon
39
+ image={{ uri: 'https://example.com/logo.png' }}
40
+ detail="ANM51-1000220101-3"
41
+ title="Carga 11Kg"
42
+ subtitle="Vence el 16/08/2025"
43
+ value="$2.500"
44
+ active
45
+ onPress={() => handleSelect(coupon)}
46
+ />
47
+
48
+ // Agotado
49
+ <UTCoupon
50
+ image={require('./assets/logo.png')}
51
+ title="Carga 11Kg"
52
+ subtitle="Sin stock"
53
+ value="$2.500"
54
+ disabled
55
+ />
56
+ ```
57
+
58
+ ## Test IDs
59
+
60
+ Dado `dataTestId="coupon"`, los subelementos reciben:
61
+
62
+ | Subelemento | testID |
63
+ | ----------- | ---------------------- |
64
+ | Raíz | `"coupon"` |
65
+ | Imagen | `"coupon.icon"` |
66
+ | Detail | `"coupon.description"` |
67
+ | Title | `"coupon.titleText"` |
68
+ | Subtitle | `"coupon.subtitle"` |
69
+ | Value | `"coupon.label"` |
@@ -0,0 +1,8 @@
1
+ export const BORDER_RADIUS = 12;
2
+
3
+ export const ICON_SECTION_WIDTH = 80;
4
+
5
+ // Notch (elliptical cutout at top/bottom edges, centered near the icon section right edge)
6
+ export const NOTCH_RADIUS_X = 26; // horizontal semi-axis (notch width = 52)
7
+ export const NOTCH_RADIUS_Y = 8; // vertical semi-axis (notch depth from edge = 8)
8
+ export const NOTCH_CENTER_X = 104; // fixed x position of the notch center
@@ -0,0 +1,159 @@
1
+ import React, { memo, useRef, useState } from 'react';
2
+ import { Image, TouchableOpacity, View } from 'react-native';
3
+ import { ClipPath, Defs, Path, Rect, Svg } from 'react-native-svg';
4
+
5
+ import UTLabel from '../UTLabel';
6
+ import { useTheme } from '../../theming';
7
+ import { TEST_ID_CONSTANTS } from '../../constants/testIds';
8
+
9
+ import { defaultProps, propTypes } from './proptypes';
10
+ import { retrieveStyle } from './theme';
11
+ import { ICON_SECTION_WIDTH } from './constants';
12
+ import { buildCouponPath } from './utils';
13
+
14
+ const {
15
+ description: detailTestId,
16
+ icon: iconTestId,
17
+ label: valueTestId,
18
+ subtitle: subtitleTestId,
19
+ titleText: titleTestId
20
+ } = TEST_ID_CONSTANTS;
21
+
22
+ const UTCoupon = ({
23
+ active = false,
24
+ dataTestId,
25
+ detail,
26
+ disabled = false,
27
+ image,
28
+ onPress,
29
+ style,
30
+ subtitle,
31
+ title,
32
+ value
33
+ }) => {
34
+ const theme = useTheme();
35
+ const themedStyles = retrieveStyle({ theme, style });
36
+ const [cardLayout, setCardLayout] = useState({ width: 0, height: 0 });
37
+ const clipId = useRef(`clip${Math.random()}`).current;
38
+
39
+ const handleLayout = ({ nativeEvent: { layout } }) => {
40
+ if (layout.width !== cardLayout.width || layout.height !== cardLayout.height) {
41
+ setCardLayout({ width: layout.width, height: layout.height });
42
+ }
43
+ };
44
+
45
+ const couponPath = cardLayout.width > 0 ? buildCouponPath(cardLayout.width, cardLayout.height) : null;
46
+
47
+ const couponBorderPath =
48
+ active && cardLayout.width > 0 ? buildCouponPath(cardLayout.width, cardLayout.height, 1) : null; // Border path inset by 1px (= strokeWidth/2) so the full 2px stroke renders
49
+
50
+ return (
51
+ <View testID={dataTestId} style={themedStyles.root} onLayout={handleLayout}>
52
+ {couponPath && (
53
+ <Svg width={cardLayout.width} height={cardLayout.height} style={themedStyles.absoluteFill}>
54
+ <Defs>
55
+ <ClipPath id={clipId}>
56
+ <Path d={couponPath} />
57
+ </ClipPath>
58
+ </Defs>
59
+ <Path d={couponPath} fill={theme.Palette.light['01']} />
60
+ <Rect
61
+ x={0}
62
+ y={0}
63
+ width={ICON_SECTION_WIDTH}
64
+ height={cardLayout.height}
65
+ fill={theme.Palette.information['01']}
66
+ clipPath={`url(#${clipId})`}
67
+ />
68
+ </Svg>
69
+ )}
70
+
71
+ <TouchableOpacity
72
+ style={themedStyles.contentRow}
73
+ onPress={disabled ? undefined : onPress}
74
+ activeOpacity={disabled ? 1 : 0.7}
75
+ >
76
+ <View style={themedStyles.iconContainer}>
77
+ {image && (
78
+ <Image
79
+ testID={dataTestId ? `${dataTestId}.${iconTestId}` : undefined}
80
+ source={image}
81
+ style={[themedStyles.image, { height: cardLayout.height }]}
82
+ />
83
+ )}
84
+ </View>
85
+
86
+ <View style={themedStyles.rightSection}>
87
+ <View style={themedStyles.textContainer}>
88
+ {detail && (
89
+ <UTLabel
90
+ dataTestId={dataTestId ? `${dataTestId}.${detailTestId}` : undefined}
91
+ colorTheme="gray"
92
+ variant="xsmall"
93
+ style={themedStyles.detail}
94
+ >
95
+ {detail}
96
+ </UTLabel>
97
+ )}
98
+ {title && (
99
+ <UTLabel
100
+ dataTestId={dataTestId ? `${dataTestId}.${titleTestId}` : undefined}
101
+ colorTheme="dark"
102
+ variant="title2"
103
+ weight="medium"
104
+ style={themedStyles.title}
105
+ >
106
+ {title}
107
+ </UTLabel>
108
+ )}
109
+ {subtitle && (
110
+ <UTLabel
111
+ dataTestId={dataTestId ? `${dataTestId}.${subtitleTestId}` : undefined}
112
+ colorTheme="gray"
113
+ variant="small"
114
+ style={themedStyles.subtitle}
115
+ >
116
+ {subtitle}
117
+ </UTLabel>
118
+ )}
119
+ </View>
120
+
121
+ {value && (
122
+ <UTLabel
123
+ dataTestId={dataTestId ? `${dataTestId}.${valueTestId}` : undefined}
124
+ colorTheme="accent"
125
+ variant="title2"
126
+ weight="medium"
127
+ style={themedStyles.value}
128
+ >
129
+ {value}
130
+ </UTLabel>
131
+ )}
132
+ </View>
133
+ </TouchableOpacity>
134
+
135
+ {disabled && (
136
+ <View style={[themedStyles.absoluteFill, themedStyles.disabledOverlay]} pointerEvents="none" />
137
+ )}
138
+
139
+ {couponBorderPath && (
140
+ <View style={themedStyles.absoluteFill} pointerEvents="none">
141
+ <Svg width={cardLayout.width} height={cardLayout.height} style={themedStyles.absoluteFill}>
142
+ <Path
143
+ d={couponBorderPath}
144
+ fill="none"
145
+ stroke={theme.Palette.accent['05']}
146
+ strokeWidth={2}
147
+ strokeLinejoin="round"
148
+ />
149
+ </Svg>
150
+ </View>
151
+ )}
152
+ </View>
153
+ );
154
+ };
155
+
156
+ UTCoupon.propTypes = propTypes;
157
+ UTCoupon.defaultProps = defaultProps;
158
+
159
+ export default memo(UTCoupon);
@@ -0,0 +1,29 @@
1
+ import { bool, func, number, object, oneOfType, shape, string } from 'prop-types';
2
+
3
+ export const propTypes = {
4
+ image: oneOfType([number, shape({ uri: string })]),
5
+ detail: string,
6
+ title: string,
7
+ subtitle: string,
8
+ value: string,
9
+ active: bool,
10
+ disabled: bool,
11
+ onPress: func,
12
+ dataTestId: string,
13
+ style: shape({
14
+ root: object,
15
+ iconContainer: object,
16
+ image: object,
17
+ textContainer: object,
18
+ detail: object,
19
+ title: object,
20
+ subtitle: object,
21
+ value: object
22
+ })
23
+ };
24
+
25
+ export const defaultProps = {
26
+ active: false,
27
+ disabled: false,
28
+ style: {}
29
+ };
@@ -0,0 +1,71 @@
1
+ import { getShadow, mergeMultipleStyles } from '../../utils/styleUtils';
2
+
3
+ import { BORDER_RADIUS, ICON_SECTION_WIDTH } from './constants';
4
+
5
+ const ownStyles = {
6
+ root: {
7
+ width: '100%'
8
+ },
9
+ absoluteFill: {
10
+ position: 'absolute',
11
+ left: 0,
12
+ right: 0,
13
+ top: 0,
14
+ bottom: 0
15
+ },
16
+ contentRow: {
17
+ flexDirection: 'row',
18
+ alignItems: 'stretch'
19
+ },
20
+ iconContainer: {
21
+ width: ICON_SECTION_WIDTH,
22
+ alignSelf: 'stretch',
23
+ alignItems: 'center',
24
+ justifyContent: 'center',
25
+ borderTopLeftRadius: BORDER_RADIUS,
26
+ borderBottomLeftRadius: BORDER_RADIUS,
27
+ overflow: 'hidden'
28
+ },
29
+ image: {
30
+ position: 'absolute',
31
+ top: 0,
32
+ left: 0,
33
+ width: ICON_SECTION_WIDTH,
34
+ resizeMode: 'cover'
35
+ },
36
+ rightSection: {
37
+ flex: 1,
38
+ flexDirection: 'row',
39
+ alignItems: 'center',
40
+ paddingVertical: 18,
41
+ paddingLeft: 14,
42
+ paddingRight: 14
43
+ },
44
+ textContainer: {
45
+ flex: 1,
46
+ gap: 4
47
+ },
48
+ detail: {},
49
+ title: {},
50
+ subtitle: {},
51
+ value: {
52
+ marginLeft: 8,
53
+ textAlign: 'right'
54
+ },
55
+ disabledOverlay: {
56
+ borderRadius: BORDER_RADIUS
57
+ }
58
+ };
59
+
60
+ const getThemeStyles = theme => ({
61
+ root: {
62
+ borderRadius: BORDER_RADIUS * 2,
63
+ ...getShadow({ level: 1, theme })
64
+ },
65
+ disabledOverlay: {
66
+ backgroundColor: theme.colors.effect
67
+ }
68
+ });
69
+
70
+ export const retrieveStyle = ({ theme, style = {} }) =>
71
+ mergeMultipleStyles(ownStyles, getThemeStyles(theme), theme?.UTCoupon, style);
@@ -0,0 +1,40 @@
1
+ import { BORDER_RADIUS, NOTCH_CENTER_X, NOTCH_RADIUS_X, NOTCH_RADIUS_Y } from './constants';
2
+
3
+ // Traces a rounded rectangle with two concave half-ellipse notches on the top and bottom edges, centered at x = NOTCH_CENTER_X.
4
+ // `inset` shifts all edges inward by this many pixels — use strokeWidth/2 so the full stroke renders within the SVG viewport without clipping.
5
+ export const buildCouponPath = (width, height, inset = 0) => {
6
+ // KAPPA = 4*(√2−1)/3 ≈ 0.5523: the control-point ratio that best fits a cubic bezier to a quarter-ellipse arc (minimises radial error at t=0.5).
7
+ const KAPPA = 0.5523;
8
+
9
+ const cornerR = BORDER_RADIUS - inset; // effective corner radius after inset
10
+ const notchX = NOTCH_CENTER_X; // x position of the notch center
11
+ const notchRx = NOTCH_RADIUS_X; // notch horizontal semi-axis (width)
12
+ const notchRy = NOTCH_RADIUS_Y; // notch vertical semi-axis (depth)
13
+ const notchCp = notchRx * KAPPA; // bezier control-point offset for notch curves
14
+ const cornerCp = cornerR * KAPPA; // bezier control-point offset for corner curves
15
+
16
+ return [
17
+ `M ${cornerR + inset} ${inset}`,
18
+ `L ${notchX - notchRx} ${inset}`,
19
+ // Top notch: two beziers forming a half-ellipse curving DOWNWARD into the card.
20
+ `C ${notchX - notchRx + notchCp} ${inset} ${notchX - notchCp} ${inset + notchRy} ${notchX} ${inset + notchRy}`,
21
+ `C ${notchX + notchCp} ${inset + notchRy} ${notchX + notchRx - notchCp} ${inset} ${notchX + notchRx} ${inset}`,
22
+ `L ${width - cornerR - inset} ${inset}`,
23
+ // Top-right corner
24
+ `C ${width - cornerR - inset + cornerCp} ${inset} ${width - inset} ${inset + cornerCp} ${width - inset} ${cornerR + inset}`,
25
+ `L ${width - inset} ${height - cornerR - inset}`,
26
+ // Bottom-right corner
27
+ `C ${width - inset} ${height - cornerR - inset + cornerCp} ${width - cornerR - inset + cornerCp} ${height - inset} ${width - cornerR - inset} ${height - inset}`,
28
+ `L ${notchX + notchRx} ${height - inset}`,
29
+ // Bottom notch: two beziers forming a half-ellipse curving UPWARD into the card.
30
+ `C ${notchX + notchRx - notchCp} ${height - inset} ${notchX + notchCp} ${height - inset - notchRy} ${notchX} ${height - inset - notchRy}`,
31
+ `C ${notchX - notchCp} ${height - inset - notchRy} ${notchX - notchRx + notchCp} ${height - inset} ${notchX - notchRx} ${height - inset}`,
32
+ `L ${cornerR + inset} ${height - inset}`,
33
+ // Bottom-left corner
34
+ `C ${cornerR + inset - cornerCp} ${height - inset} ${inset} ${height - cornerR - inset + cornerCp} ${inset} ${height - cornerR - inset}`,
35
+ `L ${inset} ${cornerR + inset}`,
36
+ // Top-left corner
37
+ `C ${inset} ${cornerR + inset - cornerCp} ${cornerR + inset - cornerCp} ${inset} ${cornerR + inset} ${inset}`,
38
+ 'Z'
39
+ ].join(' ');
40
+ };
@@ -9,6 +9,7 @@ import ownStyles from './styles';
9
9
  import switchProptypes from './proptypes';
10
10
 
11
11
  const UTSwitch = ({
12
+ dataTestId,
12
13
  disabled,
13
14
  style,
14
15
  onColor,
@@ -101,6 +102,7 @@ const UTSwitch = ({
101
102
  onPressIn={onClick}
102
103
  onPressOut={onClickEnd}
103
104
  hitSlop={hitSlop}
105
+ testID={dataTestId}
104
106
  >
105
107
  <Animated.View
106
108
  style={[
package/lib/index.js CHANGED
@@ -44,6 +44,7 @@ export { default as UTButton } from './components/UTButton';
44
44
  export { default as UTButtonGroup } from './components/UTButtonGroup';
45
45
  export { default as UTCBUInput } from './components/UTCBUInput';
46
46
  export { default as UTCheckBox } from './components/UTCheckBox';
47
+ export { default as UTCoupon } from './components/UTCoupon';
47
48
  export { default as UTCuit } from './components/UTCuit';
48
49
  export { default as UTCheckList } from './components/UTCheckList';
49
50
  export { default as UTDataCategory } from './components/UTDataCategory';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@widergy/mobile-ui",
3
3
  "description": "Widergy Mobile Components",
4
4
  "author": "widergy",
5
- "version": "2.10.0",
5
+ "version": "2.12.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [