mimir-ui-kit 1.37.18 → 1.38.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. package/dist/assets/Dropdown.css +1 -0
  2. package/dist/close-provider-CEutdhG8.js +9 -0
  3. package/dist/combobox-CVtJDVoZ.js +980 -0
  4. package/dist/components/Accordion/Accordion.js +91 -95
  5. package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
  6. package/dist/components/DatePicker/DatePicker.js +19 -19
  7. package/dist/components/DatePicker/hooks.js +11 -11
  8. package/dist/components/Dropdown/Dropdown.d.ts +45 -0
  9. package/dist/components/Dropdown/Dropdown.js +333 -0
  10. package/dist/components/Dropdown/index.d.ts +1 -0
  11. package/dist/components/Dropdown/index.js +4 -0
  12. package/dist/components/MultiSelectSearch/MultiSelectSearch.js +18 -18
  13. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  14. package/dist/components/SelectSearch/SelectSearch.js +21 -21
  15. package/dist/components/Switcher/Switcher.js +4 -4
  16. package/dist/components/TabTrail/TabTrail.js +4 -4
  17. package/dist/components/index.d.ts +1 -0
  18. package/dist/components/index.js +117 -115
  19. package/dist/{field-C1kt7aNM.js → field-FJ34aSs4.js} +2 -2
  20. package/dist/{focus-management-DOYCPyGg.js → focus-management-DE4t_lW3.js} +2 -1
  21. package/dist/{hidden-PvGXrYUY.js → hidden-DbgtYPOH.js} +1 -1
  22. package/dist/index.js +141 -139
  23. package/dist/{keyboard-mgWkd2Vh.js → keyboard-B0lm_zyn.js} +111 -114
  24. package/dist/{label-D4GFpe5F.js → label-y3ANLTNC.js} +2 -2
  25. package/dist/open-closed-CdldUPoq.js +86 -0
  26. package/dist/portal-WDFNoIMz.js +1908 -0
  27. package/dist/{use-active-press-CqLGIFz7.js → use-active-press-86hajhdd.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/combobox-BpYucpxz.js +0 -2896
  30. package/dist/open-closed-D2VjDhAN.js +0 -86
@@ -1,28 +1,24 @@
1
- import { jsxs as A, Fragment as K, jsx as I } from "react/jsx-runtime";
2
- import { c as D } from "../../index-DIxK0V-G.js";
3
- import b, { createContext as M, useRef as oe, Fragment as re, useReducer as pe, useMemo as O, useId as le, useEffect as se, useState as ae, useContext as U, forwardRef as me } from "react";
1
+ import { jsxs as A, Fragment as H, jsx as I } from "react/jsx-runtime";
2
+ import { c as v } from "../../index-DIxK0V-G.js";
3
+ import x, { createContext as K, useRef as oe, Fragment as re, useReducer as pe, useMemo as O, useId as se, useEffect as le, useState as ae, useContext as U, forwardRef as me } from "react";
4
4
  import { AccordionItem as fe } from "./AccordionItem/AccordionItem.js";
5
- import { EAccordionButtonType as g, EAccordionSize as B, EAccordionLinkIconSize as J, EAccordionButtonStyle as _e, EAccordionIconType as Y, EAccordionButtonIconSize as Z } from "./constants.js";
5
+ import { EAccordionButtonType as P, EAccordionSize as B, EAccordionLinkIconSize as J, EAccordionButtonStyle as _e, EAccordionIconType as Y, EAccordionButtonIconSize as Z } from "./constants.js";
6
6
  import { useMediaQuery as ye } from "../../hooks/useMediaQuery/useMediaQuery.js";
7
7
  import { EMediaQuery as Ee } from "../../hooks/useMediaQuery/constants.js";
8
8
  import { Icon as Se } from "../../icons/Icon.js";
9
9
  import { Link as ke } from "../AnchorLink/Link.js";
10
- import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as ve, D as te, u as xe, c as T } from "../../keyboard-mgWkd2Vh.js";
11
- import { w as he } from "../../use-active-press-CqLGIFz7.js";
12
- import { e as De } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { c as $e, i as R, u as Pe, x as ge, R as Te, s as we } from "../../open-closed-D2VjDhAN.js";
14
- import { r as Ne } from "../../bugs-diTMAGNw.js";
15
- import '../../assets/Accordion.css';let Ce = M(() => {
16
- });
17
- function Ae({ value: e, children: t }) {
18
- return b.createElement(Ce.Provider, { value: e }, t);
19
- }
20
- var ne;
21
- let Be = (ne = b.startTransition) != null ? ne : function(e) {
10
+ import { M as ee, W as q, y as j, T as Ie, o as $, a as W, H as Q, I as ce, $ as be, b as xe, D as te, u as De, c as T } from "../../keyboard-B0lm_zyn.js";
11
+ import { w as he } from "../../use-active-press-86hajhdd.js";
12
+ import { e as ve } from "../../use-resolve-button-type-DhFdPxnv.js";
13
+ import { c as $e, i as R, u as ge, R as Pe, H as Te, s as we } from "../../open-closed-CdldUPoq.js";
14
+ import { C as Ne } from "../../close-provider-CEutdhG8.js";
15
+ import { r as Ce } from "../../bugs-diTMAGNw.js";
16
+ import '../../assets/Accordion.css';var ne;
17
+ let Ae = (ne = x.startTransition) != null ? ne : function(e) {
22
18
  e();
23
19
  };
24
- var Oe = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Oe || {}), Re = ((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))(Re || {});
25
- let Me = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
20
+ var Be = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Be || {}), Oe = ((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))(Oe || {});
21
+ let Re = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0 }) }), 1: (e) => e.disclosureState === 1 ? e : { ...e, disclosureState: 1 }, 2(e, t) {
26
22
  return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
27
23
  }, 3(e, t) {
28
24
  return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
@@ -30,7 +26,7 @@ let Me = { 0: (e) => ({ ...e, disclosureState: W(e.disclosureState, { 0: 1, 1: 0
30
26
  return e.buttonElement === t.element ? e : { ...e, buttonElement: t.element };
31
27
  }, 5(e, t) {
32
28
  return e.panelElement === t.element ? e : { ...e, panelElement: t.element };
33
- } }, V = M(null);
29
+ } }, V = K(null);
34
30
  V.displayName = "DisclosureContext";
35
31
  function z(e) {
36
32
  let t = U(V);
@@ -40,7 +36,7 @@ function z(e) {
40
36
  }
41
37
  return t;
42
38
  }
43
- let X = M(null);
39
+ let X = K(null);
44
40
  X.displayName = "DisclosureAPIContext";
45
41
  function ie(e) {
46
42
  let t = U(X);
@@ -50,40 +46,40 @@ function ie(e) {
50
46
  }
51
47
  return t;
52
48
  }
53
- let G = M(null);
49
+ let G = K(null);
54
50
  G.displayName = "DisclosurePanelContext";
55
- function Fe() {
51
+ function Me() {
56
52
  return U(G);
57
53
  }
58
- function Le(e, t) {
59
- return W(t.type, Me, e, t);
54
+ function Fe(e, t) {
55
+ return W(t.type, Re, e, t);
60
56
  }
61
- let He = re;
62
- function Ke(e, t) {
63
- let { defaultOpen: u = !1, ...p } = e, s = oe(null), m = j(t, Ie((c) => {
64
- s.current = c;
65
- }, e.as === void 0 || e.as === re)), a = pe(Le, { disclosureState: u ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: r }, y] = a, l = $((c) => {
57
+ let Le = re;
58
+ function He(e, t) {
59
+ let { defaultOpen: u = !1, ...p } = e, l = oe(null), m = j(t, Ie((c) => {
60
+ l.current = c;
61
+ }, e.as === void 0 || e.as === re)), a = pe(Fe, { disclosureState: u ? 0 : 1, buttonElement: null, panelElement: null, buttonId: null, panelId: null }), [{ disclosureState: n, buttonId: r }, y] = a, s = $((c) => {
66
62
  y({ type: 1 });
67
- let f = xe(s);
63
+ let f = De(l);
68
64
  if (!f || !r) return;
69
65
  let _ = c ? c instanceof HTMLElement ? c : c.current instanceof HTMLElement ? c.current : f.getElementById(r) : f.getElementById(r);
70
66
  _ == null || _.focus();
71
- }), v = O(() => ({ close: l }), [l]), E = O(() => ({ open: n === 0, close: l }), [n, l]), S = { ref: m };
72
- return b.createElement(V.Provider, { value: a }, b.createElement(X.Provider, { value: v }, b.createElement(Ae, { value: l }, b.createElement($e, { value: W(n, { 0: R.Open, 1: R.Closed }) }, Q({ ourProps: S, theirProps: p, slot: E, defaultTag: He, name: "Disclosure" })))));
67
+ }), b = O(() => ({ close: s }), [s]), E = O(() => ({ open: n === 0, close: s }), [n, s]), S = { ref: m };
68
+ return x.createElement(V.Provider, { value: a }, x.createElement(X.Provider, { value: b }, x.createElement(Ne, { value: s }, x.createElement($e, { value: W(n, { 0: R.Open, 1: R.Closed }) }, Q({ ourProps: S, theirProps: p, slot: E, defaultTag: Le, name: "Disclosure" })))));
73
69
  }
74
- let Ue = "button";
75
- function qe(e, t) {
76
- let u = le(), { id: p = `headlessui-disclosure-button-${u}`, disabled: s = !1, autoFocus: m = !1, ...a } = e, [n, r] = z("Disclosure.Button"), y = Fe(), l = y === null ? !1 : y === n.panelId, v = oe(null), E = j(v, t, $((i) => {
77
- if (!l) return r({ type: 4, element: i });
70
+ let Ke = "button";
71
+ function Ue(e, t) {
72
+ let u = se(), { id: p = `headlessui-disclosure-button-${u}`, disabled: l = !1, autoFocus: m = !1, ...a } = e, [n, r] = z("Disclosure.Button"), y = Me(), s = y === null ? !1 : y === n.panelId, b = oe(null), E = j(b, t, $((i) => {
73
+ if (!s) return r({ type: 4, element: i });
78
74
  })), S = ce();
79
- se(() => {
80
- if (!l) return r({ type: 2, buttonId: p }), () => {
75
+ le(() => {
76
+ if (!s) return r({ type: 2, buttonId: p }), () => {
81
77
  r({ type: 2, buttonId: null });
82
78
  };
83
- }, [p, r, l]);
79
+ }, [p, r, s]);
84
80
  let c = $((i) => {
85
81
  var o;
86
- if (l) {
82
+ if (s) {
87
83
  if (n.disclosureState === 1) return;
88
84
  switch (i.key) {
89
85
  case T.Space:
@@ -105,85 +101,85 @@ function qe(e, t) {
105
101
  }
106
102
  }), _ = $((i) => {
107
103
  var o;
108
- Ne(i.currentTarget) || s || (l ? (r({ type: 0 }), (o = n.buttonElement) == null || o.focus()) : r({ type: 0 }));
109
- }), { isFocusVisible: x, focusProps: h } = be({ autoFocus: m }), { isHovered: w, hoverProps: N } = ve({ isDisabled: s }), { pressed: k, pressProps: P } = he({ disabled: s }), F = O(() => ({ open: n.disclosureState === 0, hover: w, active: k, disabled: s, focus: x, autofocus: m }), [n, w, k, x, s, m]), C = De(e, n.buttonElement), L = l ? te({ ref: E, type: C, disabled: s || void 0, autoFocus: m, onKeyDown: c, onClick: _ }, h, N, P) : te({ ref: E, id: p, type: C, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: s || void 0, autoFocus: m, onKeyDown: c, onKeyUp: f, onClick: _ }, h, N, P);
110
- return Q({ mergeRefs: S, ourProps: L, theirProps: a, slot: F, defaultTag: Ue, name: "Disclosure.Button" });
104
+ Ce(i.currentTarget) || l || (s ? (r({ type: 0 }), (o = n.buttonElement) == null || o.focus()) : r({ type: 0 }));
105
+ }), { isFocusVisible: D, focusProps: h } = be({ autoFocus: m }), { isHovered: w, hoverProps: N } = xe({ isDisabled: l }), { pressed: k, pressProps: g } = he({ disabled: l }), M = O(() => ({ open: n.disclosureState === 0, hover: w, active: k, disabled: l, focus: D, autofocus: m }), [n, w, k, D, l, m]), C = ve(e, n.buttonElement), F = s ? te({ ref: E, type: C, disabled: l || void 0, autoFocus: m, onKeyDown: c, onClick: _ }, h, N, g) : te({ ref: E, id: p, type: C, "aria-expanded": n.disclosureState === 0, "aria-controls": n.panelElement ? n.panelId : void 0, disabled: l || void 0, autoFocus: m, onKeyDown: c, onKeyUp: f, onClick: _ }, h, N, g);
106
+ return Q({ mergeRefs: S, ourProps: F, theirProps: a, slot: M, defaultTag: Ke, name: "Disclosure.Button" });
111
107
  }
112
- let je = "div", We = ee.RenderStrategy | ee.Static;
113
- function Qe(e, t) {
114
- let u = le(), { id: p = `headlessui-disclosure-panel-${u}`, transition: s = !1, ...m } = e, [a, n] = z("Disclosure.Panel"), { close: r } = ie("Disclosure.Panel"), y = ce(), [l, v] = ae(null), E = j(t, $((h) => {
115
- Be(() => n({ type: 5, element: h }));
116
- }), v);
117
- se(() => (n({ type: 3, panelId: p }), () => {
108
+ let qe = "div", je = ee.RenderStrategy | ee.Static;
109
+ function We(e, t) {
110
+ let u = se(), { id: p = `headlessui-disclosure-panel-${u}`, transition: l = !1, ...m } = e, [a, n] = z("Disclosure.Panel"), { close: r } = ie("Disclosure.Panel"), y = ce(), [s, b] = ae(null), E = j(t, $((h) => {
111
+ Ae(() => n({ type: 5, element: h }));
112
+ }), b);
113
+ le(() => (n({ type: 3, panelId: p }), () => {
118
114
  n({ type: 3, panelId: null });
119
115
  }), [p, n]);
120
- let S = Pe(), [c, f] = ge(s, l, S !== null ? (S & R.Open) === R.Open : a.disclosureState === 0), _ = O(() => ({ open: a.disclosureState === 0, close: r }), [a.disclosureState, r]), x = { ref: E, id: p, ...Te(f) };
121
- return b.createElement(we, null, b.createElement(G.Provider, { value: a.panelId }, Q({ mergeRefs: y, ourProps: x, theirProps: m, slot: _, defaultTag: je, features: We, visible: c, name: "Disclosure.Panel" })));
116
+ let S = ge(), [c, f] = Pe(l, s, S !== null ? (S & R.Open) === R.Open : a.disclosureState === 0), _ = O(() => ({ open: a.disclosureState === 0, close: r }), [a.disclosureState, r]), D = { ref: E, id: p, ...Te(f) };
117
+ return x.createElement(we, null, x.createElement(G.Provider, { value: a.panelId }, Q({ mergeRefs: y, ourProps: D, theirProps: m, slot: _, defaultTag: qe, features: je, visible: c, name: "Disclosure.Panel" })));
122
118
  }
123
- let Ve = q(Ke), ue = q(qe), de = q(Qe), ze = Object.assign(Ve, { Button: ue, Panel: de });
124
- const Xe = "_icon_1yk0x_2", Ge = "_open_1yk0x_15", Je = "_square_1yk0x_19", Ye = "_circle_1yk0x_23", Ze = "_disabled_1yk0x_23", et = "_accordion_1yk0x_37", tt = "_header_1yk0x_45", nt = "_title_1yk0x_61", ot = "_panel_1yk0x_88", rt = "_m_1yk0x_112", lt = "_s_1yk0x_19", d = {
125
- icon: Xe,
119
+ let Qe = q(He), ue = q(Ue), de = q(We), Ve = Object.assign(Qe, { Button: ue, Panel: de });
120
+ const ze = "_icon_1yk0x_2", Xe = "_open_1yk0x_15", Ge = "_square_1yk0x_19", Je = "_circle_1yk0x_23", Ye = "_disabled_1yk0x_23", Ze = "_accordion_1yk0x_37", et = "_header_1yk0x_45", tt = "_title_1yk0x_61", nt = "_panel_1yk0x_88", ot = "_m_1yk0x_112", rt = "_s_1yk0x_19", d = {
121
+ icon: ze,
126
122
  "icon-container": "_icon-container_1yk0x_8",
127
- open: Ge,
128
- square: Je,
129
- circle: Ye,
130
- disabled: Ze,
131
- accordion: et,
123
+ open: Xe,
124
+ square: Ge,
125
+ circle: Je,
126
+ disabled: Ye,
127
+ accordion: Ze,
132
128
  "is-link": "_is-link_1yk0x_41",
133
- header: tt,
134
- title: nt,
129
+ header: et,
130
+ title: tt,
135
131
  "title-uppercase": "_title-uppercase_1yk0x_64",
136
- panel: ot,
132
+ panel: nt,
137
133
  "link-open": "_link-open_1yk0x_108",
138
- m: rt,
139
- s: lt,
134
+ m: ot,
135
+ s: rt,
140
136
  "wrapper-button": "_wrapper-button_1yk0x_140"
141
137
  }, It = me(
142
138
  ({
143
139
  title: e,
144
140
  disabled: t,
145
- buttonType: u = g.BUTTON,
141
+ buttonType: u = P.BUTTON,
146
142
  children: p,
147
- showTitleByDefault: s = !0,
143
+ showTitleByDefault: l = !0,
148
144
  linkClassName: m,
149
145
  size: a = B.M,
150
146
  titleUppercase: n,
151
147
  buttonStyle: r = _e.CIRCLE,
152
148
  iconType: y = Y.ARROW,
153
- classNameTitle: l,
154
- classNameContent: v,
149
+ classNameTitle: s,
150
+ classNameContent: b,
155
151
  classNameAccordion: E,
156
152
  classNameIconButton: S,
157
153
  subtitleNode: c,
158
154
  onlyOpenSubtitleNode: f,
159
155
  classNameSubtitleContainer: _
160
- }, x) => {
161
- const [h, w] = ae(!1), N = ye(Ee.XS1), k = u === g.LINK, P = {
156
+ }, D) => {
157
+ const [h, w] = ae(!1), N = ye(Ee.XS1), k = u === P.LINK, g = {
162
158
  [d["is-link"]]: k
163
- }, F = () => {
159
+ }, M = () => {
164
160
  t || w((o) => !o);
165
- }, C = a === B.S ? J.S : J.M, L = (o) => ({
161
+ }, C = a === B.S ? J.S : J.M, F = (o) => ({
166
162
  variant: "anchor",
167
163
  size: N ? "s" : "l",
168
164
  rightIcon: {
169
165
  iconName: C,
170
- className: D({
166
+ className: v({
171
167
  [d["link-open"]]: o
172
168
  })
173
169
  }
174
170
  }), i = (o) => {
175
- const H = () => y === Y.DROPDOWN ? a === B.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === B.S ? Z.S : Z.M;
171
+ const L = () => y === Y.DROPDOWN ? a === B.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : a === B.S ? Z.S : Z.M;
176
172
  switch (u) {
177
- case g.LINK:
173
+ case P.LINK:
178
174
  return e;
179
- case g.BUTTON:
180
- return /* @__PURE__ */ A(K, { children: [
175
+ case P.BUTTON:
176
+ return /* @__PURE__ */ A(H, { children: [
181
177
  /* @__PURE__ */ I(
182
178
  "span",
183
179
  {
184
- className: D(
180
+ className: v(
185
181
  d.title,
186
- l,
182
+ s,
187
183
  n && d["title-uppercase"]
188
184
  ),
189
185
  children: e
@@ -192,7 +188,7 @@ const Xe = "_icon_1yk0x_2", Ge = "_open_1yk0x_15", Je = "_square_1yk0x_19", Ye =
192
188
  /* @__PURE__ */ I(
193
189
  "div",
194
190
  {
195
- className: D(
191
+ className: v(
196
192
  d["icon-container"],
197
193
  o && d.open,
198
194
  t && d.disabled,
@@ -203,7 +199,7 @@ const Xe = "_icon_1yk0x_2", Ge = "_open_1yk0x_15", Je = "_square_1yk0x_19", Ye =
203
199
  children: /* @__PURE__ */ I(
204
200
  Se,
205
201
  {
206
- iconName: H(),
202
+ iconName: L(),
207
203
  className: d.icon,
208
204
  "data-testid": "accordion-icon"
209
205
  }
@@ -215,44 +211,44 @@ const Xe = "_icon_1yk0x_2", Ge = "_open_1yk0x_15", Je = "_square_1yk0x_19", Ye =
215
211
  return null;
216
212
  }
217
213
  };
218
- return /* @__PURE__ */ A(K, { children: [
214
+ return /* @__PURE__ */ A(H, { children: [
219
215
  /* @__PURE__ */ I(
220
216
  "div",
221
217
  {
222
- className: D(
218
+ className: v(
223
219
  d.accordion,
224
220
  d[a],
225
- P,
221
+ g,
226
222
  E
227
223
  ),
228
- children: /* @__PURE__ */ I(ze, { ref: x, children: ({ open: o, close: H }) => /* @__PURE__ */ A(K, { children: [
229
- (!o || s) && /* @__PURE__ */ I(
224
+ children: /* @__PURE__ */ I(Ve, { ref: D, children: ({ open: o, close: L }) => /* @__PURE__ */ A(H, { children: [
225
+ (!o || l) && /* @__PURE__ */ I(
230
226
  ue,
231
227
  {
232
228
  disabled: t,
233
- as: k ? ke : g.BUTTON,
234
- onClick: F,
235
- className: D({
229
+ as: k ? ke : P.BUTTON,
230
+ onClick: M,
231
+ className: v({
236
232
  [d.header]: !k,
237
233
  [d.disabled]: t,
238
234
  [m ?? ""]: k && m
239
235
  }),
240
- ...k ? L(o) : {},
241
- children: (!o || s) && i(o)
236
+ ...k ? F(o) : {},
237
+ children: (!o || l) && i(o)
242
238
  }
243
239
  ),
244
240
  o && /* @__PURE__ */ I(
245
241
  de,
246
242
  {
247
243
  "data-testid": "accordion-panel",
248
- className: D(
244
+ className: v(
249
245
  d.panel,
250
- v,
251
- P
246
+ b,
247
+ g
252
248
  ),
253
249
  children: /* @__PURE__ */ I(fe, { size: a, children: typeof p == "function" ? p({
254
250
  open: o,
255
- close: H
251
+ close: L
256
252
  }) : p })
257
253
  }
258
254
  )
@@ -1,10 +1,10 @@
1
1
  import { jsxs as L, jsx as p } from "react/jsx-runtime";
2
- import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-mgWkd2Vh.js";
2
+ import { W as O, p as V, o as d, $ as W, b as X, D as q, H as z, c as D } from "../../keyboard-B0lm_zyn.js";
3
3
  import h, { useId as J, useState as Q, useMemo as Y, useCallback as Z, forwardRef as ee } from "react";
4
- import { w as re } from "../../use-active-press-CqLGIFz7.js";
5
- import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-D4GFpe5F.js";
4
+ import { w as re } from "../../use-active-press-86hajhdd.js";
5
+ import { u as ae, a as oe, b as te, T as ce, I as ne, G as se, j as ie, p as le, K as de } from "../../label-y3ANLTNC.js";
6
6
  import { r as be } from "../../bugs-diTMAGNw.js";
7
- import { H as ue } from "../../field-C1kt7aNM.js";
7
+ import { H as ue } from "../../field-FJ34aSs4.js";
8
8
  import { c as me } from "../../index-DIxK0V-G.js";
9
9
  import { Icon as fe } from "../../icons/Icon.js";
10
10
  import '../../assets/CheckboxMimir.css';let pe = "span";
@@ -1,6 +1,6 @@
1
1
  import { jsxs as H, jsx as a } from "react/jsx-runtime";
2
2
  import { c as _ } from "../../index-DIxK0V-G.js";
3
- import { memo as V, forwardRef as tt, useState as w, useEffect as T } from "react";
3
+ import { memo as V, forwardRef as tt, useState as N, useEffect as T } from "react";
4
4
  import { MAX_DAY as st, MAX_MONTH as et, DATE_LENGTH as it } from "./constants.js";
5
5
  import { DatePickerModal as rt } from "./DatePickerModal.js";
6
6
  import { MonthPickerModal as ot } from "./MonthPickerModal.js";
@@ -31,13 +31,13 @@ const dt = {
31
31
  validateImmediately: b,
32
32
  variant: X,
33
33
  disabled: S = !1,
34
- editable: D = !1,
34
+ editable: w = !1,
35
35
  openOnInput: j = !0,
36
36
  ...E
37
37
  }, F) => {
38
- const [l, m] = w(!1), [g, f] = w(p), [o, k] = w(
38
+ const [D, m] = N(!1), [g, f] = N(p), [o, k] = N(
39
39
  () => i && !isNaN(new Date(i).getTime()) ? new Date(i) : void 0
40
- ), [n, h] = w(x), [G, A] = w("");
40
+ ), [n, h] = N(x), [G, A] = N("");
41
41
  T(() => {
42
42
  h(x);
43
43
  }, [x]), T(() => {
@@ -51,14 +51,14 @@ const dt = {
51
51
  T(() => {
52
52
  b && (u ? (h(!1), d == null || d({ name: c, active: !1 })) : (h(!0), d == null || d({ name: c, active: !0 })));
53
53
  }, [b, c, u]), ct({
54
- isActive: l,
54
+ isActive: D,
55
55
  setActive: (t) => {
56
56
  m(t), f(p);
57
57
  },
58
58
  className: e["calendar-block"]
59
59
  });
60
60
  const K = () => {
61
- !S && (j || !D) && m(!0);
61
+ !S && (j || !w) && m(!0);
62
62
  }, W = (t) => {
63
63
  isNaN(t.getTime()) || (k(t), s == null || s({
64
64
  value: y.Date(t, "yyyy-mm-dd"),
@@ -68,15 +68,15 @@ const dt = {
68
68
  name: c
69
69
  }), r == null || r(y.Date(t, "yyyy-mm-dd"));
70
70
  }, q = (t) => {
71
- if (D) {
72
- const N = t.target.value.replace(/[^\d]/g, "");
73
- if (N.length === 0)
71
+ if (w) {
72
+ const l = t.target.value.replace(/[^\d]/g, "");
73
+ if (l.length === 0)
74
74
  A(""), s == null || s({ value: "", name: c }), r == null || r("");
75
75
  else {
76
76
  const [I, O, Y] = [
77
- L(N.substring(0, 2), st),
78
- L(N.substring(2, 4), et),
79
- N.substring(4, 8)
77
+ L(l.substring(0, 2), st),
78
+ L(l.substring(2, 4), et),
79
+ l.substring(4, 8)
80
80
  ], $ = [I, O, Y].filter(Boolean).join("/");
81
81
  if (A($), $.length === it) {
82
82
  const B = parseInt(Y), P = /* @__PURE__ */ new Date(
@@ -89,7 +89,7 @@ const dt = {
89
89
  }
90
90
  }
91
91
  }
92
- }, J = _(e.wrapper, l && e.active), Q = _(e.input, e.inputBorderControl), Z = {
92
+ }, J = _(e.wrapper, D && e.active), Q = _(e.input, e.inputBorderControl), Z = {
93
93
  onChangeValue: W,
94
94
  date: o || /* @__PURE__ */ new Date(),
95
95
  before: typeof v == "string" ? new Date(v) : v,
@@ -114,9 +114,9 @@ const dt = {
114
114
  "div",
115
115
  {
116
116
  role: "button",
117
- "data-error": n,
117
+ "data-error": !!n,
118
118
  className: _(e["date-wrapper"], {
119
- [e.editable]: D
119
+ [e.editable]: w
120
120
  }),
121
121
  onClick: K,
122
122
  children: /* @__PURE__ */ a(
@@ -133,18 +133,18 @@ const dt = {
133
133
  onChange: q,
134
134
  rightAddon: {
135
135
  addonType: "react-node",
136
- addonContent: /* @__PURE__ */ a(C, { isActive: l })
136
+ addonContent: /* @__PURE__ */ a(C, { isActive: D })
137
137
  },
138
138
  onFocus: () => {
139
- j && !D && m(!0);
139
+ j && !w && m(!0);
140
140
  },
141
- "data-error": n,
141
+ "data-error": !!n,
142
142
  ...E
143
143
  }
144
144
  )
145
145
  }
146
146
  ),
147
- l && /* @__PURE__ */ a(z, { ...Z })
147
+ D && /* @__PURE__ */ a(z, { ...Z })
148
148
  ] }),
149
149
  n && typeof n == "string" && /* @__PURE__ */ a("div", { className: e.textError, children: n })
150
150
  ] });
@@ -1,20 +1,20 @@
1
- import { useRef as g, useEffect as m } from "react";
1
+ import { useRef as x, useEffect as a } from "react";
2
2
  import { BLOCK_WIDTH as f } from "./constants.js";
3
- const x = (d) => {
4
- const t = g(null);
5
- return m(() => {
6
- var n, i, o, r, c, s;
7
- const h = window.innerHeight, w = window.innerWidth;
3
+ const H = (d) => {
4
+ const t = x(null);
5
+ return a(() => {
6
+ var o, r, s, c, l, u;
7
+ const h = window.innerHeight, y = window.innerWidth;
8
8
  if (t.current !== null) {
9
- const a = ((i = (n = t == null ? void 0 : t.current) == null ? void 0 : n.parentElement) == null ? void 0 : i.offsetWidth) ?? 0, u = ((r = (o = t == null ? void 0 : t.current) == null ? void 0 : o.parentElement) == null ? void 0 : r.offsetHeight) ?? 0, l = (s = (c = t == null ? void 0 : t.current) == null ? void 0 : c.parentElement) == null ? void 0 : s.getBoundingClientRect(), p = t.current.offsetHeight;
10
- if (h < l.y + p + u ? t.current.style.top = -p + "px" : t.current.style.top = u + "px", w < l.x + f) {
11
- const e = a - f;
12
- t.current.style.left = (e < 0 ? e / 2 : e) + "px";
9
+ const w = ((r = (o = t == null ? void 0 : t.current) == null ? void 0 : o.parentElement) == null ? void 0 : r.offsetWidth) ?? 0, p = ((c = (s = t == null ? void 0 : t.current) == null ? void 0 : s.parentElement) == null ? void 0 : c.offsetHeight) ?? 0, n = (u = (l = t == null ? void 0 : t.current) == null ? void 0 : l.parentElement) == null ? void 0 : u.getBoundingClientRect(), i = t.current.offsetHeight;
10
+ if (h < n.y + i + p ? n.y - i > 0 ? t.current.style.top = -i + "px" : t.current.style.position = "fixed" : t.current.style.top = p + "px", y < n.x + f) {
11
+ const e = w - f;
12
+ n.x - e < 0 ? t.current.style.left = (e < 0 ? e / 2 : e) + "px" : t.current.style.left = -e + "px";
13
13
  }
14
14
  t.current.style.opacity = "1";
15
15
  }
16
16
  }, [d]), t;
17
17
  };
18
18
  export {
19
- x as useDatePickerPosition
19
+ H as useDatePickerPosition
20
20
  };
@@ -0,0 +1,45 @@
1
+ import { PopoverProps, PopoverPanelProps } from '@headlessui/react';
2
+ import { ReactNode } from 'react';
3
+
4
+ export declare const ANIMATION_DELAY = 300;
5
+ type TProps = {
6
+ /**
7
+ * Пропсы для Popover
8
+ */
9
+ popoverProps?: PopoverProps;
10
+ /**
11
+ * Позиция выпадающего меню относительно кнопки.
12
+ */
13
+ position?: PopoverPanelProps['anchor'];
14
+ /**
15
+ * Компонент при клике на который выпадающее меню открывается.
16
+ */
17
+ buttonContent?: ReactNode;
18
+ /**
19
+ * Компонент выпадающего меню.
20
+ */
21
+ children?: ReactNode | ((props: {
22
+ close: VoidFunction;
23
+ }) => JSX.Element);
24
+ /**
25
+ * Дополнительный класс для компонента.
26
+ */
27
+ className?: string;
28
+ /**
29
+ * Дополнительный класс для кнопки.
30
+ */
31
+ buttonClassName?: string;
32
+ /**
33
+ * Дополнительный класс для панели.
34
+ */
35
+ panelClassName?: string;
36
+ /**
37
+ * Дополнительный класс для меню.
38
+ */
39
+ menuItemsClassName?: string;
40
+ };
41
+ /**
42
+ * Компонент Dropdown, содержит в себе кнопку и панель выпадающего меню
43
+ */
44
+ export declare const Dropdown: import('react').MemoExoticComponent<({ children, position, popoverProps, className, buttonClassName, panelClassName, menuItemsClassName, buttonContent }: TProps) => import("react/jsx-runtime").JSX.Element>;
45
+ export {};