@momo-kits/foundation 0.80.9 → 0.81.1

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/Layout/utils.ts CHANGED
@@ -1,4 +1,4 @@
1
- import {Alert, Dimensions} from 'react-native';
1
+ import {Dimensions} from 'react-native';
2
2
  import React, {Fragment, ReactElement, useEffect, useState} from 'react';
3
3
 
4
4
  /**
@@ -10,23 +10,18 @@ const validateChildren = (
10
10
  children: React.ReactNode | React.ReactNode[],
11
11
  childrenTypes: Array<React.FC>,
12
12
  ) => {
13
- if (!__DEV__) return children;
14
-
15
13
  const validateType = (child: React.ReactElement) => {
16
14
  const valid = childrenTypes.some(
17
15
  childrenType => child?.type === childrenType || child?.type == Fragment,
18
16
  );
19
17
  if (!valid) {
20
- Alert.alert(
21
- 'Component Kits',
18
+ console.warn(
22
19
  `Wrong children type for this component, expected are ${childrenTypes
23
20
  .map(type => type.displayName)
24
21
  .join(', ')}.`,
25
22
  );
26
23
  }
27
- return valid;
28
24
  };
29
-
30
25
  if (Array.isArray(children)) {
31
26
  const flattenChildren: React.ReactElement[] = children.flat();
32
27
  for (const child of flattenChildren) {
@@ -9,6 +9,7 @@ import {ApplicationContext} from '../Application';
9
9
  const PaginationDot: FC<ChildPaginationProps> = ({
10
10
  dataLength = 2,
11
11
  activeIndex = 0,
12
+ style,
12
13
  }) => {
13
14
  const {theme} = useContext(ApplicationContext);
14
15
  const renderDots = () => {
@@ -27,7 +28,11 @@ const PaginationDot: FC<ChildPaginationProps> = ({
27
28
  }
28
29
  return dots;
29
30
  };
30
- return <View style={styles.paginationPinkContainer}>{renderDots()}</View>;
31
+ return (
32
+ <View style={[style, styles.row]}>
33
+ <View style={styles.paginationPinkContainer}>{renderDots()}</View>
34
+ </View>
35
+ );
31
36
  };
32
37
 
33
38
  export default PaginationDot;
@@ -8,12 +8,15 @@ import {Colors} from '../Consts';
8
8
  const PaginationNumber: FC<ChildPaginationProps> = ({
9
9
  activeIndex = 0,
10
10
  dataLength = 2,
11
+ style,
11
12
  }) => {
12
13
  return (
13
- <View style={[styles.paginationNumberContainer]}>
14
- <Text color={Colors.black_01} typography={'label_default'}>{`${
15
- activeIndex + 1
16
- }/${dataLength}`}</Text>
14
+ <View style={[style, styles.row]}>
15
+ <View style={styles.paginationNumberContainer}>
16
+ <Text color={Colors.black_01} typography={'label_default'}>{`${
17
+ activeIndex + 1
18
+ }/${dataLength}`}</Text>
19
+ </View>
17
20
  </View>
18
21
  );
19
22
  };
@@ -8,6 +8,7 @@ import {Colors, Spacing} from '../Consts';
8
8
  const PaginationWhiteDot: FC<ChildPaginationProps> = ({
9
9
  dataLength = 2,
10
10
  activeIndex = 0,
11
+ style,
11
12
  }) => {
12
13
  const renderDots = () => {
13
14
  const dots: React.ReactElement[] = [];
@@ -24,7 +25,11 @@ const PaginationWhiteDot: FC<ChildPaginationProps> = ({
24
25
  }
25
26
  return dots;
26
27
  };
27
- return <View style={[styles.paginationWhiteContainer]}>{renderDots()}</View>;
28
+ return (
29
+ <View style={[style, styles.row]}>
30
+ <View style={styles.paginationWhiteContainer}>{renderDots()}</View>
31
+ </View>
32
+ );
28
33
  };
29
34
 
30
35
  export default PaginationWhiteDot;
@@ -25,6 +25,8 @@ export default StyleSheet.create({
25
25
  paddingHorizontal: Spacing.S,
26
26
  borderRadius: Radius.L,
27
27
  backgroundColor: Colors.black_20 + '33',
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
28
30
  },
29
31
  scrollContainer: {
30
32
  alignItems: 'center',
@@ -44,4 +46,5 @@ export default StyleSheet.create({
44
46
  height: 4,
45
47
  borderRadius: Radius.XS,
46
48
  },
49
+ row: {flexDirection: 'row'},
47
50
  });
@@ -20,6 +20,8 @@ export type PaginationProps = {
20
20
  * Represents the total number of items (pages) in the Pagination component.
21
21
  */
22
22
  dataLength: number;
23
+
24
+ style?: ViewStyle | ViewStyle[];
23
25
  };
24
26
 
25
27
  export type DotProps = {
package/Radio/types.ts CHANGED
@@ -5,7 +5,7 @@ export type RadioProps = {
5
5
  * `value`: Represents the value associated with the Radio component.
6
6
  * It is used to determine whether the Radio component is selected or not in comparison with the `groupValue`.
7
7
  */
8
- value: string;
8
+ value: any;
9
9
 
10
10
  /**
11
11
  * `disabled`: Optional. If `true`, the user won't be able to interact with the Radio component.
@@ -28,7 +28,7 @@ export type RadioProps = {
28
28
  * `groupValue`: Represents the value of the selected Radio component within a group of Radio components.
29
29
  * The Radio component for which `value` equals `groupValue` will be selected.
30
30
  */
31
- groupValue: string;
31
+ groupValue: any;
32
32
 
33
33
  /**
34
34
  * `style`: Optional. Used to apply custom styling to the Radio component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.80.9",
3
+ "version": "0.81.1",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {