@arthurzakharov/ui-kit 2.0.1 → 2.0.2

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
+ ._Button_1jlaj_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_1jlaj_1:disabled{cursor:not-allowed;opacity:.33}._SM_1jlaj_19{border-radius:var(--rm-ui-border-radius-sm);padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm)}._LG_1jlaj_24._Tertiary_1jlaj_24{padding:calc(var(--rm-ui-padding-xs) - 1px) calc(var(--rm-ui-padding-sm) - 1px)}._SM_1jlaj_19 ._Text_1jlaj_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)}._MD_1jlaj_34{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._MD_1jlaj_34._Tertiary_1jlaj_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._LG_1jlaj_24{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._LG_1jlaj_24._Tertiary_1jlaj_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._MD_1jlaj_34 ._Text_1jlaj_28{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._LG_1jlaj_24 ._Text_1jlaj_28{font-size:var(--rm-ui-font-size-body-large);line-height:var(--rm-ui-line-height-body-large)}._Primary_1jlaj_62{background-color:var(--rm-ui-next-btn-bg)}._Primary_1jlaj_62:hover{background-color:var(--rm-ui-next-btn-bg-hover)}._Primary_1jlaj_62 ._Text_1jlaj_28,._Primary_1jlaj_62 ._Info_1jlaj_71{color:#fff}._Secondary_1jlaj_75{border:1px solid transparent;background-color:transparent}._Secondary_1jlaj_75:hover{border-color:var(--rm-ui-grey-400)}._Secondary_1jlaj_75:hover ._Text_1jlaj_28{color:var(--rm-ui-grey-400);border-color:var(--rm-ui-grey-400)}._Secondary_1jlaj_75 ._Text_1jlaj_28,._Secondary_1jlaj_75 ._Info_1jlaj_71{color:var(--rm-ui-color-text-secondary)}._Tertiary_1jlaj_24{border:1px solid var(--rm-ui-grey-300);background-color:transparent}._Tertiary_1jlaj_24:hover{border-color:var(--rm-ui-grey-200)}._Tertiary_1jlaj_24:hover ._Text_1jlaj_28{color:var(--rm-ui-grey-700)}._Tertiary_1jlaj_24 ._Text_1jlaj_28,._Tertiary_1jlaj_24 ._Info_1jlaj_71{color:var(--rm-ui-color-text-primary)}._Button_1jlaj_1:not(._Loading_1jlaj_111):not(:disabled):hover{cursor:pointer}._Button_1jlaj_1:focus{outline-color:var(--rm-ui-color-focus)}._FullWidth_1jlaj_119{width:100%}._Content_1jlaj_123{display:flex;flex-direction:column}._Info_1jlaj_71{flex-basis:100%;font-weight:var(--rm-ui-font-weight-regular)}._Info_1jlaj_71._SM_1jlaj_19{font-size:var(--rm-ui-font-size-body-small);line-height:calc(var(--rm-ui-line-height-body-small) - 2px)}._Info_1jlaj_71._MD_1jlaj_34{font-size:var(--rm-ui-font-size-body);line-height:calc(var(--rm-ui-line-height-body) - 2px)}._Info_1jlaj_71._LG_1jlaj_24{font-size:var(--rm-ui-font-size-body-large);line-height:calc(var(--rm-ui-line-height-body-large) - 2px)}._Text_1jlaj_28{font-weight:var(--rm-ui-font-weight-medium);transition:color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Loader_1jlaj_153{position:absolute}
@@ -90,7 +90,7 @@ import '../../assets/bottom-bar-DE6QuEjZ.css';const k = "_BottomBar_1pxm3_1", w
90
90
  fullWidth: !0,
91
91
  text: o.text,
92
92
  color: "primary",
93
- size: "lg",
93
+ textSize: "lg",
94
94
  loading: o.loading,
95
95
  disabled: o.disabled,
96
96
  className: r.Button,
@@ -1,8 +1,8 @@
1
- import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
- import { useRef as g, useState as v } from "react";
3
- import { useWindowSize as h, useResizeObserver as x } from "usehooks-ts";
1
+ import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
+ import { useRef as g, useState as x } from "react";
3
+ import { useWindowSize as v, useResizeObserver as h } from "usehooks-ts";
4
4
  import b from "clsx";
5
- import { Button as l } from "../../controls/buttons/button/button.component.js";
5
+ import { Button as s } from "../../controls/buttons/button/button.component.js";
6
6
  import "../../controls/primitives/box/box.component.js";
7
7
  import "../../utils/content/content.component.js";
8
8
  import { baseProps as c } from "../../utils/functions/functions.util.js";
@@ -10,12 +10,12 @@ import "lucide-react";
10
10
  import '../../assets/dialog-article-BdDXX1FV.css';const A = "_DialogArticle_vv4cw_1", B = "_Buttons_vv4cw_8", n = {
11
11
  DialogArticle: A,
12
12
  Buttons: B
13
- }, j = (d) => {
14
- const { children: m, cancel: t, confirm: e, ...i } = d, o = g(null), [u, f] = v(0), { width: p } = h();
15
- return x({
13
+ }, N = (d) => {
14
+ const { children: m, cancel: t, confirm: e, ...i } = d, o = g(null), [u, f] = x(0), { width: p } = v();
15
+ return h({
16
16
  ref: o,
17
17
  onResize: (r) => f(p < 768 && r.height ? r.height : 0)
18
- }), /* @__PURE__ */ s(
18
+ }), /* @__PURE__ */ a(
19
19
  "div",
20
20
  {
21
21
  "data-testid": c(i, "data-testid", "dialog-article"),
@@ -23,28 +23,28 @@ import '../../assets/dialog-article-BdDXX1FV.css';const A = "_DialogArticle_vv4c
23
23
  style: { paddingBottom: u },
24
24
  children: [
25
25
  m,
26
- (t || e) && /* @__PURE__ */ s("div", { "data-testid": "dialog-article-buttons", ref: o, className: n.Buttons, children: [
27
- t && /* @__PURE__ */ a(
28
- l,
26
+ (t || e) && /* @__PURE__ */ a("div", { "data-testid": "dialog-article-buttons", ref: o, className: n.Buttons, children: [
27
+ t && /* @__PURE__ */ l(
28
+ s,
29
29
  {
30
30
  "data-testid": "dialog-article-cancel",
31
31
  blurAfterClick: !0,
32
32
  preventDefault: !0,
33
33
  text: t.text,
34
34
  color: "tertiary",
35
- size: "md",
35
+ textSize: "md",
36
36
  onClick: t.fn
37
37
  }
38
38
  ),
39
- e && /* @__PURE__ */ a(
40
- l,
39
+ e && /* @__PURE__ */ l(
40
+ s,
41
41
  {
42
42
  "data-testid": "dialog-article-confirm",
43
43
  blurAfterClick: !0,
44
44
  preventDefault: !0,
45
45
  text: e.text,
46
46
  color: "primary",
47
- size: "md",
47
+ textSize: "md",
48
48
  onClick: e.fn
49
49
  }
50
50
  )
@@ -54,5 +54,5 @@ import '../../assets/dialog-article-BdDXX1FV.css';const A = "_DialogArticle_vv4c
54
54
  );
55
55
  };
56
56
  export {
57
- j as DialogArticle
57
+ N as DialogArticle
58
58
  };
@@ -4,7 +4,8 @@ import { Base } from '../../../utils/types';
4
4
  export interface ButtonProps extends Base {
5
5
  text: string;
6
6
  color?: ControlButtonColor;
7
- size?: ControlButtonSize;
7
+ textSize?: ControlButtonSize;
8
+ infoSize?: ControlButtonSize;
8
9
  type?: ControlButtonType;
9
10
  disabled?: boolean;
10
11
  info?: ReactNode;
@@ -16,4 +17,4 @@ export interface ButtonProps extends Base {
16
17
  onFocus?: () => void;
17
18
  onBlur?: () => void;
18
19
  }
19
- export declare const Button: ({ text, color, size, type, disabled, info, fullWidth, loading, preventDefault, blurAfterClick, onClick, onFocus, onBlur, ...base }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
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;
@@ -1,65 +1,66 @@
1
- import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
- import p from "clsx";
3
- import { FadeScale as L } from "../../../animations/fade-scale/fade-scale.component.js";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
+ import l from "clsx";
3
+ import { FadeScale as M } from "../../../animations/fade-scale/fade-scale.component.js";
4
4
  import { Loader as x } from "../../../components/loader/loader.component.js";
5
- import { Content as M } from "../../../utils/content/content.component.js";
6
- import { withControl as S, baseProps as c } from "../../../utils/functions/functions.util.js";
7
- import '../../../assets/button-Dev1TPny.css';const C = "_Button_17hg9_1", T = "_SM_17hg9_19", B = "_LG_17hg9_24", F = "_Tertiary_17hg9_24", N = "_Text_17hg9_28", b = "_MD_17hg9_34", P = "_Primary_17hg9_62", D = "_Info_17hg9_71", G = "_Secondary_17hg9_75", I = "_Loading_17hg9_111", W = "_FullWidth_17hg9_119", w = "_Content_17hg9_123", $ = "_Loader_17hg9_140", t = {
8
- Button: C,
9
- SM: T,
10
- LG: B,
11
- Tertiary: F,
12
- Text: N,
13
- MD: b,
14
- Primary: P,
15
- Info: D,
16
- Secondary: G,
17
- Loading: I,
18
- FullWidth: W,
5
+ import { Content as C } from "../../../utils/content/content.component.js";
6
+ import { withControl as T, baseProps as _ } from "../../../utils/functions/functions.util.js";
7
+ import '../../../assets/button-CG0UkrYi.css';const B = "_Button_1jlaj_1", F = "_SM_1jlaj_19", N = "_LG_1jlaj_24", S = "_Tertiary_1jlaj_24", b = "_Text_1jlaj_28", D = "_MD_1jlaj_34", G = "_Primary_1jlaj_62", P = "_Info_1jlaj_71", I = "_Secondary_1jlaj_75", W = "_Loading_1jlaj_111", g = "_FullWidth_1jlaj_119", w = "_Content_1jlaj_123", $ = "_Loader_1jlaj_153", t = {
8
+ Button: B,
9
+ SM: F,
10
+ LG: N,
11
+ Tertiary: S,
12
+ Text: b,
13
+ MD: D,
14
+ Primary: G,
15
+ Info: P,
16
+ Secondary: I,
17
+ Loading: W,
18
+ FullWidth: g,
19
19
  Content: w,
20
20
  Loader: $
21
- }, H = ({
22
- text: _,
23
- color: r = "primary",
24
- size: o = "md",
21
+ }, J = ({
22
+ text: d,
23
+ color: a = "primary",
24
+ textSize: n = "md",
25
+ infoSize: o = "sm",
25
26
  type: i = "button",
26
- disabled: d = !1,
27
- info: m = "",
28
- fullWidth: l = !1,
29
- loading: n = !1,
30
- preventDefault: h = !1,
31
- blurAfterClick: y = !1,
32
- onClick: u = () => {
27
+ disabled: m = !1,
28
+ info: j = "",
29
+ fullWidth: y = !1,
30
+ loading: r = !1,
31
+ preventDefault: u = !1,
32
+ blurAfterClick: p = !1,
33
+ onClick: L = () => {
33
34
  },
34
35
  onFocus: f,
35
- onBlur: g,
36
- ...a
37
- }) => /* @__PURE__ */ s(
36
+ onBlur: h,
37
+ ...s
38
+ }) => /* @__PURE__ */ c(
38
39
  "button",
39
40
  {
40
- "data-testid": c(a, "data-testid", "button"),
41
+ "data-testid": _(s, "data-testid", "button"),
41
42
  type: i,
42
- disabled: d || n,
43
- className: p(t.Button, c(a, "className"), {
44
- [t.SM]: o === "sm",
45
- [t.MD]: o === "md",
46
- [t.LG]: o === "lg",
47
- [t.Primary]: r === "primary",
48
- [t.Secondary]: r === "secondary",
49
- [t.Tertiary]: r === "tertiary",
50
- [t.FullWidth]: l,
51
- [t.Loading]: n
43
+ disabled: m || r,
44
+ className: l(t.Button, _(s, "className"), {
45
+ [t.SM]: n === "sm",
46
+ [t.MD]: n === "md",
47
+ [t.LG]: n === "lg",
48
+ [t.Primary]: a === "primary",
49
+ [t.Secondary]: a === "secondary",
50
+ [t.Tertiary]: a === "tertiary",
51
+ [t.FullWidth]: y,
52
+ [t.Loading]: r
52
53
  }),
53
- onClick: S(u, { prevent: h, blur: y }),
54
+ onClick: T(L, { prevent: u, blur: p }),
54
55
  onFocus: () => f?.(),
55
- onBlur: () => g?.(),
56
+ onBlur: () => h?.(),
56
57
  children: [
57
- n && /* @__PURE__ */ e(
58
+ r && /* @__PURE__ */ e(
58
59
  x,
59
60
  {
60
61
  size: "xs",
61
62
  color: (() => {
62
- switch (r) {
63
+ switch (a) {
63
64
  case "primary":
64
65
  return "white";
65
66
  case "secondary":
@@ -71,13 +72,23 @@ import '../../../assets/button-Dev1TPny.css';const C = "_Button_17hg9_1", T = "_
71
72
  className: t.Loader
72
73
  }
73
74
  ),
74
- /* @__PURE__ */ s(L, { name: "content", keepMount: !0, condition: !n, className: t.Content, children: [
75
- /* @__PURE__ */ e("span", { className: t.Text, children: _ }),
76
- /* @__PURE__ */ e(M, { className: t.Info, children: m })
75
+ /* @__PURE__ */ c(M, { name: "content", keepMount: !0, condition: !r, className: t.Content, children: [
76
+ /* @__PURE__ */ e("span", { className: t.Text, children: d }),
77
+ /* @__PURE__ */ e(
78
+ C,
79
+ {
80
+ className: l(t.Info, {
81
+ [t.SM]: o === "sm",
82
+ [t.MD]: o === "md",
83
+ [t.LG]: o === "lg"
84
+ }),
85
+ children: j
86
+ }
87
+ )
77
88
  ] })
78
89
  ]
79
90
  }
80
91
  );
81
92
  export {
82
- H as Button
93
+ J as Button
83
94
  };
@@ -43,16 +43,16 @@ import '../../../assets/dropdown-DLhCAHEx.css';const Z = "_Dropdown_1kidn_1", ee
43
43
  onOpen: A,
44
44
  onClose: G,
45
45
  // Base props
46
- ...b
46
+ ...S
47
47
  }) => {
48
- const B = u(null), _ = u(null), S = u(null), { value: l, setFalse: m, toggle: L } = M(!1), [C, O] = f(""), [n, $] = f({ width: 0, height: 0 }), [a, N] = f([]);
48
+ const b = u(null), _ = u(null), B = u(null), { value: l, setFalse: m, toggle: L } = M(!1), [C, O] = f(""), [n, $] = f({ width: 0, height: 0 }), [a, N] = f([]);
49
49
  E({
50
50
  ref: _,
51
51
  onResize: (e) => $({ width: e.width || 0, height: e.height || 0 })
52
52
  }), P(_, (e) => {
53
- X(e, B) || (c && h(a), m());
53
+ X(e, b) || (c && h(a), m());
54
54
  }), y(() => N(Array.isArray(d) ? d : []), [d]), y(() => {
55
- l && n.width && n.height ? (S.current?.focus(), A?.call(null, n.height, n.width)) : G?.call(null);
55
+ l && n.width && n.height ? (B.current?.focus(), A?.call(null, n.height, n.width)) : G?.call(null);
56
56
  }, [l, n]);
57
57
  const j = (e, t) => {
58
58
  N((r) => r.some(({ value: p }) => p === e) ? r.filter(({ value: p }) => p !== e) : [...r, { value: e, label: t }]);
@@ -65,10 +65,10 @@ import '../../../assets/dropdown-DLhCAHEx.css';const Z = "_Dropdown_1kidn_1", ee
65
65
  return /* @__PURE__ */ i(
66
66
  "div",
67
67
  {
68
- "data-testid": H(b, "data-testid", "dropdown"),
69
- className: k(o.Dropdown, H(b, "className")),
68
+ "data-testid": H(S, "data-testid", "dropdown"),
69
+ className: k(o.Dropdown, H(S, "className")),
70
70
  children: [
71
- /* @__PURE__ */ s(R, { ref: B, onClick: L, children: /* @__PURE__ */ i("div", { className: o.Border, children: [
71
+ /* @__PURE__ */ s(R, { ref: b, onClick: L, children: /* @__PURE__ */ i("div", { className: o.Border, children: [
72
72
  /* @__PURE__ */ i("div", { className: o.Content, children: [
73
73
  /* @__PURE__ */ s(U, { text: z, position: "active" }),
74
74
  /* @__PURE__ */ s(
@@ -88,7 +88,7 @@ import '../../../assets/dropdown-DLhCAHEx.css';const Z = "_Dropdown_1kidn_1", ee
88
88
  /* @__PURE__ */ s(
89
89
  "input",
90
90
  {
91
- ref: S,
91
+ ref: B,
92
92
  value: C,
93
93
  type: "text",
94
94
  className: o.Input,
@@ -117,7 +117,16 @@ import '../../../assets/dropdown-DLhCAHEx.css';const Z = "_Dropdown_1kidn_1", ee
117
117
  },
118
118
  e + r
119
119
  )) : /* @__PURE__ */ s("li", { className: k(o.Choice, o.ChoiceNoResult), children: /* @__PURE__ */ s(x, { text: V, size: "body", checked: !1 }) }) }),
120
- c && /* @__PURE__ */ s("div", { className: o.Close, children: /* @__PURE__ */ s(J, { color: "primary", size: "sm", type: "button", onClick: () => F(), children: W }) })
120
+ c && /* @__PURE__ */ s("div", { className: o.Close, children: /* @__PURE__ */ s(
121
+ J,
122
+ {
123
+ color: "primary",
124
+ textSize: "sm",
125
+ type: "button",
126
+ text: W,
127
+ onClick: () => F()
128
+ }
129
+ ) })
121
130
  ] }) })
122
131
  ]
123
132
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "2.0.1",
4
+ "version": "2.0.2",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Button_17hg9_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_17hg9_1:disabled{cursor:not-allowed;opacity:.33}._SM_17hg9_19{border-radius:var(--rm-ui-border-radius-sm);padding:var(--rm-ui-padding-xs) var(--rm-ui-padding-sm)}._LG_17hg9_24._Tertiary_17hg9_24{padding:calc(var(--rm-ui-padding-xs) - 1px) calc(var(--rm-ui-padding-sm) - 1px)}._SM_17hg9_19 ._Text_17hg9_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)}._MD_17hg9_34{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._MD_17hg9_34._Tertiary_17hg9_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._LG_17hg9_24{border-radius:var(--rm-ui-border-radius-md);padding:var(--rm-ui-padding-sm) var(--rm-ui-padding-lg)}._LG_17hg9_24._Tertiary_17hg9_24{padding:calc(var(--rm-ui-padding-sm) - 1px) calc(var(--rm-ui-padding-lg) - 1px)}._MD_17hg9_34 ._Text_17hg9_28{font-size:var(--rm-ui-font-size-body);line-height:var(--rm-ui-line-height-body)}._LG_17hg9_24 ._Text_17hg9_28{font-size:var(--rm-ui-font-size-body-large);line-height:var(--rm-ui-line-height-body-large)}._Primary_17hg9_62{background-color:var(--rm-ui-next-btn-bg)}._Primary_17hg9_62:hover{background-color:var(--rm-ui-next-btn-bg-hover)}._Primary_17hg9_62 ._Text_17hg9_28,._Primary_17hg9_62 ._Info_17hg9_71{color:#fff}._Secondary_17hg9_75{border:1px solid transparent;background-color:transparent}._Secondary_17hg9_75:hover{border-color:var(--rm-ui-grey-400)}._Secondary_17hg9_75:hover ._Text_17hg9_28{color:var(--rm-ui-grey-400);border-color:var(--rm-ui-grey-400)}._Secondary_17hg9_75 ._Text_17hg9_28,._Secondary_17hg9_75 ._Info_17hg9_71{color:var(--rm-ui-color-text-secondary)}._Tertiary_17hg9_24{border:1px solid var(--rm-ui-grey-300);background-color:transparent}._Tertiary_17hg9_24:hover{border-color:var(--rm-ui-grey-200)}._Tertiary_17hg9_24:hover ._Text_17hg9_28{color:var(--rm-ui-grey-700)}._Tertiary_17hg9_24 ._Text_17hg9_28,._Tertiary_17hg9_24 ._Info_17hg9_71{color:var(--rm-ui-color-text-primary)}._Button_17hg9_1:not(._Loading_17hg9_111):not(:disabled):hover{cursor:pointer}._Button_17hg9_1:focus{outline-color:var(--rm-ui-color-focus)}._FullWidth_17hg9_119{width:100%}._Content_17hg9_123{display:flex;flex-direction:column}._Info_17hg9_71{flex-basis:100%;font-weight:var(--rm-ui-font-weight-regular);font-size:var(--rm-ui-font-size-body-small);line-height:calc(var(--rm-ui-line-height-body-small) - 2px)}._Text_17hg9_28{font-weight:var(--rm-ui-font-weight-medium);transition:color var(--rm-ui-amimation-speed-primary) var(--rm-ui-amimation-cubic-primary)}._Loader_17hg9_140{position:absolute}