@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.
@@ -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, Styles.paddingHorizontal8]}>
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(() => {
@@ -30,7 +30,6 @@ class Navigation {
30
30
  };
31
31
 
32
32
  setOptions = (params: NavigationOptions) => {
33
- console.log(params);
34
33
  if (__DEV__) {
35
34
  params = this.filterParams(params);
36
35
  }
@@ -1,6 +1,11 @@
1
1
  import {NavigationContainer} from './NavigationContainer';
2
2
  import Screen from '../Layout/Screen';
3
- import {HeaderRightAction, NavigationButton} from './Components';
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
@@ -65,7 +65,7 @@ const Button: FC<ButtonProps> = ({
65
65
  type = 'primary',
66
66
  size = 'large',
67
67
  useTintColor = true,
68
- full = false,
68
+ full = true,
69
69
  iconRight,
70
70
  iconLeft,
71
71
  title = 'Button',
@@ -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> = props => {
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 {value, disabled, onChange, style, label, indeterminated} = props;
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
- const haveValue = value || indeterminated;
14
- let borderColor = haveValue
15
- ? theme.colors.primary
16
- : theme.colors.text.default;
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 = haveValue
25
- ? theme.colors.background.tonal
26
- : theme.colors.border.disable;
27
- backgroundColor = haveValue
28
- ? theme.colors.background.tonal
29
- : theme.colors.background.surface;
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={onChangeValue}
41
+ onPress={() => onChange?.(!value)}
41
42
  disabled={disabled}
42
43
  style={[style, styles.container]}>
43
- <View style={[checkboxStyle, styles.checkbox]}>
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
- indeterminated?: boolean;
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
@@ -59,7 +59,7 @@ export const ErrorView: FC<{errorMessage?: string}> = ({errorMessage}) => {
59
59
  <Text
60
60
  style={Styles.flex}
61
61
  color={errorColor}
62
- numberOfLines={1}
62
+ numberOfLines={2}
63
63
  typography={'description_s'}>
64
64
  {errorMessage}
65
65
  </Text>
@@ -1,9 +1,8 @@
1
- import React, {FC, useContext} from 'react';
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.02",
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": {