mimir-ui-kit 1.22.0 → 1.23.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/ListFiles.css +1 -1
- package/dist/assets/ListPhotos.css +1 -1
- package/dist/assets/Uploader.css +1 -1
- package/dist/assets/UploaderPhotos.css +1 -1
- package/dist/components/ListFiles/ListFiles.js +9 -6
- package/dist/components/ListPhotos/ListPhotos.js +1 -1
- package/dist/components/Uploader/Uploader.js +4 -4
- package/dist/components/UploaderFiles/UploaderFiles.js +2 -2
- package/dist/components/UploaderPhotos/UploaderPhotos.js +2 -3
- package/dist/utils/formating/FileSize.js +5 -3
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
._file-
|
1
|
+
._file-info_1qfel_2{display:flex;flex-direction:column;gap:var(--space-xs);overflow:hidden}._file-info_1qfel_2 ._file-info-size_1qfel_8{font-family:var(--font-inter),sans-serif;font-size:var(--size-text-m);font-weight:var(--font-weight-text-regular);line-height:var(--line-height-text-xxs);text-align:left;color:var(--disabled-color)}._file-info_1qfel_2 ._file-info-name-wrapper_1qfel_16{display:table;table-layout:fixed;width:100%}._file-info_1qfel_2 ._file-info-name-wrapper_1qfel_16 ._file-info-name_1qfel_16{font-family:var(--font-inter),sans-serif;font-size:var(--size-text-l2);font-weight:var(--font-weight-text-regular);line-height:var(--line-height-text-xl);text-align:left;color:var(--black-100);display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._file-upload-container_1qfel_34{display:flex;flex-direction:column;width:100%;padding-left:0;margin-bottom:0;gap:var(--space-xs)}._file-upload-container_1qfel_34 ._file-upload-container-item_1qfel_42{display:flex;justify-content:space-between;align-items:center;background:var(--white);position:relative;padding:var(--space-xs) var(--space-m);border-radius:var(--control-radius)}._file-upload-container_1qfel_34 ._file-upload-container-item_1qfel_42 button{background:var(--black-5);position:absolute;right:var(--space-2xs);top:var(--space-2xs)}._file-upload-container_1qfel_34 ._file-upload-container-item_1qfel_42 span{display:flex}
|
@@ -1 +1 @@
|
|
1
|
-
._list-
|
1
|
+
._list-photos_16pts_2{display:flex;gap:var(--space-m);overflow-x:auto}._list-photos_16pts_2::-webkit-scrollbar{display:none}._list-photos_16pts_2 li{position:relative;flex-shrink:0;width:var(--space-4xxl);height:var(--space-4xxl);overflow:hidden;border-radius:var(--control-radius);box-shadow:0 0 #16172705,0 2px 4px #16172705,0 6px 6px #16172705,0 15px 9px #16172703}._list-photos_16pts_2 img{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}._list-photos_16pts_2 button{position:absolute;top:var(--space-2xs);right:var(--space-2xs)}
|
package/dist/assets/Uploader.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
._upload-
|
1
|
+
._upload-file-wrapper_n3hxs_2{position:relative;width:100%}._upload-file-wrapper_n3hxs_2 label{display:flex;flex-direction:column;gap:var(--space-m);align-items:center;justify-content:center}._upload-file-wrapper_n3hxs_2 label button{z-index:1}._upload-file-wrapper_n3hxs_2 label b{color:var(--black-100);font-weight:var(--font-weight-text-regular);font-size:var(--size-text-l2);font-family:var(--font-inter);font-style:normal;line-height:130%;text-align:center}._upload-file-wrapper_n3hxs_2 label ._upload-text_n3hxs_25{color:var(--disabled-color);font-weight:var(--font-weight-text-regular);font-size:var(--size-text-m);font-family:var(--font-inter);font-style:normal;line-height:var(--line-height-text-xxs);text-align:center}._upload-file-input_n3hxs_35{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;opacity:0}
|
@@ -1 +1 @@
|
|
1
|
-
._upload-
|
1
|
+
._upload-file-wrapper_2zki8_2{display:flex;flex-direction:column;gap:var(--space-m);overflow:hidden}
|
@@ -3,9 +3,12 @@ import { useState, useEffect } from "react";
|
|
3
3
|
import { formating } from "../../utils/index.js";
|
4
4
|
import { Button } from "../Button/Button.js";
|
5
5
|
import '../../assets/ListFiles.css';const cls = {
|
6
|
-
"file-info": "_file-
|
7
|
-
"file-
|
8
|
-
"file-
|
6
|
+
"file-info": "_file-info_1qfel_2",
|
7
|
+
"file-info-size": "_file-info-size_1qfel_8",
|
8
|
+
"file-info-name-wrapper": "_file-info-name-wrapper_1qfel_16",
|
9
|
+
"file-info-name": "_file-info-name_1qfel_16",
|
10
|
+
"file-upload-container": "_file-upload-container_1qfel_34",
|
11
|
+
"file-upload-container-item": "_file-upload-container-item_1qfel_42"
|
9
12
|
};
|
10
13
|
function ListFiles({ value, onChange }) {
|
11
14
|
const [list, setList] = useState(value);
|
@@ -17,13 +20,13 @@ function ListFiles({ value, onChange }) {
|
|
17
20
|
setList(newList);
|
18
21
|
onChange == null ? void 0 : onChange({ deleteId: id, list: newList });
|
19
22
|
};
|
20
|
-
return /* @__PURE__ */ jsx("ul", { className: cls["file-upload-container"], children: list.map((el, key) => /* @__PURE__ */ jsxs("li", { children: [
|
23
|
+
return /* @__PURE__ */ jsx("ul", { className: cls["file-upload-container"], children: list.map((el, key) => /* @__PURE__ */ jsxs("li", { className: cls["file-upload-container-item"], children: [
|
21
24
|
/* @__PURE__ */ jsxs("div", { className: cls["file-info"], children: [
|
22
|
-
(el == null ? void 0 : el.size) && /* @__PURE__ */ jsxs("span", { children: [
|
25
|
+
(el == null ? void 0 : el.size) && /* @__PURE__ */ jsxs("span", { className: cls["file-info-size"], children: [
|
23
26
|
" ",
|
24
27
|
formating.Size(el == null ? void 0 : el.size)
|
25
28
|
] }),
|
26
|
-
/* @__PURE__ */ jsx("div", { className: cls["file-
|
29
|
+
/* @__PURE__ */ jsx("div", { className: cls["file-info-name-wrapper"], children: /* @__PURE__ */ jsx("div", { className: cls["file-info-name"], children: el.name }) })
|
27
30
|
] }),
|
28
31
|
/* @__PURE__ */ jsx(
|
29
32
|
Button,
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
3
3
|
import { Button } from "../Button/Button.js";
|
4
4
|
import '../../assets/ListPhotos.css';const cls = {
|
5
|
-
"list-photos": "_list-
|
5
|
+
"list-photos": "_list-photos_16pts_2"
|
6
6
|
};
|
7
7
|
function ListPhotos({ value, onChange }) {
|
8
8
|
const [list, setList] = useState(value);
|
@@ -3,9 +3,9 @@ import { forwardRef, useRef, useId } from "react";
|
|
3
3
|
import { Icon } from "../../icons/Icon.js";
|
4
4
|
import { Button } from "../Button/Button.js";
|
5
5
|
import '../../assets/Uploader.css';const cls = {
|
6
|
-
"upload-
|
7
|
-
"upload-text": "_upload-
|
8
|
-
"upload-file-input": "_upload-file-
|
6
|
+
"upload-file-wrapper": "_upload-file-wrapper_n3hxs_2",
|
7
|
+
"upload-text": "_upload-text_n3hxs_25",
|
8
|
+
"upload-file-input": "_upload-file-input_n3hxs_35"
|
9
9
|
};
|
10
10
|
const MIME = {
|
11
11
|
jpeg: "image/jpeg",
|
@@ -51,7 +51,7 @@ const Uploader = forwardRef(
|
|
51
51
|
var _a;
|
52
52
|
(_a = uploaderRef.current) == null ? void 0 : _a.click();
|
53
53
|
};
|
54
|
-
return /* @__PURE__ */ jsxs("div", { className: cls["upload-
|
54
|
+
return /* @__PURE__ */ jsxs("div", { className: cls["upload-file-wrapper"], ref, children: [
|
55
55
|
/* @__PURE__ */ jsx(
|
56
56
|
"input",
|
57
57
|
{
|
@@ -4,7 +4,7 @@ import { forwardRef, useState, useEffect } from "react";
|
|
4
4
|
import { ListFiles } from "../ListFiles/ListFiles.js";
|
5
5
|
import { Uploader } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const cls = {
|
7
|
-
"upload-
|
7
|
+
"upload-file-wrapper": "_upload-file-wrapper_2zki8_2"
|
8
8
|
};
|
9
9
|
const UploaderFiles = forwardRef(
|
10
10
|
(props, ref) => {
|
@@ -41,7 +41,7 @@ const UploaderFiles = forwardRef(
|
|
41
41
|
"div",
|
42
42
|
{
|
43
43
|
className: classNames(
|
44
|
-
cls["upload-
|
44
|
+
cls["upload-file-wrapper"],
|
45
45
|
isMaxFilesReached && cls.disabled
|
46
46
|
),
|
47
47
|
children: [
|
@@ -4,7 +4,7 @@ import { forwardRef, useState, useEffect } from "react";
|
|
4
4
|
import { ListPhotos } from "../ListPhotos/ListPhotos.js";
|
5
5
|
import { Uploader } from "../Uploader/Uploader.js";
|
6
6
|
import '../../assets/UploaderPhotos.css';const cls = {
|
7
|
-
"upload-
|
7
|
+
"upload-file-wrapper": "_upload-file-wrapper_2zki8_2"
|
8
8
|
};
|
9
9
|
const UploaderPhotos = forwardRef(
|
10
10
|
(props, ref) => {
|
@@ -31,12 +31,11 @@ const UploaderPhotos = forwardRef(
|
|
31
31
|
setPhotos(j.list);
|
32
32
|
if (j.deleteId) onChange == null ? void 0 : onChange({ type: "delete", data: j.deleteId });
|
33
33
|
};
|
34
|
-
console.log(photos);
|
35
34
|
return /* @__PURE__ */ jsxs(
|
36
35
|
"div",
|
37
36
|
{
|
38
37
|
className: classNames(
|
39
|
-
cls["upload-
|
38
|
+
cls["upload-file-wrapper"],
|
40
39
|
isMaxFilesReached && cls.disabled
|
41
40
|
),
|
42
41
|
children: [
|
@@ -2,11 +2,13 @@ function Size(size) {
|
|
2
2
|
if (!size) return "";
|
3
3
|
let i = -1;
|
4
4
|
const b = [" Kb", " Mb", " Gb", " Tb", "Pb", "Eb", "Zb", "Yb"];
|
5
|
+
const sistemParams = 1024;
|
6
|
+
const maxValue = 0.1;
|
5
7
|
do {
|
6
|
-
size /=
|
8
|
+
size /= sistemParams;
|
7
9
|
i += 1;
|
8
|
-
} while (size >
|
9
|
-
return Math.max(size,
|
10
|
+
} while (size > sistemParams);
|
11
|
+
return Math.max(size, maxValue).toFixed(1) + b[i];
|
10
12
|
}
|
11
13
|
export {
|
12
14
|
Size as default
|