nestiq-component-library 1.0.25 → 1.0.26

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 (35) hide show
  1. package/dist/components/ImageListPopup/ImageListPopup.d.ts +4 -11
  2. package/dist/components/PropertyDetailsHeader/PropertyDetailsHeader.d.ts +1 -1
  3. package/dist/components/PropertyImageList/PropertyImageList.d.ts +4 -9
  4. package/dist/index.es.js +43 -70
  5. package/dist/index.es.js.map +1 -1
  6. package/dist/index.js +42 -69
  7. package/dist/index.js.map +1 -1
  8. package/package.json +3 -7
  9. package/rollup.config.mjs +35 -40
  10. package/src/components/ImageListPopup/ImageListPopup.css +107 -107
  11. package/src/components/ImageListPopup/ImageListPopup.tsx +141 -212
  12. package/src/components/Popup/Popup.tsx +28 -28
  13. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +83 -82
  14. package/src/components/PropertyImageList/PropertyImageList.tsx +14 -43
  15. package/tsconfig.json +2 -0
  16. package/dist/assets/images/heartIcon.svg +0 -3
  17. package/dist/assets/images/icon-close-white.webp +0 -0
  18. package/dist/assets/images/no-image-icon.png +0 -0
  19. package/dist/components/Button/Button.js +0 -6
  20. package/dist/components/ImageListPopup/ImageListPopup.js +0 -26
  21. package/dist/components/Popup/Popup.js +0 -12
  22. package/nestiq-component-library-1.0.22.tgz +0 -0
  23. /package/dist/assets/images/{Icon_rightArrow.svg → Icon_rightArrow.bced4a705c07148d.svg} +0 -0
  24. /package/dist/assets/images/{LayersIcon.svg → LayersIcon.34c085c352a2c9c8.svg} +0 -0
  25. /package/dist/assets/images/{blackarrow-Right.svg → blackarrow-Right.e585ae62dd55abae.svg} +0 -0
  26. /package/dist/assets/images/{blckarrow-Left.svg → blckarrow-Left.e2134741aa368d30.svg} +0 -0
  27. /package/dist/assets/images/{chevron-left.svg → chevron-left.04f0a7f16b745c1a.svg} +0 -0
  28. /package/dist/assets/images/{default-property.jpg → default-property.9987f19670be82b6.jpg} +0 -0
  29. /package/dist/assets/images/{icon_close_2.png → icon_close_2.e41bb9a4db48e048.png} +0 -0
  30. /package/dist/assets/images/{icon_gallery.svg → icon_gallery.269b721daf2ca907.svg} +0 -0
  31. /package/dist/assets/images/{icon_map.svg → icon_map.2318ec664c3e615e.svg} +0 -0
  32. /package/dist/assets/images/{icon_share_1.svg → icon_share_1.b9ec05630dc1087e.svg} +0 -0
  33. /package/dist/assets/images/{layer_icon.svg → layer_icon.9b56c187199c44b5.svg} +0 -0
  34. /package/dist/assets/images/{locationIcon.svg → locationIcon.0af399c78e0cdc20.svg} +0 -0
  35. /package/dist/assets/images/{locationIconBlack.svg → locationIconBlack.eb8e9e9226b43573.svg} +0 -0
@@ -1,107 +1,107 @@
1
- .popup-overlay {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- background-color: rgba(0, 0, 0, 0.7);
8
- display: flex;
9
- justify-content: center;
10
- align-items: center;
11
- z-index: 10000;
12
- }
13
-
14
- .popup-container {
15
- background-color: transparent;
16
- border-radius: 8px;
17
- max-width: 90%;
18
- max-height: 90%;
19
- display: flex;
20
- flex-direction: column;
21
- align-items: center;
22
- position: relative;
23
- }
24
-
25
- .popup-header {
26
- display: flex;
27
- justify-content: center;
28
- align-items: center;
29
- width: 100%;
30
- padding: 1rem;
31
- position: absolute;
32
- top: 0;
33
- }
34
-
35
- .popup-title {
36
- color: white;
37
- font-size: 24px;
38
- font-weight: bold;
39
- }
40
-
41
- .btn-close {
42
- position: absolute;
43
- right: 1rem;
44
- top: 1rem;
45
- background: none;
46
- border: none;
47
- color: white;
48
- font-size: 24px;
49
- cursor: pointer;
50
- }
51
-
52
- .popup-body {
53
- display: flex;
54
- justify-content: center;
55
- align-items: center;
56
- padding: 1rem;
57
- position: relative;
58
- flex: 1;
59
- }
60
-
61
- .main-image {
62
- max-width: 100%;
63
- max-height: 80vh;
64
- border-radius: 8px;
65
- }
66
-
67
- .btn-prev,
68
- .btn-next {
69
- background: none;
70
- border: none;
71
- color: white;
72
- font-size: 48px;
73
- cursor: pointer;
74
- position: absolute;
75
- top: 50%;
76
- transform: translateY(-50%);
77
- }
78
-
79
- .btn-prev {
80
- left: 10px;
81
- }
82
-
83
- .btn-next {
84
- right: 10px;
85
- }
86
-
87
- .popup-thumbnails {
88
- display: flex;
89
- justify-content: center;
90
- align-items: center;
91
- gap: 10px;
92
- padding: 1rem;
93
- }
94
-
95
- .thumbnail {
96
- width: 60px;
97
- height: 60px;
98
- object-fit: cover;
99
- border-radius: 8px;
100
- cursor: pointer;
101
- opacity: 0.6;
102
- }
103
-
104
- .thumbnail.active {
105
- border: 2px solid white;
106
- opacity: 1;
107
- }
1
+ .popup-overlay {
2
+ position: fixed;
3
+ top: 0;
4
+ left: 0;
5
+ right: 0;
6
+ bottom: 0;
7
+ background-color: rgba(0, 0, 0, 0.7);
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ z-index: 10000;
12
+ }
13
+
14
+ .popup-container {
15
+ background-color: transparent;
16
+ border-radius: 8px;
17
+ max-width: 90%;
18
+ max-height: 90%;
19
+ display: flex;
20
+ flex-direction: column;
21
+ align-items: center;
22
+ position: relative;
23
+ }
24
+
25
+ .popup-header {
26
+ display: flex;
27
+ justify-content: center;
28
+ align-items: center;
29
+ width: 100%;
30
+ padding: 1rem;
31
+ position: absolute;
32
+ top: 0;
33
+ }
34
+
35
+ .popup-title {
36
+ color: white;
37
+ font-size: 24px;
38
+ font-weight: bold;
39
+ }
40
+
41
+ .btn-close {
42
+ position: absolute;
43
+ right: 1rem;
44
+ top: 1rem;
45
+ background: none;
46
+ border: none;
47
+ color: white;
48
+ font-size: 24px;
49
+ cursor: pointer;
50
+ }
51
+
52
+ .popup-body {
53
+ display: flex;
54
+ justify-content: center;
55
+ align-items: center;
56
+ padding: 1rem;
57
+ position: relative;
58
+ flex: 1;
59
+ }
60
+
61
+ .main-image {
62
+ max-width: 100%;
63
+ max-height: 80vh;
64
+ border-radius: 8px;
65
+ }
66
+
67
+ .btn-prev,
68
+ .btn-next {
69
+ background: none;
70
+ border: none;
71
+ color: white;
72
+ font-size: 48px;
73
+ cursor: pointer;
74
+ position: absolute;
75
+ top: 50%;
76
+ transform: translateY(-50%);
77
+ }
78
+
79
+ .btn-prev {
80
+ left: 10px;
81
+ }
82
+
83
+ .btn-next {
84
+ right: 10px;
85
+ }
86
+
87
+ .popup-thumbnails {
88
+ display: flex;
89
+ justify-content: center;
90
+ align-items: center;
91
+ gap: 10px;
92
+ padding: 1rem;
93
+ }
94
+
95
+ .thumbnail {
96
+ width: 60px;
97
+ height: 60px;
98
+ object-fit: cover;
99
+ border-radius: 8px;
100
+ cursor: pointer;
101
+ opacity: 0.6;
102
+ }
103
+
104
+ .thumbnail.active {
105
+ border: 2px solid white;
106
+ opacity: 1;
107
+ }
@@ -1,212 +1,141 @@
1
- import "./ImageListPopup.css";
2
- import React, { useEffect, useRef, useState } from "react";
3
- // import icon_checkmark from "../../../assets/Images/icon_checkmark.svg";
4
- import blcIconArrowRight from "../../assets/Images/blackarrow-Right.svg";
5
- import blcIconArrowLeft from "../../assets/Images/blckarrow-Left.svg";
6
- import iconClose from "../../assets/images/icon_close_2.png";
7
-
8
- interface PopupProps {
9
- property: {
10
- city: string;
11
- constructedArea: string;
12
- rooms: string;
13
- propertyArea: string;
14
- askingPrice: string;
15
- };
16
- handleArrowClickInMainImage: any;
17
- pictureUrls: any[];
18
- currentImageIndex: number;
19
- imageListRef: any;
20
- }
21
-
22
- export default function ImageListPopup(props: PopupProps) {
23
- const [showPopUp, setShowPopUp] = useState(true);
24
- // const { id } = useParams();
25
- const [mainImage, setMainImage] = useState(null);
26
- const [currentImageIndex, setCurrentImageIndex] = useState(0);
27
- // const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
28
- const imageListRef = useRef(null);
29
-
30
- // const baseUrl = "https://api-dev.nestiq.de";
31
- // const pictureUrls = props.property.pictures.map(
32
- // (picture) => `${baseUrl}${picture.contentUrl}`
33
- // );
34
- const imagePopupData = props.pictureUrls.map((pic) => {
35
- return {
36
- src: pic,
37
- title: "Not Specified",
38
- };
39
- });
40
-
41
- useEffect(() => {
42
- if (props.pictureUrls.length > 0) {
43
- setMainImage(props.pictureUrls[0]);
44
- }
45
- }, [props.pictureUrls]);
46
-
47
- const handleArrowClickInMainImage = (direction: any) => {
48
- if (!props.property || props.pictureUrls.length === 0) return;
49
-
50
- let newIndex = currentImageIndex;
51
- if (direction === "left") {
52
- newIndex =
53
- (currentImageIndex - 1 + props.pictureUrls.length) %
54
- props.pictureUrls.length;
55
- } else if (direction === "right") {
56
- newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
57
- }
58
-
59
- setCurrentImageIndex(newIndex);
60
- setMainImage(props.pictureUrls[newIndex]);
61
-
62
- props.imageListRef.current.scrollTo({
63
- left: newIndex * 150,
64
- behavior: "smooth",
65
- });
66
- };
67
-
68
- const handleClose = () => {
69
- setShowPopUp(false);
70
- };
71
-
72
- return (
73
- <div>
74
- {showPopUp && (
75
- <div className="popup-overlay">
76
- <div className=" d-flex flex-column col-6 ">
77
- <div className="d-flex align-self-end me-0 ms-5">
78
- <img
79
- src={iconClose}
80
- alt="close"
81
- className="closeIcon "
82
- onClick={handleClose}
83
- />
84
- </div>
85
-
86
- <div className="d-flex justify-content-center">
87
- <div className="p-2 bd-highlight align-self-center align-items-center me-5">
88
- <div
89
- className="rounded-circle border onImageArrow start-0 d-flex "
90
- role="button"
91
- onClick={() => handleArrowClickInMainImage("left")}
92
- >
93
- <img
94
- src={blcIconArrowLeft}
95
- className="blackArrow align-self-center"
96
- alt="Left Arrow"
97
- />
98
- </div>
99
- </div>
100
- <div className="p-2 bd-highlight">
101
- <div
102
- className=" rounded-5 mainImage "
103
- style={{
104
- backgroundImage: `url(${props.pictureUrls[currentImageIndex]})`,
105
- height: "350px",
106
- width: "600px",
107
- backgroundSize: "cover",
108
- backgroundPosition: "center",
109
- }}
110
- ></div>
111
- </div>
112
- <div className="p-2 bd-highlight align-self-center ms-5">
113
- {" "}
114
- <div
115
- role="button"
116
- className="rounded-circle border onImageArrow d-flex justify-content-center"
117
- onClick={() => handleArrowClickInMainImage("right")}
118
- >
119
- <img
120
- src={blcIconArrowRight}
121
- className="blackArrow align-self-center"
122
- alt="Right Arrow"
123
- />
124
- </div>
125
- </div>
126
- </div>
127
- {/* <div className="d-flex flex-column">
128
- <div className=" d-flex flex-row align-self-center ">
129
- <img
130
- src={LeftArrow}
131
- alt="close"
132
- className="w-100 h-100 align-self-center me-5 "
133
- />
134
- <img src={house} alt="close" className="w-100 h-100 " />
135
- <img
136
- src={RightArrow}
137
- alt="close"
138
- className="w-100 h-100 align-self-center ms-5 "
139
- />
140
- </div>
141
- </div> */}
142
- <div className="d-flex flex-row">
143
- {/* Arrows on the main image */}
144
- </div>
145
- <div className="d-flex flex-row gap-4 w-100 secondList ">
146
- <div className="col-lg-12 d-flex flex-row p-1 align-self-center mt-5">
147
- <div className="col-12 position-relative d-flex justify-content-center">
148
- {/* <div
149
- className="col-1 h-100 d-flex position-absolute start-0"
150
- onClick={() => handleArrowClickInMainImage("left")}
151
- role="button"
152
- >
153
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
154
- <img
155
- src={iconArrowLeft}
156
- className="arroIconColour"
157
- alt="Left Arrow"
158
- />
159
- </div>
160
- </div> */}
161
- <div
162
- className="col-lg-10 rounded-3 h-100 w-100 d-flex flex-row gap-2 overflow-auto "
163
- ref={props.imageListRef}
164
- >
165
- {props.property && (
166
- <div className="col-lg-5 h-100 w-25 d-flex gap-4 flex-row rounded-3">
167
- {props.pictureUrls.map((imageUrl, index) => (
168
- <div
169
- key={index}
170
- className="col-lg-12 h-100 d-flex"
171
- onClick={() => {
172
- setMainImage(imageUrl);
173
- setCurrentImageIndex(index);
174
- props.imageListRef.current.scrollTo({
175
- left: index * 150,
176
- behavior: "smooth",
177
- });
178
- }}
179
- role="button"
180
- >
181
- <img
182
- src={imageUrl}
183
- alt={`Image ${index + 1}`}
184
- className="col-12 h-100 rounded-3 object-fit-cover"
185
- />
186
- </div>
187
- ))}
188
- </div>
189
- )}
190
- </div>
191
- {/* <div
192
- className="col-1 h-100 d-flex position-absolute end-0 top-0"
193
- onClick={() => handleArrowClickInMainImage("right")}
194
- role="button"
195
- >
196
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
197
- <img
198
- src={iconArrowRight}
199
- className="arroIconColour"
200
- alt="Right Arrow"
201
- />
202
- </div>
203
- </div> */}
204
- </div>
205
- </div>
206
- </div>
207
- </div>
208
- </div>
209
- )}
210
- </div>
211
- );
212
- }
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/icon_close_2.png";
6
+
7
+ interface PopupProps {
8
+ pictureUrls: { title: string; url: string }[];
9
+ }
10
+
11
+ export default function ImageListPopup(props: PopupProps) {
12
+ const [showPopUp, setShowPopUp] = useState(true);
13
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
14
+ const imageListRef = useRef<HTMLDivElement | null>(null);
15
+
16
+ const handleArrowClickInMainImage = (direction: any) => {
17
+ if (props.pictureUrls.length === 0) return;
18
+
19
+ let newIndex = currentImageIndex;
20
+ if (direction === "left") {
21
+ newIndex =
22
+ (currentImageIndex - 1 + props.pictureUrls.length) %
23
+ props.pictureUrls.length;
24
+ } else if (direction === "right") {
25
+ newIndex = (currentImageIndex + 1) % props.pictureUrls.length;
26
+ }
27
+
28
+ setCurrentImageIndex(newIndex);
29
+
30
+ imageListRef.current!.scrollTo({
31
+ left: newIndex * 150,
32
+ behavior: "smooth",
33
+ });
34
+ };
35
+
36
+ const handleClose = () => {
37
+ setShowPopUp(false);
38
+ };
39
+
40
+ return (
41
+ <div>
42
+ {showPopUp && (
43
+ <div className="popup-overlay">
44
+ <div className=" d-flex flex-column col-6 ">
45
+ <span className="txt-white">
46
+ {props.pictureUrls[currentImageIndex].title}
47
+ </span>
48
+ <div className="d-flex align-self-end me-0 ms-5">
49
+ <img
50
+ src={iconClose}
51
+ alt="close"
52
+ className="closeIcon"
53
+ onClick={handleClose}
54
+ />
55
+ </div>
56
+
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,28 +1,28 @@
1
- import React from "react";
2
- import closeIcon from "../../assets/images/icon_close_2.png";
3
- import "./Popup.css";
4
-
5
- interface PopupProps {
6
- children: React.ReactNode;
7
- onCloseClick: () => void;
8
- }
9
-
10
- const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
11
- return (
12
- <div className="popup-overlay">
13
- <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">
14
- <div className="end-0 top-0 position-absolute ">
15
- <img
16
- src={closeIcon}
17
- alt="close"
18
- className="closeIcon me-2"
19
- onClick={onCloseClick}
20
- />
21
- </div>
22
- {children}
23
- </div>
24
- </div>
25
- );
26
- };
27
-
28
- export default Popup;
1
+ import React from "react";
2
+ import closeIcon from "../../assets/images/icon_close_2.png";
3
+ import "./Popup.css";
4
+
5
+ interface PopupProps {
6
+ children: React.ReactNode;
7
+ onCloseClick: () => void;
8
+ }
9
+
10
+ const Popup: React.FC<PopupProps> = ({ onCloseClick, children }) => {
11
+ return (
12
+ <div className="popup-overlay">
13
+ <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">
14
+ <div className="end-0 top-0 position-absolute ">
15
+ <img
16
+ src={closeIcon}
17
+ alt="close"
18
+ className="closeIcon me-2"
19
+ onClick={onCloseClick}
20
+ />
21
+ </div>
22
+ {children}
23
+ </div>
24
+ </div>
25
+ );
26
+ };
27
+
28
+ export default Popup;