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.
@@ -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
+ };
@@ -0,0 +1,9 @@
1
+ export declare enum EMessageShortReplyVariant {
2
+ Sapphire = "sapphire",
3
+ SapphireFilled = "sapphire-filled",
4
+ Citrine = "citrine",
5
+ Asphalt = "asphalt",
6
+ Gray = "gray",
7
+ White = "white",
8
+ Green = "green"
9
+ }
@@ -0,0 +1,4 @@
1
+ var p = /* @__PURE__ */ ((i) => (i.Sapphire = "sapphire", i.SapphireFilled = "sapphire-filled", i.Citrine = "citrine", i.Asphalt = "asphalt", i.Gray = "gray", i.White = "white", i.Green = "green", i))(p || {});
2
+ export {
3
+ p as EMessageShortReplyVariant
4
+ };
@@ -0,0 +1,2 @@
1
+ export { MessageShortReply, type TProps as TMessageShortReplyProps } from './MessageShortReply';
2
+ export { EMessageShortReplyVariant } from './constants';
@@ -0,0 +1,6 @@
1
+ import { MessageShortReply as o } from "./MessageShortReply.js";
2
+ import { EMessageShortReplyVariant as a } from "./constants.js";
3
+ export {
4
+ a as EMessageShortReplyVariant,
5
+ o as MessageShortReply
6
+ };
@@ -1,38 +1,38 @@
1
- import { jsxs as y, jsx as p, Fragment as j } from "react/jsx-runtime";
2
- import { c as B } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as D, useState as T, useEffect as V, useMemo as _ } from "react";
4
- import { imageTypes as h } from "./constants.js";
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 E } from "../Button/constants.js";
7
- import { ListFiles as M } from "../ListFiles/ListFiles.js";
8
- import { ListPhotos as O } from "../ListPhotos/ListPhotos.js";
9
- import { Uploader as P } from "../Uploader/Uploader.js";
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 ? h.includes(i.file.type) : "type" in i && typeof i.type == "string" ? h.includes(i.type) : !1, W = D(
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: o,
20
- value: a,
21
- maxFiles: m,
19
+ onChange: a,
20
+ value: r,
21
+ maxFiles: u,
22
22
  titleUploader: b,
23
23
  buttonText: w = "Выберите файлы",
24
- showOnlyUploadButton: u = !1,
25
- uploadButtonVariant: z = E.SecondaryAsphalt,
24
+ showOnlyUploadButton: d = !1,
25
+ uploadButtonVariant: z = C.SecondaryAsphalt,
26
26
  buttonSize: I = "m",
27
27
  buttonClassName: L
28
- } = i, [l, n] = T(
29
- a || []
30
- ), d = l.length >= m;
31
- V(() => {
32
- a && n(a);
33
- }, [a]);
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 r = t.value.map((e) => f(e.file) ? {
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, ...r]), o == null || o({ type: "add", data: t.value });
48
+ n((e) => [...e, ...o]), a == null || a({ type: "add", data: t.value });
49
49
  }, c = (t) => {
50
- n((r) => r.filter((e) => e.id !== t)), o == null || o({ type: "delete", data: t });
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)), r = () => l.filter(f);
53
- return s === "all" ? { files: t(), photos: r() } : s === "files" ? { photos: [], files: t() } : s === "photos" ? { files: [], photos: r() } : { files: [], 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__ */ y(
55
+ return /* @__PURE__ */ h(
56
56
  "div",
57
57
  {
58
- className: B(
58
+ "data-testid": "universal-uploader",
59
+ className: j(
59
60
  g["upload-file-wrapper"],
60
- d && g.disabled
61
+ m && g.disabled
61
62
  ),
62
63
  children: [
63
64
  /* @__PURE__ */ p(
64
- P,
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: m,
72
- isDisabled: d,
72
+ maxFiles: u,
73
+ isDisabled: m,
73
74
  titleUploader: b,
74
- showOnlyUploadButton: u,
75
+ showOnlyUploadButton: d,
75
76
  buttonText: w,
76
77
  uploadButtonVariant: z,
77
78
  buttonSize: I,
78
79
  buttonClassName: L
79
80
  }
80
81
  ),
81
- !u && /* @__PURE__ */ y(j, { children: [
82
+ !d && /* @__PURE__ */ h(V, { children: [
82
83
  (s === "files" || s === "all") && /* @__PURE__ */ p(
83
- M,
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
- O,
91
+ M,
91
92
  {
92
93
  value: R,
93
94
  onChange: (t) => c(t.deleteId)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.36.16",
4
+ "version": "1.37.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {