ota-components-module 1.3.0 → 1.3.2

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 (55) hide show
  1. package/lib/button/ThemedButton.d.ts +19 -0
  2. package/lib/button/ThemedButton.js +73 -0
  3. package/lib/feedback/ActivityLoader.d.ts +12 -0
  4. package/lib/feedback/ActivityLoader.js +65 -0
  5. package/lib/feedback/CustomAlert.d.ts +20 -0
  6. package/lib/feedback/CustomAlert.js +96 -0
  7. package/lib/feedback/DeleteImageConfirmationDialog.d.ts +16 -0
  8. package/lib/feedback/DeleteImageConfirmationDialog.js +19 -0
  9. package/lib/feedback/ProgressBar.d.ts +15 -0
  10. package/lib/feedback/ProgressBar.js +34 -0
  11. package/lib/image/ImagePickerBottomSheet.d.ts +10 -0
  12. package/lib/image/ImagePickerBottomSheet.js +31 -0
  13. package/lib/image/ImagePickerView.d.ts +11 -0
  14. package/lib/image/ImagePickerView.js +65 -0
  15. package/lib/image/MultipleImagePreview.d.ts +33 -0
  16. package/lib/image/MultipleImagePreview.js +332 -0
  17. package/lib/image/StackedImage.d.ts +11 -0
  18. package/lib/image/StackedImage.js +122 -0
  19. package/lib/index.d.ts +25 -0
  20. package/lib/index.js +56 -0
  21. package/lib/input/CustomDropdown.d.ts +40 -0
  22. package/lib/input/CustomDropdown.js +71 -0
  23. package/lib/input/CustomInput.d.ts +17 -0
  24. package/lib/input/CustomInput.js +47 -0
  25. package/lib/input/FormField.d.ts +31 -0
  26. package/lib/input/FormField.js +250 -0
  27. package/lib/input/KeyboardScrollView.d.ts +7 -0
  28. package/lib/input/KeyboardScrollView.js +96 -0
  29. package/lib/input/SearchViewInput.d.ts +59 -0
  30. package/lib/input/SearchViewInput.js +80 -0
  31. package/lib/layout/BottomSheetDialog.d.ts +5 -0
  32. package/lib/layout/BottomSheetDialog.js +156 -0
  33. package/lib/layout/BottomTwoButtonLayoutComponent.d.ts +26 -0
  34. package/lib/layout/BottomTwoButtonLayoutComponent.js +81 -0
  35. package/lib/layout/CardView.d.ts +24 -0
  36. package/lib/layout/CardView.js +79 -0
  37. package/lib/layout/PropertyHeaderComponent.d.ts +34 -0
  38. package/lib/layout/PropertyHeaderComponent.js +63 -0
  39. package/lib/list/SearchableList.d.ts +50 -0
  40. package/lib/list/SearchableList.js +143 -0
  41. package/lib/models/PropertyImage.d.ts +11 -0
  42. package/lib/models/PropertyImage.js +22 -0
  43. package/lib/typography/Label.d.ts +26 -0
  44. package/lib/typography/Label.js +147 -0
  45. package/lib/utils/BaseStyle.d.ts +31 -0
  46. package/lib/utils/BaseStyle.js +42 -0
  47. package/lib/utils/Strings.d.ts +1 -0
  48. package/lib/utils/Strings.js +4 -0
  49. package/lib/utils/TextConstants.d.ts +23 -0
  50. package/lib/utils/TextConstants.js +28 -0
  51. package/lib/utils/Utils.d.ts +5 -0
  52. package/lib/utils/Utils.js +12 -0
  53. package/lib/webbaseview/WebBaseView.d.ts +8 -0
  54. package/lib/webbaseview/WebBaseView.js +28 -0
  55. package/package.json +9 -9
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ViewStyle, TextStyle } from 'react-native';
3
+ export type ButtonType = 'primary' | 'secondary';
4
+ export type ButtonSize = 'small' | 'regular';
5
+ export type ButtonProps = {
6
+ testID?: string;
7
+ title: string;
8
+ onPress: () => void;
9
+ type?: ButtonType;
10
+ size?: ButtonSize;
11
+ disabled?: boolean;
12
+ style?: ViewStyle;
13
+ textstyle?: TextStyle;
14
+ primaryColor?: string;
15
+ backgroundColor?: string;
16
+ disabledColor?: string;
17
+ };
18
+ declare const ThemedButton: React.FC<ButtonProps>;
19
+ export default ThemedButton;
@@ -0,0 +1,73 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var react_1 = require("react");
15
+ var react_native_1 = require("react-native");
16
+ var BaseStyle_1 = require("../utils/BaseStyle");
17
+ var Label_1 = require("../typography/Label");
18
+ var TextConstants_1 = require("../utils/TextConstants");
19
+ var ThemedButton = function (_a) {
20
+ var testID = _a.testID, title = _a.title, onPress = _a.onPress, _b = _a.type, type = _b === void 0 ? 'primary' : _b, _c = _a.size, size = _c === void 0 ? 'regular' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, style = _a.style, textstyle = _a.textstyle, _e = _a.primaryColor, primaryColor = _e === void 0 ? BaseStyle_1.Colors.lightThemePrimaryColor : _e, _f = _a.backgroundColor, backgroundColor = _f === void 0 ? '#FFFFFF' : _f, _g = _a.disabledColor, disabledColor = _g === void 0 ? '#B8D8E8' : _g;
21
+ var getButtonStyle = function () {
22
+ var baseStyle = {
23
+ borderRadius: 30, // Rounded corners as shown in the image
24
+ alignItems: 'center',
25
+ justifyContent: 'center',
26
+ borderWidth: type === 'secondary' ? 2 : 0,
27
+ borderColor: primaryColor,
28
+ height: 50
29
+ };
30
+ // Size variations
31
+ var sizeStyles = {
32
+ small: {
33
+ paddingVertical: 6,
34
+ paddingHorizontal: 16,
35
+ minWidth: 80,
36
+ },
37
+ regular: {
38
+ paddingVertical: 12,
39
+ paddingHorizontal: 24,
40
+ minWidth: 120,
41
+ },
42
+ };
43
+ // Type variations
44
+ var typeStyles = {
45
+ primary: {
46
+ backgroundColor: disabled ? disabledColor : primaryColor, // Lighter blue when disabled
47
+ },
48
+ secondary: {
49
+ backgroundColor: 'transparent',
50
+ },
51
+ };
52
+ return __assign(__assign(__assign(__assign({}, baseStyle), sizeStyles[size]), typeStyles[type]), style);
53
+ };
54
+ var getTextStyle = function () {
55
+ var baseStyle = {
56
+ textAlign: 'center',
57
+ };
58
+ // Type variations
59
+ var typeStyles = {
60
+ primary: {
61
+ color: backgroundColor,
62
+ },
63
+ secondary: {
64
+ color: primaryColor,
65
+ },
66
+ };
67
+ return __assign(__assign(__assign({}, baseStyle), typeStyles[type]), textstyle);
68
+ };
69
+ return (<react_native_1.TouchableOpacity testID={testID} style={getButtonStyle()} onPress={onPress} disabled={disabled} activeOpacity={0.7}>
70
+ <Label_1.default text={title} size={size === 'small' ? TextConstants_1.TextSize.SMALL : TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.SEMI_BOLD} customStyle={getTextStyle()}/>
71
+ </react_native_1.TouchableOpacity>);
72
+ };
73
+ exports.default = ThemedButton;
@@ -0,0 +1,12 @@
1
+ interface ActivityLoaderProps {
2
+ loading?: boolean;
3
+ message?: string;
4
+ backgroundColor?: string;
5
+ textColor?: string;
6
+ shadowColor?: string;
7
+ }
8
+ /**
9
+ * A loading indicator component that displays a spinner and optional message
10
+ */
11
+ declare const ActivityLoader: React.FC<ActivityLoaderProps>;
12
+ export default ActivityLoader;
@@ -0,0 +1,65 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var react_native_1 = require("react-native");
15
+ var BaseStyle_1 = require("../utils/BaseStyle");
16
+ var Label_1 = require("../typography/Label");
17
+ var TextConstants_1 = require("../utils/TextConstants");
18
+ /**
19
+ * A loading indicator component that displays a spinner and optional message
20
+ */
21
+ var ActivityLoader = function (_a) {
22
+ var _b = _a.loading, loading = _b === void 0 ? true : _b, _c = _a.message, message = _c === void 0 ? "Loading..." : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? BaseStyle_1.Colors.whiteColor : _d, _e = _a.textColor, textColor = _e === void 0 ? BaseStyle_1.Colors.textBlack : _e, _f = _a.shadowColor, shadowColor = _f === void 0 ? BaseStyle_1.Colors.shadowColor : _f;
23
+ if (!loading) {
24
+ return null;
25
+ }
26
+ var styles = getStyles(backgroundColor, textColor, shadowColor);
27
+ return (<react_native_1.View style={[styles.parent]}>
28
+ <react_native_1.View style={[styles.activityContainer, styles.shadowProp]}>
29
+ <react_native_1.ActivityIndicator size="large" color={textColor} style={{ marginTop: 20 }}/>
30
+ <Label_1.default text={message} size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.NORMAL} color={textColor} customStyle={styles.text}/>
31
+ </react_native_1.View>
32
+ </react_native_1.View>);
33
+ };
34
+ var getStyles = function (backgroundColor, textColor, shadowColor) { return react_native_1.StyleSheet.create({
35
+ shadowProp: __assign({ shadowColor: shadowColor, shadowOffset: { width: -2, height: 2 }, shadowOpacity: 0.2, shadowRadius: 5, elevation: react_native_1.Platform.OS === 'android' ? 5 : 0 }, (react_native_1.Platform.OS === 'android'
36
+ ? {
37
+ borderWidth: 0.5,
38
+ borderColor: 'rgba(0,0,0,0.05)',
39
+ }
40
+ : {})),
41
+ parent: {
42
+ flex: 1,
43
+ justifyContent: 'center',
44
+ alignItems: 'center',
45
+ position: 'absolute',
46
+ top: 0,
47
+ left: 0,
48
+ right: 0,
49
+ bottom: 0,
50
+ backgroundColor: 'rgba(0, 0, 0, 0.5)',
51
+ },
52
+ activityContainer: {
53
+ width: 230,
54
+ height: 100,
55
+ borderRadius: 10,
56
+ backgroundColor: backgroundColor,
57
+ },
58
+ text: {
59
+ alignSelf: 'center',
60
+ marginTop: 4,
61
+ fontSize: 16,
62
+ color: textColor,
63
+ },
64
+ }); };
65
+ exports.default = ActivityLoader;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { GestureResponderEvent, ViewStyle } from "react-native";
3
+ interface CustomAlertProps {
4
+ visible: boolean;
5
+ title: string;
6
+ message: string | null;
7
+ positiveButtonText?: string;
8
+ negativeButtonText?: string;
9
+ backgroundColor?: string;
10
+ textColor?: string;
11
+ shadowColor?: string;
12
+ onPositivePress: (event: GestureResponderEvent) => void;
13
+ onNegativePress?: (event: GestureResponderEvent) => void;
14
+ viewStyle?: ViewStyle | ViewStyle[];
15
+ }
16
+ /**
17
+ * A custom alert dialog component with configurable buttons
18
+ */
19
+ declare const CustomAlert: React.FC<CustomAlertProps>;
20
+ export default CustomAlert;
@@ -0,0 +1,96 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ var react_1 = require("react");
15
+ var react_native_1 = require("react-native");
16
+ var BaseStyle_1 = require("../utils/BaseStyle");
17
+ var Label_1 = require("../typography/Label");
18
+ var TextConstants_1 = require("../utils/TextConstants");
19
+ /**
20
+ * A custom alert dialog component with configurable buttons
21
+ */
22
+ var CustomAlert = function (_a) {
23
+ var visible = _a.visible, title = _a.title, message = _a.message, _b = _a.positiveButtonText, positiveButtonText = _b === void 0 ? "OK" : _b, _c = _a.negativeButtonText, negativeButtonText = _c === void 0 ? "Cancel" : _c, onPositivePress = _a.onPositivePress, onNegativePress = _a.onNegativePress, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? BaseStyle_1.Colors.whiteColor : _d, _e = _a.textColor, textColor = _e === void 0 ? BaseStyle_1.Colors.textBlack : _e, _f = _a.shadowColor, shadowColor = _f === void 0 ? BaseStyle_1.Colors.shadowColor : _f, viewStyle = _a.viewStyle;
24
+ var styles = getStyles(backgroundColor, textColor, shadowColor);
25
+ return (<react_native_1.Modal animationType="fade" transparent={true} visible={visible} statusBarTranslucent={true} onRequestClose={onNegativePress || onPositivePress}>
26
+ <react_native_1.View style={styles.centeredView}>
27
+ <react_native_1.View style={[styles.modalView, viewStyle]}>
28
+ {title && <Label_1.default text={title} size={TextConstants_1.TextSize.LARGE} weight={TextConstants_1.TextWeight.BOLD} color={textColor} customStyle={styles.title}/>}
29
+
30
+ <Label_1.default text={message} size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.NORMAL} color={textColor} customStyle={styles.message}/>
31
+
32
+ <react_native_1.View style={styles.buttonContainer}>
33
+ <react_native_1.TouchableOpacity style={styles.textButton} testID="btnPositiveAction" onPress={onPositivePress}>
34
+ <Label_1.default text={positiveButtonText} size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.BOLD} color={textColor} customStyle={styles.text}/>
35
+ </react_native_1.TouchableOpacity>
36
+
37
+ {onNegativePress && (<react_native_1.View style={styles.buttonWrapper}>
38
+ <react_native_1.TouchableOpacity style={styles.textButton} testID="btnNegativeAction" onPress={onNegativePress}>
39
+ <Label_1.default text={negativeButtonText} size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.BOLD} color={textColor} customStyle={styles.text}/>
40
+ </react_native_1.TouchableOpacity>
41
+ </react_native_1.View>)}
42
+ </react_native_1.View>
43
+ </react_native_1.View>
44
+ </react_native_1.View>
45
+ </react_native_1.Modal>);
46
+ };
47
+ var getStyles = function (backgroundColor, textColor, shadowColor) { return react_native_1.StyleSheet.create({
48
+ centeredView: {
49
+ flex: 1,
50
+ justifyContent: "center",
51
+ alignItems: "center",
52
+ paddingHorizontal: 20,
53
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
54
+ },
55
+ modalView: __assign({ width: "100%", backgroundColor: backgroundColor, borderRadius: 20, padding: 20, alignItems: "center", shadowColor: shadowColor, shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.25, shadowRadius: 4, elevation: react_native_1.Platform.OS === 'android' ? 5 : 0 }, (react_native_1.Platform.OS === 'android'
56
+ ? {
57
+ borderWidth: 0.5,
58
+ borderColor: 'rgba(0,0,0,0.05)',
59
+ }
60
+ : {})),
61
+ title: {
62
+ width: "100%",
63
+ textAlign: "left",
64
+ marginBottom: 10,
65
+ },
66
+ message: {
67
+ width: "100%",
68
+ textAlign: "left",
69
+ marginBottom: 20,
70
+ lineHeight: 26
71
+ },
72
+ buttonContainer: {
73
+ flexDirection: "row",
74
+ justifyContent: "flex-end",
75
+ width: "100%",
76
+ marginTop: 20,
77
+ paddingHorizontal: 10,
78
+ },
79
+ singleButtonContainer: {
80
+ justifyContent: "center",
81
+ },
82
+ text: {
83
+ fontSize: 16,
84
+ fontWeight: "bold",
85
+ color: textColor,
86
+ },
87
+ buttonWrapper: {
88
+ // Ensures both buttons take equal width
89
+ marginStart: 35, // Adds spacing between buttons
90
+ },
91
+ textButton: {
92
+ paddingHorizontal: 10,
93
+ paddingVertical: 5
94
+ }
95
+ }); };
96
+ exports.default = CustomAlert;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ interface DeleteImageConfirmationDialogProps {
3
+ message: string;
4
+ onConfirm: () => void;
5
+ onCancel: () => void;
6
+ primaryButtonText?: string;
7
+ secondaryButtonText?: string;
8
+ primaryColor?: string;
9
+ backgroundColor?: string;
10
+ textColor?: string;
11
+ }
12
+ /**
13
+ * A confirmation dialog for deleting images
14
+ */
15
+ declare const DeleteImageConfirmationDialog: React.FC<DeleteImageConfirmationDialogProps>;
16
+ export default DeleteImageConfirmationDialog;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_native_1 = require("react-native");
4
+ var react_1 = require("react");
5
+ var Label_1 = require("../typography/Label");
6
+ var TextConstants_1 = require("../utils/TextConstants");
7
+ var BottomTwoButtonLayoutComponent_1 = require("../layout/BottomTwoButtonLayoutComponent");
8
+ /**
9
+ * A confirmation dialog for deleting images
10
+ */
11
+ var DeleteImageConfirmationDialog = function (_a) {
12
+ var message = _a.message, _b = _a.primaryButtonText, primaryButtonText = _b === void 0 ? "Delete" : _b, _c = _a.secondaryButtonText, secondaryButtonText = _c === void 0 ? "Cancel" : _c, onConfirm = _a.onConfirm, onCancel = _a.onCancel, primaryColor = _a.primaryColor, backgroundColor = _a.backgroundColor, textColor = _a.textColor;
13
+ return (<react_native_1.View style={{ flex: 1 }}>
14
+ <Label_1.default text={message} size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.NORMAL} textColorType="primary" customStyle={{ alignSelf: 'center', textAlign: 'center', paddingHorizontal: 15, color: textColor }}/>
15
+
16
+ <BottomTwoButtonLayoutComponent_1.default primaryButtonTestID="btnDelete" secondaryButtonTestID="btnCancel" primaryButtonText={primaryButtonText} secondaryButtonText={secondaryButtonText} onPrimaryButtonPress={onConfirm} onSecondaryButtonPress={onCancel} isPrimaryButtonDisabled={false} isSecondaryButtonDisabled={false} containerStyle={{ elevation: 0, shadowOpacity: 0, borderTopWidth: 0 }} primaryColor={primaryColor} backgroundColor={backgroundColor}/>
17
+ </react_native_1.View>);
18
+ };
19
+ exports.default = DeleteImageConfirmationDialog;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface ProgressBarProps {
3
+ progress: number;
4
+ maxValue?: number;
5
+ minValue?: number;
6
+ height?: number;
7
+ backgroundColor?: string;
8
+ progressColor?: string;
9
+ borderRadius?: number;
10
+ }
11
+ /**
12
+ * A progress bar component that visualizes progress as a horizontal bar
13
+ */
14
+ declare const ProgressBar: React.FC<ProgressBarProps>;
15
+ export default ProgressBar;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_1 = require("react");
4
+ var react_native_1 = require("react-native");
5
+ var BaseStyle_1 = require("../utils/BaseStyle");
6
+ /**
7
+ * A progress bar component that visualizes progress as a horizontal bar
8
+ */
9
+ var ProgressBar = function (_a) {
10
+ var progress = _a.progress, _b = _a.maxValue, maxValue = _b === void 0 ? 1 : _b, _c = _a.minValue, minValue = _c === void 0 ? 0 : _c, _d = _a.height, height = _d === void 0 ? 6 : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? BaseStyle_1.Colors.lightGrayColor : _e, _f = _a.progressColor, progressColor = _f === void 0 ? '#6CB7D8' : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 3 : _g;
11
+ // Calculate the width percentage based on progress, minValue, and maxValue
12
+ var normalizedProgress = Math.max(0, Math.min(1, (progress - minValue) / (maxValue - minValue)));
13
+ var width = "".concat(normalizedProgress * 100, "%");
14
+ return (<react_native_1.View style={[styles.container, { height: height, backgroundColor: backgroundColor, borderRadius: borderRadius }]}>
15
+ <react_native_1.View style={[
16
+ styles.progressIndicator,
17
+ {
18
+ width: width,
19
+ backgroundColor: progressColor,
20
+ borderRadius: borderRadius,
21
+ },
22
+ ]}/>
23
+ </react_native_1.View>);
24
+ };
25
+ var styles = react_native_1.StyleSheet.create({
26
+ container: {
27
+ width: '100%',
28
+ overflow: 'hidden',
29
+ },
30
+ progressIndicator: {
31
+ height: '100%',
32
+ },
33
+ });
34
+ exports.default = ProgressBar;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ImagePickerBottomSheetProps {
3
+ visible: boolean;
4
+ onClose: () => void;
5
+ onTakePhoto: () => void;
6
+ onUploadFile: () => void;
7
+ title?: string;
8
+ }
9
+ declare const ImagePickerBottomSheet: React.FC<ImagePickerBottomSheetProps>;
10
+ export default ImagePickerBottomSheet;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_1 = require("react");
4
+ var ImagePickerView_1 = require("./ImagePickerView");
5
+ var BottomSheetDialog_1 = require("../layout/BottomSheetDialog");
6
+ var ImagePickerBottomSheet = function (_a) {
7
+ var visible = _a.visible, onClose = _a.onClose, onTakePhoto = _a.onTakePhoto, onUploadFile = _a.onUploadFile, title = _a.title;
8
+ var ref = (0, react_1.useRef)(null);
9
+ var TakePhoto = function () {
10
+ closeSheet();
11
+ setTimeout(function () {
12
+ onTakePhoto();
13
+ }, 1000);
14
+ };
15
+ var UploadFile = function () {
16
+ closeSheet();
17
+ setTimeout(function () {
18
+ onUploadFile();
19
+ }, 1000);
20
+ };
21
+ var closeSheet = function () {
22
+ if (ref.current) {
23
+ ref.current.closeBottomSheet();
24
+ }
25
+ };
26
+ return (<BottomSheetDialog_1.default visible={visible} onClose={onClose} height={200} // Adjust height as needed
27
+ ref={ref}>
28
+ <ImagePickerView_1.default title={title} onTakePhoto={TakePhoto} onUploadFile={UploadFile} onClose={closeSheet}/>
29
+ </BottomSheetDialog_1.default>);
30
+ };
31
+ exports.default = ImagePickerBottomSheet;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { ViewStyle } from 'react-native';
3
+ interface ImagePickerViewProps {
4
+ onTakePhoto: () => void;
5
+ onUploadFile: () => void;
6
+ onClose?: () => void;
7
+ containerStyle?: ViewStyle;
8
+ title?: string;
9
+ }
10
+ declare const ImagePickerView: React.FC<ImagePickerViewProps>;
11
+ export default ImagePickerView;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var react_1 = require("react");
4
+ var react_native_1 = require("react-native");
5
+ var ic_camera_svg_1 = require("../../assets/images/ic_camera.svg");
6
+ var ic_folder_svg_1 = require("../../assets/images/ic_folder.svg");
7
+ var ic_close_svg_1 = require("../../assets/images/ic_close.svg");
8
+ var Label_1 = require("../typography/Label");
9
+ var TextConstants_1 = require("../utils/TextConstants");
10
+ var BaseStyle_1 = require("../utils/BaseStyle");
11
+ var ImagePickerView = function (_a) {
12
+ var onTakePhoto = _a.onTakePhoto, onUploadFile = _a.onUploadFile, onClose = _a.onClose, containerStyle = _a.containerStyle, _b = _a.title, title = _b === void 0 ? 'Add an Image' : _b;
13
+ return (<react_native_1.View style={[styles.container, containerStyle]}>
14
+ <react_native_1.View style={styles.header}>
15
+ <Label_1.default text={title} size={TextConstants_1.TextSize.LARGE} weight={TextConstants_1.TextWeight.BOLD} textColorType="primary"/>
16
+ {onClose && (<react_native_1.TouchableOpacity onPress={onClose} style={styles.closeButton}>
17
+ <ic_close_svg_1.default width={24} height={24}/>
18
+ </react_native_1.TouchableOpacity>)}
19
+ </react_native_1.View>
20
+
21
+ <react_native_1.TouchableOpacity style={styles.option} onPress={onTakePhoto} activeOpacity={0.7}>
22
+ <ic_camera_svg_1.default width={24} height={24} style={styles.icon}/>
23
+ <Label_1.default text="Take a photo" size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.NORMAL} textColorType="primary"/>
24
+ </react_native_1.TouchableOpacity>
25
+
26
+ <react_native_1.View style={styles.divider}/>
27
+
28
+ <react_native_1.TouchableOpacity style={styles.option} onPress={onUploadFile} activeOpacity={0.7}>
29
+ <ic_folder_svg_1.default width={24} height={24} style={styles.icon}/>
30
+ <Label_1.default text="Upload a file" size={TextConstants_1.TextSize.NORMAL} weight={TextConstants_1.TextWeight.NORMAL} textColorType="primary"/>
31
+ </react_native_1.TouchableOpacity>
32
+ </react_native_1.View>);
33
+ };
34
+ var styles = react_native_1.StyleSheet.create({
35
+ container: {
36
+ backgroundColor: BaseStyle_1.Colors.whiteColor,
37
+ borderRadius: 12,
38
+ overflow: 'hidden',
39
+ },
40
+ header: {
41
+ flexDirection: 'row',
42
+ justifyContent: 'space-between',
43
+ alignItems: 'center',
44
+ paddingStart: 16,
45
+ paddingBottom: 16
46
+ },
47
+ closeButton: {
48
+ padding: 4,
49
+ },
50
+ option: {
51
+ flexDirection: 'row',
52
+ alignItems: 'center',
53
+ paddingVertical: 16,
54
+ paddingHorizontal: 16,
55
+ },
56
+ icon: {
57
+ marginRight: 16,
58
+ },
59
+ divider: {
60
+ height: 1,
61
+ backgroundColor: BaseStyle_1.Colors.lightGrayColor,
62
+ marginHorizontal: 16,
63
+ },
64
+ });
65
+ exports.default = ImagePickerView;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import { PropertyImage } from '../models/PropertyImage';
3
+ type MultipleImagePreviewProps = {
4
+ /**
5
+ * Array of image URIs to display. Can be local file paths or server URLs.
6
+ */
7
+ images: PropertyImage[];
8
+ /**
9
+ * Initial image index to display
10
+ */
11
+ initialIndex?: number;
12
+ /**
13
+ * Callback when the preview is closed
14
+ */
15
+ onClose?: () => void;
16
+ /**
17
+ * Callback when an image is deleted
18
+ */
19
+ onDelete?: (index: number) => void;
20
+ /**
21
+ * Callback when an image is set as default
22
+ */
23
+ OnMarkDefault?: (index: number, value: boolean) => void;
24
+ /**
25
+ * Whether to show the delete button
26
+ */
27
+ showDeleteButton?: boolean;
28
+ };
29
+ /**
30
+ * MultipleImagePreview component for displaying images
31
+ */
32
+ declare const MultipleImagePreview: React.FC<MultipleImagePreviewProps>;
33
+ export default MultipleImagePreview;