ui-rn 2.1.0 → 2.1.2
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 +1 -1
- package/src/Icon/{PropsStyle.tsx → Props.tsx} +0 -7
- package/src/Icon/index.tsx +1 -1
- package/src/Layout.tsx +2 -2
- package/src/Text/Props.ts +2 -2
- package/src/Text/index.tsx +2 -2
- package/src/Touch/TouchScale.tsx +2 -2
- package/src/Touch/makeStyle.ts +1 -0
- package/src/index.tsx +7 -2
package/package.json
CHANGED
|
@@ -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
|
package/src/Icon/index.tsx
CHANGED
|
@@ -35,7 +35,7 @@ export const RNVectorIcon = {
|
|
|
35
35
|
|
|
36
36
|
export type IconType = keyof typeof RNVectorIcon;
|
|
37
37
|
|
|
38
|
-
import { Props } from "./
|
|
38
|
+
import { Props } from "./Props";
|
|
39
39
|
import { makeProps } from "./makeProps";
|
|
40
40
|
|
|
41
41
|
export default class IconApp extends React.PureComponent<Props> {
|
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
|
|
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
|
-
}:
|
|
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
|
|
16
|
+
export interface TextProps extends RNTextProps, PropsParent, MakeProp {
|
|
17
17
|
backgroundColor?: string
|
|
18
18
|
primary?: boolean
|
|
19
19
|
white?: boolean
|
package/src/Text/index.tsx
CHANGED
|
@@ -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 {
|
|
4
|
+
import { TextProps } from "./Props";
|
|
5
5
|
import { isArray, isObject } from "underscore";
|
|
6
|
-
const Text: React.FC<
|
|
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") {
|
package/src/Touch/TouchScale.tsx
CHANGED
|
@@ -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
|
|
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,
|
|
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/Touch/makeStyle.ts
CHANGED
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 {
|
|
9
|
+
export { Props as IconProps } from './Icon/Props'
|
|
10
|
+
export { default as Layout } from './Layout'
|
|
11
|
+
export { LayoutProps } from './Layout'
|