mimir-ui-kit 1.43.19 → 1.43.21
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/assets/Drawer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._drawer_pv7po_2{--drawer-width: 808px;--drawer-z-index: 10000;position:fixed;z-index:10000;z-index:var(--drawer-z-index);display:flex;flex-direction:column;width:808px;width:var(--drawer-width);height:100%;overflow:auto;background-color:var(--black-5);transition:all .3s ease;pointer-events:none}._drawer_pv7po_2::-webkit-scrollbar{width:3px}._drawer_pv7po_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_pv7po_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_pv7po_2 ._content_pv7po_26{position:relative;display:flex;flex:1;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-xs) var(--mimir-space-3xs) var(--mimir-space-4xl);overflow:hidden;transition:all .3s ease}@media (max-width: 600px){._drawer_pv7po_2 ._content_pv7po_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_pv7po_2 ._header_pv7po_41{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_pv7po_2 ._header_pv7po_41:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_pv7po_2 ._header_pv7po_41._sticky-header_pv7po_49{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_pv7po_2 ._header_pv7po_41 ._title_pv7po_55{flex:1;align-self:flex-end;font-weight:var(--mimir-font-weight-text-medium);font-size:var(--mimir-size-text-xl3);line-height:var(--mimir-space-2xxl);letter-spacing:.7px}@media (max-width: 600px){._drawer_pv7po_2 ._header_pv7po_41 ._title_pv7po_55{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_pv7po_2 ._header_pv7po_41 ._space_pv7po_69{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_pv7po_2 ._header_pv7po_41{min-height:55px}._drawer_pv7po_2 ._header_pv7po_41:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_pv7po_2 ._inner_pv7po_80{flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_pv7po_2 ._inner_pv7po_80._is-loading_pv7po_85{display:flex;flex-direction:column;align-items:center;justify-content:center}._drawer_pv7po_2 ._button_pv7po_91{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_pv7po_2 ._footer_pv7po_96{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_pv7po_2 ._footer_pv7po_96{padding:var(--mimir-space-m)}}._drawer_pv7po_2 ._footer_pv7po_96._has-scroll_pv7po_105{box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_pv7po_2 ._footer-button_pv7po_108{display:block;margin-left:auto}._drawer_pv7po_2._left_pv7po_112{top:0;left:-100%}._drawer_pv7po_2._right_pv7po_116{top:0;right:-100%}._drawer_pv7po_2._full_pv7po_120{top:0;right:0;bottom:0;left:0;width:100%;height:100%;max-height:100vh;border-radius:0;transform:scale(.95);opacity:0;transition:transform .3s ease-in-out,opacity .3s ease-in-out}._drawer_pv7po_2._bottom_pv7po_130{--drawer-width: calc(100% - var(--mimir-space-m));right:50%;bottom:-100%;left:50%;height:-webkit-max-content;height:-moz-max-content;height:max-content;max-height:calc(100% - var(--mimir-space-xs));border-top-left-radius:var(--mimir-control-radius);border-top-right-radius:var(--mimir-control-radius);transform:translate(-50%)}._drawer_pv7po_2._bottom_pv7po_130._full-bottom-height_pv7po_141{height:calc(100% - var(--mimir-space-xs))}._drawer_pv7po_2._bottom_pv7po_130._is-loading_pv7po_85{height:50vh}._drawer_pv7po_2._opened_pv7po_147{transition:all .3s ease;pointer-events:auto}._drawer_pv7po_2._opened_pv7po_147._left_pv7po_112{left:0%;transition:left .3s ease}._drawer_pv7po_2._opened_pv7po_147._right_pv7po_116{right:0%;transition:right .3s ease}._drawer_pv7po_2._opened_pv7po_147._bottom_pv7po_130{bottom:0%}._drawer_pv7po_2._opened_pv7po_147._full_pv7po_120{transform:scale(1);opacity:1}._drawer_pv7po_2._is-closing_pv7po_166._left_pv7po_112{left:-100%}._drawer_pv7po_2._is-closing_pv7po_166._right_pv7po_116{right:-100%}._drawer_pv7po_2._is-closing_pv7po_166._bottom_pv7po_130{bottom:-100%}._drawer_pv7po_2._is-closing_pv7po_166._full_pv7po_120{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_pv7po_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_pv7po_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_pv7po_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_pv7po_2{--drawer-width: 100%}._drawer_pv7po_2._bottom_pv7po_130{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_pv7po_203{--overlay-z-index: 9990;position:fixed;top:0;left:0;z-index:9990;z-index:var(--overlay-z-index);width:100%;height:100%;background-color:#0009;opacity:0;transition:all .3s ease}._overlay_pv7po_203._opened_pv7po_147{opacity:1;transition:all .3s ease}._overlay_pv7po_203._opened_pv7po_147._unmount_pv7po_219{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_pv7po_203._is-closing_pv7po_166{opacity:0;transition:all .3s ease}._overlay_pv7po_203._unmount_pv7po_219{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
|
|
@@ -48,6 +48,8 @@ export type TProps = {
|
|
|
48
48
|
onChange?: (isOpen: boolean) => void;
|
|
49
49
|
/** Позиция контента аккордеона */
|
|
50
50
|
contentPosition?: EAccordionContentPosition | `${EAccordionContentPosition}`;
|
|
51
|
+
/** Флаг, указывающий, нужно ли останавливать распространение события */
|
|
52
|
+
needStopPropagation?: boolean;
|
|
51
53
|
};
|
|
52
54
|
export declare const Accordion: import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLElement>>;
|
|
53
55
|
export {};
|
|
@@ -1,24 +1,24 @@
|
|
|
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 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) {
|
|
18
18
|
e();
|
|
19
19
|
};
|
|
20
|
-
var
|
|
21
|
-
let
|
|
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
22
|
return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
|
|
23
23
|
}, 3(e, t) {
|
|
24
24
|
return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
|
|
@@ -26,180 +26,183 @@ let Qe = { 0: (e) => ({ ...e, disclosureState: X(e.disclosureState, { 0: 1, 1: 0
|
|
|
26
26
|
return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
|
|
27
27
|
}, 5(e, t) {
|
|
28
28
|
return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
|
|
29
|
-
} },
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
let t =
|
|
29
|
+
} }, Y = Q(null);
|
|
30
|
+
Y.displayName = "DisclosureContext";
|
|
31
|
+
function Z(e) {
|
|
32
|
+
let t = z(Y);
|
|
33
33
|
if (t === null) {
|
|
34
34
|
let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
|
35
|
-
throw Error.captureStackTrace && Error.captureStackTrace(d,
|
|
35
|
+
throw Error.captureStackTrace && Error.captureStackTrace(d, Z), d;
|
|
36
36
|
}
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
function
|
|
42
|
-
let t =
|
|
39
|
+
let ee = Q(null);
|
|
40
|
+
ee.displayName = "DisclosureAPIContext";
|
|
41
|
+
function Ee(e) {
|
|
42
|
+
let t = z(ee);
|
|
43
43
|
if (t === null) {
|
|
44
44
|
let d = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
|
|
45
|
-
throw Error.captureStackTrace && Error.captureStackTrace(d,
|
|
45
|
+
throw Error.captureStackTrace && Error.captureStackTrace(d, Ee), d;
|
|
46
46
|
}
|
|
47
47
|
return t;
|
|
48
48
|
}
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
return
|
|
49
|
+
let te = Q(null);
|
|
50
|
+
te.displayName = "DisclosurePanelContext";
|
|
51
|
+
function Ke() {
|
|
52
|
+
return z(te);
|
|
53
53
|
}
|
|
54
|
-
function ze(e, t) {
|
|
55
|
-
return X(t.type, Qe, e, t);
|
|
56
|
-
}
|
|
57
|
-
let Ke = ue;
|
|
58
54
|
function Xe(e, t) {
|
|
59
|
-
|
|
60
|
-
c.current = i;
|
|
61
|
-
}, e.as === void 0 || e.as === ue)), a = xe(ze, { disclosureState: d ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: o }, S] = a, s = B((i) => {
|
|
62
|
-
S({ type: 1 });
|
|
63
|
-
let _ = we(c);
|
|
64
|
-
if (!_ || !o) return;
|
|
65
|
-
let g = i ? i instanceof HTMLElement ? i : i.current instanceof HTMLElement ? i.current : _.getElementById(o) : _.getElementById(o);
|
|
66
|
-
g == null || g.focus();
|
|
67
|
-
}), T = F(() => ({ close: s }), [s]), b = F(() => ({ open: n === 0, close: s }), [n, s]), I = { ref: m };
|
|
68
|
-
return P.createElement(J.Provider, { value: a }, P.createElement(Z.Provider, { value: T }, P.createElement(He, { value: s }, P.createElement(Ce, { value: X(n, { 0: H.Open, 1: H.Closed }) }, G({ ourProps: I, theirProps: p, slot: b, defaultTag: Ke, name: "Disclosure" })))));
|
|
55
|
+
return G(t.type, ze, e, t);
|
|
69
56
|
}
|
|
70
|
-
let Ge =
|
|
57
|
+
let Ge = pe;
|
|
71
58
|
function Je(e, t) {
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
})),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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" })))));
|
|
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 }), () => {
|
|
77
|
+
l({ type: 2, buttonId: null });
|
|
78
78
|
};
|
|
79
|
-
}, [p,
|
|
80
|
-
let
|
|
81
|
-
var
|
|
82
|
-
if (
|
|
79
|
+
}, [p, l, c]);
|
|
80
|
+
let u = O((r) => {
|
|
81
|
+
var P;
|
|
82
|
+
if (c) {
|
|
83
83
|
if (n.disclosureState === 1) return;
|
|
84
|
-
switch (
|
|
85
|
-
case
|
|
86
|
-
case
|
|
87
|
-
|
|
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();
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
|
-
} else switch (
|
|
91
|
-
case
|
|
92
|
-
case
|
|
93
|
-
|
|
90
|
+
} else switch (r.key) {
|
|
91
|
+
case A.Space:
|
|
92
|
+
case A.Enter:
|
|
93
|
+
r.preventDefault(), r.stopPropagation(), l({ type: 0 });
|
|
94
94
|
break;
|
|
95
95
|
}
|
|
96
|
-
}),
|
|
97
|
-
switch (
|
|
98
|
-
case
|
|
99
|
-
|
|
96
|
+
}), f = O((r) => {
|
|
97
|
+
switch (r.key) {
|
|
98
|
+
case A.Space:
|
|
99
|
+
r.preventDefault();
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
|
-
}),
|
|
103
|
-
var
|
|
104
|
-
|
|
105
|
-
}), { isFocusVisible:
|
|
106
|
-
return
|
|
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" });
|
|
107
107
|
}
|
|
108
|
-
let
|
|
109
|
-
function
|
|
110
|
-
let d =
|
|
111
|
-
|
|
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
112
|
}), T);
|
|
113
|
-
|
|
113
|
+
V(() => (n({ type: 3, panelId: p }), () => {
|
|
114
114
|
n({ type: 3, panelId: null });
|
|
115
115
|
}), [p, n]);
|
|
116
|
-
let I =
|
|
117
|
-
return
|
|
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" })));
|
|
118
118
|
}
|
|
119
|
-
let
|
|
120
|
-
const
|
|
121
|
-
icon:
|
|
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,
|
|
122
122
|
"icon-container": "_icon-container_1x2lg_8",
|
|
123
|
-
open:
|
|
124
|
-
square:
|
|
125
|
-
circle:
|
|
126
|
-
disabled:
|
|
127
|
-
accordion:
|
|
123
|
+
open: st,
|
|
124
|
+
square: ct,
|
|
125
|
+
circle: at,
|
|
126
|
+
disabled: it,
|
|
127
|
+
accordion: ut,
|
|
128
128
|
"is-link": "_is-link_1x2lg_41",
|
|
129
129
|
"content-top": "_content-top_1x2lg_44",
|
|
130
|
-
button:
|
|
131
|
-
header:
|
|
132
|
-
title:
|
|
130
|
+
button: dt,
|
|
131
|
+
header: pt,
|
|
132
|
+
title: mt,
|
|
133
133
|
"title-uppercase": "_title-uppercase_1x2lg_72",
|
|
134
|
-
panel:
|
|
134
|
+
panel: ft,
|
|
135
135
|
"content-bottom": "_content-bottom_1x2lg_109",
|
|
136
136
|
"link-open": "_link-open_1x2lg_129",
|
|
137
|
-
m:
|
|
138
|
-
s:
|
|
137
|
+
m: _t,
|
|
138
|
+
s: Et,
|
|
139
139
|
"wrapper-button": "_wrapper-button_1x2lg_161"
|
|
140
|
-
},
|
|
140
|
+
}, wt = Pe(
|
|
141
141
|
({
|
|
142
142
|
title: e,
|
|
143
143
|
disabled: t,
|
|
144
|
-
buttonType: d =
|
|
144
|
+
buttonType: d = w.BUTTON,
|
|
145
145
|
children: p,
|
|
146
|
-
showTitleByDefault:
|
|
146
|
+
showTitleByDefault: a = !0,
|
|
147
147
|
linkClassName: m,
|
|
148
|
-
size:
|
|
148
|
+
size: i = H.M,
|
|
149
149
|
titleUppercase: n,
|
|
150
|
-
buttonStyle:
|
|
151
|
-
iconType: S =
|
|
152
|
-
classNameTitle:
|
|
150
|
+
buttonStyle: l = ve.CIRCLE,
|
|
151
|
+
iconType: S = se.ARROW,
|
|
152
|
+
classNameTitle: c,
|
|
153
153
|
classNameContent: T,
|
|
154
154
|
classNameAccordion: b,
|
|
155
155
|
classNameIconButton: I,
|
|
156
|
-
subtitleNode:
|
|
157
|
-
onlyOpenSubtitleNode:
|
|
158
|
-
classNameSubtitleContainer:
|
|
159
|
-
activeKey:
|
|
156
|
+
subtitleNode: u,
|
|
157
|
+
onlyOpenSubtitleNode: f,
|
|
158
|
+
classNameSubtitleContainer: E,
|
|
159
|
+
activeKey: _,
|
|
160
160
|
defaultActiveKey: v,
|
|
161
161
|
onChange: y,
|
|
162
|
-
|
|
162
|
+
needStopPropagation: C = !1,
|
|
163
|
+
contentPosition: D = N.BOTTOM
|
|
163
164
|
}, M) => {
|
|
164
|
-
const
|
|
165
|
+
const h = _ !== void 0, [R, L] = fe(
|
|
165
166
|
() => !!v
|
|
166
|
-
),
|
|
167
|
-
[
|
|
168
|
-
},
|
|
169
|
-
[
|
|
170
|
-
[
|
|
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
|
|
171
172
|
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}, [
|
|
175
|
-
const
|
|
173
|
+
V(() => {
|
|
174
|
+
h && L(!!_);
|
|
175
|
+
}, [_, h]);
|
|
176
|
+
const be = (o) => {
|
|
177
|
+
var re;
|
|
176
178
|
if (t)
|
|
177
179
|
return;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
184
|
variant: "anchor",
|
|
182
|
-
size:
|
|
185
|
+
size: P ? "s" : "l",
|
|
183
186
|
rightIcon: {
|
|
184
|
-
iconName:
|
|
185
|
-
className:
|
|
186
|
-
[
|
|
187
|
+
iconName: Ie,
|
|
188
|
+
className: k({
|
|
189
|
+
[s["link-open"]]: o
|
|
187
190
|
})
|
|
188
191
|
}
|
|
189
|
-
}),
|
|
190
|
-
const
|
|
192
|
+
}), Te = (o) => {
|
|
193
|
+
const g = () => S === se.DROPDOWN ? i === H.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : i === H.S ? ce.S : ce.M;
|
|
191
194
|
switch (d) {
|
|
192
|
-
case
|
|
195
|
+
case w.LINK:
|
|
193
196
|
return e;
|
|
194
|
-
case
|
|
195
|
-
return /* @__PURE__ */
|
|
197
|
+
case w.BUTTON:
|
|
198
|
+
return /* @__PURE__ */ F(W, { children: [
|
|
196
199
|
/* @__PURE__ */ x(
|
|
197
200
|
"span",
|
|
198
201
|
{
|
|
199
|
-
className:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
n &&
|
|
202
|
+
className: k(
|
|
203
|
+
s.title,
|
|
204
|
+
c,
|
|
205
|
+
n && s["title-uppercase"]
|
|
203
206
|
),
|
|
204
207
|
children: e
|
|
205
208
|
}
|
|
@@ -207,19 +210,19 @@ const ot = "_icon_1x2lg_2", rt = "_open_1x2lg_15", lt = "_square_1x2lg_19", st =
|
|
|
207
210
|
/* @__PURE__ */ x(
|
|
208
211
|
"div",
|
|
209
212
|
{
|
|
210
|
-
className:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
t &&
|
|
214
|
-
l
|
|
213
|
+
className: k(
|
|
214
|
+
s["icon-container"],
|
|
215
|
+
o && s.open,
|
|
216
|
+
t && s.disabled,
|
|
217
|
+
s[l],
|
|
215
218
|
I
|
|
216
219
|
),
|
|
217
220
|
"data-testid": "accordion-icon-container",
|
|
218
221
|
children: /* @__PURE__ */ x(
|
|
219
|
-
|
|
222
|
+
ke,
|
|
220
223
|
{
|
|
221
|
-
iconName:
|
|
222
|
-
className:
|
|
224
|
+
iconName: g(),
|
|
225
|
+
className: s.icon,
|
|
223
226
|
"data-testid": "accordion-icon"
|
|
224
227
|
}
|
|
225
228
|
)
|
|
@@ -229,69 +232,69 @@ const ot = "_icon_1x2lg_2", rt = "_open_1x2lg_15", lt = "_square_1x2lg_19", st =
|
|
|
229
232
|
default:
|
|
230
233
|
return null;
|
|
231
234
|
}
|
|
232
|
-
},
|
|
233
|
-
|
|
235
|
+
}, oe = (o, g) => /* @__PURE__ */ x(
|
|
236
|
+
Se,
|
|
234
237
|
{
|
|
235
238
|
"data-testid": "accordion-panel",
|
|
236
|
-
className:
|
|
237
|
-
|
|
239
|
+
className: k(
|
|
240
|
+
s.panel,
|
|
238
241
|
T,
|
|
239
|
-
|
|
240
|
-
|
|
242
|
+
ne,
|
|
243
|
+
j
|
|
241
244
|
),
|
|
242
|
-
children: /* @__PURE__ */ x(
|
|
243
|
-
open:
|
|
244
|
-
close:
|
|
245
|
+
children: /* @__PURE__ */ x($e, { size: i, children: typeof p == "function" ? p({
|
|
246
|
+
open: o,
|
|
247
|
+
close: g
|
|
245
248
|
}) : p })
|
|
246
249
|
}
|
|
247
250
|
);
|
|
248
|
-
return /* @__PURE__ */
|
|
251
|
+
return /* @__PURE__ */ F(W, { children: [
|
|
249
252
|
/* @__PURE__ */ x(
|
|
250
253
|
"div",
|
|
251
254
|
{
|
|
252
|
-
className:
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
className: k(
|
|
256
|
+
s.accordion,
|
|
257
|
+
s[i],
|
|
258
|
+
ne,
|
|
256
259
|
b,
|
|
257
|
-
|
|
260
|
+
j
|
|
258
261
|
),
|
|
259
262
|
children: /* @__PURE__ */ x(
|
|
260
|
-
|
|
263
|
+
rt,
|
|
261
264
|
{
|
|
262
265
|
ref: M,
|
|
263
|
-
defaultOpen:
|
|
264
|
-
children: ({ open:
|
|
265
|
-
D ===
|
|
266
|
-
(!
|
|
267
|
-
|
|
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,
|
|
268
271
|
{
|
|
269
272
|
disabled: t,
|
|
270
|
-
as:
|
|
271
|
-
onClick:
|
|
272
|
-
className:
|
|
273
|
-
[
|
|
274
|
-
[
|
|
275
|
-
[m ?? ""]:
|
|
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
|
|
276
279
|
}),
|
|
277
|
-
...
|
|
278
|
-
children: (!
|
|
280
|
+
...B ? xe(o) : {},
|
|
281
|
+
children: (!o || a) && Te(o)
|
|
279
282
|
}
|
|
280
283
|
),
|
|
281
|
-
D ===
|
|
284
|
+
D === N.BOTTOM && o && oe(o, g)
|
|
282
285
|
] })
|
|
283
286
|
},
|
|
284
|
-
|
|
287
|
+
_ ? String(r) : void 0
|
|
285
288
|
)
|
|
286
289
|
}
|
|
287
290
|
),
|
|
288
|
-
(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
(u || f) && /* @__PURE__ */ F("div", { className: E, children: [
|
|
292
|
+
u,
|
|
293
|
+
r && f
|
|
291
294
|
] })
|
|
292
295
|
] });
|
|
293
296
|
}
|
|
294
297
|
);
|
|
295
298
|
export {
|
|
296
|
-
|
|
299
|
+
wt as Accordion
|
|
297
300
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
1
|
+
import { jsxs as a, Fragment as te, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { c as n } from "../../index-DIxK0V-G.js";
|
|
3
|
-
import { forwardRef as ne, useState as
|
|
3
|
+
import { forwardRef as ne, useState as v, useRef as L, useEffect as M, useCallback as g } from "react";
|
|
4
4
|
import { EDrawerPosition as R } from "./constants.js";
|
|
5
5
|
import { useContainer as re } from "./hooks.js";
|
|
6
6
|
import { ScrollWrapper as se } from "./ScrollWrapper/index.js";
|
|
@@ -9,33 +9,33 @@ import { EMediaQuery as le } from "../../hooks/useMediaQuery/constants.js";
|
|
|
9
9
|
import { useLockBodyScroll as ae } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
|
|
10
10
|
import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
|
|
11
11
|
import { Button as H } from "../Button/Button.js";
|
|
12
|
-
import { EButtonVariantDefault as
|
|
13
|
-
import { Loader as
|
|
14
|
-
import { Portal as
|
|
15
|
-
import { EScrollBarVariant as
|
|
16
|
-
import '../../assets/Drawer.css';const
|
|
17
|
-
drawer:
|
|
18
|
-
content:
|
|
19
|
-
|
|
20
|
-
header:
|
|
21
|
-
"sticky-header": "_sticky-header_14uzm_53",
|
|
12
|
+
import { EButtonVariantDefault as pe, EButtonSize as c } from "../Button/constants.js";
|
|
13
|
+
import { Loader as de } from "../Loader/Loader.js";
|
|
14
|
+
import { Portal as ue } from "../Portal/Portal.js";
|
|
15
|
+
import { EScrollBarVariant as me, EScrollBarSize as fe } from "../ScrollBar/constants.js";
|
|
16
|
+
import '../../assets/Drawer.css';const _e = "_drawer_pv7po_2", he = "_content_pv7po_26", ve = "_header_pv7po_41", ge = "_title_pv7po_55", ye = "_space_pv7po_69", be = "_inner_pv7po_80", Ce = "_button_pv7po_91", we = "_footer_pv7po_96", Ne = "_left_pv7po_112", ke = "_right_pv7po_116", Se = "_full_pv7po_120", Be = "_bottom_pv7po_130", Ee = "_opened_pv7po_147", ze = "_overlay_pv7po_203", Ie = "_unmount_pv7po_219", e = {
|
|
17
|
+
drawer: _e,
|
|
18
|
+
content: he,
|
|
19
|
+
header: ve,
|
|
20
|
+
"sticky-header": "_sticky-header_pv7po_49",
|
|
22
21
|
title: ge,
|
|
23
22
|
space: ye,
|
|
24
|
-
inner:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
inner: be,
|
|
24
|
+
"is-loading": "_is-loading_pv7po_85",
|
|
25
|
+
button: Ce,
|
|
26
|
+
footer: we,
|
|
27
|
+
"has-scroll": "_has-scroll_pv7po_105",
|
|
28
|
+
"footer-button": "_footer-button_pv7po_108",
|
|
29
|
+
left: Ne,
|
|
30
|
+
right: ke,
|
|
31
|
+
full: Se,
|
|
32
|
+
bottom: Be,
|
|
33
|
+
"full-bottom-height": "_full-bottom-height_pv7po_141",
|
|
34
|
+
opened: Ee,
|
|
35
|
+
"is-closing": "_is-closing_pv7po_166",
|
|
36
|
+
overlay: ze,
|
|
37
37
|
unmount: Ie
|
|
38
|
-
}, Oe = 300, Le = (
|
|
38
|
+
}, Oe = 300, Le = (p) => p ? {
|
|
39
39
|
drawer: {
|
|
40
40
|
position: "absolute",
|
|
41
41
|
zIndex: 100
|
|
@@ -45,38 +45,38 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
45
45
|
zIndex: 90
|
|
46
46
|
}
|
|
47
47
|
} : {}, Ye = ne(
|
|
48
|
-
(
|
|
48
|
+
(p, T) => {
|
|
49
49
|
const {
|
|
50
50
|
as: x = "div",
|
|
51
51
|
isOpen: r,
|
|
52
|
-
onClose:
|
|
52
|
+
onClose: d,
|
|
53
53
|
title: D,
|
|
54
54
|
className: A,
|
|
55
55
|
unmount: y = !0,
|
|
56
56
|
isLoading: s = !1,
|
|
57
57
|
stickyHeader: P,
|
|
58
58
|
fullBottomHeight: X = !1,
|
|
59
|
-
position:
|
|
59
|
+
position: u = R.RIGHT,
|
|
60
60
|
paddingRight: j = 8,
|
|
61
|
-
footer:
|
|
61
|
+
footer: m,
|
|
62
62
|
children: F,
|
|
63
63
|
classNameTitle: G,
|
|
64
64
|
classNameHeader: Q,
|
|
65
65
|
classNameInner: V,
|
|
66
66
|
classNameContent: W,
|
|
67
67
|
classNameFooter: K,
|
|
68
|
-
closeOnClickOutside:
|
|
69
|
-
showCloseButton:
|
|
70
|
-
getContainer:
|
|
68
|
+
closeOnClickOutside: b = !0,
|
|
69
|
+
showCloseButton: C = !0,
|
|
70
|
+
getContainer: f,
|
|
71
71
|
...Y
|
|
72
|
-
} =
|
|
73
|
-
enabled:
|
|
74
|
-
}),
|
|
72
|
+
} = p, [w, N] = v(!1), [q, k] = v(!1), S = L(), _ = ie(le.XS1), { ref: J } = ce({
|
|
73
|
+
enabled: u === R.BOTTOM
|
|
74
|
+
}), B = re(f), i = L(null), [U, Z] = v(!1);
|
|
75
75
|
M(() => {
|
|
76
76
|
const l = () => {
|
|
77
77
|
if (i.current) {
|
|
78
|
-
const { scrollHeight: ee, clientHeight:
|
|
79
|
-
Z(ee >
|
|
78
|
+
const { scrollHeight: ee, clientHeight: oe } = i.current;
|
|
79
|
+
Z(ee > oe);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
l();
|
|
@@ -85,41 +85,41 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
85
85
|
O.disconnect();
|
|
86
86
|
};
|
|
87
87
|
}, [r, s]), ae({
|
|
88
|
-
on: r && !
|
|
88
|
+
on: r && !w,
|
|
89
89
|
paddingRight: j
|
|
90
90
|
});
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
const t = g(() => {
|
|
92
|
+
d && (N(!0), S.current = setTimeout(() => {
|
|
93
|
+
d(), N(!1);
|
|
94
94
|
}, Oe));
|
|
95
|
-
}, [
|
|
96
|
-
|
|
97
|
-
}, [
|
|
95
|
+
}, [d]), $ = g(() => {
|
|
96
|
+
b && t();
|
|
97
|
+
}, [b, t]), h = g(
|
|
98
98
|
(l) => {
|
|
99
|
-
l.key === "Escape" &&
|
|
99
|
+
l.key === "Escape" && t();
|
|
100
100
|
},
|
|
101
|
-
[
|
|
101
|
+
[t]
|
|
102
102
|
);
|
|
103
|
-
M(() => (r && (
|
|
104
|
-
|
|
105
|
-
}), [r,
|
|
106
|
-
const
|
|
103
|
+
M(() => (r && (k(!0), window.addEventListener("keydown", h)), () => {
|
|
104
|
+
k(!1), clearTimeout(S.current), window.removeEventListener("keydown", h);
|
|
105
|
+
}), [r, h]);
|
|
106
|
+
const E = {
|
|
107
107
|
[e.opened]: q,
|
|
108
|
-
[e["is-closing"]]:
|
|
108
|
+
[e["is-closing"]]: w,
|
|
109
109
|
[e["full-bottom-height"]]: X,
|
|
110
110
|
[e["is-loading"]]: s
|
|
111
111
|
};
|
|
112
112
|
if (!r && y)
|
|
113
113
|
return null;
|
|
114
|
-
const
|
|
114
|
+
const z = Le(f !== void 0 && f !== !1), I = /* @__PURE__ */ a(te, { children: [
|
|
115
115
|
/* @__PURE__ */ a(
|
|
116
116
|
x,
|
|
117
117
|
{
|
|
118
118
|
ref: T,
|
|
119
119
|
"aria-hidden": !r,
|
|
120
120
|
role: "dialog",
|
|
121
|
-
style:
|
|
122
|
-
className: n(e.drawer, e[
|
|
121
|
+
style: z.drawer,
|
|
122
|
+
className: n(e.drawer, e[u], E, A),
|
|
123
123
|
...Y,
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ a(
|
|
@@ -129,7 +129,7 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
129
129
|
className: n(
|
|
130
130
|
e.content,
|
|
131
131
|
W,
|
|
132
|
-
e[
|
|
132
|
+
e[u],
|
|
133
133
|
{
|
|
134
134
|
[e["is-loading"]]: !!s
|
|
135
135
|
}
|
|
@@ -142,22 +142,22 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
142
142
|
[e["sticky-header"]]: P
|
|
143
143
|
}),
|
|
144
144
|
children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ o("h2", { className: n(e.title, G), children: D }),
|
|
146
|
+
/* @__PURE__ */ o("div", { className: e.space, children: C && /* @__PURE__ */ o(
|
|
147
147
|
H,
|
|
148
148
|
{
|
|
149
|
-
variant:
|
|
149
|
+
variant: pe.SecondaryWhite,
|
|
150
150
|
isIconButton: !0,
|
|
151
|
-
size:
|
|
151
|
+
size: _ ? c.S : c.M,
|
|
152
152
|
iconName: "Close16px",
|
|
153
|
-
onClick:
|
|
153
|
+
onClick: t,
|
|
154
154
|
className: e.button
|
|
155
155
|
}
|
|
156
156
|
) })
|
|
157
157
|
]
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ o(
|
|
161
161
|
se,
|
|
162
162
|
{
|
|
163
163
|
ref: i,
|
|
@@ -168,26 +168,26 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
168
168
|
},
|
|
169
169
|
V
|
|
170
170
|
),
|
|
171
|
-
variant:
|
|
172
|
-
size:
|
|
173
|
-
children: s ? /* @__PURE__ */
|
|
171
|
+
variant: me.LIGHT,
|
|
172
|
+
size: fe.M,
|
|
173
|
+
children: s ? /* @__PURE__ */ o(de, {}) : F
|
|
174
174
|
}
|
|
175
175
|
)
|
|
176
176
|
]
|
|
177
177
|
}
|
|
178
178
|
),
|
|
179
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ o(
|
|
180
180
|
"footer",
|
|
181
181
|
{
|
|
182
182
|
className: n(e.footer, K, {
|
|
183
183
|
[e["has-scroll"]]: U
|
|
184
184
|
}),
|
|
185
|
-
children: typeof
|
|
185
|
+
children: typeof m == "function" ? m({ handleClose: t }) : m || C && /* @__PURE__ */ o(
|
|
186
186
|
H,
|
|
187
187
|
{
|
|
188
|
-
size:
|
|
189
|
-
full:
|
|
190
|
-
onClick:
|
|
188
|
+
size: _ ? c.L : c.XXL,
|
|
189
|
+
full: _,
|
|
190
|
+
onClick: t,
|
|
191
191
|
className: e["footer-button"],
|
|
192
192
|
children: "Закрыть"
|
|
193
193
|
}
|
|
@@ -197,7 +197,7 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
197
197
|
]
|
|
198
198
|
}
|
|
199
199
|
),
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ o(
|
|
201
201
|
"div",
|
|
202
202
|
{
|
|
203
203
|
className: n(
|
|
@@ -205,15 +205,15 @@ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14
|
|
|
205
205
|
{
|
|
206
206
|
[e.unmount]: !y
|
|
207
207
|
},
|
|
208
|
-
|
|
208
|
+
E
|
|
209
209
|
),
|
|
210
|
-
style:
|
|
210
|
+
style: z.overlay,
|
|
211
211
|
"data-testid": "drawer-overlay",
|
|
212
212
|
onClick: $
|
|
213
213
|
}
|
|
214
214
|
)
|
|
215
215
|
] });
|
|
216
|
-
return
|
|
216
|
+
return B === !1 ? I : /* @__PURE__ */ o(ue, { element: B, children: I });
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
export {
|