react-native-ui-lib 7.46.3-snapshot.7406 → 7.46.3-snapshot.7424

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/incubator.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import {Dialog, ExpandableOverlay, Slider, Toast} from './src/incubator';
2
- export {Dialog, ExpandableOverlay, Slider, Toast};
1
+ import {ExpandableOverlay, Slider, Toast} from './src/incubator';
2
+ export {ExpandableOverlay, Slider, Toast};
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilib-native",
3
- "version": "5.0.0-snapshot.7406",
3
+ "version": "5.0.0-snapshot.7424",
4
4
  "homepage": "https://github.com/wix/react-native-ui-lib",
5
5
  "description": "uilib native components (separated from js components)",
6
6
  "main": "components/index",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.46.3-snapshot.7406",
3
+ "version": "7.46.3-snapshot.7424",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -3,20 +3,12 @@ import { HintPositions, HintProps } from './types';
3
3
  declare const Hint: {
4
4
  (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
5
5
  displayName: string;
6
- defaultProps: {
7
- position: HintPositions;
8
- useModal: boolean;
9
- };
10
6
  positions: typeof HintPositions;
11
7
  };
12
8
  export { HintProps, Hint };
13
9
  declare const _default: React.ForwardRefExoticComponent<HintProps & React.RefAttributes<any>> & {
14
10
  (props: HintProps): string | number | true | React.JSX.Element | Iterable<React.ReactNode> | null;
15
11
  displayName: string;
16
- defaultProps: {
17
- position: HintPositions;
18
- useModal: boolean;
19
- };
20
12
  positions: typeof HintPositions;
21
13
  };
22
14
  export default _default;
@@ -22,8 +22,8 @@ const HINT_MIN_WIDTH = 68;
22
22
  const Hint = props => {
23
23
  const {
24
24
  visible,
25
- useModal,
26
- position,
25
+ useModal = true,
26
+ position = HintPositions.BOTTOM,
27
27
  children,
28
28
  message,
29
29
  containerWidth = Constants.windowWidth,
@@ -69,6 +69,7 @@ const Hint = props => {
69
69
  if (targetRef.current && hintRef.current) {
70
70
  focusAccessibilityOnHint(targetRef.current, hintRef.current);
71
71
  }
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
72
73
  }, []);
73
74
  const targetLayout = useMemo(() => {
74
75
  return isUsingModal ? targetLayoutInWindowState : targetLayoutState;
@@ -78,6 +79,7 @@ const Hint = props => {
78
79
  if (hintRef.current) {
79
80
  focusAccessibilityOnHint(targetRef.current, hintRef.current);
80
81
  }
82
+ // eslint-disable-next-line react-hooks/exhaustive-deps
81
83
  }, []);
82
84
  const showHint = !!targetLayout;
83
85
  const {
@@ -240,10 +242,6 @@ const styles = StyleSheet.create({
240
242
  }
241
243
  });
242
244
  Hint.displayName = 'Hint';
243
- Hint.defaultProps = {
244
- position: HintPositions.BOTTOM,
245
- useModal: true
246
- };
247
245
  Hint.positions = HintPositions;
248
246
  export { HintProps, Hint };
249
247
 
@@ -117,7 +117,7 @@ class Slider extends PureComponent {
117
117
  maximumValue,
118
118
  value
119
119
  } = props;
120
- if (minimumValue >= maximumValue) {
120
+ if (minimumValue > maximumValue) {
121
121
  console.warn('Slider minimumValue must be lower than maximumValue');
122
122
  }
123
123
  if (!useRange && (value < minimumValue || value > maximumValue)) {
@@ -23,6 +23,9 @@ export default function TabPage({
23
23
  containerWidth
24
24
  } = useContext(TabBarContext);
25
25
  const [shouldLoad, setLoaded] = useState(!lazy);
26
+
27
+ // TODO: RN 77 hack - remove the state in future RN\reanimated release (ticket 4838 \ https://github.com/software-mansion/react-native-reanimated/issues/8517) when fixed we should revert to the original logic (see this PR: https://github.com/wix/react-native-ui-lib/pull/3829)
28
+ const [isActive, setIsActive] = useState(currentPage.value === index);
26
29
  // const [focused, setFocused] = useState(false);
27
30
 
28
31
  const lazyLoad = useCallback(() => {
@@ -36,6 +39,7 @@ export default function TabPage({
36
39
  return currentPage.value;
37
40
  }, (currentPage /* , previousPage */) => {
38
41
  const isActive = currentPage === index;
42
+ runOnJS(setIsActive)(isActive);
39
43
  // const wasActive = previousPage === index;
40
44
  // const nearActive = asCarousel && (currentPage - 1 === index || currentPage + 1 === index);
41
45
  // const wasNearActive =
@@ -52,23 +56,25 @@ export default function TabPage({
52
56
  // }
53
57
  }, [currentPage, lazyLoad]);
54
58
  const animatedPageStyle = useAnimatedStyle(() => {
59
+ if (!nestedInScrollView) {
60
+ return {};
61
+ }
55
62
  const isActive = Math.round(currentPage.value) === index;
56
-
57
- // TODO: Fix to proper animated style once Reanimated export AnimatedStyleProp
58
- const style = {
59
- opacity: isActive || asCarousel ? 1 : 0,
60
- zIndex: isActive || asCarousel ? 1 : 0
63
+ return {
64
+ position: isActive ? 'relative' : 'absolute'
61
65
  };
62
- if (nestedInScrollView) {
63
- style.position = isActive ? 'relative' : 'absolute';
64
- }
65
- return style;
66
66
  });
67
67
  const _style = useMemo(() => {
68
68
  return [!asCarousel && styles.page, animatedPageStyle, {
69
69
  width: asCarousel ? containerWidth : undefined
70
- }, style];
71
- }, [asCarousel, animatedPageStyle, containerWidth, style]);
70
+ }, style, !isActive && !asCarousel ? {
71
+ opacity: 0,
72
+ zIndex: 0
73
+ } : {
74
+ opacity: 1,
75
+ zIndex: 1
76
+ }];
77
+ }, [asCarousel, animatedPageStyle, containerWidth, style, isActive]);
72
78
  return <Reanimated.View style={_style} testID={testID}>
73
79
  {!shouldLoad && renderLoading?.()}
74
80
  {shouldLoad && props.children}
@@ -76,7 +82,5 @@ export default function TabPage({
76
82
  </Reanimated.View>;
77
83
  }
78
84
  const styles = StyleSheet.create({
79
- page: {
80
- ...StyleSheet.absoluteFillObject
81
- }
85
+ page: StyleSheet.absoluteFillObject
82
86
  });
@@ -45,7 +45,8 @@ export function validateValues(props) {
45
45
  } = props;
46
46
  if (minimumValue > maximumValue || useRange && initialMinimumValue && initialMaximumValue && initialMinimumValue > initialMaximumValue) {
47
47
  LogService.forwardError({
48
- message: 'Your passed values are invalid. Please check if minimum values are not higher than maximum values'
48
+ // eslint-disable-next-line max-len
49
+ message: `Your passed values are invalid. Please check if minimum values are not higher than maximum values (minimumValue: ${minimumValue}, maximumValue: ${maximumValue}, initialMinimumValue: ${initialMinimumValue}, initialMaximumValue: ${initialMaximumValue})`
49
50
  });
50
51
  }
51
52
  if (value !== undefined && minimumValue && maximumValue && !inRange(value, minimumValue, maximumValue)) {