mimir-ui-kit 1.38.30 → 1.38.32
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/RadioGroup/RadioGroup.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.js +84 -74
- package/dist/icons/Icon.js +1 -1
- package/dist/icons/components/12px/MessageRead12px.js +2 -2
- package/dist/icons/components/index.js +570 -569
- package/dist/index-BuVUKy18.js +2658 -0
- package/package.json +1 -1
- package/dist/index-DzVMAmli.js +0 -1431
@@ -32,6 +32,10 @@ export type TRadioGroupProps = Omit<RadioGroupProps, 'value'> & {
|
|
32
32
|
* Дополнительный класснейм для span радиогруппы.
|
33
33
|
*/
|
34
34
|
classNameRadioSpan?: string;
|
35
|
+
/**
|
36
|
+
* Дополнительный класснейм для обертки контента радиогруппы.
|
37
|
+
*/
|
38
|
+
classNameContentWrapper?: string;
|
35
39
|
};
|
36
40
|
/**
|
37
41
|
* Компонент RadioGroup для выбора одной опции из нескольких.
|
@@ -60,4 +64,8 @@ export declare const RadioGroup: import('react').ForwardRefExoticComponent<Omit<
|
|
60
64
|
* Дополнительный класснейм для span радиогруппы.
|
61
65
|
*/
|
62
66
|
classNameRadioSpan?: string;
|
67
|
+
/**
|
68
|
+
* Дополнительный класснейм для обертки контента радиогруппы.
|
69
|
+
*/
|
70
|
+
classNameContentWrapper?: string;
|
63
71
|
} & import('react').RefAttributes<HTMLElement>>;
|
@@ -11,7 +11,7 @@ let Le = { 0(e, r) {
|
|
11
11
|
let o = [...e.options, { id: r.id, element: r.element, propsRef: r.propsRef }];
|
12
12
|
return { ...e, options: Ie(o, (a) => a.element.current) };
|
13
13
|
}, 1(e, r) {
|
14
|
-
let o = e.options.slice(), a = e.options.findIndex((
|
14
|
+
let o = e.options.slice(), a = e.options.findIndex((u) => u.id === r.id);
|
15
15
|
return a === -1 ? e : (o.splice(a, 1), { ...e, options: o });
|
16
16
|
} }, J = ce(null);
|
17
17
|
J.displayName = "RadioGroupDataContext";
|
@@ -38,68 +38,68 @@ function Ue(e, r) {
|
|
38
38
|
}
|
39
39
|
let je = "div";
|
40
40
|
function He(e, r) {
|
41
|
-
let o = q(), a = oe(), { id:
|
41
|
+
let o = q(), a = oe(), { id: u = `headlessui-radiogroup-${o}`, value: _, form: v, name: c, onChange: n, by: m, disabled: l = a || !1, defaultValue: s, ...y } = e, d = Ae(m), [k, D] = xe(Ue, { options: [] }), p = k.options, [O, A] = te(), [C, w] = ie(), P = B(null), G = z(P, r), $ = ke(s), [t, x] = Oe(_, n, $), F = T(() => p.find((i) => !i.propsRef.current.disabled), [p]), g = T(() => p.some((i) => d(i.propsRef.current.value, t)), [p, t]), f = U((i) => {
|
42
42
|
var I;
|
43
|
-
if (
|
44
|
-
let h = (I =
|
45
|
-
return h != null && h.disabled ? !1 : (x == null || x(
|
46
|
-
}), be = U((
|
43
|
+
if (l || d(i, t)) return !1;
|
44
|
+
let h = (I = p.find((j) => d(j.propsRef.current.value, i))) == null ? void 0 : I.propsRef.current;
|
45
|
+
return h != null && h.disabled ? !1 : (x == null || x(i), !0);
|
46
|
+
}), be = U((i) => {
|
47
47
|
let I = P.current;
|
48
48
|
if (!I) return;
|
49
|
-
let h = Ge(I), j =
|
50
|
-
switch (
|
49
|
+
let h = Ge(I), j = p.filter((b) => b.propsRef.current.disabled === !1).map((b) => b.element.current);
|
50
|
+
switch (i.key) {
|
51
51
|
case N.Enter:
|
52
|
-
De(
|
52
|
+
De(i.currentTarget);
|
53
53
|
break;
|
54
54
|
case N.ArrowLeft:
|
55
55
|
case N.ArrowUp:
|
56
|
-
if (
|
57
|
-
let b =
|
58
|
-
b &&
|
56
|
+
if (i.preventDefault(), i.stopPropagation(), re(j, H.Previous | H.WrapAround) === ae.Success) {
|
57
|
+
let b = p.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
|
58
|
+
b && f(b.propsRef.current.value);
|
59
59
|
}
|
60
60
|
break;
|
61
61
|
case N.ArrowRight:
|
62
62
|
case N.ArrowDown:
|
63
|
-
if (
|
64
|
-
let b =
|
65
|
-
b &&
|
63
|
+
if (i.preventDefault(), i.stopPropagation(), re(j, H.Next | H.WrapAround) === ae.Success) {
|
64
|
+
let b = p.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
|
65
|
+
b && f(b.propsRef.current.value);
|
66
66
|
}
|
67
67
|
break;
|
68
68
|
case N.Space:
|
69
69
|
{
|
70
|
-
|
71
|
-
let b =
|
72
|
-
b &&
|
70
|
+
i.preventDefault(), i.stopPropagation();
|
71
|
+
let b = p.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
|
72
|
+
b && f(b.propsRef.current.value);
|
73
73
|
}
|
74
74
|
break;
|
75
75
|
}
|
76
|
-
}), Z = U((
|
77
|
-
if ($ !== void 0) return
|
78
|
-
}, [
|
79
|
-
return E.createElement(w, { name: "RadioGroup.Description" }, E.createElement(A, { name: "RadioGroup.Label" }, E.createElement(Q.Provider, { value: Re }, E.createElement(J.Provider, { value: ve },
|
76
|
+
}), Z = U((i) => (D({ type: 0, ...i }), () => D({ type: 1, id: i.id }))), ve = T(() => ({ value: t, firstOption: F, containsCheckedOption: g, disabled: l, compare: d, ...k }), [t, F, g, l, d, k]), Re = T(() => ({ registerOption: Z, change: f }), [Z, f]), he = { ref: G, id: u, role: "radiogroup", "aria-labelledby": O, "aria-describedby": C, onKeyDown: be }, $e = T(() => ({ value: t }), [t]), ge = Fe(() => {
|
77
|
+
if ($ !== void 0) return f($);
|
78
|
+
}, [f, $]);
|
79
|
+
return E.createElement(w, { name: "RadioGroup.Description" }, E.createElement(A, { name: "RadioGroup.Label" }, E.createElement(Q.Provider, { value: Re }, E.createElement(J.Provider, { value: ve }, c != null && E.createElement(we, { disabled: l, data: { [c]: t || "on" }, overrides: { type: "radio", checked: t != null }, form: v, onReset: ge }), K({ ourProps: he, theirProps: y, slot: $e, defaultTag: je, name: "RadioGroup" })))));
|
80
80
|
}
|
81
81
|
let Me = "div";
|
82
82
|
function Ve(e, r) {
|
83
83
|
var o;
|
84
|
-
let a = X("RadioGroup.Option"),
|
85
|
-
ne(() =>
|
84
|
+
let a = X("RadioGroup.Option"), u = Y("RadioGroup.Option"), _ = q(), { id: v = `headlessui-radiogroup-option-${_}`, value: c, disabled: n = a.disabled || !1, autoFocus: m = !1, ...l } = e, s = B(null), y = z(s, r), [d, k] = te(), [D, p] = ie(), O = se({ value: c, disabled: n });
|
85
|
+
ne(() => u.registerOption({ id: v, element: s, propsRef: O }), [v, u, s, O]);
|
86
86
|
let A = U((g) => {
|
87
|
-
var
|
87
|
+
var f;
|
88
88
|
if (fe(g.currentTarget)) return g.preventDefault();
|
89
|
-
|
90
|
-
}), C = ((o = a.firstOption) == null ? void 0 : o.id) ===
|
91
|
-
return E.createElement(
|
89
|
+
u.change(c) && ((f = s.current) == null || f.focus());
|
90
|
+
}), C = ((o = a.firstOption) == null ? void 0 : o.id) === v, { isFocusVisible: w, focusProps: P } = le({ autoFocus: m }), { isHovered: G, hoverProps: $ } = de({ isDisabled: n }), t = a.compare(a.value, c), x = ue({ ref: y, id: v, role: "radio", "aria-checked": t ? "true" : "false", "aria-labelledby": d, "aria-describedby": D, "aria-disabled": n ? !0 : void 0, tabIndex: n ? -1 : t || !a.containsCheckedOption && C ? 0 : -1, onClick: n ? void 0 : A, autoFocus: m }, P, $), F = T(() => ({ checked: t, disabled: n, active: w, hover: G, focus: w, autofocus: m }), [t, n, G, w, m]);
|
91
|
+
return E.createElement(p, { name: "RadioGroup.Description" }, E.createElement(k, { name: "RadioGroup.Label" }, K({ ourProps: x, theirProps: l, slot: F, defaultTag: Me, name: "RadioGroup.Option" })));
|
92
92
|
}
|
93
93
|
let We = "span";
|
94
94
|
function ze(e, r) {
|
95
95
|
var o;
|
96
|
-
let a = X("Radio"),
|
97
|
-
ne(() =>
|
96
|
+
let a = X("Radio"), u = Y("Radio"), _ = q(), v = Pe(), c = oe(), { id: n = v || `headlessui-radio-${_}`, value: m, disabled: l = a.disabled || c || !1, autoFocus: s = !1, ...y } = e, d = B(null), k = z(d, r), D = Ee(), p = Te(), O = se({ value: m, disabled: l });
|
97
|
+
ne(() => u.registerOption({ id: n, element: d, propsRef: O }), [n, u, d, O]);
|
98
98
|
let A = U((g) => {
|
99
|
-
var
|
99
|
+
var f;
|
100
100
|
if (fe(g.currentTarget)) return g.preventDefault();
|
101
|
-
|
102
|
-
}), { isFocusVisible: C, focusProps: w } = le({ autoFocus:
|
101
|
+
u.change(m) && ((f = d.current) == null || f.focus());
|
102
|
+
}), { isFocusVisible: C, focusProps: w } = le({ autoFocus: s }), { isHovered: P, hoverProps: G } = de({ isDisabled: l }), $ = ((o = a.firstOption) == null ? void 0 : o.id) === n, t = a.compare(a.value, m), x = ue({ ref: k, id: n, role: "radio", "aria-checked": t ? "true" : "false", "aria-labelledby": D, "aria-describedby": p, "aria-disabled": l ? !0 : void 0, tabIndex: l ? -1 : t || !a.containsCheckedOption && $ ? 0 : -1, autoFocus: s, onClick: l ? void 0 : A }, w, G), F = T(() => ({ checked: t, disabled: l, hover: P, focus: C, autofocus: s }), [t, l, P, C, s]);
|
103
103
|
return K({ ourProps: x, theirProps: y, slot: F, defaultTag: We, name: "Radio" });
|
104
104
|
}
|
105
105
|
let Ke = W(He), qe = W(Ve), me = W(ze), Be = V, Je = ye, Xe = Object.assign(Ke, { Option: qe, Radio: me, Label: Be, Description: Je });
|
@@ -118,63 +118,73 @@ const Qe = "_group_yses6_3", Ye = "_radio_yses6_18", Ze = "_disabled_yses6_40",
|
|
118
118
|
value: r,
|
119
119
|
onChange: o,
|
120
120
|
label: a,
|
121
|
-
classNameRadioWrapper:
|
121
|
+
classNameRadioWrapper: u,
|
122
122
|
classNameRadioSpan: _,
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
classNameContentWrapper: v,
|
124
|
+
...c
|
125
|
+
}, n) => {
|
126
|
+
const m = M(
|
126
127
|
R["radio-wrapper"],
|
127
|
-
|
128
|
+
u,
|
128
129
|
{
|
129
|
-
[R.disabled]:
|
130
|
+
[R.disabled]: c.disabled
|
130
131
|
}
|
131
132
|
);
|
132
133
|
return /* @__PURE__ */ ee(
|
133
134
|
Xe,
|
134
135
|
{
|
135
|
-
ref:
|
136
|
+
ref: n,
|
136
137
|
value: r,
|
137
138
|
className: R.group,
|
138
139
|
onChange: o,
|
139
|
-
...
|
140
|
+
...c,
|
140
141
|
children: [
|
141
142
|
a && /* @__PURE__ */ L(V, { as: "p", className: R.label, children: a }),
|
142
|
-
/* @__PURE__ */ L(
|
143
|
-
|
143
|
+
/* @__PURE__ */ L(
|
144
|
+
"div",
|
144
145
|
{
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
146
|
+
className: M(
|
147
|
+
R["content-wrapper"],
|
148
|
+
v
|
149
|
+
),
|
150
|
+
children: e.map(({ label: l, value: s }) => /* @__PURE__ */ L(
|
151
|
+
me,
|
152
|
+
{
|
153
|
+
as: "span",
|
154
|
+
value: s,
|
155
|
+
disabled: c.disabled,
|
156
|
+
className: m,
|
157
|
+
"data-testid": `radio-option-${s}`,
|
158
|
+
children: ({ checked: y, disabled: d }) => /* @__PURE__ */ ee(_e, { children: [
|
159
|
+
/* @__PURE__ */ L(
|
160
|
+
V,
|
157
161
|
{
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
162
|
+
as: "span",
|
163
|
+
className: M(
|
164
|
+
R.radio,
|
165
|
+
{
|
166
|
+
[R.disabled]: c.disabled
|
167
|
+
},
|
168
|
+
_
|
169
|
+
),
|
170
|
+
children: /* @__PURE__ */ L(
|
171
|
+
"span",
|
172
|
+
{
|
173
|
+
className: M(R.frame, {
|
174
|
+
[R.checked]: y,
|
175
|
+
[R.disabled]: d
|
176
|
+
})
|
177
|
+
}
|
178
|
+
)
|
169
179
|
}
|
170
|
-
)
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
)
|
180
|
+
),
|
181
|
+
l
|
182
|
+
] })
|
183
|
+
},
|
184
|
+
typeof s == "string" ? s : String(s)
|
185
|
+
))
|
186
|
+
}
|
187
|
+
)
|
178
188
|
]
|
179
189
|
}
|
180
190
|
);
|
package/dist/icons/Icon.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
2
2
|
import { Suspense as s } from "react";
|
3
|
-
import { i as e } from "../index-
|
3
|
+
import { i as e } from "../index-BuVUKy18.js";
|
4
4
|
const p = ({ iconName: o, ...n }) => {
|
5
5
|
const r = e[o];
|
6
6
|
return r ? /* @__PURE__ */ t(s, { fallback: null, children: /* @__PURE__ */ t(r, { ...n, "data-testid": o }) }) : null;
|
@@ -12,7 +12,7 @@ const t = (l) => /* @__PURE__ */ d(
|
|
12
12
|
/* @__PURE__ */ e(
|
13
13
|
"path",
|
14
14
|
{
|
15
|
-
|
15
|
+
fillRule: "evenodd",
|
16
16
|
clipRule: "evenodd",
|
17
17
|
d: "M8.14103 4.3077L2.76402 10.1635L0.131592 7.29443L0.868431 6.61836L2.76431 8.68466L7.40445 3.63135L8.14103 4.3077Z",
|
18
18
|
fill: "white"
|
@@ -21,7 +21,7 @@ const t = (l) => /* @__PURE__ */ d(
|
|
21
21
|
/* @__PURE__ */ e(
|
22
22
|
"path",
|
23
23
|
{
|
24
|
-
|
24
|
+
fillRule: "evenodd",
|
25
25
|
clipRule: "evenodd",
|
26
26
|
d: "M11.8682 4.3077L6.50505 10.1484L5.2356 8.86685L5.94605 8.16311L6.47762 8.69975L11.1316 3.63135L11.8682 4.3077Z",
|
27
27
|
fill: "white"
|