@cdek-it/react-native-ui-kit 0.6.1 → 0.6.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.
@@ -7,7 +7,6 @@ const ANIMATION_BACKDROP_DURATION = 200;
7
7
  const ANIMATION_CONTENT_DURATION = 500;
8
8
  const BACKDROP_OPACITY = 0.5;
9
9
  const SCALE_INIT_VALUE = 0.9;
10
- // eslint-disable-next-line import-x/no-deprecated
11
10
  const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
12
11
  export const Dialog = ({ isVisible, onClose, onHideComplete, header, footer, body, testID, }) => {
13
12
  const [showModal, setShowModal] = useState(false);
@@ -23,13 +23,11 @@ export const InputOtp = memo(({ length, onChange, disabled = false, error = fals
23
23
  onBlur?.(e);
24
24
  }, [onBlur]);
25
25
  const activeIndex = useMemo(() => Math.min(value.length, length - 1), [value.length, length]);
26
- const renderArray = useMemo(() => Array.from({ length }).fill(null), [length]);
26
+ const renderArray = useMemo(() => Array.from({ length }, (_, i) => `Otp-Item-${i}`), [length]);
27
27
  return (<Pressable disabled={disabled} style={styles.container} testID={testID} testOnly_pressed={testOnly_pressed} onPress={handlePress}>
28
28
  {({ pressed }) => (<>
29
29
  <View style={styles.content}>
30
- {renderArray.map((_, index) => (<InputOtpItem disabled={disabled} error={error} focused={isFocused ? index === activeIndex : false}
31
- // eslint-disable-next-line react/no-array-index-key
32
- key={index} pressed={pressed} testID={`${testID}Item`} value={value[index]}/>))}
30
+ {renderArray.map((key, index) => (<InputOtpItem disabled={disabled} error={error} focused={isFocused ? index === activeIndex : false} key={key} pressed={pressed} testID={`${testID}Item`} value={value[index]}/>))}
33
31
  </View>
34
32
  <TextInput keyboardType='number-pad' maxLength={length} ref={inputRef} style={styles.input} testID={`${testID}HiddenInput`} value={value} onBlur={handleBlur} onChangeText={handleChange} onFocus={handleFocus} {...rest}/>
35
33
  </>)}
@@ -11,6 +11,7 @@ export declare const useInputStyle: (size?: InputTextBaseProps["size"]) => {
11
11
  containerFocused: {
12
12
  outlineColor: string;
13
13
  outlineWidth: number;
14
+ borderColor: string;
14
15
  };
15
16
  containerFloatLabel: {
16
17
  minHeight: number;
@@ -27,6 +27,7 @@ const useStyles = makeStyles(({ theme, border, typography, spacing, fonts }) =>
27
27
  containerFocused: {
28
28
  outlineColor: theme.General.focusOutlineColor,
29
29
  outlineWidth: Math.round(theme.General.focusShadowWidth),
30
+ borderColor: theme.General.focusBorderColor,
30
31
  },
31
32
  containerFloatLabel: {
32
33
  minHeight: theme.Button.Common.buttonHeightXL,
@@ -2,9 +2,7 @@ import { memo, useEffect, useMemo } from 'react';
2
2
  import Animated, { Easing, interpolate, useAnimatedProps, useAnimatedStyle, useSharedValue, withRepeat, withTiming, } from 'react-native-reanimated';
3
3
  import Svg, { Circle } from 'react-native-svg';
4
4
  import { makeStyles } from '../../utils/makeStyles';
5
- // eslint-disable-next-line import-x/no-deprecated
6
5
  const AnimatedSvg = Animated.createAnimatedComponent(Svg);
7
- // eslint-disable-next-line import-x/no-deprecated
8
6
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
9
7
  const STROKE_WIDTH = 2;
10
8
  /**
@@ -1,4 +1,4 @@
1
- import { memo, useCallback } from 'react';
1
+ import { memo, useCallback, useMemo } from 'react';
2
2
  import { View } from 'react-native';
3
3
  import { makeStyles } from '../../utils/makeStyles';
4
4
  import { RatingClear } from './RatingClear';
@@ -20,12 +20,10 @@ export const Rating = memo(({ disabled = false, paddings = false, maxRating = 5,
20
20
  const handleItemPress = useCallback((index) => () => {
21
21
  onChange(index + 1);
22
22
  }, [onChange]);
23
+ const renderArray = useMemo(() => Array.from({ length: maxRating }, (_, i) => `Rating-Item-${i}`), [maxRating]);
23
24
  return (<View style={styles.container}>
24
25
  <RatingClear disabled={disabled} paddings={paddings} testID={testID || 'RatingClear'} onPress={onClear} {...rest}/>
25
- {new Array(maxRating).fill(null).map((_, index) => (<RatingItem checked={index < rating}
26
- // Использовать индекс массива в качестве ключа - единственно возможное и правильное решение
27
- // eslint-disable-next-line react/no-array-index-key
28
- key={`RatingItem-${index}`} paddings={paddings} testID={`RatingItem-${index + 1}`} onPress={handleItemPress(index)}/>))}
26
+ {renderArray.map((key, index) => (<RatingItem checked={index < rating} key={key} paddings={paddings} testID={`RatingItem-${index + 1}`} onPress={handleItemPress(index)}/>))}
29
27
  </View>);
30
28
  });
31
29
  const useStyles = makeStyles(({ theme }) => ({
@@ -5,7 +5,6 @@ import Svg, { Circle } from 'react-native-svg';
5
5
  import { makeStyles } from '../../utils/makeStyles';
6
6
  import { TimerFlip } from './TimerFlip';
7
7
  import { COUNTER_SIZE } from './constants';
8
- // eslint-disable-next-line import-x/no-deprecated
9
8
  const AnimatedCircle = Animated.createAnimatedComponent(Circle);
10
9
  const BORDER_WIDTH = 2;
11
10
  /**
@@ -21,6 +20,8 @@ export const Timer = memo(({ countFrom, onFinish }) => {
21
20
  const center = COUNTER_SIZE / 2;
22
21
  const circleAnimatedProps = useAnimatedProps(() => ({
23
22
  strokeDashoffset: -circleAnimation.value * circumferenceLength,
23
+ origin: [center, center],
24
+ rotation: -90,
24
25
  }));
25
26
  useEffect(() => {
26
27
  setCurrentTimerValue(countFrom);
@@ -45,7 +46,7 @@ export const Timer = memo(({ countFrom, onFinish }) => {
45
46
  }, [currentTimerValue, onFinish]);
46
47
  return (<View style={styles.container} testID={TestId.Container}>
47
48
  <Svg style={styles.svgContainer}>
48
- <AnimatedCircle animatedProps={circleAnimatedProps} cx={center} cy={center} fill='none' origin={[center, center]} r={circumferenceRadius} rotation={-90} stroke={styles.circle.color} strokeDasharray={circumferenceLength} strokeLinecap='round' strokeWidth={BORDER_WIDTH}/>
49
+ <AnimatedCircle animatedProps={circleAnimatedProps} cx={center} cy={center} fill='none' r={circumferenceRadius} stroke={styles.circle.color} strokeDasharray={circumferenceLength} strokeLinecap='round' strokeWidth={BORDER_WIDTH}/>
49
50
  </Svg>
50
51
 
51
52
  <TimerFlip value={currentTimerValue}/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cdek-it/react-native-ui-kit",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "UI kit на основе Prime Faces, Prime Flex для React Native",
5
5
  "license": "MIT",
6
6
  "homepage": "https://developer.cdek.ru/design-system",
@@ -42,7 +42,6 @@
42
42
  "pod-install": "bundle exec pod install --project-directory=ios"
43
43
  },
44
44
  "dependencies": {
45
- "@gorhom/portal": "^1.0.14",
46
45
  "@tabler/icons-react-native": "^3.36.0"
47
46
  },
48
47
  "devDependencies": {