mimir-ui-kit 1.42.2 → 1.43.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.
- package/dist/ProgressBar-COdzy3fY.js +67 -0
- package/dist/assets/MultiSelectSearch.css +1 -1
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/SelectSearch.css +1 -1
- package/dist/assets/Switcher.css +1 -1
- package/dist/assets/TabTrail.css +1 -1
- package/dist/assets/hooks.css +1 -0
- package/dist/{combobox-Dv6-ANkb.js → combobox-fIVOzEhl.js} +6 -6
- package/dist/components/Accordion/Accordion.d.ts +6 -0
- package/dist/components/Accordion/Accordion.js +202 -182
- package/dist/components/AnchorLink/Link.d.ts +2 -0
- package/dist/components/AnchorLink/Link.js +54 -42
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/DatePicker/DatePicker.d.ts +32 -0
- package/dist/components/DatePicker/DatePicker.js +125 -111
- package/dist/components/DatePicker/DatePickerModal.d.ts +5 -1
- package/dist/components/DatePicker/DatePickerModal.js +97 -75
- package/dist/components/DatePicker/MonthPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/MonthPickerModal.js +96 -58
- package/dist/components/DatePicker/YearPickerModal.d.ts +5 -1
- package/dist/components/DatePicker/YearPickerModal.js +75 -57
- package/dist/components/Drawer/Drawer.d.ts +7 -1
- package/dist/components/Drawer/Drawer.js +122 -106
- package/dist/components/Drawer/hooks.d.ts +9 -0
- package/dist/components/Drawer/hooks.js +24 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -1
- package/dist/components/Dropdown/Dropdown.js +361 -343
- package/dist/components/Dropdown/constants.d.ts +11 -0
- package/dist/components/Dropdown/constants.js +5 -0
- package/dist/components/Dropdown/hooks.d.ts +19 -0
- package/dist/components/Dropdown/hooks.js +11 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/index.js +5 -2
- package/dist/components/MultiSelectSearch/MultiSelectSearch.d.ts +8 -1
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +461 -302
- package/dist/components/MultiSelectSearch/constants.d.ts +6 -0
- package/dist/components/MultiSelectSearch/constants.js +7 -5
- package/dist/components/MultiSelectSearch/index.d.ts +1 -1
- package/dist/components/MultiSelectSearch/index.js +5 -4
- package/dist/components/MultiSelectSearch/types.d.ts +33 -1
- package/dist/components/MultiSelectSearch/utils.d.ts +1 -0
- package/dist/components/MultiSelectSearch/utils.js +31 -17
- package/dist/components/Pagination/Pagination.d.ts +23 -0
- package/dist/components/Pagination/Pagination.js +137 -99
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.d.ts +8 -1
- package/dist/components/SelectSearch/SelectSearch.js +381 -220
- package/dist/components/SelectSearch/constants.d.ts +6 -0
- package/dist/components/SelectSearch/constants.js +3 -2
- package/dist/components/SelectSearch/index.d.ts +1 -1
- package/dist/components/SelectSearch/index.js +5 -4
- package/dist/components/SelectSearch/types.d.ts +32 -1
- package/dist/components/SelectSearch/utils.d.ts +2 -0
- package/dist/components/SelectSearch/utils.js +28 -14
- package/dist/components/Slider/Slider.d.ts +6 -2
- package/dist/components/Slider/Slider.js +123 -109
- package/dist/components/Slider/utils.d.ts +1 -0
- package/dist/components/Slider/utils.js +4 -0
- package/dist/components/Switcher/Switcher.js +66 -59
- package/dist/components/Switcher/types.d.ts +1 -0
- package/dist/components/TabTrail/TabTrail.d.ts +9 -0
- package/dist/components/TabTrail/TabTrail.js +198 -190
- package/dist/components/Toasts/ProgressBar.d.ts +4 -2
- package/dist/components/Toasts/ProgressBar.js +1 -1
- package/dist/components/Toasts/Toast.d.ts +5 -1
- package/dist/components/Toasts/Toast.js +59 -44
- package/dist/components/Toasts/ToastList.js +1 -1
- package/dist/components/Toasts/ToastsProvider.js +1 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +154 -149
- package/dist/{field-BP5-U1Nr.js → field-BLi5834s.js} +2 -2
- package/dist/{focus-management-Dp2_vbQ3.js → focus-management-BAl0GmRk.js} +1 -1
- package/dist/{hidden-Dn4lM6EL.js → hidden-CkTYbiNM.js} +1 -1
- package/dist/hooks/useTimer/index.d.ts +2 -1
- package/dist/hooks/useTimer/index.js +55 -41
- package/dist/hooks-HgN6Yauq.js +117 -0
- package/dist/index.js +182 -177
- package/dist/{keyboard-CUMsrFX1.js → keyboard-wis2TUql.js} +2 -2
- package/dist/{label-DOlEWXBl.js → label-BmphTIGY.js} +2 -2
- package/dist/{open-closed-CkTbpRyi.js → open-closed-CJijMeI2.js} +1 -1
- package/dist/{portal-C_u5auU1.js → portal-BnEqSZwo.js} +2 -2
- package/dist/{use-active-press-BVQqDQ3V.js → use-active-press-CnDeVvQq.js} +1 -1
- package/dist/{use-is-mounted-D7cq4xsa.js → use-is-mounted-MBU4fiLr.js} +1 -1
- package/package.json +3 -1
- package/dist/ProgressBar-DEFs1tWq.js +0 -55
- package/dist/assets/Dropdown.css +0 -1
- package/dist/components/Pagination/types.d.ts +0 -0
@@ -1,23 +1,24 @@
|
|
1
|
-
import { jsxs as
|
2
|
-
import { c as
|
3
|
-
import * as
|
4
|
-
import
|
5
|
-
import { ETabTrailSize as
|
6
|
-
import { TabButtons as
|
1
|
+
import { jsxs as Z, jsx as k } from "react/jsx-runtime";
|
2
|
+
import { c as j } from "../../index-DIxK0V-G.js";
|
3
|
+
import * as M from "react";
|
4
|
+
import O, { useState as Y, createContext as ie, useReducer as ye, useMemo as R, useId as ue, useRef as Q, useContext as ce, forwardRef as Se, useEffect as ee } from "react";
|
5
|
+
import { ETabTrailSize as Ae } from "./constants.js";
|
6
|
+
import { TabButtons as ke } from "./TabButtons/TabButtons.js";
|
7
7
|
import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
|
8
|
+
import { Icon as Ne } from "../../icons/Icon.js";
|
8
9
|
import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
|
9
|
-
import { M as oe, W as
|
10
|
-
import { w as
|
11
|
-
import { e as
|
12
|
-
import { f as
|
13
|
-
import { T as pe, s as
|
14
|
-
import { _ as
|
15
|
-
import '../../assets/TabTrail.css';function
|
16
|
-
let [t, n] =
|
17
|
-
return t ?
|
10
|
+
import { M as oe, W as U, s as J, y as V, o as D, n as X, H as q, $ as de, b as Re, D as fe, a as z, u as Le, c as $, e as Oe } from "../../keyboard-wis2TUql.js";
|
11
|
+
import { w as Me } from "../../use-active-press-CnDeVvQq.js";
|
12
|
+
import { e as Ce } from "../../use-resolve-button-type-DhFdPxnv.js";
|
13
|
+
import { f as Be } from "../../use-is-mounted-MBU4fiLr.js";
|
14
|
+
import { T as pe, s as We } from "../../hidden-CkTYbiNM.js";
|
15
|
+
import { _ as G, T as K, P as L, F as _ } from "../../focus-management-BAl0GmRk.js";
|
16
|
+
import '../../assets/TabTrail.css';function Ge({ onFocus: e }) {
|
17
|
+
let [t, n] = Y(!0), r = Be();
|
18
|
+
return t ? O.createElement(pe, { as: "button", type: "button", features: We.Focusable, onFocus: (s) => {
|
18
19
|
s.preventDefault();
|
19
20
|
let l, o = 50;
|
20
|
-
function
|
21
|
+
function d() {
|
21
22
|
if (o-- <= 0) {
|
22
23
|
l && cancelAnimationFrame(l);
|
23
24
|
return;
|
@@ -27,13 +28,13 @@ import '../../assets/TabTrail.css';function We({ onFocus: e }) {
|
|
27
28
|
n(!1);
|
28
29
|
return;
|
29
30
|
}
|
30
|
-
l = requestAnimationFrame(
|
31
|
+
l = requestAnimationFrame(d);
|
31
32
|
}
|
32
|
-
l = requestAnimationFrame(
|
33
|
+
l = requestAnimationFrame(d);
|
33
34
|
} }) : null;
|
34
35
|
}
|
35
|
-
const be =
|
36
|
-
function
|
36
|
+
const be = M.createContext(null);
|
37
|
+
function ze() {
|
37
38
|
return { groups: /* @__PURE__ */ new Map(), get(e, t) {
|
38
39
|
var n;
|
39
40
|
let r = this.groups.get(e);
|
@@ -42,259 +43,266 @@ function Ge() {
|
|
42
43
|
r.set(t, s + 1);
|
43
44
|
let l = Array.from(r.keys()).indexOf(t);
|
44
45
|
function o() {
|
45
|
-
let
|
46
|
-
|
46
|
+
let d = r.get(t);
|
47
|
+
d > 1 ? r.set(t, d - 1) : r.delete(t);
|
47
48
|
}
|
48
49
|
return [l, o];
|
49
50
|
} };
|
50
51
|
}
|
51
|
-
function
|
52
|
-
let t =
|
53
|
-
return
|
52
|
+
function Ue({ children: e }) {
|
53
|
+
let t = M.useRef(ze());
|
54
|
+
return M.createElement(be.Provider, { value: t }, e);
|
54
55
|
}
|
55
56
|
function me(e) {
|
56
|
-
let t =
|
57
|
+
let t = M.useContext(be);
|
57
58
|
if (!t) throw new Error("You must wrap your component in a <StableCollection>");
|
58
|
-
let n =
|
59
|
-
return
|
59
|
+
let n = M.useId(), [r, s] = t.current.get(e, n);
|
60
|
+
return M.useEffect(() => s, []), r;
|
60
61
|
}
|
61
|
-
var
|
62
|
-
let
|
62
|
+
var Ve = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ve || {}), qe = ((e) => (e[e.Less = -1] = "Less", e[e.Equal = 0] = "Equal", e[e.Greater = 1] = "Greater", e))(qe || {}), He = ((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))(He || {});
|
63
|
+
let je = { 0(e, t) {
|
63
64
|
var n;
|
64
|
-
let r =
|
65
|
-
var
|
66
|
-
return !((
|
65
|
+
let r = G(e.tabs, (u) => u.current), s = G(e.panels, (u) => u.current), l = r.filter((u) => {
|
66
|
+
var h;
|
67
|
+
return !((h = u.current) != null && h.hasAttribute("disabled"));
|
67
68
|
}), o = { ...e, tabs: r, panels: s };
|
68
69
|
if (t.index < 0 || t.index > r.length - 1) {
|
69
|
-
let
|
70
|
+
let u = z(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => z(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
|
70
71
|
if (l.length === 0) return o;
|
71
|
-
let
|
72
|
-
return { ...o, selectedIndex:
|
72
|
+
let h = z(u, { 0: () => r.indexOf(l[0]), 1: () => r.indexOf(l[l.length - 1]) });
|
73
|
+
return { ...o, selectedIndex: h === -1 ? e.selectedIndex : h };
|
73
74
|
}
|
74
|
-
let
|
75
|
-
if (!
|
76
|
-
let v = (n = r.indexOf(
|
75
|
+
let d = r.slice(0, t.index), I = [...r.slice(t.index), ...d].find((u) => l.includes(u));
|
76
|
+
if (!I) return o;
|
77
|
+
let v = (n = r.indexOf(I)) != null ? n : e.selectedIndex;
|
77
78
|
return v === -1 && (v = e.selectedIndex), { ...o, selectedIndex: v };
|
78
79
|
}, 1(e, t) {
|
79
80
|
if (e.tabs.includes(t.tab)) return e;
|
80
|
-
let n = e.tabs[e.selectedIndex], r =
|
81
|
+
let n = e.tabs[e.selectedIndex], r = G([...e.tabs, t.tab], (l) => l.current), s = e.selectedIndex;
|
81
82
|
return e.info.current.isControlled || (s = r.indexOf(n), s === -1 && (s = e.selectedIndex)), { ...e, tabs: r, selectedIndex: s };
|
82
83
|
}, 2(e, t) {
|
83
84
|
return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
|
84
85
|
}, 3(e, t) {
|
85
|
-
return e.panels.includes(t.panel) ? e : { ...e, panels:
|
86
|
+
return e.panels.includes(t.panel) ? e : { ...e, panels: G([...e.panels, t.panel], (n) => n.current) };
|
86
87
|
}, 4(e, t) {
|
87
88
|
return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
|
88
|
-
} },
|
89
|
-
|
90
|
-
function
|
91
|
-
let t = ce(
|
89
|
+
} }, te = ie(null);
|
90
|
+
te.displayName = "TabsDataContext";
|
91
|
+
function C(e) {
|
92
|
+
let t = ce(te);
|
92
93
|
if (t === null) {
|
93
94
|
let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
|
94
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
95
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, C), n;
|
95
96
|
}
|
96
97
|
return t;
|
97
98
|
}
|
98
|
-
let
|
99
|
-
|
100
|
-
function
|
101
|
-
let t = ce(
|
99
|
+
let re = ie(null);
|
100
|
+
re.displayName = "TabsActionsContext";
|
101
|
+
function ne(e) {
|
102
|
+
let t = ce(re);
|
102
103
|
if (t === null) {
|
103
104
|
let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
|
104
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
105
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, ne), n;
|
105
106
|
}
|
106
107
|
return t;
|
107
108
|
}
|
108
|
-
function
|
109
|
-
return
|
109
|
+
function Je(e, t) {
|
110
|
+
return z(t.type, je, e, t);
|
110
111
|
}
|
111
|
-
let
|
112
|
-
function
|
113
|
-
let { defaultIndex: n = 0, vertical: r = !1, manual: s = !1, onChange: l, selectedIndex: o = null, ...
|
114
|
-
const
|
115
|
-
let
|
116
|
-
})),
|
117
|
-
|
118
|
-
}),
|
119
|
-
|
112
|
+
let Ke = "div";
|
113
|
+
function Ye(e, t) {
|
114
|
+
let { defaultIndex: n = 0, vertical: r = !1, manual: s = !1, onChange: l, selectedIndex: o = null, ...d } = e;
|
115
|
+
const I = r ? "vertical" : "horizontal", v = s ? "manual" : "auto";
|
116
|
+
let u = o !== null, h = J({ isControlled: u }), y = V(t), [p, c] = ye(Je, { info: h, selectedIndex: o ?? n, tabs: [], panels: [] }), x = R(() => ({ selectedIndex: p.selectedIndex }), [p.selectedIndex]), A = J(l || (() => {
|
117
|
+
})), w = J(p.tabs), b = R(() => ({ orientation: I, activation: v, ...p }), [I, v, p]), P = D((a) => (c({ type: 1, tab: a }), () => c({ type: 2, tab: a }))), F = D((a) => (c({ type: 3, panel: a }), () => c({ type: 4, panel: a }))), m = D((a) => {
|
118
|
+
g.current !== a && A.current(a), u || c({ type: 0, index: a });
|
119
|
+
}), g = J(u ? e.selectedIndex : p.selectedIndex), N = R(() => ({ registerTab: P, registerPanel: F, change: m }), []);
|
120
|
+
X(() => {
|
120
121
|
c({ type: 0, index: o ?? n });
|
121
|
-
}, [o]),
|
122
|
-
if (
|
123
|
-
let
|
124
|
-
|
122
|
+
}, [o]), X(() => {
|
123
|
+
if (g.current === void 0 || p.tabs.length <= 0) return;
|
124
|
+
let a = G(p.tabs, (f) => f.current);
|
125
|
+
a.some((f, T) => p.tabs[T] !== f) && m(a.indexOf(p.tabs[g.current]));
|
125
126
|
});
|
126
|
-
let
|
127
|
-
return
|
128
|
-
var
|
129
|
-
for (let
|
127
|
+
let B = { ref: y };
|
128
|
+
return O.createElement(Ue, null, O.createElement(re.Provider, { value: N }, O.createElement(te.Provider, { value: b }, b.tabs.length <= 0 && O.createElement(Ge, { onFocus: () => {
|
129
|
+
var a, f;
|
130
|
+
for (let T of w.current) if (((a = T.current) == null ? void 0 : a.tabIndex) === 0) return (f = T.current) == null || f.focus(), !0;
|
130
131
|
return !1;
|
131
|
-
} }),
|
132
|
+
} }), q({ ourProps: B, theirProps: d, slot: x, defaultTag: Ke, name: "Tabs" }))));
|
132
133
|
}
|
133
|
-
let
|
134
|
-
function
|
135
|
-
let { orientation: n, selectedIndex: r } =
|
136
|
-
return
|
134
|
+
let Qe = "div";
|
135
|
+
function Xe(e, t) {
|
136
|
+
let { orientation: n, selectedIndex: r } = C("Tab.List"), s = V(t), l = R(() => ({ selectedIndex: r }), [r]);
|
137
|
+
return q({ ourProps: { ref: s, role: "tablist", "aria-orientation": n }, theirProps: e, slot: l, defaultTag: Qe, name: "Tabs.List" });
|
137
138
|
}
|
138
|
-
let
|
139
|
-
function
|
139
|
+
let Ze = "button";
|
140
|
+
function et(e, t) {
|
140
141
|
var n, r;
|
141
|
-
let s = ue(), { id: l = `headlessui-tabs-tab-${s}`, disabled: o = !1, autoFocus:
|
142
|
-
|
143
|
-
let F = me("tabs"),
|
144
|
-
|
145
|
-
let
|
146
|
-
var
|
147
|
-
let
|
148
|
-
if (
|
149
|
-
let _e = (
|
142
|
+
let s = ue(), { id: l = `headlessui-tabs-tab-${s}`, disabled: o = !1, autoFocus: d = !1, ...I } = e, { orientation: v, activation: u, selectedIndex: h, tabs: y, panels: p } = C("Tab"), c = ne("Tab"), x = C("Tab"), [A, w] = Y(null), b = Q(null), P = V(b, t, w);
|
143
|
+
X(() => c.registerTab(b), [c, b]);
|
144
|
+
let F = me("tabs"), m = y.indexOf(b);
|
145
|
+
m === -1 && (m = F);
|
146
|
+
let g = m === h, N = D((i) => {
|
147
|
+
var S;
|
148
|
+
let H = i();
|
149
|
+
if (H === K.Success && u === "auto") {
|
150
|
+
let _e = (S = Le(b)) == null ? void 0 : S.activeElement, le = x.tabs.findIndex((Ee) => Ee.current === _e);
|
150
151
|
le !== -1 && c.change(le);
|
151
152
|
}
|
152
|
-
return
|
153
|
-
}),
|
154
|
-
let
|
155
|
-
if (
|
156
|
-
|
153
|
+
return H;
|
154
|
+
}), B = D((i) => {
|
155
|
+
let S = y.map((H) => H.current).filter(Boolean);
|
156
|
+
if (i.key === $.Space || i.key === $.Enter) {
|
157
|
+
i.preventDefault(), i.stopPropagation(), c.change(m);
|
157
158
|
return;
|
158
159
|
}
|
159
|
-
switch (
|
160
|
-
case
|
161
|
-
case
|
162
|
-
return
|
163
|
-
case
|
164
|
-
case
|
165
|
-
return
|
160
|
+
switch (i.key) {
|
161
|
+
case $.Home:
|
162
|
+
case $.PageUp:
|
163
|
+
return i.preventDefault(), i.stopPropagation(), N(() => L(S, _.First));
|
164
|
+
case $.End:
|
165
|
+
case $.PageDown:
|
166
|
+
return i.preventDefault(), i.stopPropagation(), N(() => L(S, _.Last));
|
166
167
|
}
|
167
|
-
if (
|
168
|
-
return
|
168
|
+
if (N(() => z(v, { vertical() {
|
169
|
+
return i.key === $.ArrowUp ? L(S, _.Previous | _.WrapAround) : i.key === $.ArrowDown ? L(S, _.Next | _.WrapAround) : K.Error;
|
169
170
|
}, horizontal() {
|
170
|
-
return
|
171
|
-
} })) ===
|
172
|
-
}),
|
173
|
-
var
|
174
|
-
|
175
|
-
|
171
|
+
return i.key === $.ArrowLeft ? L(S, _.Previous | _.WrapAround) : i.key === $.ArrowRight ? L(S, _.Next | _.WrapAround) : K.Error;
|
172
|
+
} })) === K.Success) return i.preventDefault();
|
173
|
+
}), a = Q(!1), f = D(() => {
|
174
|
+
var i;
|
175
|
+
a.current || (a.current = !0, (i = b.current) == null || i.focus({ preventScroll: !0 }), c.change(m), Oe(() => {
|
176
|
+
a.current = !1;
|
176
177
|
}));
|
177
|
-
}),
|
178
|
-
|
179
|
-
}), { isFocusVisible:
|
180
|
-
return
|
178
|
+
}), T = D((i) => {
|
179
|
+
i.preventDefault();
|
180
|
+
}), { isFocusVisible: W, focusProps: Te } = de({ autoFocus: d }), { isHovered: ae, hoverProps: Ie } = Re({ isDisabled: o }), { pressed: se, pressProps: Pe } = Me({ disabled: o }), we = R(() => ({ selected: g, hover: ae, active: se, focus: W, autofocus: d, disabled: o }), [g, ae, W, se, d, o]), $e = fe({ ref: P, onKeyDown: B, onMouseDown: T, onClick: f, id: l, role: "tab", type: Ce(e, A), "aria-controls": (r = (n = p[m]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": g, tabIndex: g ? 0 : -1, disabled: o || void 0, autoFocus: d }, Te, Ie, Pe);
|
181
|
+
return q({ ourProps: $e, theirProps: I, slot: we, defaultTag: Ze, name: "Tabs.Tab" });
|
181
182
|
}
|
182
|
-
let
|
183
|
-
function
|
184
|
-
let { selectedIndex: n } =
|
185
|
-
return
|
183
|
+
let tt = "div";
|
184
|
+
function rt(e, t) {
|
185
|
+
let { selectedIndex: n } = C("Tab.Panels"), r = V(t), s = R(() => ({ selectedIndex: n }), [n]);
|
186
|
+
return q({ ourProps: { ref: r }, theirProps: e, slot: s, defaultTag: tt, name: "Tabs.Panels" });
|
186
187
|
}
|
187
|
-
let
|
188
|
-
function
|
188
|
+
let nt = "div", at = oe.RenderStrategy | oe.Static;
|
189
|
+
function st(e, t) {
|
189
190
|
var n, r, s, l;
|
190
|
-
let o = ue(), { id:
|
191
|
-
|
192
|
-
let A = me("panels"),
|
193
|
-
|
194
|
-
let
|
195
|
-
return !
|
191
|
+
let o = ue(), { id: d = `headlessui-tabs-panel-${o}`, tabIndex: I = 0, ...v } = e, { selectedIndex: u, tabs: h, panels: y } = C("Tab.Panel"), p = ne("Tab.Panel"), c = Q(null), x = V(c, t);
|
192
|
+
X(() => p.registerPanel(c), [p, c]);
|
193
|
+
let A = me("panels"), w = y.indexOf(c);
|
194
|
+
w === -1 && (w = A);
|
195
|
+
let b = w === u, { isFocusVisible: P, focusProps: F } = de(), m = R(() => ({ selected: b, focus: P }), [b, P]), g = fe({ ref: x, id: d, role: "tabpanel", "aria-labelledby": (r = (n = h[w]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: b ? I : -1 }, F);
|
196
|
+
return !b && ((s = v.unmount) == null || s) && !((l = v.static) != null && l) ? O.createElement(pe, { "aria-hidden": "true", ...g }) : q({ ourProps: g, theirProps: v, slot: m, defaultTag: nt, features: at, visible: b, name: "Tabs.Panel" });
|
196
197
|
}
|
197
|
-
let
|
198
|
-
const
|
199
|
-
container:
|
200
|
-
group:
|
201
|
-
"group-inner": "_group-
|
202
|
-
tab:
|
203
|
-
list:
|
204
|
-
tabs:
|
205
|
-
buttons:
|
206
|
-
m:
|
207
|
-
s:
|
208
|
-
},
|
198
|
+
let lt = U(et), ve = U(Ye), xe = U(Xe), he = U(rt), ge = U(st), ot = Object.assign(lt, { Group: ve, List: xe, Panels: he, Panel: ge });
|
199
|
+
const it = "_container_109vo_2", ut = "_group_109vo_6", ct = "_tab_109vo_17", dt = "_list_109vo_55", ft = "_tabs_109vo_66", pt = "_buttons_109vo_72", bt = "_m_109vo_79", mt = "_s_109vo_87", E = {
|
200
|
+
container: it,
|
201
|
+
group: ut,
|
202
|
+
"group-inner": "_group-inner_109vo_10",
|
203
|
+
tab: ct,
|
204
|
+
list: dt,
|
205
|
+
tabs: ft,
|
206
|
+
buttons: pt,
|
207
|
+
m: bt,
|
208
|
+
s: mt
|
209
|
+
}, kt = Se(
|
209
210
|
({
|
210
211
|
categories: e,
|
211
|
-
size: t =
|
212
|
+
size: t = Ae.M,
|
212
213
|
showButtons: n = !0,
|
213
214
|
className: r,
|
214
215
|
selectedTabIndex: s,
|
215
216
|
onTabChange: l,
|
216
217
|
buttonsVariant: o = Fe.WHITE,
|
217
|
-
autoShowButtons:
|
218
|
-
tabClassName:
|
218
|
+
autoShowButtons: d = !1,
|
219
|
+
tabClassName: I,
|
219
220
|
listClassName: v,
|
220
|
-
panelClassName:
|
221
|
-
buttonsClassName:
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
221
|
+
panelClassName: u,
|
222
|
+
buttonsClassName: h,
|
223
|
+
indicatorColor: y,
|
224
|
+
tabIcons: p = {}
|
225
|
+
}, c) => {
|
226
|
+
const [x, A] = Y(s || 0), [w, b] = Y(!1), P = Q(null), F = y ? { "--tab-indicator-color": y } : void 0;
|
227
|
+
ee(() => {
|
228
|
+
s !== void 0 && s !== x && A(s);
|
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);
|
235
238
|
};
|
236
|
-
|
237
|
-
var
|
238
|
-
const a = (
|
239
|
-
`.${
|
239
|
+
ee(() => {
|
240
|
+
var f;
|
241
|
+
const a = (f = P.current) == null ? void 0 : f.querySelector(
|
242
|
+
`.${E.tab}[data-active="true"]`
|
240
243
|
);
|
241
244
|
a && typeof a.scrollIntoView == "function" && a.scrollIntoView({
|
242
245
|
behavior: "smooth",
|
243
246
|
block: "nearest",
|
244
247
|
inline: "center"
|
245
248
|
});
|
246
|
-
}, [
|
249
|
+
}, [x]), ee(() => {
|
247
250
|
const a = () => {
|
248
|
-
if (
|
249
|
-
const { scrollWidth:
|
250
|
-
|
251
|
+
if (P.current) {
|
252
|
+
const { scrollWidth: f, clientWidth: T } = P.current;
|
253
|
+
b(f > T);
|
251
254
|
}
|
252
255
|
};
|
253
256
|
return a(), window.addEventListener("resize", a), () => window.removeEventListener("resize", a);
|
254
257
|
}, [e]);
|
255
|
-
const
|
256
|
-
return /* @__PURE__ */
|
258
|
+
const B = d ? w : n;
|
259
|
+
return /* @__PURE__ */ Z(
|
257
260
|
ve,
|
258
261
|
{
|
259
|
-
ref:
|
260
|
-
className:
|
261
|
-
selectedIndex:
|
262
|
-
onChange:
|
262
|
+
ref: c,
|
263
|
+
className: j(E.group, E[t], r),
|
264
|
+
selectedIndex: x,
|
265
|
+
onChange: m,
|
266
|
+
style: F,
|
263
267
|
children: [
|
264
|
-
/* @__PURE__ */
|
265
|
-
/* @__PURE__ */
|
268
|
+
/* @__PURE__ */ Z("div", { className: E["group-inner"], children: [
|
269
|
+
/* @__PURE__ */ k(
|
266
270
|
xe,
|
267
271
|
{
|
268
|
-
ref:
|
269
|
-
className:
|
270
|
-
children: /* @__PURE__ */
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
272
|
+
ref: P,
|
273
|
+
className: j(E.list, v),
|
274
|
+
children: /* @__PURE__ */ k("div", { className: E.tabs, children: e.map(({ name: a, notificationCount: f }, T) => {
|
275
|
+
const W = p[T];
|
276
|
+
return /* @__PURE__ */ Z(
|
277
|
+
ot,
|
278
|
+
{
|
279
|
+
className: `${E.tab} ${x === T ? 'data-active="true"' : ""} ${I || ""}`,
|
280
|
+
"data-active": x === T,
|
281
|
+
children: [
|
282
|
+
W && /* @__PURE__ */ k(Ne, { iconName: W }),
|
283
|
+
a,
|
284
|
+
f && /* @__PURE__ */ k(De, { count: f, size: "m" })
|
285
|
+
]
|
286
|
+
},
|
287
|
+
a
|
288
|
+
);
|
289
|
+
}) })
|
282
290
|
}
|
283
291
|
),
|
284
|
-
|
285
|
-
|
292
|
+
B && /* @__PURE__ */ k("div", { className: j(E.buttons, h), children: /* @__PURE__ */ k(
|
293
|
+
ke,
|
286
294
|
{
|
287
|
-
handlePrevTab:
|
288
|
-
handleNextTab:
|
295
|
+
handlePrevTab: N,
|
296
|
+
handleNextTab: g,
|
289
297
|
buttonsVariant: o
|
290
298
|
}
|
291
299
|
) })
|
292
300
|
] }),
|
293
|
-
/* @__PURE__ */
|
301
|
+
/* @__PURE__ */ k(he, { className: E.panels, children: e.map(({ name: a, content: f }) => /* @__PURE__ */ k(
|
294
302
|
ge,
|
295
303
|
{
|
296
|
-
className:
|
297
|
-
children:
|
304
|
+
className: j(E.panel, u),
|
305
|
+
children: f
|
298
306
|
},
|
299
307
|
a
|
300
308
|
)) })
|
@@ -304,5 +312,5 @@ const ot = "_container_rlke5_2", it = "_group_rlke5_6", ut = "_tab_rlke5_16", ct
|
|
304
312
|
}
|
305
313
|
);
|
306
314
|
export {
|
307
|
-
|
315
|
+
kt as TabTrail
|
308
316
|
};
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { TProps as TToastProps } from './Toast';
|
2
2
|
|
3
|
-
type TProps = Pick<TToastProps, 'duration' | 'variant'
|
4
|
-
|
3
|
+
type TProps = Pick<TToastProps, 'duration' | 'variant'> & {
|
4
|
+
isPaused?: boolean;
|
5
|
+
};
|
6
|
+
export declare const ProgressBar: import('react').MemoExoticComponent<({ duration, variant, isPaused }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
5
7
|
export {};
|
@@ -50,5 +50,9 @@ export type TProps = {
|
|
50
50
|
* Слот уведомления.
|
51
51
|
*/
|
52
52
|
slot?: ReactNode;
|
53
|
+
/**
|
54
|
+
* Флаг, указывающий на приостановку таймера при наведении курсора.
|
55
|
+
*/
|
56
|
+
pauseOnHover?: boolean;
|
53
57
|
};
|
54
|
-
export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, slot }: TProps) => import("react/jsx-runtime").JSX.Element>;
|
58
|
+
export declare const Toast: import('react').MemoExoticComponent<({ id, title, message, position, variant, duration, autoClose, needProgress, needTimer, needCloseButton, onToastRemove, slot, pauseOnHover }: TProps) => import("react/jsx-runtime").JSX.Element>;
|