@widergy/mobile-ui 1.48.1 → 1.48.2
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 +7 -0
- package/lib/components/UTProductItem/components/Status/index.js +2 -6
- package/lib/components/UTStatus/README.md +2 -2
- package/lib/components/UTStatus/constants.js +0 -6
- package/lib/components/UTStatus/index.js +6 -6
- package/lib/components/UTStatus/theme.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.48.2](https://github.com/widergy/mobile-ui/compare/v1.48.1...v1.48.2) (2025-06-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [UGC-1544] utstatus fixes ([#440](https://github.com/widergy/mobile-ui/issues/440)) ([3eae576](https://github.com/widergy/mobile-ui/commit/3eae5762502ac9c57935ac290510fa0d2cd3534b))
|
|
7
|
+
|
|
1
8
|
## [1.48.1](https://github.com/widergy/mobile-ui/compare/v1.48.0...v1.48.1) (2025-06-09)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -5,16 +5,12 @@ import { bool, object, shape, string } from 'prop-types';
|
|
|
5
5
|
import UTStatus from '../../../UTStatus';
|
|
6
6
|
|
|
7
7
|
const Status = ({ shouldUseGap, statusProps, themedStyles }) => {
|
|
8
|
-
const {
|
|
8
|
+
const { label } = statusProps;
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
11
|
<UTStatus
|
|
12
|
-
Icon={Icon}
|
|
13
|
-
labelProps={labelProps}
|
|
14
12
|
style={{ container: [shouldUseGap ? themedStyles.gap : '', themedStyles.status] }}
|
|
15
|
-
|
|
16
|
-
variant={variant}
|
|
17
|
-
withoutIcon={withoutIcon}
|
|
13
|
+
{...statusProps}
|
|
18
14
|
>
|
|
19
15
|
{label}
|
|
20
16
|
</UTStatus>
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
| Icon | string | - | Allows display for a custom icon. If omitted, a default Icon for the variant will be used. |
|
|
12
12
|
| labelProps | object | {} | Props to pass down to the internal UTLabel component. |
|
|
13
13
|
| style | object | - | Custom styles to apply to the component. |
|
|
14
|
-
|
|
|
14
|
+
| shade | string | '01' | Shade to apply to the palette variant specified |
|
|
15
15
|
| variant | string | 'success' | The variant will defined the default icon that the component will render, as well as the background color for the status container. |
|
|
16
16
|
| withoutIcon | bool | false | if `true`, no icon will be rendered. |
|
|
17
17
|
|
|
18
18
|
## Example
|
|
19
19
|
|
|
20
20
|
```jsx
|
|
21
|
-
<UTStatus variant="error"
|
|
21
|
+
<UTStatus variant="error" shade="03" labelProps={{ withMarkdown: true }}>
|
|
22
22
|
Error con Markdown
|
|
23
23
|
</UTStatus>
|
|
24
24
|
```
|
|
@@ -8,29 +8,29 @@ import { mergeMultipleStyles } from '../../utils/styleUtils';
|
|
|
8
8
|
import { useTheme } from '../../theming';
|
|
9
9
|
|
|
10
10
|
import { defaultIconMapper, ownStyles, getVariantStyles } from './theme';
|
|
11
|
-
import {
|
|
11
|
+
import { VARIANTS } from './constants';
|
|
12
12
|
|
|
13
13
|
const UTStatus = ({
|
|
14
14
|
children,
|
|
15
15
|
Icon,
|
|
16
16
|
labelProps = {},
|
|
17
|
+
shade = '01',
|
|
17
18
|
style,
|
|
18
|
-
type = TYPES.dark,
|
|
19
19
|
variant = VARIANTS.success,
|
|
20
20
|
withoutIcon
|
|
21
21
|
}) => {
|
|
22
22
|
const theme = useTheme();
|
|
23
23
|
const themedStyles = mergeMultipleStyles(
|
|
24
24
|
ownStyles,
|
|
25
|
-
getVariantStyles(theme)({ variant,
|
|
25
|
+
getVariantStyles(theme)({ variant, shade }),
|
|
26
26
|
theme?.UTStatus,
|
|
27
27
|
style
|
|
28
28
|
);
|
|
29
29
|
const StatusIcon = Icon ?? defaultIconMapper(variant);
|
|
30
30
|
return (
|
|
31
31
|
<View style={themedStyles.container}>
|
|
32
|
-
{withoutIcon ? null : <UTIcon colorTheme={
|
|
33
|
-
<UTLabel colorTheme={
|
|
32
|
+
{withoutIcon ? null : <UTIcon colorTheme={variant} name={StatusIcon} />}
|
|
33
|
+
<UTLabel colorTheme={variant} {...labelProps}>
|
|
34
34
|
{children}
|
|
35
35
|
</UTLabel>
|
|
36
36
|
</View>
|
|
@@ -40,7 +40,7 @@ const UTStatus = ({
|
|
|
40
40
|
UTStatus.propTypes = {
|
|
41
41
|
Icon: string,
|
|
42
42
|
labelProps: object,
|
|
43
|
-
|
|
43
|
+
shade: string,
|
|
44
44
|
variant: string,
|
|
45
45
|
withoutIcon: bool
|
|
46
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VARIANTS } from './constants';
|
|
2
2
|
|
|
3
3
|
export const defaultIconMapper = variant =>
|
|
4
4
|
({
|
|
@@ -23,8 +23,8 @@ export const ownStyles = {
|
|
|
23
23
|
|
|
24
24
|
export const getVariantStyles =
|
|
25
25
|
theme =>
|
|
26
|
-
({ variant,
|
|
26
|
+
({ variant, shade }) => ({
|
|
27
27
|
container: {
|
|
28
|
-
backgroundColor: theme.Palette[variant]?.[
|
|
28
|
+
backgroundColor: theme.Palette[variant]?.[shade]
|
|
29
29
|
}
|
|
30
30
|
});
|
package/package.json
CHANGED