@holper/react-native-holper-storybook 0.7.1 → 0.7.2
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/lib/components/DonutCountdown/style.ts +2 -1
- package/lib/components/Input/style.ts +2 -1
- package/lib/components/Select/index.tsx +1 -0
- package/lib/components/Select/style.ts +6 -1
- package/lib/components/Toast/index.tsx +34 -20
- package/lib/configs/constants.ts +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dimensions, StyleSheet } from 'react-native';
|
|
1
|
+
import { Dimensions, Platform, StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import { borderRadius, Colors } from '../../configs/constants';
|
|
4
4
|
|
|
@@ -27,6 +27,7 @@ export default StyleSheet.create({
|
|
|
27
27
|
fontFamily: 'poppins_regular',
|
|
28
28
|
backgroundColor: Colors.white,
|
|
29
29
|
marginVertical: 6,
|
|
30
|
+
paddingTop: Platform.OS === 'android' ? 14 : 0,
|
|
30
31
|
},
|
|
31
32
|
fixedSize: {
|
|
32
33
|
width: width - 60,
|
|
@@ -29,6 +29,7 @@ const Select = ({
|
|
|
29
29
|
Icon={() => <Feather name="chevron-down" size={24} style={style.iconStyle} />}
|
|
30
30
|
useNativeAndroidPickerStyle={false}
|
|
31
31
|
pickerProps={{ mode: 'dropdown', enabled: !disabled, itemStyle: style.itemStyle }}
|
|
32
|
+
dropdownItemStyle={style.dropdownStyle}
|
|
32
33
|
style={{
|
|
33
34
|
inputIOSContainer: { pointerEvents: 'none', ...style.basicStyle, ...style[`${variant}Container`] },
|
|
34
35
|
inputAndroidContainer: { ...style.basicStyle, ...style[`${variant}Container`] },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dimensions, StyleSheet } from 'react-native';
|
|
1
|
+
import { Dimensions, Platform, StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import { borderRadius, Colors } from '../../configs/constants';
|
|
4
4
|
|
|
@@ -42,6 +42,7 @@ export default StyleSheet.create({
|
|
|
42
42
|
flex: 1,
|
|
43
43
|
color: Colors.darkblue,
|
|
44
44
|
fontFamily: 'poppins_regular',
|
|
45
|
+
top: Platform.OS === 'android' ? 2 : 0,
|
|
45
46
|
},
|
|
46
47
|
errorFontStyle: {
|
|
47
48
|
color: Colors.red,
|
|
@@ -56,6 +57,10 @@ export default StyleSheet.create({
|
|
|
56
57
|
marginTop: 12,
|
|
57
58
|
color: Colors.darkblue,
|
|
58
59
|
},
|
|
60
|
+
dropdownStyle: {
|
|
61
|
+
backgroundColor: Colors.white,
|
|
62
|
+
color: Colors.darkblue,
|
|
63
|
+
},
|
|
59
64
|
itemStyle: {
|
|
60
65
|
color: Colors.darkblue,
|
|
61
66
|
fontFamily: 'poppins_regular',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Ionicons } from '@expo/vector-icons';
|
|
2
|
+
import { useColorScheme } from 'react-native';
|
|
2
3
|
import { toast, Toaster } from 'sonner-native';
|
|
3
4
|
|
|
4
5
|
import { Colors } from '../../configs/constants';
|
|
@@ -6,26 +7,39 @@ import style from './style';
|
|
|
6
7
|
|
|
7
8
|
import type { ToastMessageProps } from '../../configs/types';
|
|
8
9
|
|
|
9
|
-
const Toast = () =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
10
|
+
const Toast = () => {
|
|
11
|
+
const colorScheme = useColorScheme();
|
|
12
|
+
const isDarkMode = colorScheme === 'dark';
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Toaster
|
|
16
|
+
autoWiggleOnUpdate="toast-change"
|
|
17
|
+
closeButton
|
|
18
|
+
duration={3000}
|
|
19
|
+
icons={{
|
|
20
|
+
error: (
|
|
21
|
+
<Ionicons name="alert-circle-outline" color={isDarkMode ? Colors.brightred : Colors.darkred} size={30} />
|
|
22
|
+
),
|
|
23
|
+
success: (
|
|
24
|
+
<Ionicons
|
|
25
|
+
name="checkmark-circle-outline"
|
|
26
|
+
color={isDarkMode ? Colors.brightgreen : Colors.darkgreen}
|
|
27
|
+
size={30}
|
|
28
|
+
/>
|
|
29
|
+
),
|
|
30
|
+
}}
|
|
31
|
+
pauseWhenPageIsHidden
|
|
32
|
+
position="top-center"
|
|
33
|
+
richColors
|
|
34
|
+
swipeToDismissDirection="up"
|
|
35
|
+
visibleToasts={4}
|
|
36
|
+
toastOptions={{
|
|
37
|
+
titleStyle: style.titleStyle,
|
|
38
|
+
descriptionStyle: style.descriptionStyle,
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
29
43
|
|
|
30
44
|
export const sendMessage = ({ variant, message, description }: ToastMessageProps) => {
|
|
31
45
|
toast[variant](message, { description });
|
package/lib/configs/constants.ts
CHANGED
|
@@ -8,6 +8,7 @@ export const Colors = {
|
|
|
8
8
|
whiteice: '#E7EAEE',
|
|
9
9
|
whitepearl: '#F7F8F9',
|
|
10
10
|
// Greens
|
|
11
|
+
brightgreen: '#8AE8AD',
|
|
11
12
|
darkgreen: '#008A2E',
|
|
12
13
|
green: '#3FE384',
|
|
13
14
|
lightergreen: '#F5FEFA',
|
|
@@ -28,6 +29,7 @@ export const Colors = {
|
|
|
28
29
|
placeboPurple: '#F0ECFE',
|
|
29
30
|
violet: '#300049',
|
|
30
31
|
// Reds
|
|
32
|
+
brightred: '#E6A3A6',
|
|
31
33
|
darkred: '#E60606',
|
|
32
34
|
lightred: '#FFC1C1',
|
|
33
35
|
red: '#FD4C4C',
|