@arthurzakharov/ui-kit 3.17.0 → 3.19.0
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-DBz6-Gkk.css +1 -0
- package/dist/assets/text-area-aZwGK7CT.css +1 -0
- package/dist/components/accordion-table/accordion-table.component.js +15 -14
- package/dist/components/user-panel/user-panel.component.js +3 -2
- package/dist/controls/buttons/button/button.component.d.ts +2 -1
- package/dist/controls/buttons/button/button.component.js +102 -83
- package/dist/controls/interactives/text-area/text-area.component.d.ts +3 -1
- package/dist/controls/interactives/text-area/text-area.component.js +53 -47
- package/package.json +1 -1
- package/dist/assets/button-BMjMeK04.css +0 -1
- package/dist/assets/text-area-Dgc2jHSx.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Button_o1crw_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)}._WithHint_o1crw_14{display:inline-flex;flex-direction:row;align-items:center;gap:var(--rm-ui-padding-sm)}._EnterHint_o1crw_21{white-space:nowrap}._Button_o1crw_1:disabled{cursor:not-allowed;opacity:.33}._Button_o1crw_1._SM_o1crw_30{border-radius:var(--rm-ui-border-radius-sm);padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm)}._Button_o1crw_1._LG_o1crw_35._Tertiary_o1crw_35{padding:calc(var(--rm-ui-padding-xs) - 1px) calc(var(--rm-ui-padding-sm) - 1px)}._Button_o1crw_1._SM_o1crw_30 ._Text_o1crw_39{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_o1crw_1._MD_o1crw_45{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_o1crw_1._MD_o1crw_45._Tertiary_o1crw_35{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_o1crw_1._LG_o1crw_35{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._Button_o1crw_1._LG_o1crw_35._Tertiary_o1crw_35{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._Button_o1crw_1._MD_o1crw_45 ._Text_o1crw_39{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._Button_o1crw_1._LG_o1crw_35 ._Text_o1crw_39{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Button_o1crw_1._Primary_o1crw_73{background-color:var(--rm-ui-next-btn-bg)}._Button_o1crw_1._Primary_o1crw_73:hover{background-color:var(--rm-ui-next-btn-bg-hover)}._Button_o1crw_1._Primary_o1crw_73 ._Text_o1crw_39,._Button_o1crw_1._Primary_o1crw_73 ._Info_o1crw_82{color:#fff}._Button_o1crw_1._Secondary_o1crw_86{border:1px solid transparent;background-color:transparent}._Button_o1crw_1._Secondary_o1crw_86:hover{border-color:var(--rm-ui-grey-400)}._Button_o1crw_1._Secondary_o1crw_86:hover ._Text_o1crw_39{color:var(--rm-ui-grey-400);border-color:var(--rm-ui-grey-400)}._Button_o1crw_1._Secondary_o1crw_86 ._Text_o1crw_39,._Button_o1crw_1._Secondary_o1crw_86 ._Info_o1crw_82{color:var(--rm-ui-color-text-secondary)}._Button_o1crw_1._Tertiary_o1crw_35{border:1px solid var(--rm-ui-grey-300);background-color:transparent}._Button_o1crw_1._Tertiary_o1crw_35:hover{border-color:var(--rm-ui-grey-200)}._Button_o1crw_1._Tertiary_o1crw_35:hover ._Text_o1crw_39{color:var(--rm-ui-grey-700)}._Button_o1crw_1._Tertiary_o1crw_35 ._Text_o1crw_39,._Button_o1crw_1._Tertiary_o1crw_35 ._Info_o1crw_82{color:var(--rm-ui-color-text-primary)}._Button_o1crw_1:not(._Loading_o1crw_122):not(:disabled):hover{cursor:pointer}._Button_o1crw_1:focus{outline-color:var(--rm-ui-color-focus)}._Button_o1crw_1._FullWidth_o1crw_130,._Button_o1crw_1._FullWidthUntil768_o1crw_134,._Button_o1crw_1._FullWidthUntil1024_o1crw_135,._Button_o1crw_1._FullWidthUntil1200_o1crw_136{width:100%}@media(min-width:768px){._Button_o1crw_1._FullWidthUntil768_o1crw_134{width:auto}}@media(min-width:1024px){._Button_o1crw_1._FullWidthUntil1024_o1crw_135{width:auto}}@media(min-width:1200px){._Button_o1crw_1._FullWidthUntil1200_o1crw_136{width:auto}}._Button_o1crw_1._FullWidthFrom768_o1crw_158,._Button_o1crw_1._FullWidthFrom1024_o1crw_159,._Button_o1crw_1._FullWidthFrom1200_o1crw_160{width:auto}@media(min-width:768px){._Button_o1crw_1._FullWidthFrom768_o1crw_158{width:100%}}@media(min-width:1024px){._Button_o1crw_1._FullWidthFrom1024_o1crw_159{width:100%}}@media(min-width:1200px){._Button_o1crw_1._FullWidthFrom1200_o1crw_160{width:100%}}._Content_o1crw_182{display:flex;flex-direction:column}._Info_o1crw_82{flex-basis:100%;font-weight:var(--rm-ui-font-weight-regular)}._Info_o1crw_82._SM_o1crw_30{font-size:var(--rm-ui-font-size-body-small);line-height:1.2}._Info_o1crw_82._MD_o1crw_45{font-size:var(--rm-ui-font-size-body);line-height:1.2}._Info_o1crw_82._LG_o1crw_35{font-size:var(--rm-ui-font-size-body-large);line-height:1.2}._Text_o1crw_39{font-weight:var(--rm-ui-font-weight-medium);transition:color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Loader_o1crw_213{position:absolute}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._TextArea_15g66_1{display:flex;flex-direction:column}._Input_15g66_6{resize:none;outline:none;box-sizing:border-box;width:100%;border:none;border-radius:10px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm);font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._Input_15g66_6:hover{cursor:pointer}._Input_15g66_6:disabled{opacity:.33}._ErrorMessage_15g66_28{padding-top:var(--rm-ui-padding-xxs)}._FieldGroup_15g66_32{display:flex;flex-direction:column;gap:var(--rm-ui-padding-xs);width:100%}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
1
|
+
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as H, Fragment as p } from "react";
|
|
3
3
|
import { ChevronDown as B } from "lucide-react";
|
|
4
4
|
import { clsx as s, baseProps as _ } from "../../utils/functions/functions.util.js";
|
|
5
5
|
import { FadeGrow as g } from "../../animations/fade-grow/fade-grow.component.js";
|
|
6
6
|
import { Rotate as C } from "../../animations/rotate/rotate.component.js";
|
|
7
|
+
import "../text/text.component.js";
|
|
7
8
|
import "../../utils/content/content.component.js";
|
|
8
9
|
import "usehooks-ts";
|
|
9
10
|
import "../../controls/primitives/box/box.component.js";
|
|
10
11
|
import { ButtonText as w } from "../../controls/buttons/button-text/button-text.component.js";
|
|
11
|
-
import '../../assets/accordion-table-Ci3u6qTN.css';const b = "_AccordionTable_gmtv3_1", $ = "_Head_gmtv3_11", u = "_HeadRow_gmtv3_15", R = "_DataRow_gmtv3_16", f = "_BodyRow_gmtv3_21", N = "_HeadCell_gmtv3_25", A = "_BodyCell_gmtv3_26", T = "_BodyHeadCell_gmtv3_41", D = "_BodyHead_gmtv3_41",
|
|
12
|
+
import '../../assets/accordion-table-Ci3u6qTN.css';const b = "_AccordionTable_gmtv3_1", $ = "_Head_gmtv3_11", u = "_HeadRow_gmtv3_15", R = "_DataRow_gmtv3_16", f = "_BodyRow_gmtv3_21", N = "_HeadCell_gmtv3_25", A = "_BodyCell_gmtv3_26", T = "_BodyHeadCell_gmtv3_41", D = "_BodyHead_gmtv3_41", a = {
|
|
12
13
|
AccordionTable: b,
|
|
13
14
|
Head: $,
|
|
14
15
|
HeadRow: u,
|
|
@@ -18,26 +19,26 @@ import '../../assets/accordion-table-Ci3u6qTN.css';const b = "_AccordionTable_gm
|
|
|
18
19
|
BodyCell: A,
|
|
19
20
|
BodyHeadCell: T,
|
|
20
21
|
BodyHead: D
|
|
21
|
-
},
|
|
22
|
+
}, J = ({ table: d, active: l = 0, ...r }) => {
|
|
22
23
|
const [m, h] = H(l >= 0 && l < d.body.length ? l : null);
|
|
23
24
|
return /* @__PURE__ */ n(
|
|
24
25
|
"div",
|
|
25
26
|
{
|
|
26
27
|
"data-testid": _(r, "data-testid", "accordion-table"),
|
|
27
|
-
className: s(
|
|
28
|
+
className: s(a.AccordionTable, _(r, "className")),
|
|
28
29
|
style: { "--accordion-columns": Math.max(d.head.length, 1) },
|
|
29
30
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
+
/* @__PURE__ */ t("div", { "data-testid": "accordion-table-head", className: a.Head, children: /* @__PURE__ */ t("div", { className: a.HeadRow, children: d.head.map((e, o) => /* @__PURE__ */ t(
|
|
31
32
|
"div",
|
|
32
33
|
{
|
|
33
|
-
className:
|
|
34
|
+
className: a.HeadCell,
|
|
34
35
|
"data-testid": `accordion-table-head-cell-${o}`,
|
|
35
36
|
dangerouslySetInnerHTML: { __html: e }
|
|
36
37
|
},
|
|
37
38
|
e
|
|
38
39
|
)) }) }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ t("div", { children: d.body.map((e, o) => /* @__PURE__ */ n(p, { children: [
|
|
41
|
+
/* @__PURE__ */ t("div", { className: a.BodyRow, children: /* @__PURE__ */ t("div", { className: s(a.BodyCell, a.BodyHead, a.BodyHeadCell), children: /* @__PURE__ */ t(
|
|
41
42
|
w,
|
|
42
43
|
{
|
|
43
44
|
"data-testid": `accordion-table-button-${o}`,
|
|
@@ -48,25 +49,25 @@ import '../../assets/accordion-table-Ci3u6qTN.css';const b = "_AccordionTable_gm
|
|
|
48
49
|
weight: "regular",
|
|
49
50
|
color: "theme-primary",
|
|
50
51
|
iconPosition: "right",
|
|
51
|
-
icon: /* @__PURE__ */
|
|
52
|
+
icon: /* @__PURE__ */ t(
|
|
52
53
|
C,
|
|
53
54
|
{
|
|
54
55
|
name: "rotate-icon",
|
|
55
56
|
condition: m === o,
|
|
56
57
|
from: "top",
|
|
57
58
|
to: "bottom",
|
|
58
|
-
children: /* @__PURE__ */
|
|
59
|
+
children: /* @__PURE__ */ t(B, { size: 24 })
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
62
|
onClick: () => h((i) => o !== i ? o : null)
|
|
62
63
|
}
|
|
63
64
|
) }) }),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ t(g, { name: `visible-section-${o}`, condition: m === o, children: /* @__PURE__ */ t("div", { "data-testid": `accordion-table-section-content-${o}`, children: e.rows.map((i, c) => /* @__PURE__ */ t(
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
67
|
-
className:
|
|
68
|
+
className: a.DataRow,
|
|
68
69
|
"data-testid": `accordion-table-data-row-${o}-${c}`,
|
|
69
|
-
children: i.map((v, y) => /* @__PURE__ */
|
|
70
|
+
children: i.map((v, y) => /* @__PURE__ */ t("div", { className: a.BodyCell, children: v }, `tr-${o}-${c}-${y}`))
|
|
70
71
|
},
|
|
71
72
|
`tr-${o}-${c}`
|
|
72
73
|
)) }) })
|
|
@@ -76,5 +77,5 @@ import '../../assets/accordion-table-Ci3u6qTN.css';const b = "_AccordionTable_gm
|
|
|
76
77
|
);
|
|
77
78
|
};
|
|
78
79
|
export {
|
|
79
|
-
|
|
80
|
+
J as AccordionTable
|
|
80
81
|
};
|
|
@@ -2,6 +2,7 @@ import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import { Pencil as d } from "lucide-react";
|
|
3
3
|
import { clsx as p, baseProps as o } from "../../utils/functions/functions.util.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import "../text/text.component.js";
|
|
5
6
|
import "../../utils/content/content.component.js";
|
|
6
7
|
import "usehooks-ts";
|
|
7
8
|
import "../../controls/primitives/box/box.component.js";
|
|
@@ -10,7 +11,7 @@ import '../../assets/user-panel-SauszbHl.css';const _ = "_UserPanel_zes0v_1", P
|
|
|
10
11
|
UserPanel: _,
|
|
11
12
|
Head: P,
|
|
12
13
|
Info: u
|
|
13
|
-
},
|
|
14
|
+
}, g = ({ title: n, button: r, data: l, onClick: s, ...a }) => /* @__PURE__ */ i(
|
|
14
15
|
"div",
|
|
15
16
|
{
|
|
16
17
|
"data-testid": o(a, "data-testid", "user-panel"),
|
|
@@ -37,5 +38,5 @@ import '../../assets/user-panel-SauszbHl.css';const _ = "_UserPanel_zes0v_1", P
|
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
g as UserPanel
|
|
41
42
|
};
|
|
@@ -15,8 +15,9 @@ export interface ButtonProps extends Base {
|
|
|
15
15
|
loading?: boolean;
|
|
16
16
|
preventDefault?: boolean;
|
|
17
17
|
blurAfterClick?: boolean;
|
|
18
|
+
enterHint?: ReactNode;
|
|
18
19
|
onClick?: () => void;
|
|
19
20
|
onFocus?: () => void;
|
|
20
21
|
onBlur?: () => void;
|
|
21
22
|
}
|
|
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;
|
|
23
|
+
export declare const Button: ({ text, color, textSize, infoSize, type, disabled, info, fullWidth, fullWidthUntil, fullWidthFrom, loading, preventDefault, blurAfterClick, enterHint, onClick, onFocus, onBlur, ...base }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,94 +1,109 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { clsx as
|
|
4
|
-
import { FadeScale as
|
|
5
|
-
import { Loader as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
1
|
+
import { jsxs as f, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as L } from "react";
|
|
3
|
+
import { clsx as v, withControl as g, baseProps as x } from "../../../utils/functions/functions.util.js";
|
|
4
|
+
import { FadeScale as k } from "../../../animations/fade-scale/fade-scale.component.js";
|
|
5
|
+
import { Loader as C } from "../../../components/loader/loader.component.js";
|
|
6
|
+
import { Text as S } from "../../../components/text/text.component.js";
|
|
7
|
+
import { Content as D } from "../../../utils/content/content.component.js";
|
|
8
|
+
import '../../../assets/button-DBz6-Gkk.css';const H = "_Button_o1crw_1", P = "_WithHint_o1crw_14", G = "_EnterHint_o1crw_21", I = "_SM_o1crw_30", $ = "_LG_o1crw_35", j = "_Tertiary_o1crw_35", A = "_Text_o1crw_39", R = "_MD_o1crw_45", X = "_Primary_o1crw_73", q = "_Info_o1crw_82", J = "_Secondary_o1crw_86", K = "_Loading_o1crw_122", O = "_FullWidth_o1crw_130", Q = "_FullWidthUntil768_o1crw_134", V = "_FullWidthUntil1024_o1crw_135", Y = "_FullWidthUntil1200_o1crw_136", Z = "_FullWidthFrom768_o1crw_158", z = "_FullWidthFrom1024_o1crw_159", tt = "_FullWidthFrom1200_o1crw_160", ot = "_Content_o1crw_182", nt = "_Loader_o1crw_213", t = {
|
|
9
|
+
Button: H,
|
|
10
|
+
WithHint: P,
|
|
11
|
+
EnterHint: G,
|
|
12
|
+
SM: I,
|
|
13
|
+
LG: $,
|
|
14
|
+
Tertiary: j,
|
|
15
|
+
Text: A,
|
|
16
|
+
MD: R,
|
|
17
|
+
Primary: X,
|
|
18
|
+
Info: q,
|
|
19
|
+
Secondary: J,
|
|
20
|
+
Loading: K,
|
|
21
|
+
FullWidth: O,
|
|
22
|
+
FullWidthUntil768: Q,
|
|
23
|
+
FullWidthUntil1024: V,
|
|
24
|
+
FullWidthUntil1200: Y,
|
|
25
|
+
FullWidthFrom768: Z,
|
|
26
|
+
FullWidthFrom1024: z,
|
|
27
|
+
FullWidthFrom1200: tt,
|
|
28
|
+
Content: ot,
|
|
29
|
+
Loader: nt
|
|
30
|
+
}, ut = ({
|
|
31
|
+
text: E,
|
|
32
|
+
color: c = "primary",
|
|
33
|
+
textSize: u = "md",
|
|
34
|
+
infoSize: _ = "sm",
|
|
35
|
+
type: b = "button",
|
|
36
|
+
disabled: m = !1,
|
|
37
|
+
info: B = "",
|
|
38
|
+
fullWidth: l = !1,
|
|
36
39
|
fullWidthUntil: n,
|
|
37
|
-
fullWidthFrom:
|
|
38
|
-
loading:
|
|
39
|
-
preventDefault:
|
|
40
|
-
blurAfterClick:
|
|
41
|
-
|
|
40
|
+
fullWidthFrom: r,
|
|
41
|
+
loading: i = !1,
|
|
42
|
+
preventDefault: T = !1,
|
|
43
|
+
blurAfterClick: M = !1,
|
|
44
|
+
enterHint: a,
|
|
45
|
+
onClick: h = () => {
|
|
42
46
|
},
|
|
43
|
-
onFocus:
|
|
44
|
-
onBlur:
|
|
45
|
-
...
|
|
47
|
+
onFocus: U,
|
|
48
|
+
onBlur: N,
|
|
49
|
+
...W
|
|
46
50
|
}) => {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
if (
|
|
51
|
+
const o = n !== void 0 && r !== void 0, s = a != null && a !== !1 && a !== "", e = s ? !1 : l;
|
|
52
|
+
L(() => {
|
|
53
|
+
if (o) {
|
|
50
54
|
console.warn(
|
|
51
55
|
"[ui-kit] Button: `fullWidthUntil` and `fullWidthFrom` are mutually exclusive. Both are set — neither will be applied. Use only one."
|
|
52
56
|
);
|
|
53
57
|
return;
|
|
54
58
|
}
|
|
55
|
-
n !== void 0 && !
|
|
59
|
+
n !== void 0 && !l && console.warn(
|
|
56
60
|
"[ui-kit] Button: `fullWidthUntil` is set but `fullWidth` is not true. `fullWidthUntil` has no effect without `fullWidth`."
|
|
57
|
-
),
|
|
61
|
+
), r !== void 0 && !l && console.warn(
|
|
58
62
|
"[ui-kit] Button: `fullWidthFrom` is set but `fullWidth` is not true. `fullWidthFrom` has no effect without `fullWidth`."
|
|
63
|
+
), s && l && console.warn(
|
|
64
|
+
"[ui-kit] Button: `enterHint` forces `fullWidth` to `false` so the hint can sit beside the button. Pass `fullWidth={false}` (or omit it) to silence this warning."
|
|
59
65
|
);
|
|
60
|
-
}, [
|
|
66
|
+
}, [l, n, r, o, s]), L(() => {
|
|
67
|
+
if (!s) return;
|
|
68
|
+
const p = (F) => {
|
|
69
|
+
if (F.key !== "Enter" || m || i) return;
|
|
70
|
+
const w = F.target;
|
|
71
|
+
w && (w.tagName === "TEXTAREA" || w.isContentEditable) || (F.preventDefault(), h());
|
|
72
|
+
};
|
|
73
|
+
return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
|
|
74
|
+
}, [s, m, i, h]);
|
|
75
|
+
const y = /* @__PURE__ */ f(
|
|
61
76
|
"button",
|
|
62
77
|
{
|
|
63
|
-
"data-testid":
|
|
64
|
-
type:
|
|
65
|
-
disabled:
|
|
66
|
-
className:
|
|
67
|
-
[t.SM]:
|
|
68
|
-
[t.MD]:
|
|
69
|
-
[t.LG]:
|
|
70
|
-
[t.Primary]:
|
|
71
|
-
[t.Secondary]:
|
|
72
|
-
[t.Tertiary]:
|
|
73
|
-
[t.FullWidth]:
|
|
74
|
-
[t.FullWidthUntil768]:
|
|
75
|
-
[t.FullWidthUntil1024]:
|
|
76
|
-
[t.FullWidthUntil1200]:
|
|
77
|
-
[t.FullWidthFrom768]:
|
|
78
|
-
[t.FullWidthFrom1024]:
|
|
79
|
-
[t.FullWidthFrom1200]:
|
|
80
|
-
[t.Loading]:
|
|
78
|
+
"data-testid": x(W, "data-testid", "button"),
|
|
79
|
+
type: b,
|
|
80
|
+
disabled: m || i,
|
|
81
|
+
className: v(t.Button, x(W, "className"), {
|
|
82
|
+
[t.SM]: u === "sm",
|
|
83
|
+
[t.MD]: u === "md",
|
|
84
|
+
[t.LG]: u === "lg",
|
|
85
|
+
[t.Primary]: c === "primary",
|
|
86
|
+
[t.Secondary]: c === "secondary",
|
|
87
|
+
[t.Tertiary]: c === "tertiary",
|
|
88
|
+
[t.FullWidth]: e && n === void 0 && r === void 0,
|
|
89
|
+
[t.FullWidthUntil768]: e && !o && n === 768,
|
|
90
|
+
[t.FullWidthUntil1024]: e && !o && n === 1024,
|
|
91
|
+
[t.FullWidthUntil1200]: e && !o && n === 1200,
|
|
92
|
+
[t.FullWidthFrom768]: e && !o && r === 768,
|
|
93
|
+
[t.FullWidthFrom1024]: e && !o && r === 1024,
|
|
94
|
+
[t.FullWidthFrom1200]: e && !o && r === 1200,
|
|
95
|
+
[t.Loading]: i
|
|
81
96
|
}),
|
|
82
|
-
onClick:
|
|
83
|
-
onFocus: () =>
|
|
84
|
-
onBlur: () =>
|
|
97
|
+
onClick: g(h, { prevent: T, blur: M }),
|
|
98
|
+
onFocus: () => U?.(),
|
|
99
|
+
onBlur: () => N?.(),
|
|
85
100
|
children: [
|
|
86
|
-
|
|
87
|
-
|
|
101
|
+
i && /* @__PURE__ */ d(
|
|
102
|
+
C,
|
|
88
103
|
{
|
|
89
104
|
size: "xs",
|
|
90
105
|
color: (() => {
|
|
91
|
-
switch (
|
|
106
|
+
switch (c) {
|
|
92
107
|
case "primary":
|
|
93
108
|
return "white";
|
|
94
109
|
case "secondary":
|
|
@@ -100,24 +115,28 @@ import '../../../assets/button-BMjMeK04.css';const C = "_Button_14or2_1", T = "_
|
|
|
100
115
|
className: t.Loader
|
|
101
116
|
}
|
|
102
117
|
),
|
|
103
|
-
/* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
|
|
118
|
+
/* @__PURE__ */ f(k, { name: "content", keepMount: !0, condition: !i, className: t.Content, children: [
|
|
119
|
+
/* @__PURE__ */ d("span", { className: t.Text, children: E }),
|
|
120
|
+
/* @__PURE__ */ d(
|
|
121
|
+
D,
|
|
107
122
|
{
|
|
108
|
-
className:
|
|
109
|
-
[t.SM]:
|
|
110
|
-
[t.MD]:
|
|
111
|
-
[t.LG]:
|
|
123
|
+
className: v(t.Info, {
|
|
124
|
+
[t.SM]: _ === "sm",
|
|
125
|
+
[t.MD]: _ === "md",
|
|
126
|
+
[t.LG]: _ === "lg"
|
|
112
127
|
}),
|
|
113
|
-
children:
|
|
128
|
+
children: B
|
|
114
129
|
}
|
|
115
130
|
)
|
|
116
131
|
] })
|
|
117
132
|
]
|
|
118
133
|
}
|
|
119
134
|
);
|
|
135
|
+
return s ? /* @__PURE__ */ f("div", { className: t.WithHint, children: [
|
|
136
|
+
y,
|
|
137
|
+
/* @__PURE__ */ d(S, { tag: "span", size: "body-small", color: "text-secondary", className: t.EnterHint, children: a })
|
|
138
|
+
] }) : y;
|
|
120
139
|
};
|
|
121
140
|
export {
|
|
122
|
-
|
|
141
|
+
ut as Button
|
|
123
142
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Interactive } from '../../utils';
|
|
2
2
|
import { Base } from '../../../utils/types';
|
|
3
|
+
export type TextAreaPlaceholderPosition = 'inside' | 'outside';
|
|
3
4
|
export interface TextAreaProps extends Base, Interactive<string> {
|
|
4
5
|
placeholder?: string;
|
|
6
|
+
placeholderPosition?: TextAreaPlaceholderPosition;
|
|
5
7
|
rows?: number;
|
|
6
8
|
message?: string;
|
|
7
9
|
}
|
|
8
|
-
export declare const TextArea: ({ id, value, disabled, state, onChange, onFocus, onBlur, placeholder, rows, message, ...base }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const TextArea: ({ id, value, disabled, state, onChange, onFocus, onBlur, placeholder, placeholderPosition, rows, message, ...base }: TextAreaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,64 +1,70 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { baseProps as
|
|
3
|
-
import { FadeSlide as
|
|
4
|
-
import { Box as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { baseProps as s, clsx as B } from "../../../utils/functions/functions.util.js";
|
|
3
|
+
import { FadeSlide as C } from "../../../animations/fade-slide/fade-slide.component.js";
|
|
4
|
+
import { Box as G } from "../../primitives/box/box.component.js";
|
|
5
5
|
import "../../../utils/content/content.component.js";
|
|
6
6
|
import "lucide-react";
|
|
7
|
-
import { ErrorMessage as
|
|
7
|
+
import { ErrorMessage as y } from "../../primitives/error-message/error-message.component.js";
|
|
8
8
|
import "usehooks-ts";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { Text as b } from "../../../components/text/text.component.js";
|
|
10
|
+
import { useControlInteraction as j } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
|
|
11
|
+
import '../../../assets/text-area-aZwGK7CT.css';const O = "_Input_15g66_6", T = "_ErrorMessage_15g66_28", $ = "_FieldGroup_15g66_32", t = {
|
|
12
|
+
Input: O,
|
|
13
|
+
ErrorMessage: T,
|
|
14
|
+
FieldGroup: $
|
|
15
|
+
}, J = ({
|
|
14
16
|
// Interactive props
|
|
15
|
-
id:
|
|
16
|
-
value:
|
|
17
|
-
disabled:
|
|
17
|
+
id: a,
|
|
18
|
+
value: u,
|
|
19
|
+
disabled: i = !1,
|
|
18
20
|
state: n = "idle",
|
|
19
|
-
onChange:
|
|
20
|
-
onFocus:
|
|
21
|
-
onBlur:
|
|
21
|
+
onChange: g,
|
|
22
|
+
onFocus: x,
|
|
23
|
+
onBlur: f,
|
|
22
24
|
// TextArea props
|
|
23
|
-
placeholder:
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
placeholder: r = "",
|
|
26
|
+
placeholderPosition: h = "inside",
|
|
27
|
+
rows: _ = 5,
|
|
28
|
+
message: d = "",
|
|
26
29
|
// Base props
|
|
27
|
-
...
|
|
30
|
+
...o
|
|
28
31
|
}) => {
|
|
29
|
-
const { focused:
|
|
30
|
-
id:
|
|
31
|
-
disabled:
|
|
32
|
-
onChange:
|
|
33
|
-
onFocus:
|
|
34
|
-
onBlur:
|
|
35
|
-
})
|
|
36
|
-
|
|
32
|
+
const { focused: F, emitChange: N, handleFocus: E, handleBlur: I } = j({
|
|
33
|
+
id: a,
|
|
34
|
+
disabled: i,
|
|
35
|
+
onChange: g,
|
|
36
|
+
onFocus: x,
|
|
37
|
+
onBlur: f
|
|
38
|
+
}), m = s(o, "data-testid", "textarea"), c = h === "outside", M = c && !!r, l = /* @__PURE__ */ e(G, { state: n, focused: F, className: s(o, "className"), children: /* @__PURE__ */ e(
|
|
39
|
+
"textarea",
|
|
40
|
+
{
|
|
41
|
+
"data-testid": "textarea-input",
|
|
42
|
+
disabled: i,
|
|
43
|
+
id: a,
|
|
44
|
+
rows: _,
|
|
45
|
+
placeholder: c ? "" : r,
|
|
46
|
+
value: u,
|
|
47
|
+
className: t.Input,
|
|
48
|
+
onChange: (v) => N(v.target.value, "keyboard"),
|
|
49
|
+
onFocus: () => E(),
|
|
50
|
+
onBlur: () => I()
|
|
51
|
+
}
|
|
52
|
+
) });
|
|
53
|
+
return /* @__PURE__ */ p(
|
|
37
54
|
"div",
|
|
38
55
|
{
|
|
39
|
-
"data-testid":
|
|
40
|
-
className:
|
|
56
|
+
"data-testid": m,
|
|
57
|
+
className: B(t.Container, s(o, "className")),
|
|
41
58
|
children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
id: o,
|
|
48
|
-
rows: u,
|
|
49
|
-
placeholder: p,
|
|
50
|
-
value: c,
|
|
51
|
-
className: a.Input,
|
|
52
|
-
onChange: (E) => x(E.target.value, "keyboard"),
|
|
53
|
-
onFocus: () => f(),
|
|
54
|
-
onBlur: () => h()
|
|
55
|
-
}
|
|
56
|
-
) }),
|
|
57
|
-
/* @__PURE__ */ r(_, { name: "text-message", condition: n === "error" && !!m, children: /* @__PURE__ */ r(C, { "data-testid": "textarea-error-message", text: m, className: a.ErrorMessage }) })
|
|
59
|
+
M ? /* @__PURE__ */ p("div", { className: t.FieldGroup, children: [
|
|
60
|
+
/* @__PURE__ */ e(b, { tag: "div", weight: "medium", size: "body", color: "text-primary", "data-testid": `${m}-label`, children: r }),
|
|
61
|
+
l
|
|
62
|
+
] }) : l,
|
|
63
|
+
/* @__PURE__ */ e(C, { name: "text-message", condition: n === "error" && !!d, children: /* @__PURE__ */ e(y, { "data-testid": "textarea-error-message", text: d, className: t.ErrorMessage }) })
|
|
58
64
|
]
|
|
59
65
|
}
|
|
60
66
|
);
|
|
61
67
|
};
|
|
62
68
|
export {
|
|
63
|
-
|
|
69
|
+
J as TextArea
|
|
64
70
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
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}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._TextArea_11gck_1{display:flex;flex-direction:column}._Input_11gck_6{resize:none;outline:none;box-sizing:border-box;width:100%;border:none;border-radius:10px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm);font-weight:var(--rm-ui-font-weight-medium);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-primary)}._Input_11gck_6:hover{cursor:pointer}._Input_11gck_6:disabled{opacity:.33}._ErrorMessage_11gck_28{padding-top:var(--rm-ui-padding-xxs)}
|