@arthurzakharov/ui-kit 1.7.6 → 1.7.8

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
+ ._FormRow_v16lb_1{display:flex;flex-direction:column;align-items:stretch}._XXS_v16lb_7{gap:var(--rm-ui-padding-xxs)}._XS_v16lb_11{gap:var(--rm-ui-padding-xs)}._SM_v16lb_15{gap:var(--rm-ui-padding-sm)}._MD_v16lb_19{gap:var(--rm-ui-padding-md)}._LG_v16lb_23,._XL_v16lb_27{gap:var(--rm-ui-padding-xl)}._XXL_v16lb_31{gap:var(--rm-ui-padding-xxl)}._XXXL_v16lb_35{gap:var(--rm-ui-padding-xxxl)}._Child_v16lb_39{flex-grow:1}@media screen and (min-width:768px){._FormRow_v16lb_1{flex-direction:row}._Child_v16lb_39[data-children-quantity="1"]{width:100%}._Child_v16lb_39[data-children-quantity="2"]{width:50%}._Child_v16lb_39[data-children-quantity="3"]{width:calc(100% / 3)}._Child_v16lb_39[data-children-quantity="4"]{width:25%}}
@@ -0,0 +1 @@
1
+ ._InfoPanel_1xmmg_1{position:relative;padding:var(--rm-ui-padding-md) 0;background-color:var(--rm-ui-info-panel-bg);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)}._InfoPanel_1xmmg_1:before,._InfoPanel_1xmmg_1:after{content:"";display:block;position:absolute;top:0;z-index:1;height:100%;width:100vw;background-color:inherit}._InfoPanel_1xmmg_1:before{left:0}._InfoPanel_1xmmg_1:after{right:0}._List_1xmmg_30{position:relative;z-index:2;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xs)}._Item_1xmmg_40{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Key_1xmmg_48{color:var(--rm-ui-color-text-secondary)}._Value_1xmmg_52{color:var(--rm-ui-color-text-primary)}@media screen and (min-width:480px){._Item_1xmmg_40{gap:var(--rm-ui-padding-xxs)}}
@@ -0,0 +1 @@
1
+ ._TextField_1jd9o_1{position:relative;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Content_1jd9o_11{box-sizing:border-box;position:relative;flex-grow:1;height:58px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm) calc(var(--rm-ui-padding-xs) - 2px) var(--rm-ui-padding-sm);display:flex;flex-direction:row;justify-content:stretch;align-items:flex-end}._Content_1jd9o_11:hover{cursor:pointer}._Label_1jd9o_27{position:absolute;left:var(--rm-ui-padding-sm);transition:top var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Label_1jd9o_27:hover{cursor:pointer}._Idle_1jd9o_37{top:50%;transform:translateY(-50%)}._Active_1jd9o_42{top:var(--rm-ui-padding-xs);transform:translateY(0)}._Placeholder_1jd9o_47{position:absolute;z-index:1;bottom:var(--rm-ui-padding-xs);left:var(--rm-ui-padding-sm)}._PlaceholderText_1jd9o_54{opacity:.75;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}._ErrorMessage_1jd9o_62{padding-left:var(--rm-ui-padding-sm)}._Input_1jd9o_66{flex-grow:1}._MaskStart_1jd9o_70{opacity:0}
@@ -1,35 +1,35 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { Children as t, isValidElement as x } from "react";
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { Children as _, isValidElement as m } from "react";
3
3
  import c from "clsx";
4
- import { baseProps as m } from "../../utils/functions/functions.util.js";
5
- import '../../assets/form-row-Dx21oHae.css';const l = "_FormRow_ax4us_1", u = "_XXS_ax4us_7", a = "_XS_ax4us_11", i = "_SM_ax4us_15", L = "_MD_ax4us_19", d = "_LG_ax4us_23", e = "_XL_ax4us_27", S = "_XXL_ax4us_31", M = "_XXXL_ax4us_35", f = "_Child_ax4us_39", s = {
6
- FormRow: l,
7
- XXS: u,
8
- XS: a,
9
- SM: i,
10
- MD: L,
11
- LG: d,
12
- XL: e,
13
- XXL: S,
14
- XXXL: M,
15
- Child: f
16
- }, R = ({ children: X, gap: o = "sm", ..._ }) => t.count(X) === 0 ? null : /* @__PURE__ */ n(
4
+ import { baseProps as n } from "../../utils/functions/functions.util.js";
5
+ import '../../assets/form-row-C_CTS-Xj.css';const i = "_FormRow_v16lb_1", L = "_XXS_v16lb_7", d = "_XS_v16lb_11", e = "_SM_v16lb_15", v = "_MD_v16lb_19", x = "_LG_v16lb_23", S = "_XL_v16lb_27", b = "_XXL_v16lb_31", u = "_XXXL_v16lb_35", a = "_Child_v16lb_39", o = {
6
+ FormRow: i,
7
+ XXS: L,
8
+ XS: d,
9
+ SM: e,
10
+ MD: v,
11
+ LG: x,
12
+ XL: S,
13
+ XXL: b,
14
+ XXXL: u,
15
+ Child: a
16
+ }, C = ({ children: t, gap: X = "sm", ...l }) => _.count(t) === 0 ? null : /* @__PURE__ */ r(
17
17
  "div",
18
18
  {
19
- "data-testid": m(_, "data-testid", "form-row"),
20
- className: c(s.FormRow, m(_, "className"), {
21
- [s.XXS]: o === "xxs",
22
- [s.XS]: o === "xs",
23
- [s.SM]: o === "sm",
24
- [s.MD]: o === "md",
25
- [s.LG]: o === "lg",
26
- [s.XL]: o === "xl",
27
- [s.XXL]: o === "xxl",
28
- [s.XXXL]: o === "xxxl"
19
+ "data-testid": n(l, "data-testid", "form-row"),
20
+ className: c(o.FormRow, n(l, "className"), {
21
+ [o.XXS]: X === "xxs",
22
+ [o.XS]: X === "xs",
23
+ [o.SM]: X === "sm",
24
+ [o.MD]: X === "md",
25
+ [o.LG]: X === "lg",
26
+ [o.XL]: X === "xl",
27
+ [o.XXL]: X === "xxl",
28
+ [o.XXXL]: X === "xxxl"
29
29
  }),
30
- children: t.map(X, (r) => x(r) ? /* @__PURE__ */ n("div", { "data-children-quantity": t.count(X), className: s.Child, children: r }) : null)
30
+ children: _.map(t, (s) => m(s) ? /* @__PURE__ */ r("div", { "data-children-quantity": _.count(t), className: o.Child, children: s }) : null)
31
31
  }
32
32
  );
33
33
  export {
34
- R as FormRow
34
+ C as FormRow
35
35
  };
@@ -1,23 +1,23 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import c from "clsx";
1
+ import { jsx as e, jsxs as i } from "react/jsx-runtime";
2
+ import o from "clsx";
3
3
  import { baseProps as n } from "../../utils/functions/functions.util.js";
4
- import '../../assets/info-panel-BJPuE65n.css';const r = "_InfoPanel_1u1r0_1", m = "_List_1u1r0_30", d = "_Item_1u1r0_40", _ = "_Key_1u1r0_48", f = "_Value_1u1r0_52", a = {
5
- InfoPanel: r,
6
- List: m,
7
- Item: d,
8
- Key: _,
4
+ import '../../assets/info-panel-DT7lLHJR.css';const c = "_InfoPanel_1xmmg_1", d = "_List_1xmmg_30", _ = "_Item_1xmmg_40", r = "_Key_1xmmg_48", f = "_Value_1xmmg_52", a = {
5
+ InfoPanel: c,
6
+ List: d,
7
+ Item: _,
8
+ Key: r,
9
9
  Value: f
10
- }, N = ({ data: l, ...s }) => /* @__PURE__ */ e(
10
+ }, u = ({ data: l, ...s }) => /* @__PURE__ */ e(
11
11
  "div",
12
12
  {
13
13
  "data-testid": n(s, "data-testid", "info-panel"),
14
- className: c(a.InfoPanel, n(s, "className")),
15
- children: /* @__PURE__ */ e("ul", { "data-testid": "info-panel-list", className: a.List, children: l.map(([t, i]) => /* @__PURE__ */ o("li", { className: a.Item, children: [
14
+ className: o(a.InfoPanel, n(s, "className")),
15
+ children: /* @__PURE__ */ e("ul", { "data-testid": "info-panel-list", className: a.List, children: l.map(([t, m]) => /* @__PURE__ */ i("li", { className: a.Item, children: [
16
16
  /* @__PURE__ */ e("span", { "data-testid": "info-panel-key", className: a.Key, children: t }),
17
- /* @__PURE__ */ e("span", { "data-testid": "info-panel-value", className: a.Value, children: i })
17
+ /* @__PURE__ */ e("span", { "data-testid": "info-panel-value", className: a.Value, children: m })
18
18
  ] }, t)) })
19
19
  }
20
20
  );
21
21
  export {
22
- N as InfoPanel
22
+ u as InfoPanel
23
23
  };
@@ -1,102 +1,106 @@
1
- import { jsxs as p, jsx as t } from "react/jsx-runtime";
2
- import n from "clsx";
3
- import { useBoolean as f } from "usehooks-ts";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import d from "clsx";
3
+ import { useBoolean as x } from "usehooks-ts";
4
4
  import { FadeScale as k } from "../../../animations/fade-scale/fade-scale.component.js";
5
5
  import { FadeSlide as B } from "../../../animations/fade-slide/fade-slide.component.js";
6
6
  import { Box as C } from "../../primitives/box/box.component.js";
7
7
  import "react";
8
- import { baseProps as x } from "../../../utils/functions/functions.util.js";
8
+ import { baseProps as h } from "../../../utils/functions/functions.util.js";
9
9
  import "lucide-react";
10
10
  import { ErrorMessage as $ } from "../../primitives/error-message/error-message.component.js";
11
11
  import { Label as w } from "../../primitives/label/label.component.js";
12
- import { Input as j } from "../input/input.component.js";
13
- import '../../../assets/text-field-5nNgGQnX.css';const D = "_TextField_l5ui0_1", O = "_Content_l5ui0_10", q = "_Label_l5ui0_26", y = "_Idle_l5ui0_32", z = "_Active_l5ui0_37", G = "_Placeholder_l5ui0_42", H = "_PlaceholderText_l5ui0_49", J = "_ErrorMessage_l5ui0_57", K = "_Input_l5ui0_61", Q = "_MaskStart_l5ui0_65", e = {
14
- TextField: D,
15
- Content: O,
12
+ import { Input as D } from "../input/input.component.js";
13
+ import '../../../assets/text-field-CMQWxQpy.css';const O = "_TextField_1jd9o_1", y = "_Content_1jd9o_11", q = "_Label_1jd9o_27", z = "_Idle_1jd9o_37", G = "_Active_1jd9o_42", H = "_Placeholder_1jd9o_47", J = "_PlaceholderText_1jd9o_54", K = "_ErrorMessage_1jd9o_62", Q = "_Input_1jd9o_66", R = "_MaskStart_1jd9o_70", e = {
14
+ TextField: O,
15
+ Content: y,
16
16
  Label: q,
17
- Idle: y,
18
- Active: z,
19
- Placeholder: G,
20
- PlaceholderText: H,
21
- ErrorMessage: J,
22
- Input: K,
23
- MaskStart: Q
24
- }, se = ({
17
+ Idle: z,
18
+ Active: G,
19
+ Placeholder: H,
20
+ PlaceholderText: J,
21
+ ErrorMessage: K,
22
+ Input: Q,
23
+ MaskStart: R
24
+ }, le = ({
25
25
  // Interactive props
26
- id: c,
27
- value: l = "",
28
- disabled: h = !1,
29
- state: a = "idle",
30
- onChange: I,
26
+ id: l,
27
+ value: s = "",
28
+ disabled: I = !1,
29
+ state: n = "idle",
30
+ onChange: j,
31
31
  onFocus: F,
32
32
  onBlur: M,
33
33
  // Text props
34
- mask: i,
34
+ mask: c,
35
35
  maxLength: P = -1,
36
36
  label: T = "",
37
- message: d = "",
38
- placeholder: m = "",
37
+ message: m = "",
38
+ placeholder: _ = "",
39
39
  // Base props
40
- ...u
40
+ ...p
41
41
  }) => {
42
- const { value: _, setTrue: A, setFalse: S } = f(!1), { value: r, setTrue: b, setFalse: g } = f(!1), s = r || !!l || _, E = !i && !!m && r && !l && !_, N = !!d && a === "error", v = (o) => {
43
- b(), F?.(o);
42
+ const { value: u, setTrue: g, setFalse: A } = x(!1), { value: r, setTrue: S, setFalse: b } = x(!1), a = r || !!s || u, E = !c && !!_ && r && !s && !u, N = !!m && n === "error", v = (o) => {
43
+ S(), F?.(o);
44
44
  }, L = (o) => {
45
- g(), M?.(o);
45
+ b(), M?.(o);
46
46
  };
47
- return /* @__PURE__ */ p(
47
+ return /* @__PURE__ */ i(
48
48
  "div",
49
49
  {
50
- "data-testid": x(u, "data-testid", "text-field"),
51
- className: n(e.TextField, x(u, "className")),
50
+ "data-testid": h(p, "data-testid", "text-field"),
51
+ className: d(e.TextField, h(p, "className")),
52
52
  children: [
53
- /* @__PURE__ */ t(C, { state: a, focused: r, children: /* @__PURE__ */ p(
54
- "label",
55
- {
56
- htmlFor: c,
57
- className: e.Content,
58
- onPointerDown: (o) => {
59
- r && o.preventDefault();
60
- },
61
- children: [
62
- /* @__PURE__ */ t(
63
- w,
64
- {
65
- "data-testid": "text-label",
66
- text: T,
67
- position: s ? "active" : "idle",
68
- state: s ? a : "idle",
69
- className: n(e.Label, s ? e.Active : e.Idle)
70
- }
71
- ),
72
- /* @__PURE__ */ t(k, { name: "text-placeholder", condition: E, className: e.Placeholder, children: /* @__PURE__ */ t("span", { "data-testid": "text-placeholder", className: e.PlaceholderText, children: m }) }),
73
- /* @__PURE__ */ t(
74
- j,
75
- {
76
- "data-testid": "text-input",
77
- mask: i,
78
- maxLength: P,
79
- disabled: h,
80
- id: c,
81
- value: l,
82
- className: n(e.Input, {
83
- [e.MaskStart]: i && l === "" && !s
84
- }),
85
- onAnimationStart: A,
86
- onAnimationEnd: S,
87
- onChange: I,
88
- onFocus: v,
89
- onBlur: L
90
- }
91
- )
92
- ]
93
- }
94
- ) }),
95
- /* @__PURE__ */ t(B, { name: "text-message", direction: "ltr", condition: N, children: /* @__PURE__ */ t($, { "data-testid": "text-error-message", text: d, className: e.ErrorMessage }) })
53
+ /* @__PURE__ */ i(C, { state: n, focused: r, children: [
54
+ /* @__PURE__ */ t(
55
+ w,
56
+ {
57
+ "data-testid": "text-label",
58
+ text: T,
59
+ position: a ? "active" : "idle",
60
+ state: a ? n : "idle",
61
+ className: d(e.Label, a ? e.Active : e.Idle)
62
+ }
63
+ ),
64
+ /* @__PURE__ */ i(
65
+ "label",
66
+ {
67
+ htmlFor: l,
68
+ className: e.Content,
69
+ onPointerDown: (o) => {
70
+ r && o.preventDefault();
71
+ const f = document.getElementById(l);
72
+ console.log("input", f), f?.click();
73
+ },
74
+ children: [
75
+ /* @__PURE__ */ t(k, { name: "text-placeholder", condition: E, className: e.Placeholder, children: /* @__PURE__ */ t("span", { "data-testid": "text-placeholder", className: e.PlaceholderText, children: _ }) }),
76
+ /* @__PURE__ */ t(
77
+ D,
78
+ {
79
+ "data-testid": "text-input",
80
+ mask: c,
81
+ maxLength: P,
82
+ disabled: I,
83
+ id: l,
84
+ value: s,
85
+ className: d(e.Input, {
86
+ [e.MaskStart]: c && s === "" && !a
87
+ }),
88
+ onAnimationStart: g,
89
+ onAnimationEnd: A,
90
+ onChange: j,
91
+ onFocus: v,
92
+ onBlur: L
93
+ }
94
+ )
95
+ ]
96
+ }
97
+ )
98
+ ] }),
99
+ /* @__PURE__ */ t(B, { name: "text-message", direction: "ltr", condition: N, children: /* @__PURE__ */ t($, { "data-testid": "text-error-message", text: m, className: e.ErrorMessage }) })
96
100
  ]
97
101
  }
98
102
  );
99
103
  };
100
104
  export {
101
- se as TextField
105
+ le as TextField
102
106
  };
@@ -1,33 +1,36 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import _ from "clsx";
3
- import { Content as a } from "../../../utils/content/content.component.js";
4
- import { baseProps as t } from "../../../utils/functions/functions.util.js";
5
- import '../../../assets/label-BKXQlPJi.css';const i = "_Label_85kr5_1", d = "_Idle_85kr5_7", m = "_Active_85kr5_12", n = "_Success_85kr5_21", e = {
6
- Label: i,
7
- Idle: d,
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import i from "clsx";
3
+ import { Content as _ } from "../../../utils/content/content.component.js";
4
+ import { baseProps as o } from "../../../utils/functions/functions.util.js";
5
+ import '../../../assets/label-BKXQlPJi.css';const d = "_Label_85kr5_1", n = "_Idle_85kr5_7", m = "_Active_85kr5_12", p = "_Success_85kr5_21", e = {
6
+ Label: d,
7
+ Idle: n,
8
8
  Active: m,
9
9
  Error: "_Error_85kr5_17",
10
- Success: n
11
- }, v = ({
10
+ Success: p
11
+ }, L = ({
12
12
  // Label props
13
- text: o,
13
+ text: t,
14
14
  state: r = "idle",
15
15
  position: c = "idle",
16
16
  // Base props
17
17
  ...s
18
- }) => /* @__PURE__ */ l(
19
- a,
18
+ }) => /* @__PURE__ */ a(
19
+ _,
20
20
  {
21
- "data-testid": t(s, "data-testid", "label"),
22
- className: _(e.Label, t(s, "className"), {
21
+ "data-testid": o(s, "data-testid", "label"),
22
+ className: i(e.Label, o(s, "className"), {
23
23
  [e.Idle]: c === "idle",
24
24
  [e.Active]: c === "active",
25
25
  [e.Error]: r === "error",
26
26
  [e.Success]: r === "success"
27
27
  }),
28
- children: o
28
+ onClick: (l) => {
29
+ l.stopPropagation();
30
+ },
31
+ children: t
29
32
  }
30
33
  );
31
34
  export {
32
- v as Label
35
+ L as Label
33
36
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "1.7.6",
4
+ "version": "1.7.8",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._FormRow_ax4us_1{display:flex;flex-direction:column;align-items:stretch}._XXS_ax4us_7{gap:var(--rm-ui-padding-xxs)}._XS_ax4us_11{gap:var(--rm-ui-padding-xs)}._SM_ax4us_15{gap:var(--rm-ui-padding-sm)}._MD_ax4us_19{gap:var(--rm-ui-padding-md)}._LG_ax4us_23,._XL_ax4us_27{gap:var(--rm-ui-padding-xl)}._XXL_ax4us_31{gap:var(--rm-ui-padding-xxl)}._XXXL_ax4us_35{gap:var(--rm-ui-padding-xxxl)}._Child_ax4us_39{flex-grow:1}._Child_ax4us_39[data-children-quantity="1"]{width:100%}._Child_ax4us_39[data-children-quantity="2"]{width:50%}._Child_ax4us_39[data-children-quantity="3"]{width:calc(100% / 3)}._Child_ax4us_39[data-children-quantity="4"]{width:25%}@media screen and (min-width:768px){._FormRow_ax4us_1{flex-direction:row}}
@@ -1 +0,0 @@
1
- ._InfoPanel_1u1r0_1{position:relative;padding:var(--rm-ui-padding-md) 0;background-color:var(--rm-ui-info-panel-bg);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)}._InfoPanel_1u1r0_1:before,._InfoPanel_1u1r0_1:after{content:"";display:block;position:absolute;top:0;z-index:1;height:100%;width:100vw;background-color:inherit}._InfoPanel_1u1r0_1:before{left:0}._InfoPanel_1u1r0_1:after{right:0}._List_1u1r0_30{position:relative;z-index:2;display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xs)}._Item_1u1r0_40{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:var(--rm-ui-padding-xxs)}._Key_1u1r0_48{color:var(--rm-ui-color-text-secondary)}._Value_1u1r0_52{color:var(--rm-ui-color-text-primary)}@media screen and (min-width:480px){._Item_1u1r0_40{justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}}
@@ -1 +0,0 @@
1
- ._TextField_l5ui0_1{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:var(--rm-ui-padding-xxs)}._Content_l5ui0_10{box-sizing:border-box;position:relative;flex-grow:1;height:58px;padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm) calc(var(--rm-ui-padding-xs) - 2px) var(--rm-ui-padding-sm);display:flex;flex-direction:row;justify-content:stretch;align-items:flex-end}._Content_l5ui0_10:hover{cursor:pointer}._Label_l5ui0_26{position:absolute;left:var(--rm-ui-padding-sm);transition:top var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Idle_l5ui0_32{top:50%;transform:translateY(-50%)}._Active_l5ui0_37{top:var(--rm-ui-padding-xs);transform:translateY(0)}._Placeholder_l5ui0_42{position:absolute;z-index:1;bottom:var(--rm-ui-padding-xs);left:var(--rm-ui-padding-sm)}._PlaceholderText_l5ui0_49{opacity:.75;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body);color:var(--rm-ui-color-text-secondary)}._ErrorMessage_l5ui0_57{padding-left:var(--rm-ui-padding-sm)}._Input_l5ui0_61{flex-grow:1}._MaskStart_l5ui0_65{opacity:0}