@codeleap/mobile 2.0.1 → 2.0.4
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/ActionIcon/index.js +2 -1
- package/dist/components/ActionIcon/index.js.map +1 -1
- package/dist/components/ActionIcon/styles.d.ts +58 -58
- package/dist/components/Backdrop/index.js +1 -1
- package/dist/components/Backdrop/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +109 -109
- package/dist/components/Button/index.js +5 -7
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Button/styles.d.ts +60 -55
- package/dist/components/Button/styles.js +4 -2
- package/dist/components/Button/styles.js.map +1 -1
- package/dist/components/Checkbox/index.js +4 -2
- package/dist/components/Checkbox/index.js.map +1 -1
- package/dist/components/Checkbox/styles.d.ts +1 -1
- package/dist/components/Checkbox/styles.js +4 -0
- package/dist/components/Checkbox/styles.js.map +1 -1
- package/dist/components/FileInput/index.d.ts +1 -1
- package/dist/components/Image/index.js +3 -0
- package/dist/components/Image/index.js.map +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/MultiSelect/styles.js +1 -4
- package/dist/components/MultiSelect/styles.js.map +1 -1
- package/dist/components/Navigation/utils.js +0 -1
- package/dist/components/Navigation/utils.js.map +1 -1
- package/dist/components/Pager/styles.js +13 -11
- package/dist/components/Pager/styles.js.map +1 -1
- package/dist/components/RadioInput/index.js +3 -1
- package/dist/components/RadioInput/index.js.map +1 -1
- package/dist/components/RadioInput/styles.d.ts +1 -1
- package/dist/components/RadioInput/styles.js +1 -0
- package/dist/components/RadioInput/styles.js.map +1 -1
- package/dist/components/SegmentedControl/index.d.ts +10 -1
- package/dist/components/SegmentedControl/index.js +27 -27
- package/dist/components/SegmentedControl/index.js.map +1 -1
- package/dist/components/SegmentedControl/styles.d.ts +56 -51
- package/dist/components/SegmentedControl/styles.js +10 -3
- package/dist/components/SegmentedControl/styles.js.map +1 -1
- package/dist/components/Select/index.js +1 -2
- package/dist/components/Select/index.js.map +1 -1
- package/dist/components/Select/styles.d.ts +1 -1
- package/dist/components/Select/styles.js +4 -1
- package/dist/components/Select/styles.js.map +1 -1
- package/dist/components/Switch/index.js +1 -1
- package/dist/components/Switch/index.js.map +1 -1
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/Text/index.js +43 -3
- package/dist/components/Text/index.js.map +1 -1
- package/dist/components/Text/styles.d.ts +57 -52
- package/dist/components/Text/styles.js +11 -3
- package/dist/components/Text/styles.js.map +1 -1
- package/dist/components/TextInput/index.d.ts +8 -4
- package/dist/components/TextInput/index.js +37 -17
- package/dist/components/TextInput/index.js.map +1 -1
- package/dist/components/TextInput/styles.d.ts +1 -1
- package/dist/components/TextInput/styles.js +11 -3
- package/dist/components/TextInput/styles.js.map +1 -1
- package/dist/components/Touchable/index.d.ts +1 -1
- package/dist/components/Touchable/index.js +81 -43
- package/dist/components/Touchable/index.js.map +1 -1
- package/dist/components/Touchable/styles.d.ts +56 -51
- package/dist/components/Touchable/styles.js +6 -1
- package/dist/components/Touchable/styles.js.map +1 -1
- package/dist/components/defaultStyles.d.ts +263 -263
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.d.ts +2 -0
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js +287 -286
- package/dist/utils/KeyboardAware/lib/KeyboardAwareHOC.js.map +1 -1
- package/dist/utils/OSAlert.d.ts +6 -5
- package/dist/utils/OSAlert.js +7 -6
- package/dist/utils/OSAlert.js.map +1 -1
- package/dist/utils/hooks.d.ts +34 -1
- package/dist/utils/hooks.js +54 -1
- package/dist/utils/hooks.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -6
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/notifications.js +4 -4
- package/dist/utils/notifications.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionIcon/index.tsx +2 -1
- package/src/components/Backdrop/index.tsx +1 -1
- package/src/components/Button/index.tsx +7 -11
- package/src/components/Button/styles.ts +34 -10
- package/src/components/Checkbox/index.tsx +4 -1
- package/src/components/Checkbox/styles.ts +5 -0
- package/src/components/Image/index.tsx +3 -0
- package/src/components/Modal/index.tsx +1 -1
- package/src/components/MultiSelect/styles.ts +1 -8
- package/src/components/Navigation/utils.tsx +0 -2
- package/src/components/Pager/styles.ts +16 -11
- package/src/components/RadioInput/index.tsx +3 -1
- package/src/components/RadioInput/styles.ts +2 -1
- package/src/components/SegmentedControl/index.tsx +31 -18
- package/src/components/SegmentedControl/styles.ts +29 -7
- package/src/components/Select/index.tsx +2 -1
- package/src/components/Select/styles.ts +12 -2
- package/src/components/Switch/index.tsx +1 -1
- package/src/components/Text/index.tsx +57 -7
- package/src/components/Text/styles.ts +25 -9
- package/src/components/TextInput/index.tsx +48 -9
- package/src/components/TextInput/styles.ts +14 -4
- package/src/components/Touchable/index.tsx +90 -36
- package/src/components/Touchable/styles.ts +15 -3
- package/src/utils/KeyboardAware/lib/KeyboardAwareHOC.tsx +34 -24
- package/src/utils/OSAlert.ts +10 -10
- package/src/utils/hooks.ts +82 -2
- package/src/utils/index.ts +2 -2
- package/src/utils/notifications.ts +4 -4
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { StylesOf } from '@codeleap/common';
|
|
2
|
+
import { FeedbackConfig } from '../../utils';
|
|
3
|
+
export declare type TextComposition = 'text' | 'touchFeedback';
|
|
4
|
+
export declare type TextStylesGen<TCSS = any> = StylesOf<'text', TCSS> & {
|
|
5
|
+
'pressFeedback'?: FeedbackConfig;
|
|
6
|
+
};
|
|
2
7
|
export declare const TextStyles: {
|
|
3
|
-
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
8
|
+
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
4
9
|
h1: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
5
10
|
h2: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
6
11
|
h3: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
@@ -12,54 +17,54 @@ export declare const TextStyles: {
|
|
|
12
17
|
p3: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
13
18
|
p4: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
14
19
|
link: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<"text", any>>;
|
|
15
|
-
OSAlertBody: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
16
|
-
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
17
|
-
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
18
|
-
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
19
|
-
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
20
|
-
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
21
|
-
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
22
|
-
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
23
|
-
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
24
|
-
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
25
|
-
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
26
|
-
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
27
|
-
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
28
|
-
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
29
|
-
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
30
|
-
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
31
|
-
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
32
|
-
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
33
|
-
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
34
|
-
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
35
|
-
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
36
|
-
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
37
|
-
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
38
|
-
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
39
|
-
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
40
|
-
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
41
|
-
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
42
|
-
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
43
|
-
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
44
|
-
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
45
|
-
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
46
|
-
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
47
|
-
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
48
|
-
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
49
|
-
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
50
|
-
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
51
|
-
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
52
|
-
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
53
|
-
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
54
|
-
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
55
|
-
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
56
|
-
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
57
|
-
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
58
|
-
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
59
|
-
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
60
|
-
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
61
|
-
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
62
|
-
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
63
|
-
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
64
|
-
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) =>
|
|
20
|
+
OSAlertBody: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
21
|
+
inline: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
22
|
+
block: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
23
|
+
flex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
24
|
+
inlineFlex: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
25
|
+
absolute: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
26
|
+
relative: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
27
|
+
fixed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
28
|
+
sticky: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
29
|
+
hidden: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
30
|
+
full: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
31
|
+
noWrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
32
|
+
fullWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
33
|
+
fullHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
34
|
+
fullView: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
35
|
+
fullViewWidth: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
36
|
+
fullViewHeight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
37
|
+
whole: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
38
|
+
centerRow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
39
|
+
row: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
40
|
+
listStyles: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
41
|
+
column: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
42
|
+
center: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
43
|
+
alignStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
44
|
+
alignEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
45
|
+
alignCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
46
|
+
alignStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
47
|
+
alignSelfCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
48
|
+
alignSelfStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
49
|
+
alignSelfStretch: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
50
|
+
alignSelfEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
51
|
+
justifyStart: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
52
|
+
justifyEnd: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
53
|
+
justifyCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
54
|
+
justifySpaceBetween: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
55
|
+
justifySpaceAround: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
56
|
+
textRight: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
57
|
+
textLeft: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
58
|
+
textCenter: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
59
|
+
blur: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
60
|
+
elevated: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
61
|
+
neumorphism: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
62
|
+
scrollX: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
63
|
+
scrollY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
64
|
+
scrollXY: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
65
|
+
wrap: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
66
|
+
debRed: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
67
|
+
debGreen: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
68
|
+
debBlue: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
69
|
+
debYellow: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => TextStylesGen<any>;
|
|
65
70
|
};
|
|
@@ -15,9 +15,17 @@ exports.TextStyles = void 0;
|
|
|
15
15
|
var common_1 = require("@codeleap/common");
|
|
16
16
|
var createTextStyle = (0, common_1.createDefaultVariantFactory)();
|
|
17
17
|
var presets = (0, common_1.includePresets)(function (styles) { return createTextStyle(function () { return ({ text: styles }); }); });
|
|
18
|
-
exports.TextStyles = __assign(__assign({}, presets), { default: createTextStyle(function (theme) {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
exports.TextStyles = __assign(__assign({}, presets), { default: createTextStyle(function (theme) {
|
|
19
|
+
var defaultStyle = (0, common_1.assignTextStyle)('p1')(theme).text;
|
|
20
|
+
return {
|
|
21
|
+
text: __assign({ fontFamily: theme.typography.fontFamily }, defaultStyle),
|
|
22
|
+
pressFeedback: {
|
|
23
|
+
type: 'highlight',
|
|
24
|
+
brightness: 0,
|
|
25
|
+
shiftOpacity: 0.3,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}), h1: (0, common_1.assignTextStyle)('h1'), h2: (0, common_1.assignTextStyle)('h2'), h3: (0, common_1.assignTextStyle)('h3'), h4: (0, common_1.assignTextStyle)('h4'), h5: (0, common_1.assignTextStyle)('h5'), h6: (0, common_1.assignTextStyle)('h6'), p1: (0, common_1.assignTextStyle)('p1'), p2: (0, common_1.assignTextStyle)('p2'), p3: (0, common_1.assignTextStyle)('p3'), p4: (0, common_1.assignTextStyle)('p4'), link: (0, common_1.assignTextStyle)('p1'), OSAlertBody: createTextStyle(function (theme) { return ({
|
|
21
29
|
text: __assign(__assign({}, (0, common_1.assignTextStyle)('p1')(theme).text), theme.presets.textCenter),
|
|
22
30
|
}); }) });
|
|
23
31
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Text/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/Text/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAAqH;AASrH,IAAM,eAAe,GAAG,IAAA,oCAA2B,GAEhD,CAAA;AAEH,IAAM,OAAO,GAAG,IAAA,uBAAc,EAAC,UAAC,MAAM,IAAK,OAAA,eAAe,CAAC,cAAM,OAAA,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAlB,CAAkB,CAAC,EAAzC,CAAyC,CACnF,CAAA;AAEY,QAAA,UAAU,yBAClB,OAAO,KACV,OAAO,EAAE,eAAe,CAAC,UAAC,KAAK;QAC7B,IAAM,YAAY,GAAG,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAA;QACtD,OAAO;YACL,IAAI,aACF,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,UAAU,IACpC,YAAY,CAChB;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,WAAW;gBACjB,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,GAAG;aAClB;SACF,CAAA;IACH,CAAC,CAAC,EACF,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,EAAE,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EACzB,IAAI,EAAE,IAAA,wBAAe,EAAC,IAAI,CAAC,EAC3B,WAAW,EAAE,eAAe,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACvC,IAAI,wBACC,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GACjC,KAAK,CAAC,OAAO,CAAC,UAAU,CAC5B;KACF,CAAC,EALsC,CAKtC,CAAC,IACJ"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ComponentVariants, FormTypes } from '@codeleap/common';
|
|
3
3
|
import { ComponentPropsWithoutRef } from 'react';
|
|
4
|
+
import { TextProps } from '../Text';
|
|
4
5
|
import { ViewProps } from '../View';
|
|
5
6
|
import { StylesOf } from '../../types';
|
|
6
7
|
import { TextInput as NativeTextInput } from 'react-native';
|
|
@@ -11,6 +12,10 @@ export * from './styles';
|
|
|
11
12
|
import { InputIconComposition, TextInputComposition, TextInputStyles } from './styles';
|
|
12
13
|
import { ActionIconProps } from '../ActionIcon';
|
|
13
14
|
declare type NativeProps = ComponentPropsWithoutRef<typeof NativeTextInput>;
|
|
15
|
+
declare type SubtitleProps = {
|
|
16
|
+
errorProps: TextProps;
|
|
17
|
+
styles: Record<'wrapper' | 'error' | 'subtitle', any>;
|
|
18
|
+
};
|
|
14
19
|
export declare type TextInputProps = Partial<TextInputMaskProps> & ComponentVariants<typeof TextInputStyles> & Omit<NativeProps, 'value'> & {
|
|
15
20
|
multiline?: boolean;
|
|
16
21
|
onChangeText?: (text: string) => void;
|
|
@@ -27,6 +32,7 @@ export declare type TextInputProps = Partial<TextInputMaskProps> & ComponentVari
|
|
|
27
32
|
password?: boolean;
|
|
28
33
|
visibilityToggle?: boolean;
|
|
29
34
|
touchableWrapper?: boolean;
|
|
35
|
+
subtitle?: string | ((props: SubtitleProps) => React.ReactElement);
|
|
30
36
|
onPress?: () => void;
|
|
31
37
|
masking?: FormTypes.TextField['masking'];
|
|
32
38
|
innerWrapperProps?: ViewProps;
|
|
@@ -158,6 +164,7 @@ export declare const TextInput: React.ForwardRefExoticComponent<Partial<TextInpu
|
|
|
158
164
|
password?: boolean;
|
|
159
165
|
visibilityToggle?: boolean;
|
|
160
166
|
touchableWrapper?: boolean;
|
|
167
|
+
subtitle?: string | ((props: SubtitleProps) => React.ReactElement);
|
|
161
168
|
onPress?: () => void;
|
|
162
169
|
masking?: FormTypes.TextField['masking'];
|
|
163
170
|
innerWrapperProps?: ViewProps;
|
|
@@ -165,10 +172,7 @@ export declare const TextInput: React.ForwardRefExoticComponent<Partial<TextInpu
|
|
|
165
172
|
onChangeMask?: TextInputMaskProps['onChangeText'];
|
|
166
173
|
required?: boolean;
|
|
167
174
|
} & React.RefAttributes<NativeTextInput>>;
|
|
168
|
-
export declare const FormError:
|
|
169
|
-
[x: string]: any;
|
|
170
|
-
message: any;
|
|
171
|
-
}) => any;
|
|
175
|
+
export declare const FormError: React.FC<TextProps>;
|
|
172
176
|
declare type InputIconProps = {
|
|
173
177
|
styles: StylesOf<InputIconComposition>;
|
|
174
178
|
commonStyles: StylesOf<InputIconComposition>;
|
|
@@ -64,11 +64,11 @@ __exportStar(require("./styles"), exports);
|
|
|
64
64
|
var ActionIcon_1 = require("../ActionIcon");
|
|
65
65
|
exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
66
66
|
var _a, _b;
|
|
67
|
-
var onChange = rawprops.onChange, value = rawprops.value, onChangeText = rawprops.onChangeText, disabled = rawprops.disabled, edited = rawprops.edited, onFocus = rawprops.onFocus, onBlur = rawprops.onBlur, variants = rawprops.variants, label = rawprops.label, wrapperProps = rawprops.wrapperProps, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, innerWrapperProps = rawprops.innerWrapperProps, _c = rawprops.masking, masking = _c === void 0 ? null : _c, onChangeMask = rawprops.onChangeMask, debugName = rawprops.debugName,
|
|
68
|
-
var
|
|
69
|
-
var
|
|
67
|
+
var onChange = rawprops.onChange, value = rawprops.value, onChangeText = rawprops.onChangeText, disabled = rawprops.disabled, edited = rawprops.edited, onFocus = rawprops.onFocus, onBlur = rawprops.onBlur, variants = rawprops.variants, label = rawprops.label, wrapperProps = rawprops.wrapperProps, leftIcon = rawprops.leftIcon, rightIcon = rawprops.rightIcon, styles = rawprops.styles, validate = rawprops.validate, password = rawprops.password, visibilityToggle = rawprops.visibilityToggle, innerWrapperProps = rawprops.innerWrapperProps, _c = rawprops.masking, masking = _c === void 0 ? null : _c, _d = rawprops.subtitle, subtitle = _d === void 0 ? '' : _d, onChangeMask = rawprops.onChangeMask, debugName = rawprops.debugName, _e = rawprops.required, required = _e === void 0 ? false : _e, props = __rest(rawprops, ["onChange", "value", "onChangeText", "disabled", "edited", "onFocus", "onBlur", "variants", "label", "wrapperProps", "leftIcon", "rightIcon", "styles", "validate", "password", "visibilityToggle", "innerWrapperProps", "masking", "subtitle", "onChangeMask", "debugName", "required"]);
|
|
68
|
+
var _f = (0, react_1.useState)(false), isFocused = _f[0], setFocus = _f[1];
|
|
69
|
+
var _g = (0, react_1.useState)(edited), editedState = _g[0], setEdited = _g[1];
|
|
70
70
|
var input = (0, react_1.useRef)(null);
|
|
71
|
-
var
|
|
71
|
+
var _h = (0, common_1.useBooleanToggle)(false), textIsVisible = _h[0], setTextVisible = _h[1];
|
|
72
72
|
var variantStyles = (0, common_1.useDefaultComponentStyle)('u:TextInput', {
|
|
73
73
|
variants: variants,
|
|
74
74
|
styles: styles,
|
|
@@ -106,7 +106,7 @@ exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
|
106
106
|
var _a, _b;
|
|
107
107
|
(_b = (_a = input.current) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
108
108
|
}, isTextInput: true })); });
|
|
109
|
-
var
|
|
109
|
+
var _j = (0, common_1.useValidate)(value, validate), showError = _j.showError, error = _j.error;
|
|
110
110
|
var commonIconStyles = (0, common_1.getNestedStylesByKey)('icon', variantStyles);
|
|
111
111
|
var leftIconStyles = (0, common_1.getNestedStylesByKey)('leftIcon', variantStyles);
|
|
112
112
|
var rightIconStyles = (0, common_1.getNestedStylesByKey)('rightIcon', variantStyles);
|
|
@@ -116,7 +116,7 @@ exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
|
116
116
|
isFocused ? variantStyles[key + ':focus'] : {},
|
|
117
117
|
showError ? variantStyles[key + ':error'] : {},
|
|
118
118
|
];
|
|
119
|
-
return requestedStyles;
|
|
119
|
+
return react_native_1.StyleSheet.flatten(requestedStyles);
|
|
120
120
|
}
|
|
121
121
|
function handlePress() {
|
|
122
122
|
var _a, _b;
|
|
@@ -132,34 +132,54 @@ exports.TextInput = (0, react_1.forwardRef)(function (rawprops, inputRef) {
|
|
|
132
132
|
icon: (textIsVisible ? 'input-visiblity:visible' : 'input-visiblity:hidden'),
|
|
133
133
|
debugName: "".concat(debugName, " toggle visibility"),
|
|
134
134
|
} : {};
|
|
135
|
-
|
|
135
|
+
var subtitleStyles = {
|
|
136
|
+
error: getStyles('error'),
|
|
137
|
+
wrapper: getStyles('subtitleWrapper'),
|
|
138
|
+
subtitle: getStyles('subtitle'),
|
|
139
|
+
};
|
|
140
|
+
var errorProps = { text: error.message, style: subtitleStyles.error };
|
|
141
|
+
var subtitleContent = common_1.TypeGuards.isFunction(subtitle) ? subtitle({ styles: subtitleStyles, errorProps: errorProps }) : <View_1.View style={subtitleStyles.wrapper}>
|
|
142
|
+
<exports.FormError {...errorProps}/>
|
|
143
|
+
{common_1.TypeGuards.isString(subtitle) ? <Text_1.Text text={subtitle} style={subtitleStyles.subtitle}/> : (subtitle || null)}
|
|
144
|
+
</View_1.View>;
|
|
145
|
+
return (<Touchable_1.Touchable style={getStyles('wrapper')} debugName={debugName} onPress={handlePress} {...wrapperProps} android_ripple={null} noFeedback>
|
|
136
146
|
<Label_1.InputLabel label={label} style={getStyles('label')} asteriskStyle={getStyles('requiredAsterisk')} wrapperStyle={getStyles('labelWrapper')} required={required}/>
|
|
137
147
|
<View_1.View style={getStyles('innerWrapper')} {...innerWrapperProps}>
|
|
138
|
-
<exports.InputIcon isFocused={isFocused} showError={showError} styles={leftIconStyles} commonStyles={commonIconStyles} debugName={"".concat(debugName, " left icon")} {...leftIcon}/>
|
|
148
|
+
<exports.InputIcon isFocused={isFocused} showError={showError} styles={leftIconStyles} commonStyles={commonIconStyles} debugName={"".concat(debugName, " left icon")} onPress={function () { }} noFeedback={!leftIcon.onPress} {...leftIcon}/>
|
|
139
149
|
{/* @ts-ignore */}
|
|
140
150
|
<InputElement ref={input} secureTextEntry={password && !textIsVisible} onChange={function (e) { return masking ? onChange === null || onChange === void 0 ? void 0 : onChange(e) : handleChange(e); }} value={value} editable={disabled} onFocus={handleFocus} onBlur={handleBlur} placeholderTextColor={(_a = react_native_1.StyleSheet.flatten(getStyles('placeholder'))) === null || _a === void 0 ? void 0 : _a.color} selectionColor={(_b = react_native_1.StyleSheet.flatten(getStyles('selection'))) === null || _b === void 0 ? void 0 : _b.color} includeRawValueInChangeText={true} {...props} {...(masking ? { onChangeText: handleMaskChange, type: masking === null || masking === void 0 ? void 0 : masking.type, refInput: function (inputRef) {
|
|
141
151
|
input.current = inputRef;
|
|
142
152
|
} } : {})} style={getStyles('textField')}/>
|
|
143
|
-
<exports.InputIcon isFocused={isFocused} showError={showError} styles={rightIconStyles} commonStyles={commonIconStyles} debugName={"".concat(debugName, " right icon")} {...rightIcon} {...visibilityToggleProps}/>
|
|
153
|
+
<exports.InputIcon isFocused={isFocused} showError={showError} styles={rightIconStyles} commonStyles={commonIconStyles} debugName={"".concat(debugName, " right icon")} onPress={function () { }} noFeedback={!(rightIcon === null || rightIcon === void 0 ? void 0 : rightIcon.onPress)} {...rightIcon} {...visibilityToggleProps}/>
|
|
144
154
|
|
|
145
155
|
</View_1.View>
|
|
146
|
-
|
|
156
|
+
{subtitleContent}
|
|
147
157
|
</Touchable_1.Touchable>);
|
|
148
158
|
});
|
|
149
159
|
var FormError = function (_a) {
|
|
150
|
-
var
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
160
|
+
var text = _a.text, props = __rest(_a, ["text"]);
|
|
161
|
+
var message = text;
|
|
162
|
+
if (common_1.TypeGuards.isNumber(message)) {
|
|
163
|
+
message = message.toString();
|
|
164
|
+
}
|
|
165
|
+
if (typeof message === 'undefined') {
|
|
166
|
+
message = '';
|
|
154
167
|
}
|
|
155
|
-
|
|
168
|
+
if (common_1.TypeGuards.isString(message)) {
|
|
169
|
+
var text_1 = message ? "".concat(message.charAt(0).toUpperCase() + message.slice(1)) : ' ';
|
|
170
|
+
return <Text_1.Text text={text_1} {...props}/>;
|
|
171
|
+
}
|
|
172
|
+
return <>
|
|
173
|
+
{text}
|
|
174
|
+
</>;
|
|
156
175
|
};
|
|
157
176
|
exports.FormError = FormError;
|
|
158
177
|
var InputIcon = function (_a) {
|
|
159
178
|
var styles = _a.styles, commonStyles = _a.commonStyles, isFocused = _a.isFocused, showError = _a.showError, props = __rest(_a, ["styles", "commonStyles", "isFocused", "showError"]);
|
|
160
179
|
if (!props.icon)
|
|
161
180
|
return null;
|
|
162
|
-
function getStyles(
|
|
181
|
+
function getStyles(k) {
|
|
182
|
+
var key = k;
|
|
163
183
|
if (key === 'icon')
|
|
164
184
|
key = '';
|
|
165
185
|
var requestedStyles = [
|
|
@@ -176,7 +196,7 @@ var InputIcon = function (_a) {
|
|
|
176
196
|
icon: getStyles('icon'),
|
|
177
197
|
touchablePressable: getStyles('touchablePressable'),
|
|
178
198
|
touchableWrapper: getStyles('touchableWrapper'),
|
|
179
|
-
|
|
199
|
+
touchableFeedback: getStyles('touchableFeedback'),
|
|
180
200
|
};
|
|
181
201
|
return <ActionIcon_1.ActionIcon styles={iconStyles} {...props}/>;
|
|
182
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/TextInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA8B;AAC9B,2CAWyB;AACzB,+BAAmG;AACnG,gCAAyC;AACzC,gCAAyC;AAGzC,6CAAuH;AACvH,0CAAwD;AACxD,6DAAiF;AACjF,iCAAoC;AAEpC,iCAAoC;AAA3B,mGAAA,UAAU,OAAA;AAEnB,2CAAwB;AAOxB,4CAA4E;AAwC/D,QAAA,SAAS,GAAG,IAAA,kBAAU,EAAkC,UAAC,QAAQ,EAAE,QAAQ;;IAEpF,IAAA,QAAQ,GAuBN,QAAQ,SAvBF,EACR,KAAK,GAsBH,QAAQ,MAtBL,EACL,YAAY,GAqBV,QAAQ,aArBE,EACZ,QAAQ,GAoBN,QAAQ,SApBF,EACR,MAAM,GAmBJ,QAAQ,OAnBJ,EACN,OAAO,GAkBL,QAAQ,QAlBH,EACP,MAAM,GAiBJ,QAAQ,OAjBJ,EACN,QAAQ,GAgBN,QAAQ,SAhBF,EACR,KAAK,GAeH,QAAQ,MAfL,EACL,YAAY,GAcV,QAAQ,aAdE,EACZ,QAAQ,GAaN,QAAQ,SAb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UAAU,CAAC,CACnB,IAAI,KAAK,CAAC,EACV,CAAA;AACJ,CAAC,CAAA;AA5BY,QAAA,SAAS,aA4BrB"}
|
|
@@ -2,7 +2,7 @@ import { ActionIconParts } from '../ActionIcon';
|
|
|
2
2
|
export declare type IconParts = Exclude<ActionIconParts, 'icon' | 'icon:disabled'>;
|
|
3
3
|
declare type InputIcons = 'icon' | 'leftIcon' | 'rightIcon';
|
|
4
4
|
export declare type InputIconComposition = `${InputIcons}${Capitalize<IconParts>}` | InputIcons;
|
|
5
|
-
declare type TextInputParts = 'wrapper' | InputIconComposition | 'textField' | 'label' | 'innerWrapper' | 'error' | 'placeholder' | 'selection' | 'requiredAsterisk' | 'labelWrapper';
|
|
5
|
+
declare type TextInputParts = 'wrapper' | InputIconComposition | 'textField' | 'label' | 'innerWrapper' | 'error' | 'subtitle' | 'subtitleWrapper' | 'placeholder' | 'selection' | 'requiredAsterisk' | 'labelWrapper';
|
|
6
6
|
export declare type TextInputComposition = `${TextInputParts}:error` | `${TextInputParts}:focus` | TextInputParts;
|
|
7
7
|
export declare const TextInputStyles: {
|
|
8
8
|
default: (theme: import("@codeleap/common").ThemeColorScheme<import("@codeleap/common").AppTheme>, variant?: string) => Partial<Record<TextInputComposition, any>>;
|
|
@@ -38,9 +38,17 @@ exports.TextInputStyles = __assign(__assign({}, presets), { default: createTextI
|
|
|
38
38
|
'icon:focus': {
|
|
39
39
|
color: theme.colors.primary,
|
|
40
40
|
},
|
|
41
|
-
leftIconTouchableWrapper:
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
leftIconTouchableWrapper: {
|
|
42
|
+
// ...theme.spacing.marginRight(0.5),
|
|
43
|
+
},
|
|
44
|
+
rightIconTouchableWrapper: {
|
|
45
|
+
// ...theme.spacing.marginLeft(0.5),
|
|
46
|
+
},
|
|
47
|
+
error: {
|
|
48
|
+
color: theme.colors.negative,
|
|
49
|
+
},
|
|
50
|
+
subtitleWrapper: __assign(__assign(__assign(__assign({}, theme.spacing.marginTop(0.2)), theme.presets.row), theme.presets.justifySpaceBetween), theme.presets.alignCenter),
|
|
51
|
+
subtitle: __assign({}, theme.presets.textRight),
|
|
44
52
|
'label:error': {
|
|
45
53
|
color: theme.colors.negative,
|
|
46
54
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/TextInput/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA+F;
|
|
1
|
+
{"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/TextInput/styles.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,2CAA+F;AA4B/F,IAAM,oBAAoB,GACxB,IAAA,oCAA2B,GAAwB,CAAA;AAErD,IAAM,OAAO,GAAG,IAAA,uBAAc,EAAC,UAAC,MAAM,IAAK,OAAA,oBAAoB,CAAC,cAAM,OAAA,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,EAArB,CAAqB,CAAC,EAAjD,CAAiD,CAAC,CAAA;AAEhF,QAAA,eAAe,yBACvB,OAAO,KACV,OAAO,EAAE,oBAAoB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACxC,SAAS,0CACJ,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,GACxB,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAClC,IAAA,wBAAe,EAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KACpC,QAAQ,EAAE,CAAC,EACX,eAAe,EAAE,aAAa,EAC9B,IAAI,EAAE,CAAC,GACR;QACD,WAAW,EAAE;YACX,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;SAC9B;QACD,SAAS,EAAE;YACT,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;SAC5B;QACD,OAAO,EAAE;YACP,OAAO,EAAE,MAAM;YACf,aAAa,EAAE,QAAQ;SAExB;QACD,YAAY,mDACP,K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E;YAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ;SAC7B;QACD,YAAY,eACP,KAAK,CAAC,OAAO,CAAC,GAAG,CACrB;KACF,CAAC,EA7EuC,CA6EvC,CAAC,EACH,IAAI,EAAE,oBAAoB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACrC,YAAY,eACP,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAC9D;KACF,CAAC,EAJoC,CAIpC,CAAC,EACH,GAAG,EAAE,oBAAoB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACpC,YAAY,eACP,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAC3B;KACF,CAAC,EAJmC,CAInC,CAAC,EACH,IAAI,EAAE,oBAAoB,CAAC,UAAC,KAAK,IAAK,OAAA,CAAC;QACrC,YAAY,wBACP,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAC1B,YAAY,EAAE,EAAE,GACjB;KACF,CAAC,EALoC,CAKpC,CAAC,IACJ"}
|
|
@@ -11,8 +11,8 @@ export declare type TouchableProps = Omit<ComponentPropsWithoutRef<typeof Pressa
|
|
|
11
11
|
debugName: string;
|
|
12
12
|
activeOpacity?: number;
|
|
13
13
|
debugComponent?: string;
|
|
14
|
-
feedbackVariant?: 'opacity' | 'none' | 'highlight';
|
|
15
14
|
onPress?: AnyFunction;
|
|
15
|
+
noFeedback?: boolean;
|
|
16
16
|
styles?: StylesOf<TouchableComposition>;
|
|
17
17
|
} & BaseViewProps;
|
|
18
18
|
export * from './styles';
|
|
@@ -1,15 +1,4 @@
|
|
|
1
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
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
3
|
if (k2 === undefined) k2 = k;
|
|
15
4
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -55,28 +44,38 @@ var common_1 = require("@codeleap/common");
|
|
|
55
44
|
var react_native_1 = require("react-native");
|
|
56
45
|
var react_native_animatable_1 = require("react-native-animatable");
|
|
57
46
|
var View_1 = require("../View");
|
|
47
|
+
var utils_1 = require("../../utils");
|
|
58
48
|
__exportStar(require("./styles"), exports);
|
|
59
|
-
var
|
|
49
|
+
var defaultWrapperStyles = {
|
|
60
50
|
paddingTop: 0,
|
|
61
51
|
paddingLeft: 0,
|
|
62
52
|
paddingRight: 0,
|
|
63
53
|
paddingBottom: 0,
|
|
64
54
|
overflow: 'hidden',
|
|
55
|
+
alignItems: 'stretch',
|
|
65
56
|
};
|
|
66
57
|
var defaultPressableStyles = {
|
|
67
58
|
marginTop: 0,
|
|
68
59
|
marginLeft: 0,
|
|
69
60
|
marginRight: 0,
|
|
70
61
|
marginBottom: 0,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
62
|
+
};
|
|
63
|
+
var ripplePressableStyles = {
|
|
64
|
+
// position: 'absolute',
|
|
65
|
+
// top: 0,
|
|
66
|
+
// left: 0,
|
|
67
|
+
// right: 0,
|
|
68
|
+
// bottom: 0,
|
|
69
|
+
// width: '100%',
|
|
70
|
+
// minWidth: '100%',
|
|
71
|
+
// maxWidth: '100%',
|
|
72
|
+
// height: '100%',
|
|
73
|
+
// minHeight: '100%',
|
|
74
|
+
// maxHeight: '100%',
|
|
75
|
+
// flex: 1,
|
|
76
76
|
};
|
|
77
77
|
exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
78
|
-
var _a = touchableProps.variants, variants = _a === void 0 ? [] : _a, children = touchableProps.children, onPress = touchableProps.onPress, style = touchableProps.style,
|
|
79
|
-
var _feedbackVariant = onPress ? feedbackVariant : 'none';
|
|
78
|
+
var _a = touchableProps.variants, variants = _a === void 0 ? [] : _a, children = touchableProps.children, onPress = touchableProps.onPress, style = touchableProps.style, debugName = touchableProps.debugName, debugComponent = touchableProps.debugComponent, _b = touchableProps.noFeedback, noFeedback = _b === void 0 ? false : _b, styles = touchableProps.styles, props = __rest(touchableProps, ["variants", "children", "onPress", "style", "debugName", "debugComponent", "noFeedback", "styles"]);
|
|
80
79
|
var variantStyles = (0, common_1.useDefaultComponentStyle)('u:Touchable', {
|
|
81
80
|
variants: variants,
|
|
82
81
|
transform: react_native_1.StyleSheet.flatten,
|
|
@@ -86,40 +85,79 @@ exports.Touchable = (0, react_1.forwardRef)(function (touchableProps, ref) {
|
|
|
86
85
|
var logger = (0, common_1.useCodeleapContext)().logger;
|
|
87
86
|
var press = function () {
|
|
88
87
|
if (!onPress) {
|
|
89
|
-
|
|
88
|
+
logger.warn('No onPress passed to touchable', {
|
|
89
|
+
touchableProps: touchableProps,
|
|
90
|
+
}, 'User Interaction');
|
|
91
|
+
return;
|
|
90
92
|
}
|
|
91
93
|
logger.log("<".concat(debugComponent || 'Touchable', "/> pressed"), debugName || variants, 'User interaction');
|
|
92
94
|
onPress && onPress();
|
|
93
95
|
};
|
|
94
96
|
var _styles = react_native_1.StyleSheet.flatten([variantStyles.wrapper, style]);
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
backgroundColor: pressed ? '#e0e0e0' : 'transparent',
|
|
103
|
-
};
|
|
104
|
-
break;
|
|
105
|
-
case 'opacity':
|
|
106
|
-
return {
|
|
107
|
-
opacity: pressed ? activeOpacity : 1,
|
|
108
|
-
};
|
|
109
|
-
case 'none':
|
|
110
|
-
return {};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
var rippleConfig = hasRipple ? __assign(__assign({}, (variantStyles.ripple || {})), (props.android_ripple || {})) : null;
|
|
97
|
+
var disableFeedback = !onPress || noFeedback;
|
|
98
|
+
var _c = (0, utils_1.usePressableFeedback)(_styles, {
|
|
99
|
+
hightlightPropertyIn: 'backgroundColor',
|
|
100
|
+
hightlightPropertyOut: 'backgroundColor',
|
|
101
|
+
disabled: disableFeedback,
|
|
102
|
+
feedbackConfig: variantStyles === null || variantStyles === void 0 ? void 0 : variantStyles.feedback,
|
|
103
|
+
}), rippleConfig = _c.rippleConfig, getFeedbackStyle = _c.getFeedbackStyle;
|
|
114
104
|
var Wrapper = View_1.View;
|
|
115
|
-
|
|
105
|
+
var _d = React.useMemo(function () {
|
|
106
|
+
var wrapperkeys = [
|
|
107
|
+
'margin',
|
|
108
|
+
'alignSelf',
|
|
109
|
+
'border',
|
|
110
|
+
// 'flex!',
|
|
111
|
+
];
|
|
112
|
+
var sharedKeys = [
|
|
113
|
+
'width!',
|
|
114
|
+
'height!',
|
|
115
|
+
'flex!',
|
|
116
|
+
'position!',
|
|
117
|
+
'top!',
|
|
118
|
+
'left!',
|
|
119
|
+
'right!',
|
|
120
|
+
'bottom!',
|
|
121
|
+
];
|
|
122
|
+
var wrapperStyle = {};
|
|
123
|
+
var pressableStyle = {};
|
|
124
|
+
var match = function (k, key) {
|
|
125
|
+
if (k.endsWith('!')) {
|
|
126
|
+
return key === k.substring(0, k.length - 1);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
return key.startsWith(k);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
Object.entries(_styles).forEach(function (_a) {
|
|
133
|
+
var key = _a[0], value = _a[1];
|
|
134
|
+
if (wrapperkeys.some(function (k) { return match(k, key); })) {
|
|
135
|
+
wrapperStyle[key] = value;
|
|
136
|
+
}
|
|
137
|
+
else if (sharedKeys.some(function (k) { return match(k, key); })) {
|
|
138
|
+
wrapperStyle[key] = value;
|
|
139
|
+
pressableStyle[key] = value;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
pressableStyle[key] = value;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
wrapperStyle.overflow = 'hidden';
|
|
146
|
+
// wrapperStyle.flexDirection = 'row'
|
|
147
|
+
// wrapperStyle.alignItems = 'stretch'
|
|
148
|
+
return {
|
|
149
|
+
wrapperStyle: wrapperStyle,
|
|
150
|
+
pressableStyle: pressableStyle,
|
|
151
|
+
};
|
|
152
|
+
}, [JSON.stringify(_styles)]), wrapperStyle = _d.wrapperStyle, pressableStyle = _d.pressableStyle;
|
|
153
|
+
return (<Wrapper style={[wrapperStyle]}>
|
|
116
154
|
<react_native_1.Pressable onPress={press} style={function (_a) {
|
|
117
155
|
var pressed = _a.pressed;
|
|
118
156
|
return ([
|
|
157
|
+
// defaultPressableStyles,
|
|
158
|
+
pressableStyle,
|
|
159
|
+
// !!rippleConfig && ripplePressableStyles,
|
|
119
160
|
getFeedbackStyle(pressed),
|
|
120
|
-
variantStyles.pressable,
|
|
121
|
-
_styles,
|
|
122
|
-
defaultPressableStyles,
|
|
123
161
|
]);
|
|
124
162
|
}} android_ripple={rippleConfig} {...props} ref={ref}>
|
|
125
163
|
{children}
|