@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 o, jsx as t } from "react/jsx-runtime";
2
- import { Check as l, CircleQuestionMark as _, X as d, CircleAlert as m } from "lucide-react";
3
- import f from "clsx";
4
- import { baseProps as n } from "../../utils/functions/functions.util.js";
5
- import { Content as a } from "../../utils/content/content.component.js";
6
- import '../../assets/message-CgGyIv5e.css';const u = "_Message_fkc6l_1", k = "_Success_fkc6l_15", I = "_Icon_fkc6l_19", x = "_Question_fkc6l_23", C = "_Info_fkc6l_39", N = "_Content_fkc6l_52", g = "_Title_fkc6l_62", T = "_Text_fkc6l_66", s = {
7
- Message: u,
8
- Success: k,
9
- Icon: I,
10
- Question: x,
11
- Error: "_Error_fkc6l_31",
12
- Info: C,
13
- Content: N,
14
- Title: g,
15
- Text: T
16
- }, E = ({ type: e, title: i, text: r, ...c }) => /* @__PURE__ */ o(
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": n(c, "data-testid", "message"),
20
- className: f(s.Message, n(c, "className"), {
21
- [s.Success]: e === "success",
22
- [s.Question]: e === "question",
23
- [s.Error]: e === "error",
24
- [s.Info]: e === "info"
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
- e === "success" && /* @__PURE__ */ t(l, { "data-testid": "success-icon", className: s.Icon }),
28
- e === "question" && /* @__PURE__ */ t(_, { "data-testid": "question-icon", className: s.Icon }),
29
- e === "error" && /* @__PURE__ */ t(d, { "data-testid": "error-icon", className: s.Icon }),
30
- e === "info" && /* @__PURE__ */ t(m, { "data-testid": "info-icon", className: s.Icon }),
31
- /* @__PURE__ */ o("div", { className: s.Content, children: [
32
- /* @__PURE__ */ t(a, { "data-testid": "message-title", className: s.Title, children: i }),
33
- /* @__PURE__ */ t(a, { "data-testid": "message-text", className: s.Text, children: r })
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
- E as Message
54
+ p as Message
40
55
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "2.4.0",
4
+ "version": "2.4.1",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -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)}