@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 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 { Icon, label, labelProps, type, variant, withoutIcon } = statusProps;
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
- type={type}
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
- | type | string | 'dark' | Color theme to apply for both the icon and label text. |
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" type="negative" labelProps={{ withMarkdown: true }}>
21
+ <UTStatus variant="error" shade="03" labelProps={{ withMarkdown: true }}>
22
22
  Error con Markdown
23
23
  </UTStatus>
24
24
  ```
@@ -6,9 +6,3 @@ export const VARIANTS = {
6
6
  success: 'success',
7
7
  warning: 'warning'
8
8
  };
9
-
10
- export const TYPES = {
11
- accent: 'accent',
12
- dark: 'dark',
13
- negative: 'negative'
14
- };
@@ -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 { TYPES, VARIANTS } from './constants';
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, type }),
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={type} name={StatusIcon} />}
33
- <UTLabel colorTheme={type} {...labelProps}>
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
- type: string,
43
+ shade: string,
44
44
  variant: string,
45
45
  withoutIcon: bool
46
46
  };
@@ -1,4 +1,4 @@
1
- import { TYPES, VARIANTS } from './constants';
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, type }) => ({
26
+ ({ variant, shade }) => ({
27
27
  container: {
28
- backgroundColor: theme.Palette[variant]?.[type === TYPES.negative ? '04' : '01']
28
+ backgroundColor: theme.Palette[variant]?.[shade]
29
29
  }
30
30
  });
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": "1.48.1",
5
+ "version": "1.48.2",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [