@widergy/mobile-ui 1.28.0 → 1.28.1

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.28.1](https://github.com/widergy/mobile-ui/compare/v1.28.0...v1.28.1) (2024-10-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * [UGC-934] text area fix ([#368](https://github.com/widergy/mobile-ui/issues/368)) ([32bcffc](https://github.com/widergy/mobile-ui/commit/32bcffc0e4b91e5c049fc548f3596bc7599a90ce))
7
+
1
8
  # [1.28.0](https://github.com/widergy/mobile-ui/compare/v1.27.1...v1.28.0) (2024-10-15)
2
9
 
3
10
 
@@ -17,7 +17,7 @@ import UTLabel from '../UTLabel';
17
17
  import { COMPONENTS_MAPPER, DEBOUNCE_CONFIG, DEBOUNCE_DELAY } from './constants';
18
18
  import { defaultProps, propTypes } from './proptypes';
19
19
  import { getPropsByType } from './utils';
20
- import { LINE_HEIGHT, retrieveStyle } from './theme';
20
+ import { CONTAINER, LINE_HEIGHT, retrieveStyle } from './theme';
21
21
 
22
22
  const UTBaseInputField = forwardRef(
23
23
  (
@@ -170,7 +170,8 @@ const UTBaseInputField = forwardRef(
170
170
  const minHeight =
171
171
  containerStyle.borderWidth * 2 +
172
172
  containerStyle.paddingVertical * 2 +
173
- (inputStyle.lineHeight || LINE_HEIGHT) * maxRows;
173
+ (inputStyle.lineHeight || LINE_HEIGHT) * maxRows +
174
+ (maxLength && showCharacterCount ? LINE_HEIGHT + CONTAINER.ROW_GAP : 0);
174
175
 
175
176
  return (
176
177
  <View style={[containerStyle, { minHeight }]}>
@@ -179,6 +180,7 @@ const UTBaseInputField = forwardRef(
179
180
  <TextInput
180
181
  autoCapitalize={autoCapitalize}
181
182
  autoCorrect={false}
183
+ cursorColor={inputStyle.cursorColor}
182
184
  defaultValue={value}
183
185
  editable={!disabled && !readOnly && editable}
184
186
  id={id ? `${id}` : undefined}
@@ -4,7 +4,7 @@ import { SIZES, VARIANT } from './constants';
4
4
 
5
5
  export const LINE_HEIGHT = 22;
6
6
 
7
- const CONTAINER = {
7
+ export const CONTAINER = {
8
8
  PADDING: {
9
9
  HORIZONTAL: 16,
10
10
  VERTICAL: 12
@@ -37,9 +37,10 @@ const COLORS = {
37
37
  READ_ONLY: 'transparent'
38
38
  },
39
39
  TEXT: {
40
+ CURSOR: theme => theme.Palette.accent['04'],
40
41
  INPUT: theme => theme.Palette.dark['05'],
41
42
  PLACEHOLDER: theme => theme.Palette.gray['02'],
42
- SELECTION: theme => theme.Palette.accent['04']
43
+ SELECTION: theme => theme.Palette.accent['02']
43
44
  }
44
45
  };
45
46
 
@@ -75,6 +76,7 @@ const baseTextInputTheme = theme => ({
75
76
  textAlignVertical: 'center',
76
77
  zIndex: 4
77
78
  },
79
+ cursorColor: COLORS.TEXT.CURSOR(theme),
78
80
  placeholderTextColor: COLORS.TEXT.PLACEHOLDER(theme),
79
81
  selectionColor: COLORS.TEXT.SELECTION(theme)
80
82
  },
@@ -117,8 +119,8 @@ const conditionalContainerStyle = (disabled, error, focused, inputSize, readOnly
117
119
  borderColor: COLORS.BORDER.READ_ONLY
118
120
  }),
119
121
  ...(inputSize === SIZES.SMALL && {
120
- paddingHorizontal: SMALL_INPUT_PADDING.HORIZONTAL,
121
- paddingVertical: SMALL_INPUT_PADDING.VERTICAL
122
+ paddingHorizontal: SMALL_INPUT_PADDING.HORIZONTAL - (focused ? 1 : 0),
123
+ paddingVertical: SMALL_INPUT_PADDING.VERTICAL - (focused ? 1 : 0)
122
124
  })
123
125
  });
124
126
 
@@ -155,6 +157,7 @@ export const retrieveStyle = ({
155
157
  ...conditionalInputStyle(maxRows, multiline),
156
158
  ...style.input
157
159
  },
160
+ cursorColor: baseTheme.input.cursorColor,
158
161
  placeholderTextColor: baseTheme.input.placeholderTextColor,
159
162
  selectionColor: baseTheme.input.selectionColor
160
163
  };
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.0",
5
+ "version": "1.28.1",
6
6
  "repository": "https://github.com/widergy/mobile-ui.git",
7
7
  "main": "lib/index.js",
8
8
  "files": [