ui-rn 2.0.9 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-rn",
3
- "version": "2.0.9",
3
+ "version": "2.1.1",
4
4
  "repository": "https://github.com/package-dev/ui-rn",
5
5
  "description": "ui-rn",
6
6
  "author": "Phamha98",
@@ -1,19 +1,12 @@
1
1
  import {
2
2
  RNVectorIcon,
3
3
  } from "./index"
4
- import React from 'react'
5
4
  import {
6
5
  FlexStyle,
7
6
  StyleProp,
8
- StyleSheet,
9
- TextProps,
10
7
  TextStyle,
11
- TouchableOpacity,
12
- ViewProps,
13
8
  ViewStyle,
14
9
  } from 'react-native'
15
-
16
- import { isArray, isEmpty, isNumber, isObject, isString } from "underscore";
17
10
  import { MakeProp } from "./makeProps";
18
11
  export interface Props extends MakeProp {
19
12
  name: string
@@ -35,7 +35,7 @@ export const RNVectorIcon = {
35
35
 
36
36
  export type IconType = keyof typeof RNVectorIcon;
37
37
 
38
- import { Props } from "./PropsStyle";
38
+ import { Props } from "./Props";
39
39
  import { makeProps } from "./makeProps";
40
40
 
41
41
  export default class IconApp extends React.PureComponent<Props> {
@@ -45,14 +45,13 @@ export default class IconApp extends React.PureComponent<Props> {
45
45
  name: "home",
46
46
  };
47
47
 
48
- res: { color: string; style: any; size: number };
49
-
50
48
  constructor(props: Props) {
51
49
  super(props);
52
50
  this.res = makeProps(props);
53
51
  }
54
52
  render() {
55
- const { size, color, style } = this.res;
53
+ const res = makeProps(this.props);
54
+ const { size, color, style } = res;
56
55
  if (this.props.name === "none") return null;
57
56
  const IconView = RNVectorIcon[this.props.type || "Ionicons"];
58
57
  if (typeof this.props.onPress != "function") {
package/src/Layout.tsx CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import SafeAreaView, { ForceInsetProp } from 'react-native-safe-area-view';
3
3
  import { StyleProp, ViewStyle } from 'react-native';
4
- export interface ILayout {
4
+ export interface LayoutProps {
5
5
  children?: any;
6
6
  forceInset?: ForceInsetProp;
7
7
  forceInsetBot?: ForceInsetProp;
@@ -19,7 +19,7 @@ export default function Layout({
19
19
  style,
20
20
  primary,
21
21
  bottomInset
22
- }: ILayout) {
22
+ }: LayoutProps) {
23
23
  return (
24
24
  <SafeAreaView
25
25
  style={[
package/src/Text/Props.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react'
2
- import { TextProps, TextStyle } from 'react-native'
2
+ import { TextProps as RNTextProps, TextStyle } from 'react-native'
3
3
  import { MakeProp } from './makeStyle'
4
4
  interface PropsParent {
5
5
  children?: React.ReactNode
@@ -13,7 +13,7 @@ interface PropsParent {
13
13
  background?: string
14
14
  }
15
15
  //@ts-ignore
16
- export interface Props extends TextProps, PropsParent, MakeProp {
16
+ export interface TextProps extends RNTextProps, PropsParent, MakeProp {
17
17
  backgroundColor?: string
18
18
  primary?: boolean
19
19
  white?: boolean
@@ -1,9 +1,9 @@
1
1
  import React, { isValidElement } from "react";
2
2
  import { StyleSheet, Text as RNText } from "react-native";
3
3
  import { Style } from "./Style";
4
- import { Props } from "./Props";
4
+ import { TextProps } from "./Props";
5
5
  import { isArray, isObject } from "underscore";
6
- const Text: React.FC<Props> = ({ style, children, ...props }) => {
6
+ const Text: React.FC<TextProps> = ({ style, children, ...props }) => {
7
7
  const Children = () => {
8
8
  const content = props?.lang ?? undefined;
9
9
  if (typeof content !== "undefined") {
@@ -3,14 +3,14 @@ import { Animated, TouchableOpacity, ViewProps } from "react-native";
3
3
  import { Style } from "./Style";
4
4
  import { Props } from "./Props";
5
5
 
6
- interface ButtonScaleProps extends Props {
6
+ export interface TouchableScaleProps extends Props {
7
7
  scaleValue?: number;
8
8
  scale?: boolean;
9
9
  containerStyle?: ViewProps["style"];
10
10
  }
11
11
  type TouchableOpacityRef = React.ComponentRef<typeof TouchableOpacity>;
12
12
 
13
- const Touch = React.forwardRef<TouchableOpacityRef, ButtonScaleProps>(
13
+ const Touch = React.forwardRef<TouchableOpacityRef, TouchableScaleProps>(
14
14
  ({ scaleValue = 1.1, style, background, containerStyle, ...props }, ref) => {
15
15
  if (props?.hidden) return <></>;
16
16
  const animatedButtonScale = React.useRef(new Animated.Value(1)).current;
package/src/index.tsx CHANGED
@@ -1,6 +1,11 @@
1
1
  export { default as Touch } from './Touch/Touch'
2
- export { default as TouchScale } from './Touch/TouchScale'
3
2
  export { default as Block } from './Touch/Block'
3
+ export { Props as TouchProps } from './Touch/Props'
4
+ export { default as TouchScale } from './Touch/TouchScale'
5
+ export { TouchableScaleProps } from './Touch/TouchScale'
4
6
  export { default as Text } from './Text'
7
+ export { TextProps } from './Text/Props'
5
8
  export { default as Icon } from './Icon'
6
- export { default as Layout } from './Layout'
9
+ export { Props as IconProps } from './Icon/Props'
10
+ export { default as Layout } from './Layout'
11
+ export { LayoutProps } from './Layout'