@widergy/mobile-ui 1.49.0 → 1.49.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,17 @@
1
+ ## [1.49.2](https://github.com/widergy/mobile-ui/compare/v1.49.1...v1.49.2) (2025-06-13)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [OUG-8532] visual errors complaint ([b9fff31](https://github.com/widergy/mobile-ui/commit/b9fff310f4c76ef4a22626e8340ee66cd5155d2d))
7
+
8
+ ## [1.49.1](https://github.com/widergy/mobile-ui/compare/v1.49.0...v1.49.1) (2025-06-12)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * [UGC-1546] modal closes on backdrop press ([#442](https://github.com/widergy/mobile-ui/issues/442)) ([f2d2297](https://github.com/widergy/mobile-ui/commit/f2d22977cc24c16154895f9a16909bd7587d1257))
14
+
1
15
  # [1.49.0](https://github.com/widergy/mobile-ui/compare/v1.48.2...v1.49.0) (2025-06-11)
2
16
 
3
17
 
@@ -10,6 +10,6 @@ export default StyleSheet.create({
10
10
  marginBottom: moderateVerticalScale(12)
11
11
  },
12
12
  radio: {
13
- marginLeft: moderateVerticalScale(15)
13
+ marginLeft: 0
14
14
  }
15
15
  });
@@ -5,7 +5,8 @@ import {
5
5
  Keyboard,
6
6
  Modal,
7
7
  ImageBackground,
8
- KeyboardAvoidingView
8
+ KeyboardAvoidingView,
9
+ Pressable
9
10
  } from 'react-native';
10
11
  import _ from 'lodash';
11
12
 
@@ -58,6 +59,16 @@ const UTModal = ({
58
59
  const styles = _.merge({}, ownStyles, themeStyles, style);
59
60
 
60
61
  const ParentView = disableTouchable ? View : TouchableWithoutFeedback;
62
+
63
+ const handleParentViewPress = () => {
64
+ Keyboard.dismiss();
65
+ if (!loading) onRequestClose();
66
+ };
67
+
68
+ const handleModalContentPress = () => {
69
+ Keyboard.dismiss();
70
+ };
71
+
61
72
  return (
62
73
  <Modal
63
74
  animationType="fade"
@@ -67,7 +78,7 @@ const UTModal = ({
67
78
  testID={dataTestId}
68
79
  >
69
80
  <KeyboardAvoidingView behavior={IS_IOS ? 'padding' : 'height'} style={styles.keyboardAvoidingView}>
70
- <ParentView onPress={() => Keyboard.dismiss()} style={[disableTouchable && styles.viewContainer]}>
81
+ <ParentView onPress={handleParentViewPress} style={[disableTouchable && styles.viewContainer]}>
71
82
  <View style={styles.childView} forceInset={{ top: 'never' }}>
72
83
  <View
73
84
  style={[
@@ -75,86 +86,92 @@ const UTModal = ({
75
86
  modalBackgroundColor && { backgroundColor: modalBackgroundColor }
76
87
  ]}
77
88
  >
78
- <UTLoading
79
- loading={loading}
80
- style={[styles.innerContainer, styles.content, styles.loading]}
81
- message={loadingText}
82
- >
83
- <View style={[styles.innerContainer, modalStyles?.innerContainer]}>
84
- {!!backgroundImg && (
85
- <ImageBackground source={backgroundImg} resizeMode="stretch" style={backgroundStyles} />
86
- )}
87
- {!!imageComponent && (
88
- <View style={[styles.content, imageStyles]}>
89
- {!hideCloseButton && (
90
- <UTButton
91
- colorTheme={closeButtonColorTheme}
92
- Icon="IconX"
93
- onPress={onRequestClose || cancelButton.onPress}
94
- style={{ root: styles.closeButton }}
95
- variant="text"
96
- dataTestId={`${dataTestId}.${closeButton}`}
97
- />
98
- )}
99
- <View style={styles.imageContainer}>{imageComponent}</View>
100
- </View>
101
- )}
102
- <View style={styles.content}>
103
- <View style={[styles.headerContainer, !!title && styles.closeButtonContainer]}>
104
- {!!title && (
105
- <UTLabel variant="title3" weight="medium" dataTestId={`${dataTestId}.${titleTestId}`}>
106
- {title}
89
+ <Pressable onPress={handleModalContentPress}>
90
+ <UTLoading
91
+ loading={loading}
92
+ style={[styles.innerContainer, styles.loading]}
93
+ message={loadingText}
94
+ >
95
+ <View style={[styles.innerContainer, modalStyles?.innerContainer]}>
96
+ {!!backgroundImg && (
97
+ <ImageBackground source={backgroundImg} resizeMode="stretch" style={backgroundStyles} />
98
+ )}
99
+ {!!imageComponent && (
100
+ <View style={[styles.content, imageStyles]}>
101
+ {!hideCloseButton && (
102
+ <UTButton
103
+ colorTheme={closeButtonColorTheme}
104
+ Icon="IconX"
105
+ onPress={onRequestClose}
106
+ style={{ root: styles.closeButton }}
107
+ variant="text"
108
+ dataTestId={`${dataTestId}.${closeButton}`}
109
+ />
110
+ )}
111
+ <View style={styles.imageContainer}>{imageComponent}</View>
112
+ </View>
113
+ )}
114
+ <View style={styles.content}>
115
+ <View style={[styles.headerContainer, !!title && styles.closeButtonContainer]}>
116
+ {!!title && (
117
+ <UTLabel
118
+ variant="title3"
119
+ weight="medium"
120
+ dataTestId={`${dataTestId}.${titleTestId}`}
121
+ >
122
+ {title}
123
+ </UTLabel>
124
+ )}
125
+ {!backgroundImg && !imageComponent && !hideCloseButton && (
126
+ <UTButton
127
+ colorTheme={closeButtonColorTheme}
128
+ Icon="IconX"
129
+ onPress={onRequestClose}
130
+ style={{ root: styles.closeButton }}
131
+ variant="text"
132
+ dataTestId={`${dataTestId}.${closeButton}`}
133
+ />
134
+ )}
135
+ </View>
136
+ {!!subtitle && (
137
+ <UTLabel
138
+ colorTheme="gray"
139
+ {...subtitleProps}
140
+ dataTestId={`${dataTestId}.${subtitleTestId}`}
141
+ >
142
+ {subtitle}
107
143
  </UTLabel>
108
144
  )}
109
- {!backgroundImg && !imageComponent && !hideCloseButton && (
145
+
146
+ {children}
147
+ </View>
148
+ {!hideSeparatorBar && <SeparatorBar />}
149
+ <View style={styles.buttonsContainer}>
150
+ {!!cancelButton && (
110
151
  <UTButton
111
- colorTheme={closeButtonColorTheme}
112
- Icon="IconX"
113
- onPress={onRequestClose}
114
- style={{ root: styles.closeButton }}
152
+ colorTheme={cancelButton.colorTheme || 'secondary'}
153
+ disabled={cancelButton.disabled || loading}
154
+ onPress={cancelButton.onPress}
115
155
  variant="text"
116
- dataTestId={`${dataTestId}.${closeButton}`}
117
- />
156
+ dataTestId={`${dataTestId}.${cancelButtonTestId}`}
157
+ >
158
+ {cancelButton.text || 'Cancelar'}
159
+ </UTButton>
160
+ )}
161
+ {!!acceptButton && (
162
+ <UTButton
163
+ colorTheme={acceptButton.colorTheme || 'primary'}
164
+ disabled={acceptButton.disabled || loading}
165
+ onPress={acceptButton.onPress}
166
+ dataTestId={`${dataTestId}.${acceptButtonTestId}`}
167
+ >
168
+ {acceptButton.text || 'Aceptar'}
169
+ </UTButton>
118
170
  )}
119
171
  </View>
120
- {!!subtitle && (
121
- <UTLabel
122
- colorTheme="gray"
123
- {...subtitleProps}
124
- dataTestId={`${dataTestId}.${subtitleTestId}`}
125
- >
126
- {subtitle}
127
- </UTLabel>
128
- )}
129
-
130
- {children}
131
- </View>
132
- {!hideSeparatorBar && <SeparatorBar />}
133
- <View style={styles.buttonsContainer}>
134
- {!!cancelButton && (
135
- <UTButton
136
- colorTheme={cancelButton.colorTheme || 'secondary'}
137
- disabled={cancelButton.disabled || loading}
138
- onPress={cancelButton.onPress}
139
- variant="text"
140
- dataTestId={`${dataTestId}.${cancelButtonTestId}`}
141
- >
142
- {cancelButton.text || 'Cancelar'}
143
- </UTButton>
144
- )}
145
- {!!acceptButton && (
146
- <UTButton
147
- colorTheme={acceptButton.colorTheme || 'primary'}
148
- disabled={acceptButton.disabled || loading}
149
- onPress={acceptButton.onPress}
150
- dataTestId={`${dataTestId}.${acceptButtonTestId}`}
151
- >
152
- {acceptButton.text || 'Aceptar'}
153
- </UTButton>
154
- )}
155
172
  </View>
156
- </View>
157
- </UTLoading>
173
+ </UTLoading>
174
+ </Pressable>
158
175
  </View>
159
176
  </View>
160
177
  </ParentView>
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.49.0",
5
+ "version": "1.49.2",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [