react-native-ui-lib 7.38.1-snapshot.6300 → 7.38.1-snapshot.6304

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-ui-lib",
3
- "version": "7.38.1-snapshot.6300",
3
+ "version": "7.38.1-snapshot.6304",
4
4
  "main": "src/index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
@@ -0,0 +1,27 @@
1
+ console.log(`inside index.web.js`);
2
+ export const icons = {
3
+ get check() {
4
+ return {uri: require('./check.png'), dimensions: {width: 24, height: 24}};
5
+ },
6
+ get checkSmall() {
7
+ return {uri: require('./check-small.png'), dimensions: {width: 24, height: 24}};
8
+ },
9
+ get minusSmall() {
10
+ return {uri: require('./minusSmall.png'), dimensions: {width: 24, height: 24}};
11
+ },
12
+ get plusSmall() {
13
+ return {uri: require('./plusSmall.png'), dimensions: {width: 24, height: 24}};
14
+ },
15
+ get search() {
16
+ return {uri: require('./search.png'), dimensions: {width: 24, height: 24}};
17
+ },
18
+ get x() {
19
+ return {uri: require('./x.png'), dimensions: {width: 24, height: 24}};
20
+ },
21
+ get xMedium() {
22
+ return {uri: require('./xMedium.png'), dimensions: {width: 24, height: 24}};
23
+ },
24
+ get xFlat() {
25
+ return {uri: require('./xFlat.png'), dimensions: {width: 24, height: 24}};
26
+ }
27
+ };
@@ -0,0 +1,5 @@
1
+ export const images = {
2
+ get gradient() {
3
+ return {uri: require('./gradient.png'), dimensions: {width: 56, height: 2}};
4
+ }
5
+ };
@@ -374,6 +374,7 @@ class Button extends PureComponent {
374
374
  animateLayout,
375
375
  modifiers,
376
376
  forwardedRef,
377
+ hitSlop: hitSlopProp,
377
378
  ...others
378
379
  } = this.props;
379
380
  const shadowStyle = this.getShadowStyle();
@@ -387,7 +388,7 @@ class Button extends PureComponent {
387
388
  const borderRadiusStyle = this.getBorderRadiusStyle();
388
389
  return <TouchableOpacity row centerV style={[this.styles.container, animateLayout && this.getAnimationDirectionStyle(), containerSizeStyle, this.isLink && this.styles.innerContainerLink, shadowStyle, margins, paddings, {
389
390
  backgroundColor
390
- }, borderRadiusStyle, outlineStyle, style]} activeOpacity={0.6} activeBackgroundColor={this.getActiveBackgroundColor()} onLayout={this.onLayout} onPress={onPress} disabled={disabled} testID={testID} hitSlop={this.getAccessibleHitSlop()} {...others} ref={forwardedRef}>
391
+ }, borderRadiusStyle, outlineStyle, style]} activeOpacity={0.6} activeBackgroundColor={this.getActiveBackgroundColor()} onLayout={this.onLayout} onPress={onPress} disabled={disabled} testID={testID} hitSlop={hitSlopProp ?? this.getAccessibleHitSlop()} {...others} ref={forwardedRef}>
391
392
  {this.props.children}
392
393
  {this.props.iconOnRight ? this.renderLabel() : this.renderIcon()}
393
394
  {this.props.iconOnRight ? this.renderIcon() : this.renderLabel()}
@@ -1,29 +1,13 @@
1
1
  import _isEqual from "lodash/isEqual";
2
- import { useState, useCallback, useRef, useEffect } from 'react';
3
- import { SafeAreaInsetsManager } from 'uilib-native';
4
- import { Constants } from "../../../commons/new";
2
+ import { useState, useCallback, useRef } from 'react';
5
3
  export default function useHintLayout({
6
4
  onBackgroundPress,
7
5
  targetFrame
8
6
  }) {
9
7
  const [targetLayoutState, setTargetLayout] = useState(targetFrame);
10
- const [targetLayoutInWindowState, setTargetLayoutInWindow] = useState();
8
+ const [targetLayoutInWindowState, setTargetLayoutInWindow] = useState(targetFrame);
11
9
  const [hintMessageWidth, setHintMessageWidth] = useState();
12
10
  const targetRef = useRef(null);
13
- useEffect(() => {
14
- if (targetFrame) {
15
- if (!onBackgroundPress) {
16
- setTargetLayoutInWindow(targetFrame);
17
- } else {
18
- SafeAreaInsetsManager.getSafeAreaInsets().then(insets => {
19
- setTargetLayoutInWindow({
20
- ...targetFrame,
21
- y: targetFrame.y + (insets?.top ?? 0) + Constants.getSafeAreaInsets().top
22
- });
23
- });
24
- }
25
- }
26
- }, []);
27
11
  const onTargetLayout = useCallback(({
28
12
  nativeEvent: {
29
13
  layout
@@ -156,7 +156,7 @@ class Image extends PureComponent {
156
156
  } = modifiers;
157
157
  return (
158
158
  // @ts-ignore
159
- <ImageView style={[tintColor && {
159
+ <ImageView style={[Constants.isWeb && source?.dimensions, tintColor && {
160
160
  tintColor
161
161
  }, shouldFlipRTL && styles.rtlFlipped, width && {
162
162
  width
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * @description: Image component that fades-in the image with animation once it's loaded
4
- * @extends: Animated.Image
5
- */
6
- declare const AnimatedImage: {
7
- (props: any): React.JSX.Element;
8
- displayName: string;
9
- };
10
- export default AnimatedImage;
@@ -1,52 +0,0 @@
1
- import React, { useState, useCallback, useEffect } from 'react';
2
- import { StyleSheet, Animated } from 'react-native';
3
- import View from "../../components/view";
4
-
5
- /**
6
- * @description: Image component that fades-in the image with animation once it's loaded
7
- * @extends: Animated.Image
8
- */
9
- const AnimatedImage = props => {
10
- const {
11
- containerStyle,
12
- source,
13
- loader,
14
- style,
15
- onLoad: propsOnLoad,
16
- animationDuration = 300,
17
- testID,
18
- ...others
19
- } = props;
20
- const [isLoading, setIsLoading] = useState(true);
21
- const opacity = new Animated.Value(0);
22
- useEffect(() => {
23
- // Fade in the image once it's loaded
24
- if (!isLoading) {
25
- Animated.timing(opacity, {
26
- toValue: 1,
27
- duration: animationDuration,
28
- useNativeDriver: true // Note: native driver may not work for opacity on the web
29
- }).start();
30
- }
31
- }, [isLoading, opacity, animationDuration]);
32
- const onLoad = useCallback(event => {
33
- setIsLoading(false);
34
- propsOnLoad?.(event);
35
- }, [propsOnLoad]);
36
- return <View style={containerStyle}>
37
- <Animated.Image {...others} source={source} style={[style, {
38
- opacity
39
- }]} // Apply the animated opacity
40
- onLoad={onLoad} // Handle the onLoad event
41
- testID={testID} />
42
- {isLoading && loader && <View style={styles.loader}>{loader}</View>}
43
- </View>;
44
- };
45
- AnimatedImage.displayName = 'AnimatedImage';
46
- export default AnimatedImage;
47
- const styles = StyleSheet.create({
48
- loader: {
49
- ...StyleSheet.absoluteFillObject,
50
- justifyContent: 'center'
51
- }
52
- });