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,27 @@
|
|
|
1
|
+
export declare const randomUniqueId: () => string;
|
|
2
|
+
export declare const numberWithDot: (x: number | string) => string;
|
|
3
|
+
export declare const regexPassword: RegExp;
|
|
4
|
+
export declare const regexEmail: RegExp;
|
|
5
|
+
export declare const regexPhoneNumber: RegExp;
|
|
6
|
+
export declare function validateCharactersPassword(password: string): boolean;
|
|
7
|
+
export declare function hidePhone(phone: string): string;
|
|
8
|
+
export declare function countDownMinute(count: number): string;
|
|
9
|
+
export declare function getIFrame(url: string, bottom?: number): string;
|
|
10
|
+
export declare function formatDateDisplay({ date: input, formatInput, }: {
|
|
11
|
+
date: string | number | Date;
|
|
12
|
+
formatInput: string;
|
|
13
|
+
}): string;
|
|
14
|
+
export declare function formatTimeDisplay({ time }: {
|
|
15
|
+
time: string;
|
|
16
|
+
}): string;
|
|
17
|
+
export declare function formatTimeCreateOffer({ time }: {
|
|
18
|
+
time: string;
|
|
19
|
+
}): string;
|
|
20
|
+
export declare function formatDateAndCheckToday(date: string): string;
|
|
21
|
+
export declare function formatDistanceToNow(date: string): string;
|
|
22
|
+
export declare function formatDateFromIOSString(date: string): string;
|
|
23
|
+
export declare function splitDate(date: string): string;
|
|
24
|
+
export declare function formatMoney(amount: number, options?: {
|
|
25
|
+
currency?: string;
|
|
26
|
+
locale?: string;
|
|
27
|
+
}): string;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.regexPhoneNumber = exports.regexEmail = exports.regexPassword = exports.numberWithDot = exports.randomUniqueId = void 0;
|
|
4
|
+
exports.validateCharactersPassword = validateCharactersPassword;
|
|
5
|
+
exports.hidePhone = hidePhone;
|
|
6
|
+
exports.countDownMinute = countDownMinute;
|
|
7
|
+
exports.getIFrame = getIFrame;
|
|
8
|
+
exports.formatDateDisplay = formatDateDisplay;
|
|
9
|
+
exports.formatTimeDisplay = formatTimeDisplay;
|
|
10
|
+
exports.formatTimeCreateOffer = formatTimeCreateOffer;
|
|
11
|
+
exports.formatDateAndCheckToday = formatDateAndCheckToday;
|
|
12
|
+
exports.formatDistanceToNow = formatDistanceToNow;
|
|
13
|
+
exports.formatDateFromIOSString = formatDateFromIOSString;
|
|
14
|
+
exports.splitDate = splitDate;
|
|
15
|
+
exports.formatMoney = formatMoney;
|
|
16
|
+
const date_fns_1 = require("date-fns");
|
|
17
|
+
const randomUniqueId = () => {
|
|
18
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
19
|
+
// eslint-disable-next-line no-bitwise
|
|
20
|
+
const r = (Math.random() * 16) | 0,
|
|
21
|
+
// eslint-disable-next-line no-bitwise
|
|
22
|
+
v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
23
|
+
return v.toString(16);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.randomUniqueId = randomUniqueId;
|
|
27
|
+
const numberWithDot = (x) => {
|
|
28
|
+
return x === null || x === void 0 ? void 0 : x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, '.');
|
|
29
|
+
};
|
|
30
|
+
exports.numberWithDot = numberWithDot;
|
|
31
|
+
exports.regexPassword = /^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])/;
|
|
32
|
+
exports.regexEmail = new RegExp(/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/);
|
|
33
|
+
exports.regexPhoneNumber = /(84|0[3|5|7|8|9])+([0-9]{8})\b/gi;
|
|
34
|
+
function validateCharactersPassword(password) {
|
|
35
|
+
return exports.regexPassword.test(password);
|
|
36
|
+
}
|
|
37
|
+
function hidePhone(phone) {
|
|
38
|
+
return phone.slice(0, 3) + phone.slice(3).replace(/.(?=...)/g, '*');
|
|
39
|
+
}
|
|
40
|
+
function countDownMinute(count) {
|
|
41
|
+
let minutes = Math.floor(count / 60);
|
|
42
|
+
let seconds = count % 60;
|
|
43
|
+
return `${minutes.toString().padStart(2, '0')}:${seconds
|
|
44
|
+
.toString()
|
|
45
|
+
.padStart(2, '0')}`;
|
|
46
|
+
}
|
|
47
|
+
function getIFrame(url, bottom) {
|
|
48
|
+
return `<!DOCTYPE html>
|
|
49
|
+
<html>
|
|
50
|
+
<style>
|
|
51
|
+
body {
|
|
52
|
+
padding: 0;
|
|
53
|
+
margin: 0;
|
|
54
|
+
width: 100vw;
|
|
55
|
+
}
|
|
56
|
+
</style>
|
|
57
|
+
<head>
|
|
58
|
+
<title>Page Title</title>
|
|
59
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
60
|
+
</head>
|
|
61
|
+
<iframe style="width: 100vw; height: 100vh; padding-bottom: ${bottom || 0}px;" src=${url} />
|
|
62
|
+
<body>
|
|
63
|
+
|
|
64
|
+
</body>
|
|
65
|
+
|
|
66
|
+
</html>`;
|
|
67
|
+
}
|
|
68
|
+
function formatDateDisplay({ date: input, formatInput, }) {
|
|
69
|
+
if (formatInput && typeof input === 'string') {
|
|
70
|
+
const date = (0, date_fns_1.parse)(input, formatInput, new Date());
|
|
71
|
+
return (0, date_fns_1.format)(date, 'dd/MM/yyyy');
|
|
72
|
+
}
|
|
73
|
+
if (typeof input !== 'string') {
|
|
74
|
+
return (0, date_fns_1.format)(input, 'MM/dd/yyyy');
|
|
75
|
+
}
|
|
76
|
+
return input;
|
|
77
|
+
}
|
|
78
|
+
function formatTimeDisplay({ time }) {
|
|
79
|
+
const timeParsed = (0, date_fns_1.parse)(time, 'HH:mm', new Date());
|
|
80
|
+
return (0, date_fns_1.format)(timeParsed, 'hh:mm a');
|
|
81
|
+
}
|
|
82
|
+
function formatTimeCreateOffer({ time }) {
|
|
83
|
+
const timeParsed = (0, date_fns_1.parse)(time, 'hh:mm a', new Date());
|
|
84
|
+
return (0, date_fns_1.format)(timeParsed, 'HH:mm');
|
|
85
|
+
}
|
|
86
|
+
function formatDateAndCheckToday(date) {
|
|
87
|
+
const parsedDate = (0, date_fns_1.parse)(date, "yyyy-M-dd'T'HH:mm:ss.SSSX", new Date());
|
|
88
|
+
if ((0, date_fns_1.isToday)(parsedDate)) {
|
|
89
|
+
return 'TODAY';
|
|
90
|
+
}
|
|
91
|
+
return (0, date_fns_1.format)(new Date(date), 'dd/MM/yyyy');
|
|
92
|
+
}
|
|
93
|
+
function formatDistanceToNow(date) {
|
|
94
|
+
const parsedDate = (0, date_fns_1.parse)(date, "yyyy-M-dd'T'HH:mm:ss.SSSX", new Date());
|
|
95
|
+
return (0, date_fns_1.formatDistanceToNowStrict)(new Date(parsedDate), { addSuffix: true });
|
|
96
|
+
}
|
|
97
|
+
function formatDateFromIOSString(date) {
|
|
98
|
+
return (0, date_fns_1.format)(new Date(date), 'dd/MM/yyyy');
|
|
99
|
+
}
|
|
100
|
+
function splitDate(date) {
|
|
101
|
+
const dateParts = date.split('-');
|
|
102
|
+
return `${dateParts[2]}-${dateParts[1]}-${dateParts[0]}`;
|
|
103
|
+
}
|
|
104
|
+
function formatMoney(amount, options) {
|
|
105
|
+
const { currency = 'AUD', locale = 'en-AU' } = options || {};
|
|
106
|
+
return (amount || 0).toLocaleString(locale, {
|
|
107
|
+
style: 'currency',
|
|
108
|
+
currency,
|
|
109
|
+
});
|
|
110
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "parousya-shared",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "rimraf dist && tsc",
|
|
7
|
+
"watch": "tsc --watch",
|
|
8
|
+
"prepare": "npm run build"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@types/react": "^19.2.18",
|
|
12
|
+
"@types/react-native": "^0.72.8",
|
|
13
|
+
"date-fns": "^3.6.0",
|
|
14
|
+
"react": "19.0.0",
|
|
15
|
+
"react-hook-form": "^7.54.2",
|
|
16
|
+
"react-native": "0.78.1",
|
|
17
|
+
"react-native-avoid-softinput": "^7.0.1",
|
|
18
|
+
"react-native-modal": "^13.0.1",
|
|
19
|
+
"react-native-paper": "^5.12.3",
|
|
20
|
+
"react-native-safe-area-context": "^5.3.0",
|
|
21
|
+
"rimraf": "^3.0.2",
|
|
22
|
+
"typescript": "^5.0.4"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"date-fns": "*",
|
|
26
|
+
"react": "*",
|
|
27
|
+
"react-hook-form": "*",
|
|
28
|
+
"react-native": "*",
|
|
29
|
+
"react-native-avoid-softinput": "*",
|
|
30
|
+
"react-native-modal": "*",
|
|
31
|
+
"react-native-paper": "*",
|
|
32
|
+
"react-native-safe-area-context": "*"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [],
|
|
35
|
+
"author": "Than Jack",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"types": "dist/index.d.ts",
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=14"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": ""
|
|
47
|
+
},
|
|
48
|
+
"description": "Shared React Native UI components",
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
}
|
|
52
|
+
}
|