@arthurzakharov/ui-kit 3.16.0 → 3.17.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.
@@ -0,0 +1 @@
1
+ ._Radio_qna8q_1{display:inline-flex;flex-direction:column}._WithLabel_qna8q_6{display:flex;width:100%;gap:var(--rm-ui-padding-xs)}._Content_qna8q_12{display:inline-flex}._Horizontal_qna8q_16{flex-direction:row;gap:var(--rm-ui-padding-lg)}._Vertical_qna8q_21{flex-direction:column;gap:var(--rm-ui-padding-xxs)}._Label_qna8q_26{position:relative;display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--rm-ui-padding-xs)}._Label_qna8q_26:hover{cursor:pointer}._ErrorMessage_qna8q_39{padding-top:var(--rm-ui-padding-xxs)}
@@ -1,18 +1,18 @@
1
- import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { baseProps as g, clsx as f } from "../../../utils/functions/functions.util.js";
3
- import { FadeSlide as $ } from "../../../animations/fade-slide/fade-slide.component.js";
1
+ import { jsxs as u, jsx as o } from "react/jsx-runtime";
2
+ import { baseProps as f, clsx as h } from "../../../utils/functions/functions.util.js";
3
+ import { FadeSlide as W } from "../../../animations/fade-slide/fade-slide.component.js";
4
4
  import "../../primitives/box/box.component.js";
5
- import { Caption as F } from "../../primitives/caption/caption.component.js";
6
- import { Choice as j } from "../../primitives/choice/choice.component.js";
7
- import { ErrorMessage as B } from "../../primitives/error-message/error-message.component.js";
8
- import { HiddenInput as w } from "../../primitives/hidden-input/hidden-input.component.js";
5
+ import { Caption as $ } from "../../primitives/caption/caption.component.js";
6
+ import { Choice as F } from "../../primitives/choice/choice.component.js";
7
+ import { ErrorMessage as j } from "../../primitives/error-message/error-message.component.js";
8
+ import { HiddenInput as B } from "../../primitives/hidden-input/hidden-input.component.js";
9
9
  import "../../../utils/content/content.component.js";
10
- import { RadioLabel as P } from "../../primitives/radio-label/radio-label.component.js";
10
+ import { RadioLabel as w } from "../../primitives/radio-label/radio-label.component.js";
11
11
  import "lucide-react";
12
- import { Text as S } from "../../../components/text/text.component.js";
13
- import { getChoiceId as T } from "../../utils/functions/functions.util.js";
14
- import { useControlInteraction as q } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
15
- import '../../../assets/radio-D4fKo4f0.css';const A = "_Radio_1trgm_1", D = "_WithLabel_1trgm_6", G = "_Content_1trgm_12", J = "_Horizontal_1trgm_16", K = "_Vertical_1trgm_21", O = "_Label_1trgm_26", Q = "_ErrorMessage_1trgm_39", o = {
12
+ import { Text as P } from "../../../components/text/text.component.js";
13
+ import { getChoiceId as S } from "../../utils/functions/functions.util.js";
14
+ import { useControlInteraction as T } from "../../utils/hooks/use-control-interaction/use-control-interaction.hook.js";
15
+ import '../../../assets/radio-BAqOCwHC.css';const A = "_Radio_qna8q_1", D = "_WithLabel_qna8q_6", G = "_Content_qna8q_12", J = "_Horizontal_qna8q_16", K = "_Vertical_qna8q_21", O = "_Label_qna8q_26", Q = "_ErrorMessage_qna8q_39", r = {
16
16
  Radio: A,
17
17
  WithLabel: D,
18
18
  Content: G,
@@ -20,76 +20,76 @@ import '../../../assets/radio-D4fKo4f0.css';const A = "_Radio_1trgm_1", D = "_Wi
20
20
  Vertical: K,
21
21
  Label: O,
22
22
  ErrorMessage: Q
23
- }, U = (t, a) => t == null || t === !1 || t === "" ? null : typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ r(S, { tag: "div", weight: "medium", size: "body", color: "text-primary", "data-testid": `${a}-label`, children: t }) : /* @__PURE__ */ r("div", { "data-testid": `${a}-label`, children: t }), ct = ({
23
+ }, U = (t, i) => t == null || t === !1 || t === "" ? null : typeof t == "string" || typeof t == "number" ? /* @__PURE__ */ o(P, { tag: "div", weight: "medium", size: "body", color: "text-primary", "data-testid": `${i}-label`, children: t }) : /* @__PURE__ */ o("div", { "data-testid": `${i}-label`, children: t }), ct = ({
24
24
  // Interactive props
25
25
  id: t,
26
- value: a = "",
26
+ value: i = "",
27
27
  disabled: n = !1,
28
- state: d = "idle",
29
- onChange: h,
30
- onFocus: v,
31
- onBlur: L,
28
+ state: m = "idle",
29
+ onChange: q,
30
+ onFocus: g,
31
+ onBlur: v,
32
32
  // Radio props
33
- choices: C,
33
+ choices: L,
34
34
  orientation: l = "horizontal",
35
- iconSize: z = "md",
36
- textSize: x = "body",
35
+ iconSize: C = "md",
36
+ textSize: z = "body",
37
37
  message: c = "",
38
38
  label: e,
39
39
  // Base props
40
40
  ...p
41
41
  }) => {
42
- const { emitChange: y, handleFocus: E, handleBlur: M } = q({
42
+ const { emitChange: x, handleFocus: y, handleBlur: E } = T({
43
43
  id: t,
44
44
  disabled: n,
45
- onChange: h,
46
- onFocus: v,
47
- onBlur: L
48
- }), _ = g(p, "data-testid", "radio"), R = e != null && e !== !1 && e !== "";
49
- return /* @__PURE__ */ u("div", { "data-testid": _, className: f(o.Radio, { [o.WithLabel]: R }, g(p, "className")), children: [
45
+ onChange: q,
46
+ onFocus: g,
47
+ onBlur: v
48
+ }), _ = f(p, "data-testid", "radio"), M = e != null && e !== !1 && e !== "";
49
+ return /* @__PURE__ */ u("div", { "data-testid": _, className: h(r.Radio, { [r.WithLabel]: M }, f(p, "className")), children: [
50
50
  U(e, _),
51
- /* @__PURE__ */ r(
51
+ /* @__PURE__ */ o(
52
52
  "div",
53
53
  {
54
- className: f(o.Content, {
55
- [o.Horizontal]: l === "horizontal",
56
- [o.Vertical]: l === "vertical"
54
+ className: h(r.Content, {
55
+ [r.Horizontal]: l === "horizontal",
56
+ [r.Vertical]: l === "vertical"
57
57
  }),
58
- children: C.map((i, H, N) => {
59
- const s = T(t, i.value, H);
60
- return /* @__PURE__ */ r(P, { id: s, value: a, state: d, choice: i, choices: N, children: ({ focused: b, hovered: I, checked: m, state: V }) => /* @__PURE__ */ u("div", { className: o.Label, children: [
61
- /* @__PURE__ */ r(
62
- j,
58
+ children: L.map((a, R, H) => {
59
+ const s = S(t, a.value, R);
60
+ return /* @__PURE__ */ o(w, { id: s, value: i, state: m, choice: a, choices: H, children: ({ focused: N, hovered: b, checked: d, state: I }) => /* @__PURE__ */ u("div", { className: r.Label, children: [
61
+ /* @__PURE__ */ o(
62
+ F,
63
63
  {
64
64
  type: "radio",
65
- size: z,
66
- state: V,
67
- checked: m,
68
- focused: b,
69
- hovered: I,
65
+ size: C,
66
+ state: I,
67
+ checked: d,
68
+ focused: N,
69
+ hovered: b,
70
70
  disabled: n
71
71
  }
72
72
  ),
73
- /* @__PURE__ */ r(
74
- w,
73
+ /* @__PURE__ */ o(
74
+ B,
75
75
  {
76
76
  type: "radio",
77
77
  id: s,
78
- value: i.value,
78
+ value: a.value,
79
79
  name: t,
80
- checked: m,
80
+ checked: d,
81
81
  disabled: n,
82
- onChange: (X, W) => y(i.value, W),
83
- onFocus: E,
84
- onBlur: M
82
+ onChange: (X, V) => x(a.value, V),
83
+ onFocus: y,
84
+ onBlur: E
85
85
  }
86
86
  ),
87
- /* @__PURE__ */ r(F, { text: i.label, size: x, checked: m })
87
+ /* @__PURE__ */ o($, { text: a.label, size: z, checked: d })
88
88
  ] }) }, s);
89
89
  })
90
90
  }
91
91
  ),
92
- /* @__PURE__ */ r($, { name: "message", condition: d === "error" && !!c, children: /* @__PURE__ */ r(B, { text: c, className: o.ErrorMessage }) })
92
+ /* @__PURE__ */ o(W, { name: "message", condition: m === "error" && !!c, children: /* @__PURE__ */ o(j, { text: c, className: r.ErrorMessage }) })
93
93
  ] });
94
94
  };
95
95
  export {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arthurzakharov/ui-kit",
3
3
  "private": false,
4
- "version": "3.16.0",
4
+ "version": "3.17.0",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
7
7
  "types": "dist/main.d.ts",
@@ -1 +0,0 @@
1
- ._Radio_1trgm_1{display:inline-flex;flex-direction:column}._WithLabel_1trgm_6{display:flex;width:100%;gap:var(--rm-ui-padding-sm)}._Content_1trgm_12{display:inline-flex}._Horizontal_1trgm_16{flex-direction:row;gap:var(--rm-ui-padding-lg)}._Vertical_1trgm_21{flex-direction:column;gap:var(--rm-ui-padding-xxs)}._Label_1trgm_26{position:relative;display:inline-flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:var(--rm-ui-padding-xs)}._Label_1trgm_26:hover{cursor:pointer}._ErrorMessage_1trgm_39{padding-top:var(--rm-ui-padding-xxs)}