@widergy/mobile-ui 2.12.1 → 2.13.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 +14 -0
- package/lib/components/FilePicker/index.js +0 -1
- package/lib/components/MultipleFilePicker/components/UploadedFiles/index.js +1 -8
- package/lib/components/UTCoupon/index.js +2 -2
- package/lib/components/UTStatus/README.md +81 -13
- package/lib/components/UTStatus/constants.js +4 -0
- package/lib/components/UTStatus/index.js +18 -4
- package/lib/components/UTStatus/theme.js +22 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [2.13.0](https://github.com/widergy/mobile-ui/compare/v2.12.2...v2.13.0) (2026-04-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [CX-2188] new size utstatus ([#499](https://github.com/widergy/mobile-ui/issues/499)) ([de280e4](https://github.com/widergy/mobile-ui/commit/de280e4b20731ce0b53a65ab20ba684004cd4c62))
|
|
7
|
+
|
|
8
|
+
## [2.12.2](https://github.com/widergy/mobile-ui/compare/v2.12.1...v2.12.2) (2026-04-17)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [UGGC-101] utcoupon title size ([#498](https://github.com/widergy/mobile-ui/issues/498)) ([7544789](https://github.com/widergy/mobile-ui/commit/7544789f1f25bdf10bfd77d80816a32b586cfe10))
|
|
14
|
+
|
|
1
15
|
## [2.12.1](https://github.com/widergy/mobile-ui/compare/v2.12.0...v2.12.1) (2026-04-14)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -11,14 +11,7 @@ import UTLabel from '../../../UTLabel';
|
|
|
11
11
|
import { bytesFormater } from './utils';
|
|
12
12
|
import styles from './styles';
|
|
13
13
|
|
|
14
|
-
const UploadedFiles = ({
|
|
15
|
-
dataTestId,
|
|
16
|
-
disabled = false,
|
|
17
|
-
file,
|
|
18
|
-
filePlaceholder,
|
|
19
|
-
index,
|
|
20
|
-
onDelete
|
|
21
|
-
}) => {
|
|
14
|
+
const UploadedFiles = ({ dataTestId, disabled = false, file, filePlaceholder, index, onDelete }) => {
|
|
22
15
|
return (
|
|
23
16
|
<Surface style={styles.container} testID={dataTestId ? `${dataTestId}.preview.${index}` : undefined}>
|
|
24
17
|
<UTIcon name="IconCheck" size={32} colorTheme="accent" shade="04" />
|
|
@@ -99,7 +99,7 @@ const UTCoupon = ({
|
|
|
99
99
|
<UTLabel
|
|
100
100
|
dataTestId={dataTestId ? `${dataTestId}.${titleTestId}` : undefined}
|
|
101
101
|
colorTheme="dark"
|
|
102
|
-
variant="
|
|
102
|
+
variant="title3"
|
|
103
103
|
weight="medium"
|
|
104
104
|
style={themedStyles.title}
|
|
105
105
|
>
|
|
@@ -122,7 +122,7 @@ const UTCoupon = ({
|
|
|
122
122
|
<UTLabel
|
|
123
123
|
dataTestId={dataTestId ? `${dataTestId}.${valueTestId}` : undefined}
|
|
124
124
|
colorTheme="accent"
|
|
125
|
-
variant="
|
|
125
|
+
variant="title3"
|
|
126
126
|
weight="medium"
|
|
127
127
|
style={themedStyles.value}
|
|
128
128
|
>
|
|
@@ -1,24 +1,92 @@
|
|
|
1
1
|
# UTStatus
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Descripción
|
|
4
4
|
|
|
5
|
-
`UTStatus`
|
|
5
|
+
`UTStatus` es un indicador de estado que combina un ícono y una etiqueta de texto. Es completamente consciente del tema y soporta múltiples variantes de color y tamaños. Está diseñado para ser flexible y personalizable.
|
|
6
6
|
|
|
7
7
|
## Props
|
|
8
8
|
|
|
9
|
-
|
|
|
10
|
-
| ----------- | ------ |
|
|
11
|
-
| Icon | string | -
|
|
12
|
-
| labelProps | object | {}
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
9
|
+
| Nombre | Tipo | Default | Descripción |
|
|
10
|
+
| ----------- | ------ | ----------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| Icon | string | - | Nombre de un ícono personalizado. Si se omite, se usa el ícono por defecto según la variante. |
|
|
12
|
+
| labelProps | object | {} | Props adicionales que se pasan al componente `UTLabel` interno. |
|
|
13
|
+
| shade | string | `'01'` | Shade de la paleta para la variante especificada. |
|
|
14
|
+
| size | string | - | Tamaño del componente. Ver tabla de tamaños. Si se omite, se usa el tamaño por defecto. |
|
|
15
|
+
| style | object | - | Estilos personalizados para aplicar al componente. |
|
|
16
|
+
| variant | string | `'success'` | Define el ícono por defecto y el color de fondo del contenedor. Ver tabla de variantes. |
|
|
17
|
+
| withoutIcon | bool | `false` | Si es `true`, no se renderiza el ícono. |
|
|
17
18
|
|
|
18
|
-
##
|
|
19
|
+
## Tamaños
|
|
20
|
+
|
|
21
|
+
La prop `size` es opcional. Sin ella, el componente usa el tamaño por defecto.
|
|
22
|
+
|
|
23
|
+
| `size` | Ícono | Variante de fuente | Padding V / H | Gap |
|
|
24
|
+
| ---------- | ----- | ------------------ | ------------- | ---- |
|
|
25
|
+
| `"xsmall"` | 14px | `xsmall` | 2px / 4px | 4px |
|
|
26
|
+
| sin prop | — | `body` | 4px / 8px | 8px |
|
|
27
|
+
|
|
28
|
+
Los tamaños de fuente son los definidos por `UTLabel` para cada variante y pueden ser escalados por el sistema.
|
|
29
|
+
|
|
30
|
+
## Variantes
|
|
31
|
+
|
|
32
|
+
| Variante | Ícono por defecto | Color de fondo |
|
|
33
|
+
| ------------- | -------------------- | -------------------- |
|
|
34
|
+
| `success` | `IconCheck` | `Palette.success` |
|
|
35
|
+
| `error` | `IconX` | `Palette.error` |
|
|
36
|
+
| `warning` | `IconAlertTriangle` | `Palette.warning` |
|
|
37
|
+
| `information` | `IconInfoCircle` | `Palette.information`|
|
|
38
|
+
| `accent` | `IconInfoCircle` | `Palette.accent` |
|
|
39
|
+
| `gray` | `IconArchive` | `Palette.gray` |
|
|
40
|
+
|
|
41
|
+
## Ejemplos
|
|
42
|
+
|
|
43
|
+
### Uso básico
|
|
44
|
+
|
|
45
|
+
```jsx
|
|
46
|
+
<UTStatus variant="success">Operación exitosa</UTStatus>
|
|
47
|
+
<UTStatus variant="error">Ocurrió un error</UTStatus>
|
|
48
|
+
<UTStatus variant="warning">Atención requerida</UTStatus>
|
|
49
|
+
<UTStatus variant="information">Información disponible</UTStatus>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Tamaño xsmall
|
|
53
|
+
|
|
54
|
+
```jsx
|
|
55
|
+
<UTStatus size="xsmall" variant="success">Exitoso</UTStatus>
|
|
56
|
+
<UTStatus size="xsmall" variant="error">Error</UTStatus>
|
|
57
|
+
<UTStatus size="xsmall" variant="warning">Advertencia</UTStatus>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Con shade personalizado
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
<UTStatus shade="03" variant="error">Error shade 03</UTStatus>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Con ícono personalizado
|
|
67
|
+
|
|
68
|
+
```jsx
|
|
69
|
+
<UTStatus Icon="IconShoppingCart" variant="accent">En carrito</UTStatus>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Sin ícono
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
<UTStatus variant="information" withoutIcon>Solo texto</UTStatus>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Con markdown
|
|
79
|
+
|
|
80
|
+
```jsx
|
|
81
|
+
<UTStatus labelProps={{ withMarkdown: true }} variant="accent">
|
|
82
|
+
Estado **con markdown**
|
|
83
|
+
</UTStatus>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Con estilos personalizados
|
|
19
87
|
|
|
20
88
|
```jsx
|
|
21
|
-
<UTStatus
|
|
22
|
-
|
|
89
|
+
<UTStatus style={{ container: { borderRadius: 8 } }} variant="success">
|
|
90
|
+
Borde redondeado
|
|
23
91
|
</UTStatus>
|
|
24
92
|
```
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { View } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { bool, object, string } from 'prop-types';
|
|
3
|
+
import { bool, node, object, string } from 'prop-types';
|
|
4
4
|
|
|
5
5
|
import UTLabel from '../UTLabel';
|
|
6
6
|
import UTIcon from '../UTIcon';
|
|
7
7
|
import { mergeMultipleStyles } from '../../utils/styleUtils';
|
|
8
8
|
import { useTheme } from '../../theming';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
defaultIconMapper,
|
|
12
|
+
getIconSize,
|
|
13
|
+
getLabelVariant,
|
|
14
|
+
getSizeStyles,
|
|
15
|
+
getVariantStyles,
|
|
16
|
+
ownStyles
|
|
17
|
+
} from './theme';
|
|
11
18
|
import { VARIANTS } from './constants';
|
|
12
19
|
|
|
13
20
|
const UTStatus = ({
|
|
@@ -15,6 +22,7 @@ const UTStatus = ({
|
|
|
15
22
|
Icon,
|
|
16
23
|
labelProps = {},
|
|
17
24
|
shade = '01',
|
|
25
|
+
size,
|
|
18
26
|
style,
|
|
19
27
|
variant = VARIANTS.success,
|
|
20
28
|
withoutIcon
|
|
@@ -22,15 +30,18 @@ const UTStatus = ({
|
|
|
22
30
|
const theme = useTheme();
|
|
23
31
|
const themedStyles = mergeMultipleStyles(
|
|
24
32
|
ownStyles,
|
|
33
|
+
getSizeStyles(size),
|
|
25
34
|
getVariantStyles(theme)({ variant, shade }),
|
|
26
35
|
theme?.UTStatus,
|
|
27
36
|
style
|
|
28
37
|
);
|
|
29
38
|
const StatusIcon = Icon ?? defaultIconMapper(variant);
|
|
39
|
+
const iconSize = getIconSize(size);
|
|
40
|
+
const labelVariant = getLabelVariant(size);
|
|
30
41
|
return (
|
|
31
42
|
<View style={themedStyles.container}>
|
|
32
|
-
{withoutIcon ? null : <UTIcon colorTheme={variant} name={StatusIcon} />}
|
|
33
|
-
<UTLabel colorTheme={variant} {...labelProps}>
|
|
43
|
+
{withoutIcon ? null : <UTIcon colorTheme={variant} name={StatusIcon} size={iconSize} />}
|
|
44
|
+
<UTLabel colorTheme={variant} variant={labelVariant} {...labelProps}>
|
|
34
45
|
{children}
|
|
35
46
|
</UTLabel>
|
|
36
47
|
</View>
|
|
@@ -38,9 +49,12 @@ const UTStatus = ({
|
|
|
38
49
|
};
|
|
39
50
|
|
|
40
51
|
UTStatus.propTypes = {
|
|
52
|
+
children: node,
|
|
41
53
|
Icon: string,
|
|
42
54
|
labelProps: object,
|
|
43
55
|
shade: string,
|
|
56
|
+
size: string,
|
|
57
|
+
style: object,
|
|
44
58
|
variant: string,
|
|
45
59
|
withoutIcon: bool
|
|
46
60
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VARIANTS } from './constants';
|
|
1
|
+
import { SIZES, VARIANTS } from './constants';
|
|
2
2
|
|
|
3
3
|
export const defaultIconMapper = variant =>
|
|
4
4
|
({
|
|
@@ -10,6 +10,27 @@ export const defaultIconMapper = variant =>
|
|
|
10
10
|
[VARIANTS.warning]: 'IconAlertTriangle'
|
|
11
11
|
})[variant];
|
|
12
12
|
|
|
13
|
+
export const getIconSize = size =>
|
|
14
|
+
({
|
|
15
|
+
[SIZES.xsmall]: 14
|
|
16
|
+
})[size];
|
|
17
|
+
|
|
18
|
+
export const getLabelVariant = size =>
|
|
19
|
+
({
|
|
20
|
+
[SIZES.xsmall]: 'xsmall'
|
|
21
|
+
})[size];
|
|
22
|
+
|
|
23
|
+
export const getSizeStyles = size =>
|
|
24
|
+
({
|
|
25
|
+
[SIZES.xsmall]: {
|
|
26
|
+
container: {
|
|
27
|
+
gap: 4,
|
|
28
|
+
paddingHorizontal: 4,
|
|
29
|
+
paddingVertical: 2
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
})[size] || {};
|
|
33
|
+
|
|
13
34
|
export const ownStyles = {
|
|
14
35
|
container: {
|
|
15
36
|
flexDirection: 'row',
|
package/package.json
CHANGED