mimir-ui-kit 1.43.18 → 1.43.20

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.
@@ -1 +1 @@
1
- ._drawer_13ua6_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_13ua6_2::-webkit-scrollbar{width:3px}._drawer_13ua6_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_13ua6_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_13ua6_2 ._content_13ua6_26{position:relative;display:flex;flex:1;flex-direction:column;padding:var(--mimir-space-m) var(--mimir-space-4xl) var(--mimir-space-4xl);transition:all .3s ease}@media (max-width: 600px){._drawer_13ua6_2 ._content_13ua6_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_13ua6_2 ._content_13ua6_26._is-loading_13ua6_40{align-items:center;justify-content:center}._drawer_13ua6_2 ._header_13ua6_44{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_13ua6_2 ._header_13ua6_44:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_13ua6_2 ._header_13ua6_44._sticky-header_13ua6_52{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_13ua6_2 ._header_13ua6_44 ._title_13ua6_58{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-line-height-text-s1);letter-spacing:.7px}@media (max-width: 600px){._drawer_13ua6_2 ._header_13ua6_44 ._title_13ua6_58{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_13ua6_2 ._header_13ua6_44 ._space_13ua6_72{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_13ua6_2 ._header_13ua6_44{min-height:55px}._drawer_13ua6_2 ._header_13ua6_44:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_13ua6_2 ._inner_13ua6_83{flex:1}._drawer_13ua6_2 ._button_13ua6_86{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_13ua6_2 ._footer_13ua6_91{display:block;padding-top:var(--mimir-space-4xl)}@media (max-width: 600px){._drawer_13ua6_2 ._footer_13ua6_91{padding-top:var(--mimir-space-m)}}._drawer_13ua6_2 ._footer-button_13ua6_100{display:block;margin-left:auto}._drawer_13ua6_2._left_13ua6_104{top:0;left:-100%}._drawer_13ua6_2._right_13ua6_108{top:0;right:-100%}._drawer_13ua6_2._full_13ua6_112{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_13ua6_2._bottom_13ua6_122{--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_13ua6_2._bottom_13ua6_122._full-bottom-height_13ua6_133{height:calc(100% - var(--mimir-space-xs))}._drawer_13ua6_2._bottom_13ua6_122._is-loading_13ua6_40{height:50vh}._drawer_13ua6_2._opened_13ua6_139{transition:all .3s ease;pointer-events:auto}._drawer_13ua6_2._opened_13ua6_139._left_13ua6_104{left:0%;transition:left .3s ease}._drawer_13ua6_2._opened_13ua6_139._right_13ua6_108{right:0%;transition:right .3s ease}._drawer_13ua6_2._opened_13ua6_139._bottom_13ua6_122{bottom:0%}._drawer_13ua6_2._opened_13ua6_139._full_13ua6_112{transform:scale(1);opacity:1}._drawer_13ua6_2._is-closing_13ua6_158._left_13ua6_104{left:-100%}._drawer_13ua6_2._is-closing_13ua6_158._right_13ua6_108{right:-100%}._drawer_13ua6_2._is-closing_13ua6_158._bottom_13ua6_122{bottom:-100%}._drawer_13ua6_2._is-closing_13ua6_158._full_13ua6_112{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_13ua6_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_13ua6_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_13ua6_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_13ua6_2{--drawer-width: 100%}._drawer_13ua6_2._bottom_13ua6_122{--drawer-width: calc(100% - var(--mimir-space-xs))}}._overlay_13ua6_195{--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_13ua6_195._opened_13ua6_139{opacity:1;transition:all .3s ease}._overlay_13ua6_195._opened_13ua6_139._unmount_13ua6_211{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_13ua6_195._is-closing_13ua6_158{opacity:0;transition:all .3s ease}._overlay_13ua6_195._unmount_13ua6_211{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
1
+ ._drawer_14uzm_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_14uzm_2::-webkit-scrollbar{width:3px}._drawer_14uzm_2::-webkit-scrollbar-thumb{background-color:var(--black-80);border-radius:2px}._drawer_14uzm_2::-webkit-scrollbar-track{background-color:var(--white)}._drawer_14uzm_2 ._content_14uzm_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_14uzm_2 ._content_14uzm_26{--drawer-width: 100%;padding:var(--mimir-space-m)}}._drawer_14uzm_2 ._content_14uzm_26._is-loading_14uzm_41{align-items:center;justify-content:center}._drawer_14uzm_2 ._header_14uzm_45{display:flex;gap:var(--mimir-space-xs);min-height:68px}._drawer_14uzm_2 ._header_14uzm_45:not(:last-child){margin-bottom:var(--mimir-space-2xl)}._drawer_14uzm_2 ._header_14uzm_45._sticky-header_14uzm_53{position:-webkit-sticky;position:sticky;top:0;left:0;background-color:var(--black-5)}._drawer_14uzm_2 ._header_14uzm_45 ._title_14uzm_59{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_14uzm_2 ._header_14uzm_45 ._title_14uzm_59{font-size:var(--mimir-size-text-xl2);line-height:var(--mimir-line-height-text-xs)}}._drawer_14uzm_2 ._header_14uzm_45 ._space_14uzm_73{flex:0 0 var(--button-height-m)}@media (max-width: 600px){._drawer_14uzm_2 ._header_14uzm_45{min-height:55px}._drawer_14uzm_2 ._header_14uzm_45:not(:last-child){margin-bottom:var(--mimir-space-m)}}._drawer_14uzm_2 ._inner_14uzm_84{flex:1;padding-right:var(--mimir-space-xxl);overflow-y:auto}._drawer_14uzm_2 ._inner_14uzm_84._is-loading_14uzm_41{display:flex;flex-direction:column;align-items:center;justify-content:center}._drawer_14uzm_2 ._button_14uzm_95{position:absolute;top:var(--mimir-space-m);right:var(--mimir-space-m)}._drawer_14uzm_2 ._footer_14uzm_100{display:block;padding:var(--mimir-space-2xl) var(--mimir-space-xxl) var(--mimir-space-4xl) var(--mimir-space-xxl)}@media (max-width: 600px){._drawer_14uzm_2 ._footer_14uzm_100{padding:var(--mimir-space-m)}}._drawer_14uzm_2 ._footer_14uzm_100._has-scroll_14uzm_109{box-shadow:var(--mimir-modal-window-bottom-panel-shadow)}._drawer_14uzm_2 ._footer-button_14uzm_112{display:block;margin-left:auto}._drawer_14uzm_2._left_14uzm_116{top:0;left:-100%}._drawer_14uzm_2._right_14uzm_120{top:0;right:-100%}._drawer_14uzm_2._full_14uzm_124{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_14uzm_2._bottom_14uzm_134{--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_14uzm_2._bottom_14uzm_134._full-bottom-height_14uzm_145{height:calc(100% - var(--mimir-space-xs))}._drawer_14uzm_2._bottom_14uzm_134._is-loading_14uzm_41{height:50vh}._drawer_14uzm_2._opened_14uzm_151{transition:all .3s ease;pointer-events:auto}._drawer_14uzm_2._opened_14uzm_151._left_14uzm_116{left:0%;transition:left .3s ease}._drawer_14uzm_2._opened_14uzm_151._right_14uzm_120{right:0%;transition:right .3s ease}._drawer_14uzm_2._opened_14uzm_151._bottom_14uzm_134{bottom:0%}._drawer_14uzm_2._opened_14uzm_151._full_14uzm_124{transform:scale(1);opacity:1}._drawer_14uzm_2._is-closing_14uzm_170._left_14uzm_116{left:-100%}._drawer_14uzm_2._is-closing_14uzm_170._right_14uzm_120{right:-100%}._drawer_14uzm_2._is-closing_14uzm_170._bottom_14uzm_134{bottom:-100%}._drawer_14uzm_2._is-closing_14uzm_170._full_14uzm_124{transform:scale(.95);opacity:0}@media (max-width: 1440px){._drawer_14uzm_2{--drawer-width: 608px}}@media (max-width: 1280px){._drawer_14uzm_2{--drawer-width: 648px}}@media (max-width: 768px){._drawer_14uzm_2{--drawer-width: 584px}}@media (max-width: 600px){._drawer_14uzm_2{--drawer-width: 100%}._drawer_14uzm_2._bottom_14uzm_134{--drawer-width: calc(100% - var(--mimir-space-m))}}._overlay_14uzm_207{--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_14uzm_207._opened_14uzm_151{opacity:1;transition:all .3s ease}._overlay_14uzm_207._opened_14uzm_151._unmount_14uzm_223{z-index:var(--overlay-z-index);-webkit-appearance:none;-moz-appearance:none;appearance:none}._overlay_14uzm_207._is-closing_14uzm_170{opacity:0;transition:all .3s ease}._overlay_14uzm_207._unmount_14uzm_223{z-index:-1;-webkit-appearance:none;-moz-appearance:none;appearance:none}
@@ -0,0 +1 @@
1
+ ._scroll-container_7yixd_2{height:100%;padding-right:4px;overflow-y:auto}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar{width:8px;height:8px}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar-track{background:var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light]::-webkit-scrollbar-thumb{background:var(--black-80);border:2px solid var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar{width:8px;height:8px}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-track{background:var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-thumb{background:var(--black-80);border:2px solid var(--white);border-radius:var(--mimir-control-radius)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar{width:4px;height:4px}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-track{border-radius:var(--mimir-control-radius-xs2)}._scroll-container_7yixd_2[data-variant=light][data-size=s]::-webkit-scrollbar-thumb{border:1px solid var(--white);border-radius:var(--mimir-control-radius-xs2)}
@@ -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 R, Fragment as j, jsx as x } from "react/jsx-runtime";
2
- import { c as O } from "../../index-DIxK0V-G.js";
3
- import P, { createContext as W, useRef as ie, Fragment as ue, useReducer as xe, useMemo as F, useId as de, useEffect as Q, useState as pe, useContext as V, forwardRef as Te } from "react";
4
- import { AccordionItem as De } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionButtonType as N, EAccordionContentPosition as A, EAccordionSize as L, EAccordionLinkIconSize as oe, EAccordionButtonStyle as $e, EAccordionIconType as re, EAccordionButtonIconSize as le } from "./constants.js";
6
- import { useMediaQuery as Pe } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
- import { EMediaQuery as ve } from "../../hooks/useMediaQuery/constants.js";
8
- import { Icon as ye } from "../../icons/Icon.js";
9
- import { Link as he } from "../AnchorLink/Link.js";
10
- import { M as se, W as z, y as K, T as ke, o as B, a as X, H as G, I as me, $ as Oe, b as Be, D as ce, u as we, c as C } from "../../keyboard-wis2TUql.js";
11
- import { w as Ne } from "../../use-active-press-CnDeVvQq.js";
12
- import { e as Ae } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { c as Ce, i as H, u as Me, R as Re, H as Le, s as Fe } from "../../open-closed-CJijMeI2.js";
14
- import { C as He } from "../../close-provider-CEutdhG8.js";
15
- import { r as Ue } from "../../bugs-diTMAGNw.js";
16
- import '../../assets/Accordion.css';var ae;
17
- let qe = (ae = P.startTransition) != null ? ae : function(e) {
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 je = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(je || {}), We = ((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))(We || {});
21
- let Qe = { 0: (e) => ({ ...e, disclosureState: X(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
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
- } }, J = W(null);
30
- J.displayName = "DisclosureContext";
31
- function Y(e) {
32
- let t = V(J);
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, Y), d;
35
+ throw Error.captureStackTrace && Error.captureStackTrace(d, Z), d;
36
36
  }
37
37
  return t;
38
38
  }
39
- let Z = W(null);
40
- Z.displayName = "DisclosureAPIContext";
41
- function fe(e) {
42
- let t = V(Z);
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, fe), d;
45
+ throw Error.captureStackTrace && Error.captureStackTrace(d, Ee), d;
46
46
  }
47
47
  return t;
48
48
  }
49
- let ee = W(null);
50
- ee.displayName = "DisclosurePanelContext";
51
- function Ve() {
52
- return V(ee);
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
- let { defaultOpen: d = !1, ...p } = e, c = ie(null), m = K(t, ke((i) => {
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 = "button";
57
+ let Ge = pe;
71
58
  function Je(e, t) {
72
- let d = de(), { id: p = `headlessui-disclosure-button-${d}`, disabled: c = !1, autoFocus: m = !1, ...a } = e, [n, o] = Y("Disclosure.Button"), S = Ve(), s = S === null ? !1 : S === n.panelId, T = ie(null), b = K(T, t, B((u) => {
73
- if (!s) return o({ type: 4, element: u });
74
- })), I = me();
75
- Q(() => {
76
- if (!s) return o({ type: 2, buttonId: p }), () => {
77
- o({ type: 2, buttonId: null });
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, o, s]);
80
- let i = B((u) => {
81
- var f;
82
- if (s) {
79
+ }, [p, l, c]);
80
+ let u = O((r) => {
81
+ var P;
82
+ if (c) {
83
83
  if (n.disclosureState === 1) return;
84
- switch (u.key) {
85
- case C.Space:
86
- case C.Enter:
87
- u.preventDefault(), u.stopPropagation(), o({ type: 0 }), (f = n.buttonElement) == null || f.focus();
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 (u.key) {
91
- case C.Space:
92
- case C.Enter:
93
- u.preventDefault(), u.stopPropagation(), o({ type: 0 });
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
- }), _ = B((u) => {
97
- switch (u.key) {
98
- case C.Space:
99
- u.preventDefault();
96
+ }), f = O((r) => {
97
+ switch (r.key) {
98
+ case A.Space:
99
+ r.preventDefault();
100
100
  break;
101
101
  }
102
- }), g = B((u) => {
103
- var f;
104
- Ue(u.currentTarget) || c || (s ? (o({ type: 0 }), (f = n.buttonElement) == null || f.focus()) : o({ type: 0 }));
105
- }), { isFocusVisible: E, focusProps: v } = Oe({ autoFocus: m }), { isHovered: y, hoverProps: D } = Be({ isDisabled: c }), { pressed: M, pressProps: $ } = Ne({ disabled: c }), U = F(() => ({ open: n.disclosureState === 0, hover: y, active: M, disabled: c, focus: E, autofocus: m }), [n, y, M, E, c, m]), w = Ae(e, n.buttonElement), h = s ? ce({ ref: b, type: w, disabled: c || void 0, autoFocus: m, onKeyDown: i, onClick: g }, v, D, $) : ce({ ref: b, id: p, type: w, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: c || void 0, autoFocus: m, onKeyDown: i, onKeyUp: _, onClick: g }, v, D, $);
106
- return G({ mergeRefs: I, ourProps: h, theirProps: a, slot: U, defaultTag: Ge, name: "Disclosure.Button" });
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 Ye = "div", Ze = se.RenderStrategy | se.Static;
109
- function et(e, t) {
110
- let d = de(), { id: p = `headlessui-disclosure-panel-${d}`, transition: c = !1, ...m } = e, [a, n] = Y("Disclosure.Panel"), { close: o } = fe("Disclosure.Panel"), S = me(), [s, T] = pe(null), b = K(t, B((v) => {
111
- qe(() => n({ type: 5, element: v }));
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
- Q(() => (n({ type: 3, panelId: p }), () => {
113
+ V(() => (n({ type: 3, panelId: p }), () => {
114
114
  n({ type: 3, panelId: null });
115
115
  }), [p, n]);
116
- let I = Me(), [i, _] = Re(c, s, I !== null ? (I & H.Open) === H.Open : a.disclosureState === 0), g = F(() => ({ open: a.disclosureState === 0, close: o }), [a.disclosureState, o]), E = { ref: b, id: p, ...Le(_) };
117
- return P.createElement(Fe, null, P.createElement(ee.Provider, { value: a.panelId }, G({ mergeRefs: S, ourProps: E, theirProps: m, slot: g, defaultTag: Ye, features: Ze, visible: i, name: "Disclosure.Panel" })));
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 tt = z(Xe), _e = z(Je), Ee = z(et), nt = Object.assign(tt, { Button: _e, Panel: Ee });
120
- const ot = "_icon_1x2lg_2", rt = "_open_1x2lg_15", lt = "_square_1x2lg_19", st = "_circle_1x2lg_23", ct = "_disabled_1x2lg_23", at = "_accordion_1x2lg_37", it = "_button_1x2lg_49", ut = "_header_1x2lg_53", dt = "_title_1x2lg_69", pt = "_panel_1x2lg_96", mt = "_m_1x2lg_133", ft = "_s_1x2lg_19", l = {
121
- icon: ot,
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: rt,
124
- square: lt,
125
- circle: st,
126
- disabled: ct,
127
- accordion: at,
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: it,
131
- header: ut,
132
- title: dt,
130
+ button: dt,
131
+ header: pt,
132
+ title: mt,
133
133
  "title-uppercase": "_title-uppercase_1x2lg_72",
134
- panel: pt,
134
+ panel: ft,
135
135
  "content-bottom": "_content-bottom_1x2lg_109",
136
136
  "link-open": "_link-open_1x2lg_129",
137
- m: mt,
138
- s: ft,
137
+ m: _t,
138
+ s: Et,
139
139
  "wrapper-button": "_wrapper-button_1x2lg_161"
140
- }, Ot = Te(
140
+ }, wt = Pe(
141
141
  ({
142
142
  title: e,
143
143
  disabled: t,
144
- buttonType: d = N.BUTTON,
144
+ buttonType: d = w.BUTTON,
145
145
  children: p,
146
- showTitleByDefault: c = !0,
146
+ showTitleByDefault: a = !0,
147
147
  linkClassName: m,
148
- size: a = L.M,
148
+ size: i = H.M,
149
149
  titleUppercase: n,
150
- buttonStyle: o = $e.CIRCLE,
151
- iconType: S = re.ARROW,
152
- classNameTitle: s,
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: i,
157
- onlyOpenSubtitleNode: _,
158
- classNameSubtitleContainer: g,
159
- activeKey: E,
156
+ subtitleNode: u,
157
+ onlyOpenSubtitleNode: f,
158
+ classNameSubtitleContainer: E,
159
+ activeKey: _,
160
160
  defaultActiveKey: v,
161
161
  onChange: y,
162
- contentPosition: D = A.BOTTOM
162
+ needStopPropagation: C = !1,
163
+ contentPosition: D = N.BOTTOM
163
164
  }, M) => {
164
- const $ = E !== void 0, [U, w] = pe(
165
+ const h = _ !== void 0, [R, L] = fe(
165
166
  () => !!v
166
- ), h = $ ? !!E : U, u = Pe(ve.XS1), f = d === N.LINK, te = {
167
- [l["is-link"]]: f
168
- }, q = {
169
- [l["content-top"]]: D === A.TOP,
170
- [l["content-bottom"]]: D === A.BOTTOM
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
- Q(() => {
173
- $ && w(!!E);
174
- }, [E, $]);
175
- const ge = () => {
173
+ V(() => {
174
+ h && L(!!_);
175
+ }, [_, h]);
176
+ const be = (o) => {
177
+ var re;
176
178
  if (t)
177
179
  return;
178
- const r = !h;
179
- y == null || y(r), $ || w(r);
180
- }, Se = a === L.S ? oe.S : oe.M, be = (r) => ({
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: u ? "s" : "l",
185
+ size: P ? "s" : "l",
183
186
  rightIcon: {
184
- iconName: Se,
185
- className: O({
186
- [l["link-open"]]: r
187
+ iconName: Ie,
188
+ className: k({
189
+ [s["link-open"]]: o
187
190
  })
188
191
  }
189
- }), Ie = (r) => {
190
- const k = () => S === re.DROPDOWN ? a === L.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === L.S ? le.S : le.M;
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 N.LINK:
195
+ case w.LINK:
193
196
  return e;
194
- case N.BUTTON:
195
- return /* @__PURE__ */ R(j, { children: [
197
+ case w.BUTTON:
198
+ return /* @__PURE__ */ F(W, { children: [
196
199
  /* @__PURE__ */ x(
197
200
  "span",
198
201
  {
199
- className: O(
200
- l.title,
201
- s,
202
- n && l["title-uppercase"]
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: O(
211
- l["icon-container"],
212
- r && l.open,
213
- t && l.disabled,
214
- l[o],
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
- ye,
222
+ ke,
220
223
  {
221
- iconName: k(),
222
- className: l.icon,
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
- }, ne = (r, k) => /* @__PURE__ */ x(
233
- Ee,
235
+ }, oe = (o, g) => /* @__PURE__ */ x(
236
+ Se,
234
237
  {
235
238
  "data-testid": "accordion-panel",
236
- className: O(
237
- l.panel,
239
+ className: k(
240
+ s.panel,
238
241
  T,
239
- te,
240
- q
242
+ ne,
243
+ j
241
244
  ),
242
- children: /* @__PURE__ */ x(De, { size: a, children: typeof p == "function" ? p({
243
- open: r,
244
- close: k
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__ */ R(j, { children: [
251
+ return /* @__PURE__ */ F(W, { children: [
249
252
  /* @__PURE__ */ x(
250
253
  "div",
251
254
  {
252
- className: O(
253
- l.accordion,
254
- l[a],
255
- te,
255
+ className: k(
256
+ s.accordion,
257
+ s[i],
258
+ ne,
256
259
  b,
257
- q
260
+ j
258
261
  ),
259
262
  children: /* @__PURE__ */ x(
260
- nt,
263
+ rt,
261
264
  {
262
265
  ref: M,
263
- defaultOpen: h,
264
- children: ({ open: r, close: k }) => /* @__PURE__ */ R(j, { children: [
265
- D === A.TOP && r && ne(r, k),
266
- (!r || c) && /* @__PURE__ */ x(
267
- _e,
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: f ? he : N.BUTTON,
271
- onClick: ge,
272
- className: O(l.button, q, {
273
- [l.header]: !f,
274
- [l.disabled]: t,
275
- [m ?? ""]: f && 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
- ...f ? be(r) : {},
278
- children: (!r || c) && Ie(r)
280
+ ...B ? xe(o) : {},
281
+ children: (!o || a) && Te(o)
279
282
  }
280
283
  ),
281
- D === A.BOTTOM && r && ne(r, k)
284
+ D === N.BOTTOM && o && oe(o, g)
282
285
  ] })
283
286
  },
284
- E ? String(h) : void 0
287
+ _ ? String(r) : void 0
285
288
  )
286
289
  }
287
290
  ),
288
- (i || _) && /* @__PURE__ */ R("div", { className: g, children: [
289
- i,
290
- h && _
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
- Ot as Accordion
299
+ wt as Accordion
297
300
  };
@@ -1,38 +1,41 @@
1
- import { jsxs as f, Fragment as I, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as a, Fragment as oe, jsx as t } from "react/jsx-runtime";
2
2
  import { c as n } from "../../index-DIxK0V-G.js";
3
- import { forwardRef as q, useState as M, useRef as J, useCallback as h, useEffect as U } from "react";
4
- import { EDrawerPosition as O } from "./constants.js";
5
- import { useContainer as Z } from "./hooks.js";
6
- import { useMediaQuery as $ } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
- import { EMediaQuery as ee } from "../../hooks/useMediaQuery/constants.js";
8
- import { useLockBodyScroll as te } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
9
- import { useResizeObserver as oe } from "../../hooks/useResizeObserver/useResizeObserver.js";
10
- import { Button as S } from "../Button/Button.js";
11
- import { EButtonVariantDefault as ne, EButtonSize as r } from "../Button/constants.js";
12
- import { Loader as se } from "../Loader/Loader.js";
13
- import { Portal as re } from "../Portal/Portal.js";
14
- import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13ua6_26", le = "_header_13ua6_44", ce = "_title_13ua6_58", ue = "_space_13ua6_72", de = "_inner_13ua6_83", me = "_button_13ua6_86", _e = "_footer_13ua6_91", fe = "_left_13ua6_104", he = "_right_13ua6_108", pe = "_full_13ua6_112", ye = "_bottom_13ua6_122", ge = "_opened_13ua6_139", Ce = "_overlay_13ua6_195", ve = "_unmount_13ua6_211", e = {
15
- drawer: ae,
16
- content: ie,
17
- "is-loading": "_is-loading_13ua6_40",
18
- header: le,
19
- "sticky-header": "_sticky-header_13ua6_52",
20
- title: ce,
21
- space: ue,
22
- inner: de,
23
- button: me,
24
- footer: _e,
25
- "footer-button": "_footer-button_13ua6_100",
26
- left: fe,
27
- right: he,
28
- full: pe,
29
- bottom: ye,
30
- "full-bottom-height": "_full-bottom-height_13ua6_133",
31
- opened: ge,
32
- "is-closing": "_is-closing_13ua6_158",
33
- overlay: Ce,
34
- unmount: ve
35
- }, Ne = 300, be = (a) => a ? {
3
+ import { forwardRef as ne, useState as z, useRef as L, useEffect as M, useCallback as g } from "react";
4
+ import { EDrawerPosition as R } from "./constants.js";
5
+ import { useContainer as re } from "./hooks.js";
6
+ import { ScrollWrapper as se } from "./ScrollWrapper/index.js";
7
+ import { useMediaQuery as ie } from "../../hooks/useMediaQuery/useMediaQuery.js";
8
+ import { EMediaQuery as le } from "../../hooks/useMediaQuery/constants.js";
9
+ import { useLockBodyScroll as ae } from "../../hooks/useLockBodyScroll/useLockBodyScroll.js";
10
+ import { useResizeObserver as ce } from "../../hooks/useResizeObserver/useResizeObserver.js";
11
+ import { Button as H } from "../Button/Button.js";
12
+ import { EButtonVariantDefault as ue, EButtonSize as c } from "../Button/constants.js";
13
+ import { Loader as me } from "../Loader/Loader.js";
14
+ import { Portal as de } from "../Portal/Portal.js";
15
+ import { EScrollBarVariant as fe, EScrollBarSize as _e } from "../ScrollBar/constants.js";
16
+ import '../../assets/Drawer.css';const he = "_drawer_14uzm_2", pe = "_content_14uzm_26", ze = "_header_14uzm_45", ge = "_title_14uzm_59", ye = "_space_14uzm_73", ve = "_inner_14uzm_84", be = "_button_14uzm_95", Ce = "_footer_14uzm_100", we = "_left_14uzm_116", Ne = "_right_14uzm_120", ke = "_full_14uzm_124", Se = "_bottom_14uzm_134", Be = "_opened_14uzm_151", Ee = "_overlay_14uzm_207", Ie = "_unmount_14uzm_223", e = {
17
+ drawer: he,
18
+ content: pe,
19
+ "is-loading": "_is-loading_14uzm_41",
20
+ header: ze,
21
+ "sticky-header": "_sticky-header_14uzm_53",
22
+ title: ge,
23
+ space: ye,
24
+ inner: ve,
25
+ button: be,
26
+ footer: Ce,
27
+ "has-scroll": "_has-scroll_14uzm_109",
28
+ "footer-button": "_footer-button_14uzm_112",
29
+ left: we,
30
+ right: Ne,
31
+ full: ke,
32
+ bottom: Se,
33
+ "full-bottom-height": "_full-bottom-height_14uzm_145",
34
+ opened: Be,
35
+ "is-closing": "_is-closing_14uzm_170",
36
+ overlay: Ee,
37
+ unmount: Ie
38
+ }, Oe = 300, Le = (u) => u ? {
36
39
  drawer: {
37
40
  position: "absolute",
38
41
  zIndex: 100
@@ -41,120 +44,157 @@ import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13
41
44
  position: "absolute",
42
45
  zIndex: 90
43
46
  }
44
- } : {}, Ae = q(
45
- (a, L) => {
47
+ } : {}, Ye = ne(
48
+ (u, T) => {
46
49
  const {
47
- as: R = "div",
48
- isOpen: s,
49
- onClose: i,
50
- title: T,
51
- className: x,
52
- unmount: p = !0,
53
- isLoading: l = !1,
54
- stickyHeader: z,
55
- fullBottomHeight: D = !1,
56
- position: c = O.RIGHT,
57
- paddingRight: A = 8,
58
- footer: u,
59
- children: H,
60
- classNameTitle: P,
61
- classNameHeader: X,
62
- classNameInner: j,
63
- classNameContent: F,
64
- classNameFooter: Q,
65
- closeOnClickOutside: y = !0,
66
- showCloseButton: g = !0,
67
- getContainer: d,
68
- ...G
69
- } = a, [C, v] = M(!1), [K, N] = M(!1), b = J(), m = $(ee.XS1), { ref: V } = oe({
70
- enabled: c === O.BOTTOM
71
- }), w = Z(d);
72
- te({
73
- on: s && !C,
74
- paddingRight: A
50
+ as: x = "div",
51
+ isOpen: r,
52
+ onClose: m,
53
+ title: D,
54
+ className: A,
55
+ unmount: y = !0,
56
+ isLoading: s = !1,
57
+ stickyHeader: P,
58
+ fullBottomHeight: X = !1,
59
+ position: d = R.RIGHT,
60
+ paddingRight: j = 8,
61
+ footer: f,
62
+ children: F,
63
+ classNameTitle: G,
64
+ classNameHeader: Q,
65
+ classNameInner: V,
66
+ classNameContent: W,
67
+ classNameFooter: K,
68
+ closeOnClickOutside: v = !0,
69
+ showCloseButton: b = !0,
70
+ getContainer: _,
71
+ ...Y
72
+ } = u, [C, w] = z(!1), [q, N] = z(!1), k = L(), h = ie(le.XS1), { ref: J } = ce({
73
+ enabled: d === R.BOTTOM
74
+ }), S = re(_), i = L(null), [U, Z] = z(!1);
75
+ M(() => {
76
+ const l = () => {
77
+ if (i.current) {
78
+ const { scrollHeight: ee, clientHeight: te } = i.current;
79
+ Z(ee > te);
80
+ }
81
+ };
82
+ l();
83
+ const O = new ResizeObserver(l);
84
+ return i.current && O.observe(i.current), () => {
85
+ O.disconnect();
86
+ };
87
+ }, [r, s]), ae({
88
+ on: r && !C,
89
+ paddingRight: j
75
90
  });
76
- const o = h(() => {
77
- i && (v(!0), b.current = setTimeout(() => {
78
- i(), v(!1);
79
- }, Ne));
80
- }, [i]), W = h(() => {
81
- y && o();
82
- }, [y, o]), _ = h(
83
- (Y) => {
84
- Y.key === "Escape" && o();
91
+ const o = g(() => {
92
+ m && (w(!0), k.current = setTimeout(() => {
93
+ m(), w(!1);
94
+ }, Oe));
95
+ }, [m]), $ = g(() => {
96
+ v && o();
97
+ }, [v, o]), p = g(
98
+ (l) => {
99
+ l.key === "Escape" && o();
85
100
  },
86
101
  [o]
87
102
  );
88
- U(() => (s && (N(!0), window.addEventListener("keydown", _)), () => {
89
- N(!1), clearTimeout(b.current), window.removeEventListener("keydown", _);
90
- }), [s, _]);
91
- const k = {
92
- [e.opened]: K,
103
+ M(() => (r && (N(!0), window.addEventListener("keydown", p)), () => {
104
+ N(!1), clearTimeout(k.current), window.removeEventListener("keydown", p);
105
+ }), [r, p]);
106
+ const B = {
107
+ [e.opened]: q,
93
108
  [e["is-closing"]]: C,
94
- [e["full-bottom-height"]]: D,
95
- [e["is-loading"]]: l
109
+ [e["full-bottom-height"]]: X,
110
+ [e["is-loading"]]: s
96
111
  };
97
- if (!s && p)
112
+ if (!r && y)
98
113
  return null;
99
- const B = be(d !== void 0 && d !== !1), E = /* @__PURE__ */ f(I, { children: [
100
- /* @__PURE__ */ t(
101
- R,
114
+ const E = Le(_ !== void 0 && _ !== !1), I = /* @__PURE__ */ a(oe, { children: [
115
+ /* @__PURE__ */ a(
116
+ x,
102
117
  {
103
- ref: L,
104
- "aria-hidden": !s,
118
+ ref: T,
119
+ "aria-hidden": !r,
105
120
  role: "dialog",
106
- style: B.drawer,
107
- className: n(e.drawer, e[c], k, x),
108
- ...G,
109
- children: /* @__PURE__ */ t(
110
- "section",
111
- {
112
- ref: V,
113
- className: n(
114
- e.content,
115
- F,
116
- e[c],
117
- {
118
- [e["is-loading"]]: !!l
119
- }
120
- ),
121
- children: l ? /* @__PURE__ */ t(se, {}) : /* @__PURE__ */ f(I, { children: [
122
- /* @__PURE__ */ f(
123
- "header",
121
+ style: E.drawer,
122
+ className: n(e.drawer, e[d], B, A),
123
+ ...Y,
124
+ children: [
125
+ /* @__PURE__ */ a(
126
+ "section",
127
+ {
128
+ ref: J,
129
+ className: n(
130
+ e.content,
131
+ W,
132
+ e[d],
124
133
  {
125
- className: n(e.header, X, {
126
- [e["sticky-header"]]: z
127
- }),
128
- children: [
129
- /* @__PURE__ */ t("h2", { className: n(e.title, P), children: T }),
130
- /* @__PURE__ */ t("div", { className: e.space, children: g && /* @__PURE__ */ t(
131
- S,
132
- {
133
- variant: ne.SecondaryWhite,
134
- isIconButton: !0,
135
- size: m ? r.S : r.M,
136
- iconName: "Close16px",
137
- onClick: o,
138
- className: e.button
139
- }
140
- ) })
141
- ]
134
+ [e["is-loading"]]: !!s
142
135
  }
143
136
  ),
144
- /* @__PURE__ */ t("div", { className: n(e.inner, j), children: H }),
145
- /* @__PURE__ */ t("footer", { className: n(e.footer, Q), children: typeof u == "function" ? u({ handleClose: o }) : u || g && /* @__PURE__ */ t(
146
- S,
137
+ children: [
138
+ /* @__PURE__ */ a(
139
+ "header",
140
+ {
141
+ className: n(e.header, Q, {
142
+ [e["sticky-header"]]: P
143
+ }),
144
+ children: [
145
+ /* @__PURE__ */ t("h2", { className: n(e.title, G), children: D }),
146
+ /* @__PURE__ */ t("div", { className: e.space, children: b && /* @__PURE__ */ t(
147
+ H,
148
+ {
149
+ variant: ue.SecondaryWhite,
150
+ isIconButton: !0,
151
+ size: h ? c.S : c.M,
152
+ iconName: "Close16px",
153
+ onClick: o,
154
+ className: e.button
155
+ }
156
+ ) })
157
+ ]
158
+ }
159
+ ),
160
+ /* @__PURE__ */ t(
161
+ se,
162
+ {
163
+ ref: i,
164
+ className: n(
165
+ e.inner,
166
+ {
167
+ [e["is-loading"]]: !!s
168
+ },
169
+ V
170
+ ),
171
+ variant: fe.LIGHT,
172
+ size: _e.M,
173
+ children: s ? /* @__PURE__ */ t(me, {}) : F
174
+ }
175
+ )
176
+ ]
177
+ }
178
+ ),
179
+ /* @__PURE__ */ t(
180
+ "footer",
181
+ {
182
+ className: n(e.footer, K, {
183
+ [e["has-scroll"]]: U
184
+ }),
185
+ children: typeof f == "function" ? f({ handleClose: o }) : f || b && /* @__PURE__ */ t(
186
+ H,
147
187
  {
148
- size: m ? r.M : r.XXL,
149
- full: m,
188
+ size: h ? c.L : c.XXL,
189
+ full: h,
150
190
  onClick: o,
151
191
  className: e["footer-button"],
152
192
  children: "Закрыть"
153
193
  }
154
- ) })
155
- ] })
156
- }
157
- )
194
+ )
195
+ }
196
+ )
197
+ ]
158
198
  }
159
199
  ),
160
200
  /* @__PURE__ */ t(
@@ -163,20 +203,20 @@ import '../../assets/Drawer.css';const ae = "_drawer_13ua6_2", ie = "_content_13
163
203
  className: n(
164
204
  e.overlay,
165
205
  {
166
- [e.unmount]: !p
206
+ [e.unmount]: !y
167
207
  },
168
- k
208
+ B
169
209
  ),
170
- style: B.overlay,
210
+ style: E.overlay,
171
211
  "data-testid": "drawer-overlay",
172
- onClick: W
212
+ onClick: $
173
213
  }
174
214
  )
175
215
  ] });
176
- return w === !1 ? E : /* @__PURE__ */ t(re, { element: w, children: E });
216
+ return S === !1 ? I : /* @__PURE__ */ t(de, { element: S, children: I });
177
217
  }
178
218
  );
179
219
  export {
180
- Ne as ANIMATION_DELAY,
181
- Ae as Drawer
220
+ Oe as ANIMATION_DELAY,
221
+ Ye as Drawer
182
222
  };
@@ -0,0 +1,11 @@
1
+ import { default as React } from 'react';
2
+ import { EScrollBarSize, EScrollBarVariant } from '../../ScrollBar/constants';
3
+
4
+ type TProps = {
5
+ children: React.ReactNode;
6
+ className?: string;
7
+ variant?: `${EScrollBarVariant}`;
8
+ size?: `${EScrollBarSize}`;
9
+ };
10
+ export declare const ScrollWrapper: React.ForwardRefExoticComponent<TProps & React.RefAttributes<HTMLDivElement>>;
11
+ export {};
@@ -0,0 +1,27 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { c as t } from "../../../index-DIxK0V-G.js";
3
+ import { forwardRef as i } from "react";
4
+ import { EScrollBarVariant as e, EScrollBarSize as m } from "../../ScrollBar/constants.js";
5
+ import '../../../assets/index2.css';const n = {
6
+ "scroll-container": "_scroll-container_7yixd_2"
7
+ }, p = i(
8
+ ({
9
+ children: r,
10
+ className: a,
11
+ variant: o = e.LIGHT,
12
+ size: l = m.M
13
+ }, c) => /* @__PURE__ */ s(
14
+ "div",
15
+ {
16
+ ref: c,
17
+ className: t(n["scroll-container"], a),
18
+ "data-variant": o,
19
+ "data-size": l,
20
+ children: r
21
+ }
22
+ )
23
+ );
24
+ p.displayName = "ScrollWrapper";
25
+ export {
26
+ p as ScrollWrapper
27
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.43.18",
4
+ "version": "1.43.20",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {