mimir-ui-kit 1.34.8 → 1.34.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,18 +7,18 @@ import { useMediaQuery as _e } from "../../hooks/useMediaQuery/useMediaQuery.js"
7
7
  import { EMediaQuery as Ie } from "../../hooks/useMediaQuery/constants.js";
8
8
  import { Icon as Se } from "../../icons/Icon.js";
9
9
  import { Link as Pe } from "../AnchorLink/Link.js";
10
- import { M as ee, W as q, y as K, T as ke, o as O, a as V, H as W, I as le, $ as ve, b as he, D as te, u as ye, c as g } from "../../keyboard-B0lm_zyn.js";
10
+ import { M as ee, W as q, y as K, T as ke, o as O, a as V, H as W, I as le, $ as ve, b as he, D as ne, u as ye, c as g } from "../../keyboard-B0lm_zyn.js";
11
11
  import { w as Ee } from "../../use-active-press-86hajhdd.js";
12
12
  import { T as be } from "../../use-resolve-button-type-BAxjHhds.js";
13
13
  import { c as De, i as M, u as $e, V as ge, A as Te, s as we } from "../../open-closed-Cy6VDfYc.js";
14
14
  import { r as Ne } from "../../bugs-diTMAGNw.js";
15
15
  import '../../assets/Accordion.css';let Re = F(() => {
16
16
  });
17
- function Ce({ value: e, children: t }) {
18
- return h.createElement(Re.Provider, { value: e }, t);
17
+ function Ce({ value: e, children: n }) {
18
+ return h.createElement(Re.Provider, { value: e }, n);
19
19
  }
20
- var ne;
21
- let Ae = (ne = h.startTransition) != null ? ne : function(e) {
20
+ var te;
21
+ let Ae = (te = h.startTransition) != null ? te : function(e) {
22
22
  e();
23
23
  };
24
24
  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.LinkPanel = 4] = "LinkPanel", e[e.UnlinkPanel = 5] = "UnlinkPanel", e))(Oe || {});
@@ -26,43 +26,43 @@ let xe = { 0: (e) => ({ ...e, disclosureState: V(e.disclosureState, { 0: 1, 1: 0
26
26
  return e.linkedPanel === !0 ? e : { ...e, linkedPanel: !0 };
27
27
  }, 5(e) {
28
28
  return e.linkedPanel === !1 ? e : { ...e, linkedPanel: !1 };
29
- }, 2(e, t) {
30
- return e.buttonId === t.buttonId ? e : { ...e, buttonId: t.buttonId };
31
- }, 3(e, t) {
32
- return e.panelId === t.panelId ? e : { ...e, panelId: t.panelId };
29
+ }, 2(e, n) {
30
+ return e.buttonId === n.buttonId ? e : { ...e, buttonId: n.buttonId };
31
+ }, 3(e, n) {
32
+ return e.panelId === n.panelId ? e : { ...e, panelId: n.panelId };
33
33
  } }, j = F(null);
34
34
  j.displayName = "DisclosureContext";
35
35
  function Q(e) {
36
- let t = H(j);
37
- if (t === null) {
36
+ let n = H(j);
37
+ if (n === null) {
38
38
  let c = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
39
39
  throw Error.captureStackTrace && Error.captureStackTrace(c, Q), c;
40
40
  }
41
- return t;
41
+ return n;
42
42
  }
43
43
  let z = F(null);
44
44
  z.displayName = "DisclosureAPIContext";
45
45
  function se(e) {
46
- let t = H(z);
47
- if (t === null) {
46
+ let n = H(z);
47
+ if (n === null) {
48
48
  let c = new Error(`<${e} /> is missing a parent <Disclosure /> component.`);
49
49
  throw Error.captureStackTrace && Error.captureStackTrace(c, se), c;
50
50
  }
51
- return t;
51
+ return n;
52
52
  }
53
53
  let G = F(null);
54
54
  G.displayName = "DisclosurePanelContext";
55
55
  function Me() {
56
56
  return H(G);
57
57
  }
58
- function Fe(e, t) {
59
- return V(t.type, xe, e, t);
58
+ function Fe(e, n) {
59
+ return V(n.type, xe, e, n);
60
60
  }
61
61
  let Le = U;
62
- function Ue(e, t) {
63
- let { defaultOpen: c = !1, ...o } = e, l = B(null), p = K(t, ke((a) => {
62
+ function Ue(e, n) {
63
+ let { defaultOpen: c = !1, ...o } = e, l = B(null), p = K(n, ke((a) => {
64
64
  l.current = a;
65
- }, e.as === void 0 || e.as === U)), u = B(null), n = B(null), r = ue(Fe, { disclosureState: c ? 0 : 1, linkedPanel: !1, buttonRef: n, panelRef: u, buttonId: null, panelId: null }), [{ disclosureState: m, buttonId: s }, _] = r, i = O((a) => {
65
+ }, e.as === void 0 || e.as === U)), d = B(null), t = B(null), r = ue(Fe, { disclosureState: c ? 0 : 1, linkedPanel: !1, buttonRef: t, panelRef: d, buttonId: null, panelId: null }), [{ disclosureState: m, buttonId: s }, _] = r, i = O((a) => {
66
66
  _({ type: 1 });
67
67
  let v = ye(l);
68
68
  if (!v || !s) return;
@@ -72,8 +72,8 @@ function Ue(e, t) {
72
72
  return h.createElement(j.Provider, { value: r }, h.createElement(z.Provider, { value: y }, h.createElement(Ce, { value: i }, h.createElement(De, { value: V(m, { 0: M.Open, 1: M.Closed }) }, W({ ourProps: I, theirProps: o, slot: k, defaultTag: Le, name: "Disclosure" })))));
73
73
  }
74
74
  let He = "button";
75
- function qe(e, t) {
76
- let c = oe(), { id: o = `headlessui-disclosure-button-${c}`, disabled: l = !1, autoFocus: p = !1, ...u } = e, [n, r] = Q("Disclosure.Button"), m = Me(), s = m === null ? !1 : m === n.panelId, _ = B(null), i = K(_, t, s ? null : n.buttonRef), y = le();
75
+ function qe(e, n) {
76
+ let c = oe(), { id: o = `headlessui-disclosure-button-${c}`, disabled: l = !1, autoFocus: p = !1, ...d } = e, [t, r] = Q("Disclosure.Button"), m = Me(), s = m === null ? !1 : m === t.panelId, _ = B(null), i = K(_, n, s ? null : t.buttonRef), y = le();
77
77
  re(() => {
78
78
  if (!s) return r({ type: 2, buttonId: o }), () => {
79
79
  r({ type: 2, buttonId: null });
@@ -82,11 +82,11 @@ function qe(e, t) {
82
82
  let k = O((f) => {
83
83
  var $;
84
84
  if (s) {
85
- if (n.disclosureState === 1) return;
85
+ if (t.disclosureState === 1) return;
86
86
  switch (f.key) {
87
87
  case g.Space:
88
88
  case g.Enter:
89
- f.preventDefault(), f.stopPropagation(), r({ type: 0 }), ($ = n.buttonRef.current) == null || $.focus();
89
+ f.preventDefault(), f.stopPropagation(), r({ type: 0 }), ($ = t.buttonRef.current) == null || $.focus();
90
90
  break;
91
91
  }
92
92
  } else switch (f.key) {
@@ -103,23 +103,23 @@ function qe(e, t) {
103
103
  }
104
104
  }), a = O((f) => {
105
105
  var $;
106
- Ne(f.currentTarget) || l || (s ? (r({ type: 0 }), ($ = n.buttonRef.current) == null || $.focus()) : r({ type: 0 }));
107
- }), { isFocusVisible: v, focusProps: S } = ve({ autoFocus: p }), { isHovered: b, hoverProps: T } = he({ isDisabled: l }), { pressed: w, pressProps: D } = Ee({ disabled: l }), L = x(() => ({ open: n.disclosureState === 0, hover: b, active: w, disabled: l, focus: v, autofocus: p }), [n, b, w, v, l, p]), N = be(e, _), ie = s ? te({ ref: i, type: N, disabled: l || void 0, autoFocus: p, onKeyDown: k, onClick: a }, S, T, D) : te({ ref: i, id: o, type: N, "aria-expanded": n.disclosureState === 0, "aria-controls": n.linkedPanel ? n.panelId : void 0, disabled: l || void 0, autoFocus: p, onKeyDown: k, onKeyUp: I, onClick: a }, S, T, D);
108
- return W({ mergeRefs: y, ourProps: ie, theirProps: u, slot: L, defaultTag: He, name: "Disclosure.Button" });
106
+ Ne(f.currentTarget) || l || (s ? (r({ type: 0 }), ($ = t.buttonRef.current) == null || $.focus()) : r({ type: 0 }));
107
+ }), { isFocusVisible: v, focusProps: S } = ve({ autoFocus: p }), { isHovered: b, hoverProps: T } = he({ isDisabled: l }), { pressed: w, pressProps: D } = Ee({ disabled: l }), L = x(() => ({ open: t.disclosureState === 0, hover: b, active: w, disabled: l, focus: v, autofocus: p }), [t, b, w, v, l, p]), N = be(e, _), ie = s ? ne({ ref: i, type: N, disabled: l || void 0, autoFocus: p, onKeyDown: k, onClick: a }, S, T, D) : ne({ ref: i, id: o, type: N, "aria-expanded": t.disclosureState === 0, "aria-controls": t.linkedPanel ? t.panelId : void 0, disabled: l || void 0, autoFocus: p, onKeyDown: k, onKeyUp: I, onClick: a }, S, T, D);
108
+ return W({ mergeRefs: y, ourProps: ie, theirProps: d, slot: L, defaultTag: He, name: "Disclosure.Button" });
109
109
  }
110
110
  let Ke = "div", Ve = ee.RenderStrategy | ee.Static;
111
- function We(e, t) {
112
- let c = oe(), { id: o = `headlessui-disclosure-panel-${c}`, transition: l = !1, ...p } = e, [u, n] = Q("Disclosure.Panel"), { close: r } = se("Disclosure.Panel"), m = le(), s = K(t, u.panelRef, (a) => {
113
- Ae(() => n({ type: a ? 4 : 5 }));
111
+ function We(e, n) {
112
+ let c = oe(), { id: o = `headlessui-disclosure-panel-${c}`, transition: l = !1, ...p } = e, [d, t] = Q("Disclosure.Panel"), { close: r } = se("Disclosure.Panel"), m = le(), s = K(n, d.panelRef, (a) => {
113
+ Ae(() => t({ type: a ? 4 : 5 }));
114
114
  });
115
- re(() => (n({ type: 3, panelId: o }), () => {
116
- n({ type: 3, panelId: null });
117
- }), [o, n]);
118
- let _ = $e(), [i, y] = ge(l, u.panelRef, _ !== null ? (_ & M.Open) === M.Open : u.disclosureState === 0), k = x(() => ({ open: u.disclosureState === 0, close: r }), [u.disclosureState, r]), I = { ref: s, id: o, ...Te(y) };
119
- return h.createElement(we, null, h.createElement(G.Provider, { value: u.panelId }, W({ mergeRefs: m, ourProps: I, theirProps: p, slot: k, defaultTag: Ke, features: Ve, visible: i, name: "Disclosure.Panel" })));
115
+ re(() => (t({ type: 3, panelId: o }), () => {
116
+ t({ type: 3, panelId: null });
117
+ }), [o, t]);
118
+ let _ = $e(), [i, y] = ge(l, d.panelRef, _ !== null ? (_ & M.Open) === M.Open : d.disclosureState === 0), k = x(() => ({ open: d.disclosureState === 0, close: r }), [d.disclosureState, r]), I = { ref: s, id: o, ...Te(y) };
119
+ return h.createElement(we, null, h.createElement(G.Provider, { value: d.panelId }, W({ mergeRefs: m, ourProps: I, theirProps: p, slot: k, defaultTag: Ke, features: Ve, visible: i, name: "Disclosure.Panel" })));
120
120
  }
121
121
  let je = q(Ue), ae = q(qe), ce = q(We), Qe = Object.assign(je, { Button: ae, Panel: ce });
122
- const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26", Je = "_icon_1p5o7_33", Ye = "_circle_1p5o7_43", Ze = "_square_1p5o7_50", et = "_panel_1p5o7_60", tt = "_open_1p5o7_67", nt = "_m_1p5o7_87", ot = "_s_1p5o7_50", d = {
122
+ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26", Je = "_icon_1p5o7_33", Ye = "_circle_1p5o7_43", Ze = "_square_1p5o7_50", en = "_panel_1p5o7_60", nn = "_open_1p5o7_67", tn = "_m_1p5o7_87", on = "_s_1p5o7_50", u = {
123
123
  accordion: ze,
124
124
  "is-link": "_is-link_1p5o7_9",
125
125
  header: Ge,
@@ -129,22 +129,22 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
129
129
  "icon-container": "_icon-container_1p5o7_36",
130
130
  circle: Ye,
131
131
  square: Ze,
132
- panel: et,
133
- open: tt,
132
+ panel: en,
133
+ open: nn,
134
134
  "link-open": "_link-open_1p5o7_83",
135
- m: nt,
136
- s: ot,
135
+ m: tn,
136
+ s: on,
137
137
  "wrapper-button": "_wrapper-button_1p5o7_115"
138
- }, Pt = de(
138
+ }, kn = de(
139
139
  ({
140
140
  title: e,
141
- buttonType: t = C.BUTTON,
141
+ buttonType: n = C.BUTTON,
142
142
  children: c,
143
143
  size: o = A.M,
144
144
  titleUppercase: l,
145
145
  buttonStyle: p = me.CIRCLE,
146
- iconType: u = J.ARROW,
147
- classNameTitle: n,
146
+ iconType: d = J.ARROW,
147
+ classNameTitle: t,
148
148
  classNameContent: r,
149
149
  classNameAccordion: m,
150
150
  classNameIconButton: s,
@@ -152,13 +152,13 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
152
152
  onlyOpenSubtitleNode: i,
153
153
  classNameSubtitleContainer: y
154
154
  }, k) => {
155
- const [I, a] = pe(!1), v = _e(Ie.XS1), S = t === "link", b = {
156
- [d["is-link"]]: S
155
+ const [I, a] = pe(!1), v = _e(Ie.XS1), S = n === "link", b = {
156
+ [u["is-link"]]: S
157
157
  }, T = () => {
158
158
  a(!I);
159
159
  }, w = (D) => {
160
- const L = () => u === J.DROPDOWN ? o === A.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : o === A.S ? Z.S : Z.M, N = o === A.S ? Y.S : Y.M;
161
- switch (t) {
160
+ const L = () => d === J.DROPDOWN ? o === A.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px" : o === A.S ? Z.S : Z.M, N = o === A.S ? Y.S : Y.M;
161
+ switch (n) {
162
162
  case C.LINK:
163
163
  return /* @__PURE__ */ P(
164
164
  Pe,
@@ -168,7 +168,7 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
168
168
  rightIcon: {
169
169
  iconName: N,
170
170
  className: E({
171
- [d["link-open"]]: D
171
+ [u["link-open"]]: D
172
172
  })
173
173
  },
174
174
  children: e
@@ -180,9 +180,9 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
180
180
  "span",
181
181
  {
182
182
  className: E(
183
- d.title,
184
- n,
185
- l && d["title-uppercase"]
183
+ u.title,
184
+ t,
185
+ l && u["title-uppercase"]
186
186
  ),
187
187
  children: e
188
188
  }
@@ -191,9 +191,9 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
191
191
  "div",
192
192
  {
193
193
  className: E(
194
- d["icon-container"],
195
- D,
196
- d[p],
194
+ u["icon-container"],
195
+ D && u.open,
196
+ u[p],
197
197
  s
198
198
  ),
199
199
  "data-testid": "accordion-icon-container",
@@ -201,7 +201,7 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
201
201
  Se,
202
202
  {
203
203
  iconName: L(),
204
- className: d.icon,
204
+ className: u.icon,
205
205
  "data-testid": "accordion-icon"
206
206
  }
207
207
  )
@@ -217,27 +217,27 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
217
217
  "div",
218
218
  {
219
219
  className: E(
220
- d.accordion,
221
- d[o],
220
+ u.accordion,
221
+ u[o],
222
222
  b,
223
223
  m
224
224
  ),
225
225
  children: /* @__PURE__ */ R(Qe, { ref: k, children: [
226
- /* @__PURE__ */ P("div", { className: d["wrapper-button"], onClick: T, children: /* @__PURE__ */ P(
226
+ /* @__PURE__ */ P("div", { className: u["wrapper-button"], onClick: T, children: /* @__PURE__ */ P(
227
227
  ae,
228
228
  {
229
229
  as: S ? U : C.BUTTON,
230
230
  className: E({
231
- [d.header]: !S
231
+ [u.header]: !S
232
232
  }),
233
- children: w()
233
+ children: w(I)
234
234
  }
235
235
  ) }),
236
236
  I && /* @__PURE__ */ P(
237
237
  ce,
238
238
  {
239
239
  className: E(
240
- d.panel,
240
+ u.panel,
241
241
  r,
242
242
  b
243
243
  ),
@@ -255,5 +255,5 @@ const ze = "_accordion_1p5o7_2", Ge = "_header_1p5o7_13", Xe = "_title_1p5o7_26"
255
255
  }
256
256
  );
257
257
  export {
258
- Pt as Accordion
258
+ kn as Accordion
259
259
  };
@@ -31,8 +31,8 @@ export type TUploaderFiles = {
31
31
  */
32
32
  maxFiles: number;
33
33
  /**
34
- * Текст внутри кнопки загрузки файла
35
- */
34
+ * Текст внутри кнопки загрузки файла
35
+ */
36
36
  buttonText?: string;
37
37
  };
38
38
  export type TOnChangeFilesUpdate = {
@@ -7,7 +7,15 @@ import '../../assets/UploaderPhotos.css';const c = {
7
7
  "upload-file-wrapper": "_upload-file-wrapper_1a115_2"
8
8
  }, V = h(
9
9
  (n, u) => {
10
- const { filesType: x, arrayName: y, maxSize: F, onChange: a, value: t, maxFiles: o, buttonText: v } = n, [i, r] = D(t || []), d = i.length >= o;
10
+ const {
11
+ filesType: x,
12
+ arrayName: y,
13
+ maxSize: F,
14
+ onChange: a,
15
+ value: t,
16
+ maxFiles: o,
17
+ buttonText: v
18
+ } = n, [i, r] = D(t || []), d = i.length >= o;
11
19
  I(() => {
12
20
  t && r(t);
13
21
  }, [t]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.34.8",
4
+ "version": "1.34.9",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {