nestiq-component-library 1.1.0 → 1.1.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 (40) hide show
  1. package/dist/assets/images/Icon_rightArrow.svg +3 -0
  2. package/dist/assets/images/LayersIcon.svg +5 -0
  3. package/dist/assets/images/blackarrow-Right.svg +3 -0
  4. package/dist/assets/images/blckarrow-Left.svg +3 -0
  5. package/dist/assets/images/chevron-left.svg +3 -0
  6. package/dist/assets/images/default-property.jpg +0 -0
  7. package/dist/assets/images/heartIcon.svg +3 -0
  8. package/dist/assets/images/icon-close-white.webp +0 -0
  9. package/dist/assets/images/icon_close 2.e41bb9a4db48e048.png +0 -0
  10. package/dist/assets/images/icon_close_2.png +0 -0
  11. package/dist/assets/images/icon_gallery.svg +4 -0
  12. package/dist/assets/images/icon_map.svg +10 -0
  13. package/dist/assets/images/icon_share_1.svg +3 -0
  14. package/dist/assets/images/layer_icon.svg +5 -0
  15. package/dist/assets/images/locationIcon.svg +4 -0
  16. package/dist/assets/images/locationIconBlack.svg +4 -0
  17. package/dist/assets/images/no-image-icon.png +0 -0
  18. package/dist/components/Button/Button.js +6 -0
  19. package/dist/components/ImageListPopup/ImageListPopup.js +26 -0
  20. package/dist/components/Popup/Popup.js +12 -0
  21. package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +1 -1
  22. package/dist/components/SharePopup/PopUp.d.ts +7 -0
  23. package/dist/index.es.js +12 -12
  24. package/dist/index.es.js.map +1 -1
  25. package/dist/index.js +12 -12
  26. package/dist/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/rollup.config.mjs +35 -35
  29. package/src/components/FloorPlanPopup/FloorPlanPopup.css +3 -3
  30. package/src/components/FloorPlanPopup/FloorPlanPopup.tsx +83 -83
  31. package/src/components/ImageListPopup/ImageListPopup.css +83 -83
  32. package/src/components/ImageListPopup/ImageListPopup.tsx +141 -141
  33. package/src/components/Popup/Popup.tsx +29 -29
  34. package/src/components/PropertyCard/PropertyCard.tsx +136 -136
  35. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +82 -80
  36. package/src/components/PropertyImageList/PropertyImageList.tsx +198 -198
  37. package/src/components/SharePopup/SharePopup.tsx +139 -139
  38. package/src/components/ToastWrapper/ToastWrapper.tsx +25 -25
  39. package/src/functions/util.ts +3 -3
  40. package/src/index.tsx +20 -20
@@ -1,83 +1,83 @@
1
- import React, { useEffect, useState } from "react";
2
- import iconClose from "../../assets/images/close.png";
3
-
4
- interface PopupProps {
5
- contentUrl: string;
6
- onCloseClick: () => void;
7
- }
8
-
9
- const FloorPlanPopup: React.FC<PopupProps> = ({ contentUrl, onCloseClick }) => {
10
- const [isContentImage, setIsContentImage] = useState(false);
11
-
12
- useEffect(() => {
13
- if (contentUrl) {
14
- const fileFormat = contentUrl.split(".").pop();
15
- if (
16
- fileFormat === "png" ||
17
- fileFormat === "jpg" ||
18
- fileFormat === "jpeg" ||
19
- fileFormat === "svg"
20
- ) {
21
- setIsContentImage(true);
22
- }
23
- }
24
- }, [contentUrl]);
25
-
26
- const downloadButtonClickHandler = (): void => {
27
- // Create a temporary anchor element
28
- const link = document.createElement("a");
29
- link.href = contentUrl;
30
- link.setAttribute("download", ""); // This attribute hints the browser to download the file
31
-
32
- // Append the anchor to the body and click it to trigger the download
33
- document.body.appendChild(link);
34
- link.click();
35
-
36
- // Clean up: remove the anchor element
37
- document.body.removeChild(link);
38
- };
39
- return (
40
- <div className="popup-overlay">
41
- <div className=" d-flex w-50 flex-column col-6 ">
42
- <div className="d-flex align-self-end me-5 mt-5">
43
- <img
44
- src={iconClose}
45
- alt="close"
46
- className="closeIcon mt-5"
47
- onClick={onCloseClick}
48
- />
49
- </div>
50
- <div className="d-flex justify-content-center">
51
- <div className="p-2 bd-highlight">
52
- {isContentImage && (
53
- <div
54
- className="rounded-5 mainImage"
55
- style={{
56
- backgroundImage: `url(${contentUrl})`,
57
- height: "350px",
58
- width: "600px",
59
- backgroundSize: "cover",
60
- backgroundPosition: "center",
61
- }}
62
- ></div>
63
- )}
64
- {!isContentImage && (
65
- <div className="text-white text-center">
66
- No Preview Available
67
- <button
68
- className="btn btn-info"
69
- onClick={downloadButtonClickHandler}
70
- >
71
- {" "}
72
- Download{" "}
73
- </button>
74
- </div>
75
- )}
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- );
81
- };
82
-
83
- export default FloorPlanPopup;
1
+ import React, { useEffect, useState } from "react";
2
+ import iconClose from "../../assets/images/close.png";
3
+
4
+ interface PopupProps {
5
+ contentUrl: string;
6
+ onCloseClick: () => void;
7
+ }
8
+
9
+ const FloorPlanPopup: React.FC<PopupProps> = ({ contentUrl, onCloseClick }) => {
10
+ const [isContentImage, setIsContentImage] = useState(false);
11
+
12
+ useEffect(() => {
13
+ if (contentUrl) {
14
+ const fileFormat = contentUrl.split(".").pop();
15
+ if (
16
+ fileFormat === "png" ||
17
+ fileFormat === "jpg" ||
18
+ fileFormat === "jpeg" ||
19
+ fileFormat === "svg"
20
+ ) {
21
+ setIsContentImage(true);
22
+ }
23
+ }
24
+ }, [contentUrl]);
25
+
26
+ const downloadButtonClickHandler = (): void => {
27
+ // Create a temporary anchor element
28
+ const link = document.createElement("a");
29
+ link.href = contentUrl;
30
+ link.setAttribute("download", ""); // This attribute hints the browser to download the file
31
+
32
+ // Append the anchor to the body and click it to trigger the download
33
+ document.body.appendChild(link);
34
+ link.click();
35
+
36
+ // Clean up: remove the anchor element
37
+ document.body.removeChild(link);
38
+ };
39
+ return (
40
+ <div className="popup-overlay">
41
+ <div className=" d-flex w-50 flex-column col-6 ">
42
+ <div className="d-flex align-self-end me-5 mt-5">
43
+ <img
44
+ src={iconClose}
45
+ alt="close"
46
+ className="closeIcon mt-5"
47
+ onClick={onCloseClick}
48
+ />
49
+ </div>
50
+ <div className="d-flex justify-content-center">
51
+ <div className="p-2 bd-highlight">
52
+ {isContentImage && (
53
+ <div
54
+ className="rounded-5 mainImage"
55
+ style={{
56
+ backgroundImage: `url(${contentUrl})`,
57
+ height: "350px",
58
+ width: "600px",
59
+ backgroundSize: "cover",
60
+ backgroundPosition: "center",
61
+ }}
62
+ ></div>
63
+ )}
64
+ {!isContentImage && (
65
+ <div className="text-white text-center">
66
+ No Preview Available
67
+ <button
68
+ className="btn btn-info"
69
+ onClick={downloadButtonClickHandler}
70
+ >
71
+ {" "}
72
+ Download{" "}
73
+ </button>
74
+ </div>
75
+ )}
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ );
81
+ };
82
+
83
+ export default FloorPlanPopup;
@@ -1,83 +1,83 @@
1
- .popup-header {
2
- display: flex;
3
- justify-content: center;
4
- align-items: center;
5
- width: 100%;
6
- padding: 1rem;
7
- position: absolute;
8
- top: 0;
9
- }
10
-
11
- .popup-title {
12
- color: white;
13
- font-size: 24px;
14
- font-weight: bold;
15
- }
16
-
17
- .btn-close {
18
- position: absolute;
19
- right: 1rem;
20
- top: 1rem;
21
- background: none;
22
- border: none;
23
- color: white;
24
- font-size: 24px;
25
- cursor: pointer;
26
- }
27
-
28
- .popup-body {
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
- padding: 1rem;
33
- position: relative;
34
- flex: 1;
35
- }
36
-
37
- .main-image {
38
- max-width: 100%;
39
- max-height: 80vh;
40
- border-radius: 8px;
41
- }
42
-
43
- .btn-prev,
44
- .btn-next {
45
- background: none;
46
- border: none;
47
- color: white;
48
- font-size: 48px;
49
- cursor: pointer;
50
- position: absolute;
51
- top: 50%;
52
- transform: translateY(-50%);
53
- }
54
-
55
- .btn-prev {
56
- left: 10px;
57
- }
58
-
59
- .btn-next {
60
- right: 10px;
61
- }
62
-
63
- .popup-thumbnails {
64
- display: flex;
65
- justify-content: center;
66
- align-items: center;
67
- gap: 10px;
68
- padding: 1rem;
69
- }
70
-
71
- .thumbnail {
72
- width: 60px;
73
- height: 60px;
74
- object-fit: cover;
75
- border-radius: 8px;
76
- cursor: pointer;
77
- opacity: 0.6;
78
- }
79
-
80
- .thumbnail.active {
81
- border: 2px solid white;
82
- opacity: 1;
83
- }
1
+ .popup-header {
2
+ display: flex;
3
+ justify-content: center;
4
+ align-items: center;
5
+ width: 100%;
6
+ padding: 1rem;
7
+ position: absolute;
8
+ top: 0;
9
+ }
10
+
11
+ .popup-title {
12
+ color: white;
13
+ font-size: 24px;
14
+ font-weight: bold;
15
+ }
16
+
17
+ .btn-close {
18
+ position: absolute;
19
+ right: 1rem;
20
+ top: 1rem;
21
+ background: none;
22
+ border: none;
23
+ color: white;
24
+ font-size: 24px;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .popup-body {
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+ padding: 1rem;
33
+ position: relative;
34
+ flex: 1;
35
+ }
36
+
37
+ .main-image {
38
+ max-width: 100%;
39
+ max-height: 80vh;
40
+ border-radius: 8px;
41
+ }
42
+
43
+ .btn-prev,
44
+ .btn-next {
45
+ background: none;
46
+ border: none;
47
+ color: white;
48
+ font-size: 48px;
49
+ cursor: pointer;
50
+ position: absolute;
51
+ top: 50%;
52
+ transform: translateY(-50%);
53
+ }
54
+
55
+ .btn-prev {
56
+ left: 10px;
57
+ }
58
+
59
+ .btn-next {
60
+ right: 10px;
61
+ }
62
+
63
+ .popup-thumbnails {
64
+ display: flex;
65
+ justify-content: center;
66
+ align-items: center;
67
+ gap: 10px;
68
+ padding: 1rem;
69
+ }
70
+
71
+ .thumbnail {
72
+ width: 60px;
73
+ height: 60px;
74
+ object-fit: cover;
75
+ border-radius: 8px;
76
+ cursor: pointer;
77
+ opacity: 0.6;
78
+ }
79
+
80
+ .thumbnail.active {
81
+ border: 2px solid white;
82
+ opacity: 1;
83
+ }
@@ -1,141 +1,141 @@
1
- import "./ImageListPopup.css";
2
- import React, { useRef, useState } from "react";
3
- import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
4
- import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
5
- import iconClose from "../../assets/images/close.png";
6
- import "../../styles/common.css";
7
-
8
- interface PopupProps {
9
- pictureUrls: { title: string; url: string }[];
10
- }
11
-
12
- export default function ImageListPopup(props: PopupProps) {
13
- const [showPopUp, setShowPopUp] = useState(true);
14
- const [currentImageIndex, setCurrentImageIndex] = useState(0);
15
- const imageListRef = useRef<HTMLDivElement | null>(null);
16
-
17
- const handleArrowClickInMainImage = (direction: any) => {
18
- if (props.pictureUrls.length === 0) return;
19
-
20
- let newIndex = currentImageIndex;
21
- if (direction === "left") {
22
- newIndex =
23
- (currentImageIndex - 1 + props.pictureUrls.length) %
24
- props.pictureUrls.length;
25
- } else if (direction === "right") {
26
- newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
27
- }
28
-
29
- setCurrentImageIndex(newIndex);
30
-
31
- imageListRef.current!.scrollTo({
32
- left: newIndex * 150,
33
- behavior: "smooth",
34
- });
35
- };
36
-
37
- const handleClose = () => {
38
- setShowPopUp(false);
39
- };
40
-
41
- return (
42
- <div>
43
- {showPopUp && (
44
- <div className="popup-overlay">
45
- <div className=" d-flex w-50 flex-column col-6 ">
46
- <div className="d-flex align-self-end me-5 mt-5">
47
- <img
48
- src={iconClose}
49
- alt="close"
50
- className="closeIcon mt-5"
51
- onClick={handleClose}
52
- />
53
- </div>
54
- <span className="text-white align-self-center">
55
- {props.pictureUrls[currentImageIndex].title}
56
- </span>
57
- <div className="d-flex justify-content-center">
58
- <div className="p-2 bd-highlight align-self-center align-items-center me-5">
59
- <div
60
- className="rounded-circle border onImageArrow start-0 d-flex "
61
- role="button"
62
- onClick={() => handleArrowClickInMainImage("left")}
63
- >
64
- <img
65
- src={blcIconArrowLeft}
66
- className="blackArrow align-self-center"
67
- alt="Left Arrow"
68
- />
69
- </div>
70
- </div>
71
- <div className="p-2 bd-highlight">
72
- <div
73
- className=" rounded-5 mainImage "
74
- style={{
75
- backgroundImage: `url(${props.pictureUrls[currentImageIndex].url})`,
76
- height: "350px",
77
- width: "600px",
78
- backgroundSize: "cover",
79
- backgroundPosition: "center",
80
- }}
81
- ></div>
82
- </div>
83
- <div className="p-2 bd-highlight align-self-center ms-5">
84
- {" "}
85
- <div
86
- role="button"
87
- className="rounded-circle border onImageArrow d-flex justify-content-center"
88
- onClick={() => handleArrowClickInMainImage("right")}
89
- >
90
- <img
91
- src={blcIconArrowRight}
92
- className="blackArrow align-self-center"
93
- alt="Right Arrow"
94
- />
95
- </div>
96
- </div>
97
- </div>
98
- <div className="d-flex flex-row">
99
- {/* Arrows on the main image */}
100
- </div>
101
- <div className="d-flex flex-row gap-4 w-100 secondList ">
102
- <div className="col-lg-12 d-flex flex-row p-1 align-self-center mt-5">
103
- <div className="col-12 position-relative d-flex justify-content-center">
104
- <div
105
- className="col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto "
106
- ref={imageListRef}
107
- >
108
- {props.pictureUrls.length > 0 && (
109
- <div className="col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3">
110
- {props.pictureUrls.map((picture, index) => (
111
- <div
112
- key={index}
113
- className="col-lg-12 h-100 d-flex"
114
- onClick={() => {
115
- setCurrentImageIndex(index);
116
- imageListRef.current!.scrollTo({
117
- left: index * 150,
118
- behavior: "smooth",
119
- });
120
- }}
121
- role="button"
122
- >
123
- <img
124
- src={picture.url}
125
- alt={`Image ${index + 1}`}
126
- className="col-12 h-100 rounded-3 object-fit-cover"
127
- />
128
- </div>
129
- ))}
130
- </div>
131
- )}
132
- </div>
133
- </div>
134
- </div>
135
- </div>
136
- </div>
137
- </div>
138
- )}
139
- </div>
140
- );
141
- }
1
+ import "./ImageListPopup.css";
2
+ import React, { useRef, useState } from "react";
3
+ import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
4
+ import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
5
+ import iconClose from "../../assets/images/close.png";
6
+ import "../../styles/common.css";
7
+
8
+ interface PopupProps {
9
+ pictureUrls: { title: string; url: string }[];
10
+ }
11
+
12
+ export default function ImageListPopup(props: PopupProps) {
13
+ const [showPopUp, setShowPopUp] = useState(true);
14
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
15
+ const imageListRef = useRef<HTMLDivElement | null>(null);
16
+
17
+ const handleArrowClickInMainImage = (direction: any) => {
18
+ if (props.pictureUrls.length === 0) return;
19
+
20
+ let newIndex = currentImageIndex;
21
+ if (direction === "left") {
22
+ newIndex =
23
+ (currentImageIndex - 1 + props.pictureUrls.length) %
24
+ props.pictureUrls.length;
25
+ } else if (direction === "right") {
26
+ newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
27
+ }
28
+
29
+ setCurrentImageIndex(newIndex);
30
+
31
+ imageListRef.current!.scrollTo({
32
+ left: newIndex * 150,
33
+ behavior: "smooth",
34
+ });
35
+ };
36
+
37
+ const handleClose = () => {
38
+ setShowPopUp(false);
39
+ };
40
+
41
+ return (
42
+ <div>
43
+ {showPopUp && (
44
+ <div className="popup-overlay">
45
+ <div className=" d-flex w-50 flex-column col-6 ">
46
+ <div className="d-flex align-self-end me-5 mt-5">
47
+ <img
48
+ src={iconClose}
49
+ alt="close"
50
+ className="closeIcon mt-5"
51
+ onClick={handleClose}
52
+ />
53
+ </div>
54
+ <span className="text-white align-self-center">
55
+ {props.pictureUrls[currentImageIndex].title}
56
+ </span>
57
+ <div className="d-flex justify-content-center">
58
+ <div className="p-2 bd-highlight align-self-center align-items-center me-5">
59
+ <div
60
+ className="rounded-circle border onImageArrow start-0 d-flex "
61
+ role="button"
62
+ onClick={() => handleArrowClickInMainImage("left")}
63
+ >
64
+ <img
65
+ src={blcIconArrowLeft}
66
+ className="blackArrow align-self-center"
67
+ alt="Left Arrow"
68
+ />
69
+ </div>
70
+ </div>
71
+ <div className="p-2 bd-highlight">
72
+ <div
73
+ className=" rounded-5 mainImage "
74
+ style={{
75
+ backgroundImage: `url(${props.pictureUrls[currentImageIndex].url})`,
76
+ height: "350px",
77
+ width: "600px",
78
+ backgroundSize: "cover",
79
+ backgroundPosition: "center",
80
+ }}
81
+ ></div>
82
+ </div>
83
+ <div className="p-2 bd-highlight align-self-center ms-5">
84
+ {" "}
85
+ <div
86
+ role="button"
87
+ className="rounded-circle border onImageArrow d-flex justify-content-center"
88
+ onClick={() => handleArrowClickInMainImage("right")}
89
+ >
90
+ <img
91
+ src={blcIconArrowRight}
92
+ className="blackArrow align-self-center"
93
+ alt="Right Arrow"
94
+ />
95
+ </div>
96
+ </div>
97
+ </div>
98
+ <div className="d-flex flex-row">
99
+ {/* Arrows on the main image */}
100
+ </div>
101
+ <div className="d-flex flex-row gap-4 w-100 secondList ">
102
+ <div className="col-lg-12 d-flex flex-row p-1 align-self-center mt-5">
103
+ <div className="col-12 position-relative d-flex justify-content-center">
104
+ <div
105
+ className="col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto "
106
+ ref={imageListRef}
107
+ >
108
+ {props.pictureUrls.length > 0 && (
109
+ <div className="col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3">
110
+ {props.pictureUrls.map((picture, index) => (
111
+ <div
112
+ key={index}
113
+ className="col-lg-12 h-100 d-flex"
114
+ onClick={() => {
115
+ setCurrentImageIndex(index);
116
+ imageListRef.current!.scrollTo({
117
+ left: index * 150,
118
+ behavior: "smooth",
119
+ });
120
+ }}
121
+ role="button"
122
+ >
123
+ <img
124
+ src={picture.url}
125
+ alt={`Image ${index + 1}`}
126
+ className="col-12 h-100 rounded-3 object-fit-cover"
127
+ />
128
+ </div>
129
+ ))}
130
+ </div>
131
+ )}
132
+ </div>
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ )}
139
+ </div>
140
+ );
141
+ }
@@ -1,29 +1,29 @@
1
- import React from "react";
2
- import closeIcon from "../../assets/images/icon_close_2.png";
3
- import "./Popup.css";
4
- import "../../styles/common.css";
5
-
6
- interface PopupProps {
7
- children: React.ReactNode;
8
- onCloseClick: () => void;
9
- }
10
-
11
- const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
12
- return (
13
- <div className="popup-overlay">
14
- <div className="shareSection col-12 d-flex position-relative flex-column mx-auto justify-content-center col-5 col-lg-6 d-flex gap-4">
15
- <div className="end-0 top-0 position-absolute ">
16
- <img
17
- src={closeIcon}
18
- alt="close"
19
- className="closeIcon me-2"
20
- onClick={onCloseClick}
21
- />
22
- </div>
23
- {children}
24
- </div>
25
- </div>
26
- );
27
- };
28
-
29
- export default Popup;
1
+ import React from "react";
2
+ import closeIcon from "../../assets/images/icon_close_2.png";
3
+ import "./Popup.css";
4
+ import "../../styles/common.css";
5
+
6
+ interface PopupProps {
7
+ children: React.ReactNode;
8
+ onCloseClick: () => void;
9
+ }
10
+
11
+ const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
12
+ return (
13
+ <div className="popup-overlay">
14
+ <div className="shareSection col-12 d-flex position-relative flex-column mx-auto justify-content-center col-5 col-lg-6 d-flex gap-4">
15
+ <div className="end-0 top-0 position-absolute ">
16
+ <img
17
+ src={closeIcon}
18
+ alt="close"
19
+ className="closeIcon me-2"
20
+ onClick={onCloseClick}
21
+ />
22
+ </div>
23
+ {children}
24
+ </div>
25
+ </div>
26
+ );
27
+ };
28
+
29
+ export default Popup;