px-react-ui-components 1.0.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 (75) hide show
  1. package/.babelrc +3 -0
  2. package/README.md +126 -0
  3. package/dist/components/MyAlert/MyAlert.css +113 -0
  4. package/dist/components/MyAlert/MyAlert.js +109 -0
  5. package/dist/components/MyContainer/MyContainer.js +59 -0
  6. package/dist/components/MyContainer/MyContainer.module.css +110 -0
  7. package/dist/components/MyContainer/MyContainerBody.js +9 -0
  8. package/dist/components/MyContainer/MyContainerFooter.js +9 -0
  9. package/dist/components/MyContainer/MyContainerRight.js +10 -0
  10. package/dist/components/MyEditor/MyEditor.js +292 -0
  11. package/dist/components/MyEditor/MyEditor.scss +277 -0
  12. package/dist/components/MyFileUpload/MyFileUpload.js +288 -0
  13. package/dist/components/MyFileUpload/MyFileUpload.module.css +86 -0
  14. package/dist/components/MyImageCropper/MyImageCropper.js +95 -0
  15. package/dist/components/MyInput/MyInput.js +768 -0
  16. package/dist/components/MyInput/MyInput.module.css +420 -0
  17. package/dist/components/MyMaps/YandexMaps.js +162 -0
  18. package/dist/components/MyMenu/MenuItem.js +55 -0
  19. package/dist/components/MyMenu/MyMenu.module.css +102 -0
  20. package/dist/components/MyModal/MyModal.css +83 -0
  21. package/dist/components/MyModal/MyModal.js +71 -0
  22. package/dist/components/MyModal/MyModalBody.js +9 -0
  23. package/dist/components/MyModal/MyModalFooter.js +9 -0
  24. package/dist/components/MyNotFound/MyNotFound.css +22 -0
  25. package/dist/components/MyNotFound/MyNotFound.js +20 -0
  26. package/dist/components/MyScrollableCard/MyScrollableCard.js +74 -0
  27. package/dist/components/MyTable/MyTable.js +310 -0
  28. package/dist/components/MyTable/MyTable.module.css +350 -0
  29. package/dist/components/MyTable/MyTableBody.js +9 -0
  30. package/dist/components/MyTable/MyTableHead.js +9 -0
  31. package/dist/components/MyTabs/MyTabPane.js +17 -0
  32. package/dist/components/MyTabs/MyTabs.css +105 -0
  33. package/dist/components/MyTabs/MyTabs.js +66 -0
  34. package/dist/components/MyWaiting/MyWaiting.css +28 -0
  35. package/dist/components/MyWaiting/MyWaiting.js +27 -0
  36. package/dist/components/MyZoomImage/MyZoomImage.css +0 -0
  37. package/dist/components/MyZoomImage/MyZoomImage.js +108 -0
  38. package/dist/index.js +15 -0
  39. package/package.json +44 -0
  40. package/src/components/MyAlert/MyAlert.css +113 -0
  41. package/src/components/MyAlert/MyAlert.jsx +96 -0
  42. package/src/components/MyContainer/MyContainer.jsx +90 -0
  43. package/src/components/MyContainer/MyContainer.module.css +110 -0
  44. package/src/components/MyContainer/MyContainerBody.jsx +8 -0
  45. package/src/components/MyContainer/MyContainerFooter.jsx +8 -0
  46. package/src/components/MyContainer/MyContainerRight.jsx +11 -0
  47. package/src/components/MyEditor/MyEditor.jsx +252 -0
  48. package/src/components/MyEditor/MyEditor.scss +277 -0
  49. package/src/components/MyFileUpload/MyFileUpload.jsx +373 -0
  50. package/src/components/MyFileUpload/MyFileUpload.module.css +86 -0
  51. package/src/components/MyImageCropper/MyImageCropper.jsx +108 -0
  52. package/src/components/MyInput/MyInput.jsx +896 -0
  53. package/src/components/MyInput/MyInput.module.css +420 -0
  54. package/src/components/MyMaps/YandexMaps.jsx +186 -0
  55. package/src/components/MyMenu/MenuItem.jsx +62 -0
  56. package/src/components/MyMenu/MyMenu.module.css +102 -0
  57. package/src/components/MyModal/MyModal.css +83 -0
  58. package/src/components/MyModal/MyModal.jsx +78 -0
  59. package/src/components/MyModal/MyModalBody.jsx +8 -0
  60. package/src/components/MyModal/MyModalFooter.jsx +8 -0
  61. package/src/components/MyNotFound/MyNotFound.css +22 -0
  62. package/src/components/MyNotFound/MyNotFound.jsx +11 -0
  63. package/src/components/MyScrollableCard/MyScrollableCard.jsx +86 -0
  64. package/src/components/MyTable/MyTable.jsx +458 -0
  65. package/src/components/MyTable/MyTable.module.css +350 -0
  66. package/src/components/MyTable/MyTableBody.jsx +8 -0
  67. package/src/components/MyTable/MyTableHead.jsx +10 -0
  68. package/src/components/MyTabs/MyTabPane.jsx +9 -0
  69. package/src/components/MyTabs/MyTabs.css +105 -0
  70. package/src/components/MyTabs/MyTabs.jsx +63 -0
  71. package/src/components/MyWaiting/MyWaiting.css +28 -0
  72. package/src/components/MyWaiting/MyWaiting.jsx +27 -0
  73. package/src/components/MyZoomImage/MyZoomImage.css +0 -0
  74. package/src/components/MyZoomImage/MyZoomImage.jsx +139 -0
  75. package/src/index.js +15 -0
package/.babelrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-react"]
3
+ }
package/README.md ADDED
@@ -0,0 +1,126 @@
1
+ # My React UI Components
2
+
3
+ A modern, customizable React UI components library designed to simplify web development. This library provides a comprehensive set of reusable components with built-in functionality for various input types, containers, and tab navigation.
4
+
5
+ ## Features
6
+
7
+ - 🎨 Modern and responsive design
8
+ - 📱 Multiple input types (Text, Select, Date, Number, Phone, Email)
9
+ - 🧩 Customizable components with extensive props
10
+ - 🎯 Built with React 18 for optimal performance
11
+ - 🔧 Easy to integrate and use
12
+ - 📚 Comprehensive documentation
13
+ - 🎭 Tab navigation with rich features (labels, titles, descriptions, badges, icons)
14
+ - 🛠️ Type-safe components
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ # Install the main package
20
+ npm install px-react-ui-components
21
+
22
+ # Install required peer dependencies
23
+ npm install react@^18.3.1 react-dom@^18.3.1 katex@^0.16.21 quill@^2.0.3 quill-image-resize-module-react@^3.0.0 quill-table-ui@^1.0.7 react-confirm-alert@^3.0.6 react-icons@^5.5.0 react-image-crop@^11.0.7 react-loader-spinner@^6.1.6 react-zoom-pan-pinch@^3.7.0
24
+ ```
25
+
26
+ ## Peer Dependencies
27
+
28
+ This library requires the following peer dependencies to be installed in your project:
29
+
30
+ ```json
31
+ {
32
+ "react": "^18.3.1",
33
+ "react-dom": "^18.3.1",
34
+ "katex": "^0.16.21",
35
+ "quill": "^2.0.3",
36
+ "quill-image-resize-module-react": "^3.0.0",
37
+ "quill-table-ui": "^1.0.7",
38
+ "react-confirm-alert": "^3.0.6",
39
+ "react-icons": "^5.5.0",
40
+ "react-image-crop": "^11.0.7",
41
+ "react-loader-spinner": "^6.1.6",
42
+ "react-zoom-pan-pinch": "^3.7.0"
43
+ }
44
+ ```
45
+
46
+ ## Available Components
47
+
48
+ The library includes the following components:
49
+
50
+ - `MyAlert` :
51
+ - `MyEditor` :
52
+ - `MyFileUpload` :
53
+ - `MyImageCropper` :
54
+ - `MyMaps` :
55
+ - `MyMenu` :
56
+ - `MyModal` :
57
+ - `MyNotFound` :
58
+ - `MyScrollableCard` :
59
+ - `MyTable` :
60
+ - `MyWaiting` :
61
+ - `MyZoomImage` :
62
+ - `MyInput`: A versatile input component supporting multiple types:
63
+ - TEXT
64
+ - PASSWORD
65
+ - SELECT
66
+ - SELECTFILTER
67
+ - FILE
68
+ - IMAGE
69
+ - TEXTAREA
70
+ - COLOR
71
+ - READONLY
72
+ - DATE
73
+ - DATETIME
74
+ - TIME
75
+ - MONEY
76
+ - NUMBER
77
+ - MAIL
78
+ - PHONE
79
+ - `MyContainer`: A flexible container component
80
+ - `MyTabs`: Advanced tab navigation with rich features
81
+
82
+
83
+ ## Usage
84
+
85
+ Import components as needed:
86
+
87
+ ```jsx
88
+ import { MyInput, MyContainer, MyTabs, MyTabPane, MyInputType } from 'px-react-ui-components';
89
+
90
+ // Example usage
91
+ function App() {
92
+ return (
93
+ <MyContainer>
94
+ <MyInput type={MyInputType.TEXT} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
95
+ <MyInput type={MyInputType.SELECT} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
96
+ <MyInput type={MyInputType.DATE} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
97
+ <MyInput type={MyInputType.NUMBER} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
98
+ <MyInput type={MyInputType.PHONE} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
99
+ <MyInput type={MyInputType.MAIL} value={param} onChange={() => setParam(e.value)} placeholder="Enter text" />
100
+
101
+ <MyTabs>
102
+ <MyTabPane label="Tab 1" title="" description="" badge="" icon="" className="">Content for Tab 1</MyTabPane>
103
+ <MyTabPane label="Tab 2" title="" description="" badge="" icon="" className="">Content for Tab 2</MyTabPane>
104
+ </MyTabs>
105
+ </MyContainer>
106
+ );
107
+ }
108
+ ```
109
+
110
+ ## Development
111
+
112
+ To build the project:
113
+
114
+ ```bash
115
+ npm run build
116
+ ```
117
+
118
+ This will compile the source files from `src` to `dist` directory.
119
+
120
+ ## License
121
+
122
+ MIT © Piri AYKUT
123
+
124
+ ## Author
125
+
126
+ Piri AYKUT | piriaykut@gmail.com
@@ -0,0 +1,113 @@
1
+
2
+ .react-confirm-alert-blur {
3
+ filter: url(#gaussian-blur);
4
+ filter: blur(2px);
5
+ -webkit-filter: blur(2px);
6
+ }
7
+
8
+ .react-confirm-alert-overlay {
9
+ position: fixed;
10
+ top: 0;
11
+ left: 0;
12
+ right: 0;
13
+ bottom: 0;
14
+ z-index: 9999;
15
+ background: rgba(99, 99, 99, 0.9);
16
+ display: -webkit-flex;
17
+ display: -moz-flex;
18
+ display: -ms-flex;
19
+ display: -o-flex;
20
+ display: flex;
21
+ justify-content: center;
22
+ -ms-align-items: center;
23
+ align-items: center;
24
+ opacity: 0;
25
+ -webkit-animation: react-confirm-alert-fadeIn 0.5s 0.2s forwards;
26
+ -moz-animation: react-confirm-alert-fadeIn 0.5s 0.2s forwards;
27
+ -o-animation: react-confirm-alert-fadeIn 0.5s 0.2s forwards;
28
+ animation: react-confirm-alert-fadeIn 0.5s 0.2s forwards;
29
+ }
30
+
31
+ .react-confirm-alert-body {
32
+ font-family: "Nunito", sans-serif;
33
+ width: 90%; /* Daha geniş cihazlarda %90 genişlik */
34
+ max-width: 400px; /* Maksimum genişlik sınırı */
35
+ padding: 20px;
36
+ text-align: left;
37
+ background: #fff;
38
+ border-radius: 10px;
39
+ box-shadow: 0 20px 75px rgba(0, 0, 0, 0.13);
40
+ color: #666;
41
+ text-align: center;
42
+ margin: 0 auto; /* Orta hizalama */
43
+ }
44
+
45
+ @media (max-width: 600px) {
46
+ .react-confirm-alert-body {
47
+ width: 95%; /* Küçük ekranlarda daha fazla boşluk */
48
+ max-width: 320px; /* Maksimum genişlik daha küçük */
49
+ }
50
+ }
51
+
52
+ .react-confirm-alert-svg {
53
+ position: absolute;
54
+ top: 0;
55
+ left: 0;
56
+ }
57
+
58
+ .react-confirm-alert-body > h1 {
59
+ margin-top: 0;
60
+ color: #1e293b !important;
61
+ font-weight: bold;
62
+ font-size: 1.3em;
63
+ border-radius: 0px;
64
+ }
65
+
66
+ .react-confirm-alert-body > h3 {
67
+ margin: 0;
68
+ font-size: 3.5em !important;
69
+ color: #1e293b !important;
70
+ }
71
+
72
+ .react-confirm-alert-button-group {
73
+ display: -webkit-flex;
74
+ display: -moz-flex;
75
+ display: -ms-flex;
76
+ display: -o-flex;
77
+ display: flex;
78
+ justify-content: space-between;
79
+ margin-top: 30px;
80
+ }
81
+
82
+ .react-confirm-alert-button-group > button {
83
+ outline: none;
84
+ background: #1e293b;
85
+ border: none;
86
+ display: inline-block;
87
+ padding: 10px 18px;
88
+ color: #fff;
89
+ margin-right: 10px;
90
+ border-radius: 5px;
91
+ font-size: 1em;
92
+ cursor: pointer;
93
+ width: 100%;
94
+
95
+ &:hover {
96
+ opacity: 0.8;
97
+ }
98
+
99
+ &:last-child {
100
+ background: #506280 !important;
101
+ color: #fff;
102
+ }
103
+ &:first-child {
104
+ background: #1e293b !important;
105
+ color: #fff;
106
+ }
107
+ }
108
+
109
+ .react-confirm-alert-body {
110
+ width: 500px;
111
+ max-height: 300px;
112
+ overflow: auto;
113
+ }
@@ -0,0 +1,109 @@
1
+ import React from "react";
2
+ import { confirmAlert } from "react-confirm-alert";
3
+ import "react-confirm-alert/src/react-confirm-alert.css";
4
+ import "./MyAlert.css";
5
+
6
+ // import Swal from "sweetalert2";
7
+
8
+ export const MyAlertType = {
9
+ WARNING: 'warning',
10
+ ERROR: 'error',
11
+ SUCCESS: 'success',
12
+ INFO: 'info',
13
+ QUESTION: 'question'
14
+ };
15
+ Object.freeze(MyAlertType); // Enum sabitlerini değiştirmeyi engeller
16
+
17
+ export const MyAlert = (message, type = MyAlertType.INFO, {
18
+ title = '',
19
+ buttontext = {
20
+ confirm: 'Tamam',
21
+ cancel: 'İptal'
22
+ },
23
+ callback = null
24
+ } = {}) => {
25
+ let _showCancelButton = false;
26
+ switch (type) {
27
+ case MyAlertType.WARNING:
28
+ title = title ? title : 'Uyarı';
29
+ break;
30
+ case MyAlertType.ERROR:
31
+ title = title ? title : 'Hata!';
32
+ break;
33
+ case MyAlertType.SUCCESS:
34
+ title = title ? title : 'İşlem Başarılı';
35
+ break;
36
+ case MyAlertType.INFO:
37
+ title = title ? title : 'Bilgi';
38
+ break;
39
+ case MyAlertType.QUESTION:
40
+ title = title ? title : 'Onaylıyor musunuz?';
41
+ _showCancelButton = true;
42
+ if (buttontext.confirm == "Tamam") {
43
+ buttontext.confirm = "Evet";
44
+ buttontext.cancel = "Hayır";
45
+ }
46
+ break;
47
+ }
48
+ let _buttons = [{
49
+ label: buttontext.confirm,
50
+ onClick: () => {
51
+ if (callback) callback({
52
+ isConfirmed: true,
53
+ isDenied: false
54
+ });
55
+ }
56
+ }];
57
+ if (_showCancelButton) {
58
+ _buttons.push({
59
+ label: buttontext.cancel,
60
+ onClick: () => {
61
+ if (callback) callback({
62
+ isConfirmed: false,
63
+ isDenied: true
64
+ });
65
+ }
66
+ });
67
+ }
68
+ confirmAlert({
69
+ title: title,
70
+ message: /*#__PURE__*/React.createElement("div", {
71
+ dangerouslySetInnerHTML: {
72
+ __html: typeof message === 'string' ? message : message.props?.children || message.toString()
73
+ }
74
+ }),
75
+ buttons: _buttons,
76
+ onClickOutside: () => {
77
+ if (callback) callback({
78
+ isConfirmed: false,
79
+ isDenied: true
80
+ });
81
+ },
82
+ onKeypressEscape: () => {
83
+ if (callback) callback({
84
+ isConfirmed: false,
85
+ isDenied: true
86
+ });
87
+ }
88
+ });
89
+
90
+ // Swal.fire({
91
+ // title: title,
92
+ // html: message,
93
+ // icon: type,
94
+ // focusConfirm: true,
95
+ // confirmButtonText: buttontext.confirm,
96
+ // cancelButtonText: buttontext.cancel,
97
+ // showCancelButton: _showCancelButton
98
+ // }).then((result) => {
99
+ // if (callback){
100
+ // callback(result);
101
+ // }
102
+ // // /* Read more about isConfirmed, isDenied below */
103
+ // // if (result.isConfirmed) {
104
+ // // // Swal.fire("Saved!", "", "success");
105
+ // // } else if (result.isDenied) {
106
+ // // // Swal.fire("Changes are not saved", "", "info");
107
+ // // }
108
+ // });
109
+ };
@@ -0,0 +1,59 @@
1
+ import React from "react";
2
+ import styles from "./MyContainer.module.css";
3
+ function MyContainer({
4
+ children,
5
+ title = "",
6
+ description = null,
7
+ icon = null,
8
+ className = null,
9
+ titleTextStyle = null,
10
+ style = null,
11
+ headerClassName = null,
12
+ headerStyle = null,
13
+ bodyClassName = null,
14
+ bodyStyle = null,
15
+ footerClassName = null,
16
+ footerStyle = null
17
+ }) {
18
+ const arrChild = React.Children.toArray(children);
19
+ let childHeaderRight = null;
20
+ let childBody = null;
21
+ let childFooter = null;
22
+ for (let i = 0; i < arrChild.length; i++) {
23
+ const el = arrChild[i];
24
+ if (el.type && el.type.toString().includes("MyContainerTagRight")) {
25
+ childHeaderRight = el;
26
+ } else if (el.type && el.type.toString().includes("MyContainerTagBody")) {
27
+ childBody = el;
28
+ } else if (el.type && el.type.toString().includes("MyContainerTagFooter")) {
29
+ childFooter = el;
30
+ } else if (childBody == null) {
31
+ childBody = el;
32
+ } else if (childBody != null && childFooter == null && i == arrChild.length - 1) {
33
+ childFooter = el;
34
+ }
35
+ }
36
+ return /*#__PURE__*/React.createElement("section", {
37
+ className: `${styles.container} ${className || ""}`,
38
+ style: style
39
+ }, (title || childHeaderRight) && /*#__PURE__*/React.createElement("div", {
40
+ className: `${styles.header} ${headerClassName || ""}`,
41
+ style: headerStyle
42
+ }, title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
43
+ className: styles.title,
44
+ style: titleTextStyle
45
+ }, title), description && /*#__PURE__*/React.createElement("span", {
46
+ className: styles.description
47
+ }, description)), childHeaderRight && childHeaderRight), /*#__PURE__*/React.createElement("div", {
48
+ className: `${styles.body} ${bodyClassName || ""}`,
49
+ style: title ? {
50
+ paddingTop: "12px"
51
+ } : null
52
+ }, childBody), childFooter && /*#__PURE__*/React.createElement("div", {
53
+ className: `${styles.footer} ${footerClassName || ""}`,
54
+ style: title ? {
55
+ paddingTop: "12px"
56
+ } : null
57
+ }, childFooter));
58
+ }
59
+ export default MyContainer;
@@ -0,0 +1,110 @@
1
+ .container {
2
+ position: relative;
3
+ display: block;
4
+ width: 100%;
5
+ background: #ffff;
6
+ border-radius: 15px;
7
+ }
8
+
9
+ .header {
10
+ position: relative;
11
+ display: block;
12
+ width: 100%;
13
+ padding: 15px;
14
+ padding-left: 20px;
15
+ padding-bottom: 7.5px;
16
+ border-bottom: 1px solid #d0d6de;
17
+ color: #464255;
18
+ }
19
+
20
+ .title {
21
+ margin: 0px !important;
22
+ }
23
+
24
+ .description {
25
+ font-size: 12px;
26
+ }
27
+
28
+ .rightBlock {
29
+ position: absolute;
30
+ right: 15px;
31
+ z-index: 2;
32
+ top: 50%;
33
+ transform: translateY(-50%);
34
+ display: flex;
35
+ flex-direction: row;
36
+ gap: 10px;
37
+ }
38
+
39
+ .rightBlock button {
40
+ display: flex;
41
+ flex-direction: row;
42
+ gap: 10px;
43
+ justify-items: center;
44
+ align-items: center;
45
+ padding: 10px 15px;
46
+ }
47
+
48
+ .body {
49
+ display: block;
50
+ width: 100%;
51
+ padding: 15px;
52
+ }
53
+
54
+ .footer {
55
+ display: block;
56
+ width: 100%;
57
+ padding: 15px;
58
+ border-top: 1px solid #d0d6de;
59
+ }
60
+
61
+ @media screen and (max-width: 768px) {
62
+ .header {
63
+ padding: 10px;
64
+ padding-left: 15px;
65
+ padding-bottom: 5px;
66
+ }
67
+
68
+ .rightBlock {
69
+ position: relative;
70
+ right: auto;
71
+ top: auto;
72
+ transform: none;
73
+ margin-top: 10px;
74
+ justify-content: flex-end;
75
+ }
76
+
77
+ .rightBlock button {
78
+ padding: 8px 12px;
79
+ font-size: 14px;
80
+ }
81
+
82
+ .body {
83
+ padding: 10px;
84
+ }
85
+
86
+ .footer {
87
+ padding: 10px;
88
+ }
89
+ }
90
+
91
+ @media screen and (max-width: 480px) {
92
+ .header {
93
+ padding: 8px;
94
+ padding-left: 12px;
95
+ padding-bottom: 4px;
96
+ }
97
+
98
+ .rightBlock button {
99
+ padding: 6px 10px;
100
+ font-size: 12px;
101
+ }
102
+
103
+ .body {
104
+ padding: 8px;
105
+ }
106
+
107
+ .footer {
108
+ padding: 8px;
109
+ }
110
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ function MyContainerBody({
3
+ children
4
+ }) {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: "MyContainerTagBody"
7
+ }, children);
8
+ }
9
+ export default MyContainerBody;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ function MyContainerFooter({
3
+ children
4
+ }) {
5
+ return /*#__PURE__*/React.createElement("div", {
6
+ className: "MyContainerTagFooter"
7
+ }, children);
8
+ }
9
+ export default MyContainerFooter;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import styles from "./MyContainer.module.css";
3
+ function MyContainerRight({
4
+ children
5
+ }) {
6
+ return /*#__PURE__*/React.createElement("div", {
7
+ className: "MyContainerTagRight " + styles.rightBlock
8
+ }, children);
9
+ }
10
+ export default MyContainerRight;