@servesall/atoms 1.1.17 → 1.1.19

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": "@servesall/atoms",
3
- "version": "1.1.17",
3
+ "version": "1.1.19",
4
4
  "description": "Atoms for react-native",
5
5
  "main": "dist/bundle.cjs.js",
6
6
  "module": "dist/bundle.esm.js",
@@ -23,7 +23,9 @@
23
23
  "react-native-reanimated": "*"
24
24
  },
25
25
  "dependencies": {
26
- "react-native-status-bar-height": "^2.6.0"
26
+ "@gorhom/bottom-sheet": "^5.0.5",
27
+ "react-native-status-bar-height": "^2.6.0",
28
+ "styled-components": "^6.1.13"
27
29
  },
28
30
  "devDependencies": {
29
31
  "@babel/cli": "^7.17.10",
@@ -3,7 +3,17 @@ import styled from "styled-components/native";
3
3
  export const ButtonWrapper = styled.View``;
4
4
 
5
5
  export const ButtonStyle = styled.Pressable`
6
- min-height: ${(props) => (props.size === "big" ? "70px" : "56px")};
6
+ min-height: ${(props) => {
7
+ if (props.size === "big") {
8
+ return "70px";
9
+ } else if (props.size === "small") {
10
+ return "56px";
11
+ } else if (props.size === "xsmall") {
12
+ return "40px";
13
+ } else {
14
+ return "70px";
15
+ }
16
+ }};
7
17
  border-radius: 50px;
8
18
  background-color: ${(props) => props.color};
9
19
  opacity: ${(props) => (props.active ? 1 : 0.7)};
@@ -3,7 +3,17 @@ import styled from "styled-components/native";
3
3
  export const ButtonWrapper = styled.View``;
4
4
 
5
5
  export const ButtonStyle = styled.Pressable`
6
- min-height: ${(props) => (props.size === "big" ? "60px" : "54px")};
6
+ min-height: ${(props) => {
7
+ if (props.size === "big") {
8
+ return "60px";
9
+ } else if (props.size === "small") {
10
+ return "54px";
11
+ } else if (props.size === "xsmall") {
12
+ return "44px";
13
+ } else {
14
+ return "54px";
15
+ }
16
+ }};
7
17
  width: 100%;
8
18
  border-radius: ${(props) =>
9
19
  props.smallBorder
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState, useRef } from "react";
2
2
  import { H4 } from "../../Text";
3
3
  import { MarginHorizontal, Row } from "../../Layout";
4
- import { KeyboardAvoidingView, Platform } from "react-native";
4
+ import { KeyboardAvoidingView, Platform, Keyboard } from "react-native";
5
5
  import { InputWrapper, InputElement, BorderWrapper } from "./Animated.style";
6
6
  import Placeholder from "./Placeholder";
7
7
 
@@ -27,19 +27,43 @@ const Input = ({
27
27
  isRightBound = false,
28
28
  isLeftBound = false,
29
29
  euro = false,
30
+ focused = () => {},
30
31
  }) => {
31
32
  const [isFocused, setIsFocused] = useState(false);
32
33
  const [textValue, setTextValue] = useState(value || defaultValue);
33
34
  const inputRef = useRef();
34
35
 
36
+ useEffect(() => {
37
+ focused();
38
+ }, [isFocused]);
39
+
35
40
  useEffect(() => {
36
41
  textChange(textValue);
37
42
  }, [textValue]);
38
43
 
44
+ useEffect(() => {
45
+ defaultValue && setTextValue(defaultValue);
46
+ }, [defaultValue]);
47
+
39
48
  useEffect(() => {
40
49
  autoFocus && inputRef.current?.focus();
41
50
  }, [autoFocus]);
42
51
 
52
+ function blurTextInput() {
53
+ inputRef.current?.blur();
54
+ }
55
+
56
+ useEffect(() => {
57
+ const keyboardDidHideSubscription = Keyboard.addListener(
58
+ "keyboardDidHide",
59
+ blurTextInput
60
+ );
61
+
62
+ return () => {
63
+ keyboardDidHideSubscription?.remove();
64
+ };
65
+ }, []);
66
+
43
67
  return (
44
68
  <KeyboardAvoidingView
45
69
  behavior={Platform.OS === "ios" ? "padding" : "height"}
@@ -106,6 +130,7 @@ const Input = ({
106
130
  active={isFocused}
107
131
  style={style}
108
132
  returnKeyType="done"
133
+ onSubmitEditing={blurTextInput}
109
134
  />
110
135
  </Row>
111
136
  </MarginHorizontal>
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { BorderBottomElement } from "./Layout.style";
3
+
4
+ const BorderBottom = ({ children, style }) => {
5
+ return (
6
+ <BorderBottomElement style={{ ...style }}>{children}</BorderBottomElement>
7
+ );
8
+ };
9
+
10
+ export default BorderBottom;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { BorderBoxElement } from "./Layout.style";
3
+
4
+ const BorderBox = ({ children, style }) => {
5
+ return <BorderBoxElement style={{ ...style }}>{children}</BorderBoxElement>;
6
+ };
7
+
8
+ export default BorderBox;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { BorderTopElement } from "./Layout.style";
3
+
4
+ const BorderTop = ({ children, style }) => {
5
+ return <BorderTopElement style={{ ...style }}>{children}</BorderTopElement>;
6
+ };
7
+
8
+ export default BorderTop;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ImageWrapperElement } from "./Layout.style";
3
+
4
+ const ImageWrapper = ({ children, box = false, style }) => {
5
+ return (
6
+ <ImageWrapperElement style={{ ...style }}>{children}</ImageWrapperElement>
7
+ );
8
+ };
9
+
10
+ export default ImageWrapper;
@@ -141,6 +141,25 @@ export const BoxElement = styled.View`
141
141
  ${(props) => props.style};
142
142
  `;
143
143
 
144
+ export const BorderBottomElement = styled.View`
145
+ border-bottom-width: 2px;
146
+ border-color: ${(props) => props.theme.color7};
147
+ ${(props) => props.style};
148
+ `;
149
+
150
+ export const BorderTopElement = styled.View`
151
+ border-top-width: 2px;
152
+ border-color: ${(props) => props.theme.color7};
153
+ ${(props) => props.style};
154
+ `;
155
+
156
+ export const BorderBoxElement = styled.View`
157
+ border-width: 2px;
158
+ border-color: ${(props) => props.theme.color7};
159
+ border-radius: ${(props) => props.theme.borderRadiusSmall};
160
+ ${(props) => props.style};
161
+ `;
162
+
144
163
  export const FullScreenElement = styled.View`
145
164
  position: absolute;
146
165
  top: 0;
@@ -157,3 +176,10 @@ export const WebSmallWrapperElement = styled.View`
157
176
  width: 500px;
158
177
  ${(props) => props.style};
159
178
  `;
179
+
180
+ export const ImageWrapperElement = styled.View`
181
+ border-radius: ${(props) => props.theme.borderRadiusSmall};
182
+ background-color: ${(props) => props.theme.color7};
183
+ overflow: hidden;
184
+ ${(props) => props.styles};
185
+ `;
@@ -21,6 +21,10 @@ import FullScreen from "./FullScreen";
21
21
  import WebSmallWrapper from "./WebSmallWrapper";
22
22
  import Box from "./Box";
23
23
  import RoundedTopBox from "./RoundedTopBox";
24
+ import BorderBottom from "./BorderBottom";
25
+ import BorderTop from "./BorderTop";
26
+ import BorderBox from "./BorderBox";
27
+ import ImageWrapper from "./ImageWrapper";
24
28
 
25
29
  export {
26
30
  Center,
@@ -46,4 +50,8 @@ export {
46
50
  WebSmallWrapper,
47
51
  Box,
48
52
  RoundedTopBox,
53
+ BorderBottom,
54
+ BorderTop,
55
+ BorderBox,
56
+ ImageWrapper,
49
57
  };
@@ -14,7 +14,7 @@ export const RoundWrapper = styled(Animated.View)`
14
14
  ${(props) => props.style};
15
15
  `;
16
16
 
17
- export const RoundSlider = styled.View`
17
+ export const RoundSlider = styled(Animated.View)`
18
18
  width: 62px;
19
19
  height: 52px;
20
20
  background-color: ${(props) => props.theme.color1};
@@ -114,7 +114,18 @@ const SwipeButton = ({
114
114
 
115
115
  return (
116
116
  <Wrapper onLayout={onLayout}>
117
- <RoundWrapper style={[animatedBorder]}>
117
+ <Animated.View
118
+ style={[
119
+ animatedBorder,
120
+ {
121
+ width: "100%",
122
+ borderRadius: parseInt(theme.borderRadiusMedium, 10),
123
+ overflow: "hidden",
124
+ padding: 8,
125
+ borderWidth: 2,
126
+ },
127
+ ]}
128
+ >
118
129
  <Animated.View
119
130
  style={[
120
131
  colorWave,
@@ -150,7 +161,7 @@ const SwipeButton = ({
150
161
  </RoundSlider>
151
162
  </Animated.View>
152
163
  </PanGestureHandler>
153
- </RoundWrapper>
164
+ </Animated.View>
154
165
  </Wrapper>
155
166
  );
156
167
  };
package/src/index.js CHANGED
@@ -24,6 +24,10 @@ import {
24
24
  WebSmallWrapper,
25
25
  Box,
26
26
  RoundedTopBox,
27
+ BorderBottom,
28
+ BorderTop,
29
+ BorderBox,
30
+ ImageWrapper,
27
31
  } from "./Layout";
28
32
  import {
29
33
  Input,
@@ -52,7 +56,7 @@ import Switch from "./Switch";
52
56
  import SwipeButton from "./SlideToConfirm";
53
57
  import ErrorText from "./ErrorText";
54
58
  import CountryList from "./CountryFlatList";
55
- import SplashScreen from "./SplashScreen";
59
+ //import SplashScreen from "./SplashScreen";
56
60
 
57
61
  export {
58
62
  ThemeWrapper,
@@ -87,6 +91,10 @@ export {
87
91
  WebSmallWrapper,
88
92
  Box,
89
93
  RoundedTopBox,
94
+ BorderBottom,
95
+ BorderTop,
96
+ BorderBox,
97
+ ImageWrapper,
90
98
  Input,
91
99
  InputNormal,
92
100
  AnimatedPlaceholder,
@@ -110,5 +118,5 @@ export {
110
118
  ErrorText,
111
119
  AnimatedRoundedButton,
112
120
  CountryList,
113
- SplashScreen,
121
+ //SplashScreen,
114
122
  };