@arthurzakharov/ui-kit 2.2.1 → 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.
- package/dist/assets/button-BMjMeK04.css +1 -0
- package/dist/assets/message-ByzpMD6r.css +1 -0
- package/dist/components/message/message.component.d.ts +4 -4
- package/dist/components/message/message.component.js +46 -31
- package/dist/components/text/text.component.js +87 -85
- package/dist/controls/buttons/button/button.component.d.ts +3 -1
- package/dist/controls/buttons/button/button.component.js +114 -84
- package/package.json +1 -1
- package/dist/assets/button-CE_Bd7VQ.css +0 -1
- package/dist/assets/message-CgGyIv5e.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Button_14or2_1{position:relative;box-sizing:border-box;border:none;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:border-color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary),background-color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Button_14or2_1:disabled{cursor:not-allowed;opacity:.33}._Button_14or2_1._SM_14or2_19{border-radius:var(--rm-ui-border-radius-sm);padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm)}._Button_14or2_1._LG_14or2_24._Tertiary_14or2_24{padding:calc(var(--rm-ui-padding-xs) - 1px) calc(var(--rm-ui-padding-sm) - 1px)}._Button_14or2_1._SM_14or2_19 ._Text_14or2_28{font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small)}._Button_14or2_1._MD_14or2_34{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_14or2_1._MD_14or2_34._Tertiary_14or2_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_14or2_1._LG_14or2_24{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_14or2_1._LG_14or2_24._Tertiary_14or2_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_14or2_1._MD_14or2_34 ._Text_14or2_28{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Button_14or2_1._LG_14or2_24 ._Text_14or2_28{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Button_14or2_1._Primary_14or2_62{background-color:var(--rm-ui-next-btn-bg)}._Button_14or2_1._Primary_14or2_62:hover{background-color:var(--rm-ui-next-btn-bg-hover)}._Button_14or2_1._Primary_14or2_62 ._Text_14or2_28,._Button_14or2_1._Primary_14or2_62 ._Info_14or2_71{color:#fff}._Button_14or2_1._Secondary_14or2_75{border:1px solid transparent;background-color:transparent}._Button_14or2_1._Secondary_14or2_75:hover{border-color:var(--rm-ui-grey-400)}._Button_14or2_1._Secondary_14or2_75:hover ._Text_14or2_28{color:var(--rm-ui-grey-400);border-color:var(--rm-ui-grey-400)}._Button_14or2_1._Secondary_14or2_75 ._Text_14or2_28,._Button_14or2_1._Secondary_14or2_75 ._Info_14or2_71{color:var(--rm-ui-color-text-secondary)}._Button_14or2_1._Tertiary_14or2_24{border:1px solid var(--rm-ui-grey-300);background-color:transparent}._Button_14or2_1._Tertiary_14or2_24:hover{border-color:var(--rm-ui-grey-200)}._Button_14or2_1._Tertiary_14or2_24:hover ._Text_14or2_28{color:var(--rm-ui-grey-700)}._Button_14or2_1._Tertiary_14or2_24 ._Text_14or2_28,._Button_14or2_1._Tertiary_14or2_24 ._Info_14or2_71{color:var(--rm-ui-color-text-primary)}._Button_14or2_1:not(._Loading_14or2_111):not(:disabled):hover{cursor:pointer}._Button_14or2_1:focus{outline-color:var(--rm-ui-color-focus)}._Button_14or2_1._FullWidth_14or2_119,._Button_14or2_1._FullWidthUntil768_14or2_123,._Button_14or2_1._FullWidthUntil1024_14or2_124,._Button_14or2_1._FullWidthUntil1200_14or2_125{width:100%}@media(min-width:768px){._Button_14or2_1._FullWidthUntil768_14or2_123{width:auto}}@media(min-width:1024px){._Button_14or2_1._FullWidthUntil1024_14or2_124{width:auto}}@media(min-width:1200px){._Button_14or2_1._FullWidthUntil1200_14or2_125{width:auto}}._Button_14or2_1._FullWidthFrom768_14or2_147,._Button_14or2_1._FullWidthFrom1024_14or2_148,._Button_14or2_1._FullWidthFrom1200_14or2_149{width:auto}@media(min-width:768px){._Button_14or2_1._FullWidthFrom768_14or2_147{width:100%}}@media(min-width:1024px){._Button_14or2_1._FullWidthFrom1024_14or2_148{width:100%}}@media(min-width:1200px){._Button_14or2_1._FullWidthFrom1200_14or2_149{width:100%}}._Content_14or2_171{display:flex;flex-direction:column}._Info_14or2_71{flex-basis:100%;font-weight:var(--rm-ui-font-weight-regular)}._Info_14or2_71._SM_14or2_19{font-size:var(--rm-ui-font-size-body-small);line-height:1.2}._Info_14or2_71._MD_14or2_34{font-size:var(--rm-ui-font-size-body);line-height:1.2}._Info_14or2_71._LG_14or2_24{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Text_14or2_28{font-weight:var(--rm-ui-font-weight-medium);transition:color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Loader_14or2_202{position:absolute}
|
|
@@ -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
|
};
|
|
@@ -49,93 +49,95 @@ import '../../assets/text-DYEJSFKw.css';const x = "_Lined_zitvv_1", b = "_Left_z
|
|
|
49
49
|
"page-title": { tag: "h1", weight: "bold", size: "hl1", color: "text-primary" },
|
|
50
50
|
"sidebar-title": { tag: "h3", weight: "bold", size: "hl3", color: "text-primary" },
|
|
51
51
|
"step-title": { tag: "h2", weight: "bold", size: "hl4", color: "text-primary" },
|
|
52
|
-
"under-submit": { tag: "p", weight: "
|
|
52
|
+
"under-submit": { tag: "p", weight: "regular", size: "body-small", color: "text-secondary" },
|
|
53
53
|
"under-submit-light": { tag: "p", weight: "light", size: "body-small", color: "text-secondary" }
|
|
54
|
-
}, _e = G(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const z = L(m, {
|
|
80
|
-
[e.Lined]: g,
|
|
81
|
-
// ALIGNMENTS
|
|
82
|
-
[e.Left]: y === "left",
|
|
83
|
-
[e.Center]: y === "center",
|
|
84
|
-
[e.Right]: y === "right",
|
|
85
|
-
// FONT WEIGHTS
|
|
86
|
-
[e.Light]: n === "light",
|
|
87
|
-
[e.Regular]: n === "regular",
|
|
88
|
-
[e.Medium]: n === "medium",
|
|
89
|
-
[e.Bold]: n === "bold",
|
|
90
|
-
// FONT SIZES
|
|
91
|
-
[e.BodyExtraSmall]: r === "body-extra-small",
|
|
92
|
-
[e.BodySmall]: r === "body-small",
|
|
93
|
-
[e.Body]: r === "body",
|
|
94
|
-
[e.BodyLarge]: r === "body-large",
|
|
95
|
-
[e.HL1]: r === "hl1",
|
|
96
|
-
[e.HL2]: r === "hl2",
|
|
97
|
-
[e.HL3]: r === "hl3",
|
|
98
|
-
[e.HL4]: r === "hl4",
|
|
99
|
-
[e.HL5]: r === "hl5",
|
|
100
|
-
// COLORS
|
|
101
|
-
[e.TextPrimary]: t === "text-primary",
|
|
102
|
-
[e.TextSecondary]: t === "text-secondary",
|
|
103
|
-
[e.AccentPrimary]: t === "accent-primary",
|
|
104
|
-
[e.AccentSecondary]: t === "accent-secondary",
|
|
105
|
-
[e.ThemePrimary]: t === "theme-primary",
|
|
106
|
-
[e.ThemeSecondary]: t === "theme-secondary",
|
|
107
|
-
[e.Error]: t === "error",
|
|
108
|
-
[e.Success]: t === "success",
|
|
109
|
-
[e.Focus]: t === "focus",
|
|
110
|
-
[e.Link]: t === "link",
|
|
111
|
-
[e.Grey950]: t === "grey-950",
|
|
112
|
-
[e.Grey900]: t === "grey-900",
|
|
113
|
-
[e.Grey800]: t === "grey-800",
|
|
114
|
-
[e.Grey700]: t === "grey-700",
|
|
115
|
-
[e.Grey600]: t === "grey-600",
|
|
116
|
-
[e.Grey500]: t === "grey-500",
|
|
117
|
-
[e.Grey400]: t === "grey-400",
|
|
118
|
-
[e.Grey300]: t === "grey-300",
|
|
119
|
-
[e.Grey200]: t === "grey-200",
|
|
120
|
-
[e.Grey100]: t === "grey-100",
|
|
121
|
-
[e.Grey50]: t === "grey-50",
|
|
122
|
-
// PRESETS
|
|
123
|
-
[e.UnderSubmit]: o === "under-submit",
|
|
124
|
-
[e.UnderSubmitLight]: o === "under-submit-light"
|
|
125
|
-
});
|
|
126
|
-
return /* @__PURE__ */ p(
|
|
127
|
-
u,
|
|
128
|
-
{
|
|
129
|
-
ref: h,
|
|
130
|
-
"data-testid": l["data-testid"] || "content",
|
|
131
|
-
tag: d,
|
|
132
|
-
alwaysRender: !1,
|
|
133
|
-
className: z,
|
|
134
|
-
...l,
|
|
135
|
-
children: v
|
|
54
|
+
}, _e = G(
|
|
55
|
+
({
|
|
56
|
+
children: v,
|
|
57
|
+
className: m,
|
|
58
|
+
preset: o,
|
|
59
|
+
lined: g = !1,
|
|
60
|
+
align: y = "left",
|
|
61
|
+
tag: c = "p",
|
|
62
|
+
weight: _ = "regular",
|
|
63
|
+
size: s = "body",
|
|
64
|
+
color: a = "text-primary",
|
|
65
|
+
...l
|
|
66
|
+
}, h) => {
|
|
67
|
+
let d = c, n = _, r = s, t = a;
|
|
68
|
+
if (o) {
|
|
69
|
+
const i = ce[o];
|
|
70
|
+
c !== "p" && c !== i.tag && console.warn(
|
|
71
|
+
`Text component: 'tag' prop will be overridden by 'preset="${o}"'. Remove explicit 'tag' prop if not intended.`
|
|
72
|
+
), _ !== "regular" && _ !== i.weight && console.warn(
|
|
73
|
+
`Text component: 'weight' prop will be overridden by 'preset="${o}"'. Remove explicit 'weight' prop if not intended.`
|
|
74
|
+
), s !== "body" && s !== i.size && console.warn(
|
|
75
|
+
`Text component: 'size' prop will be overridden by 'preset="${o}"'. Remove explicit 'size' prop if not intended.`
|
|
76
|
+
), a !== "text-primary" && a !== i.color && console.warn(
|
|
77
|
+
`Text component: 'color' prop will be overridden by 'preset="${o}"'. Remove explicit 'color' prop if not intended.`
|
|
78
|
+
), d = i.tag, n = i.weight, r = i.size, t = i.color;
|
|
136
79
|
}
|
|
137
|
-
|
|
138
|
-
|
|
80
|
+
const z = L(m, {
|
|
81
|
+
[e.Lined]: g,
|
|
82
|
+
// ALIGNMENTS
|
|
83
|
+
[e.Left]: y === "left",
|
|
84
|
+
[e.Center]: y === "center",
|
|
85
|
+
[e.Right]: y === "right",
|
|
86
|
+
// FONT WEIGHTS
|
|
87
|
+
[e.Light]: n === "light",
|
|
88
|
+
[e.Regular]: n === "regular",
|
|
89
|
+
[e.Medium]: n === "medium",
|
|
90
|
+
[e.Bold]: n === "bold",
|
|
91
|
+
// FONT SIZES
|
|
92
|
+
[e.BodyExtraSmall]: r === "body-extra-small",
|
|
93
|
+
[e.BodySmall]: r === "body-small",
|
|
94
|
+
[e.Body]: r === "body",
|
|
95
|
+
[e.BodyLarge]: r === "body-large",
|
|
96
|
+
[e.HL1]: r === "hl1",
|
|
97
|
+
[e.HL2]: r === "hl2",
|
|
98
|
+
[e.HL3]: r === "hl3",
|
|
99
|
+
[e.HL4]: r === "hl4",
|
|
100
|
+
[e.HL5]: r === "hl5",
|
|
101
|
+
// COLORS
|
|
102
|
+
[e.TextPrimary]: t === "text-primary",
|
|
103
|
+
[e.TextSecondary]: t === "text-secondary",
|
|
104
|
+
[e.AccentPrimary]: t === "accent-primary",
|
|
105
|
+
[e.AccentSecondary]: t === "accent-secondary",
|
|
106
|
+
[e.ThemePrimary]: t === "theme-primary",
|
|
107
|
+
[e.ThemeSecondary]: t === "theme-secondary",
|
|
108
|
+
[e.Error]: t === "error",
|
|
109
|
+
[e.Success]: t === "success",
|
|
110
|
+
[e.Focus]: t === "focus",
|
|
111
|
+
[e.Link]: t === "link",
|
|
112
|
+
[e.Grey950]: t === "grey-950",
|
|
113
|
+
[e.Grey900]: t === "grey-900",
|
|
114
|
+
[e.Grey800]: t === "grey-800",
|
|
115
|
+
[e.Grey700]: t === "grey-700",
|
|
116
|
+
[e.Grey600]: t === "grey-600",
|
|
117
|
+
[e.Grey500]: t === "grey-500",
|
|
118
|
+
[e.Grey400]: t === "grey-400",
|
|
119
|
+
[e.Grey300]: t === "grey-300",
|
|
120
|
+
[e.Grey200]: t === "grey-200",
|
|
121
|
+
[e.Grey100]: t === "grey-100",
|
|
122
|
+
[e.Grey50]: t === "grey-50",
|
|
123
|
+
// PRESETS
|
|
124
|
+
[e.UnderSubmit]: o === "under-submit",
|
|
125
|
+
[e.UnderSubmitLight]: o === "under-submit-light"
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ p(
|
|
128
|
+
u,
|
|
129
|
+
{
|
|
130
|
+
ref: h,
|
|
131
|
+
"data-testid": l["data-testid"] || "content",
|
|
132
|
+
tag: d,
|
|
133
|
+
alwaysRender: !1,
|
|
134
|
+
className: z,
|
|
135
|
+
...l,
|
|
136
|
+
children: v
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
139
141
|
_e.displayName = "Text";
|
|
140
142
|
export {
|
|
141
143
|
_e as Text
|
|
@@ -10,6 +10,8 @@ export interface ButtonProps extends Base {
|
|
|
10
10
|
disabled?: boolean;
|
|
11
11
|
info?: ReactNode;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
|
+
fullWidthUntil?: 768 | 1024 | 1200;
|
|
14
|
+
fullWidthFrom?: 768 | 1024 | 1200;
|
|
13
15
|
loading?: boolean;
|
|
14
16
|
preventDefault?: boolean;
|
|
15
17
|
blurAfterClick?: boolean;
|
|
@@ -17,4 +19,4 @@ export interface ButtonProps extends Base {
|
|
|
17
19
|
onFocus?: () => void;
|
|
18
20
|
onBlur?: () => void;
|
|
19
21
|
}
|
|
20
|
-
export declare const Button: ({ text, color, textSize, infoSize, type, disabled, info, fullWidth, loading, preventDefault, blurAfterClick, onClick, onFocus, onBlur, ...base }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const Button: ({ text, color, textSize, infoSize, type, disabled, info, fullWidth, fullWidthUntil, fullWidthFrom, loading, preventDefault, blurAfterClick, onClick, onFocus, onBlur, ...base }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,94 +1,124 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as d, jsx as _ } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as x } from "react";
|
|
3
|
+
import u from "clsx";
|
|
4
|
+
import { FadeScale as U } from "../../../animations/fade-scale/fade-scale.component.js";
|
|
5
|
+
import { Loader as b } from "../../../components/loader/loader.component.js";
|
|
6
|
+
import { Content as w } from "../../../utils/content/content.component.js";
|
|
7
|
+
import { withControl as v, baseProps as m } from "../../../utils/functions/functions.util.js";
|
|
8
|
+
import '../../../assets/button-BMjMeK04.css';const C = "_Button_14or2_1", T = "_SM_14or2_19", S = "_LG_14or2_24", k = "_Tertiary_14or2_24", N = "_Text_14or2_28", D = "_MD_14or2_34", G = "_Primary_14or2_62", P = "_Info_14or2_71", I = "_Secondary_14or2_75", g = "_Loading_14or2_111", $ = "_FullWidth_14or2_119", j = "_FullWidthUntil768_14or2_123", E = "_FullWidthUntil1024_14or2_124", q = "_FullWidthUntil1200_14or2_125", A = "_FullWidthFrom768_14or2_147", H = "_FullWidthFrom1024_14or2_148", J = "_FullWidthFrom1200_14or2_149", K = "_Content_14or2_171", O = "_Loader_14or2_202", t = {
|
|
9
|
+
Button: C,
|
|
10
|
+
SM: T,
|
|
10
11
|
LG: S,
|
|
11
|
-
Tertiary:
|
|
12
|
-
Text:
|
|
13
|
-
MD:
|
|
14
|
-
Primary:
|
|
15
|
-
Info:
|
|
16
|
-
Secondary:
|
|
12
|
+
Tertiary: k,
|
|
13
|
+
Text: N,
|
|
14
|
+
MD: D,
|
|
15
|
+
Primary: G,
|
|
16
|
+
Info: P,
|
|
17
|
+
Secondary: I,
|
|
17
18
|
Loading: g,
|
|
18
|
-
FullWidth:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
FullWidth: $,
|
|
20
|
+
FullWidthUntil768: j,
|
|
21
|
+
FullWidthUntil1024: E,
|
|
22
|
+
FullWidthUntil1200: q,
|
|
23
|
+
FullWidthFrom768: A,
|
|
24
|
+
FullWidthFrom1024: H,
|
|
25
|
+
FullWidthFrom1200: J,
|
|
26
|
+
Content: K,
|
|
27
|
+
Loader: O
|
|
28
|
+
}, tt = ({
|
|
29
|
+
text: F,
|
|
30
|
+
color: i = "primary",
|
|
31
|
+
textSize: l = "md",
|
|
32
|
+
infoSize: a = "sm",
|
|
33
|
+
type: h = "button",
|
|
34
|
+
disabled: y = !1,
|
|
35
|
+
info: p = "",
|
|
36
|
+
fullWidth: o = !1,
|
|
37
|
+
fullWidthUntil: n,
|
|
38
|
+
fullWidthFrom: e,
|
|
39
|
+
loading: s = !1,
|
|
40
|
+
preventDefault: W = !1,
|
|
32
41
|
blurAfterClick: L = !1,
|
|
33
42
|
onClick: f = () => {
|
|
34
43
|
},
|
|
35
|
-
onFocus:
|
|
44
|
+
onFocus: B,
|
|
36
45
|
onBlur: M,
|
|
37
|
-
...
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
[
|
|
49
|
-
|
|
50
|
-
[
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
46
|
+
...c
|
|
47
|
+
}) => {
|
|
48
|
+
const r = n !== void 0 && e !== void 0;
|
|
49
|
+
return x(() => {
|
|
50
|
+
if (r) {
|
|
51
|
+
console.warn(
|
|
52
|
+
"[ui-kit] Button: `fullWidthUntil` and `fullWidthFrom` are mutually exclusive. Both are set — neither will be applied. Use only one."
|
|
53
|
+
);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
n !== void 0 && !o && console.warn(
|
|
57
|
+
"[ui-kit] Button: `fullWidthUntil` is set but `fullWidth` is not true. `fullWidthUntil` has no effect without `fullWidth`."
|
|
58
|
+
), e !== void 0 && !o && console.warn(
|
|
59
|
+
"[ui-kit] Button: `fullWidthFrom` is set but `fullWidth` is not true. `fullWidthFrom` has no effect without `fullWidth`."
|
|
60
|
+
);
|
|
61
|
+
}, [o, n, e, r]), /* @__PURE__ */ d(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
"data-testid": m(c, "data-testid", "button"),
|
|
65
|
+
type: h,
|
|
66
|
+
disabled: y || s,
|
|
67
|
+
className: u(t.Button, m(c, "className"), {
|
|
68
|
+
[t.SM]: l === "sm",
|
|
69
|
+
[t.MD]: l === "md",
|
|
70
|
+
[t.LG]: l === "lg",
|
|
71
|
+
[t.Primary]: i === "primary",
|
|
72
|
+
[t.Secondary]: i === "secondary",
|
|
73
|
+
[t.Tertiary]: i === "tertiary",
|
|
74
|
+
[t.FullWidth]: o && n === void 0 && e === void 0,
|
|
75
|
+
[t.FullWidthUntil768]: o && !r && n === 768,
|
|
76
|
+
[t.FullWidthUntil1024]: o && !r && n === 1024,
|
|
77
|
+
[t.FullWidthUntil1200]: o && !r && n === 1200,
|
|
78
|
+
[t.FullWidthFrom768]: o && !r && e === 768,
|
|
79
|
+
[t.FullWidthFrom1024]: o && !r && e === 1024,
|
|
80
|
+
[t.FullWidthFrom1200]: o && !r && e === 1200,
|
|
81
|
+
[t.Loading]: s
|
|
82
|
+
}),
|
|
83
|
+
onClick: v(f, { prevent: W, blur: L }),
|
|
84
|
+
onFocus: () => B?.(),
|
|
85
|
+
onBlur: () => M?.(),
|
|
86
|
+
children: [
|
|
87
|
+
s && /* @__PURE__ */ _(
|
|
88
|
+
b,
|
|
79
89
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
size: "xs",
|
|
91
|
+
color: (() => {
|
|
92
|
+
switch (i) {
|
|
93
|
+
case "primary":
|
|
94
|
+
return "white";
|
|
95
|
+
case "secondary":
|
|
96
|
+
return "text-secondary";
|
|
97
|
+
case "tertiary":
|
|
98
|
+
return "text-primary";
|
|
99
|
+
}
|
|
100
|
+
})(),
|
|
101
|
+
className: t.Loader
|
|
86
102
|
}
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ d(U, { name: "content", keepMount: !0, condition: !s, className: t.Content, children: [
|
|
105
|
+
/* @__PURE__ */ _("span", { className: t.Text, children: F }),
|
|
106
|
+
/* @__PURE__ */ _(
|
|
107
|
+
w,
|
|
108
|
+
{
|
|
109
|
+
className: u(t.Info, {
|
|
110
|
+
[t.SM]: a === "sm",
|
|
111
|
+
[t.MD]: a === "md",
|
|
112
|
+
[t.LG]: a === "lg"
|
|
113
|
+
}),
|
|
114
|
+
children: p
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
};
|
|
92
122
|
export {
|
|
93
|
-
|
|
123
|
+
tt as Button
|
|
94
124
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._Button_esa05_1{position:relative;box-sizing:border-box;border:none;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:border-color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary),background-color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Button_esa05_1:disabled{cursor:not-allowed;opacity:.33}._Button_esa05_1._SM_esa05_19{border-radius:var(--rm-ui-border-radius-sm);padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm)}._Button_esa05_1._LG_esa05_24._Tertiary_esa05_24{padding:calc(var(--rm-ui-padding-xs) - 1px) calc(var(--rm-ui-padding-sm) - 1px)}._Button_esa05_1._SM_esa05_19 ._Text_esa05_28{font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body-small);line-height:var(--rm-ui-line-height-body-small)}._Button_esa05_1._MD_esa05_34{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_esa05_1._MD_esa05_34._Tertiary_esa05_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_esa05_1._LG_esa05_24{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_esa05_1._LG_esa05_24._Tertiary_esa05_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_esa05_1._MD_esa05_34 ._Text_esa05_28{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Button_esa05_1._LG_esa05_24 ._Text_esa05_28{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Button_esa05_1._Primary_esa05_62{background-color:var(--rm-ui-next-btn-bg)}._Button_esa05_1._Primary_esa05_62:hover{background-color:var(--rm-ui-next-btn-bg-hover)}._Button_esa05_1._Primary_esa05_62 ._Text_esa05_28,._Button_esa05_1._Primary_esa05_62 ._Info_esa05_71{color:#fff}._Button_esa05_1._Secondary_esa05_75{border:1px solid transparent;background-color:transparent}._Button_esa05_1._Secondary_esa05_75:hover{border-color:var(--rm-ui-grey-400)}._Button_esa05_1._Secondary_esa05_75:hover ._Text_esa05_28{color:var(--rm-ui-grey-400);border-color:var(--rm-ui-grey-400)}._Button_esa05_1._Secondary_esa05_75 ._Text_esa05_28,._Button_esa05_1._Secondary_esa05_75 ._Info_esa05_71{color:var(--rm-ui-color-text-secondary)}._Button_esa05_1._Tertiary_esa05_24{border:1px solid var(--rm-ui-grey-300);background-color:transparent}._Button_esa05_1._Tertiary_esa05_24:hover{border-color:var(--rm-ui-grey-200)}._Button_esa05_1._Tertiary_esa05_24:hover ._Text_esa05_28{color:var(--rm-ui-grey-700)}._Button_esa05_1._Tertiary_esa05_24 ._Text_esa05_28,._Button_esa05_1._Tertiary_esa05_24 ._Info_esa05_71{color:var(--rm-ui-color-text-primary)}._Button_esa05_1:not(._Loading_esa05_111):not(:disabled):hover{cursor:pointer}._Button_esa05_1:focus{outline-color:var(--rm-ui-color-focus)}._Button_esa05_1._FullWidth_esa05_119{width:100%}._Content_esa05_123{display:flex;flex-direction:column}._Info_esa05_71{flex-basis:100%;font-weight:var(--rm-ui-font-weight-regular)}._Info_esa05_71._SM_esa05_19{font-size:var(--rm-ui-font-size-body-small);line-height:1.2}._Info_esa05_71._MD_esa05_34{font-size:var(--rm-ui-font-size-body);line-height:1.2}._Info_esa05_71._LG_esa05_24{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Text_esa05_28{font-weight:var(--rm-ui-font-weight-medium);transition:color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Loader_esa05_154{position:absolute}
|
|
@@ -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)}
|