@widergy/mobile-ui 0.37.3 → 0.37.5

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
+ ## [0.37.5](https://github.com/widergy/mobile-ui/compare/v0.37.4...v0.37.5) (2023-06-14)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * added property for error number of lines ([#242](https://github.com/widergy/mobile-ui/issues/242)) ([b263d60](https://github.com/widergy/mobile-ui/commit/b263d6036920a70e6a8758f967a5ba355989e019))
7
+
8
+ ## [0.37.4](https://github.com/widergy/mobile-ui/compare/v0.37.3...v0.37.4) (2023-06-06)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * image radio ([#240](https://github.com/widergy/mobile-ui/issues/240)) ([d834b8c](https://github.com/widergy/mobile-ui/commit/d834b8c149b636e4c772ed02ecae8b517be61eea))
14
+
1
15
  ## [0.37.3](https://github.com/widergy/mobile-ui/compare/v0.37.2...v0.37.3) (2023-03-11)
2
16
 
3
17
 
@@ -5,14 +5,14 @@ import Label from '../Label';
5
5
  import constants from './constants';
6
6
  import propTypes from './propTypes';
7
7
 
8
- const CaptionLabel = ({ color, children, error, errorColor, style }) => (
8
+ const CaptionLabel = ({ color, children, error, errorColor, style, textProps }) => (
9
9
  <Label
10
10
  color={!error ? color : errorColor}
11
11
  error={error && !errorColor}
12
12
  primary={!error && !color}
13
13
  xsmall
14
14
  style={style}
15
- textProps={constants.textProps}
15
+ textProps={textProps || constants.textProps}
16
16
  >
17
17
  {error || children || ' '}
18
18
  </Label>
@@ -5,9 +5,9 @@ import propTypes from './propTypes';
5
5
  import { getImageStyles } from './styles';
6
6
  import { DEFAULT_IMAGE_ICON_SIZE } from './constants';
7
7
 
8
- const ImageIcon = ({ containerStyle, image, size, style, theme, ...props }) => {
8
+ const ImageIcon = ({ containerStyle, image, size, style, theme, withUri = false, ...props }) => {
9
9
  const imageStyles = getImageStyles(size);
10
- return <Image resizeMode="contain" {...props} source={image} style={[imageStyles, style]} />;
10
+ return <Image resizeMode="contain" {...props} source={withUri ? {uri: image} : image} style={[imageStyles, style]} />;
11
11
  };
12
12
 
13
13
  ImageIcon.defaultProps = {
@@ -33,10 +33,19 @@ const ImageRadio = ({ options, title, onChange, value, style, variant = {} }) =>
33
33
  ]}
34
34
  >
35
35
  <View style={vertical ? styles.touchableInnerContainerVertical : styles.touchableInnerContainer}>
36
- <ImageIcon
36
+ {
37
+ !!option.configuration.selected_image_url && <ImageIcon
37
38
  size={IMAGE_SIZE}
38
- image={isSelected(option) ? option.selectedImage : option.unselectedImage}
39
+ image={isSelected(option) ? option.configuration.selected_image_url : option.configuration.image_url}
40
+ withUri={true}
39
41
  />
42
+ }
43
+ {
44
+ !!option?.configuration?.SelectedImageComponent && <ImageIcon
45
+ size={IMAGE_SIZE}
46
+ image={isSelected(option) ? option.configuration.SelectedImageComponent : option.configuration.UnselectedImageComponent}
47
+ />
48
+ }
40
49
  <View style={!vertical ? styles.labels : styles.verticalLabels}>
41
50
  <Label
42
51
  white={!transparentBackground && isSelected(option)}
@@ -15,6 +15,7 @@ const UTPasswordField = ({
15
15
  passwordValidations,
16
16
  showValidations,
17
17
  shouldShowError,
18
+ errorTextProps,
18
19
  ...props
19
20
  }) => {
20
21
  const { value, onChange } = input;
@@ -26,6 +27,7 @@ const UTPasswordField = ({
26
27
  value={value}
27
28
  onChange={onChange}
28
29
  error={showValidations ? !!error : error}
30
+ errorTextProps={errorTextProps}
29
31
  hiddenInput
30
32
  />
31
33
  {!!showValidations && !!passwordValidations && (
@@ -38,6 +38,7 @@ const FilledInput = ({
38
38
  multiline,
39
39
  captionLabel,
40
40
  borderless,
41
+ errorTextProps,
41
42
  ...props
42
43
  }) => {
43
44
  const [initialHeight, setInitialHeight] = useState(inputHeight);
@@ -126,6 +127,7 @@ const FilledInput = ({
126
127
  color={theme.colors.primary}
127
128
  errorColor={theme.colors.error}
128
129
  style={[themeStyles?.errorLabel, styles?.errorLabel]}
130
+ textProps={errorTextProps}
129
131
  >
130
132
  {captionLabel}
131
133
  </CaptionLabel>
@@ -40,6 +40,7 @@ const OutlinedInput = ({
40
40
  multiline,
41
41
  captionLabel,
42
42
  borderless,
43
+ errorTextProps,
43
44
  ...props
44
45
  }) => {
45
46
  const focusedColor = themeStyles?.focused?.color || theme.colors.primary;
@@ -153,6 +154,7 @@ const OutlinedInput = ({
153
154
  color={theme.colors.primary}
154
155
  errorColor={theme.colors.error}
155
156
  style={[themeStyles?.errorLabel, styles?.errorLabel]}
157
+ textProps={errorTextProps}
156
158
  >
157
159
  {captionLabel}
158
160
  </CaptionLabel>
@@ -37,6 +37,7 @@ const StandardInput = ({
37
37
  tooltipProps,
38
38
  captionLabel,
39
39
  borderless,
40
+ errorTextProps,
40
41
  ...props
41
42
  }) => (
42
43
  <View style={[ownStyles.container, themeStyles?.root, styles?.container]}>
@@ -114,6 +115,7 @@ const StandardInput = ({
114
115
  color={theme.colors.primary}
115
116
  errorColor={theme.colors.error}
116
117
  style={[themeStyles?.errorLabel, styles?.errorLabel]}
118
+ textProps={errorTextProps}
117
119
  >
118
120
  {captionLabel}
119
121
  </CaptionLabel>
@@ -14,7 +14,7 @@ const variants = {
14
14
  outlined: OutlinedInput
15
15
  };
16
16
 
17
- const UTTextInput = ({ variant = 'standard', theme, onFocus, onBlur, controlledFocus, select, ...props }) => {
17
+ const UTTextInput = ({ variant = 'standard', theme, onFocus, onBlur, controlledFocus, select, errorTextProps, ...props }) => {
18
18
  const [inputHeight, setInputHeight] = useState(0);
19
19
  const [focused, setFocused] = useState(false);
20
20
 
@@ -44,6 +44,7 @@ const UTTextInput = ({ variant = 'standard', theme, onFocus, onBlur, controlledF
44
44
  themeStyles={themeStyles}
45
45
  inputHeight={inputHeight}
46
46
  select={select}
47
+ errorTextProps={errorTextProps}
47
48
  />
48
49
  );
49
50
  };
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": "0.37.3",
5
+ "version": "0.37.5",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [