mimir-ui-kit 1.43.28 → 1.44.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.
- package/dist/Input-IzZ6B9kw.js +232 -0
- package/dist/assets/Avatar.css +1 -1
- package/dist/assets/Chip.css +1 -1
- package/dist/assets/CopyText.css +1 -0
- package/dist/assets/Counter.css +1 -0
- package/dist/assets/DropdownSelect.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/styles.css +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.js +41 -37
- package/dist/components/Avatar/constants.d.ts +5 -0
- package/dist/components/Avatar/constants.js +3 -2
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +5 -4
- package/dist/components/Avatar/types.d.ts +3 -1
- package/dist/components/Chip/Chip.d.ts +5 -1
- package/dist/components/Chip/Chip.js +45 -36
- package/dist/components/Chip/constants.d.ts +5 -1
- package/dist/components/Chip/constants.js +3 -3
- package/dist/components/CopyText/CopyText.d.ts +3 -0
- package/dist/components/CopyText/CopyText.js +96 -0
- package/dist/components/CopyText/index.d.ts +2 -0
- package/dist/components/CopyText/index.js +4 -0
- package/dist/components/CopyText/types.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.d.ts +11 -0
- package/dist/components/DatePicker/DatePicker.js +96 -93
- package/dist/components/DatePicker/DatePickerModal.js +1 -1
- package/dist/components/DatePicker/MonthPickerModal.js +1 -1
- package/dist/components/DatePicker/YearPickerModal.js +1 -1
- package/dist/components/DatePicker/constants.d.ts +6 -0
- package/dist/components/DatePicker/constants.js +13 -12
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.js +3 -1
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +3 -0
- package/dist/components/DropdownSelect/DropdownSelect.js +115 -0
- package/dist/components/DropdownSelect/constants.d.ts +5 -0
- package/dist/components/DropdownSelect/constants.js +4 -0
- package/dist/components/DropdownSelect/index.d.ts +3 -0
- package/dist/components/DropdownSelect/index.js +6 -0
- package/dist/components/DropdownSelect/types.d.ts +56 -0
- package/dist/components/Input/Input.d.ts +5 -0
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/Input/constants.d.ts +6 -0
- package/dist/components/Input/constants.js +4 -3
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputPassword/InputPassword.js +1 -1
- package/dist/components/InputPhoneNumber/InputPhoneNumber.js +1 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +1 -1
- package/dist/components/MultiSelectSearch/utils.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +1 -1
- package/dist/components/Pagination/Counter/Counter.d.ts +9 -0
- package/dist/components/Pagination/Counter/Counter.js +28 -0
- package/dist/components/Pagination/Pagination.d.ts +17 -0
- package/dist/components/Pagination/Pagination.js +167 -126
- package/dist/components/Pagination/constants.d.ts +6 -0
- package/dist/components/Pagination/constants.js +5 -3
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pagination/index.js +4 -2
- package/dist/components/SelectSearch/SelectSearch.d.ts +2 -1
- package/dist/components/SelectSearch/SelectSearch.js +193 -187
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +7 -5
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +6 -1
- package/dist/components/SelectSearch/utils.js +1 -1
- package/dist/components/TabTrail/TabTrail.d.ts +16 -0
- package/dist/components/TabTrail/TabTrail.js +257 -220
- package/dist/components/TextArea/TextArea.js +1 -1
- package/dist/components/index.d.ts +8 -4
- package/dist/components/index.js +178 -166
- package/dist/index.js +203 -191
- package/dist/styles.module-D3nnIVCZ.js +31 -0
- package/package.json +1 -1
- package/dist/Input-BU_6U1CW.js +0 -227
- package/dist/styles.module-Cuqm31CO.js +0 -28
@@ -1,25 +1,25 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import { ETabTrailSize as
|
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";
|
5
|
+
import { ETabTrailSize as Fe } from "./constants.js";
|
6
6
|
import { TabButtons as ke } from "./TabButtons/TabButtons.js";
|
7
|
-
import { ETabTrailButtonVariant as
|
8
|
-
import { Icon as
|
9
|
-
import { NotificationBadge as
|
10
|
-
import { M as
|
11
|
-
import { w as
|
12
|
-
import { e as
|
13
|
-
import { f as
|
14
|
-
import { T as
|
15
|
-
import { _ as
|
16
|
-
import '../../assets/TabTrail.css';function
|
17
|
-
let [t, n] =
|
18
|
-
return t ?
|
19
|
-
|
20
|
-
let l,
|
21
|
-
function
|
22
|
-
if (
|
7
|
+
import { ETabTrailButtonVariant as De } from "./TabButtons/constants.js";
|
8
|
+
import { Icon as ue } from "../../icons/Icon.js";
|
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";
|
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 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";
|
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) => {
|
19
|
+
a.preventDefault();
|
20
|
+
let l, i = 50;
|
21
|
+
function f() {
|
22
|
+
if (i-- <= 0) {
|
23
23
|
l && cancelAnimationFrame(l);
|
24
24
|
return;
|
25
25
|
}
|
@@ -28,283 +28,320 @@ import '../../assets/TabTrail.css';function Ge({ onFocus: e }) {
|
|
28
28
|
n(!1);
|
29
29
|
return;
|
30
30
|
}
|
31
|
-
l = requestAnimationFrame(
|
31
|
+
l = requestAnimationFrame(f);
|
32
32
|
}
|
33
|
-
l = requestAnimationFrame(
|
33
|
+
l = requestAnimationFrame(f);
|
34
34
|
} }) : null;
|
35
35
|
}
|
36
|
-
const
|
36
|
+
const xe = B.createContext(null);
|
37
37
|
function ze() {
|
38
38
|
return { groups: /* @__PURE__ */ new Map(), get(e, t) {
|
39
39
|
var n;
|
40
40
|
let r = this.groups.get(e);
|
41
41
|
r || (r = /* @__PURE__ */ new Map(), this.groups.set(e, r));
|
42
|
-
let
|
43
|
-
r.set(t,
|
42
|
+
let a = (n = r.get(t)) != null ? n : 0;
|
43
|
+
r.set(t, a + 1);
|
44
44
|
let l = Array.from(r.keys()).indexOf(t);
|
45
|
-
function
|
46
|
-
let
|
47
|
-
|
45
|
+
function i() {
|
46
|
+
let f = r.get(t);
|
47
|
+
f > 1 ? r.set(t, f - 1) : r.delete(t);
|
48
48
|
}
|
49
|
-
return [l,
|
49
|
+
return [l, i];
|
50
50
|
} };
|
51
51
|
}
|
52
|
-
function
|
53
|
-
let t =
|
54
|
-
return
|
52
|
+
function Ve({ children: e }) {
|
53
|
+
let t = B.useRef(ze());
|
54
|
+
return B.createElement(xe.Provider, { value: t }, e);
|
55
55
|
}
|
56
|
-
function
|
57
|
-
let t =
|
56
|
+
function ge(e) {
|
57
|
+
let t = B.useContext(xe);
|
58
58
|
if (!t) throw new Error("You must wrap your component in a <StableCollection>");
|
59
|
-
let n =
|
60
|
-
return
|
59
|
+
let n = B.useId(), [r, a] = t.current.get(e, n);
|
60
|
+
return B.useEffect(() => a, []), r;
|
61
61
|
}
|
62
|
-
var
|
63
|
-
let
|
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) {
|
64
64
|
var n;
|
65
|
-
let r =
|
66
|
-
var
|
67
|
-
return !((
|
68
|
-
}),
|
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 };
|
69
69
|
if (t.index < 0 || t.index > r.length - 1) {
|
70
|
-
let
|
71
|
-
if (l.length === 0) return
|
72
|
-
let
|
73
|
-
return { ...
|
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 };
|
74
74
|
}
|
75
|
-
let
|
76
|
-
if (!
|
77
|
-
let
|
78
|
-
return
|
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 };
|
79
79
|
}, 1(e, t) {
|
80
80
|
if (e.tabs.includes(t.tab)) return e;
|
81
|
-
let n = e.tabs[e.selectedIndex], r =
|
82
|
-
return e.info.current.isControlled || (
|
81
|
+
let n = e.tabs[e.selectedIndex], r = q([...e.tabs, t.tab], (l) => l.current), a = e.selectedIndex;
|
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:
|
86
|
+
return e.panels.includes(t.panel) ? e : { ...e, panels: q([...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
|
-
} },
|
90
|
-
|
91
|
-
function
|
92
|
-
let t =
|
89
|
+
} }, le = fe(null);
|
90
|
+
le.displayName = "TabsDataContext";
|
91
|
+
function W(e) {
|
92
|
+
let t = be(le);
|
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,
|
95
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, W), n;
|
96
96
|
}
|
97
97
|
return t;
|
98
98
|
}
|
99
|
-
let
|
100
|
-
|
101
|
-
function
|
102
|
-
let t =
|
99
|
+
let ie = fe(null);
|
100
|
+
ie.displayName = "TabsActionsContext";
|
101
|
+
function oe(e) {
|
102
|
+
let t = be(ie);
|
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,
|
105
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, oe), n;
|
106
106
|
}
|
107
107
|
return t;
|
108
108
|
}
|
109
|
-
function
|
110
|
-
return
|
109
|
+
function Ke(e, t) {
|
110
|
+
return H(t.type, Je, e, t);
|
111
111
|
}
|
112
|
-
let
|
113
|
-
function
|
114
|
-
let { defaultIndex: n = 0, vertical: r = !1, manual:
|
115
|
-
const
|
116
|
-
let
|
117
|
-
})), w =
|
118
|
-
|
119
|
-
}),
|
120
|
-
|
121
|
-
|
122
|
-
}, [
|
123
|
-
if (
|
124
|
-
let
|
125
|
-
|
112
|
+
let Ye = "div";
|
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]));
|
126
126
|
});
|
127
|
-
let
|
128
|
-
return
|
129
|
-
var
|
130
|
-
for (let
|
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;
|
131
131
|
return !1;
|
132
|
-
} }),
|
132
|
+
} }), K({ ourProps: C, theirProps: f, slot: F, defaultTag: Ye, name: "Tabs" }))));
|
133
133
|
}
|
134
|
-
let
|
135
|
-
function
|
136
|
-
let { orientation: n, selectedIndex: r } =
|
137
|
-
return
|
134
|
+
let Xe = "div";
|
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" });
|
138
138
|
}
|
139
|
-
let
|
140
|
-
function
|
139
|
+
let et = "button";
|
140
|
+
function tt(e, t) {
|
141
141
|
var n, r;
|
142
|
-
let
|
143
|
-
|
144
|
-
let
|
145
|
-
|
146
|
-
let
|
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
147
|
var S;
|
148
|
-
let
|
149
|
-
if (
|
150
|
-
let
|
151
|
-
|
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);
|
152
152
|
}
|
153
|
-
return
|
154
|
-
}),
|
155
|
-
let S =
|
156
|
-
if (
|
157
|
-
|
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);
|
158
158
|
return;
|
159
159
|
}
|
160
|
-
switch (
|
161
|
-
case
|
162
|
-
case
|
163
|
-
return
|
164
|
-
case
|
165
|
-
case
|
166
|
-
return
|
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));
|
167
167
|
}
|
168
|
-
if (
|
169
|
-
return
|
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;
|
170
170
|
}, horizontal() {
|
171
|
-
return
|
172
|
-
} })) ===
|
173
|
-
}),
|
174
|
-
var
|
175
|
-
|
176
|
-
|
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;
|
177
177
|
}));
|
178
|
-
}),
|
179
|
-
|
180
|
-
}), { isFocusVisible:
|
181
|
-
return
|
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" });
|
182
182
|
}
|
183
|
-
let
|
184
|
-
function
|
185
|
-
let { selectedIndex: n } =
|
186
|
-
return
|
183
|
+
let rt = "div";
|
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" });
|
187
187
|
}
|
188
|
-
let
|
189
|
-
function
|
190
|
-
var n, r,
|
191
|
-
let
|
192
|
-
|
193
|
-
let
|
194
|
-
w === -1 && (w =
|
195
|
-
let b = w ===
|
196
|
-
return !b && ((
|
188
|
+
let at = "div", st = de.RenderStrategy | de.Static;
|
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" });
|
197
197
|
}
|
198
|
-
let
|
199
|
-
const
|
200
|
-
container:
|
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 });
|
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
201
|
group: ut,
|
202
|
-
"group-inner": "_group-
|
203
|
-
tab:
|
204
|
-
list:
|
205
|
-
tabs:
|
206
|
-
buttons:
|
207
|
-
m:
|
208
|
-
s:
|
209
|
-
|
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,
|
210
|
+
"tab-content": "_tab-content_14t2i_123",
|
211
|
+
"tab-value": "_tab-value_14t2i_131",
|
212
|
+
"tab-name": "_tab-name_14t2i_140",
|
213
|
+
"tab-header": "_tab-header_14t2i_149",
|
214
|
+
"tab-text": "_tab-text_14t2i_155",
|
215
|
+
"tab-icon": "_tab-icon_14t2i_162"
|
216
|
+
}, kt = Ae(
|
210
217
|
({
|
211
218
|
categories: e,
|
212
|
-
size: t =
|
219
|
+
size: t = Fe.M,
|
213
220
|
showButtons: n = !0,
|
214
221
|
className: r,
|
215
|
-
selectedTabIndex:
|
222
|
+
selectedTabIndex: a,
|
216
223
|
onTabChange: l,
|
217
|
-
buttonsVariant:
|
218
|
-
autoShowButtons:
|
219
|
-
tabClassName:
|
220
|
-
listClassName:
|
221
|
-
panelClassName:
|
222
|
-
buttonsClassName:
|
223
|
-
indicatorColor:
|
224
|
-
tabIcons: p = {}
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
}, [x, s]);
|
230
|
-
const m = (a) => {
|
231
|
-
A(a), l == null || l(a);
|
232
|
-
}, g = () => {
|
233
|
-
const a = (x + 1) % e.length;
|
234
|
-
m(a);
|
235
|
-
}, N = () => {
|
236
|
-
const a = (x - 1 + e.length) % e.length;
|
237
|
-
m(a);
|
224
|
+
buttonsVariant: i = De.WHITE,
|
225
|
+
autoShowButtons: f = !1,
|
226
|
+
tabClassName: P,
|
227
|
+
listClassName: x,
|
228
|
+
panelClassName: d,
|
229
|
+
buttonsClassName: T,
|
230
|
+
indicatorColor: N,
|
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 }
|
238
236
|
};
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
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);
|
248
|
+
};
|
249
|
+
se(() => {
|
250
|
+
var v;
|
251
|
+
const s = (v = $.current) == null ? void 0 : v.querySelector(
|
252
|
+
`.${m.tab}[data-active="true"]`
|
243
253
|
);
|
244
|
-
|
254
|
+
s && typeof s.scrollIntoView == "function" && s.scrollIntoView({
|
245
255
|
behavior: "smooth",
|
246
256
|
block: "nearest",
|
247
257
|
inline: "center"
|
248
258
|
});
|
249
|
-
}, [
|
250
|
-
const
|
251
|
-
if (
|
252
|
-
const { scrollWidth:
|
253
|
-
|
259
|
+
}, [g]), se(() => {
|
260
|
+
const s = () => {
|
261
|
+
if ($.current) {
|
262
|
+
const { scrollWidth: v, clientWidth: L } = $.current;
|
263
|
+
A(v > L);
|
254
264
|
}
|
255
265
|
};
|
256
|
-
return
|
266
|
+
return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
257
267
|
}, [e]);
|
258
|
-
const
|
259
|
-
return /* @__PURE__ */
|
260
|
-
|
268
|
+
const c = f ? b : n;
|
269
|
+
return /* @__PURE__ */ V(
|
270
|
+
_e,
|
261
271
|
{
|
262
|
-
ref:
|
263
|
-
className:
|
264
|
-
|
265
|
-
|
266
|
-
|
272
|
+
ref: F,
|
273
|
+
className: X(
|
274
|
+
m.group,
|
275
|
+
m[t],
|
276
|
+
o === "detailed" && m.detailed,
|
277
|
+
r
|
278
|
+
),
|
279
|
+
selectedIndex: g,
|
280
|
+
onChange: h,
|
281
|
+
style: I,
|
267
282
|
children: [
|
268
|
-
/* @__PURE__ */
|
269
|
-
/* @__PURE__ */
|
270
|
-
|
283
|
+
/* @__PURE__ */ V("div", { className: m["group-inner"], children: [
|
284
|
+
/* @__PURE__ */ _(
|
285
|
+
Te,
|
271
286
|
{
|
272
|
-
ref:
|
273
|
-
className:
|
274
|
-
children: /* @__PURE__ */
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
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
|
294
|
+
},
|
295
|
+
...G && {
|
296
|
+
"--detailed-border-color": G
|
297
|
+
}
|
298
|
+
} : void 0;
|
299
|
+
return /* @__PURE__ */ _(
|
300
|
+
ot,
|
301
|
+
{
|
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__ */ _(
|
315
|
+
Re,
|
316
|
+
{
|
317
|
+
count: v,
|
318
|
+
size: "m"
|
319
|
+
}
|
320
|
+
)
|
321
|
+
] })
|
322
|
+
},
|
323
|
+
s
|
324
|
+
);
|
325
|
+
}
|
326
|
+
) })
|
290
327
|
}
|
291
328
|
),
|
292
|
-
|
329
|
+
c && /* @__PURE__ */ _("div", { className: X(m.buttons, T), children: /* @__PURE__ */ _(
|
293
330
|
ke,
|
294
331
|
{
|
295
|
-
handlePrevTab:
|
296
|
-
handleNextTab:
|
297
|
-
buttonsVariant:
|
332
|
+
handlePrevTab: C,
|
333
|
+
handleNextTab: k,
|
334
|
+
buttonsVariant: i
|
298
335
|
}
|
299
336
|
) })
|
300
337
|
] }),
|
301
|
-
/* @__PURE__ */
|
302
|
-
|
338
|
+
/* @__PURE__ */ _(Ie, { className: m.panels, children: e.map(({ name: s, content: v }) => /* @__PURE__ */ _(
|
339
|
+
Pe,
|
303
340
|
{
|
304
|
-
className:
|
305
|
-
children:
|
341
|
+
className: X(m.panel, d),
|
342
|
+
children: v
|
306
343
|
},
|
307
|
-
|
344
|
+
s
|
308
345
|
)) })
|
309
346
|
]
|
310
347
|
}
|
@@ -5,7 +5,7 @@ import { useAutoResizeTextArea as Z } from "./hooks.js";
|
|
5
5
|
import { useMergeRefs as $ } from "../../hooks/useMergeRefs/useMergeRefs.js";
|
6
6
|
import { Icon as ee } from "../../icons/Icon.js";
|
7
7
|
import { Button as te } from "../Button/Button.js";
|
8
|
-
import { c as e } from "../../Input-
|
8
|
+
import { c as e } from "../../Input-IzZ6B9kw.js";
|
9
9
|
import { EInputVariant as ae } from "../Input/constants.js";
|
10
10
|
import '../../assets/TextArea.css';const re = "_textarea_rk5xe_2", se = "_clear_rk5xe_11", le = "_label_rk5xe_26", ne = "_s_rk5xe_71", oe = "_m_rk5xe_84", ce = "_l_rk5xe_26", t = {
|
11
11
|
"textarea-wrapper": "_textarea-wrapper_rk5xe_2",
|