koylu-vampir-design 1.0.39 → 1.0.40
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
2
|
declare type AlertOptionsType = {
|
|
3
3
|
title?: string;
|
|
4
4
|
onAccept?: (any: any) => void;
|
|
@@ -9,7 +9,7 @@ declare type AlertOptionsType = {
|
|
|
9
9
|
acceptType?: string;
|
|
10
10
|
cancelText?: string;
|
|
11
11
|
cancelType?: string;
|
|
12
|
-
description?: string;
|
|
12
|
+
description?: string | ReactElement;
|
|
13
13
|
};
|
|
14
14
|
declare type AlertProp = {
|
|
15
15
|
showAlert: (message?: any, options?: AlertOptionsType) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertProvider.d.ts","sourceRoot":"","sources":["../../src/Alerts/AlertProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AlertProvider.d.ts","sourceRoot":"","sources":["../../src/Alerts/AlertProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAO5C,aAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,GAAG,KAAA,KAAK,IAAI,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;CACrC,CAAC;AAEF,aAAK,SAAS,GAAG;IACf,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/D,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,CACZ,OAAO,CAAC,EAAE,GAAG,EACb,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,gBAAgB,KACvB,OAAO,CAAC,GAAG,CAAC,CAAC;IAClB,UAAU,CAAC,EAAE,CACX,OAAO,CAAC,EAAE,GAAG,EACb,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,EAClB,OAAO,CAAC,EAAE,gBAAgB,KACvB,OAAO,CAAC,GAAG,CAAC,CAAC;IAClB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAIF,eAAO,MAAM,YAAY,0BAGvB,CAAC;AAEH,eAAO,MAAM,QAAQ,iBAAuC,CAAC;AAC7D,aAAK,UAAU,GAAG,EAAE,CAAC;AAErB,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAsF9C,CAAC"}
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.AlertProvider = exports.useAlert = exports.AlertContext = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const react_native_1 = require("react-native");
|
|
9
|
+
const Utils_1 = require("../Utils");
|
|
9
10
|
const AlertContent_1 = require("./AlertContent");
|
|
10
11
|
const AlertQuestionContent_1 = require("./AlertQuestionContent");
|
|
11
12
|
const AlertSelectContent_1 = require("./AlertSelectContent");
|
|
12
|
-
const Utils_1 = require("../Utils");
|
|
13
13
|
const MODAL_PRESENTATION_STYLE = "pageSheet";
|
|
14
14
|
exports.AlertContext = react_1.default.createContext({
|
|
15
15
|
showAlert: () => { },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertQuestionContent.d.ts","sourceRoot":"","sources":["../../src/Alerts/AlertQuestionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"AlertQuestionContent.d.ts","sourceRoot":"","sources":["../../src/Alerts/AlertQuestionContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAIL,SAAS,EAIV,MAAM,cAAc,CAAC;AAOtB,aAAK,KAAK,GAAG;IACX,KAAK,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA6DhD,CAAC"}
|
|
@@ -22,12 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.AlertQuestionContent = void 0;
|
|
23
23
|
const react_1 = __importStar(require("react"));
|
|
24
24
|
const react_native_1 = require("react-native");
|
|
25
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
25
26
|
const __1 = require("../");
|
|
26
27
|
const Themes_1 = require("../Themes");
|
|
27
|
-
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
28
28
|
const AlertButtons_1 = require("./AlertButtons");
|
|
29
29
|
const AlertTitle_1 = require("./AlertTitle");
|
|
30
|
-
const AlertQuestionContent = ({ style, background, options, children }) => {
|
|
30
|
+
const AlertQuestionContent = ({ style, background, options, children, }) => {
|
|
31
31
|
const { baseBackgroundColor, dimBackgroundColorTransparent, baseTextColor } = Themes_1.useColors();
|
|
32
32
|
const [input, setInput] = react_1.useState(options.currentValue || "");
|
|
33
33
|
const insets = react_native_safe_area_context_1.useSafeAreaInsets();
|
|
@@ -36,12 +36,18 @@ const AlertQuestionContent = ({ style, background, options, children }) => {
|
|
|
36
36
|
react_1.default.createElement(react_native_1.View, { style: [styles.base, style] },
|
|
37
37
|
react_1.default.createElement(react_native_1.View, { style: [
|
|
38
38
|
styles.background,
|
|
39
|
-
{ backgroundColor: color, paddingBottom: insets.bottom + 10 }
|
|
39
|
+
{ backgroundColor: color, paddingBottom: insets.bottom + 10 },
|
|
40
40
|
] },
|
|
41
41
|
react_1.default.createElement(react_native_1.View, { style: styles.message },
|
|
42
42
|
typeof children === "string" && (react_1.default.createElement(__1.Typography, { style: styles.messageText, size: children.length < 100 ? 16 : 14 }, children)),
|
|
43
|
-
react_1.default.createElement(react_native_1.TextInput, { autoCorrect: false, autoCapitalize: "none", style: [
|
|
44
|
-
|
|
43
|
+
react_1.default.createElement(react_native_1.TextInput, { autoCorrect: false, autoCapitalize: "none", style: [
|
|
44
|
+
styles.input,
|
|
45
|
+
{
|
|
46
|
+
backgroundColor: dimBackgroundColorTransparent,
|
|
47
|
+
color: baseTextColor,
|
|
48
|
+
},
|
|
49
|
+
], value: input, onChangeText: setInput }),
|
|
50
|
+
typeof options.description === "string" ? (react_1.default.createElement(__1.Typography, { style: styles.messageText }, options.description)) : (options.description)),
|
|
45
51
|
react_1.default.createElement(AlertButtons_1.AlertButtons, { options: options, payload: input })),
|
|
46
52
|
!!options.title && react_1.default.createElement(AlertTitle_1.AlertTitle, { options: options }))));
|
|
47
53
|
};
|
|
@@ -50,26 +56,26 @@ const { height } = react_native_1.Dimensions.get("window");
|
|
|
50
56
|
const isMiniDevice = height < 600;
|
|
51
57
|
const styles = react_native_1.StyleSheet.create({
|
|
52
58
|
base: {
|
|
53
|
-
marginTop: "auto"
|
|
59
|
+
marginTop: "auto",
|
|
54
60
|
},
|
|
55
61
|
keyboardView: {
|
|
56
|
-
flex: 1
|
|
62
|
+
flex: 1,
|
|
57
63
|
},
|
|
58
64
|
background: {
|
|
59
65
|
position: "relative",
|
|
60
66
|
padding: 32,
|
|
61
67
|
borderTopLeftRadius: 32,
|
|
62
|
-
borderTopRightRadius: 32
|
|
68
|
+
borderTopRightRadius: 32,
|
|
63
69
|
},
|
|
64
70
|
message: {
|
|
65
71
|
width: "100%",
|
|
66
72
|
padding: 0,
|
|
67
73
|
paddingVertical: 20,
|
|
68
74
|
minHeight: 100,
|
|
69
|
-
marginBottom: 20
|
|
75
|
+
marginBottom: 20,
|
|
70
76
|
},
|
|
71
77
|
messageText: {
|
|
72
|
-
width: "100%"
|
|
78
|
+
width: "100%",
|
|
73
79
|
},
|
|
74
80
|
input: {
|
|
75
81
|
minWidth: "100%",
|
|
@@ -80,6 +86,6 @@ const styles = react_native_1.StyleSheet.create({
|
|
|
80
86
|
borderRadius: 8,
|
|
81
87
|
paddingHorizontal: 16,
|
|
82
88
|
marginTop: 15,
|
|
83
|
-
marginBottom: 15
|
|
84
|
-
}
|
|
89
|
+
marginBottom: 15,
|
|
90
|
+
},
|
|
85
91
|
});
|