mimir-ui-kit 1.62.0 → 1.64.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.
- package/dist/Input-CqNPT8os.js +243 -0
- package/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.js +242 -220
- package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
- package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
- package/dist/components/Button/Button.d.ts +37 -0
- package/dist/components/Button/Button.js +77 -61
- package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
- package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Drawer/Drawer.d.ts +5 -0
- package/dist/components/Drawer/Drawer.js +141 -135
- package/dist/components/GosZnak/GosZnak.d.ts +1 -1
- package/dist/components/GosZnak/GosZnak.js +88 -67
- package/dist/components/GosZnak/types.d.ts +5 -0
- package/dist/components/Image/Image.d.ts +5 -0
- package/dist/components/Image/Image.js +55 -50
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.d.ts +5 -0
- package/dist/components/InputPassword/InputPassword.js +80 -69
- package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
- package/dist/components/Loader/Loader.d.ts +6 -1
- package/dist/components/Loader/Loader.js +37 -14
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
- package/dist/components/RadioGroup/RadioGroup.js +142 -129
- package/dist/components/SelectSearch/SelectSearch.d.ts +1 -0
- package/dist/components/SelectSearch/SelectSearch.js +299 -277
- package/dist/components/SelectSearch/types.d.ts +5 -0
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TextArea/TextArea.d.ts +1 -1
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/TextAreaV2/TextArea.js +155 -142
- package/dist/components/TextAreaV2/types.d.ts +5 -0
- package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
- package/dist/components/UniversalUploader/UniversalUploader.js +92 -88
- package/dist/components/UniversalUploader/types.d.ts +5 -0
- package/dist/components/Uploader/Uploader.d.ts +7 -2
- package/dist/components/Uploader/Uploader.js +121 -90
- package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
- package/dist/components/UploaderFiles/types.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
- package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
- package/dist/components/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/types/dataTestId.d.ts +1 -0
- package/dist/types/dataTestId.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/Input-DPnH8pKc.js +0 -227
|
@@ -1,187 +1,200 @@
|
|
|
1
|
-
import { jsxs as ee, jsx as
|
|
2
|
-
import { K
|
|
3
|
-
import { W as
|
|
4
|
-
import
|
|
5
|
-
import { u as
|
|
1
|
+
import { jsxs as ee, jsx as U, Fragment as ke } from "react/jsx-runtime";
|
|
2
|
+
import { K, w as Oe, a as ie, z as ne, U as ae, b as we, T as ye, j as Pe, u as Ee, I as De, G as Re, p as Ce } from "../../label-BmphTIGY.js";
|
|
3
|
+
import { W as q, y as B, o as j, H as J, s as te, n as le, $ as se, b as ue, D as de, a as Ge, u as xe, c as N } from "../../keyboard-wis2TUql.js";
|
|
4
|
+
import D, { createContext as ce, useId as X, useReducer as ze, useRef as Q, useMemo as R, useCallback as Fe, useContext as pe, forwardRef as Ne } from "react";
|
|
5
|
+
import { u as Ae } from "../../use-by-comparator-CVuf9KBq.js";
|
|
6
6
|
import { r as fe } from "../../bugs-diTMAGNw.js";
|
|
7
|
-
import { P as re, F as
|
|
8
|
-
import { c as
|
|
9
|
-
import '../../assets/RadioGroup.css';var
|
|
10
|
-
let
|
|
11
|
-
let
|
|
12
|
-
return { ...e, options:
|
|
13
|
-
}, 1(e,
|
|
14
|
-
let
|
|
15
|
-
return
|
|
16
|
-
} },
|
|
17
|
-
|
|
18
|
-
function
|
|
19
|
-
let
|
|
20
|
-
if (
|
|
21
|
-
let
|
|
22
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
7
|
+
import { P as re, F as W, T as oe, _ as Se } from "../../focus-management-BAl0GmRk.js";
|
|
8
|
+
import { c as V } from "../../index-DIxK0V-G.js";
|
|
9
|
+
import '../../assets/RadioGroup.css';var Le = ((e) => (e[e.RegisterOption = 0] = "RegisterOption", e[e.UnregisterOption = 1] = "UnregisterOption", e))(Le || {});
|
|
10
|
+
let Ue = { 0(e, o) {
|
|
11
|
+
let n = [...e.options, { id: o.id, element: o.element, propsRef: o.propsRef }];
|
|
12
|
+
return { ...e, options: Se(n, (i) => i.element.current) };
|
|
13
|
+
}, 1(e, o) {
|
|
14
|
+
let n = e.options.slice(), i = e.options.findIndex((d) => d.id === o.id);
|
|
15
|
+
return i === -1 ? e : (n.splice(i, 1), { ...e, options: n });
|
|
16
|
+
} }, Y = ce(null);
|
|
17
|
+
Y.displayName = "RadioGroupDataContext";
|
|
18
|
+
function Z(e) {
|
|
19
|
+
let o = pe(Y);
|
|
20
|
+
if (o === null) {
|
|
21
|
+
let n = new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);
|
|
22
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, Z), n;
|
|
23
23
|
}
|
|
24
|
-
return
|
|
24
|
+
return o;
|
|
25
25
|
}
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
let
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
26
|
+
let T = ce(null);
|
|
27
|
+
T.displayName = "RadioGroupActionsContext";
|
|
28
|
+
function I(e) {
|
|
29
|
+
let o = pe(T);
|
|
30
|
+
if (o === null) {
|
|
31
|
+
let n = new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);
|
|
32
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, I), n;
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return o;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
36
|
+
function je(e, o) {
|
|
37
|
+
return Ge(o.type, Ue, e, o);
|
|
38
38
|
}
|
|
39
|
-
let
|
|
40
|
-
function
|
|
41
|
-
let
|
|
42
|
-
var
|
|
43
|
-
if (
|
|
44
|
-
let
|
|
45
|
-
return
|
|
46
|
-
}), be =
|
|
47
|
-
let
|
|
48
|
-
if (!
|
|
49
|
-
let
|
|
50
|
-
switch (
|
|
51
|
-
case
|
|
52
|
-
|
|
39
|
+
let He = "div";
|
|
40
|
+
function We(e, o) {
|
|
41
|
+
let n = X(), i = ie(), { id: d = `headlessui-radiogroup-${n}`, value: w, form: h, name: r, onChange: a, by: m, disabled: s = i || !1, defaultValue: c, ...v } = e, u = Ae(m), [g, C] = ze(je, { options: [] }), p = g.options, [y, A] = ne(), [G, P] = ae(), E = Q(null), x = B(E, o), k = we(c), [t, z] = ye(w, a, k), F = R(() => p.find((l) => !l.propsRef.current.disabled), [p]), O = R(() => p.some((l) => u(l.propsRef.current.value, t)), [p, t]), f = j((l) => {
|
|
42
|
+
var S;
|
|
43
|
+
if (s || u(l, t)) return !1;
|
|
44
|
+
let _ = (S = p.find((H) => u(H.propsRef.current.value, l))) == null ? void 0 : S.propsRef.current;
|
|
45
|
+
return _ != null && _.disabled ? !1 : (z == null || z(l), !0);
|
|
46
|
+
}), be = j((l) => {
|
|
47
|
+
let S = E.current;
|
|
48
|
+
if (!S) return;
|
|
49
|
+
let _ = xe(S), H = p.filter((b) => b.propsRef.current.disabled === !1).map((b) => b.element.current);
|
|
50
|
+
switch (l.key) {
|
|
51
|
+
case N.Enter:
|
|
52
|
+
Ce(l.currentTarget);
|
|
53
53
|
break;
|
|
54
|
-
case
|
|
55
|
-
case
|
|
56
|
-
if (
|
|
57
|
-
let b = p.find((
|
|
54
|
+
case N.ArrowLeft:
|
|
55
|
+
case N.ArrowUp:
|
|
56
|
+
if (l.preventDefault(), l.stopPropagation(), re(H, W.Previous | W.WrapAround) === oe.Success) {
|
|
57
|
+
let b = p.find((L) => L.element.current === (_ == null ? void 0 : _.activeElement));
|
|
58
58
|
b && f(b.propsRef.current.value);
|
|
59
59
|
}
|
|
60
60
|
break;
|
|
61
|
-
case
|
|
62
|
-
case
|
|
63
|
-
if (
|
|
64
|
-
let b = p.find((
|
|
61
|
+
case N.ArrowRight:
|
|
62
|
+
case N.ArrowDown:
|
|
63
|
+
if (l.preventDefault(), l.stopPropagation(), re(H, W.Next | W.WrapAround) === oe.Success) {
|
|
64
|
+
let b = p.find((L) => L.element.current === (_ == null ? void 0 : _.activeElement));
|
|
65
65
|
b && f(b.propsRef.current.value);
|
|
66
66
|
}
|
|
67
67
|
break;
|
|
68
|
-
case
|
|
68
|
+
case N.Space:
|
|
69
69
|
{
|
|
70
|
-
|
|
71
|
-
let b = p.find((
|
|
70
|
+
l.preventDefault(), l.stopPropagation();
|
|
71
|
+
let b = p.find((L) => L.element.current === (_ == null ? void 0 : _.activeElement));
|
|
72
72
|
b && f(b.propsRef.current.value);
|
|
73
73
|
}
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
|
-
}),
|
|
77
|
-
if (
|
|
78
|
-
}, [f,
|
|
79
|
-
return
|
|
76
|
+
}), M = j((l) => (C({ type: 0, ...l }), () => C({ type: 1, id: l.id }))), ve = R(() => ({ value: t, firstOption: F, containsCheckedOption: O, disabled: s, compare: u, ...g }), [t, F, O, s, u, g]), he = R(() => ({ registerOption: M, change: f }), [M, f]), $e = { ref: x, id: d, role: "radiogroup", "aria-labelledby": y, "aria-describedby": G, onKeyDown: be }, ge = R(() => ({ value: t }), [t]), _e = Fe(() => {
|
|
77
|
+
if (k !== void 0) return f(k);
|
|
78
|
+
}, [f, k]);
|
|
79
|
+
return D.createElement(P, { name: "RadioGroup.Description" }, D.createElement(A, { name: "RadioGroup.Label" }, D.createElement(T.Provider, { value: he }, D.createElement(Y.Provider, { value: ve }, r != null && D.createElement(Pe, { disabled: s, data: { [r]: t || "on" }, overrides: { type: "radio", checked: t != null }, form: h, onReset: _e }), J({ ourProps: $e, theirProps: v, slot: ge, defaultTag: He, name: "RadioGroup" })))));
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
function
|
|
83
|
-
var
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
let
|
|
81
|
+
let Ve = "div";
|
|
82
|
+
function Ke(e, o) {
|
|
83
|
+
var n;
|
|
84
|
+
let i = Z("RadioGroup.Option"), d = I("RadioGroup.Option"), w = X(), { id: h = `headlessui-radiogroup-option-${w}`, value: r, disabled: a = i.disabled || !1, autoFocus: m = !1, ...s } = e, c = Q(null), v = B(c, o), [u, g] = ne(), [C, p] = ae(), y = te({ value: r, disabled: a });
|
|
85
|
+
le(() => d.registerOption({ id: h, element: c, propsRef: y }), [h, d, c, y]);
|
|
86
|
+
let A = j((O) => {
|
|
87
87
|
var f;
|
|
88
|
-
if (fe(
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
return
|
|
88
|
+
if (fe(O.currentTarget)) return O.preventDefault();
|
|
89
|
+
d.change(r) && ((f = c.current) == null || f.focus());
|
|
90
|
+
}), G = ((n = i.firstOption) == null ? void 0 : n.id) === h, { isFocusVisible: P, focusProps: E } = se({ autoFocus: m }), { isHovered: x, hoverProps: k } = ue({ isDisabled: a }), t = i.compare(i.value, r), z = de({ ref: v, id: h, role: "radio", "aria-checked": t ? "true" : "false", "aria-labelledby": u, "aria-describedby": C, "aria-disabled": a ? !0 : void 0, tabIndex: a ? -1 : t || !i.containsCheckedOption && G ? 0 : -1, onClick: a ? void 0 : A, autoFocus: m }, E, k), F = R(() => ({ checked: t, disabled: a, active: P, hover: x, focus: P, autofocus: m }), [t, a, x, P, m]);
|
|
91
|
+
return D.createElement(p, { name: "RadioGroup.Description" }, D.createElement(g, { name: "RadioGroup.Label" }, J({ ourProps: z, theirProps: s, slot: F, defaultTag: Ve, name: "RadioGroup.Option" })));
|
|
92
92
|
}
|
|
93
|
-
let
|
|
94
|
-
function
|
|
95
|
-
var
|
|
96
|
-
let
|
|
97
|
-
|
|
98
|
-
let
|
|
93
|
+
let qe = "span";
|
|
94
|
+
function Be(e, o) {
|
|
95
|
+
var n;
|
|
96
|
+
let i = Z("Radio"), d = I("Radio"), w = X(), h = Ee(), r = ie(), { id: a = h || `headlessui-radio-${w}`, value: m, disabled: s = i.disabled || r || !1, autoFocus: c = !1, ...v } = e, u = Q(null), g = B(u, o), C = De(), p = Re(), y = te({ value: m, disabled: s });
|
|
97
|
+
le(() => d.registerOption({ id: a, element: u, propsRef: y }), [a, d, u, y]);
|
|
98
|
+
let A = j((O) => {
|
|
99
99
|
var f;
|
|
100
|
-
if (fe(
|
|
101
|
-
|
|
102
|
-
}), { isFocusVisible:
|
|
103
|
-
return
|
|
100
|
+
if (fe(O.currentTarget)) return O.preventDefault();
|
|
101
|
+
d.change(m) && ((f = u.current) == null || f.focus());
|
|
102
|
+
}), { isFocusVisible: G, focusProps: P } = se({ autoFocus: c }), { isHovered: E, hoverProps: x } = ue({ isDisabled: s }), k = ((n = i.firstOption) == null ? void 0 : n.id) === a, t = i.compare(i.value, m), z = de({ ref: g, id: a, role: "radio", "aria-checked": t ? "true" : "false", "aria-labelledby": C, "aria-describedby": p, "aria-disabled": s ? !0 : void 0, tabIndex: s ? -1 : t || !i.containsCheckedOption && k ? 0 : -1, autoFocus: c, onClick: s ? void 0 : A }, P, x), F = R(() => ({ checked: t, disabled: s, hover: E, focus: G, autofocus: c }), [t, s, E, G, c]);
|
|
103
|
+
return J({ ourProps: z, theirProps: v, slot: F, defaultTag: qe, name: "Radio" });
|
|
104
104
|
}
|
|
105
|
-
let
|
|
106
|
-
const
|
|
107
|
-
group:
|
|
105
|
+
let Je = q(We), Xe = q(Ke), me = q(Be), Qe = K, Ye = Oe, Ze = Object.assign(Je, { Option: Xe, Radio: me, Label: Qe, Description: Ye });
|
|
106
|
+
const Te = "_group_po2hz_2", Ie = "_radio_po2hz_17", Me = "_disabled_po2hz_39", er = "_label_po2hz_50", rr = "_frame_po2hz_63", or = "_checked_po2hz_72", $ = {
|
|
107
|
+
group: Te,
|
|
108
108
|
"content-wrapper": "_content-wrapper_po2hz_7",
|
|
109
109
|
"radio-wrapper": "_radio-wrapper_po2hz_17",
|
|
110
|
-
radio:
|
|
111
|
-
disabled:
|
|
110
|
+
radio: Ie,
|
|
111
|
+
disabled: Me,
|
|
112
112
|
label: er,
|
|
113
113
|
frame: rr,
|
|
114
|
-
checked:
|
|
115
|
-
}, cr =
|
|
114
|
+
checked: or
|
|
115
|
+
}, cr = Ne(
|
|
116
116
|
({
|
|
117
117
|
options: e,
|
|
118
|
-
value:
|
|
119
|
-
onChange:
|
|
120
|
-
label:
|
|
121
|
-
classNameRadioWrapper:
|
|
122
|
-
classNameRadioSpan:
|
|
123
|
-
classNameContentWrapper:
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
118
|
+
value: o,
|
|
119
|
+
onChange: n,
|
|
120
|
+
label: i,
|
|
121
|
+
classNameRadioWrapper: d,
|
|
122
|
+
classNameRadioSpan: w,
|
|
123
|
+
classNameContentWrapper: h,
|
|
124
|
+
dataTestIdReactMap: r,
|
|
125
|
+
...a
|
|
126
|
+
}, m) => {
|
|
127
|
+
const s = V(
|
|
128
|
+
$["radio-wrapper"],
|
|
129
|
+
d,
|
|
129
130
|
{
|
|
130
|
-
[
|
|
131
|
+
[$.disabled]: a.disabled
|
|
131
132
|
}
|
|
132
133
|
);
|
|
133
134
|
return /* @__PURE__ */ ee(
|
|
134
|
-
|
|
135
|
+
Ze,
|
|
135
136
|
{
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
"data-testid-react": r == null ? void 0 : r.group,
|
|
138
|
+
ref: m,
|
|
139
|
+
value: o,
|
|
140
|
+
className: $.group,
|
|
141
|
+
onChange: n,
|
|
142
|
+
...a,
|
|
141
143
|
children: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
+
i && /* @__PURE__ */ U(
|
|
145
|
+
K,
|
|
146
|
+
{
|
|
147
|
+
"data-testid-react": r == null ? void 0 : r.label,
|
|
148
|
+
as: "p",
|
|
149
|
+
className: $.label,
|
|
150
|
+
children: i
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ U(
|
|
144
154
|
"div",
|
|
145
155
|
{
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
"data-testid-react": r == null ? void 0 : r.contentWrapper,
|
|
157
|
+
className: V(
|
|
158
|
+
$["content-wrapper"],
|
|
159
|
+
h
|
|
149
160
|
),
|
|
150
|
-
children: e.map(({ label:
|
|
161
|
+
children: e.map(({ label: c, value: v }) => /* @__PURE__ */ U(
|
|
151
162
|
me,
|
|
152
163
|
{
|
|
164
|
+
"data-testid-react": r == null ? void 0 : r.radio,
|
|
153
165
|
as: "span",
|
|
154
|
-
value:
|
|
155
|
-
disabled:
|
|
156
|
-
className:
|
|
157
|
-
"data-testid": `radio-option-${
|
|
158
|
-
children: ({ checked:
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
166
|
+
value: v,
|
|
167
|
+
disabled: a.disabled,
|
|
168
|
+
className: s,
|
|
169
|
+
"data-testid": `radio-option-${v}`,
|
|
170
|
+
children: ({ checked: u, disabled: g }) => /* @__PURE__ */ ee(ke, { children: [
|
|
171
|
+
/* @__PURE__ */ U(
|
|
172
|
+
K,
|
|
161
173
|
{
|
|
162
174
|
as: "span",
|
|
163
|
-
className:
|
|
164
|
-
|
|
175
|
+
className: V(
|
|
176
|
+
$.radio,
|
|
165
177
|
{
|
|
166
|
-
[
|
|
178
|
+
[$.disabled]: a.disabled
|
|
167
179
|
},
|
|
168
|
-
|
|
180
|
+
w
|
|
169
181
|
),
|
|
170
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ U(
|
|
171
183
|
"span",
|
|
172
184
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
[
|
|
185
|
+
"data-testid-react": r == null ? void 0 : r.frame,
|
|
186
|
+
className: V($.frame, {
|
|
187
|
+
[$.checked]: u,
|
|
188
|
+
[$.disabled]: g
|
|
176
189
|
})
|
|
177
190
|
}
|
|
178
191
|
)
|
|
179
192
|
}
|
|
180
193
|
),
|
|
181
|
-
|
|
194
|
+
c
|
|
182
195
|
] })
|
|
183
196
|
},
|
|
184
|
-
typeof
|
|
197
|
+
typeof v == "string" ? v : String(v)
|
|
185
198
|
))
|
|
186
199
|
}
|
|
187
200
|
)
|
|
@@ -34,4 +34,5 @@ export declare const SelectSearch: import('react').ForwardRefExoticComponent<Pic
|
|
|
34
34
|
highlightMatches?: boolean;
|
|
35
35
|
searchInHeaderGroupItems?: boolean;
|
|
36
36
|
isModal?: boolean;
|
|
37
|
+
dataTestIdReactMap?: import('../..').TDataTestIdReactMap<"selectSearch" | "container" | "input" | "options" | "option" | "groupHeader" | "clearButton" | "loadingIndicator">;
|
|
37
38
|
} & import('react').RefAttributes<HTMLElement>>;
|