mimir-ui-kit 1.23.0 → 1.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. package/dist/assets/Drawer.css +1 -1
  2. package/dist/assets/ListPhotos.css +1 -1
  3. package/dist/assets/SelectSearch.css +1 -1
  4. package/dist/assets/Steps.css +1 -1
  5. package/dist/assets/TabTrail.css +1 -1
  6. package/dist/assets/Uploader.css +1 -1
  7. package/dist/assets/UploaderPhotos.css +1 -1
  8. package/dist/components/Accordion/Accordion.d.ts +2 -0
  9. package/dist/components/Accordion/Accordion.js +15 -2
  10. package/dist/components/Drawer/Drawer.js +19 -19
  11. package/dist/components/ListPhotos/ListPhotos.js +1 -1
  12. package/dist/components/SelectSearch/SelectSearch.js +27 -22
  13. package/dist/components/Steps/Steps.d.ts +8 -0
  14. package/dist/components/Steps/Steps.js +37 -8
  15. package/dist/components/Steps/constants.d.ts +11 -1
  16. package/dist/components/Steps/constants.js +44 -0
  17. package/dist/components/TabTrail/TabTrail.js +9 -9
  18. package/dist/components/Uploader/Uploader.d.ts +4 -0
  19. package/dist/components/Uploader/Uploader.js +7 -6
  20. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +4 -0
  21. package/dist/components/UploaderPhotos/UploaderPhotos.js +14 -5
  22. package/dist/components/Vote/index.d.ts +1 -1
  23. package/dist/components/index.d.ts +1 -1
  24. package/dist/icons/Icon.js +1 -1
  25. package/dist/icons/components/12px/MessageRead12px.d.ts +4 -0
  26. package/dist/icons/components/12px/MessageRead12px.js +37 -0
  27. package/dist/icons/components/32px/PersonalManager32px.d.ts +4 -0
  28. package/dist/icons/components/32px/PersonalManager32px.js +112 -0
  29. package/dist/icons/components/StepXL.d.ts +4 -0
  30. package/dist/icons/components/StepXL.js +32 -0
  31. package/dist/icons/components/index.d.ts +3 -0
  32. package/dist/icons/components/index.js +543 -540
  33. package/dist/{index-Cxiikb7g.js → index-FDVpKRvA.js} +550 -539
  34. package/dist/utils/index.d.ts +0 -2
  35. package/dist/utils/index.js +1 -3
  36. package/package.json +1 -1
  37. package/dist/assets/ListFiles.css +0 -1
  38. package/dist/components/ListFiles/ListFiles.d.ts +0 -26
  39. package/dist/components/ListFiles/ListFiles.js +0 -45
  40. package/dist/components/ListFiles/constants.d.ts +0 -3
  41. package/dist/components/ListFiles/constants.js +0 -33
  42. package/dist/components/ListFiles/index.d.ts +0 -2
  43. package/dist/components/ListFiles/index.js +0 -4
  44. package/dist/components/UploaderFiles/UploaderFiles.d.ts +0 -38
  45. package/dist/components/UploaderFiles/UploaderFiles.js +0 -68
  46. package/dist/components/UploaderFiles/index.d.ts +0 -2
  47. package/dist/components/UploaderFiles/index.js +0 -4
  48. package/dist/utils/formating/FileSize.d.ts +0 -1
  49. package/dist/utils/formating/FileSize.js +0 -15
@@ -1,5 +1,4 @@
1
1
  import { default as Date } from './formating/Date';
2
- import { default as Size } from './formating/FileSize';
3
2
  import { default as Month } from './formating/Month';
4
3
  import { default as Number } from './formating/Numbers';
5
4
  import { default as UUIDv4 } from './UUID4';
@@ -9,5 +8,4 @@ export declare const formating: {
9
8
  Month: typeof Month;
10
9
  Date: typeof Date;
11
10
  UUIDv4: typeof UUIDv4;
12
- Size: typeof Size;
13
11
  };
@@ -1,5 +1,4 @@
1
1
  import _Date from "./formating/Date.js";
2
- import Size from "./formating/FileSize.js";
3
2
  import Month from "./formating/Month.js";
4
3
  import Numbers from "./formating/Numbers.js";
5
4
  import UUIDv4 from "./UUID4.js";
@@ -7,8 +6,7 @@ const formating = {
7
6
  Number: Numbers,
8
7
  Month,
9
8
  Date: _Date,
10
- UUIDv4,
11
- Size
9
+ UUIDv4
12
10
  };
13
11
  export {
14
12
  formating
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.23.0",
4
+ "version": "1.24.1",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
@@ -1 +0,0 @@
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,26 +0,0 @@
1
- export type TListFiles = {
2
- /**
3
- * Массив фото
4
- */
5
- value: TFilesDetail[];
6
- /**
7
- * функция -callback, которая вызывается при изменении списка и передает обновленный список и deleteId,
8
- */
9
- onChange?: (e: TFileValue) => void;
10
- };
11
- export type TFileItem = {
12
- id: number;
13
- url: string;
14
- };
15
- export type TFileValue = {
16
- deleteId?: number;
17
- list: TFilesDetail[];
18
- };
19
- export type TFilesDetail = {
20
- id: number;
21
- url: string;
22
- name: string;
23
- size?: number;
24
- type?: string;
25
- };
26
- export declare function ListFiles({ value, onChange }: TListFiles): import("react/jsx-runtime").JSX.Element;
@@ -1,45 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { useState, useEffect } from "react";
3
- import { formating } from "../../utils/index.js";
4
- import { Button } from "../Button/Button.js";
5
- import '../../assets/ListFiles.css';const cls = {
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"
12
- };
13
- function ListFiles({ value, onChange }) {
14
- const [list, setList] = useState(value);
15
- useEffect(() => {
16
- setList(value);
17
- }, [value]);
18
- const onDelete = async (id) => {
19
- const newList = [...list.filter((el) => el.id !== id)];
20
- setList(newList);
21
- onChange == null ? void 0 : onChange({ deleteId: id, list: newList });
22
- };
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: [
24
- /* @__PURE__ */ jsxs("div", { className: cls["file-info"], children: [
25
- (el == null ? void 0 : el.size) && /* @__PURE__ */ jsxs("span", { className: cls["file-info-size"], children: [
26
- " ",
27
- formating.Size(el == null ? void 0 : el.size)
28
- ] }),
29
- /* @__PURE__ */ jsx("div", { className: cls["file-info-name-wrapper"], children: /* @__PURE__ */ jsx("div", { className: cls["file-info-name"], children: el.name }) })
30
- ] }),
31
- /* @__PURE__ */ jsx(
32
- Button,
33
- {
34
- isIconButton: true,
35
- iconName: "Close12px",
36
- size: "m-s",
37
- variant: "secondary-gray",
38
- onClick: () => onDelete(el.id)
39
- }
40
- )
41
- ] }, key)) });
42
- }
43
- export {
44
- ListFiles
45
- };
@@ -1,3 +0,0 @@
1
- import { TFilesDetail } from './ListFiles';
2
-
3
- export declare const photos: TFilesDetail[];
@@ -1,33 +0,0 @@
1
- const photos = [
2
- {
3
- id: 111,
4
- name: "ООО “КИЗ-СТРОЙ” - Свидетельство о регистрации (06.12.2003).xls",
5
- url: "https://i.pinimg.com/736x/5a/e6/12/5ae612a7ecf50870c8f41961fefc332f.jpg",
6
- size: 1024,
7
- type: "image/png"
8
- },
9
- {
10
- id: 112,
11
- name: "ООО “КИЗ-СТРОЙ” - Доверенность (20.10.2005).xls",
12
- url: "https://i1.sndcdn.com/artworks-rQAPPfrs44UvRwIz-WJkvyQ-t500x500.jpg",
13
- size: 1024,
14
- type: "image/png"
15
- },
16
- {
17
- id: 113,
18
- name: "Скан паспорта.pdf",
19
- url: "https://i1.sndcdn.com/avatars-000095020320-0pmjnu-t500x500.jpg",
20
- size: 2064,
21
- type: "image/png"
22
- },
23
- {
24
- id: 114,
25
- name: "Прочие документы.xls",
26
- url: "https://i1.sndcdn.com/avatars-000151937348-27m28p-t500x500.jpg",
27
- size: 1024,
28
- type: "image/png"
29
- }
30
- ];
31
- export {
32
- photos
33
- };
@@ -1,2 +0,0 @@
1
- export { ListFiles } from './ListFiles';
2
- export type { ListFiles as TListFiles } from './ListFiles';
@@ -1,4 +0,0 @@
1
- import { ListFiles } from "./ListFiles.js";
2
- export {
3
- ListFiles
4
- };
@@ -1,38 +0,0 @@
1
- import { TFilesDetail } from '../ListFiles/ListFiles';
2
- import { imageTypesArr } from '../Uploader/constants';
3
- import { TFileItem } from '../Uploader/Uploader';
4
-
5
- export type TUploaderFiles = {
6
- /**
7
- * Массив разрешенных типов файлов для настройки валидации
8
- * 'jpeg' | 'jpg' | 'png' | 'tiff' | 'gif' | 'doc' | 'xls' | 'pdf' |'docx' | 'txt'
9
- */
10
- filesType: imageTypesArr[];
11
- /**
12
- * Наименование передаваемого массива файлов
13
- */
14
- arrayName: string;
15
- /**
16
- * Максимальный размер файлов.
17
- */
18
- maxSize: number;
19
- /**
20
- * Функция обратного вызова, передает параметры type и data,
21
- * type 'add' в data передает массив файлов,
22
- * type:'delete' в data передает id удаленного файла
23
- */
24
- onChange: (j: TOnChangeFilesUpdate) => void;
25
- /**
26
- * Передаваемые файлы.
27
- */
28
- value?: TFilesDetail[];
29
- /**
30
- * Максимальное количество файлов.
31
- */
32
- maxFiles: number;
33
- };
34
- export type TOnChangeFilesUpdate = {
35
- type: string;
36
- data: TFileItem[] | number;
37
- };
38
- export declare const UploaderFiles: import('react').ForwardRefExoticComponent<TUploaderFiles & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,68 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import { c as classNames } from "../../index-CweZ_OcN.js";
3
- import { forwardRef, useState, useEffect } from "react";
4
- import { ListFiles } from "../ListFiles/ListFiles.js";
5
- import { Uploader } from "../Uploader/Uploader.js";
6
- import '../../assets/UploaderPhotos.css';const cls = {
7
- "upload-file-wrapper": "_upload-file-wrapper_2zki8_2"
8
- };
9
- const UploaderFiles = forwardRef(
10
- (props, ref) => {
11
- const { filesType, arrayName, maxSize, onChange, value, maxFiles } = props;
12
- const [files, setFiles] = useState(value || []);
13
- const isMaxFilesReached = files.length >= maxFiles;
14
- useEffect(() => {
15
- if (value) {
16
- setFiles(value);
17
- }
18
- }, [value]);
19
- const onChangeValue = (e) => {
20
- const newFiles = [
21
- ...files,
22
- ...e.value.map((el) => {
23
- var _a, _b, _c;
24
- return {
25
- id: el.id,
26
- url: "",
27
- size: (_a = el == null ? void 0 : el.file) == null ? void 0 : _a.size,
28
- name: (_b = el == null ? void 0 : el.file) == null ? void 0 : _b.name,
29
- type: (_c = el == null ? void 0 : el.file) == null ? void 0 : _c.type
30
- };
31
- })
32
- ];
33
- setFiles(newFiles);
34
- onChange == null ? void 0 : onChange({ type: "add", data: e.value });
35
- };
36
- const onDelete = (j) => {
37
- setFiles(j.list);
38
- if (j.deleteId) onChange == null ? void 0 : onChange({ type: "delete", data: j.deleteId });
39
- };
40
- return /* @__PURE__ */ jsxs(
41
- "div",
42
- {
43
- className: classNames(
44
- cls["upload-file-wrapper"],
45
- isMaxFilesReached && cls.disabled
46
- ),
47
- children: [
48
- /* @__PURE__ */ jsx(
49
- Uploader,
50
- {
51
- filesType,
52
- arrayName,
53
- maxSize,
54
- onChangeValue,
55
- ref,
56
- maxFiles,
57
- isDisabled: isMaxFilesReached
58
- }
59
- ),
60
- /* @__PURE__ */ jsx(ListFiles, { value: files, onChange: onDelete })
61
- ]
62
- }
63
- );
64
- }
65
- );
66
- export {
67
- UploaderFiles
68
- };
@@ -1,2 +0,0 @@
1
- export { UploaderFiles } from './UploaderFiles';
2
- export type { TUploaderFiles, TOnChangeFilesUpdate } from './UploaderFiles';
@@ -1,4 +0,0 @@
1
- import { UploaderFiles } from "./UploaderFiles.js";
2
- export {
3
- UploaderFiles
4
- };
@@ -1 +0,0 @@
1
- export default function Size(size: number): string;
@@ -1,15 +0,0 @@
1
- function Size(size) {
2
- if (!size) return "";
3
- let i = -1;
4
- const b = [" Kb", " Mb", " Gb", " Tb", "Pb", "Eb", "Zb", "Yb"];
5
- const sistemParams = 1024;
6
- const maxValue = 0.1;
7
- do {
8
- size /= sistemParams;
9
- i += 1;
10
- } while (size > sistemParams);
11
- return Math.max(size, maxValue).toFixed(1) + b[i];
12
- }
13
- export {
14
- Size as default
15
- };