@widergy/mobile-ui 1.18.1 → 1.18.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/lib/components/CheckList/components/CheckBoxRenderer/index.js +8 -10
  3. package/lib/components/Label/propTypes.js +2 -5
  4. package/lib/components/UTAutocomplete/index.js +5 -11
  5. package/lib/components/UTBadge/index.js +2 -3
  6. package/lib/components/UTBaseInputField/README.md +31 -22
  7. package/lib/components/UTBaseInputField/components/ActionAdornment/index.js +6 -3
  8. package/lib/components/UTBaseInputField/constants.js +3 -1
  9. package/lib/components/UTBaseInputField/index.js +17 -6
  10. package/lib/components/UTBaseInputField/proptypes.js +10 -20
  11. package/lib/components/UTBaseInputField/theme.js +1 -2
  12. package/lib/components/UTButton/proptypes.js +4 -5
  13. package/lib/components/UTCBUInput/index.js +11 -12
  14. package/lib/components/UTCheckBox/README.md +14 -14
  15. package/lib/components/UTCheckBox/index.js +11 -6
  16. package/lib/components/UTCheckBox/proptypes.js +3 -4
  17. package/lib/components/UTCheckBox/theme.js +11 -4
  18. package/lib/components/UTCheckList/README.MD +22 -32
  19. package/lib/components/UTCheckList/index.js +6 -7
  20. package/lib/components/UTCheckList/proptypes.js +12 -24
  21. package/lib/components/UTFieldLabel/index.js +11 -13
  22. package/lib/components/UTIcon/index.js +2 -3
  23. package/lib/components/UTPasswordField/versions/V1/constants.js +4 -0
  24. package/lib/components/UTPasswordField/versions/V1/index.js +12 -13
  25. package/lib/components/UTPhoneInput/index.js +26 -27
  26. package/lib/components/UTProductItem/index.js +3 -3
  27. package/lib/components/UTSearchField/README.md +14 -13
  28. package/lib/components/UTSearchField/index.js +6 -4
  29. package/lib/components/UTSearchField/proptypes.js +5 -9
  30. package/lib/components/UTSelect/versions/V1/README.md +29 -35
  31. package/lib/components/UTSelect/versions/V1/index.js +73 -44
  32. package/lib/components/UTSelect/versions/V1/proptypes.js +17 -16
  33. package/lib/components/UTSelect/versions/V1/styles.js +3 -0
  34. package/lib/components/UTSelect/versions/V1/utils.js +21 -0
  35. package/lib/components/UTSelectableCard/index.js +5 -2
  36. package/lib/components/UTTextInput/versions/V1/README.md +35 -34
  37. package/lib/components/UTTextInput/versions/V1/components/TextInputField/index.js +13 -14
  38. package/lib/components/UTTextInput/versions/V1/index.js +12 -10
  39. package/lib/components/UTTextInput/versions/V1/proptypes.js +20 -19
  40. package/lib/components/UTValidation/index.js +3 -3
  41. package/lib/components/UTValidation/styles.js +3 -0
  42. package/lib/constants/inputs.js +1 -1
  43. package/package.json +1 -1
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { bool, elementType, func, instanceOf, number, oneOfType, shape, string } from 'prop-types';
3
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
2
+ import { bool, elementType, func, instanceOf, number, object, oneOfType, shape, string } from 'prop-types';
4
3
 
5
4
  import UTBaseInputField from '../../../../../UTBaseInputField';
6
5
  import { COMPONENT_KEYS } from '../../../../../UTBaseInputField/constants';
@@ -12,13 +11,13 @@ const TextInputField = ({
12
11
  disabled,
13
12
  error,
14
13
  id,
15
- input,
16
14
  inputRef,
17
15
  inputSize,
18
16
  LeftIcon,
19
17
  maxLength,
20
18
  maxRows,
21
19
  onBlur,
20
+ onChange,
22
21
  onFocus,
23
22
  onSubmitEditing,
24
23
  placeholder,
@@ -30,7 +29,8 @@ const TextInputField = ({
30
29
  style,
31
30
  suffix,
32
31
  tooltip,
33
- type
32
+ type,
33
+ value
34
34
  }) => {
35
35
  const leftAdornments = [
36
36
  { name: COMPONENT_KEYS.ICON, props: { Icon: LeftIcon } },
@@ -48,15 +48,15 @@ const TextInputField = ({
48
48
  <UTBaseInputField
49
49
  alwaysShowPlaceholder={alwaysShowPlaceholder}
50
50
  blurOnSubmit={blurOnSubmit}
51
- disabled={disabled}
51
+ disabled={disabled && !readOnly}
52
52
  error={error}
53
53
  id={id}
54
- input={input}
55
54
  inputSize={inputSize}
56
55
  leftAdornments={leftAdornments}
57
56
  maxLength={maxLength}
58
57
  maxRows={maxRows}
59
58
  onBlur={onBlur}
59
+ onChange={onChange}
60
60
  onFocus={onFocus}
61
61
  onSubmitEditing={onSubmitEditing}
62
62
  placeholder={placeholder}
@@ -67,6 +67,7 @@ const TextInputField = ({
67
67
  showCharacterCount={showCharacterCount}
68
68
  style={style}
69
69
  type={type}
70
+ value={value}
70
71
  />
71
72
  );
72
73
  };
@@ -80,16 +81,13 @@ TextInputField.propTypes = {
80
81
  disabled: bool,
81
82
  error: string,
82
83
  id: oneOfType([number, string]),
83
- input: shape({
84
- value: string,
85
- onChange: func
86
- }),
87
84
  inputRef: oneOfType([func, instanceOf(Object)]),
88
85
  inputSize: string,
89
86
  LeftIcon: elementType,
90
87
  maxLength: number,
91
88
  maxRows: number,
92
89
  onBlur: func,
90
+ onChange: func,
93
91
  onFocus: func,
94
92
  onSubmitEditing: func,
95
93
  placeholder: string,
@@ -99,13 +97,14 @@ TextInputField.propTypes = {
99
97
  RightIcon: elementType,
100
98
  showCharacterCount: bool,
101
99
  style: shape({
102
- container: ViewPropTypes.style,
103
- input: ViewPropTypes.style,
104
- root: ViewPropTypes.style
100
+ container: object,
101
+ input: object,
102
+ root: object
105
103
  }),
106
104
  suffix: string,
107
105
  tooltip: string,
108
- type: string
106
+ type: string,
107
+ value: string
109
108
  };
110
109
 
111
110
  export default TextInputField;
@@ -19,15 +19,15 @@ const UTTextInput = ({
19
19
  error,
20
20
  helpText,
21
21
  id,
22
- input,
23
22
  inputRef,
24
23
  inputSize,
25
- label,
26
- labelVariant,
24
+ title,
25
+ titleVariant,
27
26
  LeftIcon,
28
27
  maxLength,
29
28
  maxRows,
30
29
  onBlur,
30
+ onChange,
31
31
  onFocus,
32
32
  onSubmitEditing,
33
33
  placeholder,
@@ -41,10 +41,11 @@ const UTTextInput = ({
41
41
  suffix,
42
42
  tooltip,
43
43
  type,
44
- validations
44
+ validations,
45
+ value
45
46
  }) => {
46
- const labelColorTheme = readOnly ? 'gray' : 'dark';
47
- const labelComponentVariant = labelVariant === SIZES.SMALL ? 'small' : 'body';
47
+ const titleColorTheme = readOnly ? 'gray' : 'dark';
48
+ const titleComponentVariant = titleVariant === SIZES.SMALL ? 'small' : 'body';
48
49
 
49
50
  const validationData = useMemo(
50
51
  () => validations || (error && formatErrorToValidation(error)),
@@ -53,9 +54,9 @@ const UTTextInput = ({
53
54
 
54
55
  return (
55
56
  <View style={[styles.container, style.root]}>
56
- {label && (
57
- <UTFieldLabel colorTheme={labelColorTheme} required={required} variant={labelComponentVariant}>
58
- {label}
57
+ {title && (
58
+ <UTFieldLabel colorTheme={titleColorTheme} required={required} variant={titleComponentVariant}>
59
+ {title}
59
60
  </UTFieldLabel>
60
61
  )}
61
62
  <TextInputField
@@ -65,13 +66,13 @@ const UTTextInput = ({
65
66
  disabled={disabled}
66
67
  error={error}
67
68
  id={id}
68
- input={input}
69
69
  inputRef={inputRef}
70
70
  inputSize={inputSize}
71
71
  LeftIcon={LeftIcon}
72
72
  maxLength={maxLength}
73
73
  maxRows={maxRows}
74
74
  onBlur={onBlur}
75
+ onChange={onChange}
75
76
  onFocus={onFocus}
76
77
  onSubmitEditing={onSubmitEditing}
77
78
  placeholder={placeholder}
@@ -84,6 +85,7 @@ const UTTextInput = ({
84
85
  suffix={suffix}
85
86
  tooltip={tooltip}
86
87
  type={type}
88
+ value={value}
87
89
  />
88
90
  {helpText && (
89
91
  <UTLabel colorTheme="gray" variant="small">
@@ -1,41 +1,39 @@
1
- import { bool, elementType, func, instanceOf, number, oneOfType, shape, string } from 'prop-types';
2
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
1
+ import { bool, elementType, func, instanceOf, number, object, oneOfType, shape, string } from 'prop-types';
3
2
 
4
3
  import { validationDataProptypes } from '../../../UTValidation/constants';
5
4
 
6
5
  import { SIZES } from './constants';
7
6
 
8
7
  export const defaultProps = {
9
- input: {
10
- value: [],
11
- onChange: () => {}
12
- },
13
8
  inputSize: SIZES.LARGE,
14
- labelVariant: SIZES.LARGE,
15
9
  maxRows: 1,
16
- style: {}
10
+ onChange: () => {},
11
+ style: {},
12
+ titleVariant: SIZES.LARGE,
13
+ value: null
17
14
  };
18
15
 
19
16
  export const propTypes = {
20
- action: shape({ icon: elementType, action: func, colorTheme: string, text: string }),
17
+ action: shape({
18
+ action: func,
19
+ colorTheme: string,
20
+ icon: elementType,
21
+ text: string
22
+ }),
21
23
  alwaysShowPlaceholder: bool,
22
24
  blurOnSubmit: bool,
23
25
  disabled: bool,
24
26
  error: string,
25
27
  helpText: string,
26
28
  id: oneOfType([number, string]),
27
- input: shape({
28
- value: string,
29
- onChange: func
30
- }),
31
29
  inputRef: oneOfType([func, instanceOf(Object)]),
32
30
  inputSize: string,
33
- label: string,
34
- labelVariant: string,
31
+ keyboardType: string,
35
32
  LeftIcon: elementType,
36
33
  maxLength: number,
37
34
  maxRows: number,
38
35
  onBlur: func,
36
+ onChange: func,
39
37
  onFocus: func,
40
38
  onSubmitEditing: func,
41
39
  placeholder: string,
@@ -46,12 +44,15 @@ export const propTypes = {
46
44
  RightIcon: elementType,
47
45
  showCharacterCount: bool,
48
46
  style: shape({
49
- container: ViewPropTypes.style,
50
- input: ViewPropTypes.style,
51
- root: ViewPropTypes.style
47
+ container: object,
48
+ input: object,
49
+ root: object
52
50
  }),
53
51
  suffix: string,
52
+ title: string,
53
+ titleVariant: string,
54
54
  tooltip: string,
55
55
  type: string,
56
- validations: validationDataProptypes
56
+ validations: validationDataProptypes,
57
+ value: string
57
58
  };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { isEmpty } from 'lodash';
3
3
  import { View } from 'react-native';
4
- import { ViewPropTypes } from 'deprecated-react-native-prop-types';
4
+ import { object } from 'prop-types';
5
5
 
6
6
  import { useTheme } from '../../theming';
7
7
  import UTIcon from '../UTIcon';
@@ -51,7 +51,7 @@ const UTValidation = ({ style, validationData }) => {
51
51
  )}
52
52
  </View>
53
53
  )}
54
- <UTLabel colorTheme={STATUS_COLOR_MAPPER[itemStatus]} variant="small">
54
+ <UTLabel colorTheme={STATUS_COLOR_MAPPER[itemStatus]} variant="small" style={styles.itemText}>
55
55
  {text}
56
56
  </UTLabel>
57
57
  </View>
@@ -66,7 +66,7 @@ const UTValidation = ({ style, validationData }) => {
66
66
  UTValidation.defaultProps = DEFAULT_PROPS;
67
67
 
68
68
  UTValidation.propTypes = {
69
- style: ViewPropTypes.style,
69
+ style: object,
70
70
  validationData: validationDataProptypes
71
71
  };
72
72
 
@@ -16,6 +16,9 @@ export default StyleSheet.create({
16
16
  alignItems: 'center',
17
17
  flexDirection: 'row'
18
18
  },
19
+ itemText: {
20
+ flex: 1
21
+ },
19
22
  itemsContainer: {
20
23
  rowGap: 8
21
24
  },
@@ -1,4 +1,4 @@
1
- export const LABEL_VARIANTS = {
1
+ export const TITLE_VARIANTS = {
2
2
  large: 'body',
3
3
  small: 'small'
4
4
  };
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.18.1",
5
+ "version": "1.18.3",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [