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.
Files changed (83) hide show
  1. package/dist/components/AppVersion/index.d.ts +7 -0
  2. package/dist/components/AppVersion/index.js +15 -0
  3. package/dist/components/Button/index.d.ts +18 -0
  4. package/dist/components/Button/index.js +35 -0
  5. package/dist/components/Button/types.d.ts +6 -0
  6. package/dist/components/Button/types.js +2 -0
  7. package/dist/components/Footer/index.d.ts +3 -0
  8. package/dist/components/Footer/index.js +20 -0
  9. package/dist/components/Footer/styles.d.ts +34 -0
  10. package/dist/components/Footer/styles.js +17 -0
  11. package/dist/components/Footer/types.d.ts +4 -0
  12. package/dist/components/Footer/types.js +2 -0
  13. package/dist/components/Icons/index.d.ts +3 -0
  14. package/dist/components/Icons/index.js +64 -0
  15. package/dist/components/Icons/styles.d.ts +9 -0
  16. package/dist/components/Icons/styles.js +16 -0
  17. package/dist/components/Icons/types.d.ts +7 -0
  18. package/dist/components/Icons/types.js +2 -0
  19. package/dist/components/KeyboardWrapper/index.d.ts +3 -0
  20. package/dist/components/KeyboardWrapper/index.js +15 -0
  21. package/dist/components/KeyboardWrapper/types.d.ts +7 -0
  22. package/dist/components/KeyboardWrapper/types.js +2 -0
  23. package/dist/components/Loading/index.d.ts +7 -0
  24. package/dist/components/Loading/index.js +14 -0
  25. package/dist/components/Text/index.d.ts +3 -0
  26. package/dist/components/Text/index.js +60 -0
  27. package/dist/components/Text/types.d.ts +26 -0
  28. package/dist/components/Text/types.js +2 -0
  29. package/dist/components/TextField/index.d.ts +8 -0
  30. package/dist/components/TextField/index.js +48 -0
  31. package/dist/components/TextInput/index.d.ts +3 -0
  32. package/dist/components/TextInput/index.js +145 -0
  33. package/dist/components/TextInput/styles.d.ts +57 -0
  34. package/dist/components/TextInput/styles.js +35 -0
  35. package/dist/components/TextInput/types.d.ts +48 -0
  36. package/dist/components/TextInput/types.js +2 -0
  37. package/dist/components/ThemeProvider/index.d.ts +3 -0
  38. package/dist/components/ThemeProvider/index.js +18 -0
  39. package/dist/components/ThemeProvider/types.d.ts +5 -0
  40. package/dist/components/ThemeProvider/types.js +2 -0
  41. package/dist/components/View/index.d.ts +3 -0
  42. package/dist/components/View/index.js +281 -0
  43. package/dist/components/View/types.d.ts +39 -0
  44. package/dist/components/View/types.js +2 -0
  45. package/dist/components/index.d.ts +10 -0
  46. package/dist/components/index.js +26 -0
  47. package/dist/index.d.ts +4 -0
  48. package/dist/index.js +20 -0
  49. package/dist/themes/colors.d.ts +256 -0
  50. package/dist/themes/colors.js +264 -0
  51. package/dist/themes/dark-theme.d.ts +2 -0
  52. package/dist/themes/dark-theme.js +17 -0
  53. package/dist/themes/default-theme.d.ts +3 -0
  54. package/dist/themes/default-theme.js +45 -0
  55. package/dist/themes/faith-dark-theme.d.ts +2 -0
  56. package/dist/themes/faith-dark-theme.js +17 -0
  57. package/dist/themes/faith-default-theme.d.ts +3 -0
  58. package/dist/themes/faith-default-theme.js +45 -0
  59. package/dist/themes/fonts.d.ts +5 -0
  60. package/dist/themes/fonts.js +53 -0
  61. package/dist/themes/index.d.ts +5 -0
  62. package/dist/themes/index.js +23 -0
  63. package/dist/themes/platform.d.ts +42 -0
  64. package/dist/themes/platform.js +78 -0
  65. package/dist/themes/types.d.ts +80 -0
  66. package/dist/themes/types.js +2 -0
  67. package/dist/themes/use-theme.d.ts +2 -0
  68. package/dist/themes/use-theme.js +22 -0
  69. package/dist/tools/index.d.ts +2 -0
  70. package/dist/tools/index.js +18 -0
  71. package/dist/tools/modal-portal/index.d.ts +9 -0
  72. package/dist/tools/modal-portal/index.js +76 -0
  73. package/dist/tools/modal-portal/services.d.ts +8 -0
  74. package/dist/tools/modal-portal/services.js +26 -0
  75. package/dist/tools/modal-portal/types.d.ts +37 -0
  76. package/dist/tools/modal-portal/types.js +2 -0
  77. package/dist/utils/index.d.ts +2 -0
  78. package/dist/utils/index.js +18 -0
  79. package/dist/utils/methods/index.d.ts +11 -0
  80. package/dist/utils/methods/index.js +21 -0
  81. package/dist/utils/string/index.d.ts +27 -0
  82. package/dist/utils/string/index.js +110 -0
  83. package/package.json +52 -0
@@ -0,0 +1,17 @@
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.FaithDarkTheme = void 0;
7
+ const faith_default_theme_1 = require("./faith-default-theme");
8
+ const fonts_1 = __importDefault(require("./fonts"));
9
+ exports.FaithDarkTheme = {
10
+ ...faith_default_theme_1.FaithDefaultTheme,
11
+ dark: true,
12
+ mode: 'adaptive',
13
+ colors: {
14
+ ...faith_default_theme_1.FaithDefaultTheme.colors,
15
+ },
16
+ fonts: (0, fonts_1.default)(),
17
+ };
@@ -0,0 +1,3 @@
1
+ import { Theme } from './types';
2
+ export declare const FaithDefaultTheme: Theme;
3
+ export type Colors = (typeof FaithDefaultTheme)['colors'];
@@ -0,0 +1,45 @@
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.FaithDefaultTheme = void 0;
7
+ const react_native_paper_1 = require("react-native-paper");
8
+ const colors_1 = require("./colors");
9
+ const fonts_1 = __importDefault(require("./fonts"));
10
+ exports.FaithDefaultTheme = {
11
+ ...react_native_paper_1.MD2LightTheme,
12
+ isV3: false,
13
+ dark: false,
14
+ roundness: 4,
15
+ colors: {
16
+ primary: '#1870D5',
17
+ secondary: '#2A2A2A',
18
+ accent: '#03dac4',
19
+ background: '#ffffff',
20
+ card: '#F6F6F6',
21
+ border: '#D3D3D3',
22
+ surface: colors_1.white,
23
+ error: '#e9342a',
24
+ onSurface: '#000000',
25
+ disabled: '#999999',
26
+ placeholder: '#999999',
27
+ backdrop: 'rgba(0,0,0,0.5)',
28
+ notification: colors_1.pinkA400,
29
+ tooltip: 'rgba(28, 27, 31, 1)',
30
+ modal: 'rgba(0,0,0,0.5)',
31
+ text: '#424242',
32
+ warning: '#ffcc00',
33
+ success: '#60d077',
34
+ white: '#fff',
35
+ black: '#000',
36
+ lightGreen: '#cfffcf',
37
+ blue: '#3378f6',
38
+ royalBlue: '#4169E1',
39
+ ghostWhite: '#F8F8FF',
40
+ },
41
+ fonts: (0, fonts_1.default)(),
42
+ animation: {
43
+ scale: 1.0,
44
+ },
45
+ };
@@ -0,0 +1,5 @@
1
+ import { PlatformOSType } from 'react-native';
2
+ import { Fonts } from './types';
3
+ export default function configureFonts(config?: {
4
+ [platform in PlatformOSType | 'default']?: Fonts;
5
+ }): Fonts;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = configureFonts;
4
+ const react_native_1 = require("react-native");
5
+ const platform_1 = require("./platform");
6
+ const fontConfig = {
7
+ web: {
8
+ regular: {
9
+ fontFamily: platform_1.Platform.fontNames.regular,
10
+ fontWeight: '500',
11
+ },
12
+ medium: {
13
+ fontFamily: platform_1.Platform.fontNames.medium,
14
+ fontWeight: '600',
15
+ },
16
+ bold: {
17
+ fontFamily: platform_1.Platform.fontNames.bold,
18
+ fontWeight: '700',
19
+ },
20
+ },
21
+ ios: {
22
+ regular: {
23
+ fontFamily: platform_1.Platform.fontNames.regular,
24
+ fontWeight: '500',
25
+ },
26
+ medium: {
27
+ fontFamily: platform_1.Platform.fontNames.medium,
28
+ fontWeight: '600',
29
+ },
30
+ bold: {
31
+ fontFamily: platform_1.Platform.fontNames.bold,
32
+ fontWeight: '700',
33
+ },
34
+ },
35
+ default: {
36
+ regular: {
37
+ fontFamily: platform_1.Platform.fontNames.regular,
38
+ fontWeight: '500',
39
+ },
40
+ medium: {
41
+ fontFamily: platform_1.Platform.fontNames.medium,
42
+ fontWeight: '600',
43
+ },
44
+ bold: {
45
+ fontFamily: platform_1.Platform.fontNames.bold,
46
+ fontWeight: '700',
47
+ },
48
+ },
49
+ };
50
+ function configureFonts(config) {
51
+ const fonts = react_native_1.Platform.select({ ...fontConfig, ...config });
52
+ return fonts;
53
+ }
@@ -0,0 +1,5 @@
1
+ export * from './platform';
2
+ export * from './use-theme';
3
+ export * from './default-theme';
4
+ export * from './dark-theme';
5
+ export { FaithDefaultTheme } from './faith-default-theme';
@@ -0,0 +1,23 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.FaithDefaultTheme = void 0;
18
+ __exportStar(require("./platform"), exports);
19
+ __exportStar(require("./use-theme"), exports);
20
+ __exportStar(require("./default-theme"), exports);
21
+ __exportStar(require("./dark-theme"), exports);
22
+ var faith_default_theme_1 = require("./faith-default-theme");
23
+ Object.defineProperty(exports, "FaithDefaultTheme", { enumerable: true, get: function () { return faith_default_theme_1.FaithDefaultTheme; } });
@@ -0,0 +1,42 @@
1
+ import { TextStyle } from 'react-native';
2
+ declare class PBase {
3
+ readonly deviceWidth: number;
4
+ readonly deviceHeight: number;
5
+ readonly screenHeight: number;
6
+ readonly sHeight: number;
7
+ readonly sWidth: number;
8
+ readonly bottomNavigatorBarHeight: number;
9
+ readonly platform: "ios" | "android" | "macos" | "windows" | "web";
10
+ readonly isIOS: boolean;
11
+ readonly isAndroid: boolean;
12
+ readonly isAndroid15: boolean;
13
+ readonly borderWidth: number;
14
+ readonly baseScreenWith = 375;
15
+ readonly baseScreenHeight = 675;
16
+ readonly select: {
17
+ <T>(specifics: ({ [platform in import("react-native").PlatformOSType]?: T; } & {
18
+ default: T;
19
+ }) | { [platform in import("react-native").PlatformOSType]: T; }): T;
20
+ <T>(specifics: { [platform in import("react-native").PlatformOSType]?: T; }): T | undefined;
21
+ };
22
+ readonly pixelRatioVal: number;
23
+ readonly systemNavigationBarHeight: number;
24
+ readonly OS: "ios" | "android" | "macos" | "windows" | "web";
25
+ readonly getPercentRadio: () => number;
26
+ readonly SizeScale: (size?: number) => number;
27
+ readonly marginKeyboard: number;
28
+ readonly SizeScaleHeight: (size?: number) => number;
29
+ readonly SizeScaleWidth: (size?: number) => number;
30
+ readonly headerHeight: number;
31
+ readonly version: string | number;
32
+ readonly fontNames: {
33
+ bold: string;
34
+ medium: string;
35
+ regular: string;
36
+ light: string;
37
+ };
38
+ readonly textBase: TextStyle;
39
+ readonly footerMarginBottom: number;
40
+ }
41
+ export declare const Platform: PBase;
42
+ export {};
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Platform = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const { width, height } = react_native_1.Dimensions.get('window');
6
+ const { height: heightScreen, width: widthScreen } = react_native_1.Dimensions.get('screen');
7
+ class PBase {
8
+ constructor() {
9
+ this.deviceWidth = width;
10
+ this.deviceHeight = height;
11
+ this.screenHeight = heightScreen;
12
+ this.sHeight = react_native_1.Platform.select({
13
+ default: heightScreen,
14
+ android: height - (react_native_1.StatusBar.currentHeight || 24),
15
+ });
16
+ this.sWidth = widthScreen;
17
+ this.bottomNavigatorBarHeight = Math.max(0, heightScreen - (react_native_1.StatusBar.currentHeight || 24) - height);
18
+ this.platform = react_native_1.Platform.OS;
19
+ this.isIOS = react_native_1.Platform.OS === 'ios';
20
+ this.isAndroid = react_native_1.Platform.OS === 'android';
21
+ this.isAndroid15 = react_native_1.Platform.OS === 'android' && react_native_1.Platform.Version === 35;
22
+ this.borderWidth = 1.5 / react_native_1.PixelRatio.getPixelSizeForLayoutSize(1);
23
+ this.baseScreenWith = 375;
24
+ this.baseScreenHeight = 675;
25
+ this.select = react_native_1.Platform.select;
26
+ this.pixelRatioVal = react_native_1.PixelRatio.get();
27
+ this.systemNavigationBarHeight = this.select({
28
+ ios: 0,
29
+ android: heightScreen - height > 0 ? heightScreen - height : 0,
30
+ default: 0,
31
+ });
32
+ this.OS = react_native_1.Platform.OS;
33
+ this.getPercentRadio = () => {
34
+ if (this.pixelRatioVal > 3) {
35
+ return Math.min(3 / this.pixelRatioVal, 0.9);
36
+ }
37
+ return 1;
38
+ };
39
+ this.SizeScale = (size = 12) => {
40
+ const scaleWidth = this.deviceWidth / this.baseScreenWith;
41
+ const scaleHeight = this.deviceHeight / this.baseScreenHeight;
42
+ const scale = Math.min(scaleWidth, scaleHeight);
43
+ // if (this.deviceWidth > 768) {
44
+ // return (this.deviceWidth * size) / this.baseScreenWith;
45
+ // }
46
+ // return PixelRatio.roundToNearestPixel(scale * size);
47
+ // return PixelRatio.roundToNearestPixel(scale * size);
48
+ // return Math.ceil(scale * size);
49
+ return Math.round(scale * size);
50
+ };
51
+ this.marginKeyboard = this.SizeScale(this.select({
52
+ android: -this.bottomNavigatorBarHeight,
53
+ ios: 25,
54
+ }));
55
+ this.SizeScaleHeight = (size = 12) => {
56
+ const scaleHeight = this.deviceHeight / this.baseScreenHeight;
57
+ return react_native_1.PixelRatio.roundToNearestPixel(scaleHeight * size * this.getPercentRadio());
58
+ };
59
+ this.SizeScaleWidth = (size = 12) => {
60
+ const scaleWidth = this.deviceWidth / this.baseScreenHeight;
61
+ return react_native_1.PixelRatio.roundToNearestPixel(scaleWidth * size * this.getPercentRadio());
62
+ };
63
+ this.headerHeight = this.SizeScale(50);
64
+ this.version = react_native_1.Platform.Version;
65
+ this.fontNames = {
66
+ bold: 'SFProDisplay-Bold',
67
+ medium: 'SFProDisplay-Medium',
68
+ regular: 'SFProDisplay-Regular',
69
+ light: 'SFProDisplay-Light',
70
+ };
71
+ this.textBase = {
72
+ fontSize: this.SizeScale(),
73
+ fontFamily: this.fontNames.regular,
74
+ };
75
+ this.footerMarginBottom = this.SizeScale(55);
76
+ }
77
+ }
78
+ exports.Platform = new PBase();
@@ -0,0 +1,80 @@
1
+ import type * as React from 'react';
2
+ export type Font = {
3
+ fontFamily: string;
4
+ fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
5
+ };
6
+ export type Fonts = {
7
+ regular: Font;
8
+ medium: Font;
9
+ light: Font;
10
+ thin: Font;
11
+ };
12
+ type Mode = 'adaptive' | 'exact';
13
+ type Colors = {
14
+ primary: string;
15
+ secondary: string;
16
+ accent: string;
17
+ background: string;
18
+ card: string;
19
+ border: string;
20
+ surface: string;
21
+ error: string;
22
+ onSurface: string;
23
+ disabled: string;
24
+ placeholder: string;
25
+ backdrop: string;
26
+ notification: string;
27
+ tooltip: string;
28
+ modal: string;
29
+ text: string;
30
+ warning: string;
31
+ success: string;
32
+ white: string;
33
+ black: string;
34
+ lightGreen: string;
35
+ blue: string;
36
+ royalBlue: string;
37
+ ghostWhite: string;
38
+ };
39
+ export type Theme = {
40
+ isV3?: boolean;
41
+ dark: boolean;
42
+ mode?: Mode;
43
+ roundness: number;
44
+ colors: Colors;
45
+ fonts: Fonts;
46
+ animation: {
47
+ scale: number;
48
+ };
49
+ };
50
+ export type $Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
51
+ export type $RemoveChildren<T extends React.ComponentType<any>> = $Omit<React.ComponentPropsWithoutRef<T>, 'children'>;
52
+ export type EllipsizeProp = 'head' | 'middle' | 'tail' | 'clip';
53
+ declare global {
54
+ namespace ReactNativePaper {
55
+ interface ThemeFont {
56
+ fontFamily: string;
57
+ fontWeight?: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
58
+ }
59
+ interface ThemeFonts {
60
+ regular: ThemeFont;
61
+ medium: ThemeFont;
62
+ light: ThemeFont;
63
+ thin: ThemeFont;
64
+ }
65
+ interface ThemeColors extends Colors {
66
+ }
67
+ interface ThemeAnimation {
68
+ scale: number;
69
+ }
70
+ interface Theme {
71
+ dark: boolean;
72
+ mode?: Mode;
73
+ roundness: number;
74
+ colors: ThemeColors;
75
+ fonts: ThemeFonts;
76
+ animation: ThemeAnimation;
77
+ }
78
+ }
79
+ }
80
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ import { Theme } from './types';
2
+ export declare const useAppTheme: () => Theme;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useAppTheme = void 0;
4
+ const react_native_1 = require("react-native");
5
+ const react_native_paper_1 = require("react-native-paper");
6
+ const dark_theme_1 = require("./dark-theme");
7
+ const default_theme_1 = require("./default-theme");
8
+ const faith_dark_theme_1 = require("./faith-dark-theme");
9
+ const faith_default_theme_1 = require("./faith-default-theme");
10
+ // import Config from 'react-native-config';
11
+ const useAppTheme = () => {
12
+ // const SYSTEM_THEME = Config.SYSTEM_THEME || 'DEFAULT'
13
+ const SYSTEM_THEME = 'FAITH';
14
+ const isLightTheme = (0, react_native_1.useColorScheme)() === 'light';
15
+ const THEMES = {
16
+ 'FAITH': isLightTheme ? faith_default_theme_1.FaithDefaultTheme : faith_dark_theme_1.FaithDarkTheme,
17
+ 'DEFAULT': isLightTheme ? default_theme_1.DefaultTheme : dark_theme_1.DarkTheme
18
+ };
19
+ const theme = THEMES[SYSTEM_THEME];
20
+ return (0, react_native_paper_1.useTheme)(theme);
21
+ };
22
+ exports.useAppTheme = useAppTheme;
@@ -0,0 +1,2 @@
1
+ export * from './modal-portal';
2
+ export * from './modal-portal/services';
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./modal-portal"), exports);
18
+ __exportStar(require("./modal-portal/services"), exports);
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ModalProps } from './types';
3
+ type ModalsPortal = {
4
+ show: (children: React.ReactNode, ops?: ModalProps) => number;
5
+ dismiss: () => void;
6
+ };
7
+ export declare const _modal: React.RefObject<ModalsPortal | null>;
8
+ export declare const ModalPortal: () => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,76 @@
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.ModalPortal = exports._modal = void 0;
40
+ const react_1 = __importStar(require("react"));
41
+ const react_native_modal_1 = __importDefault(require("react-native-modal"));
42
+ const themes_1 = require("../../themes");
43
+ const EMPTY_JSX = react_1.default.createElement(react_1.default.Fragment, null);
44
+ exports._modal = (0, react_1.createRef)();
45
+ const ModalPortalBase = (0, react_1.forwardRef)((_, ref) => {
46
+ const [content, setContent] = (0, react_1.useState)(EMPTY_JSX);
47
+ const [options, setOptions] = (0, react_1.useState)();
48
+ const [isVisible, setIsVisible] = (0, react_1.useState)(false);
49
+ const onShow = (0, react_1.useCallback)((body, ops) => {
50
+ setOptions(ops);
51
+ setContent(body);
52
+ setTimeout(() => setIsVisible(true), 0);
53
+ }, []);
54
+ const dismiss = () => {
55
+ setIsVisible(false);
56
+ };
57
+ const onModalHide = () => {
58
+ setContent(EMPTY_JSX);
59
+ };
60
+ (0, react_1.useImperativeHandle)(ref, () => {
61
+ return {
62
+ show(body, ops) {
63
+ onShow(body, ops);
64
+ },
65
+ dismiss() {
66
+ dismiss();
67
+ },
68
+ };
69
+ });
70
+ return (react_1.default.createElement(react_1.default.Fragment, null,
71
+ react_1.default.createElement(react_native_modal_1.default, { deviceHeight: themes_1.Platform.screenHeight, statusBarTranslucent: true, isVisible: isVisible, onBackdropPress: dismiss, onModalHide: onModalHide, animationOutTiming: 300, animationInTiming: 300, ...options }, content)));
72
+ });
73
+ const ModalPortal = () => {
74
+ return react_1.default.createElement(ModalPortalBase, { ref: exports._modal });
75
+ };
76
+ exports.ModalPortal = ModalPortal;
@@ -0,0 +1,8 @@
1
+ import { ModalProps } from './types';
2
+ declare class ModalPortalServiceBase {
3
+ private _ref;
4
+ show: (body: React.ReactNode, ops?: ModalProps) => void;
5
+ dismiss: () => void;
6
+ }
7
+ export declare const ModalPortalService: ModalPortalServiceBase;
8
+ export {};
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModalPortalService = void 0;
4
+ const index_1 = require("./index");
5
+ class ModalPortalServiceBase {
6
+ constructor() {
7
+ this._ref = index_1._modal;
8
+ this.show = (body, ops) => {
9
+ var _a;
10
+ if (this._ref.current && typeof ((_a = this._ref.current) === null || _a === void 0 ? void 0 : _a.show) === 'function') {
11
+ this._ref.current.show(body, ops);
12
+ return;
13
+ }
14
+ throw 'Modal Portal unavailable';
15
+ };
16
+ this.dismiss = () => {
17
+ var _a;
18
+ if (this._ref.current && typeof ((_a = this._ref.current) === null || _a === void 0 ? void 0 : _a.dismiss) === 'function') {
19
+ this._ref.current.dismiss();
20
+ return;
21
+ }
22
+ throw 'Modal Portal unavailable';
23
+ };
24
+ }
25
+ }
26
+ exports.ModalPortalService = new ModalPortalServiceBase();
@@ -0,0 +1,37 @@
1
+ import { PanResponderGestureState } from 'react-native';
2
+ import { GestureResponderEvent } from 'react-native-modal';
3
+ import { OrNull } from 'react-native-modal/dist/types';
4
+ export interface ModalProps {
5
+ animationIn?: 'bounce' | 'flash' | 'jello' | 'pulse' | 'rotate' | 'rubberBand' | 'shake' | 'swing' | 'tada' | 'wobble' | 'bounceIn' | 'bounceInDown' | 'bounceInUp' | 'bounceInLeft' | 'bounceInRight' | 'bounceOut' | 'bounceOutDown' | 'bounceOutUp' | 'bounceOutLeft' | 'bounceOutRight' | 'fadeIn' | 'fadeInDown' | 'fadeInDownBig' | 'fadeInUp' | 'fadeInUpBig' | 'fadeInLeft' | 'fadeInLeftBig' | 'fadeInRight' | 'fadeInRightBig' | 'fadeOut' | 'fadeOutDown' | 'fadeOutDownBig' | 'fadeOutUp' | 'fadeOutUpBig' | 'fadeOutLeft' | 'fadeOutLeftBig' | 'fadeOutRight' | 'fadeOutRightBig' | 'flipInX' | 'flipInY' | 'flipOutX' | 'flipOutY' | 'lightSpeedIn' | 'lightSpeedOut' | 'slideInDown' | 'slideInUp' | 'slideInLeft' | 'slideInRight' | 'slideOutDown' | 'slideOutUp' | 'slideOutLeft' | 'slideOutRight' | 'zoomIn' | 'zoomInDown' | 'zoomInUp' | 'zoomInLeft' | 'zoomInRight' | 'zoomOut' | 'zoomOutDown' | 'zoomOutUp' | 'zoomOutLeft' | 'zoomOutRight';
6
+ animationInTiming?: number;
7
+ animationOut?: 'bounce' | 'flash' | 'jello' | 'pulse' | 'rotate' | 'rubberBand' | 'shake' | 'swing' | 'tada' | 'wobble' | 'bounceIn' | 'bounceInDown' | 'bounceInUp' | 'bounceInLeft' | 'bounceInRight' | 'bounceOut' | 'bounceOutDown' | 'bounceOutUp' | 'bounceOutLeft' | 'bounceOutRight' | 'fadeIn' | 'fadeInDown' | 'fadeInDownBig' | 'fadeInUp' | 'fadeInUpBig' | 'fadeInLeft' | 'fadeInLeftBig' | 'fadeInRight' | 'fadeInRightBig' | 'fadeOut' | 'fadeOutDown' | 'fadeOutDownBig' | 'fadeOutUp' | 'fadeOutUpBig' | 'fadeOutLeft' | 'fadeOutLeftBig' | 'fadeOutRight' | 'fadeOutRightBig' | 'flipInX' | 'flipInY' | 'flipOutX' | 'flipOutY' | 'lightSpeedIn' | 'lightSpeedOut' | 'slideInDown' | 'slideInUp' | 'slideInLeft' | 'slideInRight' | 'slideOutDown' | 'slideOutUp' | 'slideOutLeft' | 'slideOutRight' | 'zoomIn' | 'zoomInDown' | 'zoomInUp' | 'zoomInLeft' | 'zoomInRight' | 'zoomOut' | 'zoomOutDown' | 'zoomOutUp' | 'zoomOutLeft' | 'zoomOutRight';
8
+ animationOutTiming?: number;
9
+ avoidKeyboard?: boolean;
10
+ coverScreen?: boolean;
11
+ hasBackdrop?: boolean;
12
+ backdropColor?: string;
13
+ backdropOpacity?: number;
14
+ backdropTransitionInTiming?: number;
15
+ backdropTransitionOutTiming?: number;
16
+ customBackdrop?: React.ReactNode;
17
+ useNativeDriver?: boolean;
18
+ deviceHeight?: number | null;
19
+ deviceWidth?: number | null;
20
+ hideModalContentWhileAnimating?: boolean;
21
+ propagateSwipe?: boolean | ((event: GestureResponderEvent, gestureState: PanResponderGestureState) => boolean);
22
+ isVisible?: boolean;
23
+ panResponderThreshold?: number;
24
+ swipeThreshold?: number;
25
+ onModalShow?: () => void;
26
+ onModalWillShow?: () => void;
27
+ onModalHide?: () => void;
28
+ onModalWillHide?: () => void;
29
+ onBackdropPress?: () => void;
30
+ onBackButtonPress?: () => void;
31
+ scrollTo?: OrNull<(e: any) => void>;
32
+ scrollOffset?: number;
33
+ scrollOffsetMax?: number;
34
+ scrollHorizontal?: boolean;
35
+ statusBarTranslucent?: boolean;
36
+ supportedOrientations?: ('landscape' | 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right')[];
37
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './methods';
2
+ export * from './string';
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./methods"), exports);
18
+ __exportStar(require("./string"), exports);
@@ -0,0 +1,11 @@
1
+ type TypesBase = 'bigint' | 'boolean' | 'function' | 'number' | 'object' | 'string' | 'symbol' | 'undefined';
2
+ export interface IErrorsProps {
3
+ status: number;
4
+ message: string;
5
+ error: any;
6
+ data: any;
7
+ }
8
+ export declare const onCheckType: (source: any, type: TypesBase) => source is TypesBase;
9
+ export declare function capitalizeFirstLetter(str: string): string;
10
+ export declare function handleErrors(error: any): IErrorsProps;
11
+ export {};
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onCheckType = void 0;
4
+ exports.capitalizeFirstLetter = capitalizeFirstLetter;
5
+ exports.handleErrors = handleErrors;
6
+ const onCheckType = (source, type) => {
7
+ return typeof source === type;
8
+ };
9
+ exports.onCheckType = onCheckType;
10
+ function capitalizeFirstLetter(str) {
11
+ return str.charAt(0).toUpperCase() + str.slice(1);
12
+ }
13
+ function handleErrors(error) {
14
+ var _a, _b, _c, _d, _e;
15
+ return {
16
+ status: ((_b = (_a = error === null || error === void 0 ? void 0 : error.data) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.code) || (error === null || error === void 0 ? void 0 : error.status),
17
+ message: ((_d = (_c = error === null || error === void 0 ? void 0 : error.data) === null || _c === void 0 ? void 0 : _c.error) === null || _d === void 0 ? void 0 : _d.message) || (error === null || error === void 0 ? void 0 : error.message) || ((_e = error === null || error === void 0 ? void 0 : error.data) === null || _e === void 0 ? void 0 : _e.message) || 'Something error',
18
+ error: error,
19
+ data: error === null || error === void 0 ? void 0 : error.data,
20
+ };
21
+ }