@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
|
|
2
|
-
import { baseProps as
|
|
3
|
-
import { FadeSlide as
|
|
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
|
|
6
|
-
import { Choice as
|
|
7
|
-
import { ErrorMessage as
|
|
8
|
-
import { HiddenInput as
|
|
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
|
|
10
|
+
import { RadioLabel as w } from "../../primitives/radio-label/radio-label.component.js";
|
|
11
11
|
import "lucide-react";
|
|
12
|
-
import { Text as
|
|
13
|
-
import { getChoiceId as
|
|
14
|
-
import { useControlInteraction as
|
|
15
|
-
import '../../../assets/radio-
|
|
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,
|
|
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:
|
|
26
|
+
value: i = "",
|
|
27
27
|
disabled: n = !1,
|
|
28
|
-
state:
|
|
29
|
-
onChange:
|
|
30
|
-
onFocus:
|
|
31
|
-
onBlur:
|
|
28
|
+
state: m = "idle",
|
|
29
|
+
onChange: q,
|
|
30
|
+
onFocus: g,
|
|
31
|
+
onBlur: v,
|
|
32
32
|
// Radio props
|
|
33
|
-
choices:
|
|
33
|
+
choices: L,
|
|
34
34
|
orientation: l = "horizontal",
|
|
35
|
-
iconSize:
|
|
36
|
-
textSize:
|
|
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:
|
|
42
|
+
const { emitChange: x, handleFocus: y, handleBlur: E } = T({
|
|
43
43
|
id: t,
|
|
44
44
|
disabled: n,
|
|
45
|
-
onChange:
|
|
46
|
-
onFocus:
|
|
47
|
-
onBlur:
|
|
48
|
-
}), _ =
|
|
49
|
-
return /* @__PURE__ */ u("div", { "data-testid": _, className:
|
|
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__ */
|
|
51
|
+
/* @__PURE__ */ o(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
className:
|
|
55
|
-
[
|
|
56
|
-
[
|
|
54
|
+
className: h(r.Content, {
|
|
55
|
+
[r.Horizontal]: l === "horizontal",
|
|
56
|
+
[r.Vertical]: l === "vertical"
|
|
57
57
|
}),
|
|
58
|
-
children:
|
|
59
|
-
const s =
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
|
|
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:
|
|
66
|
-
state:
|
|
67
|
-
checked:
|
|
68
|
-
focused:
|
|
69
|
-
hovered:
|
|
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__ */
|
|
74
|
-
|
|
73
|
+
/* @__PURE__ */ o(
|
|
74
|
+
B,
|
|
75
75
|
{
|
|
76
76
|
type: "radio",
|
|
77
77
|
id: s,
|
|
78
|
-
value:
|
|
78
|
+
value: a.value,
|
|
79
79
|
name: t,
|
|
80
|
-
checked:
|
|
80
|
+
checked: d,
|
|
81
81
|
disabled: n,
|
|
82
|
-
onChange: (X,
|
|
83
|
-
onFocus:
|
|
84
|
-
onBlur:
|
|
82
|
+
onChange: (X, V) => x(a.value, V),
|
|
83
|
+
onFocus: y,
|
|
84
|
+
onBlur: E
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ o($, { text: a.label, size: z, checked: d })
|
|
88
88
|
] }) }, s);
|
|
89
89
|
})
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
|
-
/* @__PURE__ */
|
|
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 +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)}
|