@codeleap/mobile 1.0.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/ActivityIndicator.d.ts +13 -0
- package/dist/components/ActivityIndicator.js +49 -0
- package/dist/components/ActivityIndicator.js.map +1 -0
- package/dist/components/Button.d.ts +116 -0
- package/dist/components/Button.js +57 -0
- package/dist/components/Button.js.map +1 -0
- package/dist/components/Checkbox/index.d.ts +14 -0
- package/dist/components/Checkbox/index.js +75 -0
- package/dist/components/Checkbox/index.js.map +1 -0
- package/dist/components/Checkbox/styles.d.ts +48 -0
- package/dist/components/Checkbox/styles.js +49 -0
- package/dist/components/Checkbox/styles.js.map +1 -0
- package/dist/components/Checkbox.d.ts +12 -0
- package/dist/components/Checkbox.js +61 -0
- package/dist/components/Checkbox.js.map +1 -0
- package/dist/components/Drawer.d.ts +23 -0
- package/dist/components/Drawer.js +78 -0
- package/dist/components/Drawer.js.map +1 -0
- package/dist/components/FileInput.d.ts +2 -0
- package/dist/components/FileInput.js +28 -0
- package/dist/components/FileInput.js.map +1 -0
- package/dist/components/Icon.d.ts +13 -0
- package/dist/components/Icon.js +47 -0
- package/dist/components/Icon.js.map +1 -0
- package/dist/components/Image.d.ts +16 -0
- package/dist/components/Image.js +48 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/Navigation.d.ts +30 -0
- package/dist/components/Navigation.js +126 -0
- package/dist/components/Navigation.js.map +1 -0
- package/dist/components/RadioInput/index.d.ts +25 -0
- package/dist/components/RadioInput/index.js +75 -0
- package/dist/components/RadioInput/index.js.map +1 -0
- package/dist/components/RadioInput/styles.d.ts +50 -0
- package/dist/components/RadioInput/styles.js +45 -0
- package/dist/components/RadioInput/styles.js.map +1 -0
- package/dist/components/Scroll.d.ts +104 -0
- package/dist/components/Scroll.js +73 -0
- package/dist/components/Scroll.js.map +1 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Select/index.js +31 -0
- package/dist/components/Select/index.js.map +1 -0
- package/dist/components/Slider.d.ts +20 -0
- package/dist/components/Slider.js +130 -0
- package/dist/components/Slider.js.map +1 -0
- package/dist/components/Switch.d.ts +13 -0
- package/dist/components/Switch.js +73 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/Text.d.ts +12 -0
- package/dist/components/Text.js +49 -0
- package/dist/components/Text.js.map +1 -0
- package/dist/components/TextInput.d.ts +146 -0
- package/dist/components/TextInput.js +147 -0
- package/dist/components/TextInput.js.map +1 -0
- package/dist/components/Touchable.d.ts +19 -0
- package/dist/components/Touchable.js +62 -0
- package/dist/components/Touchable.js.map +1 -0
- package/dist/components/View.d.ts +190 -0
- package/dist/components/View.js +53 -0
- package/dist/components/View.js.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.js +29 -0
- package/dist/components/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/fastImage.d.ts +1 -0
- package/dist/modules/fastImage.js +10 -0
- package/dist/modules/fastImage.js.map +1 -0
- package/dist/types/utility.d.ts +2 -0
- package/dist/types/utility.js +3 -0
- package/dist/types/utility.js.map +1 -0
- package/dist/utils/OSAlert.d.ts +31 -0
- package/dist/utils/OSAlert.js +89 -0
- package/dist/utils/OSAlert.js.map +1 -0
- package/dist/utils/styles.d.ts +1 -0
- package/dist/utils/styles.js +13 -0
- package/dist/utils/styles.js.map +1 -0
- package/package.json +32 -0
- package/src/components/ActivityIndicator.tsx +37 -0
- package/src/components/Button.tsx +61 -0
- package/src/components/Checkbox/index.tsx +68 -0
- package/src/components/Checkbox/styles.ts +63 -0
- package/src/components/FileInput.tsx +6 -0
- package/src/components/Icon.tsx +35 -0
- package/src/components/Image.tsx +43 -0
- package/src/components/Navigation.tsx +125 -0
- package/src/components/RadioInput/index.tsx +76 -0
- package/src/components/RadioInput/styles.ts +62 -0
- package/src/components/Scroll.tsx +87 -0
- package/src/components/Select/index.tsx +8 -0
- package/src/components/Slider.tsx +198 -0
- package/src/components/Switch.tsx +73 -0
- package/src/components/Text.tsx +31 -0
- package/src/components/TextInput.tsx +206 -0
- package/src/components/Touchable.tsx +54 -0
- package/src/components/View.tsx +53 -0
- package/src/components/index.ts +16 -0
- package/src/index.ts +2 -0
- package/src/modules/fastImage.ts +2 -0
- package/src/types/utility.ts +3 -0
- package/src/utils/OSAlert.ts +122 -0
- package/src/utils/styles.ts +17 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentVariants, FormTypes, IconPlaceholder, TextInputComposition, TextInputStyles } from '@codeleap/common';
|
|
3
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { StylesOf } from '../types/utility';
|
|
5
|
+
import { TextInput as NativeTextInput } from 'react-native';
|
|
6
|
+
declare type IconProp = {
|
|
7
|
+
name: IconPlaceholder;
|
|
8
|
+
action?: () => void;
|
|
9
|
+
};
|
|
10
|
+
declare type NativeProps = ComponentPropsWithoutRef<typeof NativeTextInput>;
|
|
11
|
+
export declare type TextInputProps = ComponentVariants<typeof TextInputStyles> & Omit<NativeProps, 'value'> & {
|
|
12
|
+
multiline?: boolean;
|
|
13
|
+
onChangeText?: (text: string) => void;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
edited?: boolean;
|
|
16
|
+
type?: string;
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
leftIcon?: IconProp;
|
|
19
|
+
rightIcon?: IconProp;
|
|
20
|
+
styles?: StylesOf<TextInputComposition>;
|
|
21
|
+
validate?: FormTypes.ValidatorFunction | string;
|
|
22
|
+
value?: string;
|
|
23
|
+
password?: boolean;
|
|
24
|
+
visibilityToggle?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export declare const TextInput: React.ForwardRefExoticComponent<ComponentVariants<{
|
|
27
|
+
default: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
28
|
+
line: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
29
|
+
box: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
30
|
+
pill: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
31
|
+
fixed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
32
|
+
block: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
33
|
+
flex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
34
|
+
absolute: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
35
|
+
sticky: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
36
|
+
row: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
37
|
+
center: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
38
|
+
column: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
39
|
+
wrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
40
|
+
inline: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
41
|
+
inlineFlex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
42
|
+
hidden: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
43
|
+
full: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
44
|
+
noWrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
45
|
+
fullWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
46
|
+
fullHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
47
|
+
fullView: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
48
|
+
fullViewWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
49
|
+
fullViewHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
50
|
+
whole: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
51
|
+
centerRow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
52
|
+
listStyles: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
53
|
+
alignStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
54
|
+
alignEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
55
|
+
alignCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
56
|
+
justifyStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
57
|
+
justifyEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
58
|
+
justifyCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
59
|
+
justifySpaceBetween: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
60
|
+
textRight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
61
|
+
textLeft: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
62
|
+
textCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
63
|
+
blur: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
64
|
+
elevated: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
65
|
+
neumorphism: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
66
|
+
scrollX: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
67
|
+
scrollY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
68
|
+
scrollXY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
69
|
+
debRed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
70
|
+
debGreen: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
71
|
+
debBlue: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
72
|
+
debYellow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
73
|
+
}, import("@codeleap/common").EnhancedTheme<any>, import("@codeleap/common").VariantProp<{
|
|
74
|
+
default: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
75
|
+
line: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
76
|
+
box: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
77
|
+
pill: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
78
|
+
fixed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
79
|
+
block: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
80
|
+
flex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
81
|
+
absolute: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
82
|
+
sticky: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
83
|
+
row: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
84
|
+
center: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
85
|
+
column: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
86
|
+
wrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
87
|
+
inline: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
88
|
+
inlineFlex: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
89
|
+
hidden: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
90
|
+
full: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
91
|
+
noWrap: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
92
|
+
fullWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
93
|
+
fullHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
94
|
+
fullView: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
95
|
+
fullViewWidth: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
96
|
+
fullViewHeight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
97
|
+
whole: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
98
|
+
centerRow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
99
|
+
listStyles: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
100
|
+
alignStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
101
|
+
alignEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
102
|
+
alignCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
103
|
+
justifyStart: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
104
|
+
justifyEnd: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
105
|
+
justifyCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
106
|
+
justifySpaceBetween: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
107
|
+
textRight: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
108
|
+
textLeft: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
109
|
+
textCenter: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
110
|
+
blur: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
111
|
+
elevated: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
112
|
+
neumorphism: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
113
|
+
scrollX: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
114
|
+
scrollY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
115
|
+
scrollXY: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
116
|
+
debRed: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
117
|
+
debGreen: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
118
|
+
debBlue: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
119
|
+
debYellow: (theme: import("@codeleap/common").EnhancedTheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
120
|
+
}>> & Omit<import("react-native").TextInputProps, "value"> & {
|
|
121
|
+
multiline?: boolean;
|
|
122
|
+
onChangeText?: (text: string) => void;
|
|
123
|
+
disabled?: boolean;
|
|
124
|
+
edited?: boolean;
|
|
125
|
+
type?: string;
|
|
126
|
+
label?: React.ReactNode;
|
|
127
|
+
leftIcon?: IconProp;
|
|
128
|
+
rightIcon?: IconProp;
|
|
129
|
+
styles?: StylesOf<TextInputComposition>;
|
|
130
|
+
validate?: FormTypes.ValidatorFunction | string;
|
|
131
|
+
value?: string;
|
|
132
|
+
password?: boolean;
|
|
133
|
+
visibilityToggle?: boolean;
|
|
134
|
+
} & React.RefAttributes<NativeTextInput>>;
|
|
135
|
+
export declare const FormError: ({ message, ...props }: {
|
|
136
|
+
[x: string]: any;
|
|
137
|
+
message: any;
|
|
138
|
+
}) => any;
|
|
139
|
+
export declare const InputIcon: React.FC<{
|
|
140
|
+
style: any;
|
|
141
|
+
} & IconProp>;
|
|
142
|
+
export declare const InputLabel: ({ label, style }: {
|
|
143
|
+
label: any;
|
|
144
|
+
style: any;
|
|
145
|
+
}) => any;
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.InputLabel = exports.InputIcon = exports.FormError = exports.TextInput = void 0;
|
|
45
|
+
var React = __importStar(require("react"));
|
|
46
|
+
var common_1 = require("@codeleap/common");
|
|
47
|
+
var react_1 = require("react");
|
|
48
|
+
var Text_1 = require("./Text");
|
|
49
|
+
var View_1 = require("./View");
|
|
50
|
+
var Button_1 = require("./Button");
|
|
51
|
+
var Icon_1 = require("./Icon");
|
|
52
|
+
var react_native_1 = require("react-native");
|
|
53
|
+
exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
54
|
+
var onChange = rawprops.onChange, type = rawprops.type, value = rawprops.value, onChangeText = rawprops.onChangeText, disabled = rawprops.disabled, edited = rawprops.edited, onFocus = rawprops.onFocus, onBlur = rawprops.onBlur, multiline = rawprops.multiline, responsiveVariants = rawprops.responsiveVariants, variants = rawprops.variants, label = rawprops.label, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, props = __rest(rawprops, ["onChange", "type", "value", "onChangeText", "disabled", "edited", "onFocus", "onBlur", "multiline", "responsiveVariants", "variants", "label", "leftIcon", "rightIcon", "styles", "validate", "password", "visibilityToggle"]);
|
|
55
|
+
var _a = (0, react_1.useState)(false), _ig = _a[0], setFocus = _a[1];
|
|
56
|
+
var _b = (0, react_1.useState)(edited), editedState = _b[0], setEdited = _b[1];
|
|
57
|
+
var input = (0, react_1.useRef)(null);
|
|
58
|
+
var _c = (0, common_1.useBooleanToggle)(false), textIsVisible = _c[0], setTextVisible = _c[1];
|
|
59
|
+
var variantStyles = (0, common_1.useComponentStyle)('TextInput', {
|
|
60
|
+
variants: variants,
|
|
61
|
+
responsiveVariants: responsiveVariants,
|
|
62
|
+
styles: styles,
|
|
63
|
+
});
|
|
64
|
+
var InputElement = react_native_1.TextInput;
|
|
65
|
+
var handleBlur = function (e) {
|
|
66
|
+
if (!editedState && value)
|
|
67
|
+
setEdited(true);
|
|
68
|
+
setFocus(false);
|
|
69
|
+
if (onBlur) {
|
|
70
|
+
onBlur(e);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
var handleFocus = function (e) {
|
|
74
|
+
setFocus(true);
|
|
75
|
+
if (onFocus) {
|
|
76
|
+
onFocus(e);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
var handleChange = function (event) {
|
|
80
|
+
var text = event.nativeEvent.text;
|
|
81
|
+
if (onChange)
|
|
82
|
+
onChange(event);
|
|
83
|
+
if (onChangeText)
|
|
84
|
+
onChangeText(text);
|
|
85
|
+
};
|
|
86
|
+
(0, react_1.useImperativeHandle)(inputRef, function () { return input.current; });
|
|
87
|
+
var _d = (0, common_1.useValidate)(value, validate), showError = _d.showError, error = _d.error;
|
|
88
|
+
var leftIconStyle = __assign(__assign(__assign(__assign({}, variantStyles.icon), (showError ? variantStyles['icon:error'] : {})), variantStyles.leftIcon), (showError ? variantStyles['leftIcon:error'] : {}));
|
|
89
|
+
var rightIconStyle = __assign(__assign(__assign(__assign({}, variantStyles.icon), (showError ? variantStyles['icon:error'] : {})), variantStyles.rightIcon), (showError ? variantStyles['rightIcon:error'] : {}));
|
|
90
|
+
function getStyles(key) {
|
|
91
|
+
var requestedStyles = [variantStyles[key], showError ? variantStyles[key + ':error'] : {}];
|
|
92
|
+
return requestedStyles;
|
|
93
|
+
}
|
|
94
|
+
return (<View_1.View style={getStyles('wrapper')}>
|
|
95
|
+
<exports.InputLabel label={label} style={getStyles('label')}/>
|
|
96
|
+
|
|
97
|
+
<View_1.View style={getStyles('innerWrapper')}>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<exports.InputIcon {...leftIcon} style={leftIconStyle}/>
|
|
101
|
+
<InputElement ref={input} secureTextEntry={password && !textIsVisible} onChange={handleChange} value={value} editable={disabled} onFocus={handleFocus} onBlur={handleBlur} {...props} style={getStyles('textField')}/>
|
|
102
|
+
{visibilityToggle ?
|
|
103
|
+
<exports.InputIcon name={(textIsVisible ? 'input-visiblity:visible' : 'input-visiblity:hidden')} action={function () { return setTextVisible(); }} style={rightIconStyle}/>
|
|
104
|
+
:
|
|
105
|
+
<exports.InputIcon {...rightIcon} style={rightIconStyle}/>}
|
|
106
|
+
</View_1.View>
|
|
107
|
+
|
|
108
|
+
<exports.FormError message={error.message} style={__assign({}, variantStyles.error)}/>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</View_1.View>);
|
|
112
|
+
});
|
|
113
|
+
var FormError = function (_a) {
|
|
114
|
+
var message = _a.message, props = __rest(_a, ["message"]);
|
|
115
|
+
if (['number', 'string', 'undefined'].includes(typeof message)) {
|
|
116
|
+
return <Text_1.Text text={"".concat(message || ' ')} variants={['p2', 'marginTop:1']} {...props}/>;
|
|
117
|
+
}
|
|
118
|
+
return message;
|
|
119
|
+
};
|
|
120
|
+
exports.FormError = FormError;
|
|
121
|
+
var InputIcon = function (_a) {
|
|
122
|
+
var name = _a.name, style = _a.style, action = _a.action;
|
|
123
|
+
if (!name)
|
|
124
|
+
return null;
|
|
125
|
+
if (action) {
|
|
126
|
+
return <Button_1.Button icon={name} onPress={function () { return action(); }} styles={{
|
|
127
|
+
icon: style,
|
|
128
|
+
}} variants={['icon']}/>;
|
|
129
|
+
}
|
|
130
|
+
return <Icon_1.Icon name={name} style={style}/>;
|
|
131
|
+
};
|
|
132
|
+
exports.InputIcon = InputIcon;
|
|
133
|
+
var InputLabel = function (_a) {
|
|
134
|
+
var label = _a.label, style = _a.style;
|
|
135
|
+
if (!label)
|
|
136
|
+
return null;
|
|
137
|
+
switch (typeof label) {
|
|
138
|
+
case 'string':
|
|
139
|
+
return <Text_1.Text variants={['p2']} style={style} text={label}/>;
|
|
140
|
+
case 'object':
|
|
141
|
+
return label;
|
|
142
|
+
default:
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
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,GAAoC,UAAC,EAAqB;QAApB,IAAI,UAAA,EAAE,KAAK,WAAA,EAAE,MAAM,YAAA;IAC7E,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,IAAI,MAAM,EAAC;QAET,OAAO,CAAC,eAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,cAAM,OAAA,MAAM,EAAE,EAAR,CAAQ,CAAC,CAAE,MAAM,CAAC,CAAC;gBAC3D,IAAI,EAAE,KAAK;aACZ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAA;KAEzB;IAED,OAAO,CAAC,WAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAA;AAC1C,CAAC,CAAA;AAZY,QAAA,SAAS,aAYrB;AACM,IAAM,UAAU,GAAG,UAAC,EAAc;QAAb,KAAK,WAAA,EAAE,KAAK,WAAA;IACtC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,QAAQ,OAAO,KAAK,EAAC;QACnB,KAAK,QAAQ;YACX,OAAO,CAAC,WAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,CAAA;QAC7D,KAAK,QAAQ;YAEX,OAAO,KAAK,CAAA;QACd;YACE,OAAO,IAAI,CAAA;KACd;AACH,CAAC,CAAA;AAZY,QAAA,UAAU,cAYtB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import { ComponentVariants, BaseViewProps, ViewStyles } from '@codeleap/common';
|
|
4
|
+
import { Animated, TouchableOpacity as NativeTouchable } from 'react-native';
|
|
5
|
+
export declare type TouchableProps = ComponentPropsWithoutRef<typeof NativeTouchable> & {
|
|
6
|
+
variants?: ComponentVariants<typeof ViewStyles>['variants'];
|
|
7
|
+
component?: any;
|
|
8
|
+
} & BaseViewProps;
|
|
9
|
+
export declare const Touchable: React.ForwardRefExoticComponent<import("react-native").TouchableOpacityProps & {
|
|
10
|
+
variants?: ComponentVariants<typeof ViewStyles>['variants'];
|
|
11
|
+
component?: any;
|
|
12
|
+
} & BaseViewProps & React.RefAttributes<NativeTouchable>>;
|
|
13
|
+
export declare type AnimatedTouchableProps = ComponentPropsWithoutRef<typeof Animated.View> & TouchableProps;
|
|
14
|
+
export declare const AnimatedTouchable: React.ForwardRefExoticComponent<Pick<Animated.AnimatedProps<import("react-native").ViewProps & React.RefAttributes<import("react-native").View>> & {
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}, keyof import("react-native").ViewProps | "key"> & import("react-native").TouchableOpacityProps & {
|
|
17
|
+
variants?: ComponentVariants<typeof ViewStyles>['variants'];
|
|
18
|
+
component?: any;
|
|
19
|
+
} & BaseViewProps & React.RefAttributes<Animated.AnimatedComponent<typeof import("react-native").View>>>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
22
|
+
var t = {};
|
|
23
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
24
|
+
t[p] = s[p];
|
|
25
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
26
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
27
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
28
|
+
t[p[i]] = s[p[i]];
|
|
29
|
+
}
|
|
30
|
+
return t;
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
exports.AnimatedTouchable = exports.Touchable = void 0;
|
|
34
|
+
var React = __importStar(require("react"));
|
|
35
|
+
var react_1 = require("react");
|
|
36
|
+
var common_1 = require("@codeleap/common");
|
|
37
|
+
var View_1 = require("./View");
|
|
38
|
+
var react_native_1 = require("react-native");
|
|
39
|
+
exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
40
|
+
var _a = touchableProps.variants, variants = _a === void 0 ? [] : _a, children = touchableProps.children, onPress = touchableProps.onPress, style = touchableProps.style, props = __rest(touchableProps, ["variants", "children", "onPress", "style"]);
|
|
41
|
+
var variantStyles = (0, common_1.useComponentStyle)('View', {
|
|
42
|
+
variants: variants,
|
|
43
|
+
});
|
|
44
|
+
var logger = (0, common_1.useStyle)().logger;
|
|
45
|
+
var press = function () {
|
|
46
|
+
if (!onPress)
|
|
47
|
+
throw { message: 'No onPress passed to touchable', touchableProps: touchableProps };
|
|
48
|
+
logger.log('<Touchable/> pressed', { style: style, variants: variants }, 'Component');
|
|
49
|
+
onPress(null);
|
|
50
|
+
};
|
|
51
|
+
var styles = [variantStyles.wrapper, style];
|
|
52
|
+
return <react_native_1.TouchableOpacity onPress={press} {...props} ref={ref}>
|
|
53
|
+
<View_1.View style={styles}>
|
|
54
|
+
{children}
|
|
55
|
+
</View_1.View>
|
|
56
|
+
</react_native_1.TouchableOpacity>;
|
|
57
|
+
});
|
|
58
|
+
exports.AnimatedTouchable = (0, react_1.forwardRef)(function (viewProps, ref) {
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
return <exports.Touchable component={react_native_1.Animated.View} {...viewProps}/>;
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=Touchable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Touchable.js","sourceRoot":"","sources":["../../src/components/Touchable.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,+BAA4D;AAC5D,2CAA4G;AAC5G,+BAA6B;AAC7B,6CAA6E;AAShE,QAAA,SAAS,GAAG,IAAA,kBAAU,EAAkC,UAAC,cAAc,EAAE,GAAG;IAErF,IAAA,KAKE,cAAc,SALH,EAAb,QAAQ,mBAAG,EAAE,KAAA,EACb,QAAQ,GAIN,cAAc,SAJR,EACR,OAAO,GAGL,cAAc,QAHT,EACP,KAAK,GAEH,cAAc,MAFX,EACF,KAAK,UACN,cAAc,EANZ,4CAML,CADS,CACQ;IAElB,IAAM,aAAa,GAAG,IAAA,0BAAiB,EAAC,MAAM,EAAE;QAC9C,QAAQ,UAAA;KACT,CAAC,CAAA;IACK,IAAA,MAAM,GAAI,IAAA,iBAAQ,GAAE,OAAd,CAAc;IAC3B,IAAM,KAAK,GAAG;QACZ,IAAG,CAAC,OAAO;YAAE,MAAM,EAAC,OAAO,EAAE,gCAAgC,EAAE,cAAc,gBAAA,EAAC,CAAA;QAC9E,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,EAAE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