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.
@@ -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((l) => l.id === r.id);
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: l = `headlessui-radiogroup-${o}`, value: _, form: d, name: v, onChange: n, by: f, disabled: t = a || !1, defaultValue: u, ...y } = e, m = Ae(f), [k, D] = xe(Ue, { options: [] }), c = k.options, [O, A] = te(), [C, w] = ie(), P = B(null), G = z(P, r), $ = ke(u), [i, x] = Oe(_, n, $), F = T(() => c.find((s) => !s.propsRef.current.disabled), [c]), g = T(() => c.some((s) => m(s.propsRef.current.value, i)), [c, i]), p = U((s) => {
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 (t || m(s, i)) return !1;
44
- let h = (I = c.find((j) => m(j.propsRef.current.value, s))) == null ? void 0 : I.propsRef.current;
45
- return h != null && h.disabled ? !1 : (x == null || x(s), !0);
46
- }), be = U((s) => {
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 = c.filter((b) => b.propsRef.current.disabled === !1).map((b) => b.element.current);
50
- switch (s.key) {
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(s.currentTarget);
52
+ De(i.currentTarget);
53
53
  break;
54
54
  case N.ArrowLeft:
55
55
  case N.ArrowUp:
56
- if (s.preventDefault(), s.stopPropagation(), re(j, H.Previous | H.WrapAround) === ae.Success) {
57
- let b = c.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
58
- b && p(b.propsRef.current.value);
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 (s.preventDefault(), s.stopPropagation(), re(j, H.Next | H.WrapAround) === ae.Success) {
64
- let b = c.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
65
- b && p(b.propsRef.current.value);
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
- s.preventDefault(), s.stopPropagation();
71
- let b = c.find((S) => S.element.current === (h == null ? void 0 : h.activeElement));
72
- b && p(b.propsRef.current.value);
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((s) => (D({ type: 0, ...s }), () => D({ type: 1, id: s.id }))), ve = T(() => ({ value: i, firstOption: F, containsCheckedOption: g, disabled: t, compare: m, ...k }), [i, F, g, t, m, k]), Re = T(() => ({ registerOption: Z, change: p }), [Z, p]), he = { ref: G, id: l, role: "radiogroup", "aria-labelledby": O, "aria-describedby": C, onKeyDown: be }, $e = T(() => ({ value: i }), [i]), ge = Fe(() => {
77
- if ($ !== void 0) return p($);
78
- }, [p, $]);
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 }, v != null && E.createElement(we, { disabled: t, data: { [v]: i || "on" }, overrides: { type: "radio", checked: i != null }, form: d, onReset: ge }), K({ ourProps: he, theirProps: y, slot: $e, defaultTag: je, name: "RadioGroup" })))));
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"), l = Y("RadioGroup.Option"), _ = q(), { id: d = `headlessui-radiogroup-option-${_}`, value: v, disabled: n = a.disabled || !1, autoFocus: f = !1, ...t } = e, u = B(null), y = z(u, r), [m, k] = te(), [D, c] = ie(), O = se({ value: v, disabled: n });
85
- ne(() => l.registerOption({ id: d, element: u, propsRef: O }), [d, l, u, O]);
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 p;
87
+ var f;
88
88
  if (fe(g.currentTarget)) return g.preventDefault();
89
- l.change(v) && ((p = u.current) == null || p.focus());
90
- }), C = ((o = a.firstOption) == null ? void 0 : o.id) === d, { isFocusVisible: w, focusProps: P } = le({ autoFocus: f }), { isHovered: G, hoverProps: $ } = de({ isDisabled: n }), i = a.compare(a.value, v), x = ue({ ref: y, id: d, role: "radio", "aria-checked": i ? "true" : "false", "aria-labelledby": m, "aria-describedby": D, "aria-disabled": n ? !0 : void 0, tabIndex: n ? -1 : i || !a.containsCheckedOption && C ? 0 : -1, onClick: n ? void 0 : A, autoFocus: f }, P, $), F = T(() => ({ checked: i, disabled: n, active: w, hover: G, focus: w, autofocus: f }), [i, n, G, w, f]);
91
- return E.createElement(c, { name: "RadioGroup.Description" }, E.createElement(k, { name: "RadioGroup.Label" }, K({ ourProps: x, theirProps: t, slot: F, defaultTag: Me, name: "RadioGroup.Option" })));
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"), l = Y("Radio"), _ = q(), d = Pe(), v = oe(), { id: n = d || `headlessui-radio-${_}`, value: f, disabled: t = a.disabled || v || !1, autoFocus: u = !1, ...y } = e, m = B(null), k = z(m, r), D = Ee(), c = Te(), O = se({ value: f, disabled: t });
97
- ne(() => l.registerOption({ id: n, element: m, propsRef: O }), [n, l, m, O]);
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 p;
99
+ var f;
100
100
  if (fe(g.currentTarget)) return g.preventDefault();
101
- l.change(f) && ((p = m.current) == null || p.focus());
102
- }), { isFocusVisible: C, focusProps: w } = le({ autoFocus: u }), { isHovered: P, hoverProps: G } = de({ isDisabled: t }), $ = ((o = a.firstOption) == null ? void 0 : o.id) === n, i = a.compare(a.value, f), x = ue({ ref: k, id: n, role: "radio", "aria-checked": i ? "true" : "false", "aria-labelledby": D, "aria-describedby": c, "aria-disabled": t ? !0 : void 0, tabIndex: t ? -1 : i || !a.containsCheckedOption && $ ? 0 : -1, autoFocus: u, onClick: t ? void 0 : A }, w, G), F = T(() => ({ checked: i, disabled: t, hover: P, focus: C, autofocus: u }), [i, t, P, C, u]);
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: l,
121
+ classNameRadioWrapper: u,
122
122
  classNameRadioSpan: _,
123
- ...d
124
- }, v) => {
125
- const n = M(
123
+ classNameContentWrapper: v,
124
+ ...c
125
+ }, n) => {
126
+ const m = M(
126
127
  R["radio-wrapper"],
127
- l,
128
+ u,
128
129
  {
129
- [R.disabled]: d.disabled
130
+ [R.disabled]: c.disabled
130
131
  }
131
132
  );
132
133
  return /* @__PURE__ */ ee(
133
134
  Xe,
134
135
  {
135
- ref: v,
136
+ ref: n,
136
137
  value: r,
137
138
  className: R.group,
138
139
  onChange: o,
139
- ...d,
140
+ ...c,
140
141
  children: [
141
142
  a && /* @__PURE__ */ L(V, { as: "p", className: R.label, children: a }),
142
- /* @__PURE__ */ L("div", { className: R["content-wrapper"], children: e.map(({ label: f, value: t }) => /* @__PURE__ */ L(
143
- me,
143
+ /* @__PURE__ */ L(
144
+ "div",
144
145
  {
145
- as: "span",
146
- value: t,
147
- disabled: d.disabled,
148
- className: n,
149
- "data-testid": `radio-option-${t}`,
150
- children: ({ checked: u, disabled: y }) => /* @__PURE__ */ ee(_e, { children: [
151
- /* @__PURE__ */ L(
152
- V,
153
- {
154
- as: "span",
155
- className: M(
156
- R.radio,
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
- [R.disabled]: d.disabled
159
- },
160
- _
161
- ),
162
- children: /* @__PURE__ */ L(
163
- "span",
164
- {
165
- className: M(R.frame, {
166
- [R.checked]: u,
167
- [R.disabled]: y
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
- f
174
- ] })
175
- },
176
- typeof t == "string" ? t : String(t)
177
- )) })
180
+ ),
181
+ l
182
+ ] })
183
+ },
184
+ typeof s == "string" ? s : String(s)
185
+ ))
186
+ }
187
+ )
178
188
  ]
179
189
  }
180
190
  );
@@ -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-DzVMAmli.js";
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
- "fill-rule": "evenodd",
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
- "fill-rule": "evenodd",
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"