mimir-ui-kit 1.56.2 → 1.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
- import { jsxs as z, jsx as D } from "react/jsx-runtime";
1
+ import { jsxs as z, jsx as k } from "react/jsx-runtime";
2
2
  import { c as H } from "../../index-DIxK0V-G.js";
3
- import { memo as kt, forwardRef as Nt, useState as $, useEffect as v } from "react";
4
- import { months as A, EDatePickerBorderRadius as C, MAX_DAY as ut, MAX_MONTH as ht, DATE_LENGTH as gt } from "./constants.js";
5
- import { DatePickerModal as Mt } from "./DatePickerModal.js";
3
+ import { memo as kt, forwardRef as Nt, useState as b, useEffect as v } from "react";
4
+ import { months as P, EDatePickerBorderRadius as C, MAX_DAY as ut, MAX_MONTH as ht, DATE_LENGTH as Mt } from "./constants.js";
5
+ import { DatePickerModal as gt } from "./DatePickerModal.js";
6
6
  import { MonthPickerModal as Tt } from "./MonthPickerModal.js";
7
- import { c as l } from "../../styles.module-DeBRSK_x.js";
7
+ import { c as y } from "../../styles.module-DeBRSK_x.js";
8
8
  import { formatDatePart as R } from "./utils.js";
9
9
  import { YearPickerModal as $t } from "./YearPickerModal.js";
10
10
  import { useClickOutside as bt } from "../../hooks/useClickOutside/useClickOutside.js";
@@ -16,79 +16,79 @@ const St = kt(
16
16
  Nt(
17
17
  ({
18
18
  size: j,
19
- value: k,
19
+ value: u,
20
20
  onChangeValue: a,
21
- name: w,
22
- before: h,
23
- type: n = "days",
24
- dateFormat: N = "full",
25
- error: _,
26
- onError: M,
27
- onBlur: f,
21
+ name: N,
22
+ before: M,
23
+ type: l = "days",
24
+ dateFormat: h = "full",
25
+ error: O,
26
+ onError: T,
27
+ onBlur: i,
28
28
  validateImmediately: L,
29
29
  variant: tt,
30
- disabled: O = !1,
31
- editable: b = !1,
30
+ disabled: _ = !1,
31
+ editable: A = !1,
32
32
  openOnInput: W = !0,
33
33
  sendIntermediateValues: et = !1,
34
34
  disableFuture: q = !1,
35
35
  disablePast: J = !1,
36
36
  disabledDate: U,
37
- validRange: o,
37
+ validRange: c,
38
38
  borderRadius: X = C.All,
39
39
  full: st,
40
- ...P
41
- }, rt) => {
42
- const [S, y] = $(!1), [E, p] = $(n), [m, g] = $(
43
- () => k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
44
- ), [Y, F] = $(_), [at, I] = $(""), [ct, T] = $();
45
- P.status = !!Y && Pt.Error || P.status, v(() => {
46
- F(_);
47
- }, [_]), v(() => {
40
+ ...S
41
+ }, at) => {
42
+ const [Y, D] = b(!1), [E, p] = b(l), [f, g] = b(
43
+ () => u && !isNaN(new Date(u).getTime()) ? new Date(u) : void 0
44
+ ), [I, F] = b(O), [rt, x] = b(""), [ct, $] = b();
45
+ S.status = !!I && Pt.Error || S.status, v(() => {
46
+ F(O);
47
+ }, [O]), v(() => {
48
48
  g(
49
- k && !isNaN(new Date(k).getTime()) ? new Date(k) : void 0
49
+ u && !isNaN(new Date(u).getTime()) ? new Date(u) : void 0
50
50
  );
51
- }, [k]), v(() => {
52
- if (m && typeof m != "string" && !isNaN(m == null ? void 0 : m.getTime())) {
51
+ }, [u]), v(() => {
52
+ if (f && typeof f != "string" && !isNaN(f == null ? void 0 : f.getTime())) {
53
53
  let t = "";
54
- switch (N) {
54
+ switch (h) {
55
55
  case "year": {
56
- t = m.getFullYear().toString();
56
+ t = f.getFullYear().toString();
57
57
  break;
58
58
  }
59
59
  case "month": {
60
- const s = A[m.getMonth()], e = m.getFullYear();
60
+ const s = P[f.getMonth()], e = f.getFullYear();
61
61
  t = `${s} ${e}`;
62
62
  break;
63
63
  }
64
64
  case "full": {
65
- t = d.Date(m, "dd/mm/yyyy");
65
+ t = d.Date(f, "dd/mm/yyyy");
66
66
  break;
67
67
  }
68
68
  default: {
69
- t = d.Date(m, "dd/mm/yyyy");
69
+ t = d.Date(f, "dd/mm/yyyy");
70
70
  break;
71
71
  }
72
72
  }
73
- I(t);
73
+ x(t);
74
74
  } else
75
- I("");
76
- }, [m, N]);
77
- const K = k && new Date(k).getTime;
75
+ x("");
76
+ }, [f, h]);
77
+ const K = u && new Date(u).getTime;
78
78
  v(() => {
79
- L && (K ? (F(!1), M == null || M({ name: w, active: !1 })) : (F(!0), M == null || M({ name: w, active: !0 })));
80
- }, [L, w, K]), bt({
81
- isActive: S,
79
+ L && (K ? (F(!1), T == null || T({ name: N, active: !1 })) : (F(!0), T == null || T({ name: N, active: !0 })));
80
+ }, [L, N, K]), bt({
81
+ isActive: Y,
82
82
  setActive: (t) => {
83
- y(t), p(n), t || T(void 0);
83
+ D(t), p(l), t || $(void 0);
84
84
  },
85
- className: l["calendar-block"]
85
+ className: y["calendar-block"]
86
86
  });
87
- const it = () => {
88
- !O && (W || !b) && y(!0);
87
+ const ot = () => {
88
+ !_ && (W || !A) && D(!0);
89
89
  }, Q = (t) => {
90
90
  const s = t.getTime();
91
- if (t.setHours(0, 0, 0, 0), h && (typeof h == "string" ? new Date(h) : h).getTime() > s)
91
+ if (t.setHours(0, 0, 0, 0), M && (typeof M == "string" ? new Date(M) : M).getTime() > s)
92
92
  return !1;
93
93
  if (q) {
94
94
  const e = /* @__PURE__ */ new Date();
@@ -99,31 +99,31 @@ const St = kt(
99
99
  if (e.setHours(0, 0, 0, 0), s < e.getTime()) return !1;
100
100
  }
101
101
  if (U && U(t)) return !1;
102
- if (o) {
102
+ if (c) {
103
103
  let e;
104
- typeof o[0] == "string" ? e = [
105
- new Date(o[0]),
106
- typeof o[1] == "string" ? new Date(o[1]) : o[1]
104
+ typeof c[0] == "string" ? e = [
105
+ new Date(c[0]),
106
+ typeof c[1] == "string" ? new Date(c[1]) : c[1]
107
107
  ] : e = [
108
- o[0],
109
- typeof o[1] == "string" ? new Date(o[1]) : o[1]
108
+ c[0],
109
+ typeof c[1] == "string" ? new Date(c[1]) : c[1]
110
110
  ];
111
- const [i, r] = e, c = new Date(i), u = new Date(r);
112
- if (c.setHours(0, 0, 0, 0), u.setHours(23, 59, 59, 999), t < c || t > u) return !1;
111
+ const [o, r] = e, m = new Date(o), n = new Date(r);
112
+ if (m.setHours(0, 0, 0, 0), n.setHours(23, 59, 59, 999), t < m || t > n) return !1;
113
113
  }
114
114
  return !0;
115
- }, ot = (t) => {
115
+ }, it = (t) => {
116
116
  if (!isNaN(t.getTime())) {
117
- g(t), T(void 0);
117
+ g(t), $(void 0);
118
118
  let e = "";
119
- switch (N) {
119
+ switch (h) {
120
120
  case "year": {
121
121
  e = t.getFullYear().toString();
122
122
  break;
123
123
  }
124
124
  case "month": {
125
- const i = A[t.getMonth()], r = t.getFullYear();
126
- e = `${i} ${r}`;
125
+ const o = P[t.getMonth()], r = t.getFullYear();
126
+ e = `${o} ${r}`;
127
127
  break;
128
128
  }
129
129
  case "full": {
@@ -137,19 +137,19 @@ const St = kt(
137
137
  }
138
138
  a == null || a({
139
139
  value: e,
140
- name: w
140
+ name: N
141
141
  });
142
142
  }
143
- E === "years" && (n === "years" ? (y(!1), p(n)) : p("months")), E === "months" && (n === "months" ? (y(!1), p(n)) : p("days")), g(t);
143
+ E === "years" && (l === "years" ? (D(!1), p(l)) : p("months")), E === "months" && (l === "months" ? (D(!1), p(l)) : p("days")), g(t);
144
144
  let s = "";
145
- switch (N) {
145
+ switch (h) {
146
146
  case "year": {
147
147
  s = t.getFullYear().toString();
148
148
  break;
149
149
  }
150
150
  case "month": {
151
- const e = A[t.getMonth()], i = t.getFullYear();
152
- s = `${e} ${i}`;
151
+ const e = P[t.getMonth()], o = t.getFullYear();
152
+ s = `${e} ${o}`;
153
153
  break;
154
154
  }
155
155
  case "full": {
@@ -163,148 +163,148 @@ const St = kt(
163
163
  }
164
164
  a == null || a({
165
165
  value: s,
166
- name: w
167
- }), f == null || f(s);
166
+ name: N
167
+ }), i == null || i(s);
168
168
  }, ft = (t) => {
169
- const s = m || /* @__PURE__ */ new Date(), e = s.getDate(), i = s.getMonth() + 1, r = new Date(t, i - 1, e);
170
- if (r.getFullYear() === t && r.getMonth() === i - 1 && r.getDate() === e && Q(r)) {
171
- g(r), T(void 0);
172
- let c = "";
173
- switch (N) {
169
+ const s = f || /* @__PURE__ */ new Date(), e = s.getDate(), o = s.getMonth() + 1, r = new Date(t, o - 1, e);
170
+ if (r.getFullYear() === t && r.getMonth() === o - 1 && r.getDate() === e && Q(r)) {
171
+ g(r), $(void 0);
172
+ let m = "";
173
+ switch (h) {
174
174
  case "year": {
175
- c = t.toString();
175
+ m = t.toString();
176
176
  break;
177
177
  }
178
178
  case "month": {
179
- c = `${A[i - 1]} ${t}`;
179
+ m = `${P[o - 1]} ${t}`;
180
180
  break;
181
181
  }
182
182
  case "full": {
183
- c = d.Date(r, "yyyy-mm-dd");
183
+ m = d.Date(r, "yyyy-mm-dd");
184
184
  break;
185
185
  }
186
186
  default: {
187
- c = d.Date(r, "yyyy-mm-dd");
187
+ m = d.Date(r, "yyyy-mm-dd");
188
188
  break;
189
189
  }
190
190
  }
191
191
  if (a == null || a({
192
- value: c,
193
- name: w
194
- }), f == null || f(c), n === "years") {
195
- y(!1), p(n);
192
+ value: m,
193
+ name: N
194
+ }), i == null || i(m), l === "years") {
195
+ D(!1), p(l);
196
196
  return;
197
197
  }
198
198
  } else
199
- T(new Date(t, i - 1, 1));
200
- n === "years" ? (y(!1), p(n)) : p("months");
199
+ $(new Date(t, o - 1, 1));
200
+ l === "years" ? (D(!1), p(l)) : p("months");
201
201
  }, mt = (t, s) => {
202
- const i = (m || /* @__PURE__ */ new Date()).getDate(), r = new Date(t, s - 1, i);
203
- if (r.getFullYear() === t && r.getMonth() === s - 1 && r.getDate() === i && Q(r)) {
204
- g(r), T(void 0);
205
- let c = "";
206
- switch (N) {
202
+ const o = (f || /* @__PURE__ */ new Date()).getDate(), r = new Date(t, s, 0).getDate(), m = Math.min(o, r), n = new Date(t, s - 1, m);
203
+ if (n.getFullYear() === t && n.getMonth() === s - 1 && n.getDate() === m && Q(n)) {
204
+ g(n), $(void 0);
205
+ let w = "";
206
+ switch (h) {
207
207
  case "year": {
208
- c = t.toString();
208
+ w = t.toString();
209
209
  break;
210
210
  }
211
211
  case "month": {
212
- c = `${A[s - 1]} ${t}`;
212
+ w = `${P[s - 1]} ${t}`;
213
213
  break;
214
214
  }
215
215
  case "full": {
216
- c = d.Date(r, "yyyy-mm-dd");
216
+ w = d.Date(n, "yyyy-mm-dd");
217
217
  break;
218
218
  }
219
219
  default: {
220
- c = d.Date(r, "yyyy-mm-dd");
220
+ w = d.Date(n, "yyyy-mm-dd");
221
221
  break;
222
222
  }
223
223
  }
224
224
  if (a == null || a({
225
- value: c,
226
- name: w
227
- }), f == null || f(c), n === "months") {
228
- y(!1), p(n);
225
+ value: w,
226
+ name: N
227
+ }), i == null || i(w), l === "months") {
228
+ D(!1), p(l);
229
229
  return;
230
230
  }
231
231
  } else
232
- T(new Date(t, s - 1, 1));
233
- n === "months" ? (y(!1), p(n)) : p("days");
232
+ $(new Date(t, s - 1, 1));
233
+ l === "months" ? (D(!1), p(l)) : p("days");
234
234
  }, nt = (t) => {
235
- if (b || t.target.value === "") {
235
+ if (A || t.target.value === "") {
236
236
  const s = t.target.value.replace(/[^\d]/g, "");
237
237
  if (s.length === 0)
238
- I(""), g(void 0), y(!1), a == null || a({ value: "", name: w }), f == null || f("");
238
+ x(""), g(void 0), D(!1), a == null || a({ value: "", name: N }), i == null || i("");
239
239
  else {
240
- const [e, i, r] = [
240
+ const [e, o, r] = [
241
241
  R(s.substring(0, 2), ut),
242
242
  R(s.substring(2, 4), ht),
243
243
  s.substring(4, 8)
244
- ], c = [e, i, r].filter(Boolean).join("/");
245
- if (I(c), et) {
246
- const u = r ? `${r}-${i || "00"}-${e || "00"}` : [e, i, r].filter(Boolean).join("-");
244
+ ], m = [e, o, r].filter(Boolean).join("/");
245
+ if (x(m), et) {
246
+ const n = r ? `${r}-${o || "00"}-${e || "00"}` : [e, o, r].filter(Boolean).join("-");
247
247
  a == null || a({
248
- value: u,
249
- name: w
248
+ value: n,
249
+ name: N
250
250
  });
251
251
  }
252
- if (c.length === gt) {
253
- const u = parseInt(r), x = /* @__PURE__ */ new Date(
254
- `${u}-${i.padStart(2, "0")}-${e.padStart(2, "0")}`
252
+ if (m.length === Mt) {
253
+ const n = parseInt(r), w = /* @__PURE__ */ new Date(
254
+ `${n}-${o.padStart(2, "0")}-${e.padStart(2, "0")}`
255
255
  );
256
- isNaN(x.getTime()) || (g(x), a == null || a({
257
- value: d.Date(x, "yyyy-mm-dd"),
258
- name: w
259
- }), f == null || f(d.Date(x, "yyyy-mm-dd")));
256
+ isNaN(w.getTime()) || (g(w), a == null || a({
257
+ value: d.Date(w, "yyyy-mm-dd"),
258
+ name: N
259
+ }), i == null || i(d.Date(w, "yyyy-mm-dd")));
260
260
  }
261
261
  }
262
262
  }
263
263
  }, lt = H(
264
- l.wrapper,
265
- S && !b && l.active
266
- ), yt = H(l.input, l.inputBorderControl);
264
+ y.wrapper,
265
+ Y && !A && y.active
266
+ ), yt = H(y.input, y.inputBorderControl);
267
267
  let Z;
268
- if (o) {
268
+ if (c) {
269
269
  let t, s;
270
- typeof o[0] == "string" ? t = new Date(o[0]) : t = o[0], typeof o[1] == "string" ? s = new Date(o[1]) : s = o[1], Z = [t, s];
270
+ typeof c[0] == "string" ? t = new Date(c[0]) : t = c[0], typeof c[1] == "string" ? s = new Date(c[1]) : s = c[1], Z = [t, s];
271
271
  }
272
272
  const G = {
273
- onChangeValue: ot,
274
- date: ct || m || /* @__PURE__ */ new Date(),
275
- selectedDate: m,
276
- before: typeof h == "string" ? new Date(h) : h,
273
+ onChangeValue: it,
274
+ date: ct || f || /* @__PURE__ */ new Date(),
275
+ selectedDate: f,
276
+ before: typeof M == "string" ? new Date(M) : M,
277
277
  onChangeType: p,
278
- setIsActive: y,
278
+ setIsActive: D,
279
279
  disableFuture: q,
280
280
  disablePast: J,
281
281
  disabledDate: U,
282
282
  validRange: Z,
283
- dateFormat: N
284
- }, pt = {
283
+ dateFormat: h
284
+ }, Dt = {
285
285
  ...G,
286
286
  onChangeMonth: mt,
287
- dateFormat: N
288
- }, dt = {
287
+ dateFormat: h
288
+ }, pt = {
289
289
  ...G,
290
290
  onChangeYear: ft
291
- }, Dt = (() => {
291
+ }, dt = (() => {
292
292
  switch (E) {
293
293
  case "months":
294
- return () => /* @__PURE__ */ D(Tt, { ...pt });
294
+ return () => /* @__PURE__ */ k(Tt, { ...Dt });
295
295
  case "years":
296
- return () => /* @__PURE__ */ D($t, { ...dt });
296
+ return () => /* @__PURE__ */ k($t, { ...pt });
297
297
  default:
298
- return () => /* @__PURE__ */ D(Mt, { ...G });
298
+ return () => /* @__PURE__ */ k(gt, { ...G });
299
299
  }
300
- })(), wt = ({ isActive: t }) => /* @__PURE__ */ D("button", { onClick: (e) => {
301
- e.stopPropagation(), O || y(!t);
302
- }, className: l["icon-button"], children: t ? /* @__PURE__ */ D(
300
+ })(), wt = ({ isActive: t }) => /* @__PURE__ */ k("button", { onClick: (e) => {
301
+ e.stopPropagation(), _ || D(!t);
302
+ }, className: y["icon-button"], children: t ? /* @__PURE__ */ k(
303
303
  B,
304
304
  {
305
305
  iconName: j === V.S ? "DropdownArrowUp16px" : "DropdownArrowUp24px"
306
306
  }
307
- ) : /* @__PURE__ */ D(
307
+ ) : /* @__PURE__ */ k(
308
308
  B,
309
309
  {
310
310
  iconName: j === V.S ? "DropdownArrowBottom16px" : "DropdownArrowDown24px"
@@ -313,49 +313,49 @@ const St = kt(
313
313
  return /* @__PURE__ */ z(
314
314
  "div",
315
315
  {
316
- className: H(l["input-field-group-datePicker"], {
317
- [l.full]: st
316
+ className: H(y["input-field-group-datePicker"], {
317
+ [y.full]: st
318
318
  }),
319
319
  children: [
320
- /* @__PURE__ */ z("div", { className: lt, "data-disabled": O, children: [
321
- /* @__PURE__ */ D(
320
+ /* @__PURE__ */ z("div", { className: lt, "data-disabled": _, children: [
321
+ /* @__PURE__ */ k(
322
322
  "div",
323
323
  {
324
324
  role: "button",
325
- "data-status": P.status,
326
- className: H(l["date-wrapper"], {
327
- [l.editable]: b,
328
- [l[`border-radius-${X}`]]: X !== C.All
325
+ "data-status": S.status,
326
+ className: H(y["date-wrapper"], {
327
+ [y.editable]: A,
328
+ [y[`border-radius-${X}`]]: X !== C.All
329
329
  }),
330
- onClick: it,
331
- children: /* @__PURE__ */ D(
330
+ onClick: ot,
331
+ children: /* @__PURE__ */ k(
332
332
  At,
333
333
  {
334
- ref: rt,
334
+ ref: at,
335
335
  className: yt,
336
- wrapperClassName: l["input-wrapper"],
336
+ wrapperClassName: y["input-wrapper"],
337
337
  size: j,
338
338
  type: "text",
339
339
  variant: tt,
340
- value: at,
340
+ value: rt,
341
341
  onChange: nt,
342
342
  rightAddon: {
343
343
  addonType: "react-node",
344
- addonContent: /* @__PURE__ */ D(wt, { isActive: S })
344
+ addonContent: /* @__PURE__ */ k(wt, { isActive: Y })
345
345
  },
346
- rightSlotClassName: l["right-slot"],
346
+ rightSlotClassName: y["right-slot"],
347
347
  onFocus: () => {
348
- W && !b && y(!0);
348
+ W && !A && D(!0);
349
349
  },
350
350
  borderRadius: X,
351
- ...P
351
+ ...S
352
352
  }
353
353
  )
354
354
  }
355
355
  ),
356
- S && /* @__PURE__ */ D(Dt, {})
356
+ Y && /* @__PURE__ */ k(dt, {})
357
357
  ] }),
358
- Y && typeof Y == "string" && /* @__PURE__ */ D("div", { className: l.textError, children: Y })
358
+ I && typeof I == "string" && /* @__PURE__ */ k("div", { className: y.textError, children: I })
359
359
  ]
360
360
  }
361
361
  );
@@ -27,6 +27,10 @@ export type TCategoryTab = {
27
27
  * Цвет нижней границы для detailed варианта таба.
28
28
  */
29
29
  borderColor?: string;
30
+ /**
31
+ * Цвет нижней границы по дефолту для detailed варианта таба.
32
+ */
33
+ defaultActive?: boolean;
30
34
  };
31
35
  export type TTabTrailProps = {
32
36
  /**
@@ -1,25 +1,25 @@
1
- import { jsxs as J, jsx as h, Fragment as Ne } from "react/jsx-runtime";
2
- import { c as P } from "../../index-DIxK0V-G.js";
3
- import * as V from "react";
4
- import z, { useState as ne, createContext as ve, useReducer as Se, useMemo as C, useId as he, useRef as ae, useContext as xe, forwardRef as Ae, useEffect as ue } from "react";
5
- import { ETabTrailSize as Fe } from "./constants.js";
6
- import { TabButtons as ke } from "./TabButtons/TabButtons.js";
7
- import { ETabTrailButtonVariant as De } from "./TabButtons/constants.js";
1
+ import { jsxs as j, jsx as h, Fragment as Se } from "react/jsx-runtime";
2
+ import { c as I } from "../../index-DIxK0V-G.js";
3
+ import * as q from "react";
4
+ import V, { useState as ae, createContext as ve, useReducer as Ae, useMemo as C, useId as he, useRef as se, useContext as xe, forwardRef as Fe, useEffect as ue } from "react";
5
+ import { ETabTrailSize as ke } from "./constants.js";
6
+ import { TabButtons as De } from "./TabButtons/TabButtons.js";
7
+ import { ETabTrailButtonVariant as Re } from "./TabButtons/constants.js";
8
8
  import { Icon as be } from "../../icons/Icon.js";
9
- import { NotificationBadge as Re } from "../NotificationBadge/NotificationBadge.js";
10
- import { M as me, W as Q, s as te, y as X, o as W, n as se, H as Z, $ as ge, b as Le, D as _e, a as Y, u as Oe, c as N, e as Me } from "../../keyboard-wis2TUql.js";
11
- import { w as Be } from "../../use-active-press-CnDeVvQq.js";
12
- import { e as We } from "../../use-resolve-button-type-DhFdPxnv.js";
13
- import { f as Ce } from "../../use-is-mounted-MBU4fiLr.js";
14
- import { T as Te, s as Ge } from "../../hidden-CkTYbiNM.js";
15
- import { _ as K, T as re, P as U, F as S } from "../../focus-management-BAl0GmRk.js";
16
- import '../../assets/TabTrail.css';function Ue({ onFocus: e }) {
17
- let [t, n] = ne(!0), r = Ce();
18
- return t ? z.createElement(Te, { as: "button", type: "button", features: Ge.Focusable, onFocus: (a) => {
9
+ import { NotificationBadge as Le } from "../NotificationBadge/NotificationBadge.js";
10
+ import { M as me, W as Y, s as re, y as Q, o as W, n as le, H as X, $ as ge, b as Oe, D as _e, a as K, u as Me, c as N, e as Be } from "../../keyboard-wis2TUql.js";
11
+ import { w as We } from "../../use-active-press-CnDeVvQq.js";
12
+ import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
13
+ import { f as Ge } from "../../use-is-mounted-MBU4fiLr.js";
14
+ import { T as Te, s as Ue } from "../../hidden-CkTYbiNM.js";
15
+ import { _ as J, T as ne, P as z, F as S } from "../../focus-management-BAl0GmRk.js";
16
+ import '../../assets/TabTrail.css';function ze({ onFocus: e }) {
17
+ let [t, n] = ae(!0), r = Ge();
18
+ return t ? V.createElement(Te, { as: "button", type: "button", features: Ue.Focusable, onFocus: (a) => {
19
19
  a.preventDefault();
20
- let s, l = 50;
20
+ let s, i = 50;
21
21
  function f() {
22
- if (l-- <= 0) {
22
+ if (i-- <= 0) {
23
23
  s && cancelAnimationFrame(s);
24
24
  return;
25
25
  }
@@ -33,8 +33,8 @@ import '../../assets/TabTrail.css';function Ue({ onFocus: e }) {
33
33
  s = requestAnimationFrame(f);
34
34
  } }) : null;
35
35
  }
36
- const Ie = V.createContext(null);
37
- function ze() {
36
+ const Ie = q.createContext(null);
37
+ function Ve() {
38
38
  return { groups: /* @__PURE__ */ new Map(), get(e, t) {
39
39
  var n;
40
40
  let r = this.groups.get(e);
@@ -42,57 +42,57 @@ function ze() {
42
42
  let a = (n = r.get(t)) != null ? n : 0;
43
43
  r.set(t, a + 1);
44
44
  let s = Array.from(r.keys()).indexOf(t);
45
- function l() {
45
+ function i() {
46
46
  let f = r.get(t);
47
47
  f > 1 ? r.set(t, f - 1) : r.delete(t);
48
48
  }
49
- return [s, l];
49
+ return [s, i];
50
50
  } };
51
51
  }
52
- function Ve({ children: e }) {
53
- let t = V.useRef(ze());
54
- return V.createElement(Ie.Provider, { value: t }, e);
52
+ function qe({ children: e }) {
53
+ let t = q.useRef(Ve());
54
+ return q.createElement(Ie.Provider, { value: t }, e);
55
55
  }
56
56
  function Pe(e) {
57
- let t = V.useContext(Ie);
57
+ let t = q.useContext(Ie);
58
58
  if (!t) throw new Error("You must wrap your component in a <StableCollection>");
59
- let n = V.useId(), [r, a] = t.current.get(e, n);
60
- return V.useEffect(() => a, []), r;
59
+ let n = q.useId(), [r, a] = t.current.get(e, n);
60
+ return q.useEffect(() => a, []), r;
61
61
  }
62
- var qe = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(qe || {}), He = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(He || {}), je = ((e) => (e[e.SetSelectedIndex = 0] = "SetSelectedIndex", e[e.RegisterTab = 1] = "RegisterTab", e[e.UnregisterTab = 2] = "UnregisterTab", e[e.RegisterPanel = 3] = "RegisterPanel", e[e.UnregisterPanel = 4] = "UnregisterPanel", e))(je || {});
63
- let Je = { 0(e, t) {
62
+ var He = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(He || {}), je = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(je || {}), Je = ((e) => (e[e.SetSelectedIndex = 0] = "SetSelectedIndex", e[e.RegisterTab = 1] = "RegisterTab", e[e.UnregisterTab = 2] = "UnregisterTab", e[e.RegisterPanel = 3] = "RegisterPanel", e[e.UnregisterPanel = 4] = "UnregisterPanel", e))(Je || {});
63
+ let Ke = { 0(e, t) {
64
64
  var n;
65
- let r = K(e.tabs, (d) => d.current), a = K(e.panels, (d) => d.current), s = r.filter((d) => {
65
+ let r = J(e.tabs, (d) => d.current), a = J(e.panels, (d) => d.current), s = r.filter((d) => {
66
66
  var x;
67
67
  return !((x = d.current) != null && x.hasAttribute("disabled"));
68
- }), l = { ...e, tabs: r, panels: a };
68
+ }), i = { ...e, tabs: r, panels: a };
69
69
  if (t.index < 0 || t.index > r.length - 1) {
70
- let d = Y(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => Y(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
71
- if (s.length === 0) return l;
72
- let x = Y(d, { 0: () => r.indexOf(s[0]), 1: () => r.indexOf(s[s.length - 1]) });
73
- return { ...l, selectedIndex: x === -1 ? e.selectedIndex : x };
70
+ let d = K(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => K(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
71
+ if (s.length === 0) return i;
72
+ let x = K(d, { 0: () => r.indexOf(s[0]), 1: () => r.indexOf(s[s.length - 1]) });
73
+ return { ...i, selectedIndex: x === -1 ? e.selectedIndex : x };
74
74
  }
75
- let f = r.slice(0, t.index), w = [...r.slice(t.index), ...f].find((d) => s.includes(d));
76
- if (!w) return l;
77
- let v = (n = r.indexOf(w)) != null ? n : e.selectedIndex;
78
- return v === -1 && (v = e.selectedIndex), { ...l, selectedIndex: v };
75
+ let f = r.slice(0, t.index), P = [...r.slice(t.index), ...f].find((d) => s.includes(d));
76
+ if (!P) return i;
77
+ let v = (n = r.indexOf(P)) != null ? n : e.selectedIndex;
78
+ return v === -1 && (v = e.selectedIndex), { ...i, selectedIndex: v };
79
79
  }, 1(e, t) {
80
80
  if (e.tabs.includes(t.tab)) return e;
81
- let n = e.tabs[e.selectedIndex], r = K([...e.tabs, t.tab], (s) => s.current), a = e.selectedIndex;
81
+ let n = e.tabs[e.selectedIndex], r = J([...e.tabs, t.tab], (s) => s.current), a = e.selectedIndex;
82
82
  return e.info.current.isControlled || (a = r.indexOf(n), a === -1 && (a = e.selectedIndex)), { ...e, tabs: r, selectedIndex: a };
83
83
  }, 2(e, t) {
84
84
  return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
85
85
  }, 3(e, t) {
86
- return e.panels.includes(t.panel) ? e : { ...e, panels: K([...e.panels, t.panel], (n) => n.current) };
86
+ return e.panels.includes(t.panel) ? e : { ...e, panels: J([...e.panels, t.panel], (n) => n.current) };
87
87
  }, 4(e, t) {
88
88
  return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
89
89
  } }, de = ve(null);
90
90
  de.displayName = "TabsDataContext";
91
- function q(e) {
91
+ function H(e) {
92
92
  let t = xe(de);
93
93
  if (t === null) {
94
94
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
95
- throw Error.captureStackTrace && Error.captureStackTrace(n, q), n;
95
+ throw Error.captureStackTrace && Error.captureStackTrace(n, H), n;
96
96
  }
97
97
  return t;
98
98
  }
@@ -106,124 +106,124 @@ function pe(e) {
106
106
  }
107
107
  return t;
108
108
  }
109
- function Ke(e, t) {
110
- return Y(t.type, Je, e, t);
109
+ function Ye(e, t) {
110
+ return K(t.type, Ke, e, t);
111
111
  }
112
- let Ye = "div";
113
- function Qe(e, t) {
114
- let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: s, selectedIndex: l = null, ...f } = e;
115
- const w = r ? "vertical" : "horizontal", v = a ? "manual" : "auto";
116
- let d = l !== null, x = te({ isControlled: d }), A = X(t), [p, u] = Se(Ke, { info: x, selectedIndex: l ?? n, tabs: [], panels: [] }), D = C(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), R = te(s || (() => {
117
- })), y = te(p.tabs), b = C(() => ({ orientation: w, activation: v, ...p }), [w, v, p]), F = W((o) => (u({ type: 1, tab: o }), () => u({ type: 2, tab: o }))), L = W((o) => (u({ type: 3, panel: o }), () => u({ type: 4, panel: o }))), g = W((o) => {
112
+ let Qe = "div";
113
+ function Xe(e, t) {
114
+ let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: s, selectedIndex: i = null, ...f } = e;
115
+ const P = r ? "vertical" : "horizontal", v = a ? "manual" : "auto";
116
+ let d = i !== null, x = re({ isControlled: d }), A = Q(t), [p, u] = Ae(Ye, { info: x, selectedIndex: i ?? n, tabs: [], panels: [] }), D = C(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), R = re(s || (() => {
117
+ })), y = re(p.tabs), b = C(() => ({ orientation: P, activation: v, ...p }), [P, v, p]), F = W((o) => (u({ type: 1, tab: o }), () => u({ type: 2, tab: o }))), L = W((o) => (u({ type: 3, panel: o }), () => u({ type: 4, panel: o }))), g = W((o) => {
118
118
  _.current !== o && R.current(o), d || u({ type: 0, index: o });
119
- }), _ = te(d ? e.selectedIndex : p.selectedIndex), O = C(() => ({ registerTab: F, registerPanel: L, change: g }), []);
120
- se(() => {
121
- u({ type: 0, index: l ?? n });
122
- }, [l]), se(() => {
119
+ }), _ = re(d ? e.selectedIndex : p.selectedIndex), O = C(() => ({ registerTab: F, registerPanel: L, change: g }), []);
120
+ le(() => {
121
+ u({ type: 0, index: i ?? n });
122
+ }, [i]), le(() => {
123
123
  if (_.current === void 0 || p.tabs.length <= 0) return;
124
- let o = K(p.tabs, (E) => E.current);
124
+ let o = J(p.tabs, (E) => E.current);
125
125
  o.some((E, k) => p.tabs[k] !== E) && g(o.indexOf(p.tabs[_.current]));
126
126
  });
127
127
  let T = { ref: A };
128
- return z.createElement(Ve, null, z.createElement(fe.Provider, { value: O }, z.createElement(de.Provider, { value: b }, b.tabs.length <= 0 && z.createElement(Ue, { onFocus: () => {
128
+ return V.createElement(qe, null, V.createElement(fe.Provider, { value: O }, V.createElement(de.Provider, { value: b }, b.tabs.length <= 0 && V.createElement(ze, { onFocus: () => {
129
129
  var o, E;
130
130
  for (let k of y.current) if (((o = k.current) == null ? void 0 : o.tabIndex) === 0) return (E = k.current) == null || E.focus(), !0;
131
131
  return !1;
132
- } }), Z({ ourProps: T, theirProps: f, slot: D, defaultTag: Ye, name: "Tabs" }))));
132
+ } }), X({ ourProps: T, theirProps: f, slot: D, defaultTag: Qe, name: "Tabs" }))));
133
133
  }
134
- let Xe = "div";
135
- function Ze(e, t) {
136
- let { orientation: n, selectedIndex: r } = q("Tab.List"), a = X(t), s = C(() => ({ selectedIndex: r }), [r]);
137
- return Z({ ourProps: { ref: a, role: "tablist", "aria-orientation": n }, theirProps: e, slot: s, defaultTag: Xe, name: "Tabs.List" });
134
+ let Ze = "div";
135
+ function et(e, t) {
136
+ let { orientation: n, selectedIndex: r } = H("Tab.List"), a = Q(t), s = C(() => ({ selectedIndex: r }), [r]);
137
+ return X({ ourProps: { ref: a, role: "tablist", "aria-orientation": n }, theirProps: e, slot: s, defaultTag: Ze, name: "Tabs.List" });
138
138
  }
139
- let et = "button";
140
- function tt(e, t) {
139
+ let tt = "button";
140
+ function rt(e, t) {
141
141
  var n, r;
142
- let a = he(), { id: s = `headlessui-tabs-tab-${a}`, disabled: l = !1, autoFocus: f = !1, ...w } = e, { orientation: v, activation: d, selectedIndex: x, tabs: A, panels: p } = q("Tab"), u = pe("Tab"), D = q("Tab"), [R, y] = ne(null), b = ae(null), F = X(b, t, y);
143
- se(() => u.registerTab(b), [u, b]);
142
+ let a = he(), { id: s = `headlessui-tabs-tab-${a}`, disabled: i = !1, autoFocus: f = !1, ...P } = e, { orientation: v, activation: d, selectedIndex: x, tabs: A, panels: p } = H("Tab"), u = pe("Tab"), D = H("Tab"), [R, y] = ae(null), b = se(null), F = Q(b, t, y);
143
+ le(() => u.registerTab(b), [u, b]);
144
144
  let L = Pe("tabs"), g = A.indexOf(b);
145
145
  g === -1 && (g = L);
146
- let _ = g === x, O = W((i) => {
147
- var I;
148
- let B = i();
149
- if (B === re.Success && d === "auto") {
150
- let H = (I = Oe(b)) == null ? void 0 : I.activeElement, j = D.tabs.findIndex((ce) => ce.current === H);
151
- j !== -1 && u.change(j);
146
+ let _ = g === x, O = W((l) => {
147
+ var $;
148
+ let B = l();
149
+ if (B === ne.Success && d === "auto") {
150
+ let ee = ($ = Me(b)) == null ? void 0 : $.activeElement, U = D.tabs.findIndex((te) => te.current === ee);
151
+ U !== -1 && u.change(U);
152
152
  }
153
153
  return B;
154
- }), T = W((i) => {
155
- let I = A.map((B) => B.current).filter(Boolean);
156
- if (i.key === N.Space || i.key === N.Enter) {
157
- i.preventDefault(), i.stopPropagation(), u.change(g);
154
+ }), T = W((l) => {
155
+ let $ = A.map((B) => B.current).filter(Boolean);
156
+ if (l.key === N.Space || l.key === N.Enter) {
157
+ l.preventDefault(), l.stopPropagation(), u.change(g);
158
158
  return;
159
159
  }
160
- switch (i.key) {
160
+ switch (l.key) {
161
161
  case N.Home:
162
162
  case N.PageUp:
163
- return i.preventDefault(), i.stopPropagation(), O(() => U(I, S.First));
163
+ return l.preventDefault(), l.stopPropagation(), O(() => z($, S.First));
164
164
  case N.End:
165
165
  case N.PageDown:
166
- return i.preventDefault(), i.stopPropagation(), O(() => U(I, S.Last));
166
+ return l.preventDefault(), l.stopPropagation(), O(() => z($, S.Last));
167
167
  }
168
- if (O(() => Y(v, { vertical() {
169
- return i.key === N.ArrowUp ? U(I, S.Previous | S.WrapAround) : i.key === N.ArrowDown ? U(I, S.Next | S.WrapAround) : re.Error;
168
+ if (O(() => K(v, { vertical() {
169
+ return l.key === N.ArrowUp ? z($, S.Previous | S.WrapAround) : l.key === N.ArrowDown ? z($, S.Next | S.WrapAround) : ne.Error;
170
170
  }, horizontal() {
171
- return i.key === N.ArrowLeft ? U(I, S.Previous | S.WrapAround) : i.key === N.ArrowRight ? U(I, S.Next | S.WrapAround) : re.Error;
172
- } })) === re.Success) return i.preventDefault();
173
- }), o = ae(!1), E = W(() => {
174
- var i;
175
- o.current || (o.current = !0, (i = b.current) == null || i.focus({ preventScroll: !0 }), u.change(g), Me(() => {
171
+ return l.key === N.ArrowLeft ? z($, S.Previous | S.WrapAround) : l.key === N.ArrowRight ? z($, S.Next | S.WrapAround) : ne.Error;
172
+ } })) === ne.Success) return l.preventDefault();
173
+ }), o = se(!1), E = W(() => {
174
+ var l;
175
+ o.current || (o.current = !0, (l = b.current) == null || l.focus({ preventScroll: !0 }), u.change(g), Be(() => {
176
176
  o.current = !1;
177
177
  }));
178
- }), k = W((i) => {
179
- i.preventDefault();
180
- }), { isFocusVisible: M, focusProps: le } = ge({ autoFocus: f }), { isHovered: G, hoverProps: ie } = Le({ isDisabled: l }), { pressed: ee, pressProps: oe } = Be({ disabled: l }), c = C(() => ({ selected: _, hover: G, active: ee, focus: M, autofocus: f, disabled: l }), [_, G, M, ee, f, l]), $ = _e({ ref: F, onKeyDown: T, onMouseDown: k, onClick: E, id: s, role: "tab", type: We(e, R), "aria-controls": (r = (n = p[g]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": _, tabIndex: _ ? 0 : -1, disabled: l || void 0, autoFocus: f }, le, ie, oe);
181
- return Z({ ourProps: $, theirProps: w, slot: c, defaultTag: et, name: "Tabs.Tab" });
178
+ }), k = W((l) => {
179
+ l.preventDefault();
180
+ }), { isFocusVisible: M, focusProps: ie } = ge({ autoFocus: f }), { isHovered: G, hoverProps: oe } = Oe({ isDisabled: i }), { pressed: Z, pressProps: ce } = We({ disabled: i }), c = C(() => ({ selected: _, hover: G, active: Z, focus: M, autofocus: f, disabled: i }), [_, G, M, Z, f, i]), w = _e({ ref: F, onKeyDown: T, onMouseDown: k, onClick: E, id: s, role: "tab", type: Ce(e, R), "aria-controls": (r = (n = p[g]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": _, tabIndex: _ ? 0 : -1, disabled: i || void 0, autoFocus: f }, ie, oe, ce);
181
+ return X({ ourProps: w, theirProps: P, slot: c, defaultTag: tt, name: "Tabs.Tab" });
182
182
  }
183
- let rt = "div";
184
- function nt(e, t) {
185
- let { selectedIndex: n } = q("Tab.Panels"), r = X(t), a = C(() => ({ selectedIndex: n }), [n]);
186
- return Z({ ourProps: { ref: r }, theirProps: e, slot: a, defaultTag: rt, name: "Tabs.Panels" });
183
+ let nt = "div";
184
+ function at(e, t) {
185
+ let { selectedIndex: n } = H("Tab.Panels"), r = Q(t), a = C(() => ({ selectedIndex: n }), [n]);
186
+ return X({ ourProps: { ref: r }, theirProps: e, slot: a, defaultTag: nt, name: "Tabs.Panels" });
187
187
  }
188
- let at = "div", st = me.RenderStrategy | me.Static;
189
- function lt(e, t) {
188
+ let st = "div", lt = me.RenderStrategy | me.Static;
189
+ function it(e, t) {
190
190
  var n, r, a, s;
191
- let l = he(), { id: f = `headlessui-tabs-panel-${l}`, tabIndex: w = 0, ...v } = e, { selectedIndex: d, tabs: x, panels: A } = q("Tab.Panel"), p = pe("Tab.Panel"), u = ae(null), D = X(u, t);
192
- se(() => p.registerPanel(u), [p, u]);
191
+ let i = he(), { id: f = `headlessui-tabs-panel-${i}`, tabIndex: P = 0, ...v } = e, { selectedIndex: d, tabs: x, panels: A } = H("Tab.Panel"), p = pe("Tab.Panel"), u = se(null), D = Q(u, t);
192
+ le(() => p.registerPanel(u), [p, u]);
193
193
  let R = Pe("panels"), y = A.indexOf(u);
194
194
  y === -1 && (y = R);
195
- let b = y === d, { isFocusVisible: F, focusProps: L } = ge(), g = C(() => ({ selected: b, focus: F }), [b, F]), _ = _e({ ref: D, id: f, role: "tabpanel", "aria-labelledby": (r = (n = x[y]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? w : -1 }, L);
196
- return !b && ((a = v.unmount) == null || a) && !((s = v.static) != null && s) ? z.createElement(Te, { "aria-hidden": "true", ..._ }) : Z({ ourProps: _, theirProps: v, slot: g, defaultTag: at, features: st, visible: b, name: "Tabs.Panel" });
195
+ let b = y === d, { isFocusVisible: F, focusProps: L } = ge(), g = C(() => ({ selected: b, focus: F }), [b, F]), _ = _e({ ref: D, id: f, role: "tabpanel", "aria-labelledby": (r = (n = x[y]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? P : -1 }, L);
196
+ return !b && ((a = v.unmount) == null || a) && !((s = v.static) != null && s) ? V.createElement(Te, { "aria-hidden": "true", ..._ }) : X({ ourProps: _, theirProps: v, slot: g, defaultTag: st, features: lt, visible: b, name: "Tabs.Panel" });
197
197
  }
198
- let it = Q(tt), we = Q(Qe), $e = Q(Ze), ye = Q(nt), Ee = Q(lt), ot = Object.assign(it, { Group: we, List: $e, Panels: ye, Panel: Ee });
199
- const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft = "_list_14t2i_55", pt = "_tabs_14t2i_66", bt = "_buttons_14t2i_72", mt = "_m_14t2i_79", vt = "_s_14t2i_87", ht = "_detailed_14t2i_95", m = {
200
- container: ct,
201
- group: ut,
198
+ let ot = Y(rt), we = Y(Xe), $e = Y(et), ye = Y(at), Ee = Y(it), ct = Object.assign(ot, { Group: we, List: $e, Panels: ye, Panel: Ee });
199
+ const ut = "_container_14t2i_2", dt = "_group_14t2i_6", ft = "_tab_14t2i_17", pt = "_list_14t2i_55", bt = "_tabs_14t2i_66", mt = "_buttons_14t2i_72", vt = "_m_14t2i_79", ht = "_s_14t2i_87", xt = "_detailed_14t2i_95", m = {
200
+ container: ut,
201
+ group: dt,
202
202
  "group-inner": "_group-inner_14t2i_10",
203
- tab: dt,
204
- list: ft,
205
- tabs: pt,
206
- buttons: bt,
207
- m: mt,
208
- s: vt,
209
- detailed: ht,
203
+ tab: ft,
204
+ list: pt,
205
+ tabs: bt,
206
+ buttons: mt,
207
+ m: vt,
208
+ s: ht,
209
+ detailed: xt,
210
210
  "tab-content": "_tab-content_14t2i_123",
211
211
  "tab-value": "_tab-value_14t2i_131",
212
212
  "tab-name": "_tab-name_14t2i_140",
213
213
  "tab-header": "_tab-header_14t2i_149",
214
214
  "tab-text": "_tab-text_14t2i_155",
215
215
  "tab-icon": "_tab-icon_14t2i_162"
216
- }, kt = Ae(
216
+ }, Dt = Fe(
217
217
  ({
218
218
  categories: e,
219
- size: t = Fe.M,
219
+ size: t = ke.M,
220
220
  showButtons: n = !0,
221
221
  className: r,
222
222
  selectedTabIndex: a,
223
223
  onTabChange: s,
224
- buttonsVariant: l = De.WHITE,
224
+ buttonsVariant: i = Re.WHITE,
225
225
  autoShowButtons: f = !1,
226
- tabClassName: w,
226
+ tabClassName: P,
227
227
  listClassName: v,
228
228
  panelClassName: d,
229
229
  buttonsClassName: x,
@@ -239,7 +239,7 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
239
239
  tabsClassName: g,
240
240
  groupInnerClassName: _
241
241
  }, O) => {
242
- const [T, o] = ne(a || 0), [E, k] = ne(!1), M = ae(null), le = {
242
+ const [T, o] = ae(a || 0), [E, k] = ae(!1), M = se(null), ie = {
243
243
  ...A && { "--tab-indicator-color": A }
244
244
  };
245
245
  ue(() => {
@@ -247,16 +247,16 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
247
247
  }, [T, a]);
248
248
  const G = (c) => {
249
249
  o(c), s == null || s(c);
250
- }, ie = () => {
250
+ }, oe = () => {
251
251
  const c = (T + 1) % e.length;
252
252
  G(c);
253
- }, ee = () => {
253
+ }, Z = () => {
254
254
  const c = (T - 1 + e.length) % e.length;
255
255
  G(c);
256
256
  };
257
257
  ue(() => {
258
- var $;
259
- const c = ($ = M.current) == null ? void 0 : $.querySelector(
258
+ var w;
259
+ const c = (w = M.current) == null ? void 0 : w.querySelector(
260
260
  `.${m.tab}[data-active="true"]`
261
261
  );
262
262
  c && typeof c.scrollIntoView == "function" && c.scrollIntoView({
@@ -267,18 +267,18 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
267
267
  }, [T]), ue(() => {
268
268
  const c = () => {
269
269
  if (M.current) {
270
- const { scrollWidth: $, clientWidth: i } = M.current;
271
- k($ > i);
270
+ const { scrollWidth: w, clientWidth: l } = M.current;
271
+ k(w > l);
272
272
  }
273
273
  };
274
274
  return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
275
275
  }, [e]);
276
- const oe = f ? E : n;
277
- return /* @__PURE__ */ J(
276
+ const ce = f ? E : n;
277
+ return /* @__PURE__ */ j(
278
278
  we,
279
279
  {
280
280
  ref: O,
281
- className: P(
281
+ className: I(
282
282
  m.group,
283
283
  m[t],
284
284
  u === "detailed" && m.detailed,
@@ -286,49 +286,56 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
286
286
  ),
287
287
  selectedIndex: T,
288
288
  onChange: G,
289
- style: le,
289
+ style: ie,
290
290
  children: [
291
- /* @__PURE__ */ J("div", { className: P(m["group-inner"], _), children: [
291
+ /* @__PURE__ */ j("div", { className: I(m["group-inner"], _), children: [
292
292
  /* @__PURE__ */ h(
293
293
  $e,
294
294
  {
295
295
  ref: M,
296
- className: P(m.list, v),
297
- children: /* @__PURE__ */ h("div", { className: P(m.tabs, g), children: e.map(
298
- ({ name: c, notificationCount: $, value: i, valueColor: I, borderColor: B }, H) => {
299
- const j = p[H], ce = u === "detailed" ? {
300
- ...I && {
301
- "--detailed-value-color": I
302
- },
296
+ className: I(m.list, v),
297
+ children: /* @__PURE__ */ h("div", { className: I(m.tabs, g), children: e.map(
298
+ ({
299
+ name: c,
300
+ defaultActive: w,
301
+ notificationCount: l,
302
+ value: $,
303
+ valueColor: B,
304
+ borderColor: ee
305
+ }, U) => {
306
+ const te = p[U], Ne = u === "detailed" ? {
303
307
  ...B && {
304
- "--detailed-border-color": B
308
+ "--detailed-value-color": B
309
+ },
310
+ ...ee && {
311
+ "--detailed-border-color": ee
305
312
  }
306
313
  } : void 0;
307
314
  return /* @__PURE__ */ h(
308
- ot,
315
+ ct,
309
316
  {
310
- className: `${m.tab} ${T === H ? 'data-active="true"' : ""} ${w || ""}`,
311
- "data-active": T === H,
312
- style: ce,
317
+ className: `${m.tab} ${w || T === U ? 'data-active="true"' : ""} ${P || ""}`,
318
+ "data-active": w || T === U,
319
+ style: Ne,
313
320
  children: u === "detailed" ? /* @__PURE__ */ h(
314
321
  "div",
315
322
  {
316
- className: P(
323
+ className: I(
317
324
  m["tab-content"],
318
325
  D
319
326
  ),
320
- children: /* @__PURE__ */ J(
327
+ children: /* @__PURE__ */ j(
321
328
  "div",
322
329
  {
323
- className: P(
330
+ className: I(
324
331
  m["tab-header"],
325
332
  R
326
333
  ),
327
334
  children: [
328
- /* @__PURE__ */ J(
335
+ /* @__PURE__ */ j(
329
336
  "div",
330
337
  {
331
- className: P(
338
+ className: I(
332
339
  m["tab-text"],
333
340
  y
334
341
  ),
@@ -336,17 +343,17 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
336
343
  /* @__PURE__ */ h(
337
344
  "div",
338
345
  {
339
- className: P(
346
+ className: I(
340
347
  m["tab-value"],
341
348
  b
342
349
  ),
343
- children: i
350
+ children: $
344
351
  }
345
352
  ),
346
353
  /* @__PURE__ */ h(
347
354
  "div",
348
355
  {
349
- className: P(
356
+ className: I(
350
357
  m["tab-name"],
351
358
  F
352
359
  ),
@@ -359,7 +366,7 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
359
366
  /* @__PURE__ */ h(
360
367
  "div",
361
368
  {
362
- className: P(
369
+ className: I(
363
370
  m["tab-icon"],
364
371
  L
365
372
  ),
@@ -370,13 +377,13 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
370
377
  }
371
378
  )
372
379
  }
373
- ) : /* @__PURE__ */ J(Ne, { children: [
374
- j && /* @__PURE__ */ h(be, { iconName: j }),
380
+ ) : /* @__PURE__ */ j(Se, { children: [
381
+ te && /* @__PURE__ */ h(be, { iconName: te }),
375
382
  c,
376
- $ && /* @__PURE__ */ h(
377
- Re,
383
+ l && /* @__PURE__ */ h(
384
+ Le,
378
385
  {
379
- count: $,
386
+ count: l,
380
387
  size: "m"
381
388
  }
382
389
  )
@@ -388,20 +395,20 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
388
395
  ) })
389
396
  }
390
397
  ),
391
- oe && /* @__PURE__ */ h("div", { className: P(m.buttons, x), children: /* @__PURE__ */ h(
392
- ke,
398
+ ce && /* @__PURE__ */ h("div", { className: I(m.buttons, x), children: /* @__PURE__ */ h(
399
+ De,
393
400
  {
394
- handlePrevTab: ee,
395
- handleNextTab: ie,
396
- buttonsVariant: l
401
+ handlePrevTab: Z,
402
+ handleNextTab: oe,
403
+ buttonsVariant: i
397
404
  }
398
405
  ) })
399
406
  ] }),
400
- /* @__PURE__ */ h(ye, { className: m.panels, children: e.map(({ name: c, content: $ }) => /* @__PURE__ */ h(
407
+ /* @__PURE__ */ h(ye, { className: m.panels, children: e.map(({ name: c, content: w }) => /* @__PURE__ */ h(
401
408
  Ee,
402
409
  {
403
- className: P(m.panel, d),
404
- children: $
410
+ className: I(m.panel, d),
411
+ children: w
405
412
  },
406
413
  c
407
414
  )) })
@@ -411,5 +418,5 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
411
418
  }
412
419
  );
413
420
  export {
414
- kt as TabTrail
421
+ Dt as TabTrail
415
422
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mimir-ui-kit",
3
3
  "private": false,
4
- "version": "1.56.2",
4
+ "version": "1.58.0",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {