px-react-ui-components 1.1.17 → 1.1.19

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.
package/README.md CHANGED
@@ -20,26 +20,26 @@ A modern, customizable React UI components library designed to simplify web deve
20
20
  npm install px-react-ui-components
21
21
 
22
22
  # Install required peer dependencies
23
- npm install react@^18.3.1 react-dom@^18.3.1 react-icons@^5.5.0
23
+ npm install react react-dom react-icons
24
24
 
25
25
  # Optional dependencies (install only if you need specific components)
26
26
  # For MyEditor component:
27
27
  npm install react-quill@^2.0.0 quill@^1.3.7 quill-image-resize-module-react@^3.0.0 quill-table-ui@^1.0.7 katex@^0.16.21
28
28
 
29
29
  # For MyAlert component:
30
- npm install react-confirm-alert@^3.0.6
30
+ npm install react-confirm-alert
31
31
 
32
32
  # For MyImageCropper component:
33
- npm install react-image-crop@^11.0.7
33
+ npm install react-image-crop
34
34
 
35
35
  # For MyWaiting component:
36
- npm install react-loader-spinner@^7.0.3
36
+ npm install react-loader-spinner
37
37
 
38
38
  # For MyFileUpload component:
39
- npm install react-image-file-resizer@^3.0.4 react-html5-camera-photo@^1.5.4
39
+ npm install react-image-file-resizer react-html5-camera-photo
40
40
 
41
41
  # For MyZoomImage component:
42
- npm install react-zoom-pan-pinch@^3.7.0
42
+ npm install react-zoom-pan-pinch
43
43
  ```
44
44
 
45
45
  ## Dependencies
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.AcceptType = void 0;
6
+ exports.MyFileUploadAcceptType = void 0;
7
7
  exports.default = MyFileUpload;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _pi = require("react-icons/pi");
@@ -35,7 +35,7 @@ try {
35
35
  } catch (error) {
36
36
  console.warn("MyFileUpload: react-html5-camera-photo bağımlılığı bulunamadı.");
37
37
  }
38
- const AcceptType = exports.AcceptType = {
38
+ const MyFileUploadAcceptType = exports.MyFileUploadAcceptType = {
39
39
  ALL: "all",
40
40
  FILE: "file",
41
41
  IMAGE: "image",
@@ -43,18 +43,25 @@ const AcceptType = exports.AcceptType = {
43
43
  PDF: "pdf",
44
44
  IMAGEPDF: "imagepdf"
45
45
  };
46
- Object.freeze(_MyAlert.MyAlertType);
46
+ Object.freeze(MyFileUploadAcceptType);
47
47
  function MyFileUpload({
48
+ t = null,
48
49
  multiple = false,
49
- accept = AcceptType.ALL,
50
+ accept = MyFileUploadAcceptType.ALL,
50
51
  className = null,
52
+ classNameContainer = null,
53
+ classNameItem = null,
54
+ classNameIcon = null,
55
+ classNameFile = null,
56
+ classNameCamera = null,
51
57
  camera = true,
52
58
  maxSizeMB = 50,
53
59
  onData
54
60
  }) {
61
+ const localT = typeof t === "function" ? t : key => key;
55
62
  const [loading, setLoading] = (0, _react.useState)(false);
56
- const [accepttypes, setAccepttypes] = (0, _react.useState)(AcceptType.ALL);
57
- const [acceptlabel, setAcceptlabel] = (0, _react.useState)(AcceptType.ALL);
63
+ const [MyFileUploadAcceptTypes, setMyFileUploadAcceptTypes] = (0, _react.useState)(MyFileUploadAcceptType.ALL);
64
+ const [acceptlabel, setAcceptlabel] = (0, _react.useState)(MyFileUploadAcceptType.ALL);
58
65
  const [cameraopen, setCameraopen] = (0, _react.useState)(false);
59
66
  const [cameraopened, setCameraopened] = (0, _react.useState)(false);
60
67
  const [devices, setDevices] = (0, _react.useState)([]);
@@ -65,28 +72,28 @@ function MyFileUpload({
65
72
  let type_media = ".mp3,.mp4,.avi,.wav";
66
73
  (0, _react.useEffect)(() => {
67
74
  switch (accept) {
68
- case AcceptType.ALL:
69
- setAccepttypes(type_files + "," + type_image + "," + type_media);
75
+ case MyFileUploadAcceptType.ALL:
76
+ setMyFileUploadAcceptTypes(type_files + "," + type_image + "," + type_media);
70
77
  setAcceptlabel("PNG, JPG, PDF, RAR, ZIP, MP3, MP4, AVI, WAV, Word-Excel");
71
78
  break;
72
- case AcceptType.IMAGE:
73
- setAccepttypes(type_image);
79
+ case MyFileUploadAcceptType.IMAGE:
80
+ setMyFileUploadAcceptTypes(type_image);
74
81
  setAcceptlabel("PNG, JPG ");
75
82
  break;
76
- case AcceptType.MEDIA:
77
- setAccepttypes(type_media);
83
+ case MyFileUploadAcceptType.MEDIA:
84
+ setMyFileUploadAcceptTypes(type_media);
78
85
  setAcceptlabel("MP3, MP4, AVI, WAV");
79
86
  break;
80
- case AcceptType.FILE:
81
- setAccepttypes(type_files + "," + type_image);
87
+ case MyFileUploadAcceptType.FILE:
88
+ setMyFileUploadAcceptTypes(type_files + "," + type_image);
82
89
  setAcceptlabel("PDF, RAR, ZIP, PNG, JPG, Word-Excel ");
83
90
  break;
84
- case AcceptType.PDF:
85
- setAccepttypes(".pdf");
91
+ case MyFileUploadAcceptType.PDF:
92
+ setMyFileUploadAcceptTypes(".pdf");
86
93
  setAcceptlabel("PDF");
87
94
  break;
88
- case AcceptType.IMAGEPDF:
89
- setAccepttypes(type_image + ",.pdf");
95
+ case MyFileUploadAcceptType.IMAGEPDF:
96
+ setMyFileUploadAcceptTypes(type_image + ",.pdf");
90
97
  setAcceptlabel("PNG, JPG, PDF");
91
98
  break;
92
99
  }
@@ -119,7 +126,7 @@ function MyFileUpload({
119
126
 
120
127
  let file_ext = file.type.split("/");
121
128
  file_ext = file_ext[file_ext.length - 1];
122
- if (filesize > maxSizeMB || accepttypes.indexOf(file_ext) == -1) {
129
+ if (filesize > maxSizeMB || MyFileUploadAcceptTypes.indexOf(file_ext) == -1) {
123
130
  if (filesize > maxSizeMB) {
124
131
  _error.push({
125
132
  filename: file.name,
@@ -239,13 +246,13 @@ function MyFileUpload({
239
246
  show: loading,
240
247
  message: ""
241
248
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
242
- className: className,
249
+ className: classNameContainer,
243
250
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
244
- className: _MyFileUploadModule.default.myFileUploadContainer,
251
+ className: _MyFileUploadModule.default.myFileUploadContainer + (className != null ? " " + className : ''),
245
252
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
246
- className: _MyFileUploadModule.default.myFileUploadContainerItem,
253
+ className: _MyFileUploadModule.default.myFileUploadContainerItem + (classNameItem != null ? " " + classNameItem : ''),
247
254
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
248
- className: _MyFileUploadModule.default.myFileUploadContainerItemIcon,
255
+ className: _MyFileUploadModule.default.myFileUploadContainerItemIcon + (classNameIcon != null ? " " + classNameIcon : ''),
249
256
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiFileArrowUpLight, {
250
257
  className: _MyFileUploadModule.default.Icon
251
258
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("h2", {
@@ -253,14 +260,14 @@ function MyFileUpload({
253
260
  children: [acceptlabel, /*#__PURE__*/(0, _jsxRuntime.jsx)("br", {}), " ", maxSizeMB, " MB"]
254
261
  })]
255
262
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
256
- className: _MyFileUploadModule.default.myFileUploadContainerItemFile,
263
+ className: _MyFileUploadModule.default.myFileUploadContainerItemFile + (classNameFile != null ? " " + classNameFile : ''),
257
264
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("input", {
258
265
  type: "file",
259
266
  hidden: true,
260
267
  ref: fileInputRef,
261
268
  onChange: handleFileInputChange,
262
269
  multiple: multiple,
263
- accept: accepttypes
270
+ accept: MyFileUploadAcceptTypes
264
271
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
265
272
  className: _MyFileUploadModule.default.myFileUploadButton,
266
273
  onClick: () => fileInputRef.current.click(),
@@ -268,19 +275,19 @@ function MyFileUpload({
268
275
  })]
269
276
  })]
270
277
  }), camera && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
271
- className: _MyFileUploadModule.default.myFileUploadContainerItem,
278
+ className: _MyFileUploadModule.default.myFileUploadContainerItem + (classNameCamera != null ? " " + classNameCamera : ''),
272
279
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
273
- className: _MyFileUploadModule.default.myFileUploadContainerItemIcon,
280
+ className: _MyFileUploadModule.default.myFileUploadContainerItemIcon + (classNameIcon != null ? " " + classNameIcon : ''),
274
281
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_pi.PiCamera, {
275
282
  className: _MyFileUploadModule.default.Icon
276
283
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
277
284
  className: _MyFileUploadModule.default.myFileUploadContainerItemIconText,
278
285
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
279
- children: "You can take a photo from the camera."
286
+ children: localT("Kameradan fotoğraf çekebilirsin.")
280
287
  })
281
288
  })]
282
289
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
283
- className: _MyFileUploadModule.default.myFileUploadContainerItemFile,
290
+ className: _MyFileUploadModule.default.myFileUploadContainerItemFile + (classNameFile != null ? " " + classNameFile : ''),
284
291
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
285
292
  type: "button",
286
293
  className: _MyFileUploadModule.default.myFileUploadButton,
@@ -293,7 +300,7 @@ function MyFileUpload({
293
300
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_MyModal.default, {
294
301
  show: cameraopen,
295
302
  onClose: () => setCameraopen(false),
296
- title: t("Fotoğraf Çek"),
303
+ title: localT("Fotoğraf Çek"),
297
304
  closeOnEsc: false,
298
305
  closeOnBackdropClick: false,
299
306
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
package/dist/index.js CHANGED
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "MyFileUpload", {
27
27
  return _MyFileUpload.default;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "MyFileUploadAcceptType", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _MyFileUpload.MyFileUploadAcceptType;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "MyImageCropper", {
31
37
  enumerable: true,
32
38
  get: function () {
@@ -104,7 +110,7 @@ var _MyInput = _interopRequireDefault(require("./components/MyInput/MyInput"));
104
110
  var _MyAlert = _interopRequireDefault(require("./components/MyAlert/MyAlert"));
105
111
  var _MyContainer = _interopRequireDefault(require("./components/MyContainer/MyContainer"));
106
112
  var _MyEditor = _interopRequireDefault(require("./components/MyEditor/MyEditor"));
107
- var _MyFileUpload = _interopRequireDefault(require("./components/MyFileUpload/MyFileUpload"));
113
+ var _MyFileUpload = _interopRequireWildcard(require("./components/MyFileUpload/MyFileUpload"));
108
114
  var _MyImageCropper = _interopRequireDefault(require("./components/MyImageCropper/MyImageCropper"));
109
115
  var _YandexMaps = _interopRequireDefault(require("./components/MyMaps/YandexMaps"));
110
116
  var _MenuItem = _interopRequireDefault(require("./components/MyMenu/MenuItem"));
@@ -116,6 +122,7 @@ var _MyTabs = _interopRequireDefault(require("./components/MyTabs/MyTabs"));
116
122
  var _MyWaiting = _interopRequireDefault(require("./components/MyWaiting/MyWaiting"));
117
123
  var _MyZoomImage = _interopRequireDefault(require("./components/MyZoomImage/MyZoomImage"));
118
124
  var _MySwitch = _interopRequireDefault(require("./components/MySwitch/MySwitch"));
125
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
119
126
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
120
127
  // Export types
121
128
  const MyInputType = exports.MyInputType = {
package/package.json CHANGED
@@ -1,100 +1,100 @@
1
- {
2
- "name": "px-react-ui-components",
3
- "version": "1.1.17",
4
- "main": "dist/index.js",
5
- "module": "dist/index.js",
6
- "type": "commonjs",
7
- "exports": {
8
- ".": "./dist/index.js"
9
- },
10
- "files": [
11
- "dist",
12
- "dist/components",
13
- "README.md"
14
- ],
15
- "scripts": {
16
- "build": "babel src --out-dir dist --copy-files",
17
- "prepare": "npm run build"
18
- },
19
- "keywords": [
20
- "react",
21
- "components",
22
- "ui",
23
- "ui-components",
24
- "library",
25
- "design system",
26
- "styled-components",
27
- "tailwindcss",
28
- "input",
29
- "select",
30
- "datepicker",
31
- "container",
32
- "tabs"
33
- ],
34
- "author": "Piri AYKUT | piriaykut@gmail.com",
35
- "license": "MIT",
36
- "description": "React UI components library",
37
- "devDependencies": {
38
- "@babel/cli": "^7.27.0",
39
- "@babel/core": "^7.26.10",
40
- "@babel/preset-env": "^7.26.9",
41
- "@babel/preset-react": "^7.26.3"
42
- },
43
- "peerDependencies": {
44
- "react": "^18.3.1 || ^19.0.0",
45
- "react-dom": "^18.3.1 || ^19.0.0",
46
- "react-icons": "^5.5.0"
47
- },
48
- "peerDependenciesMeta": {
49
- "katex": {
50
- "optional": true
51
- },
52
- "quill": {
53
- "optional": true
54
- },
55
- "quill-image-resize-module-react": {
56
- "optional": true
57
- },
58
- "quill-table-ui": {
59
- "optional": true
60
- },
61
- "react-confirm-alert": {
62
- "optional": true
63
- },
64
- "react-image-crop": {
65
- "optional": true
66
- },
67
- "react-loader-spinner": {
68
- "optional": true
69
- },
70
- "react-quill": {
71
- "optional": true
72
- },
73
- "react-zoom-pan-pinch": {
74
- "optional": true
75
- },
76
- "react-image-file-resizer": {
77
- "optional": true
78
- },
79
- "react-html5-camera-photo": {
80
- "optional": true
81
- },
82
- "react-router-dom": {
83
- "optional": true
84
- }
85
- },
86
- "optionalDependencies": {
87
- "katex": "^0.16.21",
88
- "quill": "^1.3.7",
89
- "quill-image-resize-module-react": "^3.0.0",
90
- "quill-table-ui": "^1.0.7",
91
- "react-confirm-alert": "^3.0.6",
92
- "react-image-crop": "^11.0.7",
93
- "react-loader-spinner": "^7.0.3",
94
- "react-quill": "^2.0.0",
95
- "react-zoom-pan-pinch": "^3.7.0",
96
- "react-image-file-resizer": "^3.0.4",
97
- "react-html5-camera-photo": "^1.5.4",
98
- "react-router-dom": "^6.28.0"
99
- }
100
- }
1
+ {
2
+ "name": "px-react-ui-components",
3
+ "version": "1.1.19",
4
+ "main": "dist/index.js",
5
+ "module": "dist/index.js",
6
+ "type": "commonjs",
7
+ "exports": {
8
+ ".": "./dist/index.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "dist/components",
13
+ "README.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "babel src --out-dir dist --copy-files",
17
+ "prepare": "npm run build"
18
+ },
19
+ "keywords": [
20
+ "react",
21
+ "components",
22
+ "ui",
23
+ "ui-components",
24
+ "library",
25
+ "design system",
26
+ "styled-components",
27
+ "tailwindcss",
28
+ "input",
29
+ "select",
30
+ "datepicker",
31
+ "container",
32
+ "tabs"
33
+ ],
34
+ "author": "Piri AYKUT | piriaykut@gmail.com",
35
+ "license": "MIT",
36
+ "description": "React UI components library",
37
+ "devDependencies": {
38
+ "@babel/cli": "^7.28.6",
39
+ "@babel/core": "^7.29.0",
40
+ "@babel/preset-env": "^7.29.2",
41
+ "@babel/preset-react": "^7.28.5"
42
+ },
43
+ "peerDependencies": {
44
+ "react": "^18.3.1",
45
+ "react-dom": "^18.3.1",
46
+ "react-icons": "^5.5.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "katex": {
50
+ "optional": true
51
+ },
52
+ "quill": {
53
+ "optional": true
54
+ },
55
+ "quill-image-resize-module-react": {
56
+ "optional": true
57
+ },
58
+ "quill-table-ui": {
59
+ "optional": true
60
+ },
61
+ "react-confirm-alert": {
62
+ "optional": true
63
+ },
64
+ "react-image-crop": {
65
+ "optional": true
66
+ },
67
+ "react-loader-spinner": {
68
+ "optional": true
69
+ },
70
+ "react-quill": {
71
+ "optional": true
72
+ },
73
+ "react-zoom-pan-pinch": {
74
+ "optional": true
75
+ },
76
+ "react-image-file-resizer": {
77
+ "optional": true
78
+ },
79
+ "react-html5-camera-photo": {
80
+ "optional": true
81
+ },
82
+ "react-router-dom": {
83
+ "optional": true
84
+ }
85
+ },
86
+ "optionalDependencies": {
87
+ "katex": "^0.16.44",
88
+ "quill": "^1.3.7",
89
+ "quill-image-resize-module-react": "^3.0.0",
90
+ "quill-table-ui": "^1.0.7",
91
+ "react-confirm-alert": "^3.0.6",
92
+ "react-image-crop": "^11.0.10",
93
+ "react-loader-spinner": "^7.0.3",
94
+ "react-quill": "^2.0.0",
95
+ "react-zoom-pan-pinch": "^3.7.0",
96
+ "react-image-file-resizer": "^3.0.4",
97
+ "react-html5-camera-photo": "^1.5.11",
98
+ "react-router-dom": "^6.30.3"
99
+ }
100
+ }