@nexara/nativeflow 0.1.1 → 0.1.4
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/commonjs/components/Button/Button.js +61 -47
- package/lib/commonjs/components/Button/Button.js.map +1 -1
- package/lib/commonjs/components/CheckBox/CheckBox.js +39 -29
- package/lib/commonjs/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/commonjs/components/Chip/Chip.js +2 -2
- package/lib/commonjs/components/Chip/Chip.js.map +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +53 -48
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogBody.js +6 -8
- package/lib/commonjs/components/Dialog/DialogBody.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogDescription.js +5 -8
- package/lib/commonjs/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogFoot.js +13 -13
- package/lib/commonjs/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogHead.js +17 -16
- package/lib/commonjs/components/Dialog/DialogHead.js.map +1 -1
- package/lib/commonjs/components/Divider/Divider.js +5 -9
- package/lib/commonjs/components/Divider/Divider.js.map +1 -1
- package/lib/commonjs/components/Grid/Grid.js +0 -1
- package/lib/commonjs/components/Grid/Grid.js.map +1 -1
- package/lib/commonjs/components/Header/Header.js.map +1 -1
- package/lib/commonjs/components/Icon/Icon.js +9 -5
- package/lib/commonjs/components/Icon/Icon.js.map +1 -1
- package/lib/commonjs/components/IconButton/IconButton.js +6 -3
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/components/Link/Link.js +13 -15
- package/lib/commonjs/components/Link/Link.js.map +1 -1
- package/lib/commonjs/components/Menu/Menu.js +51 -54
- package/lib/commonjs/components/Menu/Menu.js.map +1 -1
- package/lib/commonjs/components/Menu/MenuItem.js +0 -2
- package/lib/commonjs/components/Menu/MenuItem.js.map +1 -1
- package/lib/commonjs/components/Portal/Portal.js +1 -1
- package/lib/commonjs/components/Portal/Portal.js.map +1 -1
- package/lib/commonjs/components/Progress/Progress.js +25 -15
- package/lib/commonjs/components/Progress/Progress.js.map +1 -1
- package/lib/commonjs/components/Stack/HStack.js +9 -13
- package/lib/commonjs/components/Stack/HStack.js.map +1 -1
- package/lib/commonjs/components/Stack/VStack.js +5 -6
- package/lib/commonjs/components/Stack/VStack.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledText.js +11 -14
- package/lib/commonjs/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledView.js +14 -14
- package/lib/commonjs/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/commonjs/components/Switch/Switch.js +4 -4
- package/lib/commonjs/components/Switch/Switch.js.map +1 -1
- package/lib/commonjs/components/TouchableRipple/TouchableRipple.js +90 -103
- package/lib/commonjs/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/commonjs/components/UserInput/UserInput.js +31 -34
- package/lib/commonjs/components/UserInput/UserInput.js.map +1 -1
- package/lib/commonjs/helpers/LightenColorShades.js +18 -5
- package/lib/commonjs/helpers/LightenColorShades.js.map +1 -1
- package/lib/commonjs/helpers/ResponsiveCalculations.js +30 -4
- package/lib/commonjs/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/commonjs/helpers/index.js +16 -0
- package/lib/commonjs/helpers/index.js.map +1 -1
- package/lib/commonjs/index.js +0 -7
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/themes/LightTheme.js +1 -3
- package/lib/commonjs/themes/LightTheme.js.map +1 -1
- package/lib/commonjs/types/index.js +11 -0
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/progress.type.js +2 -0
- package/lib/commonjs/types/progress.type.js.map +1 -0
- package/lib/module/components/Button/Button.js +62 -48
- package/lib/module/components/Button/Button.js.map +1 -1
- package/lib/module/components/CheckBox/CheckBox.js +41 -31
- package/lib/module/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/components/Chip/Chip.js +2 -2
- package/lib/module/components/Chip/Chip.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js +53 -48
- package/lib/module/components/Dialog/Dialog.js.map +1 -1
- package/lib/module/components/Dialog/DialogBody.js +7 -9
- package/lib/module/components/Dialog/DialogBody.js.map +1 -1
- package/lib/module/components/Dialog/DialogDescription.js +6 -9
- package/lib/module/components/Dialog/DialogDescription.js.map +1 -1
- package/lib/module/components/Dialog/DialogFoot.js +13 -13
- package/lib/module/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/module/components/Dialog/DialogHead.js +17 -16
- package/lib/module/components/Dialog/DialogHead.js.map +1 -1
- package/lib/module/components/Divider/Divider.js +5 -9
- package/lib/module/components/Divider/Divider.js.map +1 -1
- package/lib/module/components/Grid/Grid.js +0 -1
- package/lib/module/components/Grid/Grid.js.map +1 -1
- package/lib/module/components/Header/Header.js.map +1 -1
- package/lib/module/components/Icon/Icon.js +7 -4
- package/lib/module/components/Icon/Icon.js.map +1 -1
- package/lib/module/components/IconButton/IconButton.js +5 -3
- package/lib/module/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/Link/Link.js +14 -16
- package/lib/module/components/Link/Link.js.map +1 -1
- package/lib/module/components/Menu/Menu.js +51 -54
- package/lib/module/components/Menu/Menu.js.map +1 -1
- package/lib/module/components/Menu/MenuItem.js +0 -2
- package/lib/module/components/Menu/MenuItem.js.map +1 -1
- package/lib/module/components/Portal/Portal.js +1 -1
- package/lib/module/components/Portal/Portal.js.map +1 -1
- package/lib/module/components/Progress/Progress.js +26 -16
- package/lib/module/components/Progress/Progress.js.map +1 -1
- package/lib/module/components/Stack/HStack.js +9 -13
- package/lib/module/components/Stack/HStack.js.map +1 -1
- package/lib/module/components/Stack/VStack.js +6 -7
- package/lib/module/components/Stack/VStack.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledText.js +12 -15
- package/lib/module/components/StyledComponents/StyledText.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledView.js +15 -15
- package/lib/module/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/module/components/Switch/Switch.js +4 -4
- package/lib/module/components/Switch/Switch.js.map +1 -1
- package/lib/module/components/TouchableRipple/TouchableRipple.js +90 -96
- package/lib/module/components/TouchableRipple/TouchableRipple.js.map +1 -1
- package/lib/module/components/UserInput/UserInput.js +32 -37
- package/lib/module/components/UserInput/UserInput.js.map +1 -1
- package/lib/module/components/UserInput/UserInputV2.js.map +1 -1
- package/lib/module/helpers/LightenColorShades.js +18 -5
- package/lib/module/helpers/LightenColorShades.js.map +1 -1
- package/lib/module/helpers/ResponsiveCalculations.js +28 -3
- package/lib/module/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/module/helpers/index.js +1 -0
- package/lib/module/helpers/index.js.map +1 -1
- package/lib/module/index.js +5 -5
- package/lib/module/index.js.map +1 -2
- package/lib/module/themes/LightTheme.js +1 -2
- package/lib/module/themes/LightTheme.js.map +1 -1
- package/lib/module/types/index.js +1 -0
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/progress.type.js +2 -0
- package/lib/module/types/progress.type.js.map +1 -0
- package/lib/typescript/commonjs/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogBody.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Divider/Divider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Header/Header.d.ts +1 -0
- package/lib/typescript/commonjs/src/components/Header/Header.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Icon/Icon.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Link/Link.d.ts +4 -0
- package/lib/typescript/commonjs/src/components/Link/Link.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Portal/Portal.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/Portal/Portal.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Progress/Progress.d.ts +1 -12
- package/lib/typescript/commonjs/src/components/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledText.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/TouchableRipple/TouchableRipple.d.ts +0 -10
- package/lib/typescript/commonjs/src/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts +1 -34
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInputV2.d.ts +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInputV2.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/LightenColorShades.d.ts +1 -1
- package/lib/typescript/commonjs/src/helpers/LightenColorShades.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts +1 -0
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/helpers/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/index.d.ts +0 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/themes/LightTheme.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/button.type.d.ts +3 -2
- package/lib/typescript/commonjs/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/chip.type.d.ts +1 -0
- package/lib/typescript/commonjs/src/types/chip.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/dialog.type.d.ts +4 -6
- package/lib/typescript/commonjs/src/types/dialog.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/types/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/menu.type.d.ts +7 -2
- package/lib/typescript/commonjs/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/progress.type.d.ts +13 -0
- package/lib/typescript/commonjs/src/types/progress.type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/stack.type.d.ts +6 -4
- package/lib/typescript/commonjs/src/types/stack.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts +7 -1
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts +7 -1
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogBody.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Divider/Divider.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Grid/Grid.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Header/Header.d.ts +1 -0
- package/lib/typescript/module/src/components/Header/Header.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Icon/Icon.d.ts +1 -1
- package/lib/typescript/module/src/components/Icon/Icon.d.ts.map +1 -1
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts +2 -2
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Link/Link.d.ts +4 -0
- package/lib/typescript/module/src/components/Link/Link.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/MenuItem.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Portal/Portal.d.ts +1 -1
- package/lib/typescript/module/src/components/Portal/Portal.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Progress/Progress.d.ts +1 -12
- package/lib/typescript/module/src/components/Progress/Progress.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Stack/HStack.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Stack/VStack.d.ts.map +1 -1
- package/lib/typescript/module/src/components/StyledComponents/StyledText.d.ts.map +1 -1
- package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/TouchableRipple/TouchableRipple.d.ts +0 -10
- package/lib/typescript/module/src/components/TouchableRipple/TouchableRipple.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts +1 -34
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInputV2.d.ts +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInputV2.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/LightenColorShades.d.ts +1 -1
- package/lib/typescript/module/src/helpers/LightenColorShades.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts +1 -0
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/index.d.ts +1 -0
- package/lib/typescript/module/src/helpers/index.d.ts.map +1 -1
- package/lib/typescript/module/src/index.d.ts +0 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/themes/LightTheme.d.ts.map +1 -1
- package/lib/typescript/module/src/types/button.type.d.ts +3 -2
- package/lib/typescript/module/src/types/button.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/chip.type.d.ts +1 -0
- package/lib/typescript/module/src/types/chip.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/dialog.type.d.ts +4 -6
- package/lib/typescript/module/src/types/dialog.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/index.d.ts +1 -0
- package/lib/typescript/module/src/types/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types/menu.type.d.ts +7 -2
- package/lib/typescript/module/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/progress.type.d.ts +13 -0
- package/lib/typescript/module/src/types/progress.type.d.ts.map +1 -0
- package/lib/typescript/module/src/types/stack.type.d.ts +6 -4
- package/lib/typescript/module/src/types/stack.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/styledComponents.type.d.ts +7 -1
- package/lib/typescript/module/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/userInput.type.d.ts +7 -1
- package/lib/typescript/module/src/types/userInput.type.d.ts.map +1 -1
- package/package.json +29 -19
- package/src/components/Button/Button.tsx +122 -79
- package/src/components/CheckBox/CheckBox.tsx +61 -49
- package/src/components/Chip/Chip.tsx +2 -2
- package/src/components/Dialog/Dialog.tsx +55 -51
- package/src/components/Dialog/DialogBody.tsx +7 -9
- package/src/components/Dialog/DialogDescription.tsx +10 -10
- package/src/components/Dialog/DialogFoot.tsx +15 -13
- package/src/components/Dialog/DialogHead.tsx +20 -17
- package/src/components/Divider/Divider.tsx +5 -10
- package/src/components/Grid/Grid.tsx +0 -1
- package/src/components/Header/Header.tsx +1 -0
- package/src/components/Icon/Icon.tsx +8 -4
- package/src/components/IconButton/IconButton.tsx +6 -6
- package/src/components/Link/Link.tsx +24 -7
- package/src/components/Menu/Menu.tsx +51 -51
- package/src/components/Menu/MenuItem.tsx +0 -2
- package/src/components/Portal/Portal.tsx +2 -2
- package/src/components/Progress/Progress.tsx +32 -35
- package/src/components/Stack/HStack.tsx +12 -14
- package/src/components/Stack/VStack.tsx +10 -9
- package/src/components/StyledComponents/StyledText.tsx +4 -7
- package/src/components/StyledComponents/StyledView.tsx +6 -2
- package/src/components/Switch/Switch.tsx +4 -4
- package/src/components/TouchableRipple/TouchableRipple.tsx +83 -83
- package/src/components/UserInput/UserInput.tsx +45 -39
- package/src/components/UserInput/UserInputV2.tsx +2 -2
- package/src/helpers/LightenColorShades.ts +26 -6
- package/src/helpers/ResponsiveCalculations.ts +28 -3
- package/src/helpers/index.ts +2 -1
- package/src/index.ts +2 -2
- package/src/themes/LightTheme.ts +1 -2
- package/src/types/button.type.ts +3 -2
- package/src/types/chip.type.ts +1 -0
- package/src/types/dialog.type.ts +6 -8
- package/src/types/index.ts +2 -1
- package/src/types/menu.type.ts +8 -2
- package/src/types/progress.type.ts +16 -0
- package/src/types/stack.type.ts +6 -4
- package/src/types/styledComponents.type.ts +8 -1
- package/src/types/userInput.type.ts +8 -1
- package/src/index.tsx +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { JSX } from 'react';
|
|
3
|
+
import { StyleSheet, TouchableOpacity, type ViewStyle } from "react-native";
|
|
3
4
|
import { verticalScale, horizontalScale } from "../../helpers/ResponsiveCalculations";
|
|
4
5
|
import { StyledText, StyledView } from '../StyledComponents';
|
|
5
6
|
import { useTheme } from '../../hooks';
|
|
6
7
|
import { getButtonColors } from './utils';
|
|
7
|
-
import TouchableRipple from '../TouchableRipple/TouchableRipple';
|
|
8
8
|
import type { ButtonProps } from '../../types';
|
|
9
9
|
|
|
10
10
|
|
|
@@ -32,7 +32,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
32
32
|
buttonContainerStyle,
|
|
33
33
|
textStyle,
|
|
34
34
|
onPress,
|
|
35
|
-
...
|
|
35
|
+
...rest
|
|
36
36
|
}) => {
|
|
37
37
|
const theme: any = useTheme();
|
|
38
38
|
|
|
@@ -44,110 +44,153 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
44
44
|
strokeColor,
|
|
45
45
|
disabled
|
|
46
46
|
});
|
|
47
|
-
|
|
48
|
-
const STYLES = StyleSheet.create({
|
|
47
|
+
const dynamicStyles = {
|
|
49
48
|
BUTTON_CONT: {
|
|
50
49
|
backgroundColor: backgroundColor,
|
|
51
50
|
borderWidth: variant === 'contained' ? 0 : stroke,
|
|
52
51
|
borderColor: buttonBorderColor,
|
|
53
|
-
maxWidth: '100%',
|
|
54
52
|
},
|
|
55
53
|
BUTTON_TEXT: {
|
|
56
54
|
color: buttonTextColor,
|
|
57
|
-
textAlign: 'center',
|
|
58
55
|
fontFamily: titleFF ?? '',
|
|
59
56
|
},
|
|
60
|
-
|
|
57
|
+
FLAT_BTN_MAIN_CONT: {
|
|
61
58
|
borderRadius: verticalScale(br),
|
|
62
|
-
|
|
63
|
-
alignSelf: fullWidth ? 'stretch' : 'flex-start',
|
|
59
|
+
alignSelf: fullWidth ? 'stretch' : 'flex-start' as ViewStyle['alignSelf'],
|
|
64
60
|
},
|
|
65
|
-
|
|
61
|
+
FLAT_BTN_INNER_CONT: {
|
|
66
62
|
paddingVertical: verticalScale(paddingV),
|
|
67
63
|
paddingHorizontal: horizontalScale(!fullWidth ? paddingH : 30),
|
|
68
64
|
borderRadius: verticalScale(br),
|
|
69
|
-
flexDirection: 'row',
|
|
70
|
-
alignItems: 'center',
|
|
71
|
-
justifyContent: 'space-between',
|
|
72
|
-
gap: horizontalScale(10),
|
|
73
65
|
},
|
|
74
|
-
|
|
75
|
-
borderRadius: verticalScale(100),
|
|
66
|
+
ROUND_BTN_INNER_CONT: {
|
|
76
67
|
height: verticalScale(size),
|
|
77
68
|
width: verticalScale(size),
|
|
78
|
-
alignItems: 'center',
|
|
79
|
-
justifyContent: 'center',
|
|
80
69
|
}
|
|
81
|
-
}
|
|
70
|
+
};
|
|
82
71
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
// ref={ref}
|
|
92
|
-
{...props}
|
|
93
|
-
>
|
|
94
|
-
<StyledView style={[STYLES.FLAT_BUTTON_CONT, STYLES.BUTTON_CONT, buttonContainerStyle]}>
|
|
95
|
-
{(renderLeftIcon || (fullWidth && renderRightIcon)) && (
|
|
96
|
-
<StyledView f={fullWidth ? 1 : undefined}>
|
|
97
|
-
{renderLeftIcon && React.cloneElement(renderLeftIcon, {
|
|
98
|
-
color: buttonIconColor
|
|
99
|
-
})}
|
|
100
|
-
</StyledView>
|
|
101
|
-
)}
|
|
72
|
+
const cloneElement = (element: JSX.Element): JSX.Element | null => {
|
|
73
|
+
if (React.isValidElement<{ color?: string }>(element)) {
|
|
74
|
+
return React.cloneElement(element, {
|
|
75
|
+
color: buttonIconColor
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
81
|
+
return (<>
|
|
82
|
+
{type === 'flat' && (
|
|
83
|
+
<StyledView style={[STYLES.FLAT_BTN_MAIN_CONT, dynamicStyles.FLAT_BTN_MAIN_CONT]}>
|
|
84
|
+
<TouchableOpacity
|
|
85
|
+
onPress={onPress}
|
|
86
|
+
// rippleColor={rippleColor}
|
|
87
|
+
disabled={disabled}
|
|
88
|
+
// ref={ref}
|
|
89
|
+
{...rest}
|
|
90
|
+
>
|
|
91
|
+
|
|
92
|
+
{/* <TouchableRipple
|
|
93
|
+
onPress={onPress}
|
|
94
|
+
rippleColor={rippleColor}
|
|
95
|
+
disabled={disabled}
|
|
96
|
+
// ref={ref}
|
|
97
|
+
{...rest}
|
|
98
|
+
> */}
|
|
99
|
+
<StyledView
|
|
100
|
+
style={[
|
|
101
|
+
STYLES.FLAT_BTN_INNER_CONT,
|
|
102
|
+
STYLES.BUTTON_CONT,
|
|
103
|
+
dynamicStyles.FLAT_BTN_INNER_CONT,
|
|
104
|
+
dynamicStyles.BUTTON_CONT,
|
|
105
|
+
buttonContainerStyle
|
|
106
|
+
]}>
|
|
107
|
+
{(renderLeftIcon || (fullWidth && renderRightIcon)) && (
|
|
108
|
+
<StyledView f={fullWidth ? 1 : undefined}>
|
|
109
|
+
{renderLeftIcon && cloneElement(renderLeftIcon)}
|
|
110
110
|
</StyledView>
|
|
111
|
+
)}
|
|
111
112
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
<StyledView
|
|
114
|
+
flexShrink={1}
|
|
115
|
+
f={fullWidth ? 8 : undefined}
|
|
116
|
+
>
|
|
117
|
+
<StyledText numberOfLines={1} fs={titleFS} variant={titleVariant}
|
|
118
|
+
style={[
|
|
119
|
+
STYLES.BUTTON_TEXT,
|
|
120
|
+
dynamicStyles.BUTTON_TEXT,
|
|
121
|
+
textStyle
|
|
122
|
+
]}
|
|
123
|
+
>
|
|
124
|
+
{title}
|
|
125
|
+
</StyledText>
|
|
119
126
|
</StyledView>
|
|
120
|
-
</TouchableRipple>
|
|
121
|
-
</StyledView>
|
|
122
|
-
)}
|
|
123
127
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
128
|
+
{(renderRightIcon || (fullWidth && renderLeftIcon)) && (
|
|
129
|
+
<StyledView alignItems='flex-end' f={fullWidth ? 1 : undefined}>
|
|
130
|
+
{renderRightIcon && cloneElement(renderRightIcon)}
|
|
131
|
+
</StyledView>
|
|
132
|
+
)}
|
|
133
|
+
</StyledView>
|
|
134
|
+
{/* </TouchableRipple> */}
|
|
135
|
+
</TouchableOpacity>
|
|
136
|
+
|
|
137
|
+
</StyledView>
|
|
138
|
+
)}
|
|
139
|
+
|
|
140
|
+
{type === 'round' && (
|
|
141
|
+
<StyledView style={STYLES.ROUND_BTN_MAIN_CONT} >
|
|
142
|
+
<TouchableOpacity
|
|
143
|
+
onPress={onPress}
|
|
144
|
+
// rippleColor={rippleColor}
|
|
145
|
+
{...rest}
|
|
134
146
|
>
|
|
135
|
-
<
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
147
|
+
<StyledView
|
|
148
|
+
style={[
|
|
149
|
+
STYLES.BUTTON_CONT,
|
|
150
|
+
STYLES.ROUND_BTN_INNER_CONT,
|
|
151
|
+
dynamicStyles.BUTTON_CONT,
|
|
152
|
+
dynamicStyles.ROUND_BTN_INNER_CONT,
|
|
153
|
+
buttonContainerStyle
|
|
154
|
+
]}
|
|
139
155
|
>
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
</StyledView>
|
|
147
|
-
)}
|
|
148
|
-
</>
|
|
156
|
+
{renderIcon && cloneElement(renderIcon)}
|
|
157
|
+
</StyledView>
|
|
158
|
+
</TouchableOpacity>
|
|
159
|
+
</StyledView>
|
|
160
|
+
)}
|
|
161
|
+
</>
|
|
149
162
|
);
|
|
150
163
|
};
|
|
151
164
|
|
|
152
165
|
export default Button;
|
|
153
166
|
export type { ButtonProps };
|
|
167
|
+
|
|
168
|
+
const STYLES = StyleSheet.create({
|
|
169
|
+
BUTTON_CONT: {
|
|
170
|
+
maxWidth: '100%',
|
|
171
|
+
},
|
|
172
|
+
BUTTON_TEXT: {
|
|
173
|
+
textAlign: 'center',
|
|
174
|
+
},
|
|
175
|
+
FLAT_BTN_MAIN_CONT: {
|
|
176
|
+
overflow: 'hidden',
|
|
177
|
+
},
|
|
178
|
+
FLAT_BTN_INNER_CONT: {
|
|
179
|
+
flexDirection: 'row',
|
|
180
|
+
alignItems: 'center',
|
|
181
|
+
justifyContent: 'space-between',
|
|
182
|
+
gap: horizontalScale(10),
|
|
183
|
+
},
|
|
184
|
+
ROUND_BTN_MAIN_CONT: {
|
|
185
|
+
overflow: 'hidden',
|
|
186
|
+
borderRadius: verticalScale(100),
|
|
187
|
+
alignSelf: 'flex-start',
|
|
188
|
+
},
|
|
189
|
+
ROUND_BTN_INNER_CONT: {
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'center',
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
import { StyleSheet, TouchableWithoutFeedback } from "react-native";
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { StyleSheet, TouchableWithoutFeedback, Animated, type ViewStyle } from "react-native";
|
|
3
3
|
import { StyledText, StyledView } from "../StyledComponents";
|
|
4
|
-
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from "react-native-reanimated";
|
|
5
4
|
import { useTheme } from "../../hooks";
|
|
6
5
|
import { horizontalScale, verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
7
6
|
import { Check } from "../../assets/svg";
|
|
@@ -33,36 +32,33 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
33
32
|
setIsCheckboxChecked(defaultValue);
|
|
34
33
|
}, [defaultValue]);
|
|
35
34
|
|
|
36
|
-
const scaleVal =
|
|
35
|
+
const scaleVal = useRef(new Animated.Value(1)).current;
|
|
37
36
|
const { colors }: any = useTheme();
|
|
38
37
|
activeBgColor = disabled ? colors.disable : activeBgColor ?? colors.primary;
|
|
39
38
|
iconSize = iconSize ?? size / 1.5;
|
|
40
39
|
const bgColor = (!disableBuiltInState && isCheckboxChecked) || (disableBuiltInState && isChecked) ? activeBgColor : inActiveBgColor;
|
|
40
|
+
const textColor = disabled ? colors.textDisable : colors.textPrimary;
|
|
41
41
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
CHECKBOX_PARENT_CONT: {
|
|
50
|
-
height: verticalScale(size),
|
|
51
|
-
width: verticalScale(size),
|
|
52
|
-
borderWidth: 0.8,
|
|
53
|
-
borderColor: disabled ? colors.disable : activeBgColor,
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
justifyContent: 'center',
|
|
56
|
-
borderRadius: variant === 'square' ? 5 : verticalScale(size),
|
|
57
|
-
padding: verticalScale(7),
|
|
58
|
-
backgroundColor: bgColor,
|
|
59
|
-
}
|
|
60
|
-
});
|
|
42
|
+
const dynamicMainContStyles: ViewStyle = {
|
|
43
|
+
height: verticalScale(size),
|
|
44
|
+
width: verticalScale(size),
|
|
45
|
+
borderColor: disabled ? colors.disable : activeBgColor,
|
|
46
|
+
borderRadius: variant === 'square' ? 5 : verticalScale(size),
|
|
47
|
+
backgroundColor: bgColor
|
|
48
|
+
};
|
|
61
49
|
|
|
62
|
-
const animatedStyle =
|
|
63
|
-
transform: [{ scale: scaleVal
|
|
64
|
-
}
|
|
50
|
+
const animatedStyle = {
|
|
51
|
+
transform: [{ scale: scaleVal }]
|
|
52
|
+
};
|
|
65
53
|
|
|
54
|
+
const animateScale = (toValue: number) => {
|
|
55
|
+
Animated.spring(scaleVal, {
|
|
56
|
+
toValue,
|
|
57
|
+
speed: 20,
|
|
58
|
+
bounciness: 8,
|
|
59
|
+
useNativeDriver: true,
|
|
60
|
+
}).start();
|
|
61
|
+
};
|
|
66
62
|
const onUserClick = () => {
|
|
67
63
|
if (!disableBuiltInState) {
|
|
68
64
|
onPress?.(!isCheckboxChecked);
|
|
@@ -71,32 +67,48 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
71
67
|
onPress?.(!isChecked);
|
|
72
68
|
}
|
|
73
69
|
};
|
|
74
|
-
return (
|
|
75
|
-
<
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
return (
|
|
71
|
+
<StyledView>
|
|
72
|
+
<TouchableWithoutFeedback
|
|
73
|
+
onPressIn={() => animateScale(0.8)}
|
|
74
|
+
onPressOut={() => animateScale(1)}
|
|
75
|
+
onPress={onUserClick}
|
|
76
|
+
disabled={disabled}
|
|
77
|
+
>
|
|
78
|
+
<StyledView style={[STYLES.CONTAINER, containerStyle]}>
|
|
82
79
|
|
|
83
|
-
|
|
80
|
+
<Animated.View style={[STYLES.CHECKBOX_PARENT_CONT, dynamicMainContStyles, checkBoxStyle, animatedStyle]}>
|
|
81
|
+
{
|
|
82
|
+
(disableBuiltInState ? isChecked : isCheckboxChecked) &&
|
|
83
|
+
<Check
|
|
84
|
+
color={iconColor ?? colors.iconSecondary}
|
|
85
|
+
size={verticalScale(iconSize)}
|
|
86
|
+
/>
|
|
87
|
+
}
|
|
88
|
+
</Animated.View>
|
|
84
89
|
{
|
|
85
|
-
|
|
86
|
-
<
|
|
87
|
-
color={iconColor ?? colors.iconSecondary}
|
|
88
|
-
size={verticalScale(iconSize)}
|
|
89
|
-
/>
|
|
90
|
+
text &&
|
|
91
|
+
<StyledText style={textStyle} fs={fs} color={textColor} variant={textVariant} primary>{text}</StyledText>
|
|
90
92
|
}
|
|
91
|
-
</Animated.View>
|
|
92
|
-
{
|
|
93
|
-
text &&
|
|
94
|
-
<StyledText style={textStyle} fs={fs} variant={textVariant} primary>{text}</StyledText>
|
|
95
|
-
}
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
</StyledView>
|
|
95
|
+
</TouchableWithoutFeedback>
|
|
96
|
+
</StyledView>
|
|
97
|
+
)
|
|
100
98
|
}
|
|
101
99
|
export default CheckBox;
|
|
102
|
-
export type { CheckBoxProps };
|
|
100
|
+
export type { CheckBoxProps };
|
|
101
|
+
|
|
102
|
+
const STYLES = StyleSheet.create({
|
|
103
|
+
CONTAINER: {
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
gap: horizontalScale(10),
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
},
|
|
108
|
+
CHECKBOX_PARENT_CONT: {
|
|
109
|
+
borderWidth: 0.8,
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
padding: verticalScale(7)
|
|
113
|
+
}
|
|
114
|
+
});
|
|
@@ -23,7 +23,7 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
23
23
|
renderRightIcon,
|
|
24
24
|
containerStyle,
|
|
25
25
|
textStyle,
|
|
26
|
-
...
|
|
26
|
+
...rest
|
|
27
27
|
}) => {
|
|
28
28
|
|
|
29
29
|
const theme: any = useTheme();
|
|
@@ -58,7 +58,7 @@ const Chip: React.FC<ChipProps> = ({
|
|
|
58
58
|
android_ripple={{
|
|
59
59
|
color: rippleColor,
|
|
60
60
|
}}
|
|
61
|
-
{...
|
|
61
|
+
{...rest}
|
|
62
62
|
disabled={disabled}
|
|
63
63
|
>
|
|
64
64
|
<StyledView style={[STYLES.CONTAINER, containerStyle]}>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { cloneElement, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
|
1
|
+
import React, { cloneElement, forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
2
2
|
import type { ReactElement } from "react";
|
|
3
|
-
import { Keyboard, BackHandler } from 'react-native';
|
|
4
|
-
import
|
|
3
|
+
import { Keyboard, BackHandler, StyleSheet, Animated } from 'react-native';
|
|
4
|
+
import type { ViewStyle } from 'react-native';
|
|
5
5
|
import { dialogSizes } from '../../constants';
|
|
6
6
|
import Portal from '../Portal/Portal';
|
|
7
7
|
import type { DialogProps, DialogRefProps } from '../../types';
|
|
@@ -9,36 +9,36 @@ import type { DialogProps, DialogRefProps } from '../../types';
|
|
|
9
9
|
|
|
10
10
|
const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
11
11
|
variant = 'default',
|
|
12
|
-
// isVisible = false,
|
|
13
12
|
size = 'lg',
|
|
14
13
|
fullScreen,
|
|
15
14
|
backdropColor = 'rgba(0, 0, 0, 0.5)',
|
|
16
|
-
animationDuration = 800,
|
|
15
|
+
// animationDuration = 800,
|
|
17
16
|
onClose,
|
|
17
|
+
containerStyle,
|
|
18
18
|
children,
|
|
19
19
|
}, ref) => {
|
|
20
20
|
|
|
21
21
|
const [dialogVisible, setDialogVisible] = useState(false);
|
|
22
|
-
const scale =
|
|
23
|
-
const opacity =
|
|
22
|
+
const scale = useRef(new Animated.Value(0.9)).current;
|
|
23
|
+
const opacity = useRef(new Animated.Value(0)).current;
|
|
24
24
|
|
|
25
25
|
useEffect(() => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
26
|
+
Animated.timing(opacity, {
|
|
27
|
+
toValue: dialogVisible ? 1 : 0,
|
|
28
|
+
duration: 300,
|
|
29
|
+
useNativeDriver: true,
|
|
30
|
+
}).start();
|
|
31
|
+
Animated.spring(scale, {
|
|
32
|
+
toValue: dialogVisible ? 1 : 0.9,
|
|
33
|
+
damping: 10,
|
|
34
|
+
stiffness: 90,
|
|
35
|
+
useNativeDriver: true,
|
|
36
|
+
}).start();
|
|
37
37
|
}, [dialogVisible]);
|
|
38
38
|
|
|
39
39
|
useEffect(() => {
|
|
40
|
-
BackHandler.addEventListener('hardwareBackPress', hardwareBackPress)
|
|
41
|
-
return () =>
|
|
40
|
+
const handler = BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
|
|
41
|
+
return () => handler.remove();
|
|
42
42
|
}, [dialogVisible]);
|
|
43
43
|
|
|
44
44
|
const hardwareBackPress = () => {
|
|
@@ -51,34 +51,20 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
51
51
|
close: () => setDialogVisible(false)
|
|
52
52
|
}));
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return {
|
|
69
|
-
backgroundColor: '#fff',
|
|
70
|
-
borderRadius: 5,
|
|
71
|
-
width: `${dialogSizes[size]}%`,
|
|
72
|
-
borderWidth: 1,
|
|
73
|
-
borderColor: '#d4d4d4',
|
|
74
|
-
minHeight: fullScreen ? '100%' : 'auto',
|
|
75
|
-
maxHeight: fullScreen ? '100%' : '80%',
|
|
76
|
-
opacity: opacity.value,
|
|
77
|
-
transform: [{
|
|
78
|
-
scale: scale.value
|
|
79
|
-
}],
|
|
80
|
-
}
|
|
81
|
-
});
|
|
54
|
+
const backdropAnimatedStyles = {
|
|
55
|
+
opacity: opacity,
|
|
56
|
+
backgroundColor: backdropColor,
|
|
57
|
+
};
|
|
58
|
+
const modalContAnimatedStyles = {
|
|
59
|
+
transform: [{ scale }],
|
|
60
|
+
opacity: opacity,
|
|
61
|
+
};
|
|
62
|
+
const dynamicModalContStyles: ViewStyle = {
|
|
63
|
+
minHeight: fullScreen ? '100%' : 'auto',
|
|
64
|
+
maxHeight: fullScreen ? '100%' : '80%',
|
|
65
|
+
width: `${dialogSizes[size]}%`,
|
|
66
|
+
};
|
|
67
|
+
|
|
82
68
|
const renderChildrenWithVariant = () => {
|
|
83
69
|
return React.Children.map(children, (child) => {
|
|
84
70
|
if (React.isValidElement(child)) {
|
|
@@ -98,12 +84,12 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
98
84
|
return (<>
|
|
99
85
|
<Portal name='dialog'>
|
|
100
86
|
<Animated.View
|
|
101
|
-
style={
|
|
87
|
+
style={[STYLES.BACKDROP_CONT, backdropAnimatedStyles]}
|
|
102
88
|
pointerEvents={dialogVisible ? 'auto' : 'none'}
|
|
103
89
|
onStartShouldSetResponder={handleStartShouldSetResponder}
|
|
104
90
|
>
|
|
105
91
|
<Animated.View
|
|
106
|
-
style={
|
|
92
|
+
style={[STYLES.MODAL_CONT, dynamicModalContStyles, modalContAnimatedStyles, containerStyle]}
|
|
107
93
|
onStartShouldSetResponder={() => true}
|
|
108
94
|
>
|
|
109
95
|
{renderChildrenWithVariant()}
|
|
@@ -113,4 +99,22 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
|
|
|
113
99
|
</>);
|
|
114
100
|
});
|
|
115
101
|
export default Dialog;
|
|
116
|
-
export type { DialogProps };
|
|
102
|
+
export type { DialogProps };
|
|
103
|
+
|
|
104
|
+
const STYLES = StyleSheet.create({
|
|
105
|
+
BACKDROP_CONT: {
|
|
106
|
+
position: 'absolute',
|
|
107
|
+
top: 0,
|
|
108
|
+
bottom: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
right: 0,
|
|
111
|
+
justifyContent: 'center',
|
|
112
|
+
alignItems: 'center',
|
|
113
|
+
},
|
|
114
|
+
MODAL_CONT: {
|
|
115
|
+
backgroundColor: '#fff',
|
|
116
|
+
borderRadius: 5,
|
|
117
|
+
borderWidth: 1,
|
|
118
|
+
borderColor: '#d4d4d4'
|
|
119
|
+
}
|
|
120
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, ScrollView } from 'react-native';
|
|
3
3
|
import { moderateScale } from '../../helpers/ResponsiveCalculations';
|
|
4
4
|
import type { DialogBodyProps } from '../../types';
|
|
5
5
|
|
|
@@ -14,17 +14,15 @@ const DialogBody: React.FC<props> = ({
|
|
|
14
14
|
containerStyle,
|
|
15
15
|
children,
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
},
|
|
23
|
-
});
|
|
17
|
+
const style = {
|
|
18
|
+
paddingVertical: variant == 'default' ? moderateScale(16) : 0,
|
|
19
|
+
paddingHorizontal: moderateScale(variant == 'default' ? 16 : 25),
|
|
20
|
+
gap: 20,
|
|
21
|
+
};
|
|
24
22
|
return (<>
|
|
25
23
|
|
|
26
24
|
<ScrollView scrollEnabled={scrollEnable}>
|
|
27
|
-
<View style={[
|
|
25
|
+
<View style={[style, containerStyle]} pointerEvents='box-none'>
|
|
28
26
|
{children}
|
|
29
27
|
</View>
|
|
30
28
|
</ScrollView>
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { View
|
|
2
|
+
import { View } from 'react-native';
|
|
3
3
|
import { moderateVerticalScale } from '../../helpers/ResponsiveCalculations';
|
|
4
4
|
import { StyledText } from '../StyledComponents';
|
|
5
5
|
import type { DialogDescriptionProps } from '../../types';
|
|
6
6
|
|
|
7
7
|
const DialogDescription: React.FC<DialogDescriptionProps> = ({
|
|
8
|
-
fs,
|
|
9
8
|
textVariant = 'h5',
|
|
9
|
+
fs,
|
|
10
10
|
containerStyle,
|
|
11
11
|
textStyle,
|
|
12
12
|
children,
|
|
13
13
|
}) => {
|
|
14
|
-
const STYLES = StyleSheet.create({
|
|
15
|
-
TEXT: {
|
|
16
|
-
color: '#a1a1aa',
|
|
17
|
-
lineHeight: moderateVerticalScale(13)
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
14
|
return (<>
|
|
21
|
-
|
|
22
15
|
<View style={containerStyle}>
|
|
23
|
-
<StyledText
|
|
16
|
+
<StyledText
|
|
17
|
+
style={[{ lineHeight: moderateVerticalScale(13) }, textStyle]}
|
|
18
|
+
color='#a1a1aa'
|
|
19
|
+
variant={textVariant}
|
|
20
|
+
fs={fs}
|
|
21
|
+
>
|
|
22
|
+
{children}
|
|
23
|
+
</StyledText>
|
|
24
24
|
</View>
|
|
25
25
|
</>);
|
|
26
26
|
}
|
|
@@ -14,22 +14,24 @@ const DialogFoot: React.FC<props> = ({
|
|
|
14
14
|
containerStyle,
|
|
15
15
|
children
|
|
16
16
|
}) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
padding: moderateScale(variant === 'default' ? 16 : 20),
|
|
23
|
-
paddingHorizontal: moderateScale(variant === 'default' ? 16 : 25),
|
|
24
|
-
justifyContent: 'flex-end',
|
|
25
|
-
gap: moderateScale(15)
|
|
26
|
-
},
|
|
27
|
-
});
|
|
17
|
+
const dynamicStyles = {
|
|
18
|
+
borderTopWidth: variant === 'default' ? 0.7 : 0,
|
|
19
|
+
padding: moderateScale(variant === 'default' ? 16 : 20),
|
|
20
|
+
paddingHorizontal: moderateScale(variant === 'default' ? 16 : 25),
|
|
21
|
+
};
|
|
28
22
|
return (<>
|
|
29
|
-
<Stack.H
|
|
23
|
+
<Stack.H style={[STYLES.CONTAINER, dynamicStyles, containerStyle]}>
|
|
30
24
|
{children}
|
|
31
25
|
</Stack.H>
|
|
32
26
|
</>);
|
|
33
27
|
}
|
|
34
28
|
export default DialogFoot;
|
|
35
|
-
export type { DialogFootProps };
|
|
29
|
+
export type { DialogFootProps };
|
|
30
|
+
|
|
31
|
+
const STYLES = StyleSheet.create({
|
|
32
|
+
CONTAINER: {
|
|
33
|
+
borderColor: '#d4d4d4',
|
|
34
|
+
justifyContent: 'flex-end',
|
|
35
|
+
gap: moderateScale(15)
|
|
36
|
+
},
|
|
37
|
+
});
|