@widergy/mobile-ui 1.28.3 → 1.29.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,10 @@
1
+ # [1.29.0](https://github.com/widergy/mobile-ui/compare/v1.28.3...v1.29.0) (2024-10-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * [UG-2131] spacing and bottom actions updates ([#371](https://github.com/widergy/mobile-ui/issues/371)) ([93e5862](https://github.com/widergy/mobile-ui/commit/93e58629b1268cb6ccad4646e2ddb1be91de58a5))
7
+
1
8
  ## [1.28.3](https://github.com/widergy/mobile-ui/compare/v1.28.2...v1.28.3) (2024-10-18)
2
9
 
3
10
 
@@ -0,0 +1 @@
1
+ export const DEFAULT_REDIRECTION_ICON = 'IconChevronRight';
@@ -7,6 +7,7 @@ import { ACTION_TYPES } from '../../constants';
7
7
  import { useTheme } from '../../../../theming';
8
8
  import { mergeMultipleStyles } from '../../../../utils/styleUtils';
9
9
 
10
+ import { DEFAULT_REDIRECTION_ICON } from './constants';
10
11
  import styles, { getThemeStyles } from './styles';
11
12
 
12
13
  const BottomActions = ({ actions = [], bottomActionsVariant }) => {
@@ -27,7 +28,7 @@ const BottomActions = ({ actions = [], bottomActionsVariant }) => {
27
28
  }}
28
29
  colorTheme={colorTheme}
29
30
  disabled={disabled}
30
- Icon={isRedirection ? 'IconChevronRight' : Icon}
31
+ Icon={isRedirection ? Icon || DEFAULT_REDIRECTION_ICON : Icon}
31
32
  iconPlacement={isRedirection ? 'right' : 'left'}
32
33
  loading={loading}
33
34
  onClick={onClick}
@@ -43,17 +43,19 @@ const Header = ({
43
43
 
44
44
  return (
45
45
  <View style={[styles.header, styles[size], classNames.header]}>
46
- {renderAdornment(adornment, 'left', size)}
46
+ {renderAdornment(adornment, 'left')}
47
47
  <View style={styles.headerTitles}>
48
- {renderAdornment(adornment, 'top', size)}
49
- <UTLabel variant="title3" weight="medium" {...titleProps}>
50
- {title}
51
- </UTLabel>
52
- {description && (
53
- <UTLabel colorTheme="gray" {...descriptionProps}>
54
- {description}
48
+ {renderAdornment(adornment, 'top')}
49
+ <View style={styles.titleAndDescription}>
50
+ <UTLabel variant="title3" weight="medium" {...titleProps}>
51
+ {title}
55
52
  </UTLabel>
56
- )}
53
+ {description && (
54
+ <UTLabel colorTheme="gray" {...descriptionProps}>
55
+ {description}
56
+ </UTLabel>
57
+ )}
58
+ </View>
57
59
  </View>
58
60
  {status ? (
59
61
  <Status
@@ -9,9 +9,14 @@ export default StyleSheet.create({
9
9
  headerTitles: {
10
10
  flex: 1,
11
11
  flexDirection: 'column',
12
- gap: 8,
12
+ gap: 16,
13
13
  marginRight: 'auto'
14
14
  },
15
+ titleAndDescription: {
16
+ flex: 1,
17
+ flexDirection: 'column',
18
+ gap: 8
19
+ },
15
20
  medium: {
16
21
  padding: 24
17
22
  },
@@ -26,5 +31,8 @@ export default StyleSheet.create({
26
31
  },
27
32
  alignSelf_end: {
28
33
  alignSelf: 'flex-end'
34
+ },
35
+ adornment: {
36
+ maxWidth: '100%'
29
37
  }
30
38
  });
@@ -62,19 +62,23 @@ export const statusPropsMapper = (status, theme) => {
62
62
  return { backgroundColor: theme.Palette[variant]['01'] };
63
63
  };
64
64
 
65
- export const renderAdornment = (adornment, position, size) => {
65
+ export const renderAdornment = (adornment, position) => {
66
66
  if (isEmpty(adornment) || adornment.position !== position) return null;
67
67
  const AdornmentComponent = ADORNMENT_COMPONENT_MAPPER[adornment.type];
68
68
  const defaultPlaceSelf = adornment.position === 'left' ? PLACE_SELF_TYPES.CENTER : PLACE_SELF_TYPES.START;
69
69
 
70
70
  return (
71
71
  <AdornmentComponent
72
+ {...(adornment.props || {})}
72
73
  style={[
74
+ styles.adornment,
73
75
  styles[`alignSelf_${adornment.alignment || defaultPlaceSelf}`],
74
- position === 'top' && styles[`gap_${size}`],
75
- adornment.type === 'image' && { width: adornment.props?.width, height: adornment.props?.height }
76
+ adornment.type === 'image' && {
77
+ ...(adornment.props?.width && { width: adornment.props.width }),
78
+ ...(adornment.props?.height && { height: adornment.props.height })
79
+ },
80
+ adornment.props?.style
76
81
  ]}
77
- {...(adornment.props || {})}
78
82
  />
79
83
  );
80
84
  };
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.28.3",
5
+ "version": "1.29.0",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [