parousya-shared 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppVersion/index.d.ts +7 -0
- package/dist/components/AppVersion/index.js +15 -0
- package/dist/components/Button/index.d.ts +18 -0
- package/dist/components/Button/index.js +35 -0
- package/dist/components/Button/types.d.ts +6 -0
- package/dist/components/Button/types.js +2 -0
- package/dist/components/Footer/index.d.ts +3 -0
- package/dist/components/Footer/index.js +20 -0
- package/dist/components/Footer/styles.d.ts +34 -0
- package/dist/components/Footer/styles.js +17 -0
- package/dist/components/Footer/types.d.ts +4 -0
- package/dist/components/Footer/types.js +2 -0
- package/dist/components/Icons/index.d.ts +3 -0
- package/dist/components/Icons/index.js +64 -0
- package/dist/components/Icons/styles.d.ts +9 -0
- package/dist/components/Icons/styles.js +16 -0
- package/dist/components/Icons/types.d.ts +7 -0
- package/dist/components/Icons/types.js +2 -0
- package/dist/components/KeyboardWrapper/index.d.ts +3 -0
- package/dist/components/KeyboardWrapper/index.js +15 -0
- package/dist/components/KeyboardWrapper/types.d.ts +7 -0
- package/dist/components/KeyboardWrapper/types.js +2 -0
- package/dist/components/Loading/index.d.ts +7 -0
- package/dist/components/Loading/index.js +14 -0
- package/dist/components/Text/index.d.ts +3 -0
- package/dist/components/Text/index.js +60 -0
- package/dist/components/Text/types.d.ts +26 -0
- package/dist/components/Text/types.js +2 -0
- package/dist/components/TextField/index.d.ts +8 -0
- package/dist/components/TextField/index.js +48 -0
- package/dist/components/TextInput/index.d.ts +3 -0
- package/dist/components/TextInput/index.js +145 -0
- package/dist/components/TextInput/styles.d.ts +57 -0
- package/dist/components/TextInput/styles.js +35 -0
- package/dist/components/TextInput/types.d.ts +48 -0
- package/dist/components/TextInput/types.js +2 -0
- package/dist/components/ThemeProvider/index.d.ts +3 -0
- package/dist/components/ThemeProvider/index.js +18 -0
- package/dist/components/ThemeProvider/types.d.ts +5 -0
- package/dist/components/ThemeProvider/types.js +2 -0
- package/dist/components/View/index.d.ts +3 -0
- package/dist/components/View/index.js +281 -0
- package/dist/components/View/types.d.ts +39 -0
- package/dist/components/View/types.js +2 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +26 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/themes/colors.d.ts +256 -0
- package/dist/themes/colors.js +264 -0
- package/dist/themes/dark-theme.d.ts +2 -0
- package/dist/themes/dark-theme.js +17 -0
- package/dist/themes/default-theme.d.ts +3 -0
- package/dist/themes/default-theme.js +45 -0
- package/dist/themes/faith-dark-theme.d.ts +2 -0
- package/dist/themes/faith-dark-theme.js +17 -0
- package/dist/themes/faith-default-theme.d.ts +3 -0
- package/dist/themes/faith-default-theme.js +45 -0
- package/dist/themes/fonts.d.ts +5 -0
- package/dist/themes/fonts.js +53 -0
- package/dist/themes/index.d.ts +5 -0
- package/dist/themes/index.js +23 -0
- package/dist/themes/platform.d.ts +42 -0
- package/dist/themes/platform.js +78 -0
- package/dist/themes/types.d.ts +80 -0
- package/dist/themes/types.js +2 -0
- package/dist/themes/use-theme.d.ts +2 -0
- package/dist/themes/use-theme.js +22 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.js +18 -0
- package/dist/tools/modal-portal/index.d.ts +9 -0
- package/dist/tools/modal-portal/index.js +76 -0
- package/dist/tools/modal-portal/services.d.ts +8 -0
- package/dist/tools/modal-portal/services.js +26 -0
- package/dist/tools/modal-portal/types.d.ts +37 -0
- package/dist/tools/modal-portal/types.js +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/methods/index.d.ts +11 -0
- package/dist/utils/methods/index.js +21 -0
- package/dist/utils/string/index.d.ts +27 -0
- package/dist/utils/string/index.js +110 -0
- package/package.json +52 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AppVersion = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_version_info_1 = __importDefault(require("react-native-version-info"));
|
|
9
|
+
const Text_1 = require("../Text");
|
|
10
|
+
const View_1 = require("../View");
|
|
11
|
+
const AppVersion = ({ viewProps, textProps }) => {
|
|
12
|
+
return (react_1.default.createElement(View_1.View, { top: 5, height: 30, justifyContent: "center", alignItems: "center", ...viewProps },
|
|
13
|
+
react_1.default.createElement(Text_1.Text, { color: "text", size: 13, lineHeight: 16, ...textProps }, `Version: ${react_native_version_info_1.default.appVersion} (${react_native_version_info_1.default.buildVersion})`)));
|
|
14
|
+
};
|
|
15
|
+
exports.AppVersion = AppVersion;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
import { IViewProps } from '../View/types';
|
|
4
|
+
import { TextProps } from '../Text/types';
|
|
5
|
+
export declare const Button: ({ children, mode, style, disabled, loading, containerProps, onPressIn, textProps, icon, iconSize, ...props }: {
|
|
6
|
+
children: string;
|
|
7
|
+
mode?: "text" | "contained" | "outlined" | "elevated" | "contained-tonal";
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
onPressIn?: () => void;
|
|
10
|
+
uppercase?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
icon?: string;
|
|
14
|
+
style?: StyleProp<ViewStyle>;
|
|
15
|
+
containerProps?: IViewProps;
|
|
16
|
+
textProps?: Omit<TextProps, "children">;
|
|
17
|
+
iconSize?: number;
|
|
18
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Button = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_native_paper_1 = require("react-native-paper");
|
|
10
|
+
const Text_1 = require("../Text");
|
|
11
|
+
const themes_1 = require("../../themes");
|
|
12
|
+
const View_1 = require("../View");
|
|
13
|
+
const Icons_1 = require("../Icons");
|
|
14
|
+
const Button = ({ children, mode = 'contained', style, disabled, loading, containerProps, onPressIn, textProps, icon, iconSize, ...props }) => {
|
|
15
|
+
const { colors } = (0, themes_1.useAppTheme)();
|
|
16
|
+
const { color: customLabelColor } = react_native_1.StyleSheet.flatten(textProps) || {};
|
|
17
|
+
return (react_1.default.createElement(react_native_paper_1.Button, { mode: mode, uppercase: false, disabled: disabled || loading,
|
|
18
|
+
// labelStyle={{marginVertical: 0}}
|
|
19
|
+
// loading={loading}
|
|
20
|
+
onPressIn: onPressIn, style: [
|
|
21
|
+
{
|
|
22
|
+
borderRadius: 8,
|
|
23
|
+
backgroundColor: colors.primary,
|
|
24
|
+
opacity: (disabled || loading) ? 0.5 : 1,
|
|
25
|
+
},
|
|
26
|
+
style,
|
|
27
|
+
], ...props },
|
|
28
|
+
react_1.default.createElement(View_1.View, { row: true, width: "none", padVertical: 2, alignItems: "center", justifyContent: "center", ...containerProps },
|
|
29
|
+
icon && loading !== true ? (react_1.default.createElement(View_1.View, { width: "none", right: 12 },
|
|
30
|
+
react_1.default.createElement(Icons_1.Icons, { name: icon, size: iconSize || 20, color: customLabelColor || 'white' }))) : null,
|
|
31
|
+
loading ? (react_1.default.createElement(View_1.View, { width: "none", right: 12 },
|
|
32
|
+
react_1.default.createElement(react_native_1.ActivityIndicator, { size: 14, animating: true, color: customLabelColor || colors.white }))) : (react_1.default.createElement(react_1.default.Fragment, null)),
|
|
33
|
+
react_1.default.createElement(Text_1.Text, { color: "white", size: 14, medium: true, ...textProps }, children))));
|
|
34
|
+
};
|
|
35
|
+
exports.Button = Button;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Footer = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const View_1 = require("../View");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
const themes_1 = require("../../themes");
|
|
11
|
+
const Footer = ({ children, height, ...rest }) => {
|
|
12
|
+
const { insets } = (0, styles_1.useFooterStyles)();
|
|
13
|
+
return (react_1.default.createElement(View_1.View, { width: "100%", padTop: 10, style: {
|
|
14
|
+
height: insets.bottom +
|
|
15
|
+
(typeof height === 'number'
|
|
16
|
+
? themes_1.Platform.SizeScale(height)
|
|
17
|
+
: themes_1.Platform.SizeScale(70)),
|
|
18
|
+
}, ...rest }, children || react_1.default.createElement(react_1.default.Fragment, null)));
|
|
19
|
+
};
|
|
20
|
+
exports.Footer = Footer;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const useFooterStyles: () => {
|
|
2
|
+
styles: {
|
|
3
|
+
container: {
|
|
4
|
+
height: number;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
colors: {
|
|
8
|
+
primary: string;
|
|
9
|
+
secondary: string;
|
|
10
|
+
accent: string;
|
|
11
|
+
background: string;
|
|
12
|
+
card: string;
|
|
13
|
+
border: string;
|
|
14
|
+
surface: string;
|
|
15
|
+
error: string;
|
|
16
|
+
onSurface: string;
|
|
17
|
+
disabled: string;
|
|
18
|
+
placeholder: string;
|
|
19
|
+
backdrop: string;
|
|
20
|
+
notification: string;
|
|
21
|
+
tooltip: string;
|
|
22
|
+
modal: string;
|
|
23
|
+
text: string;
|
|
24
|
+
warning: string;
|
|
25
|
+
success: string;
|
|
26
|
+
white: string;
|
|
27
|
+
black: string;
|
|
28
|
+
lightGreen: string;
|
|
29
|
+
blue: string;
|
|
30
|
+
royalBlue: string;
|
|
31
|
+
ghostWhite: string;
|
|
32
|
+
};
|
|
33
|
+
insets: import("react-native-safe-area-context").EdgeInsets;
|
|
34
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFooterStyles = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
|
+
const themes_1 = require("../../themes");
|
|
7
|
+
const useFooterStyles = () => {
|
|
8
|
+
const { colors } = (0, themes_1.useAppTheme)();
|
|
9
|
+
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
10
|
+
const styles = react_native_1.StyleSheet.create({
|
|
11
|
+
container: {
|
|
12
|
+
height: themes_1.Platform.SizeScale(100),
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
return { styles, colors, insets };
|
|
16
|
+
};
|
|
17
|
+
exports.useFooterStyles = useFooterStyles;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.Icons = void 0;
|
|
40
|
+
const react_1 = __importStar(require("react"));
|
|
41
|
+
const AntDesign_1 = __importDefault(require("@expo/vector-icons/AntDesign"));
|
|
42
|
+
const Entypo_1 = __importDefault(require("@expo/vector-icons/Entypo"));
|
|
43
|
+
const Feather_1 = __importDefault(require("@expo/vector-icons/Feather"));
|
|
44
|
+
const Ionicons_1 = __importDefault(require("@expo/vector-icons/Ionicons"));
|
|
45
|
+
const MaterialIcons_1 = __importDefault(require("@expo/vector-icons/MaterialIcons"));
|
|
46
|
+
const FontAwesome6_1 = __importDefault(require("@expo/vector-icons/FontAwesome6"));
|
|
47
|
+
const themes_1 = require("../../themes");
|
|
48
|
+
const ObjPackage = {
|
|
49
|
+
MaterialIcons: MaterialIcons_1.default,
|
|
50
|
+
AntDesign: AntDesign_1.default,
|
|
51
|
+
Feather: Feather_1.default,
|
|
52
|
+
Entypo: Entypo_1.default,
|
|
53
|
+
Ionicons: Ionicons_1.default,
|
|
54
|
+
FontAwesome6: FontAwesome6_1.default,
|
|
55
|
+
};
|
|
56
|
+
const Icons = ({ name, size = 20, color = 'black', packageName = 'MaterialIcons', }) => {
|
|
57
|
+
const { colors } = (0, themes_1.useAppTheme)();
|
|
58
|
+
const renderIcon = (0, react_1.useMemo)(() => {
|
|
59
|
+
const IconElement = ObjPackage[packageName];
|
|
60
|
+
return react_1.default.createElement(IconElement, { name, size, color: colors[color] });
|
|
61
|
+
}, [color, colors, name, packageName, size]);
|
|
62
|
+
return renderIcon;
|
|
63
|
+
};
|
|
64
|
+
exports.Icons = Icons;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIconsStyles = void 0;
|
|
4
|
+
const react_native_1 = require("react-native");
|
|
5
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
|
+
const useIconsStyles = () => {
|
|
7
|
+
const insets = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
8
|
+
const styles = react_native_1.StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
flex: 1,
|
|
11
|
+
marginTop: insets.top,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
return { styles, insets };
|
|
15
|
+
};
|
|
16
|
+
exports.useIconsStyles = useIconsStyles;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.KeyboardWrapper = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const react_native_avoid_softinput_1 = require("react-native-avoid-softinput");
|
|
10
|
+
const EMPTY_ACTION = () => true;
|
|
11
|
+
const KeyboardWrapper = ({ children, avoidOffset, disableAutoHideKeyboard, }) => {
|
|
12
|
+
return (react_1.default.createElement(react_native_1.View, { style: { flex: 1, width: '100%' }, onResponderGrant: disableAutoHideKeyboard ? undefined : react_native_1.Keyboard.dismiss, onStartShouldSetResponder: disableAutoHideKeyboard ? undefined : EMPTY_ACTION },
|
|
13
|
+
react_1.default.createElement(react_native_avoid_softinput_1.AvoidSoftInputView, { avoidOffset: avoidOffset !== null && avoidOffset !== void 0 ? avoidOffset : 10, easing: "easeIn", style: [{ flex: 1 }], showAnimationDuration: 200 }, children)));
|
|
14
|
+
};
|
|
15
|
+
exports.KeyboardWrapper = KeyboardWrapper;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Loading = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const themes_1 = require("../../themes");
|
|
10
|
+
const Loading = ({ color = 'primary', size = 'small', top = 0, }) => {
|
|
11
|
+
const { colors } = (0, themes_1.useAppTheme)();
|
|
12
|
+
return (react_1.default.createElement(react_native_1.ActivityIndicator, { size: size, color: colors[color], style: { marginTop: themes_1.Platform.SizeScale(top) } }));
|
|
13
|
+
};
|
|
14
|
+
exports.Loading = Loading;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TextProps } from './types';
|
|
3
|
+
export declare const Text: ({ children, txOptions, style, allowFontScaling, color, size, centerAlign, rightAlign, lineHeight, bold, medium, semibold, regular, textTransform, maxWidth, top, left, bottom, right, disableTranslate, underline, width, ...other }: TextProps) => React.JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Text = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const react_native_1 = require("react-native");
|
|
9
|
+
const themes_1 = require("../../themes");
|
|
10
|
+
const Text = ({ children, txOptions, style, allowFontScaling = false, color, size = 13, centerAlign, rightAlign, lineHeight, bold, medium, semibold, regular, textTransform, maxWidth, top, left, bottom, right, disableTranslate = false, underline = false, width, ...other }) => {
|
|
11
|
+
const { colors } = (0, themes_1.useAppTheme)();
|
|
12
|
+
const textStyle = [];
|
|
13
|
+
textStyle.push({ color: color ? colors[color] : colors.text });
|
|
14
|
+
size && textStyle.push({ fontSize: themes_1.Platform.SizeScale(size) });
|
|
15
|
+
centerAlign && textStyle.push({ textAlign: 'center' });
|
|
16
|
+
rightAlign && textStyle.push({ textAlign: 'right' });
|
|
17
|
+
textTransform && textStyle.push({ textTransform: 'uppercase' });
|
|
18
|
+
maxWidth && textStyle.push({ maxWidth: themes_1.Platform.SizeScale(maxWidth) });
|
|
19
|
+
top && textStyle.push({ marginTop: themes_1.Platform.SizeScale(top) });
|
|
20
|
+
bottom && textStyle.push({ marginBottom: themes_1.Platform.SizeScale(bottom) });
|
|
21
|
+
left && textStyle.push({ marginLeft: themes_1.Platform.SizeScale(left) });
|
|
22
|
+
right && textStyle.push({ marginRight: themes_1.Platform.SizeScale(right) });
|
|
23
|
+
width && textStyle.push({ width: themes_1.Platform.SizeScale(width) });
|
|
24
|
+
underline && textStyle.push({ textDecorationLine: 'underline' });
|
|
25
|
+
/* font weight */
|
|
26
|
+
if (regular) {
|
|
27
|
+
textStyle.push({
|
|
28
|
+
fontFamily: themes_1.Platform.fontNames.regular,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
else if (bold) {
|
|
32
|
+
textStyle.push({
|
|
33
|
+
fontFamily: themes_1.Platform.fontNames.bold,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
else if (medium) {
|
|
37
|
+
textStyle.push({
|
|
38
|
+
fontFamily: themes_1.Platform.fontNames.medium,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else if (semibold) {
|
|
42
|
+
textStyle.push({
|
|
43
|
+
fontFamily: themes_1.Platform.fontNames.medium,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
textStyle.push({
|
|
48
|
+
fontFamily: themes_1.Platform.fontNames.medium,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (lineHeight) {
|
|
52
|
+
textStyle.push({ lineHeight: themes_1.Platform.SizeScale(lineHeight) });
|
|
53
|
+
}
|
|
54
|
+
/* custom style */
|
|
55
|
+
if (style) {
|
|
56
|
+
textStyle.push(style);
|
|
57
|
+
}
|
|
58
|
+
return (react_1.default.createElement(react_native_1.Text, { style: react_native_1.StyleSheet.flatten(textStyle), allowFontScaling, ...other }, children));
|
|
59
|
+
};
|
|
60
|
+
exports.Text = Text;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextProps as TextPropsBase, TextStyle } from 'react-native';
|
|
3
|
+
import { Colors } from '../../themes';
|
|
4
|
+
export type TextProps = TextPropsBase & {
|
|
5
|
+
children: ReactNode | string;
|
|
6
|
+
size?: number;
|
|
7
|
+
color?: keyof Colors;
|
|
8
|
+
centerAlign?: boolean;
|
|
9
|
+
lineHeight?: number;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
top?: number;
|
|
12
|
+
left?: number;
|
|
13
|
+
bottom?: number;
|
|
14
|
+
right?: number;
|
|
15
|
+
rightAlign?: boolean;
|
|
16
|
+
regular?: boolean;
|
|
17
|
+
bold?: boolean;
|
|
18
|
+
medium?: boolean;
|
|
19
|
+
semibold?: boolean;
|
|
20
|
+
width?: number;
|
|
21
|
+
disableTranslate?: boolean;
|
|
22
|
+
style?: TextStyle;
|
|
23
|
+
textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase';
|
|
24
|
+
txOptions?: any;
|
|
25
|
+
underline?: boolean;
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Control } from 'react-hook-form';
|
|
3
|
+
import { TextInputProps } from 'react-native';
|
|
4
|
+
export interface ITextFieldProps extends TextInputProps {
|
|
5
|
+
control?: Control<any, any>;
|
|
6
|
+
name?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TextField: (props: ITextFieldProps) => React.JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TextField = void 0;
|
|
37
|
+
const react_1 = __importStar(require("react"));
|
|
38
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
39
|
+
const react_native_1 = require("react-native");
|
|
40
|
+
const TextField = (props) => {
|
|
41
|
+
const { control, name, secureTextEntry, ...rest } = props;
|
|
42
|
+
const renderUIController = (0, react_1.useCallback)(({ field: { onChange, onBlur } }) => (react_1.default.createElement(react_native_1.TextInput, { onBlur: onBlur, onChangeText: onChange, secureTextEntry: secureTextEntry, ...(secureTextEntry ? { textContentType: 'oneTimeCode' } : {}), autoCorrect: false, autoCapitalize: 'none', ...rest })), [rest, secureTextEntry]);
|
|
43
|
+
if (!control && !name) {
|
|
44
|
+
return react_1.default.createElement(react_native_1.TextInput, { secureTextEntry: secureTextEntry, ...rest });
|
|
45
|
+
}
|
|
46
|
+
return (react_1.default.createElement(react_hook_form_1.Controller, { control: control, name: name, render: renderUIController }));
|
|
47
|
+
};
|
|
48
|
+
exports.TextField = TextField;
|