@codeleap/mobile 1.0.0 → 1.3.0
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/dist/components/Animated.d.ts +103 -0
- package/dist/components/{Checkbox.js → Animated.js} +22 -28
- package/dist/components/Animated.js.map +1 -0
- package/dist/components/Button.d.ts +2 -8
- package/dist/components/Button.js +2 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/ContentView.d.ts +10 -0
- package/dist/components/ContentView.js +49 -0
- package/dist/components/ContentView.js.map +1 -0
- package/dist/components/FileInput.d.ts +19 -2
- package/dist/components/FileInput.js +89 -4
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Image.d.ts +2 -2
- package/dist/components/Image.js.map +1 -1
- package/dist/components/Modal/index.d.ts +24 -0
- package/dist/components/Modal/index.js +116 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Modal/styles.d.ts +62 -0
- package/dist/components/Modal/styles.js +62 -0
- package/dist/components/Modal/styles.js.map +1 -0
- package/dist/components/Overlay.d.ts +16 -0
- package/dist/components/Overlay.js +68 -0
- package/dist/components/Overlay.js.map +1 -0
- package/dist/components/Scroll.d.ts +1 -95
- package/dist/components/TextInput.js +1 -1
- package/dist/components/TextInput.js.map +1 -1
- package/dist/components/Touchable.d.ts +8 -14
- package/dist/components/Touchable.js +10 -12
- package/dist/components/Touchable.js.map +1 -1
- package/dist/components/View.d.ts +12 -10
- package/dist/components/View.js +2 -4
- package/dist/components/View.js.map +1 -1
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/modules/cropPicker.d.ts +1 -0
- package/dist/modules/cropPicker.js +10 -0
- package/dist/modules/cropPicker.js.map +1 -0
- package/dist/modules/documentPicker.d.ts +1 -0
- package/dist/modules/documentPicker.js +10 -0
- package/dist/modules/documentPicker.js.map +1 -0
- package/package.json +6 -3
- package/src/components/Animated.tsx +31 -0
- package/src/components/Button.tsx +2 -1
- package/src/components/ContentView.tsx +52 -0
- package/src/components/FileInput.tsx +67 -4
- package/src/components/Image.tsx +3 -3
- package/src/components/Modal/index.tsx +143 -0
- package/src/components/Modal/styles.ts +122 -0
- package/src/components/Overlay.tsx +72 -0
- package/src/components/TextInput.tsx +1 -1
- package/src/components/Touchable.tsx +20 -23
- package/src/components/View.tsx +5 -15
- package/src/components/index.ts +7 -0
- package/src/index.ts +2 -1
- package/src/modules/documentPicker.ts +2 -0
- package/dist/components/Checkbox.d.ts +0 -12
- package/dist/components/Checkbox.js.map +0 -1
|
@@ -1,54 +1,51 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
|
-
import { ComponentVariants, useComponentStyle, BaseViewProps, ViewStyles, useStyle } from '@codeleap/common'
|
|
3
|
+
import { ComponentVariants, useComponentStyle, BaseViewProps, ViewStyles, useStyle, AnyFunction } from '@codeleap/common'
|
|
4
4
|
import { View } from './View'
|
|
5
|
-
import {
|
|
5
|
+
import { TouchableOpacity as NativeTouchable} from 'react-native'
|
|
6
6
|
|
|
7
|
+
import { createAnimatableComponent } from 'react-native-animatable'
|
|
7
8
|
export type TouchableProps =
|
|
8
|
-
ComponentPropsWithoutRef<typeof NativeTouchable> &
|
|
9
|
+
Omit<ComponentPropsWithoutRef<typeof NativeTouchable>, 'onPress'> &
|
|
9
10
|
{
|
|
10
11
|
variants?: ComponentVariants <typeof ViewStyles>['variants'],
|
|
11
12
|
component?: any
|
|
13
|
+
ref?: React.Ref<NativeTouchable>
|
|
14
|
+
debugName?:string
|
|
15
|
+
onPress?: AnyFunction
|
|
12
16
|
} & BaseViewProps
|
|
13
17
|
|
|
14
|
-
export const Touchable = forwardRef<NativeTouchable, TouchableProps>((touchableProps, ref) => {
|
|
18
|
+
export const Touchable:React.FC<TouchableProps> = forwardRef<NativeTouchable, TouchableProps>((touchableProps, ref) => {
|
|
15
19
|
const {
|
|
16
20
|
variants = [],
|
|
17
21
|
children,
|
|
18
22
|
onPress,
|
|
19
23
|
style,
|
|
24
|
+
debugName,
|
|
25
|
+
|
|
20
26
|
...props
|
|
21
27
|
} = touchableProps
|
|
22
28
|
|
|
23
29
|
const variantStyles = useComponentStyle('View', {
|
|
24
30
|
variants,
|
|
25
31
|
})
|
|
32
|
+
|
|
26
33
|
const {logger} = useStyle()
|
|
27
34
|
const press = () => {
|
|
28
35
|
if(!onPress) throw {message: 'No onPress passed to touchable', touchableProps}
|
|
29
|
-
logger.log('<Touchable/>
|
|
30
|
-
onPress(
|
|
36
|
+
logger.log(`${debugName || '<Touchable/>'} pressed`, { style, variants }, 'Component')
|
|
37
|
+
onPress && onPress()
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
const styles = [variantStyles.wrapper, style]
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
|
|
43
|
+
return <NativeTouchable onPress={press} style={styles} {...props} ref={ref}>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
{children}
|
|
47
|
+
|
|
39
48
|
</NativeTouchable>
|
|
40
49
|
})
|
|
41
50
|
|
|
42
|
-
export
|
|
43
|
-
ComponentPropsWithoutRef<typeof Animated.View> &
|
|
44
|
-
TouchableProps
|
|
45
|
-
|
|
46
|
-
export const AnimatedTouchable = forwardRef<typeof Animated.View, AnimatedTouchableProps>((viewProps, ref) => {
|
|
47
|
-
// @ts-ignore
|
|
48
|
-
return <Touchable
|
|
49
|
-
component={Animated.View}
|
|
50
|
-
|
|
51
|
-
{...viewProps}
|
|
52
|
-
/>
|
|
53
|
-
|
|
54
|
-
})
|
|
51
|
+
export const AnimatedTouchable = createAnimatableComponent(Touchable)
|
package/src/components/View.tsx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import * as Animatable from 'react-native-animatable'
|
|
2
3
|
import { ComponentPropsWithoutRef, forwardRef } from 'react'
|
|
3
4
|
import { ComponentVariants, useComponentStyle, ViewStyles, BaseViewProps } from '@codeleap/common'
|
|
4
|
-
import {
|
|
5
|
+
import { View as NativeView, ViewStyle } from 'react-native'
|
|
5
6
|
|
|
6
7
|
export type ViewProps =
|
|
7
8
|
ComponentPropsWithoutRef<typeof NativeView> &
|
|
8
9
|
ComponentVariants<typeof ViewStyles> & {
|
|
9
|
-
|
|
10
|
+
ref?:any
|
|
10
11
|
component?: any
|
|
11
12
|
} & BaseViewProps
|
|
12
13
|
|
|
@@ -38,16 +39,5 @@ export const View = forwardRef<NativeView, ViewProps>((viewProps, ref) => {
|
|
|
38
39
|
</Component>
|
|
39
40
|
})
|
|
40
41
|
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
ComponentVariants<typeof ViewStyles> & BaseViewProps
|
|
44
|
-
|
|
45
|
-
export const AnimatedView = forwardRef<typeof Animated.View, AnimatedViewProps>((viewProps, ref) => {
|
|
46
|
-
// @ts-ignore
|
|
47
|
-
return <View
|
|
48
|
-
component={Animated.View}
|
|
49
|
-
|
|
50
|
-
{...viewProps}
|
|
51
|
-
/>
|
|
52
|
-
|
|
53
|
-
})
|
|
42
|
+
export const AnimatedView =
|
|
43
|
+
Animatable.createAnimatableComponent(View) as unknown as React.ForwardRefExoticComponent<{transition?: any,animation?: any} & ViewProps>
|
package/src/components/index.ts
CHANGED
|
@@ -7,6 +7,8 @@ export * from './Checkbox'
|
|
|
7
7
|
export * from './TextInput'
|
|
8
8
|
export * from './RadioInput'
|
|
9
9
|
export * from './Switch'
|
|
10
|
+
export * from './ContentView'
|
|
11
|
+
|
|
10
12
|
export * from './Select'
|
|
11
13
|
export * from './FileInput'
|
|
12
14
|
export * from './Slider'
|
|
@@ -14,3 +16,8 @@ export * from './Navigation'
|
|
|
14
16
|
export * from './Scroll'
|
|
15
17
|
export * from './ActivityIndicator'
|
|
16
18
|
export * from './Button'
|
|
19
|
+
export * from './ContentView'
|
|
20
|
+
export * from './Overlay'
|
|
21
|
+
export * from './Modal'
|
|
22
|
+
|
|
23
|
+
export * from './Navigation'
|
package/src/index.ts
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CheckboxStyles, CheckboxComposition, ComponentVariants, StylesOf } from '@codeleap/common';
|
|
3
|
-
import { ComponentPropsWithRef, ReactNode } from 'react';
|
|
4
|
-
import { Switch as NativeCheckbox } from 'react-native';
|
|
5
|
-
declare type NativeCheckboxProps = Omit<ComponentPropsWithRef<typeof NativeCheckbox>, 'thumbColor' | 'trackColor'>;
|
|
6
|
-
declare type CheckboxProps = NativeCheckboxProps & {
|
|
7
|
-
variants?: ComponentVariants<typeof CheckboxStyles>['variants'];
|
|
8
|
-
label?: ReactNode;
|
|
9
|
-
styles?: StylesOf<CheckboxComposition>;
|
|
10
|
-
};
|
|
11
|
-
export declare const Checkbox: React.ForwardRefExoticComponent<Pick<CheckboxProps, "children" | "hitSlop" | "onLayout" | "pointerEvents" | "removeClippedSubviews" | "style" | "testID" | "nativeID" | "collapsable" | "needsOffscreenAlphaCompositing" | "renderToHardwareTextureAndroid" | "focusable" | "shouldRasterizeIOS" | "isTVSelectable" | "hasTVPreferredFocus" | "tvParallaxProperties" | "tvParallaxShiftDistanceX" | "tvParallaxShiftDistanceY" | "tvParallaxTiltAngle" | "tvParallaxMagnification" | "onStartShouldSetResponder" | "onMoveShouldSetResponder" | "onResponderEnd" | "onResponderGrant" | "onResponderReject" | "onResponderMove" | "onResponderRelease" | "onResponderStart" | "onResponderTerminationRequest" | "onResponderTerminate" | "onStartShouldSetResponderCapture" | "onMoveShouldSetResponderCapture" | "onTouchStart" | "onTouchMove" | "onTouchEnd" | "onTouchCancel" | "onTouchEndCapture" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "label" | "variants" | "disabled" | "onChange" | "value" | "styles" | "onValueChange" | "ios_backgroundColor" | "onTintColor" | "thumbTintColor" | "tintColor" | "key"> & React.RefAttributes<NativeCheckbox>>;
|
|
12
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CAA+H;AAC/H,+BAAoE;AAEpE,yCAAwC;AACxC,+BAA6B;AAYhB,QAAA,QAAQ,GAAG,IAAA,kBAAU,EAA+B,UAAC,WAAW,EAAC,GAAG;IAEzE,IAAA,KAKA,WAAW,SALE,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,KAIA,WAAW,MAJD,EAAV,KAAK,mBAAG,EAAE,KAAA,EACV,KAGA,WAAW,OAHA,EAAX,MAAM,mBAAG,EAAE,KAAA,EACX,KAAK,GAEL,WAAW,MAFN,EACF,KAAK,UACR,WAAW,EANR,wCAMN,CADW,CACG;IAEf,IAAM,aAAa,GAAG,IAAA,0BAAiB,EAAC,UAAU,EAAE;QAChD,QAAQ,UAAA;QACR,MAAM,QAAA;KACT,CAAC,CAAA;IAEF,SAAS,SAAS,CAAC,GAAuB;QACtC,OAAO;YACH,aAAa,CAAC,GAAG,CAAC;YAClB,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;YAC9B,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE;YACnD,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;SAE/D,CAAA;IACL,CAAC;IAGD,OAAO,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CACrC;QAAA,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CACvC;YAAA,CAAC,WAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EACxC;QAAA,EAAE,WAAI,CACN;QAAA,CAAC,sBAAU,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAExD;;IAAA,EAAE,WAAI,CAAC,CAAA;AACX,CAAC,CAAC,CAAA"}
|