mimir-ui-kit 1.38.31 → 1.38.33
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/assets/NotificationBadge.css +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.js +19 -18
- package/dist/components/NotificationBadge/constants.d.ts +2 -1
- package/dist/components/NotificationBadge/constants.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.js +84 -74
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
._notification-
|
1
|
+
._notification-badge_jhn37_2{position:relative;display:flex;align-items:center;justify-content:center;width:var(--width-notification-badge);height:var(--height-notification-badge);color:var(--white);font-size:var(--mimir-size-text-notification-badge);background-color:var(--citrine-100);border-radius:50%}._notification-badge-absolute_jhn37_14{position:absolute}._l_jhn37_18{--mimir-size-text-notification-badge: var(--mimir-size-text-l);--width-notification-badge: 32px;--height-notification-badge: 32px}._m_jhn37_24{--mimir-size-text-notification-badge: var(--mimir-size-text-m);--width-notification-badge: 24px;--height-notification-badge: 24px}._s_jhn37_30{--height-notification-badge: 16px;--width-notification-badge: 16px;--mimir-size-text-notification-badge: var(--mimir-size-text-xs)}
|
@@ -1,25 +1,26 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import { c as
|
3
|
-
import { ENotificationBadgeSize as
|
4
|
-
import '../../assets/NotificationBadge.css';const b = "
|
5
|
-
"notification-badge": "_notification-
|
6
|
-
"notification-badge-absolute": "_notification-badge-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
2
|
+
import { c as l } from "../../index-DIxK0V-G.js";
|
3
|
+
import { ENotificationBadgeSize as m } from "./constants.js";
|
4
|
+
import '../../assets/NotificationBadge.css';const b = "_l_jhn37_18", d = "_m_jhn37_24", g = "_s_jhn37_30", t = {
|
5
|
+
"notification-badge": "_notification-badge_jhn37_2",
|
6
|
+
"notification-badge-absolute": "_notification-badge-absolute_jhn37_14",
|
7
|
+
l: b,
|
8
|
+
m: d,
|
9
|
+
s: g
|
10
|
+
}, n = ({
|
11
|
+
count: e,
|
11
12
|
position: a,
|
12
13
|
absolute: c,
|
13
|
-
size:
|
14
|
-
}) => /* @__PURE__ */
|
14
|
+
size: _ = m.M
|
15
|
+
}) => /* @__PURE__ */ f(
|
15
16
|
"div",
|
16
17
|
{
|
17
|
-
className:
|
18
|
-
|
18
|
+
className: l(
|
19
|
+
t["notification-badge"],
|
19
20
|
{
|
20
|
-
[
|
21
|
+
[t["notification-badge-absolute"]]: c
|
21
22
|
},
|
22
|
-
|
23
|
+
t[_]
|
23
24
|
),
|
24
25
|
style: {
|
25
26
|
top: a == null ? void 0 : a.top,
|
@@ -27,9 +28,9 @@ import '../../assets/NotificationBadge.css';const b = "_m_ugqfj_18", d = "_s_ugq
|
|
27
28
|
bottom: a == null ? void 0 : a.bottom,
|
28
29
|
left: a == null ? void 0 : a.left
|
29
30
|
},
|
30
|
-
children:
|
31
|
+
children: e
|
31
32
|
}
|
32
33
|
);
|
33
34
|
export {
|
34
|
-
|
35
|
+
n as NotificationBadge
|
35
36
|
};
|
@@ -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
|
);
|