@momo-kits/foundation 0.77.8-beta.2 → 0.77.8-beta.3
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/Application/Components.tsx +1 -1
- package/Application/ModalScreen.tsx +1 -1
- package/Application/Navigation.ts +0 -1
- package/Application/index.ts +8 -1
- package/Button/index.tsx +1 -1
- package/CheckBox/index.tsx +28 -23
- package/CheckBox/types.ts +1 -1
- package/Consts/styles.ts +0 -26
- package/Input/common.tsx +1 -1
- package/Pagination/PaginationNumber.tsx +1 -2
- package/package.json +2 -1
|
@@ -249,7 +249,7 @@ const HeaderCustom: React.FC<TitleCustomProps> = ({
|
|
|
249
249
|
<View style={[styles.dotAvatar, {backgroundColor: dotColor}]} />
|
|
250
250
|
)}
|
|
251
251
|
</View>
|
|
252
|
-
<View style={[Styles.flex,
|
|
252
|
+
<View style={[Styles.flex, {paddingHorizontal: 8}]}>
|
|
253
253
|
<Text typography="title_xs" color={tintColor}>
|
|
254
254
|
{title}
|
|
255
255
|
</Text>
|
|
@@ -96,7 +96,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
96
96
|
|
|
97
97
|
const snapPoints = useMemo(() => ['50%', '90%'], []);
|
|
98
98
|
const {bottom} = useSafeAreaInsets();
|
|
99
|
-
const bottomSheetRef = useRef(null);
|
|
99
|
+
const bottomSheetRef = useRef<any>(null);
|
|
100
100
|
const mountedRef = useRef(true);
|
|
101
101
|
|
|
102
102
|
useEffect(() => {
|
package/Application/index.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {NavigationContainer} from './NavigationContainer';
|
|
2
2
|
import Screen from '../Layout/Screen';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
HeaderRightAction,
|
|
5
|
+
NavigationButton,
|
|
6
|
+
HeaderToolkitAction,
|
|
7
|
+
HeaderTitle,
|
|
8
|
+
} from './Components';
|
|
4
9
|
import BottomTab from './BottomTab';
|
|
5
10
|
import {createContext} from 'react';
|
|
6
11
|
import {defaultContext} from '../Consts';
|
|
@@ -13,5 +18,7 @@ export {
|
|
|
13
18
|
Screen,
|
|
14
19
|
NavigationButton,
|
|
15
20
|
HeaderRightAction,
|
|
21
|
+
HeaderToolkitAction,
|
|
22
|
+
HeaderTitle,
|
|
16
23
|
BottomTab,
|
|
17
24
|
};
|
package/Button/index.tsx
CHANGED
package/CheckBox/index.tsx
CHANGED
|
@@ -6,41 +6,46 @@ import {ApplicationContext} from '../Application';
|
|
|
6
6
|
import {Text} from '../Text';
|
|
7
7
|
import {Icon} from '../Icon';
|
|
8
8
|
|
|
9
|
-
const CheckBox: FC<CheckBoxProps> =
|
|
9
|
+
const CheckBox: FC<CheckBoxProps> = ({
|
|
10
|
+
value,
|
|
11
|
+
disabled,
|
|
12
|
+
onChange,
|
|
13
|
+
style,
|
|
14
|
+
label,
|
|
15
|
+
indeterminate,
|
|
16
|
+
}) => {
|
|
10
17
|
const {theme} = useContext(ApplicationContext);
|
|
11
|
-
const
|
|
18
|
+
const haveValue = value || indeterminate;
|
|
19
|
+
const iconSource = indeterminate ? 'ic_minus' : 'ic_checked';
|
|
20
|
+
let borderColor = theme.colors.text.default;
|
|
21
|
+
let backgroundColor = theme.colors.background.surface;
|
|
12
22
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
let backgroundColor = haveValue
|
|
18
|
-
? theme.colors.primary
|
|
19
|
-
: theme.colors.background.surface;
|
|
20
|
-
|
|
21
|
-
let iconSource = indeterminated ? 'ic_minus' : 'ic_checked';
|
|
23
|
+
if (haveValue) {
|
|
24
|
+
borderColor = theme.colors.primary;
|
|
25
|
+
backgroundColor = theme.colors.primary;
|
|
26
|
+
}
|
|
22
27
|
|
|
23
28
|
if (disabled) {
|
|
24
|
-
borderColor =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
borderColor = theme.colors.border.disable;
|
|
30
|
+
backgroundColor = theme.colors.background.surface;
|
|
31
|
+
if (haveValue) {
|
|
32
|
+
borderColor = theme.colors.background.tonal;
|
|
33
|
+
backgroundColor = theme.colors.background.tonal;
|
|
34
|
+
}
|
|
30
35
|
}
|
|
31
|
-
const checkboxStyle = {borderColor, backgroundColor, borderWidth: 1};
|
|
32
36
|
|
|
33
|
-
const onChangeValue = () => {
|
|
34
|
-
onChange?.(!value);
|
|
35
|
-
};
|
|
36
37
|
return (
|
|
37
38
|
<TouchableOpacity
|
|
38
39
|
accessibilityLabel={`CheckBox/${label}`}
|
|
39
40
|
activeOpacity={0.8}
|
|
40
|
-
onPress={
|
|
41
|
+
onPress={() => onChange?.(!value)}
|
|
41
42
|
disabled={disabled}
|
|
42
43
|
style={[style, styles.container]}>
|
|
43
|
-
<View
|
|
44
|
+
<View
|
|
45
|
+
style={[
|
|
46
|
+
{borderColor, backgroundColor, borderWidth: 1},
|
|
47
|
+
styles.checkbox,
|
|
48
|
+
]}>
|
|
44
49
|
{haveValue && (
|
|
45
50
|
<Icon
|
|
46
51
|
color={theme.colors.background.surface}
|
package/CheckBox/types.ts
CHANGED
|
@@ -28,7 +28,7 @@ export type CheckBoxProps = {
|
|
|
28
28
|
* which is typically used to represent a "mixed" or "partial" selection state.
|
|
29
29
|
* Defaults to `false` if not provided.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
indeterminate?: boolean;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Optional. Used to apply custom styling to the CheckBox component.
|
package/Consts/styles.ts
CHANGED
|
@@ -47,32 +47,6 @@ const Styles = StyleSheet.create({
|
|
|
47
47
|
alignItems: 'flex-end',
|
|
48
48
|
justifyContent: 'center',
|
|
49
49
|
},
|
|
50
|
-
//paddingHorizontal
|
|
51
|
-
paddingHorizontal4: {
|
|
52
|
-
paddingHorizontal: 4,
|
|
53
|
-
},
|
|
54
|
-
paddingHorizontal8: {
|
|
55
|
-
paddingHorizontal: 8,
|
|
56
|
-
},
|
|
57
|
-
paddingHorizontal16: {
|
|
58
|
-
paddingHorizontal: 16,
|
|
59
|
-
},
|
|
60
|
-
paddingHorizontal24: {
|
|
61
|
-
paddingHorizontal: 24,
|
|
62
|
-
},
|
|
63
|
-
//paddingVertical
|
|
64
|
-
paddingVertical4: {
|
|
65
|
-
paddingVertical: 4,
|
|
66
|
-
},
|
|
67
|
-
paddingVertical8: {
|
|
68
|
-
paddingVertical: 8,
|
|
69
|
-
},
|
|
70
|
-
paddingVertical16: {
|
|
71
|
-
paddingVertical: 16,
|
|
72
|
-
},
|
|
73
|
-
paddingVertical24: {
|
|
74
|
-
paddingVertical: 24,
|
|
75
|
-
},
|
|
76
50
|
});
|
|
77
51
|
|
|
78
52
|
export {Styles};
|
package/Input/common.tsx
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React, {FC
|
|
1
|
+
import React, {FC} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
3
|
import {ChildPaginationProps} from './types';
|
|
4
4
|
import styles from './styles';
|
|
5
5
|
import {Text} from '../Text';
|
|
6
|
-
import {ApplicationContext} from '../Application';
|
|
7
6
|
import {Colors} from '../Consts';
|
|
8
7
|
|
|
9
8
|
const PaginationNumber: FC<ChildPaginationProps> = ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/foundation",
|
|
3
|
-
"version": "0.77.8-beta.
|
|
3
|
+
"version": "0.77.8-beta.03",
|
|
4
4
|
"description": "React Native Component Kits",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@react-navigation/core": "5.16.1",
|
|
20
20
|
"@react-navigation/native": "5.9.8",
|
|
21
21
|
"@react-navigation/routers": "5.7.4",
|
|
22
|
+
"lottie-react-native": "3.3.2",
|
|
22
23
|
"@react-navigation/stack": "git+https://gitlab.com/dung.huynh1/react-navigation-stack.git#main"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|