@tecsinapse/react-native-kit 3.5.15-beta.0 → 3.5.15-beta.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.
@@ -27,16 +27,19 @@ const Grid = ({
27
27
  }
28
28
  ],
29
29
  ...rest,
30
- children: React.Children.map(children, (child, index) => /* @__PURE__ */ jsxRuntime.jsx(
31
- Item,
32
- {
33
- columns,
34
- span: flatLayout[index],
35
- spacing,
36
- children: child
37
- },
38
- `child-${index}`
39
- ))
30
+ children: React.Children.map(children, (child, index) => {
31
+ const content = React.isValidElement(child) ? child : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: child });
32
+ return /* @__PURE__ */ jsxRuntime.jsx(
33
+ Item,
34
+ {
35
+ columns,
36
+ span: flatLayout[index],
37
+ spacing,
38
+ children: content
39
+ },
40
+ `child-${index}`
41
+ );
42
+ })
40
43
  }
41
44
  );
42
45
  }
@@ -53,12 +56,16 @@ const Grid = ({
53
56
  ],
54
57
  ...rest,
55
58
  children: React.Children.map(children, (child, index) => {
56
- return React.cloneElement(child, {
57
- ...child?.props,
58
- columns,
59
- spacing: child?.props.spacing ?? spacing,
60
- key: `child-${index}`
61
- });
59
+ if (React.isValidElement(child)) {
60
+ const childEl = child;
61
+ return React.cloneElement(childEl, {
62
+ ...childEl.props,
63
+ columns,
64
+ spacing: childEl.props?.spacing ?? spacing,
65
+ key: `child-${index}`
66
+ });
67
+ }
68
+ return child;
62
69
  })
63
70
  }
64
71
  );
@@ -48,10 +48,14 @@ const GridItem = ({
48
48
  paddingRight: reactCore.getGridItemPadding("right", _spacing, spacing),
49
49
  paddingLeft: reactCore.getGridItemPadding("left", _spacing, spacing)
50
50
  };
51
- const clone = React.cloneElement(children, {
52
- ...children?.props,
53
- style: wrapper ? children?.props.style : { ..._style, ...children?.props.style }
54
- });
51
+ let clone = void 0;
52
+ if (React.isValidElement(children)) {
53
+ const childEl = children;
54
+ clone = React.cloneElement(childEl, {
55
+ ...childEl.props,
56
+ style: wrapper ? childEl.props?.style : { ..._style, ...childEl.props?.style }
57
+ });
58
+ }
55
59
  return wrapper ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { ...rest, style: [style, _style], children: clone }) : clone;
56
60
  };
57
61
 
@@ -1,4 +1,4 @@
1
- import { jsx } from 'react/jsx-runtime';
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
2
  import React__default from 'react';
3
3
  import { View } from 'react-native';
4
4
  import GridItem from './Item/Item.js';
@@ -25,16 +25,19 @@ const Grid = ({
25
25
  }
26
26
  ],
27
27
  ...rest,
28
- children: React__default.Children.map(children, (child, index) => /* @__PURE__ */ jsx(
29
- GridItem,
30
- {
31
- columns,
32
- span: flatLayout[index],
33
- spacing,
34
- children: child
35
- },
36
- `child-${index}`
37
- ))
28
+ children: React__default.Children.map(children, (child, index) => {
29
+ const content = React__default.isValidElement(child) ? child : /* @__PURE__ */ jsx(Fragment, { children: child });
30
+ return /* @__PURE__ */ jsx(
31
+ GridItem,
32
+ {
33
+ columns,
34
+ span: flatLayout[index],
35
+ spacing,
36
+ children: content
37
+ },
38
+ `child-${index}`
39
+ );
40
+ })
38
41
  }
39
42
  );
40
43
  }
@@ -51,12 +54,16 @@ const Grid = ({
51
54
  ],
52
55
  ...rest,
53
56
  children: React__default.Children.map(children, (child, index) => {
54
- return React__default.cloneElement(child, {
55
- ...child?.props,
56
- columns,
57
- spacing: child?.props.spacing ?? spacing,
58
- key: `child-${index}`
59
- });
57
+ if (React__default.isValidElement(child)) {
58
+ const childEl = child;
59
+ return React__default.cloneElement(childEl, {
60
+ ...childEl.props,
61
+ columns,
62
+ spacing: childEl.props?.spacing ?? spacing,
63
+ key: `child-${index}`
64
+ });
65
+ }
66
+ return child;
60
67
  })
61
68
  }
62
69
  );
@@ -46,10 +46,14 @@ const GridItem = ({
46
46
  paddingRight: getGridItemPadding("right", _spacing, spacing),
47
47
  paddingLeft: getGridItemPadding("left", _spacing, spacing)
48
48
  };
49
- const clone = React__default.cloneElement(children, {
50
- ...children?.props,
51
- style: wrapper ? children?.props.style : { ..._style, ...children?.props.style }
52
- });
49
+ let clone = void 0;
50
+ if (React__default.isValidElement(children)) {
51
+ const childEl = children;
52
+ clone = React__default.cloneElement(childEl, {
53
+ ...childEl.props,
54
+ style: wrapper ? childEl.props?.style : { ..._style, ...childEl.props?.style }
55
+ });
56
+ }
53
57
  return wrapper ? /* @__PURE__ */ jsx(View, { ...rest, style: [style, _style], children: clone }) : clone;
54
58
  };
55
59
 
@@ -6,7 +6,7 @@ export interface BottomNavigatorProps<T extends string | number | symbol> extend
6
6
  onSelect: (value: T) => void | never;
7
7
  children: React.ReactElement<BottomNavigatorItemProps<T>> | React.ReactElement<BottomNavigatorItemProps<T>>[];
8
8
  }
9
- declare function BottomNavigator<T extends string | number | symbol>({ selected, onSelect, children, ...rest }: BottomNavigatorProps<T>): JSX.Element;
9
+ declare function BottomNavigator<T extends string | number | symbol>({ selected, onSelect, children, ...rest }: BottomNavigatorProps<T>): React.ReactElement;
10
10
  declare namespace BottomNavigator {
11
11
  var Item: typeof import("./Item").default;
12
12
  }
@@ -14,6 +14,6 @@ export interface BottomNavigatorItemProps<T extends ValueType> extends Omit<View
14
14
  }
15
15
  type ItemPropsWithIcon<T extends ValueType> = Omit<BottomNavigatorItemProps<T>, 'children'>;
16
16
  type ItemPropsWithChildren<T extends ValueType> = Omit<BottomNavigatorItemProps<T>, 'icon' | 'label' | 'labelElement' | 'labelProps'>;
17
- declare function Item<T extends ValueType>(props: ItemPropsWithChildren<T>): any;
18
- declare function Item<T extends ValueType>(props: ItemPropsWithIcon<T>): any;
17
+ declare function Item<T extends ValueType>(props: ItemPropsWithChildren<T>): React.ReactElement;
18
+ declare function Item<T extends ValueType>(props: ItemPropsWithIcon<T>): React.ReactElement;
19
19
  export default Item;
@@ -1,3 +1,4 @@
1
1
  import { GroupButtonOptionProps } from '@tecsinapse/react-core';
2
- declare const GroupButtonOption: (props: GroupButtonOptionProps) => JSX.Element;
2
+ import React from 'react';
3
+ declare const GroupButtonOption: (props: GroupButtonOptionProps) => React.ReactElement;
3
4
  export default GroupButtonOption;
@@ -1,2 +1,3 @@
1
1
  import { CalendarProps, SelectionType } from '@tecsinapse/react-core';
2
- export declare const Calendar: <T extends SelectionType>({ locale, ...rest }: CalendarProps<T>) => JSX.Element;
2
+ import React from 'react';
3
+ export declare const Calendar: <T extends SelectionType>({ locale, ...rest }: CalendarProps<T>) => React.ReactElement;
@@ -1,3 +1,4 @@
1
1
  import { DatePickerProps, SelectionType } from '@tecsinapse/react-core';
2
+ import React from 'react';
2
3
  export type NativeDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>;
3
- export declare const DatePicker: <T extends SelectionType>({ locale, onChange, value, type, ...rest }: NativeDatePickerProps<T>) => JSX.Element;
4
+ export declare const DatePicker: <T extends SelectionType>({ locale, onChange, value, type, ...rest }: NativeDatePickerProps<T>) => React.ReactElement;
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  import { ViewProps } from 'react-native';
2
3
  import { IGrid } from '@tecsinapse/react-core';
3
4
  export type IGridNative = IGrid & Omit<ViewProps, 'children'>;
4
- declare const Grid: ({ children, columns, layout, style, spacing, ...rest }: IGridNative) => JSX.Element;
5
+ declare const Grid: ({ children, columns, layout, style, spacing, ...rest }: IGridNative) => React.ReactElement;
5
6
  export default Grid;
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import { DimensionValue, ViewProps } from 'react-native';
2
3
  import { IGridItem } from '@tecsinapse/react-core';
3
4
  export type IGridItemNative = IGridItem & Omit<ViewProps, 'children'> & {
4
5
  flexBasis?: DimensionValue;
5
6
  };
6
- declare const GridItem: ({ children, span, columns, loadingComponent, loading, spacing: _spacing, wrapper, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, justifyContent, flexBasis, style, ...rest }: IGridItemNative) => JSX.Element;
7
+ declare const GridItem: ({ children, span, columns, loadingComponent, loading, spacing: _spacing, wrapper, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, justifyContent, flexBasis, style, ...rest }: IGridItemNative) => React.ReactElement;
7
8
  export default GridItem;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { SelectNativeProps, SelectType } from './types';
2
- declare function Select<Data, Type extends SelectType>(props: SelectNativeProps<Data, Type>): JSX.Element;
3
+ declare function Select<Data, Type extends SelectType>(props: SelectNativeProps<Data, Type>): React.ReactElement;
3
4
  export default Select;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { BaseFlatList } from '../types';
2
- declare const Flat: <Data>({ options, keyExtractor, renderItem, getData, }: BaseFlatList<Data>) => JSX.Element;
3
+ declare const Flat: <Data>({ options, keyExtractor, renderItem, getData, }: BaseFlatList<Data>) => React.ReactElement;
3
4
  export default Flat;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { IBaseModal } from '../../../atoms/Modal';
2
3
  import { LoadingProps, OverrideModalProps, SelectType } from '../types';
3
- export declare const Modal: <Data, Type extends SelectType>(props: OverrideModalProps<Data, Type> & LoadingProps & IBaseModal) => JSX.Element;
4
+ export declare const Modal: <Data, Type extends SelectType>(props: OverrideModalProps<Data, Type> & LoadingProps & IBaseModal) => React.ReactElement;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { OptionData, SelectType } from '../types';
2
3
  interface IOption<Data> {
3
4
  item: OptionData<Data>;
@@ -5,5 +6,5 @@ interface IOption<Data> {
5
6
  labelExtractor: (t: Data) => string;
6
7
  handlePressItem: (t: Data) => void;
7
8
  }
8
- declare const Component: <Data>({ handlePressItem, labelExtractor, item, type, }: IOption<Data>) => JSX.Element;
9
+ declare const Component: <Data>({ handlePressItem, labelExtractor, item, type, }: IOption<Data>) => React.ReactElement;
9
10
  export default Component;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { BaseSectionList } from '../types';
2
- declare const Section: <Data>({ options, renderItem, getData, keyExtractor, groupLabelExtractor, }: BaseSectionList<Data>) => JSX.Element;
3
+ declare const Section: <Data>({ options, renderItem, getData, keyExtractor, groupLabelExtractor, }: BaseSectionList<Data>) => React.ReactElement;
3
4
  export default Section;
@@ -20,19 +20,19 @@ declare const useModal: <Data, Type extends SelectType>({ keyExtractor, labelExt
20
20
  labelStack?: import("@tecsinapse/react-core").FontStackType | undefined;
21
21
  LabelComponent?: React.FC<import("@tecsinapse/react-core").TextProps> | undefined;
22
22
  labelWeight?: import("@tecsinapse/react-core").FontWeightType | undefined;
23
- leftComponent?: JSX.Element | undefined;
24
- rightComponent?: JSX.Element | undefined;
23
+ leftComponent?: React.ReactNode;
24
+ rightComponent?: React.ReactNode;
25
25
  borderColorGradation?: import("@tecsinapse/react-core").ColorGradationType | undefined;
26
26
  inputContainerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
27
27
  hint?: string | undefined;
28
- hintComponent?: JSX.Element | undefined;
29
- controlComponent?: ((onPress: () => void, displayValue?: string) => JSX.Element) | undefined;
28
+ hintComponent?: React.ReactNode;
29
+ controlComponent?: ((onPress: () => void, displayValue?: string) => React.ReactElement) | undefined;
30
30
  confirmButtonText?: string | undefined;
31
31
  groupLabelExtractor?: ((title: string) => string) | undefined;
32
32
  hideSearchBar?: boolean | undefined;
33
33
  searchBarPlaceholder?: string | undefined;
34
34
  selectModalTitle?: string | undefined;
35
- selectModalTitleComponent?: JSX.Element | undefined;
35
+ selectModalTitleComponent?: React.ReactNode;
36
36
  options: Data[] | Map<string, Data[]>;
37
37
  loading?: boolean;
38
38
  visible?: boolean;
@@ -7,9 +7,9 @@ declare const useSelect: <Data, Type extends SelectType>({ value, options, keyEx
7
7
  searchBarPlaceholder?: string;
8
8
  confirmButtonText?: string;
9
9
  selectModalTitle?: string;
10
- selectModalTitleComponent?: JSX.Element;
10
+ selectModalTitleComponent?: React.ReactNode;
11
11
  closeOnPick?: boolean;
12
- controlComponent?: (onPress: () => void, displayValue?: string) => JSX.Element;
12
+ controlComponent?: (onPress: () => void, displayValue?: string) => React.ReactElement;
13
13
  numberOfLines?: number;
14
14
  style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
15
15
  testID?: string | undefined;
@@ -22,13 +22,13 @@ declare const useSelect: <Data, Type extends SelectType>({ value, options, keyEx
22
22
  labelStack?: import("@tecsinapse/react-core").FontStackType | undefined;
23
23
  LabelComponent?: React.FC<import("@tecsinapse/react-core").TextProps> | undefined;
24
24
  labelWeight?: import("@tecsinapse/react-core").FontWeightType | undefined;
25
- leftComponent?: JSX.Element | undefined;
26
- rightComponent?: JSX.Element | undefined;
25
+ leftComponent?: React.ReactNode;
26
+ rightComponent?: React.ReactNode;
27
27
  borderColorGradation?: import("@tecsinapse/react-core").ColorGradationType | undefined;
28
28
  inputContainerStyle?: import("react-native").StyleProp<import("react-native").ViewStyle>;
29
29
  focused: boolean;
30
30
  hint?: string | undefined;
31
- hintComponent?: JSX.Element | undefined;
31
+ hintComponent?: React.ReactNode;
32
32
  handleBlur: () => void;
33
33
  handlePressInput: () => Promise<void>;
34
34
  getDisplayValue: () => string;
@@ -25,13 +25,13 @@ export interface SelectNativeProps<Data, Type extends SelectType> extends Omit<I
25
25
  searchBarPlaceholder?: string;
26
26
  confirmButtonText?: string;
27
27
  selectModalTitle?: string;
28
- selectModalTitleComponent?: JSX.Element;
28
+ selectModalTitleComponent?: React.ReactNode;
29
29
  closeOnPick?: boolean;
30
- controlComponent?: (onPress: () => void, displayValue?: string) => JSX.Element;
30
+ controlComponent?: (onPress: () => void, displayValue?: string) => React.ReactElement;
31
31
  numberOfLines?: number;
32
32
  }
33
33
  type BaseList<Data> = {
34
- renderItem: (item: ListRenderItemInfo<OptionData<Data>>) => JSX.Element;
34
+ renderItem: (item: ListRenderItemInfo<OptionData<Data>>) => React.ReactElement;
35
35
  getData: (options: Data[]) => OptionData<Data>[];
36
36
  keyExtractor: Extractor<Data>;
37
37
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-native-kit",
3
3
  "description": "React Native components library",
4
- "version": "3.5.15-beta.0",
4
+ "version": "3.5.15-beta.1",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@emotion/native": "~11.11.0",
20
20
  "@emotion/react": "~11.11.0",
21
- "@tecsinapse/react-core": "3.4.15-beta.0",
21
+ "@tecsinapse/react-core": "3.4.15-beta.1",
22
22
  "react-native-linear-gradient": "~2.8.3"
23
23
  },
24
24
  "devDependencies": {
@@ -40,5 +40,5 @@
40
40
  "react-native-safe-area-context": "^4.0.0",
41
41
  "react-native-vector-icons": "^9.2.0"
42
42
  },
43
- "gitHead": "a79fd28902c6a78bc91feb725354c363d29765d5"
43
+ "gitHead": "31f09f066e7f7ee57e2736d0124f2aeb667c78a9"
44
44
  }