@arthurzakharov/ui-kit 1.7.2 → 1.7.4

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.
@@ -1,13 +1,13 @@
1
1
  import { jsx as G } from "react/jsx-runtime";
2
2
  import h from "clsx";
3
3
  import { Content as L } from "../../utils/content/content.component.js";
4
- import '../../assets/text-Bhvd-u-V.css';const x = "_Lined_553v9_1", u = "_Left_553v9_7", S = "_Center_553v9_11", f = "_Right_553v9_15", T = "_Light_553v9_21", b = "_Regular_553v9_25", B = "_Medium_553v9_29", H = "_Bold_553v9_33", w = "_BodyExtraSmall_553v9_39", P = "_BodySmall_553v9_44", R = "_Body_553v9_39", z = "_BodyLarge_553v9_54", A = "_HL1_553v9_59", E = "_HL2_553v9_64", C = "_HL3_553v9_69", k = "_HL4_553v9_74", M = "_HL5_553v9_79", F = "_TextPrimary_553v9_86", $ = "_TextSecondary_553v9_90", N = "_AccentPrimary_553v9_94", j = "_AccentSecondary_553v9_98", W = "_ThemePrimary_553v9_102", q = "_ThemeSecondary_553v9_106", D = "_Success_553v9_114", I = "_Focus_553v9_118", J = "_Link_553v9_122", K = "_Grey950_553v9_126", O = "_Grey900_553v9_130", Q = "_Grey800_553v9_134", U = "_Grey700_553v9_138", V = "_Grey600_553v9_142", X = "_Grey500_553v9_146", Y = "_Grey400_553v9_150", Z = "_Grey300_553v9_154", ee = "_Grey200_553v9_158", re = "_Grey100_553v9_162", te = "_Grey50_553v9_146", e = {
4
+ import '../../assets/text-Bhvd-u-V.css';const x = "_Lined_553v9_1", S = "_Left_553v9_7", u = "_Center_553v9_11", b = "_Right_553v9_15", f = "_Light_553v9_21", T = "_Regular_553v9_25", B = "_Medium_553v9_29", H = "_Bold_553v9_33", w = "_BodyExtraSmall_553v9_39", P = "_BodySmall_553v9_44", R = "_Body_553v9_39", z = "_BodyLarge_553v9_54", A = "_HL1_553v9_59", E = "_HL2_553v9_64", C = "_HL3_553v9_69", k = "_HL4_553v9_74", M = "_HL5_553v9_79", F = "_TextPrimary_553v9_86", $ = "_TextSecondary_553v9_90", N = "_AccentPrimary_553v9_94", j = "_AccentSecondary_553v9_98", W = "_ThemePrimary_553v9_102", q = "_ThemeSecondary_553v9_106", D = "_Success_553v9_114", I = "_Focus_553v9_118", J = "_Link_553v9_122", K = "_Grey950_553v9_126", O = "_Grey900_553v9_130", Q = "_Grey800_553v9_134", U = "_Grey700_553v9_138", V = "_Grey600_553v9_142", X = "_Grey500_553v9_146", Y = "_Grey400_553v9_150", Z = "_Grey300_553v9_154", ee = "_Grey200_553v9_158", re = "_Grey100_553v9_162", te = "_Grey50_553v9_146", e = {
5
5
  Lined: x,
6
- Left: u,
7
- Center: S,
8
- Right: f,
9
- Light: T,
10
- Regular: b,
6
+ Left: S,
7
+ Center: u,
8
+ Right: b,
9
+ Light: f,
10
+ Regular: T,
11
11
  Medium: B,
12
12
  Bold: H,
13
13
  BodyExtraSmall: w,
@@ -44,7 +44,7 @@ import '../../assets/text-Bhvd-u-V.css';const x = "_Lined_553v9_1", u = "_Left_5
44
44
  "page-info": { tag: "p", weight: "light", size: "body", color: "text-secondary" },
45
45
  "page-subtitle": { tag: "h6", weight: "regular", size: "body", color: "text-primary" },
46
46
  "page-title": { tag: "h1", weight: "bold", size: "hl1", color: "text-primary" },
47
- "sidebar-title": { tag: "h3", weight: "medium", size: "hl3", color: "text-primary" },
47
+ "sidebar-title": { tag: "h3", weight: "bold", size: "hl3", color: "text-primary" },
48
48
  "step-title": { tag: "h2", weight: "bold", size: "hl4", color: "text-primary" }
49
49
  }, _e = ({
50
50
  children: m,
@@ -1,16 +1,16 @@
1
1
  import { jsx as M } from "react/jsx-runtime";
2
2
  import { useRef as d, useState as O, useLayoutEffect as Q, useCallback as R, useEffect as W } from "react";
3
3
  import K from "clsx";
4
- import { compareStrings as X, isDigit as Y, getFirstNotEnteredCharIndex as v, replaceCharByIndex as b, getNextChar as T, isSeparator as P, getPreviousChar as Z, applyMask as k } from "./input.utils.js";
4
+ import { compareStrings as X, isDigit as Y, getFirstNotEnteredCharIndex as P, replaceCharByIndex as b, getNextChar as T, isSeparator as w, getPreviousChar as Z, applyMask as k } from "./input.utils.js";
5
5
  import { useControlInteraction as tt } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
6
6
  import { baseProps as h } from "../../../utils/functions/functions.util.js";
7
- import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_Placeholder_gfvsr_45", w = {
7
+ import '../../../assets/input-DfrrUlEe.css';const et = "_Input_16els_1", nt = "_Placeholder_16els_46", y = {
8
8
  Input: et,
9
9
  Placeholder: nt
10
10
  }, it = ({
11
11
  // Interactive props
12
12
  id: u,
13
- value: y = "",
13
+ value: v = "",
14
14
  disabled: g = !1,
15
15
  onChange: $,
16
16
  onFocus: L,
@@ -29,7 +29,7 @@ import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_
29
29
  onChange: $,
30
30
  onFocus: L,
31
31
  onBlur: j
32
- }), o = d(null), D = d(!1), a = d(null), N = d(!0), [r, I] = O(y || n), i = (t) => {
32
+ }), o = d(null), D = d(!1), a = d(null), N = d(!0), [r, I] = O(v || n), i = (t) => {
33
33
  const c = Math.max(0, t);
34
34
  if (a.current = c, !o.current) return;
35
35
  const e = Math.min(c, o.current.value.length);
@@ -41,17 +41,17 @@ import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_
41
41
  o.current.setSelectionRange(t, t), a.current = null;
42
42
  }, [r, n]);
43
43
  const F = () => {
44
- const t = o.current?.value || "", c = v(t, n);
44
+ const t = o.current?.value || "", c = P(t, n);
45
45
  c !== t.length && i(c);
46
46
  }, G = R(() => {
47
47
  const t = o.current?.value || "", c = X(r, t);
48
48
  if (!Y(c)) return;
49
- const e = o.current?.selectionEnd || 0, m = v(t, n) === t.length, l = b(r, e - 1, c), f = v(l, n);
49
+ const e = o.current?.selectionEnd || 0, m = P(t, n) === t.length, l = b(r, e - 1, c), p = P(l, n);
50
50
  if (m) {
51
- const p = t.slice(0, e - 1), x = t.slice(e - 1, e), B = t.slice(e), J = b(p + B, e - 1, x), _ = T(p + B, e) || "";
52
- I(J), i(P(_, n) && _ ? e + 1 : e);
51
+ const f = t.slice(0, e - 1), x = t.slice(e - 1, e), B = t.slice(e), J = b(f + B, e - 1, x), _ = T(f + B, e) || "";
52
+ I(J), i(w(_, n) && _ ? e + 1 : e);
53
53
  } else
54
- I(l), i(f);
54
+ I(l), i(p);
55
55
  }, [r, n]), H = R(
56
56
  (t) => {
57
57
  if ([
@@ -73,8 +73,8 @@ import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_
73
73
  t.preventDefault();
74
74
  const e = o.current?.selectionEnd || 0;
75
75
  if (e) {
76
- const A = Z(r, e), m = T(r, e - 1), l = P(A, n), f = P(m, n), p = e - (l || f ? 2 : 1), x = k(r, n, e - (f ? 2 : 1));
77
- I(x), i(p);
76
+ const A = Z(r, e), m = T(r, e - 1), l = w(A, n), p = w(m, n), f = e - (l || p ? 2 : 1), x = k(r, n, e - (p ? 2 : 1));
77
+ I(x), i(f);
78
78
  }
79
79
  }
80
80
  },
@@ -103,7 +103,7 @@ import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_
103
103
  id: u,
104
104
  name: u,
105
105
  value: r,
106
- className: K(w.Input, h(s, "className"), { [w.Placeholder]: r === n }),
106
+ className: K(y.Input, h(s, "className"), { [y.Placeholder]: r === n }),
107
107
  onAnimationStart: (t) => V(t.animationName),
108
108
  onKeyDown: H,
109
109
  onChange: G,
@@ -129,8 +129,8 @@ import '../../../assets/input-D66hMzHc.css';const et = "_Input_gfvsr_1", nt = "_
129
129
  type: "text",
130
130
  id: u,
131
131
  name: u,
132
- value: y,
133
- className: K(w.Input, h(s, "className")),
132
+ value: v,
133
+ className: K(y.Input, h(s, "className")),
134
134
  onChange: (t) => C(t.target.value, "keyboard"),
135
135
  onAnimationStart: (t) => V(t.animationName),
136
136
  onFocus: S,
@@ -7,10 +7,10 @@ import { baseProps as t } from "../../../utils/functions/functions.util.js";
7
7
  import "lucide-react";
8
8
  import { ErrorMessage as C } from "../../primitives/error-message/error-message.component.js";
9
9
  import "usehooks-ts";
10
- import { useControlInteraction as k } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
11
- import '../../../assets/text-area-Dgc2jHSx.css';const B = "_Input_11gck_6", F = "_ErrorMessage_11gck_28", a = {
12
- Input: B,
13
- ErrorMessage: F
10
+ import { useControlInteraction as B } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
11
+ import '../../../assets/text-area-CvucKIow.css';const F = "_Input_1auuc_6", j = "_ErrorMessage_1auuc_29", a = {
12
+ Input: F,
13
+ ErrorMessage: j
14
14
  }, z = ({
15
15
  // Interactive props
16
16
  id: o,
@@ -27,7 +27,7 @@ import '../../../assets/text-area-Dgc2jHSx.css';const B = "_Input_11gck_6", F =
27
27
  // Base props
28
28
  ...e
29
29
  }) => {
30
- const { focused: g, emitChange: x, handleFocus: f, handleBlur: h } = k({
30
+ const { focused: x, emitChange: g, handleFocus: f, handleBlur: h } = B({
31
31
  id: o,
32
32
  disabled: s,
33
33
  onChange: c,
@@ -40,7 +40,7 @@ import '../../../assets/text-area-Dgc2jHSx.css';const B = "_Input_11gck_6", F =
40
40
  "data-testid": t(e, "data-testid", "textarea"),
41
41
  className: N(a.Container, t(e, "className")),
42
42
  children: [
43
- /* @__PURE__ */ r(I, { state: n, focused: g, className: t(e, "className"), children: /* @__PURE__ */ r(
43
+ /* @__PURE__ */ r(I, { state: n, focused: x, className: t(e, "className"), children: /* @__PURE__ */ r(
44
44
  "textarea",
45
45
  {
46
46
  "data-testid": "textarea-input",
@@ -50,7 +50,7 @@ import '../../../assets/text-area-Dgc2jHSx.css';const B = "_Input_11gck_6", F =
50
50
  placeholder: p,
51
51
  value: i,
52
52
  className: a.Input,
53
- onChange: (E) => x(E.target.value, "keyboard"),
53
+ onChange: (E) => g(E.target.value, "keyboard"),
54
54
  onFocus: () => f(),
55
55
  onBlur: () => h()
56
56
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "1.7.2",
4
+ "version": "1.7.4",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Backdrop_1y4te_1{--backdrop-padding: 115px;position:fixed;z-index:1000000;inset:0;background-color:#000000b3;display:flex;flex-direction:row;padding-top:var(--backdrop-padding)}._BackdropSizeFull_1y4te_15 ._Dialog_1y4te_15{flex-basis:100%}._BackdropSizeFull_1y4te_15 ._DialogContent_1y4te_19{overflow:initial;max-height:initial;padding-right:initial;margin-right:initial}._BackdropPositionCenter_1y4te_26,._BackdropPositionTopCenter_1y4te_27{align-items:flex-end;justify-content:center}._Dialog_1y4te_15{flex-basis:580px;position:relative;z-index:1;background-color:var(--rm-ui-content-bg);border-top-left-radius:var(--rm-ui-border-radius-xl);border-top-right-radius:var(--rm-ui-border-radius-xl);padding:var(--rm-ui-padding-lg) var(--rm-ui-padding-lg)}._DialogContent_1y4te_19{overflow:auto;max-height:calc(100vh - var(--backdrop-padding) - var(--rm-ui-padding-xl) * 2);padding-right:10px;margin-right:-10px}._DialogCloseButton_1y4te_49{position:absolute;z-index:100;top:12px;right:10px;display:flex;border-radius:4px;border:none;padding:2px;background-color:transparent}._DialogCloseButton_1y4te_49:hover{cursor:pointer}._DialogCloseButton_1y4te_49:focus-visible{outline:2px solid var(--rm-ui-color-focus)}._DialogCloseButtonIcon_1y4te_69{width:24px;height:24px;stroke:var(--rm-ui-color-text-secondary)}@media screen and (min-width:768px){._BackdropSizeOneThird_1y4te_76 ._Dialog_1y4te_15{flex-basis:33.33%}._BackdropSizeHalf_1y4te_80 ._Dialog_1y4te_15{flex-basis:50%}._BackdropSizeTwoThird_1y4te_84 ._Dialog_1y4te_15{flex-basis:66.66%}._BackdropSizeFull_1y4te_15 ._Dialog_1y4te_15{flex-basis:initial}._BackdropPositionCenter_1y4te_26{align-items:center}._BackdropPositionTopCenter_1y4te_27{align-items:flex-start;padding-top:115px;padding-bottom:115px}._DialogContent_1y4te_19{max-height:calc(100vh - var(--backdrop-padding) * 2 - var(--rm-ui-padding-xxl) * 2)}._DialogCloseButton_1y4te_49{top:26px;right:18px}._Dialog_1y4te_15{border-radius:var(--rm-ui-border-radius-lg);padding:var(--rm-ui-padding-xxl)}}
@@ -1 +0,0 @@
1
- ._Input_gfvsr_1{outline:none;box-sizing:border-box;border:none;display:inline-flex;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);background-color:transparent}._Input_gfvsr_1:hover{cursor:pointer}._Input_gfvsr_1:disabled{opacity:.33}._Input_gfvsr_1:disabled,._Input_gfvsr_1:-webkit-autofill,._Input_gfvsr_1:-webkit-autofill:hover,._Input_gfvsr_1:-webkit-autofill:focus,._Input_gfvsr_1:-webkit-autofill:active,._Input_gfvsr_1:autofill,._Input_gfvsr_1:autofill:hover,._Input_gfvsr_1:autofill:focus,._Input_gfvsr_1:autofill:active{-webkit-text-fill-color:var(--rm-ui-color-text-primary);background:transparent;transition:background 7200s ease-in-out 0s}._Input_gfvsr_1:-webkit-autofill{animation-name:_autofill-start_gfvsr_1;animation-duration:.1s}._Input_gfvsr_1:not(:-webkit-autofill){animation-name:_autofill-end_gfvsr_1;animation-duration:.1s}._Placeholder_gfvsr_45{color:var(--rm-ui-color-text-secondary);font-weight:var(--rm-ui-font-weight-light)}@keyframes _autofill-start_gfvsr_1{}@keyframes _autofill-end_gfvsr_1{}
@@ -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)}