nestiq-component-library 1.0.0 → 1.0.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.
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import "bootstrap/dist/css/bootstrap.min.css";
3
+ import "./ImageListPopup.css";
4
+ interface Image {
5
+ src: string;
6
+ title: string;
7
+ }
8
+ interface ImageListPopupProps {
9
+ images: Image[];
10
+ onClose: () => void;
11
+ }
12
+ declare const ImageListPopup: React.FC<ImageListPopupProps>;
13
+ export default ImageListPopup;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import "./Popup.css";
3
+ interface PopupProps {
4
+ children: React.ReactNode;
5
+ onCloseClick: () => void;
6
+ }
7
+ declare const Popup: React.FC<PopupProps>;
8
+ export default Popup;
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export { default as Button } from './components/Button/Button';
1
+ export { default as Button } from "./components/Button/Button";
2
+ export { default as Popup } from "./components/Popup/Popup";
3
+ export { default as ImageListPopup } from "./components/ImageListPopup/ImageListPopup";
package/dist/index.es.js CHANGED
@@ -1,9 +1,76 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
+ import closeIcon from 'src/assets/images/icon_close 2.png';
3
+ import 'bootstrap/dist/css/bootstrap.min.css';
2
4
 
3
5
  var Button = function (_a) {
4
6
  var label = _a.label;
5
7
  return React.createElement("button", null, label);
6
8
  };
7
9
 
8
- export { Button };
10
+ function styleInject(css, ref) {
11
+ if ( ref === void 0 ) ref = {};
12
+ var insertAt = ref.insertAt;
13
+
14
+ if (!css || typeof document === 'undefined') { return; }
15
+
16
+ var head = document.head || document.getElementsByTagName('head')[0];
17
+ var style = document.createElement('style');
18
+ style.type = 'text/css';
19
+
20
+ if (insertAt === 'top') {
21
+ if (head.firstChild) {
22
+ head.insertBefore(style, head.firstChild);
23
+ } else {
24
+ head.appendChild(style);
25
+ }
26
+ } else {
27
+ head.appendChild(style);
28
+ }
29
+
30
+ if (style.styleSheet) {
31
+ style.styleSheet.cssText = css;
32
+ } else {
33
+ style.appendChild(document.createTextNode(css));
34
+ }
35
+ }
36
+
37
+ var css_248z$1 = ".popup-overlay {\r\n position: fixed; /* Fixed position to cover the whole screen */\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */\r\n display: flex; /* Flexbox to center the popup */\r\n justify-content: center; /* Center horizontally */\r\n align-items: center; /* Center vertically */\r\n z-index: 10000; /* Ensure it's above other content */\r\n}\r\n\r\n.popUpHeader {\r\n height: 48px;\r\n font-size: 32px;\r\n font-weight: 600;\r\n color: #1b1b1b;\r\n}\r\n\r\n.closeIcon {\r\n width: 16px;\r\n height: 16px;\r\n cursor: pointer;\r\n}\r\n";
38
+ styleInject(css_248z$1);
39
+
40
+ var Popup = function (_a) {
41
+ var onCloseClick = _a.onCloseClick, children = _a.children;
42
+ return (React.createElement("div", { className: "popup-overlay" },
43
+ React.createElement("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" },
44
+ React.createElement("div", { className: "end-0 top-0 position-absolute " },
45
+ React.createElement("img", { src: closeIcon, alt: "close", className: "closeIcon me-2", onClick: onCloseClick })),
46
+ children)));
47
+ };
48
+
49
+ var css_248z = ".popup-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 10000;\r\n}\r\n\r\n.popup-container {\r\n background-color: #fff;\r\n border-radius: 8px;\r\n max-width: 90%;\r\n max-height: 90%;\r\n overflow: hidden;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.popup-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 1rem;\r\n border-bottom: 1px solid #ddd;\r\n}\r\n\r\n.popup-body {\r\n flex: 1;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n}\r\n\r\n.popup-body img {\r\n max-width: 100%;\r\n max-height: 100%;\r\n}\r\n\r\n.popup-footer {\r\n padding: 1rem;\r\n text-align: center;\r\n border-top: 1px solid #ddd;\r\n}\r\n";
50
+ styleInject(css_248z);
51
+
52
+ var ImageListPopup = function (_a) {
53
+ var images = _a.images, onClose = _a.onClose;
54
+ var _b = useState(0), currentIndex = _b[0], setCurrentIndex = _b[1];
55
+ var handlePrevious = function () {
56
+ setCurrentIndex(function (prevIndex) { return (prevIndex > 0 ? prevIndex - 1 : prevIndex); });
57
+ };
58
+ var handleNext = function () {
59
+ setCurrentIndex(function (prevIndex) {
60
+ return prevIndex < images.length - 1 ? prevIndex + 1 : prevIndex;
61
+ });
62
+ };
63
+ return (React.createElement("div", { className: "popup-overlay" },
64
+ React.createElement("div", { className: "popup-container" },
65
+ React.createElement("div", { className: "popup-header" },
66
+ React.createElement("span", null, images[currentIndex].title),
67
+ React.createElement("button", { className: "btn-close", onClick: onClose })),
68
+ React.createElement("div", { className: "popup-body" },
69
+ React.createElement("img", { src: images[currentIndex].src, alt: images[currentIndex].title, className: "img-fluid" })),
70
+ React.createElement("div", { className: "popup-footer" }, images.length > 1 && (React.createElement(React.Fragment, null,
71
+ React.createElement("button", { className: "btn btn-secondary me-2", onClick: handlePrevious }, "Previous"),
72
+ React.createElement("button", { className: "btn btn-secondary", onClick: handleNext }, "Next")))))));
73
+ };
74
+
75
+ export { Button, ImageListPopup, Popup };
9
76
  //# sourceMappingURL=index.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
package/dist/index.js CHANGED
@@ -1,11 +1,80 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var closeIcon = require('src/assets/images/icon_close 2.png');
5
+ require('bootstrap/dist/css/bootstrap.min.css');
4
6
 
5
7
  var Button = function (_a) {
6
8
  var label = _a.label;
7
9
  return React.createElement("button", null, label);
8
10
  };
9
11
 
12
+ function styleInject(css, ref) {
13
+ if ( ref === void 0 ) ref = {};
14
+ var insertAt = ref.insertAt;
15
+
16
+ if (!css || typeof document === 'undefined') { return; }
17
+
18
+ var head = document.head || document.getElementsByTagName('head')[0];
19
+ var style = document.createElement('style');
20
+ style.type = 'text/css';
21
+
22
+ if (insertAt === 'top') {
23
+ if (head.firstChild) {
24
+ head.insertBefore(style, head.firstChild);
25
+ } else {
26
+ head.appendChild(style);
27
+ }
28
+ } else {
29
+ head.appendChild(style);
30
+ }
31
+
32
+ if (style.styleSheet) {
33
+ style.styleSheet.cssText = css;
34
+ } else {
35
+ style.appendChild(document.createTextNode(css));
36
+ }
37
+ }
38
+
39
+ var css_248z$1 = ".popup-overlay {\r\n position: fixed; /* Fixed position to cover the whole screen */\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */\r\n display: flex; /* Flexbox to center the popup */\r\n justify-content: center; /* Center horizontally */\r\n align-items: center; /* Center vertically */\r\n z-index: 10000; /* Ensure it's above other content */\r\n}\r\n\r\n.popUpHeader {\r\n height: 48px;\r\n font-size: 32px;\r\n font-weight: 600;\r\n color: #1b1b1b;\r\n}\r\n\r\n.closeIcon {\r\n width: 16px;\r\n height: 16px;\r\n cursor: pointer;\r\n}\r\n";
40
+ styleInject(css_248z$1);
41
+
42
+ var Popup = function (_a) {
43
+ var onCloseClick = _a.onCloseClick, children = _a.children;
44
+ return (React.createElement("div", { className: "popup-overlay" },
45
+ React.createElement("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" },
46
+ React.createElement("div", { className: "end-0 top-0 position-absolute " },
47
+ React.createElement("img", { src: closeIcon, alt: "close", className: "closeIcon me-2", onClick: onCloseClick })),
48
+ children)));
49
+ };
50
+
51
+ var css_248z = ".popup-overlay {\r\n position: fixed;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background-color: rgba(0, 0, 0, 0.5);\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n z-index: 10000;\r\n}\r\n\r\n.popup-container {\r\n background-color: #fff;\r\n border-radius: 8px;\r\n max-width: 90%;\r\n max-height: 90%;\r\n overflow: hidden;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.popup-header {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 1rem;\r\n border-bottom: 1px solid #ddd;\r\n}\r\n\r\n.popup-body {\r\n flex: 1;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n padding: 1rem;\r\n}\r\n\r\n.popup-body img {\r\n max-width: 100%;\r\n max-height: 100%;\r\n}\r\n\r\n.popup-footer {\r\n padding: 1rem;\r\n text-align: center;\r\n border-top: 1px solid #ddd;\r\n}\r\n";
52
+ styleInject(css_248z);
53
+
54
+ var ImageListPopup = function (_a) {
55
+ var images = _a.images, onClose = _a.onClose;
56
+ var _b = React.useState(0), currentIndex = _b[0], setCurrentIndex = _b[1];
57
+ var handlePrevious = function () {
58
+ setCurrentIndex(function (prevIndex) { return (prevIndex > 0 ? prevIndex - 1 : prevIndex); });
59
+ };
60
+ var handleNext = function () {
61
+ setCurrentIndex(function (prevIndex) {
62
+ return prevIndex < images.length - 1 ? prevIndex + 1 : prevIndex;
63
+ });
64
+ };
65
+ return (React.createElement("div", { className: "popup-overlay" },
66
+ React.createElement("div", { className: "popup-container" },
67
+ React.createElement("div", { className: "popup-header" },
68
+ React.createElement("span", null, images[currentIndex].title),
69
+ React.createElement("button", { className: "btn-close", onClick: onClose })),
70
+ React.createElement("div", { className: "popup-body" },
71
+ React.createElement("img", { src: images[currentIndex].src, alt: images[currentIndex].title, className: "img-fluid" })),
72
+ React.createElement("div", { className: "popup-footer" }, images.length > 1 && (React.createElement(React.Fragment, null,
73
+ React.createElement("button", { className: "btn btn-secondary me-2", onClick: handlePrevious }, "Previous"),
74
+ React.createElement("button", { className: "btn btn-secondary", onClick: handleNext }, "Next")))))));
75
+ };
76
+
10
77
  exports.Button = Button;
78
+ exports.ImageListPopup = ImageListPopup;
79
+ exports.Popup = Popup;
11
80
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../node_modules/style-inject/dist/style-inject.es.js"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,UAAU,EAAE;AACxB,IAAI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAG,GAAG,CAAC;AACnC,GAAG,MAAM;AACT,IAAI,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACpD,GAAG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nestiq-component-library",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
@@ -18,10 +18,13 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rollup/plugin-commonjs": "^26.0.1",
21
+ "@rollup/plugin-image": "^3.0.3",
21
22
  "@rollup/plugin-node-resolve": "^15.2.3",
23
+ "@rollup/plugin-url": "^8.0.2",
22
24
  "@types/react": "^18.3.3",
23
25
  "@types/react-dom": "^18.3.0",
24
26
  "rollup": "^4.18.0",
27
+ "rollup-plugin-postcss": "^4.0.2",
25
28
  "rollup-plugin-typescript2": "^0.36.0",
26
29
  "typescript": "^5.4.5"
27
30
  },
package/rollup.config.mjs CHANGED
@@ -1,20 +1,31 @@
1
- import typescript from 'rollup-plugin-typescript2';
2
- import pkg from './package.json' assert { type: 'json' };
3
-
4
- export default {
5
- input: 'src/index.tsx',
6
- output: [
7
- {
8
- file: pkg.main,
9
- format: 'cjs',
10
- sourcemap: true,
11
- },
12
- {
13
- file: pkg.module,
14
- format: 'es',
15
- sourcemap: true,
16
- },
17
- ],
18
- external: ['react', 'react-dom'],
19
- plugins: [typescript()],
20
- };
1
+ import typescript from "rollup-plugin-typescript2";
2
+ import url from "@rollup/plugin-url";
3
+ import postcss from "rollup-plugin-postcss";
4
+ import pkg from "./package.json" assert { type: "json" };
5
+
6
+ export default {
7
+ input: "src/index.tsx",
8
+ output: [
9
+ {
10
+ file: pkg.main,
11
+ format: "cjs",
12
+ sourcemap: true,
13
+ },
14
+ {
15
+ file: pkg.module,
16
+ format: "es",
17
+ sourcemap: true,
18
+ },
19
+ ],
20
+ external: ["react", "react-dom"],
21
+ plugins: [
22
+ typescript(),
23
+ postcss({
24
+ extensions: [".css"],
25
+ }),
26
+ url({
27
+ include: ["**/*.svg", "**/*.png", "**/*.jpg", "**/*.jpeg", "**/*.gif"],
28
+ limit: 0,
29
+ }),
30
+ ],
31
+ };
@@ -0,0 +1,49 @@
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.5);
8
+ display: flex;
9
+ justify-content: center;
10
+ align-items: center;
11
+ z-index: 10000;
12
+ }
13
+
14
+ .popup-container {
15
+ background-color: #fff;
16
+ border-radius: 8px;
17
+ max-width: 90%;
18
+ max-height: 90%;
19
+ overflow: hidden;
20
+ display: flex;
21
+ flex-direction: column;
22
+ }
23
+
24
+ .popup-header {
25
+ display: flex;
26
+ justify-content: space-between;
27
+ align-items: center;
28
+ padding: 1rem;
29
+ border-bottom: 1px solid #ddd;
30
+ }
31
+
32
+ .popup-body {
33
+ flex: 1;
34
+ display: flex;
35
+ justify-content: center;
36
+ align-items: center;
37
+ padding: 1rem;
38
+ }
39
+
40
+ .popup-body img {
41
+ max-width: 100%;
42
+ max-height: 100%;
43
+ }
44
+
45
+ .popup-footer {
46
+ padding: 1rem;
47
+ text-align: center;
48
+ border-top: 1px solid #ddd;
49
+ }
@@ -0,0 +1,62 @@
1
+ import React, { useState } from "react";
2
+ import "bootstrap/dist/css/bootstrap.min.css";
3
+ import "./ImageListPopup.css";
4
+
5
+ interface Image {
6
+ src: string;
7
+ title: string;
8
+ }
9
+
10
+ interface ImageListPopupProps {
11
+ images: Image[];
12
+ onClose: () => void;
13
+ }
14
+
15
+ const ImageListPopup: React.FC<ImageListPopupProps> = ({ images, onClose }) => {
16
+ const [currentIndex, setCurrentIndex] = useState(0);
17
+
18
+ const handlePrevious = () => {
19
+ setCurrentIndex((prevIndex) => (prevIndex > 0 ? prevIndex - 1 : prevIndex));
20
+ };
21
+
22
+ const handleNext = () => {
23
+ setCurrentIndex((prevIndex) =>
24
+ prevIndex < images.length - 1 ? prevIndex + 1 : prevIndex,
25
+ );
26
+ };
27
+
28
+ return (
29
+ <div className="popup-overlay">
30
+ <div className="popup-container">
31
+ <div className="popup-header">
32
+ <span>{images[currentIndex].title}</span>
33
+ <button className="btn-close" onClick={onClose}></button>
34
+ </div>
35
+ <div className="popup-body">
36
+ <img
37
+ src={images[currentIndex].src}
38
+ alt={images[currentIndex].title}
39
+ className="img-fluid"
40
+ />
41
+ </div>
42
+ <div className="popup-footer">
43
+ {images.length > 1 && (
44
+ <>
45
+ <button
46
+ className="btn btn-secondary me-2"
47
+ onClick={handlePrevious}
48
+ >
49
+ Previous
50
+ </button>
51
+ <button className="btn btn-secondary" onClick={handleNext}>
52
+ Next
53
+ </button>
54
+ </>
55
+ )}
56
+ </div>
57
+ </div>
58
+ </div>
59
+ );
60
+ };
61
+
62
+ export default ImageListPopup;
@@ -0,0 +1,25 @@
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: 10000; /* Ensure it's above other content */
12
+ }
13
+
14
+ .popUpHeader {
15
+ height: 48px;
16
+ font-size: 32px;
17
+ font-weight: 600;
18
+ color: #1b1b1b;
19
+ }
20
+
21
+ .closeIcon {
22
+ width: 16px;
23
+ height: 16px;
24
+ cursor: pointer;
25
+ }
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import closeIcon from "src/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;
package/src/index.tsx CHANGED
@@ -1 +1,3 @@
1
- export { default as Button } from './components/Button/Button';
1
+ export { default as Button } from "./components/Button/Button";
2
+ export { default as Popup } from "./components/Popup/Popup";
3
+ export { default as ImageListPopup } from "./components/ImageListPopup/ImageListPopup";
@@ -0,0 +1,25 @@
1
+ // src/types/images.d.ts
2
+ declare module '*.png' {
3
+ const value: string;
4
+ export default value;
5
+ }
6
+
7
+ declare module '*.svg' {
8
+ const value: string;
9
+ export default value;
10
+ }
11
+
12
+ declare module '*.jpg' {
13
+ const value: string;
14
+ export default value;
15
+ }
16
+
17
+ declare module '*.jpeg' {
18
+ const value: string;
19
+ export default value;
20
+ }
21
+
22
+ declare module '*.gif' {
23
+ const value: string;
24
+ export default value;
25
+ }
package/tsconfig.json CHANGED
@@ -8,7 +8,13 @@
8
8
  "strict": true,
9
9
  "esModuleInterop": true,
10
10
  "skipLibCheck": true,
11
- "forceConsistentCasingInFileNames": true
11
+ "forceConsistentCasingInFileNames": true,
12
+ "moduleResolution": "node",
13
+ "resolveJsonModule": true,
14
+ "baseUrl": ".",
15
+ "paths": {
16
+ "*": ["node_modules/*", "src/types/*"]
17
+ }
12
18
  },
13
19
  "include": ["src"]
14
20
  }