mimir-ui-kit 1.36.16 → 1.37.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/MessageShortReply.css +1 -0
- package/dist/components/MessageShortReply/MessageShortReply.d.ts +30 -0
- package/dist/components/MessageShortReply/MessageShortReply.js +51 -0
- package/dist/components/MessageShortReply/constants.d.ts +9 -0
- package/dist/components/MessageShortReply/constants.js +4 -0
- package/dist/components/MessageShortReply/index.d.ts +2 -0
- package/dist/components/MessageShortReply/index.js +6 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +36 -35
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
._short-reply_1tpxx_2{--short-reply-cursor: pointer;display:inline-flex;flex-shrink:0;align-items:center;box-sizing:border-box;max-width:100%;height:32px;padding:0 var(--mimir-space-xs);overflow:hidden;color:var(--short-reply-color);font-size:var(--mimir-size-text-s);font-family:var(--mimir-font-inter);line-height:var(--mimir-line-height-text-s1);white-space:nowrap;-webkit-text-decoration:none;text-decoration:none;text-overflow:ellipsis;-moz-column-gap:var(--mimir-space-2xs);column-gap:var(--mimir-space-2xs);background-color:var(--short-reply-bg-color);border-color:var(--short-reply-border-color);border-style:solid;border-width:1px;border-radius:var(--mimir-control-input-radius);cursor:pointer;cursor:var(--short-reply-cursor);transition:all .15s ease;-webkit-appearance:none;-moz-appearance:none;appearance:none}._short-reply_1tpxx_2:hover{color:var(--short-reply-color-hover);background:var(--short-reply-bg-color-hover);border-color:var(--short-reply-border-color-hover)}._short-reply_1tpxx_2:active{color:var(--short-reply-color-active);background:var(--short-reply-bg-color-active);border-color:var(--short-reply-border-color-active)}._short-reply_1tpxx_2:focus-visible{box-shadow:0 0 2px var(--sapphire-normal)}._short-reply_1tpxx_2 svg{color:currentcolor;fill:currentcolor}._short-reply_1tpxx_2 svg path{color:currentcolor;fill:currentcolor}._short-reply_1tpxx_2._sapphire_1tpxx_50{--short-reply-bg-color: transparent;--short-reply-color-hover: var(--light-text);--short-reply-color-active: var(--light-text);--short-reply-bg-color-active: var(--sapphire-active);--short-reply-bg-color-hover: var(--sapphire-normal);--short-reply-color: var(--sapphire-normal);--short-reply-border-color: var(--sapphire-normal)}._short-reply_1tpxx_2._sapphire-filled_1tpxx_59{--short-reply-bg-color: var(--sapphire-normal);--short-reply-color-hover: var(--light-text);--short-reply-color-active: var(--light-text);--short-reply-bg-color-active: var(--sapphire-active);--short-reply-bg-color-hover: var(--sapphire-hover);--short-reply-color: var(--light-text)}._short-reply_1tpxx_2._citrine_1tpxx_67{--short-reply-bg-color: transparent;--short-reply-bg-color-active: var(--citrine-active);--short-reply-bg-color-hover: var(--citrine-hover);--short-reply-color: var(--citrine-normal);--short-reply-color-hover: var(--light-text);--short-reply-color-active: var(--light-text);--short-reply-border-color: var(--citrine-normal)}._short-reply_1tpxx_2._asphalt_1tpxx_76{--short-reply-bg-color: transparent;--short-reply-bg-color-active: var(--asphalt-active);--short-reply-bg-color-hover: var(--asphalt-hover);--short-reply-color: var(--asphalt-normal);--short-reply-color-hover: var(--light-text);--short-reply-color-active: var(--light-text);--short-reply-border-color: var(--asphalt-normal)}._short-reply_1tpxx_2._gray_1tpxx_85{--short-reply-bg-color: var(--gray-normal);--short-reply-bg-color-hover: var(--gray-hover);--short-reply-bg-color-active: var(--gray-active);--short-reply-color: var(--dark-text);--short-reply-color-hover: var(--dark-text);--short-reply-color-active: var(--light-text);border:none}._short-reply_1tpxx_2._white_1tpxx_94{--short-reply-bg-color: var(--white-normal);--short-reply-bg-color-hover: var(--white-hover);--short-reply-bg-color-active: var(--white-active);--short-reply-color: var(--dark-text);--short-reply-color-hover: var(--dark-text);--short-reply-color-active: var(--light-text);border:none}._short-reply_1tpxx_2._green_1tpxx_103{--short-reply-bg-color: transparent;--short-reply-bg-color-hover: var(--green-hover);--short-reply-bg-color-active: var(--green-active);--short-reply-color: var(--green);--short-reply-color-hover: var(--light-text);--short-reply-color-active: var(--light-text);--short-reply-border-color: var(--green)}._short-reply_1tpxx_2._disabled_1tpxx_112{--short-reply-cursor: not-allowed;color:var(--disabled);background-color:transparent;border-color:var(--disabled)}._short-reply_1tpxx_2._disabled_1tpxx_112:hover,._short-reply_1tpxx_2._disabled_1tpxx_112:active,._short-reply_1tpxx_2._disabled_1tpxx_112:focus{color:var(--disabled);background-color:transparent;border-color:var(--disabled);box-shadow:none}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { ComponentProps } from 'react';
|
2
|
+
import { EMessageShortReplyVariant } from './constants';
|
3
|
+
import { TIcon } from '../../icons';
|
4
|
+
|
5
|
+
export type TProps = ComponentProps<'button'> & {
|
6
|
+
/**
|
7
|
+
* Класс, применяемый к корневому элементу MessageShortReply.
|
8
|
+
*/
|
9
|
+
className?: string;
|
10
|
+
/**
|
11
|
+
* Флаг, указывающий, отключена ли MessageShortReply.
|
12
|
+
*/
|
13
|
+
disabled?: boolean;
|
14
|
+
/**
|
15
|
+
* "Вариант отображения MessageShortReply. Допустимые значения: 'sapphire', sapphire-filled', 'citrine', 'asphalt', 'gray', 'white', 'green'."
|
16
|
+
*/
|
17
|
+
variant?: `${EMessageShortReplyVariant}` | EMessageShortReplyVariant;
|
18
|
+
/**
|
19
|
+
* Имя иконки слева.
|
20
|
+
*/
|
21
|
+
leftIconName?: TIcon;
|
22
|
+
/**
|
23
|
+
* Имя иконки справа.
|
24
|
+
*/
|
25
|
+
rightIconName?: TIcon;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* Компонент MessageShortReply, который можно настраивать с различными темами и размерами.
|
29
|
+
*/
|
30
|
+
export declare const MessageShortReply: import('react').ForwardRefExoticComponent<Omit<TProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
2
|
+
import { c as y } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as f } from "react";
|
4
|
+
import { EMessageShortReplyVariant as g } from "./constants.js";
|
5
|
+
import { Icon as o } from "../../icons/Icon.js";
|
6
|
+
import '../../assets/MessageShortReply.css';const N = "_sapphire_1tpxx_50", b = "_citrine_1tpxx_67", u = "_asphalt_1tpxx_76", w = "_gray_1tpxx_85", R = "_white_1tpxx_94", S = "_green_1tpxx_103", I = "_disabled_1tpxx_112", e = {
|
7
|
+
"short-reply": "_short-reply_1tpxx_2",
|
8
|
+
sapphire: N,
|
9
|
+
"sapphire-filled": "_sapphire-filled_1tpxx_59",
|
10
|
+
citrine: b,
|
11
|
+
asphalt: u,
|
12
|
+
gray: w,
|
13
|
+
white: R,
|
14
|
+
green: S,
|
15
|
+
disabled: I
|
16
|
+
}, M = f(
|
17
|
+
(p, i) => {
|
18
|
+
const {
|
19
|
+
variant: n = g.Sapphire,
|
20
|
+
children: c,
|
21
|
+
className: l,
|
22
|
+
leftIconName: s,
|
23
|
+
rightIconName: r,
|
24
|
+
type: _ = "button",
|
25
|
+
disabled: t,
|
26
|
+
...h
|
27
|
+
} = p, x = {
|
28
|
+
[e.disabled]: t,
|
29
|
+
[e[n]]: !t
|
30
|
+
}, m = y(l, e["short-reply"], x);
|
31
|
+
return /* @__PURE__ */ d(
|
32
|
+
"button",
|
33
|
+
{
|
34
|
+
type: _,
|
35
|
+
disabled: t,
|
36
|
+
ref: i,
|
37
|
+
className: m,
|
38
|
+
...h,
|
39
|
+
children: [
|
40
|
+
s && /* @__PURE__ */ a(o, { iconName: s }),
|
41
|
+
c,
|
42
|
+
r && /* @__PURE__ */ a(o, { iconName: r })
|
43
|
+
]
|
44
|
+
}
|
45
|
+
);
|
46
|
+
}
|
47
|
+
);
|
48
|
+
M.displayName = "MessageShortReply";
|
49
|
+
export {
|
50
|
+
M as MessageShortReply
|
51
|
+
};
|
@@ -1,38 +1,38 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import { forwardRef as
|
4
|
-
import { imageTypes as
|
1
|
+
import { jsxs as h, jsx as p, Fragment as V } from "react/jsx-runtime";
|
2
|
+
import { c as j } from "../../index-DIxK0V-G.js";
|
3
|
+
import { forwardRef as B, useState as D, useEffect as T, useMemo as _ } from "react";
|
4
|
+
import { imageTypes as y } from "./constants.js";
|
5
5
|
import "../Button/Button.js";
|
6
|
-
import { EButtonVariantDefault as
|
7
|
-
import { ListFiles as
|
8
|
-
import { ListPhotos as
|
9
|
-
import { Uploader as
|
6
|
+
import { EButtonVariantDefault as C } from "../Button/constants.js";
|
7
|
+
import { ListFiles as E } from "../ListFiles/ListFiles.js";
|
8
|
+
import { ListPhotos as M } from "../ListPhotos/ListPhotos.js";
|
9
|
+
import { Uploader as O } from "../Uploader/Uploader.js";
|
10
10
|
import '../../assets/UploaderPhotos.css';const g = {
|
11
11
|
"upload-file-wrapper": "_upload-file-wrapper_1a115_2"
|
12
|
-
}, f = (i) => "file" in i && i.file instanceof File ?
|
12
|
+
}, f = (i) => "file" in i && i.file instanceof File ? y.includes(i.file.type) : "type" in i && typeof i.type == "string" ? y.includes(i.type) : !1, W = B(
|
13
13
|
(i, v) => {
|
14
14
|
const {
|
15
15
|
type: s,
|
16
16
|
filesType: x,
|
17
17
|
arrayName: F,
|
18
18
|
maxSize: U,
|
19
|
-
onChange:
|
20
|
-
value:
|
21
|
-
maxFiles:
|
19
|
+
onChange: a,
|
20
|
+
value: r,
|
21
|
+
maxFiles: u,
|
22
22
|
titleUploader: b,
|
23
23
|
buttonText: w = "Выберите файлы",
|
24
|
-
showOnlyUploadButton:
|
25
|
-
uploadButtonVariant: z =
|
24
|
+
showOnlyUploadButton: d = !1,
|
25
|
+
uploadButtonVariant: z = C.SecondaryAsphalt,
|
26
26
|
buttonSize: I = "m",
|
27
27
|
buttonClassName: L
|
28
|
-
} = i, [l, n] =
|
29
|
-
|
30
|
-
),
|
31
|
-
|
32
|
-
|
33
|
-
}, [
|
28
|
+
} = i, [l, n] = D(
|
29
|
+
r || []
|
30
|
+
), m = l.length >= u;
|
31
|
+
T(() => {
|
32
|
+
r && n(r);
|
33
|
+
}, [r]);
|
34
34
|
const N = (t) => {
|
35
|
-
const
|
35
|
+
const o = t.value.map((e) => f(e.file) ? {
|
36
36
|
id: e.id,
|
37
37
|
url: URL.createObjectURL(e.file),
|
38
38
|
type: e.file.type,
|
@@ -45,49 +45,50 @@ import '../../assets/UploaderPhotos.css';const g = {
|
|
45
45
|
name: e.file.name,
|
46
46
|
type: e.file.type
|
47
47
|
});
|
48
|
-
n((e) => [...e, ...
|
48
|
+
n((e) => [...e, ...o]), a == null || a({ type: "add", data: t.value });
|
49
49
|
}, c = (t) => {
|
50
|
-
n((
|
50
|
+
n((o) => o.filter((e) => e.id !== t)), a == null || a({ type: "delete", data: t });
|
51
51
|
}, { photos: R, files: S } = _(() => {
|
52
|
-
const t = () => l.filter((e) => !f(e)),
|
53
|
-
return s === "all" ? { files: t(), photos:
|
52
|
+
const t = () => l.filter((e) => !f(e)), o = () => l.filter(f);
|
53
|
+
return s === "all" ? { files: t(), photos: o() } : s === "files" ? { photos: [], files: t() } : s === "photos" ? { files: [], photos: o() } : { files: [], photos: [] };
|
54
54
|
}, [l, s]);
|
55
|
-
return /* @__PURE__ */
|
55
|
+
return /* @__PURE__ */ h(
|
56
56
|
"div",
|
57
57
|
{
|
58
|
-
|
58
|
+
"data-testid": "universal-uploader",
|
59
|
+
className: j(
|
59
60
|
g["upload-file-wrapper"],
|
60
|
-
|
61
|
+
m && g.disabled
|
61
62
|
),
|
62
63
|
children: [
|
63
64
|
/* @__PURE__ */ p(
|
64
|
-
|
65
|
+
O,
|
65
66
|
{
|
66
67
|
filesType: x,
|
67
68
|
arrayName: F,
|
68
69
|
maxSize: U,
|
69
70
|
onChangeValue: N,
|
70
71
|
ref: v,
|
71
|
-
maxFiles:
|
72
|
-
isDisabled:
|
72
|
+
maxFiles: u,
|
73
|
+
isDisabled: m,
|
73
74
|
titleUploader: b,
|
74
|
-
showOnlyUploadButton:
|
75
|
+
showOnlyUploadButton: d,
|
75
76
|
buttonText: w,
|
76
77
|
uploadButtonVariant: z,
|
77
78
|
buttonSize: I,
|
78
79
|
buttonClassName: L
|
79
80
|
}
|
80
81
|
),
|
81
|
-
!
|
82
|
+
!d && /* @__PURE__ */ h(V, { children: [
|
82
83
|
(s === "files" || s === "all") && /* @__PURE__ */ p(
|
83
|
-
|
84
|
+
E,
|
84
85
|
{
|
85
86
|
value: S,
|
86
87
|
onChange: (t) => c(t.deleteId)
|
87
88
|
}
|
88
89
|
),
|
89
90
|
(s === "photos" || s === "all") && /* @__PURE__ */ p(
|
90
|
-
|
91
|
+
M,
|
91
92
|
{
|
92
93
|
value: R,
|
93
94
|
onChange: (t) => c(t.deleteId)
|