@cdek-it/react-native-ui-kit 0.6.3 → 0.6.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.
@@ -52,5 +52,5 @@ const useStyles = makeStyles(({ theme, border, fonts, typography }) => ({
52
52
  pressed: { borderColor: theme.Form.InputText.inputHoverBorderColor },
53
53
  error: { borderColor: theme.Form.InputText.inputErrorBorderColor },
54
54
  disabled: { mixBlendMode: 'luminosity', opacity: 0.6 },
55
- cursor: { color: theme.Form.InputText.inputFocusBorderColor },
55
+ cursor: { color: theme.Form.InputText.inputTextColor },
56
56
  }));
@@ -69,12 +69,22 @@ export const InputTextBase = memo(
69
69
  const toggleUserDefinedSecureTextEntry = useCallback(() => setUserDefinedSecureTextEntry((old) => !old), []);
70
70
  const showSecureToggle = secureTextEntryProp === 'toggleable';
71
71
  const hasRightContent = loading || showClearButton || showSecureToggle || disabled;
72
+ const isOnlyButton = useMemo(() => {
73
+ return ([showClearButton, showSecureToggle].filter((val) => val).length === 1);
74
+ }, [showClearButton, showSecureToggle]);
72
75
  const rightButtonHitSlop = useMemo(() => ({
73
- top: 0,
74
- bottom: 0,
75
- left: styles.rightContainer.gap / 2,
76
- right: styles.rightContainer.gap / 2,
77
- }), [styles.rightContainer.gap]);
76
+ // Большие вертикальные отступы (100) - чтобы компенсировать возможное
77
+ // растягивание инпута по вертикали, при этом область тапа
78
+ // гарантированно не выйдет за пределы инпута
79
+ top: 100,
80
+ bottom: 100,
81
+ left: isOnlyButton
82
+ ? styles.rightContainer.gap
83
+ : styles.rightContainer.gap / 2,
84
+ right: isOnlyButton
85
+ ? styles.rightContainer.gap
86
+ : styles.rightContainer.gap / 2,
87
+ }), [styles.rightContainer.gap, isOnlyButton]);
78
88
  const texInputProps = useMemo(() => ({
79
89
  ...otherProps,
80
90
  allowFontScaling: floatLabel ? false : otherProps.allowFontScaling,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdek-it/react-native-ui-kit",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "UI kit на основе Prime Faces, Prime Flex для React Native",
5
5
  "license": "MIT",
6
6
  "homepage": "https://developer.cdek.ru/design-system",