@arthurzakharov/ui-kit 2.4.0 → 2.4.1
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Message_1591m_1{--message-icon-size: 24px;border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-md);display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start;gap:var(--rm-ui-padding-xs);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Success_1591m_15{background-color:var(--rm-ui-message-success-secondary)}._Success_1591m_15 ._Icon_1591m_19{stroke:var(--rm-ui-message-success-primary)}._Question_1591m_23{background-color:var(--rm-ui-message-question-secondary)}._Question_1591m_23 ._Icon_1591m_19{stroke:var(--rm-ui-message-question-primary)}._Error_1591m_31{background-color:var(--rm-ui-message-error-secondary)}._Error_1591m_31 ._Icon_1591m_19{stroke:var(--rm-ui-message-error-primary)}._Info_1591m_39{background-color:var(--rm-ui-message-info-secondary)}._Info_1591m_39 ._Icon_1591m_19{stroke:var(--rm-ui-message-info-primary)}._Icon_1591m_19{width:var(--message-icon-size);height:var(--message-icon-size)}._Content_1591m_52{flex-basis:calc(100% - var(--message-icon-size) - var(--rm-ui-padding-xs));display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._ContentFull_1591m_61{flex-basis:100%}._AlignLeft_1591m_65{align-items:flex-start}._AlignRight_1591m_69{align-items:flex-end}._AlignCenter_1591m_73{align-items:center}._Title_1591m_77{font-weight:var(--rm-ui-font-weight-medium)}._Text_1591m_81{font-weight:var(--rm-ui-font-weight-regular)}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { Base } from '../../utils/types';
|
|
3
3
|
type MessageType = 'success' | 'question' | 'error' | 'info';
|
|
4
|
+
type MessageAlign = 'left' | 'right' | 'center';
|
|
4
5
|
export interface MessageProps extends Base {
|
|
5
6
|
type: MessageType;
|
|
6
7
|
title: ReactNode;
|
|
7
8
|
text: ReactNode;
|
|
9
|
+
withoutIcon?: boolean;
|
|
10
|
+
align?: MessageAlign;
|
|
8
11
|
}
|
|
9
|
-
|
|
10
|
-
* Displays a message with an icon, title, and text content based on the message type (`success`, `question`, `error`, or `info`).
|
|
11
|
-
*/
|
|
12
|
-
export declare const Message: ({ type, title, text, ...base }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare const Message: ({ type, title, text, withoutIcon, align, ...base }: MessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -1,40 +1,55 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Check as
|
|
3
|
-
import
|
|
4
|
-
import { baseProps as
|
|
5
|
-
import { Content as
|
|
6
|
-
import '../../assets/message-
|
|
7
|
-
Message:
|
|
8
|
-
Success:
|
|
9
|
-
Icon:
|
|
10
|
-
Question:
|
|
11
|
-
Error: "
|
|
12
|
-
Info:
|
|
13
|
-
Content:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { jsxs as _, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { Check as g, CircleQuestionMark as d, X as f, CircleAlert as C } from "lucide-react";
|
|
3
|
+
import l from "clsx";
|
|
4
|
+
import { baseProps as a } from "../../utils/functions/functions.util.js";
|
|
5
|
+
import { Content as u } from "../../utils/content/content.component.js";
|
|
6
|
+
import '../../assets/message-ByzpMD6r.css';const A = "_Message_1591m_1", x = "_Success_1591m_15", T = "_Icon_1591m_19", I = "_Question_1591m_23", N = "_Info_1591m_39", M = "_Content_1591m_52", h = "_ContentFull_1591m_61", F = "_AlignLeft_1591m_65", Q = "_AlignRight_1591m_69", L = "_AlignCenter_1591m_73", R = "_Title_1591m_77", S = "_Text_1591m_81", e = {
|
|
7
|
+
Message: A,
|
|
8
|
+
Success: x,
|
|
9
|
+
Icon: T,
|
|
10
|
+
Question: I,
|
|
11
|
+
Error: "_Error_1591m_31",
|
|
12
|
+
Info: N,
|
|
13
|
+
Content: M,
|
|
14
|
+
ContentFull: h,
|
|
15
|
+
AlignLeft: F,
|
|
16
|
+
AlignRight: Q,
|
|
17
|
+
AlignCenter: L,
|
|
18
|
+
Title: R,
|
|
19
|
+
Text: S
|
|
20
|
+
}, m = (t, o, c) => typeof t == "string" ? /* @__PURE__ */ n(u, { "data-testid": o, className: c, children: t }) : t, p = ({ type: t, title: o, text: c, withoutIcon: s, align: i = "left", ...r }) => /* @__PURE__ */ _(
|
|
17
21
|
"div",
|
|
18
22
|
{
|
|
19
|
-
"data-testid":
|
|
20
|
-
className:
|
|
21
|
-
[
|
|
22
|
-
[
|
|
23
|
-
[
|
|
24
|
-
[
|
|
23
|
+
"data-testid": a(r, "data-testid", "message"),
|
|
24
|
+
className: l(e.Message, a(r, "className"), {
|
|
25
|
+
[e.Success]: t === "success",
|
|
26
|
+
[e.Question]: t === "question",
|
|
27
|
+
[e.Error]: t === "error",
|
|
28
|
+
[e.Info]: t === "info"
|
|
25
29
|
}),
|
|
26
30
|
children: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
!s && t === "success" && /* @__PURE__ */ n(g, { "data-testid": "success-icon", className: e.Icon }),
|
|
32
|
+
!s && t === "question" && /* @__PURE__ */ n(d, { "data-testid": "question-icon", className: e.Icon }),
|
|
33
|
+
!s && t === "error" && /* @__PURE__ */ n(f, { "data-testid": "error-icon", className: e.Icon }),
|
|
34
|
+
!s && t === "info" && /* @__PURE__ */ n(C, { "data-testid": "info-icon", className: e.Icon }),
|
|
35
|
+
/* @__PURE__ */ _(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: l(e.Content, {
|
|
39
|
+
[e.ContentFull]: s,
|
|
40
|
+
[e.AlignLeft]: i === "left",
|
|
41
|
+
[e.AlignRight]: i === "right",
|
|
42
|
+
[e.AlignCenter]: i === "center"
|
|
43
|
+
}),
|
|
44
|
+
children: [
|
|
45
|
+
m(o, "message-title", e.Title),
|
|
46
|
+
m(c, "message-text", e.Text)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
35
50
|
]
|
|
36
51
|
}
|
|
37
52
|
);
|
|
38
53
|
export {
|
|
39
|
-
|
|
54
|
+
p as Message
|
|
40
55
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._Message_fkc6l_1{--message-icon-size: 24px;border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-md);display:flex;flex-direction:row;flex-wrap:nowrap;align-items:flex-start;justify-content:flex-start;gap:var(--rm-ui-padding-xs);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Success_fkc6l_15{background-color:var(--rm-ui-message-success-secondary)}._Success_fkc6l_15 ._Icon_fkc6l_19{stroke:var(--rm-ui-message-success-primary)}._Question_fkc6l_23{background-color:var(--rm-ui-message-question-secondary)}._Question_fkc6l_23 ._Icon_fkc6l_19{stroke:var(--rm-ui-message-question-primary)}._Error_fkc6l_31{background-color:var(--rm-ui-message-error-secondary)}._Error_fkc6l_31 ._Icon_fkc6l_19{stroke:var(--rm-ui-message-error-primary)}._Info_fkc6l_39{background-color:var(--rm-ui-message-info-secondary)}._Info_fkc6l_39 ._Icon_fkc6l_19{stroke:var(--rm-ui-message-info-primary)}._Icon_fkc6l_19{width:var(--message-icon-size);height:var(--message-icon-size)}._Content_fkc6l_52{flex-basis:calc(100% - var(--message-icon-size) - var(--rm-ui-padding-xs));display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Title_fkc6l_62{font-weight:var(--rm-ui-font-weight-medium)}._Text_fkc6l_66{font-weight:var(--rm-ui-font-weight-regular)}
|