mimir-ui-kit 1.49.2 → 1.50.1

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,39 +1,39 @@
1
- import { jsxs as V, jsx as _, Fragment as Ne } from "react/jsx-runtime";
2
- import { c as X } from "../../index-DIxK0V-G.js";
3
- import * as B from "react";
4
- import M, { useState as te, createContext as fe, useReducer as Se, useMemo as R, useId as pe, useRef as re, useContext as be, forwardRef as Ae, useEffect as se } from "react";
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
5
  import { ETabTrailSize as Fe } from "./constants.js";
6
6
  import { TabButtons as ke } from "./TabButtons/TabButtons.js";
7
7
  import { ETabTrailButtonVariant as De } from "./TabButtons/constants.js";
8
- import { Icon as ue } from "../../icons/Icon.js";
8
+ import { Icon as be } from "../../icons/Icon.js";
9
9
  import { NotificationBadge as Re } from "../NotificationBadge/NotificationBadge.js";
10
- import { M as de, W as j, s as Z, y as J, o as D, n as ne, H as K, $ as me, b as Le, D as ve, a as H, u as Oe, c as y, e as Me } from "../../keyboard-wis2TUql.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
11
  import { w as Be } from "../../use-active-press-CnDeVvQq.js";
12
12
  import { e as We } from "../../use-resolve-button-type-DhFdPxnv.js";
13
13
  import { f as Ce } from "../../use-is-mounted-MBU4fiLr.js";
14
- import { T as he, s as Ge } from "../../hidden-CkTYbiNM.js";
15
- import { _ as q, T as ee, P as O, F as E } from "../../focus-management-BAl0GmRk.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
16
  import '../../assets/TabTrail.css';function Ue({ onFocus: e }) {
17
- let [t, n] = te(!0), r = Ce();
18
- return t ? M.createElement(he, { as: "button", type: "button", features: Ge.Focusable, onFocus: (a) => {
17
+ let [t, n] = ne(!0), r = Ce();
18
+ return t ? z.createElement(Te, { as: "button", type: "button", features: Ge.Focusable, onFocus: (a) => {
19
19
  a.preventDefault();
20
- let l, i = 50;
20
+ let s, l = 50;
21
21
  function f() {
22
- if (i-- <= 0) {
23
- l && cancelAnimationFrame(l);
22
+ if (l-- <= 0) {
23
+ s && cancelAnimationFrame(s);
24
24
  return;
25
25
  }
26
26
  if (e()) {
27
- if (cancelAnimationFrame(l), !r.current) return;
27
+ if (cancelAnimationFrame(s), !r.current) return;
28
28
  n(!1);
29
29
  return;
30
30
  }
31
- l = requestAnimationFrame(f);
31
+ s = requestAnimationFrame(f);
32
32
  }
33
- l = requestAnimationFrame(f);
33
+ s = requestAnimationFrame(f);
34
34
  } }) : null;
35
35
  }
36
- const xe = B.createContext(null);
36
+ const Ie = V.createContext(null);
37
37
  function ze() {
38
38
  return { groups: /* @__PURE__ */ new Map(), get(e, t) {
39
39
  var n;
@@ -41,161 +41,161 @@ function ze() {
41
41
  r || (r = /* @__PURE__ */ new Map(), this.groups.set(e, r));
42
42
  let a = (n = r.get(t)) != null ? n : 0;
43
43
  r.set(t, a + 1);
44
- let l = Array.from(r.keys()).indexOf(t);
45
- function i() {
44
+ let s = Array.from(r.keys()).indexOf(t);
45
+ function l() {
46
46
  let f = r.get(t);
47
47
  f > 1 ? r.set(t, f - 1) : r.delete(t);
48
48
  }
49
- return [l, i];
49
+ return [s, l];
50
50
  } };
51
51
  }
52
52
  function Ve({ children: e }) {
53
- let t = B.useRef(ze());
54
- return B.createElement(xe.Provider, { value: t }, e);
53
+ let t = V.useRef(ze());
54
+ return V.createElement(Ie.Provider, { value: t }, e);
55
55
  }
56
- function ge(e) {
57
- let t = B.useContext(xe);
56
+ function Pe(e) {
57
+ let t = V.useContext(Ie);
58
58
  if (!t) throw new Error("You must wrap your component in a <StableCollection>");
59
- let n = B.useId(), [r, a] = t.current.get(e, n);
60
- return B.useEffect(() => a, []), r;
59
+ let n = V.useId(), [r, a] = t.current.get(e, n);
60
+ return V.useEffect(() => a, []), r;
61
61
  }
62
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
63
  let Je = { 0(e, t) {
64
64
  var n;
65
- let r = q(e.tabs, (d) => d.current), a = q(e.panels, (d) => d.current), l = r.filter((d) => {
66
- var T;
67
- return !((T = d.current) != null && T.hasAttribute("disabled"));
68
- }), i = { ...e, tabs: r, panels: a };
65
+ let r = K(e.tabs, (d) => d.current), a = K(e.panels, (d) => d.current), s = r.filter((d) => {
66
+ var x;
67
+ return !((x = d.current) != null && x.hasAttribute("disabled"));
68
+ }), l = { ...e, tabs: r, panels: a };
69
69
  if (t.index < 0 || t.index > r.length - 1) {
70
- let d = H(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => H(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
71
- if (l.length === 0) return i;
72
- let T = H(d, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
73
- return { ...i, selectedIndex: T === -1 ? e.selectedIndex : T };
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 };
74
74
  }
75
- let f = r.slice(0, t.index), P = [...r.slice(t.index), ...f].find((d) => l.includes(d));
76
- if (!P) return i;
77
- let x = (n = r.indexOf(P)) != null ? n : e.selectedIndex;
78
- return x === -1 && (x = e.selectedIndex), { ...i, selectedIndex: x };
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 };
79
79
  }, 1(e, t) {
80
80
  if (e.tabs.includes(t.tab)) return e;
81
- let n = e.tabs[e.selectedIndex], r = q([...e.tabs, t.tab], (l) => l.current), a = e.selectedIndex;
81
+ let n = e.tabs[e.selectedIndex], r = K([...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: q([...e.panels, t.panel], (n) => n.current) };
86
+ return e.panels.includes(t.panel) ? e : { ...e, panels: K([...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
- } }, le = fe(null);
90
- le.displayName = "TabsDataContext";
91
- function W(e) {
92
- let t = be(le);
89
+ } }, de = ve(null);
90
+ de.displayName = "TabsDataContext";
91
+ function q(e) {
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, W), n;
95
+ throw Error.captureStackTrace && Error.captureStackTrace(n, q), n;
96
96
  }
97
97
  return t;
98
98
  }
99
- let ie = fe(null);
100
- ie.displayName = "TabsActionsContext";
101
- function oe(e) {
102
- let t = be(ie);
99
+ let fe = ve(null);
100
+ fe.displayName = "TabsActionsContext";
101
+ function pe(e) {
102
+ let t = xe(fe);
103
103
  if (t === null) {
104
104
  let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
105
- throw Error.captureStackTrace && Error.captureStackTrace(n, oe), n;
105
+ throw Error.captureStackTrace && Error.captureStackTrace(n, pe), n;
106
106
  }
107
107
  return t;
108
108
  }
109
109
  function Ke(e, t) {
110
- return H(t.type, Je, e, t);
110
+ return Y(t.type, Je, e, t);
111
111
  }
112
112
  let Ye = "div";
113
113
  function Qe(e, t) {
114
- let { defaultIndex: n = 0, vertical: r = !1, manual: a = !1, onChange: l, selectedIndex: i = null, ...f } = e;
115
- const P = r ? "vertical" : "horizontal", x = a ? "manual" : "auto";
116
- let d = i !== null, T = Z({ isControlled: d }), N = J(t), [p, o] = Se(Ke, { info: T, selectedIndex: i ?? n, tabs: [], panels: [] }), F = R(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), g = Z(l || (() => {
117
- })), w = Z(p.tabs), b = R(() => ({ orientation: P, activation: x, ...p }), [P, x, p]), A = D((c) => (o({ type: 1, tab: c }), () => o({ type: 2, tab: c }))), $ = D((c) => (o({ type: 3, panel: c }), () => o({ type: 4, panel: c }))), I = D((c) => {
118
- h.current !== c && g.current(c), d || o({ type: 0, index: c });
119
- }), h = Z(d ? e.selectedIndex : p.selectedIndex), k = R(() => ({ registerTab: A, registerPanel: $, change: I }), []);
120
- ne(() => {
121
- o({ type: 0, index: i ?? n });
122
- }, [i]), ne(() => {
123
- if (h.current === void 0 || p.tabs.length <= 0) return;
124
- let c = q(p.tabs, (s) => s.current);
125
- c.some((s, v) => p.tabs[v] !== s) && I(c.indexOf(p.tabs[h.current]));
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) => {
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(() => {
123
+ if (_.current === void 0 || p.tabs.length <= 0) return;
124
+ let o = K(p.tabs, (E) => E.current);
125
+ o.some((E, k) => p.tabs[k] !== E) && g(o.indexOf(p.tabs[_.current]));
126
126
  });
127
- let C = { ref: N };
128
- return M.createElement(Ve, null, M.createElement(ie.Provider, { value: k }, M.createElement(le.Provider, { value: b }, b.tabs.length <= 0 && M.createElement(Ue, { onFocus: () => {
129
- var c, s;
130
- for (let v of w.current) if (((c = v.current) == null ? void 0 : c.tabIndex) === 0) return (s = v.current) == null || s.focus(), !0;
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: () => {
129
+ var o, E;
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
- } }), K({ ourProps: C, theirProps: f, slot: F, defaultTag: Ye, name: "Tabs" }))));
132
+ } }), Z({ ourProps: T, theirProps: f, slot: D, defaultTag: Ye, name: "Tabs" }))));
133
133
  }
134
134
  let Xe = "div";
135
135
  function Ze(e, t) {
136
- let { orientation: n, selectedIndex: r } = W("Tab.List"), a = J(t), l = R(() => ({ selectedIndex: r }), [r]);
137
- return K({ ourProps: { ref: a, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: Xe, name: "Tabs.List" });
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" });
138
138
  }
139
139
  let et = "button";
140
140
  function tt(e, t) {
141
141
  var n, r;
142
- let a = pe(), { id: l = `headlessui-tabs-tab-${a}`, disabled: i = !1, autoFocus: f = !1, ...P } = e, { orientation: x, activation: d, selectedIndex: T, tabs: N, panels: p } = W("Tab"), o = oe("Tab"), F = W("Tab"), [g, w] = te(null), b = re(null), A = J(b, t, w);
143
- ne(() => o.registerTab(b), [o, b]);
144
- let $ = ge("tabs"), I = N.indexOf(b);
145
- I === -1 && (I = $);
146
- let h = I === T, k = D((u) => {
147
- var S;
148
- let Q = u();
149
- if (Q === ee.Success && d === "auto") {
150
- let ye = (S = Oe(b)) == null ? void 0 : S.activeElement, ce = F.tabs.findIndex((Ee) => Ee.current === ye);
151
- ce !== -1 && o.change(ce);
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]);
144
+ let L = Pe("tabs"), g = A.indexOf(b);
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);
152
152
  }
153
- return Q;
154
- }), C = D((u) => {
155
- let S = N.map((Q) => Q.current).filter(Boolean);
156
- if (u.key === y.Space || u.key === y.Enter) {
157
- u.preventDefault(), u.stopPropagation(), o.change(I);
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);
158
158
  return;
159
159
  }
160
- switch (u.key) {
161
- case y.Home:
162
- case y.PageUp:
163
- return u.preventDefault(), u.stopPropagation(), k(() => O(S, E.First));
164
- case y.End:
165
- case y.PageDown:
166
- return u.preventDefault(), u.stopPropagation(), k(() => O(S, E.Last));
160
+ switch (i.key) {
161
+ case N.Home:
162
+ case N.PageUp:
163
+ return i.preventDefault(), i.stopPropagation(), O(() => U(I, S.First));
164
+ case N.End:
165
+ case N.PageDown:
166
+ return i.preventDefault(), i.stopPropagation(), O(() => U(I, S.Last));
167
167
  }
168
- if (k(() => H(x, { vertical() {
169
- return u.key === y.ArrowUp ? O(S, E.Previous | E.WrapAround) : u.key === y.ArrowDown ? O(S, E.Next | E.WrapAround) : ee.Error;
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;
170
170
  }, horizontal() {
171
- return u.key === y.ArrowLeft ? O(S, E.Previous | E.WrapAround) : u.key === y.ArrowRight ? O(S, E.Next | E.WrapAround) : ee.Error;
172
- } })) === ee.Success) return u.preventDefault();
173
- }), c = re(!1), s = D(() => {
174
- var u;
175
- c.current || (c.current = !0, (u = b.current) == null || u.focus({ preventScroll: !0 }), o.change(I), Me(() => {
176
- c.current = !1;
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(() => {
176
+ o.current = !1;
177
177
  }));
178
- }), v = D((u) => {
179
- u.preventDefault();
180
- }), { isFocusVisible: L, focusProps: Y } = me({ autoFocus: f }), { isHovered: G, hoverProps: U } = Le({ isDisabled: i }), { pressed: z, pressProps: ae } = Be({ disabled: i }), we = R(() => ({ selected: h, hover: G, active: z, focus: L, autofocus: f, disabled: i }), [h, G, L, z, f, i]), $e = ve({ ref: A, onKeyDown: C, onMouseDown: v, onClick: s, id: l, role: "tab", type: We(e, g), "aria-controls": (r = (n = p[I]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": h, tabIndex: h ? 0 : -1, disabled: i || void 0, autoFocus: f }, Y, U, ae);
181
- return K({ ourProps: $e, theirProps: P, slot: we, defaultTag: et, name: "Tabs.Tab" });
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" });
182
182
  }
183
183
  let rt = "div";
184
184
  function nt(e, t) {
185
- let { selectedIndex: n } = W("Tab.Panels"), r = J(t), a = R(() => ({ selectedIndex: n }), [n]);
186
- return K({ ourProps: { ref: r }, theirProps: e, slot: a, defaultTag: rt, name: "Tabs.Panels" });
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" });
187
187
  }
188
- let at = "div", st = de.RenderStrategy | de.Static;
188
+ let at = "div", st = me.RenderStrategy | me.Static;
189
189
  function lt(e, t) {
190
- var n, r, a, l;
191
- let i = pe(), { id: f = `headlessui-tabs-panel-${i}`, tabIndex: P = 0, ...x } = e, { selectedIndex: d, tabs: T, panels: N } = W("Tab.Panel"), p = oe("Tab.Panel"), o = re(null), F = J(o, t);
192
- ne(() => p.registerPanel(o), [p, o]);
193
- let g = ge("panels"), w = N.indexOf(o);
194
- w === -1 && (w = g);
195
- let b = w === d, { isFocusVisible: A, focusProps: $ } = me(), I = R(() => ({ selected: b, focus: A }), [b, A]), h = ve({ ref: F, id: f, role: "tabpanel", "aria-labelledby": (r = (n = T[w]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? P : -1 }, $);
196
- return !b && ((a = x.unmount) == null || a) && !((l = x.static) != null && l) ? M.createElement(he, { "aria-hidden": "true", ...h }) : K({ ourProps: h, theirProps: x, slot: I, defaultTag: at, features: st, visible: b, name: "Tabs.Panel" });
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]);
193
+ let R = Pe("panels"), y = A.indexOf(u);
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" });
197
197
  }
198
- let it = j(tt), _e = j(Qe), Te = j(Ze), Ie = j(nt), Pe = j(lt), ot = Object.assign(it, { Group: _e, List: Te, Panels: Ie, Panel: Pe });
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
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
200
  container: ct,
201
201
  group: ut,
@@ -220,128 +220,190 @@ const ct = "_container_14t2i_2", ut = "_group_14t2i_6", dt = "_tab_14t2i_17", ft
220
220
  showButtons: n = !0,
221
221
  className: r,
222
222
  selectedTabIndex: a,
223
- onTabChange: l,
224
- buttonsVariant: i = De.WHITE,
223
+ onTabChange: s,
224
+ buttonsVariant: l = De.WHITE,
225
225
  autoShowButtons: f = !1,
226
- tabClassName: P,
227
- listClassName: x,
226
+ tabClassName: w,
227
+ listClassName: v,
228
228
  panelClassName: d,
229
- buttonsClassName: T,
230
- indicatorColor: N,
229
+ buttonsClassName: x,
230
+ indicatorColor: A,
231
231
  tabIcons: p = {},
232
- variant: o = "default"
233
- }, F) => {
234
- const [g, w] = te(a || 0), [b, A] = te(!1), $ = re(null), I = {
235
- ...N && { "--tab-indicator-color": N }
232
+ variant: u = "default",
233
+ tabContentClassName: D,
234
+ tabHeaderClassName: R,
235
+ tabTextClassName: y,
236
+ tabValueClassName: b,
237
+ tabNameClassName: F,
238
+ tabIconClassName: L,
239
+ tabsClassName: g,
240
+ groupInnerClassName: _
241
+ }, O) => {
242
+ const [T, o] = ne(a || 0), [E, k] = ne(!1), M = ae(null), le = {
243
+ ...A && { "--tab-indicator-color": A }
236
244
  };
237
- se(() => {
238
- a !== void 0 && a !== g && w(a);
239
- }, [g, a]);
240
- const h = (s) => {
241
- w(s), l == null || l(s);
242
- }, k = () => {
243
- const s = (g + 1) % e.length;
244
- h(s);
245
- }, C = () => {
246
- const s = (g - 1 + e.length) % e.length;
247
- h(s);
245
+ ue(() => {
246
+ a !== void 0 && a !== T && o(a);
247
+ }, [T, a]);
248
+ const G = (c) => {
249
+ o(c), s == null || s(c);
250
+ }, ie = () => {
251
+ const c = (T + 1) % e.length;
252
+ G(c);
253
+ }, ee = () => {
254
+ const c = (T - 1 + e.length) % e.length;
255
+ G(c);
248
256
  };
249
- se(() => {
250
- var v;
251
- const s = (v = $.current) == null ? void 0 : v.querySelector(
257
+ ue(() => {
258
+ var $;
259
+ const c = ($ = M.current) == null ? void 0 : $.querySelector(
252
260
  `.${m.tab}[data-active="true"]`
253
261
  );
254
- s && typeof s.scrollIntoView == "function" && s.scrollIntoView({
262
+ c && typeof c.scrollIntoView == "function" && c.scrollIntoView({
255
263
  behavior: "smooth",
256
264
  block: "nearest",
257
265
  inline: "center"
258
266
  });
259
- }, [g]), se(() => {
260
- const s = () => {
261
- if ($.current) {
262
- const { scrollWidth: v, clientWidth: L } = $.current;
263
- A(v > L);
267
+ }, [T]), ue(() => {
268
+ const c = () => {
269
+ if (M.current) {
270
+ const { scrollWidth: $, clientWidth: i } = M.current;
271
+ k($ > i);
264
272
  }
265
273
  };
266
- return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
274
+ return c(), window.addEventListener("resize", c), () => window.removeEventListener("resize", c);
267
275
  }, [e]);
268
- const c = f ? b : n;
269
- return /* @__PURE__ */ V(
270
- _e,
276
+ const oe = f ? E : n;
277
+ return /* @__PURE__ */ J(
278
+ we,
271
279
  {
272
- ref: F,
273
- className: X(
280
+ ref: O,
281
+ className: P(
274
282
  m.group,
275
283
  m[t],
276
- o === "detailed" && m.detailed,
284
+ u === "detailed" && m.detailed,
277
285
  r
278
286
  ),
279
- selectedIndex: g,
280
- onChange: h,
281
- style: I,
287
+ selectedIndex: T,
288
+ onChange: G,
289
+ style: le,
282
290
  children: [
283
- /* @__PURE__ */ V("div", { className: m["group-inner"], children: [
284
- /* @__PURE__ */ _(
285
- Te,
291
+ /* @__PURE__ */ J("div", { className: P(m["group-inner"], _), children: [
292
+ /* @__PURE__ */ h(
293
+ $e,
286
294
  {
287
- ref: $,
288
- className: X(m.list, x),
289
- children: /* @__PURE__ */ _("div", { className: m.tabs, children: e.map(
290
- ({ name: s, notificationCount: v, value: L, valueColor: Y, borderColor: G }, U) => {
291
- const z = p[U], ae = o === "detailed" ? {
292
- ...Y && {
293
- "--detailed-value-color": Y
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
294
302
  },
295
- ...G && {
296
- "--detailed-border-color": G
303
+ ...B && {
304
+ "--detailed-border-color": B
297
305
  }
298
306
  } : void 0;
299
- return /* @__PURE__ */ _(
307
+ return /* @__PURE__ */ h(
300
308
  ot,
301
309
  {
302
- className: `${m.tab} ${g === U ? 'data-active="true"' : ""} ${P || ""}`,
303
- "data-active": g === U,
304
- style: ae,
305
- children: o === "detailed" ? /* @__PURE__ */ _("div", { className: m["tab-content"], children: /* @__PURE__ */ V("div", { className: m["tab-header"], children: [
306
- /* @__PURE__ */ V("div", { className: m["tab-text"], children: [
307
- /* @__PURE__ */ _("div", { className: m["tab-value"], children: L }),
308
- /* @__PURE__ */ _("div", { className: m["tab-name"], children: s })
309
- ] }),
310
- /* @__PURE__ */ _("div", { className: m["tab-icon"], children: /* @__PURE__ */ _(ue, { iconName: "ArrowUpRight24px" }) })
311
- ] }) }) : /* @__PURE__ */ V(Ne, { children: [
312
- z && /* @__PURE__ */ _(ue, { iconName: z }),
313
- s,
314
- v && /* @__PURE__ */ _(
310
+ className: `${m.tab} ${T === H ? 'data-active="true"' : ""} ${w || ""}`,
311
+ "data-active": T === H,
312
+ style: ce,
313
+ children: u === "detailed" ? /* @__PURE__ */ h(
314
+ "div",
315
+ {
316
+ className: P(
317
+ m["tab-content"],
318
+ D
319
+ ),
320
+ children: /* @__PURE__ */ J(
321
+ "div",
322
+ {
323
+ className: P(
324
+ m["tab-header"],
325
+ R
326
+ ),
327
+ children: [
328
+ /* @__PURE__ */ J(
329
+ "div",
330
+ {
331
+ className: P(
332
+ m["tab-text"],
333
+ y
334
+ ),
335
+ children: [
336
+ /* @__PURE__ */ h(
337
+ "div",
338
+ {
339
+ className: P(
340
+ m["tab-value"],
341
+ b
342
+ ),
343
+ children: i
344
+ }
345
+ ),
346
+ /* @__PURE__ */ h(
347
+ "div",
348
+ {
349
+ className: P(
350
+ m["tab-name"],
351
+ F
352
+ ),
353
+ children: c
354
+ }
355
+ )
356
+ ]
357
+ }
358
+ ),
359
+ /* @__PURE__ */ h(
360
+ "div",
361
+ {
362
+ className: P(
363
+ m["tab-icon"],
364
+ L
365
+ ),
366
+ children: /* @__PURE__ */ h(be, { iconName: "ArrowUpRight24px" })
367
+ }
368
+ )
369
+ ]
370
+ }
371
+ )
372
+ }
373
+ ) : /* @__PURE__ */ J(Ne, { children: [
374
+ j && /* @__PURE__ */ h(be, { iconName: j }),
375
+ c,
376
+ $ && /* @__PURE__ */ h(
315
377
  Re,
316
378
  {
317
- count: v,
379
+ count: $,
318
380
  size: "m"
319
381
  }
320
382
  )
321
383
  ] })
322
384
  },
323
- s
385
+ c
324
386
  );
325
387
  }
326
388
  ) })
327
389
  }
328
390
  ),
329
- c && /* @__PURE__ */ _("div", { className: X(m.buttons, T), children: /* @__PURE__ */ _(
391
+ oe && /* @__PURE__ */ h("div", { className: P(m.buttons, x), children: /* @__PURE__ */ h(
330
392
  ke,
331
393
  {
332
- handlePrevTab: C,
333
- handleNextTab: k,
334
- buttonsVariant: i
394
+ handlePrevTab: ee,
395
+ handleNextTab: ie,
396
+ buttonsVariant: l
335
397
  }
336
398
  ) })
337
399
  ] }),
338
- /* @__PURE__ */ _(Ie, { className: m.panels, children: e.map(({ name: s, content: v }) => /* @__PURE__ */ _(
339
- Pe,
400
+ /* @__PURE__ */ h(ye, { className: m.panels, children: e.map(({ name: c, content: $ }) => /* @__PURE__ */ h(
401
+ Ee,
340
402
  {
341
- className: X(m.panel, d),
342
- children: v
403
+ className: P(m.panel, d),
404
+ children: $
343
405
  },
344
- s
406
+ c
345
407
  )) })
346
408
  ]
347
409
  }
@@ -0,0 +1,3 @@
1
+ import { TProps } from './types';
2
+
3
+ export declare const TextArea: import('react').MemoExoticComponent<import('react').ForwardRefExoticComponent<TProps & import('react').RefAttributes<HTMLDivElement>>>;