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,228 +1,232 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
import { AccordionItem as
|
|
5
|
-
import { EAccordionButtonType as
|
|
6
|
-
import { useMediaQuery as
|
|
7
|
-
import { EMediaQuery as
|
|
8
|
-
import { Icon as
|
|
9
|
-
import { Link as
|
|
10
|
-
import { M as
|
|
11
|
-
import { w as
|
|
12
|
-
import { e as
|
|
13
|
-
import { c as
|
|
14
|
-
import { C as
|
|
15
|
-
import { r as
|
|
16
|
-
import '../../assets/Accordion.css';var
|
|
17
|
-
let
|
|
1
|
+
import { jsxs as U, Fragment as K, jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import { c as w } from "../../index-DIxK0V-G.js";
|
|
3
|
+
import k, { createContext as X, useRef as pe, Fragment as ae, useReducer as ve, useMemo as j, useId as fe, useEffect as G, useState as de, useContext as I, forwardRef as ye } from "react";
|
|
4
|
+
import { AccordionItem as he } from "./AccordionItem/AccordionItem.js";
|
|
5
|
+
import { EAccordionButtonType as A, EAccordionContentPosition as L, EAccordionSize as q, EAccordionLinkIconSize as le, EAccordionButtonStyle as ke, EAccordionIconType as ie, EAccordionButtonIconSize as se } from "./constants.js";
|
|
6
|
+
import { useMediaQuery as Oe } from "../../hooks/useMediaQuery/useMediaQuery.js";
|
|
7
|
+
import { EMediaQuery as Be } from "../../hooks/useMediaQuery/constants.js";
|
|
8
|
+
import { Icon as we } from "../../icons/Icon.js";
|
|
9
|
+
import { Link as Ce } from "../AnchorLink/Link.js";
|
|
10
|
+
import { M as ce, W as J, y as Y, T as Ne, o as C, a as Z, H as T, I as _e, $ as Ae, b as Le, D as ue, u as Fe, c as F } from "../../keyboard-wis2TUql.js";
|
|
11
|
+
import { w as He } from "../../use-active-press-CnDeVvQq.js";
|
|
12
|
+
import { e as Ue } from "../../use-resolve-button-type-DhFdPxnv.js";
|
|
13
|
+
import { c as qe, i as W, u as je, R as We, H as Qe, s as Ve } from "../../open-closed-CJijMeI2.js";
|
|
14
|
+
import { C as ze } from "../../close-provider-CEutdhG8.js";
|
|
15
|
+
import { r as Ke } from "../../bugs-diTMAGNw.js";
|
|
16
|
+
import '../../assets/Accordion.css';var me;
|
|
17
|
+
let Xe = (me = k.startTransition) != null ? me : function(e) {
|
|
18
18
|
e();
|
|
19
19
|
};
|
|
20
|
-
var
|
|
21
|
-
let
|
|
22
|
-
return e.buttonId ===
|
|
23
|
-
}, 3(e,
|
|
24
|
-
return e.panelId ===
|
|
25
|
-
}, 4(e,
|
|
26
|
-
return e.buttonElement ===
|
|
27
|
-
}, 5(e,
|
|
28
|
-
return e.panelElement ===
|
|
29
|
-
} },
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
let
|
|
33
|
-
if (
|
|
34
|
-
let
|
|
35
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
20
|
+
var Ge = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Ge || {}), Ie = ((e) => (e[e.ToggleDisclosure = 0] = "ToggleDisclosure", e[e.CloseDisclosure = 1] = "CloseDisclosure", e[e.SetButtonId = 2] = "SetButtonId", e[e.SetPanelId = 3] = "SetPanelId", e[e.SetButtonElement = 4] = "SetButtonElement", e[e.SetPanelElement = 5] = "SetPanelElement", e))(Ie || {});
|
|
21
|
+
let Je = { 0: (e) => ({ ...e, disclosureState: Z(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, n) {
|
|
22
|
+
return e.buttonId === n.buttonId ? e : { ...e, buttonId: n.buttonId };
|
|
23
|
+
}, 3(e, n) {
|
|
24
|
+
return e.panelId === n.panelId ? e : { ...e, panelId: n.panelId };
|
|
25
|
+
}, 4(e, n) {
|
|
26
|
+
return e.buttonElement === n.element ? e : { ...e, buttonElement: n.element };
|
|
27
|
+
}, 5(e, n) {
|
|
28
|
+
return e.panelElement === n.element ? e : { ...e, panelElement: n.element };
|
|
29
|
+
} }, M = X(null);
|
|
30
|
+
M.displayName = "DisclosureContext";
|
|
31
|
+
function R(e) {
|
|
32
|
+
let n = I(M);
|
|
33
|
+
if (n === null) {
|
|
34
|
+
let a = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
|
35
|
+
throw Error.captureStackTrace && Error.captureStackTrace(a, R), a;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return n;
|
|
38
38
|
}
|
|
39
|
-
let ee =
|
|
39
|
+
let ee = X(null);
|
|
40
40
|
ee.displayName = "DisclosureAPIContext";
|
|
41
41
|
function Ee(e) {
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
44
|
-
let
|
|
45
|
-
throw Error.captureStackTrace && Error.captureStackTrace(
|
|
42
|
+
let n = I(ee);
|
|
43
|
+
if (n === null) {
|
|
44
|
+
let a = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
|
45
|
+
throw Error.captureStackTrace && Error.captureStackTrace(a, Ee), a;
|
|
46
46
|
}
|
|
47
|
-
return
|
|
47
|
+
return n;
|
|
48
48
|
}
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
return
|
|
49
|
+
let ne = X(null);
|
|
50
|
+
ne.displayName = "DisclosurePanelContext";
|
|
51
|
+
function Ye() {
|
|
52
|
+
return I(ne);
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
return
|
|
54
|
+
function Ze(e, n) {
|
|
55
|
+
return Z(n.type, Je, e, n);
|
|
56
56
|
}
|
|
57
|
-
let
|
|
58
|
-
function
|
|
59
|
-
let { defaultOpen:
|
|
60
|
-
|
|
61
|
-
}, e.as === void 0 || e.as ===
|
|
62
|
-
|
|
63
|
-
let
|
|
64
|
-
if (!
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
}),
|
|
68
|
-
return
|
|
57
|
+
let Te = ae;
|
|
58
|
+
function Me(e, n) {
|
|
59
|
+
let { defaultOpen: a = !1, ...f } = e, u = pe(null), d = Y(n, Ne((p) => {
|
|
60
|
+
u.current = p;
|
|
61
|
+
}, e.as === void 0 || e.as === ae)), m = ve(Ze, { disclosureState: a ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: r, buttonId: l }, x] = m, s = C((p) => {
|
|
62
|
+
x({ type: 1 });
|
|
63
|
+
let _ = Fe(u);
|
|
64
|
+
if (!_ || !l) return;
|
|
65
|
+
let g = p ? p instanceof HTMLElement ? p : p.current instanceof HTMLElement ? p.current : _.getElementById(l) : _.getElementById(l);
|
|
66
|
+
g == null || g.focus();
|
|
67
|
+
}), v = j(() => ({ close: s }), [s]), D = j(() => ({ open: r === 0, close: s }), [r, s]), P = { ref: d };
|
|
68
|
+
return k.createElement(M.Provider, { value: m }, k.createElement(ee.Provider, { value: v }, k.createElement(ze, { value: s }, k.createElement(qe, { value: Z(r, { 0: W.Open, 1: W.Closed }) }, T({ ourProps: P, theirProps: f, slot: D, defaultTag: Te, name: "Disclosure" })))));
|
|
69
69
|
}
|
|
70
|
-
let
|
|
71
|
-
function
|
|
72
|
-
let
|
|
73
|
-
if (!
|
|
74
|
-
})),
|
|
75
|
-
|
|
76
|
-
if (!
|
|
70
|
+
let Re = "button";
|
|
71
|
+
function en(e, n) {
|
|
72
|
+
let a = fe(), { id: f = `headlessui-disclosure-button-${a}`, disabled: u = !1, autoFocus: d = !1, ...m } = e, [r, l] = R("Disclosure.Button"), x = Ye(), s = x === null ? !1 : x === r.panelId, v = pe(null), D = Y(v, n, C((c) => {
|
|
73
|
+
if (!s) return l({ type: 4, element: c });
|
|
74
|
+
})), P = _e();
|
|
75
|
+
G(() => {
|
|
76
|
+
if (!s) return l({ type: 2, buttonId: f }), () => {
|
|
77
77
|
l({ type: 2, buttonId: null });
|
|
78
78
|
};
|
|
79
|
-
}, [
|
|
80
|
-
let
|
|
81
|
-
var
|
|
82
|
-
if (
|
|
83
|
-
if (
|
|
84
|
-
switch (
|
|
85
|
-
case
|
|
86
|
-
case
|
|
87
|
-
|
|
79
|
+
}, [f, l, s]);
|
|
80
|
+
let p = C((c) => {
|
|
81
|
+
var b;
|
|
82
|
+
if (s) {
|
|
83
|
+
if (r.disclosureState === 1) return;
|
|
84
|
+
switch (c.key) {
|
|
85
|
+
case F.Space:
|
|
86
|
+
case F.Enter:
|
|
87
|
+
c.preventDefault(), c.stopPropagation(), l({ type: 0 }), (b = r.buttonElement) == null || b.focus();
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
|
-
} else switch (
|
|
91
|
-
case
|
|
92
|
-
case
|
|
93
|
-
|
|
90
|
+
} else switch (c.key) {
|
|
91
|
+
case F.Space:
|
|
92
|
+
case F.Enter:
|
|
93
|
+
c.preventDefault(), c.stopPropagation(), l({ type: 0 });
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
97
|
-
switch (
|
|
98
|
-
case
|
|
99
|
-
|
|
96
|
+
}), _ = C((c) => {
|
|
97
|
+
switch (c.key) {
|
|
98
|
+
case F.Space:
|
|
99
|
+
c.preventDefault();
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
|
-
}),
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
}), { isFocusVisible:
|
|
106
|
-
return
|
|
102
|
+
}), g = C((c) => {
|
|
103
|
+
var b;
|
|
104
|
+
Ke(c.currentTarget) || u || (s ? (l({ type: 0 }), (b = r.buttonElement) == null || b.focus()) : l({ type: 0 }));
|
|
105
|
+
}), { isFocusVisible: E, focusProps: O } = Ae({ autoFocus: d }), { isHovered: B, hoverProps: H } = Le({ isDisabled: u }), { pressed: y, pressProps: o } = He({ disabled: u }), Q = j(() => ({ open: r.disclosureState === 0, hover: B, active: y, disabled: u, focus: E, autofocus: d }), [r, B, y, E, u, d]), h = Ue(e, r.buttonElement), V = s ? ue({ ref: D, type: h, disabled: u || void 0, autoFocus: d, onKeyDown: p, onClick: g }, O, H, o) : ue({ ref: D, id: f, type: h, "aria-expanded": r.disclosureState === 0, "aria-controls": r.panelElement ? r.panelId : void 0, disabled: u || void 0, autoFocus: d, onKeyDown: p, onKeyUp: _, onClick: g }, O, H, o);
|
|
106
|
+
return T({ mergeRefs: P, ourProps: V, theirProps: m, slot: Q, defaultTag: Re, name: "Disclosure.Button" });
|
|
107
107
|
}
|
|
108
|
-
let
|
|
109
|
-
function
|
|
110
|
-
let
|
|
111
|
-
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}), [
|
|
116
|
-
let
|
|
117
|
-
return
|
|
108
|
+
let nn = "div", on = ce.RenderStrategy | ce.Static;
|
|
109
|
+
function rn(e, n) {
|
|
110
|
+
let a = fe(), { id: f = `headlessui-disclosure-panel-${a}`, transition: u = !1, ...d } = e, [m, r] = R("Disclosure.Panel"), { close: l } = Ee("Disclosure.Panel"), x = _e(), [s, v] = de(null), D = Y(n, C((O) => {
|
|
111
|
+
Xe(() => r({ type: 5, element: O }));
|
|
112
|
+
}), v);
|
|
113
|
+
G(() => (r({ type: 3, panelId: f }), () => {
|
|
114
|
+
r({ type: 3, panelId: null });
|
|
115
|
+
}), [f, r]);
|
|
116
|
+
let P = je(), [p, _] = We(u, s, P !== null ? (P & W.Open) === W.Open : m.disclosureState === 0), g = j(() => ({ open: m.disclosureState === 0, close: l }), [m.disclosureState, l]), E = { ref: D, id: f, ...Qe(_) };
|
|
117
|
+
return k.createElement(Ve, null, k.createElement(ne.Provider, { value: m.panelId }, T({ mergeRefs: x, ourProps: E, theirProps: d, slot: g, defaultTag: nn, features: on, visible: p, name: "Disclosure.Panel" })));
|
|
118
118
|
}
|
|
119
|
-
let
|
|
120
|
-
const
|
|
121
|
-
icon:
|
|
119
|
+
let tn = J(Me), be = J(en), ge = J(rn), ln = Object.assign(tn, { Button: be, Panel: ge });
|
|
120
|
+
const sn = "_icon_1x2lg_2", cn = "_open_1x2lg_15", un = "_square_1x2lg_19", mn = "_circle_1x2lg_23", pn = "_disabled_1x2lg_23", an = "_accordion_1x2lg_37", fn = "_button_1x2lg_49", dn = "_header_1x2lg_53", _n = "_title_1x2lg_69", En = "_panel_1x2lg_96", bn = "_m_1x2lg_133", gn = "_s_1x2lg_19", i = {
|
|
121
|
+
icon: sn,
|
|
122
122
|
"icon-container": "_icon-container_1x2lg_8",
|
|
123
|
-
open:
|
|
124
|
-
square:
|
|
125
|
-
circle:
|
|
126
|
-
disabled:
|
|
127
|
-
accordion:
|
|
123
|
+
open: cn,
|
|
124
|
+
square: un,
|
|
125
|
+
circle: mn,
|
|
126
|
+
disabled: pn,
|
|
127
|
+
accordion: an,
|
|
128
128
|
"is-link": "_is-link_1x2lg_41",
|
|
129
129
|
"content-top": "_content-top_1x2lg_44",
|
|
130
|
-
button:
|
|
131
|
-
header:
|
|
132
|
-
title:
|
|
130
|
+
button: fn,
|
|
131
|
+
header: dn,
|
|
132
|
+
title: _n,
|
|
133
133
|
"title-uppercase": "_title-uppercase_1x2lg_72",
|
|
134
|
-
panel:
|
|
134
|
+
panel: En,
|
|
135
135
|
"content-bottom": "_content-bottom_1x2lg_109",
|
|
136
136
|
"link-open": "_link-open_1x2lg_129",
|
|
137
|
-
m:
|
|
138
|
-
s:
|
|
137
|
+
m: bn,
|
|
138
|
+
s: gn,
|
|
139
139
|
"wrapper-button": "_wrapper-button_1x2lg_161"
|
|
140
|
-
},
|
|
140
|
+
}, Ln = ye(
|
|
141
141
|
({
|
|
142
142
|
title: e,
|
|
143
|
-
disabled:
|
|
144
|
-
buttonType:
|
|
145
|
-
children:
|
|
146
|
-
showTitleByDefault:
|
|
147
|
-
linkClassName:
|
|
148
|
-
size:
|
|
149
|
-
titleUppercase:
|
|
150
|
-
buttonStyle: l =
|
|
151
|
-
iconType:
|
|
152
|
-
classNameTitle:
|
|
153
|
-
classNameContent:
|
|
154
|
-
classNameAccordion:
|
|
155
|
-
classNameIconButton:
|
|
156
|
-
subtitleNode:
|
|
157
|
-
onlyOpenSubtitleNode:
|
|
158
|
-
classNameSubtitleContainer:
|
|
159
|
-
activeKey:
|
|
160
|
-
defaultActiveKey:
|
|
161
|
-
onChange:
|
|
162
|
-
needStopPropagation:
|
|
163
|
-
contentPosition:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
[
|
|
143
|
+
disabled: n,
|
|
144
|
+
buttonType: a = A.BUTTON,
|
|
145
|
+
children: f,
|
|
146
|
+
showTitleByDefault: u = !0,
|
|
147
|
+
linkClassName: d,
|
|
148
|
+
size: m = q.M,
|
|
149
|
+
titleUppercase: r,
|
|
150
|
+
buttonStyle: l = ke.CIRCLE,
|
|
151
|
+
iconType: x = ie.ARROW,
|
|
152
|
+
classNameTitle: s,
|
|
153
|
+
classNameContent: v,
|
|
154
|
+
classNameAccordion: D,
|
|
155
|
+
classNameIconButton: P,
|
|
156
|
+
subtitleNode: p,
|
|
157
|
+
onlyOpenSubtitleNode: _,
|
|
158
|
+
classNameSubtitleContainer: g,
|
|
159
|
+
activeKey: E,
|
|
160
|
+
defaultActiveKey: O,
|
|
161
|
+
onChange: B,
|
|
162
|
+
needStopPropagation: H = !1,
|
|
163
|
+
contentPosition: y = L.BOTTOM,
|
|
164
|
+
dataTestIdReactMap: o
|
|
165
|
+
}, Q) => {
|
|
166
|
+
const h = E !== void 0, [V, c] = de(
|
|
167
|
+
() => !!O
|
|
168
|
+
), b = h ? !!E : V, Se = Oe(Be.XS1), N = a === A.LINK, oe = {
|
|
169
|
+
[i["is-link"]]: N
|
|
170
|
+
}, z = {
|
|
171
|
+
[i["content-top"]]: y === L.TOP,
|
|
172
|
+
[i["content-bottom"]]: y === L.BOTTOM
|
|
172
173
|
};
|
|
173
|
-
|
|
174
|
-
h &&
|
|
175
|
-
}, [
|
|
176
|
-
const
|
|
177
|
-
var
|
|
178
|
-
if (
|
|
174
|
+
G(() => {
|
|
175
|
+
h && c(!!E);
|
|
176
|
+
}, [E, h]);
|
|
177
|
+
const xe = (t) => {
|
|
178
|
+
var te;
|
|
179
|
+
if (n)
|
|
179
180
|
return;
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
},
|
|
181
|
+
H && ((te = t == null ? void 0 : t.stopPropagation) == null || te.call(t));
|
|
182
|
+
const S = !b;
|
|
183
|
+
B == null || B(S), h || c(S);
|
|
184
|
+
}, De = m === q.S ? le.S : le.M, Pe = (t) => ({
|
|
184
185
|
variant: "anchor",
|
|
185
|
-
size:
|
|
186
|
+
size: Se ? "s" : "l",
|
|
186
187
|
rightIcon: {
|
|
187
|
-
iconName:
|
|
188
|
-
className:
|
|
189
|
-
[
|
|
188
|
+
iconName: De,
|
|
189
|
+
className: w({
|
|
190
|
+
[i["link-open"]]: t
|
|
190
191
|
})
|
|
191
192
|
}
|
|
192
|
-
}),
|
|
193
|
-
const
|
|
194
|
-
switch (
|
|
195
|
-
case
|
|
193
|
+
}), $e = (t) => {
|
|
194
|
+
const S = () => x === ie.DROPDOWN ? m === q.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : m === q.S ? se.S : se.M;
|
|
195
|
+
switch (a) {
|
|
196
|
+
case A.LINK:
|
|
196
197
|
return e;
|
|
197
|
-
case
|
|
198
|
-
return /* @__PURE__ */
|
|
199
|
-
/* @__PURE__ */
|
|
198
|
+
case A.BUTTON:
|
|
199
|
+
return /* @__PURE__ */ U(K, { children: [
|
|
200
|
+
/* @__PURE__ */ $(
|
|
200
201
|
"span",
|
|
201
202
|
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
"data-testid-react": o == null ? void 0 : o.title,
|
|
204
|
+
className: w(
|
|
205
|
+
i.title,
|
|
206
|
+
s,
|
|
207
|
+
r && i["title-uppercase"]
|
|
206
208
|
),
|
|
207
209
|
children: e
|
|
208
210
|
}
|
|
209
211
|
),
|
|
210
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ $(
|
|
211
213
|
"div",
|
|
212
214
|
{
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
t &&
|
|
217
|
-
|
|
218
|
-
|
|
215
|
+
"data-testid-react": o == null ? void 0 : o.iconContainer,
|
|
216
|
+
className: w(
|
|
217
|
+
i["icon-container"],
|
|
218
|
+
t && i.open,
|
|
219
|
+
n && i.disabled,
|
|
220
|
+
i[l],
|
|
221
|
+
P
|
|
219
222
|
),
|
|
220
223
|
"data-testid": "accordion-icon-container",
|
|
221
|
-
children: /* @__PURE__ */
|
|
222
|
-
|
|
224
|
+
children: /* @__PURE__ */ $(
|
|
225
|
+
we,
|
|
223
226
|
{
|
|
224
|
-
iconName:
|
|
225
|
-
className:
|
|
227
|
+
iconName: S(),
|
|
228
|
+
className: i.icon,
|
|
229
|
+
"data-testid-react": o == null ? void 0 : o.icon,
|
|
226
230
|
"data-testid": "accordion-icon"
|
|
227
231
|
}
|
|
228
232
|
)
|
|
@@ -232,69 +236,87 @@ const lt = "_icon_1x2lg_2", st = "_open_1x2lg_15", ct = "_square_1x2lg_19", at =
|
|
|
232
236
|
default:
|
|
233
237
|
return null;
|
|
234
238
|
}
|
|
235
|
-
},
|
|
236
|
-
|
|
239
|
+
}, re = (t, S) => /* @__PURE__ */ $(
|
|
240
|
+
ge,
|
|
237
241
|
{
|
|
242
|
+
"data-testid-react": o == null ? void 0 : o.panel,
|
|
238
243
|
"data-testid": "accordion-panel",
|
|
239
|
-
className:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
+
className: w(
|
|
245
|
+
i.panel,
|
|
246
|
+
v,
|
|
247
|
+
oe,
|
|
248
|
+
z
|
|
244
249
|
),
|
|
245
|
-
children: /* @__PURE__ */
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
250
|
+
children: /* @__PURE__ */ $(
|
|
251
|
+
he,
|
|
252
|
+
{
|
|
253
|
+
dataTestIdReactMap: { item: o == null ? void 0 : o.contentItem },
|
|
254
|
+
size: m,
|
|
255
|
+
children: typeof f == "function" ? f({
|
|
256
|
+
open: t,
|
|
257
|
+
close: S
|
|
258
|
+
}) : f
|
|
259
|
+
}
|
|
260
|
+
)
|
|
249
261
|
}
|
|
250
262
|
);
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ U(K, { children: [
|
|
264
|
+
/* @__PURE__ */ $(
|
|
253
265
|
"div",
|
|
254
266
|
{
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
267
|
+
"data-testid-react": o == null ? void 0 : o.accordion,
|
|
268
|
+
className: w(
|
|
269
|
+
i.accordion,
|
|
270
|
+
i[m],
|
|
271
|
+
oe,
|
|
272
|
+
D,
|
|
273
|
+
z
|
|
261
274
|
),
|
|
262
|
-
children: /* @__PURE__ */
|
|
263
|
-
|
|
275
|
+
children: /* @__PURE__ */ $(
|
|
276
|
+
ln,
|
|
264
277
|
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
278
|
+
"data-testid-react": o == null ? void 0 : o.disclosure,
|
|
279
|
+
ref: Q,
|
|
280
|
+
defaultOpen: b,
|
|
281
|
+
children: ({ open: t, close: S }) => /* @__PURE__ */ U(K, { children: [
|
|
282
|
+
y === L.TOP && t && re(t, S),
|
|
283
|
+
(!t || u) && /* @__PURE__ */ $(
|
|
284
|
+
be,
|
|
271
285
|
{
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
[
|
|
278
|
-
[
|
|
286
|
+
"data-testid-react": o == null ? void 0 : o.button,
|
|
287
|
+
disabled: n,
|
|
288
|
+
as: N ? Ce : A.BUTTON,
|
|
289
|
+
onClick: xe,
|
|
290
|
+
className: w(i.button, z, {
|
|
291
|
+
[i.header]: !N,
|
|
292
|
+
[i.disabled]: n,
|
|
293
|
+
[d ?? ""]: N && d
|
|
279
294
|
}),
|
|
280
|
-
...
|
|
281
|
-
children: (!
|
|
295
|
+
...N ? Pe(t) : {},
|
|
296
|
+
children: (!t || u) && $e(t)
|
|
282
297
|
}
|
|
283
298
|
),
|
|
284
|
-
|
|
299
|
+
y === L.BOTTOM && t && re(t, S)
|
|
285
300
|
] })
|
|
286
301
|
},
|
|
287
|
-
|
|
302
|
+
E ? String(b) : void 0
|
|
288
303
|
)
|
|
289
304
|
}
|
|
290
305
|
),
|
|
291
|
-
(
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
306
|
+
(p || _) && /* @__PURE__ */ U(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
"data-testid-react": o == null ? void 0 : o.subtitleContainer,
|
|
310
|
+
className: g,
|
|
311
|
+
children: [
|
|
312
|
+
p,
|
|
313
|
+
b && _
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
)
|
|
295
317
|
] });
|
|
296
318
|
}
|
|
297
319
|
);
|
|
298
320
|
export {
|
|
299
|
-
|
|
321
|
+
Ln as Accordion
|
|
300
322
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { TDataTestIdReactMap } from '../../../types';
|
|
2
3
|
import { EAccordionSize } from '../constants';
|
|
3
4
|
|
|
4
5
|
export type TProps = {
|
|
5
6
|
children: ReactNode;
|
|
6
7
|
size: EAccordionSize | `${EAccordionSize}`;
|
|
8
|
+
/**
|
|
9
|
+
* Объект, для передачи в компонент и его элементы data-testid-react, для автоматизированного тестирования
|
|
10
|
+
*/
|
|
11
|
+
dataTestIdReactMap?: TDataTestIdReactMap<'item'>;
|
|
7
12
|
};
|
|
8
|
-
export declare const AccordionItem: ({ children, size }: TProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const AccordionItem: ({ children, size, dataTestIdReactMap }: TProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c } from "../../../index-DIxK0V-G.js";
|
|
3
|
-
import '../../../assets/AccordionItem.css';const
|
|
4
|
-
item:
|
|
5
|
-
m:
|
|
6
|
-
s:
|
|
7
|
-
},
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../../index-DIxK0V-G.js";
|
|
3
|
+
import '../../../assets/AccordionItem.css';const c = "_item_1k7g5_2", n = "_m_1k7g5_10", t = "_s_1k7g5_15", s = {
|
|
4
|
+
item: c,
|
|
5
|
+
m: n,
|
|
6
|
+
s: t
|
|
7
|
+
}, k = ({
|
|
8
|
+
children: o,
|
|
9
|
+
size: i,
|
|
10
|
+
dataTestIdReactMap: m
|
|
11
|
+
}) => /* @__PURE__ */ r(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
"data-testid-react": m == null ? void 0 : m.item,
|
|
15
|
+
className: _(s.item, s[i]),
|
|
16
|
+
children: o
|
|
17
|
+
}
|
|
18
|
+
);
|
|
8
19
|
export {
|
|
9
|
-
|
|
20
|
+
k as AccordionItem
|
|
10
21
|
};
|