nestiq-component-library 1.0.46 → 1.1.0

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 (74) hide show
  1. package/dist/components/FloorPlanPopup/FloorPlanPopup.d.ts +7 -0
  2. package/dist/components/ImageListPopup/ImageListPopup.d.ts +1 -0
  3. package/dist/components/Popup/Popup.d.ts +1 -0
  4. package/dist/components/PropertyCard/PropertyCard.d.ts +4 -3
  5. package/dist/components/PropertyImageList/PropertyImageList.d.ts +1 -0
  6. package/dist/components/SharePopup/SharePopup.d.ts +4 -0
  7. package/dist/components/ToastWrapper/ToastWrapper.d.ts +4 -0
  8. package/dist/functions/util.d.ts +1 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.es.js +105 -36
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/index.js +108 -34
  13. package/dist/index.js.map +1 -1
  14. package/package.json +4 -1
  15. package/rollup.config.mjs +35 -35
  16. package/src/components/FloorPlanPopup/FloorPlanPopup.css +3 -0
  17. package/src/components/FloorPlanPopup/FloorPlanPopup.tsx +83 -0
  18. package/src/components/ImageListPopup/ImageListPopup.css +83 -107
  19. package/src/components/ImageListPopup/ImageListPopup.tsx +141 -140
  20. package/src/components/Popup/Popup.css +0 -13
  21. package/src/components/Popup/Popup.tsx +29 -28
  22. package/src/components/PropertyCard/PropertyCard.css +6 -5
  23. package/src/components/PropertyCard/PropertyCard.tsx +136 -135
  24. package/src/components/PropertyDetailsHeader/PropertyDetailsHeader.tsx +80 -84
  25. package/src/components/PropertyImageList/PropertyImageList.tsx +198 -173
  26. package/src/components/SharePopup/{PopUp.css → SharePopup.css} +0 -14
  27. package/src/components/SharePopup/{PopUp.tsx → SharePopup.tsx} +139 -140
  28. package/src/components/ToastWrapper/ToastWrapper.tsx +25 -0
  29. package/src/functions/util.ts +3 -0
  30. package/src/index.tsx +20 -7
  31. package/src/styles/common.css +12 -0
  32. package/dist/assets/images/Icon_rightArrow.svg +0 -3
  33. package/dist/assets/images/LayersIcon.svg +0 -5
  34. package/dist/assets/images/blackarrow-Right.svg +0 -3
  35. package/dist/assets/images/blckarrow-Left.svg +0 -3
  36. package/dist/assets/images/chevron-left.svg +0 -3
  37. package/dist/assets/images/default-property.jpg +0 -0
  38. package/dist/assets/images/heartIcon.svg +0 -3
  39. package/dist/assets/images/icon-close-white.webp +0 -0
  40. package/dist/assets/images/icon_close 2.e41bb9a4db48e048.png +0 -0
  41. package/dist/assets/images/icon_close_2.png +0 -0
  42. package/dist/assets/images/icon_gallery.svg +0 -4
  43. package/dist/assets/images/icon_map.svg +0 -10
  44. package/dist/assets/images/icon_share_1.svg +0 -3
  45. package/dist/assets/images/layer_icon.svg +0 -5
  46. package/dist/assets/images/locationIcon.svg +0 -4
  47. package/dist/assets/images/locationIconBlack.svg +0 -4
  48. package/dist/assets/images/no-image-icon.png +0 -0
  49. package/dist/components/Button/Button.js +0 -6
  50. package/dist/components/ImageListPopup/ImageListPopup.js +0 -26
  51. package/dist/components/Popup/Popup.js +0 -12
  52. package/dist/components/SharePopup/PopUp.d.ts +0 -7
  53. package/src/assets/images/Logo-Nestiq_black.svg +0 -7
  54. package/src/assets/images/arrow-right-short.svg +0 -3
  55. package/src/assets/images/arrow-right.svg +0 -10
  56. package/src/assets/images/close_white.png +0 -0
  57. package/src/assets/images/dropdownIcon.svg +0 -16
  58. package/src/assets/images/facebook_icon.svg +0 -3
  59. package/src/assets/images/google_icon.svg +0 -10
  60. package/src/assets/images/heartIcon.svg +0 -3
  61. package/src/assets/images/icon-close-white.webp +0 -0
  62. package/src/assets/images/icon_checkmark.svg +0 -10
  63. package/src/assets/images/icon_close 2.png +0 -0
  64. package/src/assets/images/icon_share 1.svg +0 -3
  65. package/src/assets/images/icon_user.png +0 -0
  66. package/src/assets/images/left arrow.svg +0 -16
  67. package/src/assets/images/left-arrow.svg +0 -4
  68. package/src/assets/images/mail-icon.png +0 -0
  69. package/src/assets/images/no-image-icon.png +0 -0
  70. package/src/assets/images/right arrow.svg +0 -16
  71. package/src/assets/images/right-arrow.svg +0 -4
  72. package/src/assets/images/warning.svg +0 -11
  73. package/src/assets/images/x.svg +0 -3
  74. package/src/components/PropertyCard/PropertyDaet.json +0 -1210
@@ -1,173 +1,198 @@
1
- import React, { useRef, useState } from "react";
2
- import iconArrowRight from "../../assets/Images/Icon_rightArrow.svg";
3
- import blcIconArrowRight from "../../assets/Images/blackarrow-Right.svg";
4
- import blcIconArrowLeft from "../../assets/Images/blckarrow-Left.svg";
5
- import iconArrowLeft from "../../assets/Images/chevron-left.svg";
6
- import iconGallery from "../../assets/Images/icon_gallery.svg";
7
- import iconMap from "../../assets/Images/icon_map.svg";
8
- import iconLayers from "../../assets/Images/layer_icon.svg";
9
- import "./PropertyImageList.css";
10
- import ImageListPopup from "../ImageListPopup/ImageListPopup";
11
- import PopupProps from "../ImageListPopup/ImageListPopup";
12
-
13
- interface PopupProps {
14
- pictureUrls: { title: string; url: string }[];
15
- }
16
- export default function PropertyImageList(prop: PopupProps) {
17
- const [currentImageIndex, setCurrentImageIndex] = useState(0);
18
- const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
19
- const imageListRef = useRef<HTMLDivElement | null>(null);
20
-
21
- const handleArrowClickInMainImage = (direction: any) => {
22
- if (prop.pictureUrls.length === 0) return;
23
-
24
- let newIndex = currentImageIndex;
25
- if (direction === "left") {
26
- newIndex =
27
- (currentImageIndex - 1 + prop.pictureUrls.length) %
28
- prop.pictureUrls.length;
29
- } else if (direction === "right") {
30
- newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
31
- }
32
-
33
- setCurrentImageIndex(newIndex);
34
-
35
- imageListRef.current!.scrollTo({
36
- left: newIndex * 150,
37
- behavior: "smooth",
38
- });
39
- };
40
-
41
- const toggleAllPhotos = () => {
42
- setIsImagePopupOpen(!isImagePopupOpen);
43
- };
44
-
45
- return (
46
- <div className="col-8 me-2 Pimagelist">
47
- <div
48
- className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
49
- style={{
50
- backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
51
- backgroundSize: "cover",
52
- backgroundPosition: "center",
53
- }}
54
- >
55
- {/* Arrows on the main image */}
56
- <div
57
- className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
58
- role="button"
59
- onClick={() => handleArrowClickInMainImage("left")}
60
- >
61
- <img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
62
- </div>
63
- <div
64
- role="button"
65
- className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
66
- onClick={() => handleArrowClickInMainImage("right")}
67
- >
68
- <img
69
- src={blcIconArrowRight}
70
- className="blackArrow"
71
- alt="Right Arrow"
72
- />
73
- </div>
74
- </div>
75
-
76
- {/* Image Thumbnails */}
77
- <div className="d-flex flex-row gap-1 col-12 secondList">
78
- <div className="col-lg-6 d-flex flex-row p-1">
79
- <div className="col-12 position-relative d-flex justify-content-center">
80
- <div
81
- className="col-1 h-100 d-flex position-absolute start-0"
82
- onClick={() => handleArrowClickInMainImage("left")}
83
- role="button"
84
- >
85
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
86
- <img
87
- src={iconArrowLeft}
88
- className="arroIconColour"
89
- alt="Left Arrow"
90
- />
91
- </div>
92
- </div>
93
- <div
94
- className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
95
- ref={imageListRef}
96
- >
97
- {prop.pictureUrls.length > 0 && (
98
- <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
99
- {prop.pictureUrls.map((picture, index) => (
100
- <div
101
- key={index}
102
- className="col-lg-12 h-100 d-flex"
103
- onClick={() => {
104
- setCurrentImageIndex(index);
105
- imageListRef.current!.scrollTo({
106
- left: index * 150,
107
- behavior: "smooth",
108
- });
109
- }}
110
- role="button"
111
- >
112
- <img
113
- src={picture.url}
114
- alt={`Image ${index + 1}`}
115
- className="col-12 h-100 rounded-3 object-fit-cover"
116
- />
117
- </div>
118
- ))}
119
- </div>
120
- )}
121
- </div>
122
- <div
123
- className="col-1 h-100 d-flex position-absolute end-0 top-0"
124
- onClick={() => handleArrowClickInMainImage("right")}
125
- role="button"
126
- >
127
- <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
128
- <img
129
- src={iconArrowRight}
130
- className="arroIconColour"
131
- alt="Right Arrow"
132
- />
133
- </div>
134
- </div>
135
- </div>
136
- </div>
137
-
138
- {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
139
- <div className="col-6 d-flex flex-row">
140
- <div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
141
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
142
- <img src={iconGallery} alt="Gallery Icon" />
143
- <span className="listImgText">Alle Fotos</span>
144
- </div>
145
- </div>
146
- <div className="col-lg-4 p-1" role="button">
147
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
148
- <img src={iconLayers} alt="Layers Icon" />
149
- <span className="listImgText">Grundriss</span>
150
- </div>
151
- </div>
152
- <div
153
- className="col-lg-4 p-1"
154
- role="button"
155
- onClick={() =>
156
- window.scrollTo({
157
- top: document.documentElement.scrollHeight,
158
- })
159
- }
160
- >
161
- <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
162
- <img src={iconMap} alt="Map Icon" />
163
- <span className="listImgText">Karte</span>
164
- </div>
165
- </div>
166
- </div>
167
- </div>
168
-
169
- {/* Popup for all photos */}
170
- {isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
171
- </div>
172
- );
173
- }
1
+ import React, { useRef, useState } from "react";
2
+ import iconArrowRight from "../../assets/images/Icon_rightArrow.svg";
3
+ import blcIconArrowRight from "../../assets/images/blackarrow-Right.svg";
4
+ import blcIconArrowLeft from "../../assets/images/blckarrow-Left.svg";
5
+ import iconArrowLeft from "../../assets/images/chevron-left.svg";
6
+ import iconGallery from "../../assets/images/icon_gallery.svg";
7
+ import iconMap from "../../assets/images/icon_map.svg";
8
+ import iconLayers from "../../assets/images/layer_icon.svg";
9
+ import "./PropertyImageList.css";
10
+ import ImageListPopup from "../ImageListPopup/ImageListPopup";
11
+ import PopupProps from "../ImageListPopup/ImageListPopup";
12
+ import FloorPlanPopup from "../FloorPlanPopup/FloorPlanPopup";
13
+
14
+ interface PopupProps {
15
+ pictureUrls: { title: string; url: string }[];
16
+ floorPlanUrl: string;
17
+ }
18
+ export default function PropertyImageList(prop: PopupProps) {
19
+ const [currentImageIndex, setCurrentImageIndex] = useState(0);
20
+ const [isImagePopupOpen, setIsImagePopupOpen] = useState(false);
21
+ const [isFloorPlanPopupOpen, setIsFloorPlanPopupOpen] = useState(false);
22
+ const imageListRef = useRef<HTMLDivElement | null>(null);
23
+
24
+ const handleArrowClickInMainImage = (direction: any) => {
25
+ if (prop.pictureUrls.length === 0) return;
26
+
27
+ let newIndex = currentImageIndex;
28
+ if (direction === "left") {
29
+ newIndex =
30
+ (currentImageIndex - 1 + prop.pictureUrls.length) %
31
+ prop.pictureUrls.length;
32
+ } else if (direction === "right") {
33
+ newIndex = (currentImageIndex + 1) % prop.pictureUrls.length;
34
+ }
35
+
36
+ setCurrentImageIndex(newIndex);
37
+
38
+ imageListRef.current!.scrollTo({
39
+ left: newIndex * 150,
40
+ behavior: "smooth",
41
+ });
42
+ };
43
+
44
+ const toggleAllPhotos = () => {
45
+ setIsImagePopupOpen(!isImagePopupOpen);
46
+ };
47
+
48
+ const floorPlanClickHandler = () => {
49
+ if (prop.floorPlanUrl) {
50
+ setIsFloorPlanPopupOpen(true);
51
+ }
52
+ };
53
+
54
+ const floorPlanPopupCloseHandler = () => {
55
+ setIsFloorPlanPopupOpen(false);
56
+ };
57
+
58
+ return (
59
+ <div className="col-8 me-2 Pimagelist">
60
+ <div
61
+ className="col-12 rounded-5 mainImage d-flex position-relative align-items-center"
62
+ style={{
63
+ backgroundImage: `url(${prop.pictureUrls[currentImageIndex]?.url})`,
64
+ backgroundSize: "cover",
65
+ backgroundPosition: "center",
66
+ }}
67
+ >
68
+ {/* Arrows on the main image */}
69
+ <div
70
+ className="rounded-circle border onImageArrow d-flex position-absolute start-0 ms-2 align-items-center justify-content-center"
71
+ role="button"
72
+ onClick={() => handleArrowClickInMainImage("left")}
73
+ >
74
+ <img src={blcIconArrowLeft} className="blackArrow" alt="Left Arrow" />
75
+ </div>
76
+ <div
77
+ role="button"
78
+ className="rounded-circle border onImageArrow d-flex position-absolute end-0 me-2 align-items-center justify-content-center"
79
+ onClick={() => handleArrowClickInMainImage("right")}
80
+ >
81
+ <img
82
+ src={blcIconArrowRight}
83
+ className="blackArrow"
84
+ alt="Right Arrow"
85
+ />
86
+ </div>
87
+ </div>
88
+
89
+ {/* Image Thumbnails */}
90
+ <div className="d-flex flex-row gap-1 col-12 secondList">
91
+ <div className="col-lg-6 d-flex flex-row p-1">
92
+ <div className="col-12 position-relative d-flex justify-content-center">
93
+ <div
94
+ className="col-1 h-100 d-flex position-absolute start-0"
95
+ onClick={() => handleArrowClickInMainImage("left")}
96
+ role="button"
97
+ >
98
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
99
+ <img
100
+ src={iconArrowLeft}
101
+ className="arroIconColour"
102
+ alt="Left Arrow"
103
+ />
104
+ </div>
105
+ </div>
106
+ <div
107
+ className="col-lg-10 rounded-3 h-100 d-flex flex-row gap-2 overflow-auto ms-1"
108
+ ref={imageListRef}
109
+ >
110
+ {prop.pictureUrls.length > 0 && (
111
+ <div className="col-lg-5 h-100 d-flex gap-2 flex-row rounded-3">
112
+ {prop.pictureUrls.map((picture, index) => (
113
+ <div
114
+ key={index}
115
+ className="col-lg-12 h-100 d-flex"
116
+ onClick={() => {
117
+ setCurrentImageIndex(index);
118
+ imageListRef.current!.scrollTo({
119
+ left: index * 150,
120
+ behavior: "smooth",
121
+ });
122
+ }}
123
+ role="button"
124
+ >
125
+ <img
126
+ src={picture.url}
127
+ alt={`Image ${index + 1}`}
128
+ className="col-12 h-100 rounded-3 object-fit-cover"
129
+ />
130
+ </div>
131
+ ))}
132
+ </div>
133
+ )}
134
+ </div>
135
+ <div
136
+ className="col-1 h-100 d-flex position-absolute end-0 top-0"
137
+ onClick={() => handleArrowClickInMainImage("right")}
138
+ role="button"
139
+ >
140
+ <div className="col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3 ms-1">
141
+ <img
142
+ src={iconArrowRight}
143
+ className="arroIconColour"
144
+ alt="Right Arrow"
145
+ />
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </div>
150
+
151
+ {/* Buttons for "Alle Fotos", "Grundriss", "Karte" */}
152
+ <div className="col-6 d-flex flex-row">
153
+ <div className="col-lg-4 p-1" role="button" onClick={toggleAllPhotos}>
154
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
155
+ <img src={iconGallery} alt="Gallery Icon" />
156
+ <span className="listImgText">Alle Fotos</span>
157
+ </div>
158
+ </div>
159
+ <div
160
+ className="col-lg-4 p-1"
161
+ role="button"
162
+ onClick={floorPlanClickHandler}
163
+ >
164
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
165
+ <img src={iconLayers} alt="Layers Icon" />
166
+ <span className="listImgText">Grundriss</span>
167
+ </div>
168
+ </div>
169
+ <div
170
+ className="col-lg-4 p-1"
171
+ role="button"
172
+ onClick={() =>
173
+ window.scrollTo({
174
+ top: document.documentElement.scrollHeight,
175
+ })
176
+ }
177
+ >
178
+ <div className="border col-lg-12 h-100 d-flex flex-column listImageButton border-0 rounded-3">
179
+ <img src={iconMap} alt="Map Icon" />
180
+ <span className="listImgText">Karte</span>
181
+ </div>
182
+ </div>
183
+ </div>
184
+ </div>
185
+
186
+ {/* Popup for all photos */}
187
+ {isImagePopupOpen && <ImageListPopup pictureUrls={prop.pictureUrls} />}
188
+
189
+ {/* Popup for floor plan */}
190
+ {isFloorPlanPopupOpen && (
191
+ <FloorPlanPopup
192
+ contentUrl={prop.floorPlanUrl}
193
+ onCloseClick={floorPlanPopupCloseHandler}
194
+ />
195
+ )}
196
+ </div>
197
+ );
198
+ }
@@ -1,17 +1,3 @@
1
- .popup-overlay {
2
- position: fixed; /* Fixed position to cover the whole screen */
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
8
- display: flex; /* Flexbox to center the popup */
9
- justify-content: center; /* Center horizontally */
10
- align-items: center; /* Center vertically */
11
- z-index: 2000; /* Ensure it's above other content */
12
-
13
- }
14
-
15
1
  .shareSection {
16
2
  height: 340px;
17
3
  padding: 40px;