@widergy/mobile-ui 1.32.1 → 1.32.3

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
+ ## [1.32.3](https://github.com/widergy/mobile-ui/compare/v1.32.2...v1.32.3) (2024-11-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGENSA-801] align title ([#393](https://github.com/widergy/mobile-ui/issues/393)) ([6117550](https://github.com/widergy/mobile-ui/commit/61175507ef1a7e9af89b058e4385ca62d65ee0cc))
7
+
8
+ ## [1.32.2](https://github.com/widergy/mobile-ui/compare/v1.32.1...v1.32.2) (2024-11-15)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UG-2034] configurable selected header action ([#387](https://github.com/widergy/mobile-ui/issues/387)) ([1028860](https://github.com/widergy/mobile-ui/commit/102886072ffb42cfe8d3705355dcfd81ebfaab91))
14
+
1
15
  ## [1.32.1](https://github.com/widergy/mobile-ui/compare/v1.32.0...v1.32.1) (2024-11-15)
2
16
 
3
17
 
@@ -83,7 +83,8 @@ Header.propTypes = {
83
83
  isPrimary: bool,
84
84
  label: string,
85
85
  loading: bool,
86
- onPress: func
86
+ onPress: func,
87
+ selectedDefault: bool
87
88
  })
88
89
  ),
89
90
  headerActionsProps: shape({
@@ -13,7 +13,9 @@ import { processActions } from './utils';
13
13
  import styles from './styles';
14
14
 
15
15
  const HeaderActions = ({ headerActions, headerActionsProps }) => {
16
- const [selectedAction, setSelectedAction] = useState(null);
16
+ const [selectedAction, setSelectedAction] = useState(
17
+ headerActions.find(({ selectedDefault }) => selectedDefault)?.id
18
+ );
17
19
  const showButtonGroup = headerActionsProps.variant === HEADER_ACTIONS_VARIANTS.BUTTON_GROUP;
18
20
  const { colorTheme: buttonGroupColorTheme = 'secondary', shape: buttonGroupShape } =
19
21
  headerActionsProps?.buttonGroupProps || {};
@@ -71,7 +73,8 @@ HeaderActions.propTypes = {
71
73
  isPrimary: bool,
72
74
  label: string,
73
75
  loading: bool,
74
- onPress: func
76
+ onPress: func,
77
+ selectedDefault: bool
75
78
  })
76
79
  ),
77
80
  headerActionsProps: shape({
@@ -137,7 +137,8 @@ UTActionCard.propTypes = {
137
137
  isPrimary: bool,
138
138
  label: string,
139
139
  loading: bool,
140
- onPress: func
140
+ onPress: func,
141
+ selectedDefault: bool
141
142
  })
142
143
  ),
143
144
  headerActionsProps: shape({
@@ -78,23 +78,24 @@ const UTModal = ({
78
78
  </View>
79
79
  )}
80
80
  <View style={styles.content}>
81
- {!backgroundImg && !imageComponent && !hideCloseButton && (
82
- <UTButton
83
- colorTheme={closeButtonColorTheme}
84
- Icon="IconX"
85
- onPress={onRequestClose}
86
- style={{ root: styles.closeButton }}
87
- variant="text"
88
- />
89
- )}
90
-
91
- {!!title && (
92
- <UTLabel variant="title3" weight="medium" style={styles.title}>
93
- {title}
94
- </UTLabel>
95
- )}
81
+ <View style={[styles.headerContainer, !!title && styles.closeButtonContainer]}>
82
+ {!!title && (
83
+ <UTLabel variant="title3" weight="medium">
84
+ {title}
85
+ </UTLabel>
86
+ )}
87
+ {!backgroundImg && !imageComponent && !hideCloseButton && (
88
+ <UTButton
89
+ colorTheme={closeButtonColorTheme}
90
+ Icon="IconX"
91
+ onPress={onRequestClose}
92
+ style={{ root: styles.closeButton }}
93
+ variant="text"
94
+ />
95
+ )}
96
+ </View>
96
97
  {!!subtitle && (
97
- <UTLabel colorTheme="gray" {...subtitleProps} style={styles.subtitle}>
98
+ <UTLabel colorTheme="gray" {...subtitleProps}>
98
99
  {subtitle}
99
100
  </UTLabel>
100
101
  )}
@@ -34,15 +34,19 @@ export default StyleSheet.create({
34
34
  height: WINDOW_HEIGHT * 0.3,
35
35
  justifyContent: 'center'
36
36
  },
37
- title: {
38
- marginBottom: 12
37
+ headerContainer: {
38
+ alignItems: 'center',
39
+ display: 'flex',
40
+ flexDirection: 'row',
41
+ justifyContent: 'flex-end'
39
42
  },
40
- subtitle: {
41
- marginBottom: 12
43
+ closeButtonContainer: {
44
+ justifyContent: 'space-between'
42
45
  },
43
46
  content: {
44
47
  padding: 16,
45
- paddingBottom: 5
48
+ paddingBottom: 5,
49
+ gap: 12
46
50
  },
47
51
  closeButton: {
48
52
  alignSelf: 'flex-end'
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.32.1",
5
+ "version": "1.32.3",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [