mimir-ui-kit 1.61.1 → 1.63.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.
Files changed (59) hide show
  1. package/dist/Input-CqNPT8os.js +243 -0
  2. package/dist/components/Accordion/Accordion.d.ts +5 -0
  3. package/dist/components/Accordion/Accordion.js +242 -220
  4. package/dist/components/Accordion/AccordionItem/AccordionItem.d.ts +6 -1
  5. package/dist/components/Accordion/AccordionItem/AccordionItem.js +19 -8
  6. package/dist/components/Button/Button.d.ts +37 -0
  7. package/dist/components/Button/Button.js +77 -61
  8. package/dist/components/CheckboxMimir/CheckboxMimir.d.ts +9 -0
  9. package/dist/components/CheckboxMimir/CheckboxMimir.js +90 -59
  10. package/dist/components/DatePicker/DatePicker.js +1 -1
  11. package/dist/components/Drawer/Drawer.d.ts +5 -0
  12. package/dist/components/Drawer/Drawer.js +141 -135
  13. package/dist/components/DropdownSelect/DropdownSelect.js +25 -23
  14. package/dist/components/DropdownSelect/types.d.ts +4 -0
  15. package/dist/components/GosZnak/GosZnak.d.ts +1 -1
  16. package/dist/components/GosZnak/GosZnak.js +88 -67
  17. package/dist/components/GosZnak/types.d.ts +5 -0
  18. package/dist/components/Image/Image.d.ts +5 -0
  19. package/dist/components/Image/Image.js +55 -50
  20. package/dist/components/Input/Input.d.ts +5 -0
  21. package/dist/components/Input/Input.js +1 -1
  22. package/dist/components/Input/index.js +1 -1
  23. package/dist/components/InputPassword/InputPassword.d.ts +5 -0
  24. package/dist/components/InputPassword/InputPassword.js +80 -69
  25. package/dist/components/InputPhoneNumber/InputPhoneNumber.d.ts +5 -1
  26. package/dist/components/InputPhoneNumber/InputPhoneNumber.js +39 -32
  27. package/dist/components/Loader/Loader.d.ts +6 -1
  28. package/dist/components/Loader/Loader.js +37 -14
  29. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
  30. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.d.ts +2 -1
  31. package/dist/components/MultiSelectSearch/hooks/useRenderVirtualizedList.js +50 -48
  32. package/dist/components/MultiSelectSearch/utils.js +1 -1
  33. package/dist/components/OtpInput/OtpInput.js +1 -1
  34. package/dist/components/RadioGroup/RadioGroup.d.ts +9 -0
  35. package/dist/components/RadioGroup/RadioGroup.js +142 -129
  36. package/dist/components/SelectSearch/SelectSearch.d.ts +2 -0
  37. package/dist/components/SelectSearch/SelectSearch.js +299 -275
  38. package/dist/components/SelectSearch/types.d.ts +9 -0
  39. package/dist/components/SelectSearch/utils.js +1 -1
  40. package/dist/components/TextArea/TextArea.d.ts +1 -1
  41. package/dist/components/TextArea/TextArea.js +1 -1
  42. package/dist/components/TextAreaV2/TextArea.js +155 -142
  43. package/dist/components/TextAreaV2/types.d.ts +5 -0
  44. package/dist/components/UniversalUploader/UniversalUploader.d.ts +1 -0
  45. package/dist/components/UniversalUploader/UniversalUploader.js +89 -86
  46. package/dist/components/UniversalUploader/types.d.ts +5 -0
  47. package/dist/components/Uploader/Uploader.d.ts +5 -0
  48. package/dist/components/Uploader/Uploader.js +116 -87
  49. package/dist/components/UploaderFiles/UploaderFiles.js +88 -79
  50. package/dist/components/UploaderFiles/types.d.ts +5 -0
  51. package/dist/components/UploaderPhotos/UploaderPhotos.d.ts +5 -0
  52. package/dist/components/UploaderPhotos/UploaderPhotos.js +60 -57
  53. package/dist/components/index.js +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/types/dataTestId.d.ts +1 -0
  56. package/dist/types/dataTestId.js +1 -0
  57. package/dist/types/index.d.ts +1 -0
  58. package/package.json +1 -1
  59. package/dist/Input-DPnH8pKc.js +0 -227
@@ -1,228 +1,232 @@
1
- import { jsxs as F, Fragment as W, jsx as x } from "react/jsx-runtime";
2
- import { c as k } from "../../index-DIxK0V-G.js";
3
- import $, { createContext as Q, useRef as de, Fragment as pe, useReducer as De, useMemo as U, useId as me, useEffect as V, useState as fe, useContext as z, forwardRef as Pe } from "react";
4
- import { AccordionItem as $e } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionButtonType as w, EAccordionContentPosition as N, EAccordionSize as H, EAccordionLinkIconSize as le, EAccordionButtonStyle as ve, EAccordionIconType as se, EAccordionButtonIconSize as ce } from "./constants.js";
6
- import { useMediaQuery as ye } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
- import { EMediaQuery as he } from "../../hooks/useMediaQuery/constants.js";
8
- import { Icon as ke } from "../../icons/Icon.js";
9
- import { Link as Oe } from "../AnchorLink/Link.js";
10
- import { M as ae, W as K, y as X, T as Be, o as O, a as G, H as J, I as _e, $ as we, b as Ne, D as ie, u as Ae, c as A } from "../../keyboard-wis2TUql.js";
11
- import { w as Ce } from "../../use-active-press-CnDeVvQq.js";
12
- import { e as Me } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { c as Re, i as q, u as Le, R as Fe, H as He, s as Ue } from "../../open-closed-CJijMeI2.js";
14
- import { C as qe } from "../../close-provider-CEutdhG8.js";
15
- import { r as je } from "../../bugs-diTMAGNw.js";
16
- import '../../assets/Accordion.css';var ue;
17
- let We = (ue = $.startTransition) != null ? ue : function(e) {
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 Qe = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Qe || {}), Ve = ((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))(Ve || {});
21
- let ze = { 0: (e) => ({ ...e, disclosureState: G(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
22
- return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
23
- }, 3(e, t) {
24
- return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
25
- }, 4(e, t) {
26
- return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
27
- }, 5(e, t) {
28
- return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
29
- } }, Y = Q(null);
30
- Y.displayName = "DisclosureContext";
31
- function Z(e) {
32
- let t = z(Y);
33
- if (t === null) {
34
- let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
35
- throw Error.captureStackTrace && Error.captureStackTrace(d, Z), d;
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 t;
37
+ return n;
38
38
  }
39
- let ee = Q(null);
39
+ let ee = X(null);
40
40
  ee.displayName = "DisclosureAPIContext";
41
41
  function Ee(e) {
42
- let t = z(ee);
43
- if (t === null) {
44
- let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
45
- throw Error.captureStackTrace && Error.captureStackTrace(d, Ee), d;
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 t;
47
+ return n;
48
48
  }
49
- let te = Q(null);
50
- te.displayName = "DisclosurePanelContext";
51
- function Ke() {
52
- return z(te);
49
+ let ne = X(null);
50
+ ne.displayName = "DisclosurePanelContext";
51
+ function Ye() {
52
+ return I(ne);
53
53
  }
54
- function Xe(e, t) {
55
- return G(t.type, ze, e, t);
54
+ function Ze(e, n) {
55
+ return Z(n.type, Je, e, n);
56
56
  }
57
- let Ge = pe;
58
- function Je(e, t) {
59
- let { defaultOpen: d = !1, ...p } = e, a = de(null), m = X(t, Be((u) => {
60
- a.current = u;
61
- }, e.as === void 0 || e.as === pe)), i = De(Xe, { disclosureState: d ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: l }, S] = i, c = O((u) => {
62
- S({ type: 1 });
63
- let f = Ae(a);
64
- if (!f || !l) return;
65
- let E = u ? u instanceof HTMLElement ? u : u.current instanceof HTMLElement ? u.current : f.getElementById(l) : f.getElementById(l);
66
- E == null || E.focus();
67
- }), T = U(() => ({ close: c }), [c]), b = U(() => ({ open: n === 0, close: c }), [n, c]), I = { ref: m };
68
- return $.createElement(Y.Provider, { value: i }, $.createElement(ee.Provider, { value: T }, $.createElement(qe, { value: c }, $.createElement(Re, { value: G(n, { 0: q.Open, 1: q.Closed }) }, J({ ourProps: I, theirProps: p, slot: b, defaultTag: Ge, name: "Disclosure" })))));
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 Ye = "button";
71
- function Ze(e, t) {
72
- let d = me(), { id: p = `headlessui-disclosure-button-${d}`, disabled: a = !1, autoFocus: m = !1, ...i } = e, [n, l] = Z("Disclosure.Button"), S = Ke(), c = S === null ? !1 : S === n.panelId, T = de(null), b = X(T, t, O((r) => {
73
- if (!c) return l({ type: 4, element: r });
74
- })), I = _e();
75
- V(() => {
76
- if (!c) return l({ type: 2, buttonId: p }), () => {
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
- }, [p, l, c]);
80
- let u = O((r) => {
81
- var P;
82
- if (c) {
83
- if (n.disclosureState === 1) return;
84
- switch (r.key) {
85
- case A.Space:
86
- case A.Enter:
87
- r.preventDefault(), r.stopPropagation(), l({ type: 0 }), (P = n.buttonElement) == null || P.focus();
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 (r.key) {
91
- case A.Space:
92
- case A.Enter:
93
- r.preventDefault(), r.stopPropagation(), l({ type: 0 });
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
- }), f = O((r) => {
97
- switch (r.key) {
98
- case A.Space:
99
- r.preventDefault();
96
+ }), _ = C((c) => {
97
+ switch (c.key) {
98
+ case F.Space:
99
+ c.preventDefault();
100
100
  break;
101
101
  }
102
- }), E = O((r) => {
103
- var P;
104
- je(r.currentTarget) || a || (c ? (l({ type: 0 }), (P = n.buttonElement) == null || P.focus()) : l({ type: 0 }));
105
- }), { isFocusVisible: _, focusProps: v } = we({ autoFocus: m }), { isHovered: y, hoverProps: C } = Ne({ isDisabled: a }), { pressed: D, pressProps: M } = Ce({ disabled: a }), h = U(() => ({ open: n.disclosureState === 0, hover: y, active: D, disabled: a, focus: _, autofocus: m }), [n, y, D, _, a, m]), R = Me(e, n.buttonElement), L = c ? ie({ ref: b, type: R, disabled: a || void 0, autoFocus: m, onKeyDown: u, onClick: E }, v, C, M) : ie({ ref: b, id: p, type: R, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: a || void 0, autoFocus: m, onKeyDown: u, onKeyUp: f, onClick: E }, v, C, M);
106
- return J({ mergeRefs: I, ourProps: L, theirProps: i, slot: h, defaultTag: Ye, name: "Disclosure.Button" });
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 et = "div", tt = ae.RenderStrategy | ae.Static;
109
- function nt(e, t) {
110
- let d = me(), { id: p = `headlessui-disclosure-panel-${d}`, transition: a = !1, ...m } = e, [i, n] = Z("Disclosure.Panel"), { close: l } = Ee("Disclosure.Panel"), S = _e(), [c, T] = fe(null), b = X(t, O((v) => {
111
- We(() => n({ type: 5, element: v }));
112
- }), T);
113
- V(() => (n({ type: 3, panelId: p }), () => {
114
- n({ type: 3, panelId: null });
115
- }), [p, n]);
116
- let I = Le(), [u, f] = Fe(a, c, I !== null ? (I & q.Open) === q.Open : i.disclosureState === 0), E = U(() => ({ open: i.disclosureState === 0, close: l }), [i.disclosureState, l]), _ = { ref: b, id: p, ...He(f) };
117
- return $.createElement(Ue, null, $.createElement(te.Provider, { value: i.panelId }, J({ mergeRefs: S, ourProps: _, theirProps: m, slot: E, defaultTag: et, features: tt, visible: u, name: "Disclosure.Panel" })));
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 ot = K(Je), ge = K(Ze), Se = K(nt), rt = Object.assign(ot, { Button: ge, Panel: Se });
120
- const lt = "_icon_1x2lg_2", st = "_open_1x2lg_15", ct = "_square_1x2lg_19", at = "_circle_1x2lg_23", it = "_disabled_1x2lg_23", ut = "_accordion_1x2lg_37", dt = "_button_1x2lg_49", pt = "_header_1x2lg_53", mt = "_title_1x2lg_69", ft = "_panel_1x2lg_96", _t = "_m_1x2lg_133", Et = "_s_1x2lg_19", s = {
121
- icon: lt,
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: st,
124
- square: ct,
125
- circle: at,
126
- disabled: it,
127
- accordion: ut,
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: dt,
131
- header: pt,
132
- title: mt,
130
+ button: fn,
131
+ header: dn,
132
+ title: _n,
133
133
  "title-uppercase": "_title-uppercase_1x2lg_72",
134
- panel: ft,
134
+ panel: En,
135
135
  "content-bottom": "_content-bottom_1x2lg_109",
136
136
  "link-open": "_link-open_1x2lg_129",
137
- m: _t,
138
- s: Et,
137
+ m: bn,
138
+ s: gn,
139
139
  "wrapper-button": "_wrapper-button_1x2lg_161"
140
- }, wt = Pe(
140
+ }, Ln = ye(
141
141
  ({
142
142
  title: e,
143
- disabled: t,
144
- buttonType: d = w.BUTTON,
145
- children: p,
146
- showTitleByDefault: a = !0,
147
- linkClassName: m,
148
- size: i = H.M,
149
- titleUppercase: n,
150
- buttonStyle: l = ve.CIRCLE,
151
- iconType: S = se.ARROW,
152
- classNameTitle: c,
153
- classNameContent: T,
154
- classNameAccordion: b,
155
- classNameIconButton: I,
156
- subtitleNode: u,
157
- onlyOpenSubtitleNode: f,
158
- classNameSubtitleContainer: E,
159
- activeKey: _,
160
- defaultActiveKey: v,
161
- onChange: y,
162
- needStopPropagation: C = !1,
163
- contentPosition: D = N.BOTTOM
164
- }, M) => {
165
- const h = _ !== void 0, [R, L] = fe(
166
- () => !!v
167
- ), r = h ? !!_ : R, P = ye(he.XS1), B = d === w.LINK, ne = {
168
- [s["is-link"]]: B
169
- }, j = {
170
- [s["content-top"]]: D === N.TOP,
171
- [s["content-bottom"]]: D === N.BOTTOM
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
- V(() => {
174
- h && L(!!_);
175
- }, [_, h]);
176
- const be = (o) => {
177
- var re;
178
- if (t)
174
+ G(() => {
175
+ h && c(!!E);
176
+ }, [E, h]);
177
+ const xe = (t) => {
178
+ var te;
179
+ if (n)
179
180
  return;
180
- C && ((re = o == null ? void 0 : o.stopPropagation) == null || re.call(o));
181
- const g = !r;
182
- y == null || y(g), h || L(g);
183
- }, Ie = i === H.S ? le.S : le.M, xe = (o) => ({
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: P ? "s" : "l",
186
+ size: Se ? "s" : "l",
186
187
  rightIcon: {
187
- iconName: Ie,
188
- className: k({
189
- [s["link-open"]]: o
188
+ iconName: De,
189
+ className: w({
190
+ [i["link-open"]]: t
190
191
  })
191
192
  }
192
- }), Te = (o) => {
193
- const g = () => S === se.DROPDOWN ? i === H.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : i === H.S ? ce.S : ce.M;
194
- switch (d) {
195
- case w.LINK:
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 w.BUTTON:
198
- return /* @__PURE__ */ F(W, { children: [
199
- /* @__PURE__ */ x(
198
+ case A.BUTTON:
199
+ return /* @__PURE__ */ U(K, { children: [
200
+ /* @__PURE__ */ $(
200
201
  "span",
201
202
  {
202
- className: k(
203
- s.title,
204
- c,
205
- n && s["title-uppercase"]
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__ */ x(
212
+ /* @__PURE__ */ $(
211
213
  "div",
212
214
  {
213
- className: k(
214
- s["icon-container"],
215
- o && s.open,
216
- t && s.disabled,
217
- s[l],
218
- I
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__ */ x(
222
- ke,
224
+ children: /* @__PURE__ */ $(
225
+ we,
223
226
  {
224
- iconName: g(),
225
- className: s.icon,
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
- }, oe = (o, g) => /* @__PURE__ */ x(
236
- Se,
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: k(
240
- s.panel,
241
- T,
242
- ne,
243
- j
244
+ className: w(
245
+ i.panel,
246
+ v,
247
+ oe,
248
+ z
244
249
  ),
245
- children: /* @__PURE__ */ x($e, { size: i, children: typeof p == "function" ? p({
246
- open: o,
247
- close: g
248
- }) : p })
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__ */ F(W, { children: [
252
- /* @__PURE__ */ x(
263
+ return /* @__PURE__ */ U(K, { children: [
264
+ /* @__PURE__ */ $(
253
265
  "div",
254
266
  {
255
- className: k(
256
- s.accordion,
257
- s[i],
258
- ne,
259
- b,
260
- j
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__ */ x(
263
- rt,
275
+ children: /* @__PURE__ */ $(
276
+ ln,
264
277
  {
265
- ref: M,
266
- defaultOpen: r,
267
- children: ({ open: o, close: g }) => /* @__PURE__ */ F(W, { children: [
268
- D === N.TOP && o && oe(o, g),
269
- (!o || a) && /* @__PURE__ */ x(
270
- ge,
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
- disabled: t,
273
- as: B ? Oe : w.BUTTON,
274
- onClick: be,
275
- className: k(s.button, j, {
276
- [s.header]: !B,
277
- [s.disabled]: t,
278
- [m ?? ""]: B && m
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
- ...B ? xe(o) : {},
281
- children: (!o || a) && Te(o)
295
+ ...N ? Pe(t) : {},
296
+ children: (!t || u) && $e(t)
282
297
  }
283
298
  ),
284
- D === N.BOTTOM && o && oe(o, g)
299
+ y === L.BOTTOM && t && re(t, S)
285
300
  ] })
286
301
  },
287
- _ ? String(r) : void 0
302
+ E ? String(b) : void 0
288
303
  )
289
304
  }
290
305
  ),
291
- (u || f) && /* @__PURE__ */ F("div", { className: E, children: [
292
- u,
293
- r && f
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
- wt as Accordion
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 o } from "react/jsx-runtime";
2
- import { c } from "../../../index-DIxK0V-G.js";
3
- import '../../../assets/AccordionItem.css';const e = "_item_1k7g5_2", _ = "_m_1k7g5_10", i = "_s_1k7g5_15", s = {
4
- item: e,
5
- m: _,
6
- s: i
7
- }, a = ({ children: m, size: t }) => /* @__PURE__ */ o("div", { className: c(s.item, s[t]), children: m });
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
- a as AccordionItem
20
+ k as AccordionItem
10
21
  };