@tecsinapse/react-native-kit 4.0.1 → 4.0.3-beta.0

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.
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styled = require('./styled.js');
5
+
6
+ const BackDrop = ({ onPress, children }) => {
7
+ if (onPress) {
8
+ return /* @__PURE__ */ jsxRuntime.jsx(styled.StyledPressableBackDrop, { onPress, children });
9
+ }
10
+ return /* @__PURE__ */ jsxRuntime.jsx(styled.StyledViewBackDrop, { children });
11
+ };
12
+
13
+ module.exports = BackDrop;
@@ -6,6 +6,7 @@ var React = require('react');
6
6
  var reactNative = require('react-native');
7
7
  var reactNativeSafeAreaContext = require('react-native-safe-area-context');
8
8
  var styled = require('./styled.js');
9
+ var BackDrop = require('./BackDrop.js');
9
10
 
10
11
  const BACKDROP_ALPHA = 0.65;
11
12
  const INTERPOLATION_STEPS = 10;
@@ -123,7 +124,7 @@ const ModalView = ({
123
124
  hideEvent.remove();
124
125
  };
125
126
  }, []);
126
- return /* @__PURE__ */ jsxRuntime.jsx(styled.StyledPressableBackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(styled.BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsxRuntime.jsx(
127
+ return /* @__PURE__ */ jsxRuntime.jsx(BackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsxRuntime.jsx(styled.BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsxRuntime.jsx(
127
128
  reactNative.Animated.View,
128
129
  {
129
130
  style: {
@@ -10,6 +10,12 @@ const StyledPressableBackDrop = styled.Pressable`
10
10
  width: 100%;
11
11
  height: 100%;
12
12
  `;
13
+ const StyledViewBackDrop = styled.View`
14
+ flex: 1;
15
+ position: absolute;
16
+ width: 100%;
17
+ height: 100%;
18
+ `;
13
19
  const BackDropView = styled(reactNative.Animated.View)`
14
20
  justify-content: flex-end;
15
21
  flex: 1;
@@ -25,3 +31,4 @@ const CloseBar = styled.View`
25
31
  exports.BackDropView = BackDropView;
26
32
  exports.CloseBar = CloseBar;
27
33
  exports.StyledPressableBackDrop = StyledPressableBackDrop;
34
+ exports.StyledViewBackDrop = StyledViewBackDrop;
@@ -0,0 +1,11 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { StyledPressableBackDrop, StyledViewBackDrop } from './styled.js';
3
+
4
+ const BackDrop = ({ onPress, children }) => {
5
+ if (onPress) {
6
+ return /* @__PURE__ */ jsx(StyledPressableBackDrop, { onPress, children });
7
+ }
8
+ return /* @__PURE__ */ jsx(StyledViewBackDrop, { children });
9
+ };
10
+
11
+ export { BackDrop as default };
@@ -3,7 +3,8 @@ import { BoxContent } from '@tecsinapse/react-core';
3
3
  import { useState, useRef, useCallback, useEffect } from 'react';
4
4
  import { Animated, Easing, Keyboard, Pressable, Dimensions, StatusBar } from 'react-native';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import { StyledPressableBackDrop, BackDropView, CloseBar } from './styled.js';
6
+ import { BackDropView, CloseBar } from './styled.js';
7
+ import BackDrop from './BackDrop.js';
7
8
 
8
9
  const BACKDROP_ALPHA = 0.65;
9
10
  const INTERPOLATION_STEPS = 10;
@@ -121,7 +122,7 @@ const ModalView = ({
121
122
  hideEvent.remove();
122
123
  };
123
124
  }, []);
124
- return /* @__PURE__ */ jsx(StyledPressableBackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsx(BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsx(
125
+ return /* @__PURE__ */ jsx(BackDrop, { onPress: !frozen ? close : void 0, children: /* @__PURE__ */ jsx(BackDropView, { style: { backgroundColor: backgroundInterpolation }, children: /* @__PURE__ */ jsx(
125
126
  Animated.View,
126
127
  {
127
128
  style: {
@@ -8,6 +8,12 @@ const StyledPressableBackDrop = styled.Pressable`
8
8
  width: 100%;
9
9
  height: 100%;
10
10
  `;
11
+ const StyledViewBackDrop = styled.View`
12
+ flex: 1;
13
+ position: absolute;
14
+ width: 100%;
15
+ height: 100%;
16
+ `;
11
17
  const BackDropView = styled(Animated.View)`
12
18
  justify-content: flex-end;
13
19
  flex: 1;
@@ -20,4 +26,4 @@ const CloseBar = styled.View`
20
26
  height: ${RFValueStr("5px")};
21
27
  `;
22
28
 
23
- export { BackDropView, CloseBar, StyledPressableBackDrop };
29
+ export { BackDropView, CloseBar, StyledPressableBackDrop, StyledViewBackDrop };
@@ -0,0 +1,5 @@
1
+ declare const BackDrop: ({ onPress, children }: {
2
+ onPress: any;
3
+ children: any;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default BackDrop;
@@ -3,6 +3,12 @@ export declare const StyledPressableBackDrop: import("@emotion/native").StyledCo
3
3
  theme?: import("@emotion/react").Theme;
4
4
  as?: React.ElementType;
5
5
  } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {}>;
6
+ export declare const StyledViewBackDrop: import("@emotion/native").StyledComponent<import("react-native").ViewProps & {
7
+ theme?: import("@emotion/react").Theme;
8
+ as?: React.ElementType;
9
+ } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, {}, {
10
+ ref?: import("react").Ref<import("react-native").View> | undefined;
11
+ }>;
6
12
  export declare const BackDropView: import("@emotion/native").StyledComponent<Animated.AnimatedProps<import("react-native").ViewProps & import("react").RefAttributes<import("react-native").View>> & {
7
13
  theme?: import("@emotion/react").Theme;
8
14
  as?: React.ElementType;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-native-kit",
3
3
  "description": "React Native components library",
4
- "version": "4.0.1",
4
+ "version": "4.0.3-beta.0",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -40,5 +40,5 @@
40
40
  "react-native-safe-area-context": "^4.0.0",
41
41
  "react-native-vector-icons": "^9.2.0"
42
42
  },
43
- "gitHead": "450f025db0e2b628bd39e2d75125c84e0dd8b5be"
43
+ "gitHead": "8d8e41a3ecc06a97af46ddb9b985fef79bc85e21"
44
44
  }