mimir-ui-kit 1.37.6 → 1.37.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{combobox-CDU06zJj.js → combobox-BpYucpxz.js} +1121 -1080
- package/dist/components/Accordion/Accordion.js +21 -21
- package/dist/components/CheckboxMimir/CheckboxMimir.js +4 -4
- package/dist/components/MultiSelectSearch/MultiSelectSearch.js +22 -22
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/SelectSearch/SelectSearch.js +24 -24
- package/dist/components/Switcher/Switcher.js +4 -4
- package/dist/components/TabTrail/TabButtons/TabButtons.d.ts +2 -0
- package/dist/components/TabTrail/TabButtons/TabButtons.js +20 -16
- package/dist/components/TabTrail/TabTrail.d.ts +5 -0
- package/dist/components/TabTrail/TabTrail.js +156 -153
- package/dist/{field-FJ34aSs4.js → field-C1kt7aNM.js} +2 -2
- package/dist/{focus-management-XwV-9qkO.js → focus-management-DOYCPyGg.js} +1 -1
- package/dist/{hidden-DbgtYPOH.js → hidden-PvGXrYUY.js} +1 -1
- package/dist/{keyboard-B0lm_zyn.js → keyboard-mgWkd2Vh.js} +114 -111
- package/dist/{label-y3ANLTNC.js → label-D4GFpe5F.js} +2 -2
- package/dist/open-closed-D2VjDhAN.js +86 -0
- package/dist/{use-active-press-86hajhdd.js → use-active-press-CqLGIFz7.js} +1 -1
- package/package.json +1 -1
- package/dist/open-closed-CdldUPoq.js +0 -86
@@ -1,27 +1,28 @@
|
|
1
1
|
import { jsxs as Y, jsx as k } from "react/jsx-runtime";
|
2
|
-
import { c as
|
3
|
-
import * as
|
4
|
-
import
|
2
|
+
import { c as Ee } from "../../index-DIxK0V-G.js";
|
3
|
+
import * as M from "react";
|
4
|
+
import R, { useRef as U, useState as Q, createContext as oe, useReducer as ye, useMemo as S, useId as ie, useContext as ue, forwardRef as ke, useEffect as le } from "react";
|
5
5
|
import { ETabTrailSize as Ae } from "./constants.js";
|
6
6
|
import { TabButtons as Se } from "./TabButtons/TabButtons.js";
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import
|
7
|
+
import { ETabTrailButtonVariant as Fe } from "./TabButtons/constants.js";
|
8
|
+
import { NotificationBadge as De } from "../NotificationBadge/NotificationBadge.js";
|
9
|
+
import { n as W, M as se, W as V, s as j, y as q, o as A, H as z, $ as ce, b as Ne, D as de, a as G, u as Re, c as T, t as Me } from "../../keyboard-mgWkd2Vh.js";
|
10
|
+
import { w as Ce } from "../../use-active-press-CqLGIFz7.js";
|
11
|
+
import { e as Le } from "../../use-resolve-button-type-DhFdPxnv.js";
|
12
|
+
import { T as pe, s as Oe } from "../../hidden-PvGXrYUY.js";
|
13
|
+
import { _ as B, T as J, P as N, F as I } from "../../focus-management-DOYCPyGg.js";
|
14
|
+
import '../../assets/TabTrail.css';function Be() {
|
14
15
|
let e = U(!1);
|
15
16
|
return W(() => (e.current = !0, () => {
|
16
17
|
e.current = !1;
|
17
18
|
}), []), e;
|
18
19
|
}
|
19
20
|
function Ge({ onFocus: e }) {
|
20
|
-
let [t, n] = Q(!0), r =
|
21
|
-
return t ?
|
21
|
+
let [t, n] = Q(!0), r = Be();
|
22
|
+
return t ? R.createElement(pe, { as: "button", type: "button", features: Oe.Focusable, onFocus: (l) => {
|
22
23
|
l.preventDefault();
|
23
24
|
let s, o = 50;
|
24
|
-
function
|
25
|
+
function d() {
|
25
26
|
if (o-- <= 0) {
|
26
27
|
s && cancelAnimationFrame(s);
|
27
28
|
return;
|
@@ -31,13 +32,13 @@ function Ge({ onFocus: e }) {
|
|
31
32
|
n(!1);
|
32
33
|
return;
|
33
34
|
}
|
34
|
-
s = requestAnimationFrame(
|
35
|
+
s = requestAnimationFrame(d);
|
35
36
|
}
|
36
|
-
s = requestAnimationFrame(
|
37
|
+
s = requestAnimationFrame(d);
|
37
38
|
} }) : null;
|
38
39
|
}
|
39
|
-
const fe =
|
40
|
-
function
|
40
|
+
const fe = M.createContext(null);
|
41
|
+
function Ue() {
|
41
42
|
return { groups: /* @__PURE__ */ new Map(), get(e, t) {
|
42
43
|
var n;
|
43
44
|
let r = this.groups.get(e);
|
@@ -46,63 +47,63 @@ function Be() {
|
|
46
47
|
r.set(t, l + 1);
|
47
48
|
let s = Array.from(r.keys()).indexOf(t);
|
48
49
|
function o() {
|
49
|
-
let
|
50
|
-
|
50
|
+
let d = r.get(t);
|
51
|
+
d > 1 ? r.set(t, d - 1) : r.delete(t);
|
51
52
|
}
|
52
53
|
return [s, o];
|
53
54
|
} };
|
54
55
|
}
|
55
|
-
function
|
56
|
-
let t =
|
57
|
-
return
|
56
|
+
function We({ children: e }) {
|
57
|
+
let t = M.useRef(Ue());
|
58
|
+
return M.createElement(fe.Provider, { value: t }, e);
|
58
59
|
}
|
59
60
|
function be(e) {
|
60
|
-
let t =
|
61
|
+
let t = M.useContext(fe);
|
61
62
|
if (!t) throw new Error("You must wrap your component in a <StableCollection>");
|
62
|
-
let n =
|
63
|
-
return
|
63
|
+
let n = M.useId(), [r, l] = t.current.get(e, n);
|
64
|
+
return M.useEffect(() => l, []), r;
|
64
65
|
}
|
65
|
-
var
|
66
|
-
let
|
66
|
+
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 || {}), ze = ((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))(ze || {});
|
67
|
+
let He = { 0(e, t) {
|
67
68
|
var n;
|
68
|
-
let r =
|
69
|
+
let r = B(e.tabs, (u) => u.current), l = B(e.panels, (u) => u.current), s = r.filter((u) => {
|
69
70
|
var m;
|
70
|
-
return !((m =
|
71
|
+
return !((m = u.current) != null && m.hasAttribute("disabled"));
|
71
72
|
}), o = { ...e, tabs: r, panels: l };
|
72
73
|
if (t.index < 0 || t.index > r.length - 1) {
|
73
|
-
let
|
74
|
+
let u = G(Math.sign(t.index - e.selectedIndex), { [-1]: () => 1, 0: () => G(Math.sign(t.index), { [-1]: () => 0, 0: () => 0, 1: () => 1 }), 1: () => 0 });
|
74
75
|
if (s.length === 0) return o;
|
75
|
-
let m =
|
76
|
+
let m = G(u, { 0: () => r.indexOf(s[0]), 1: () => r.indexOf(s[s.length - 1]) });
|
76
77
|
return { ...o, selectedIndex: m === -1 ? e.selectedIndex : m };
|
77
78
|
}
|
78
|
-
let
|
79
|
-
if (!
|
80
|
-
let
|
81
|
-
return
|
79
|
+
let d = r.slice(0, t.index), p = [...r.slice(t.index), ...d].find((u) => s.includes(u));
|
80
|
+
if (!p) return o;
|
81
|
+
let b = (n = r.indexOf(p)) != null ? n : e.selectedIndex;
|
82
|
+
return b === -1 && (b = e.selectedIndex), { ...o, selectedIndex: b };
|
82
83
|
}, 1(e, t) {
|
83
84
|
if (e.tabs.includes(t.tab)) return e;
|
84
|
-
let n = e.tabs[e.selectedIndex], r =
|
85
|
+
let n = e.tabs[e.selectedIndex], r = B([...e.tabs, t.tab], (s) => s.current), l = e.selectedIndex;
|
85
86
|
return e.info.current.isControlled || (l = r.indexOf(n), l === -1 && (l = e.selectedIndex)), { ...e, tabs: r, selectedIndex: l };
|
86
87
|
}, 2(e, t) {
|
87
88
|
return { ...e, tabs: e.tabs.filter((n) => n !== t.tab) };
|
88
89
|
}, 3(e, t) {
|
89
|
-
return e.panels.includes(t.panel) ? e : { ...e, panels:
|
90
|
+
return e.panels.includes(t.panel) ? e : { ...e, panels: B([...e.panels, t.panel], (n) => n.current) };
|
90
91
|
}, 4(e, t) {
|
91
92
|
return { ...e, panels: e.panels.filter((n) => n !== t.panel) };
|
92
93
|
} }, X = oe(null);
|
93
94
|
X.displayName = "TabsDataContext";
|
94
|
-
function
|
95
|
-
let t =
|
95
|
+
function C(e) {
|
96
|
+
let t = ue(X);
|
96
97
|
if (t === null) {
|
97
98
|
let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
|
98
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
99
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, C), n;
|
99
100
|
}
|
100
101
|
return t;
|
101
102
|
}
|
102
103
|
let Z = oe(null);
|
103
104
|
Z.displayName = "TabsActionsContext";
|
104
105
|
function ee(e) {
|
105
|
-
let t =
|
106
|
+
let t = ue(Z);
|
106
107
|
if (t === null) {
|
107
108
|
let n = new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);
|
108
109
|
throw Error.captureStackTrace && Error.captureStackTrace(n, ee), n;
|
@@ -110,172 +111,174 @@ function ee(e) {
|
|
110
111
|
return t;
|
111
112
|
}
|
112
113
|
function je(e, t) {
|
113
|
-
return
|
114
|
+
return G(t.type, He, e, t);
|
114
115
|
}
|
115
|
-
let
|
116
|
-
function
|
117
|
-
let { defaultIndex: n = 0, vertical: r = !1, manual: l = !1, onChange: s, selectedIndex: o = null, ...
|
118
|
-
const
|
119
|
-
let
|
120
|
-
})),
|
121
|
-
|
122
|
-
}),
|
116
|
+
let Je = "div";
|
117
|
+
function Ke(e, t) {
|
118
|
+
let { defaultIndex: n = 0, vertical: r = !1, manual: l = !1, onChange: s, selectedIndex: o = null, ...d } = e;
|
119
|
+
const p = r ? "vertical" : "horizontal", b = l ? "manual" : "auto";
|
120
|
+
let u = o !== null, m = j({ isControlled: u }), $ = q(t), [f, a] = ye(je, { info: m, selectedIndex: o ?? n, tabs: [], panels: [] }), v = S(() => ({ selectedIndex: f.selectedIndex }), [f.selectedIndex]), w = j(s || (() => {
|
121
|
+
})), E = j(f.tabs), x = S(() => ({ orientation: p, activation: b, ...f }), [p, b, f]), F = A((c) => (a({ type: 1, tab: c }), () => a({ type: 2, tab: c }))), L = A((c) => (a({ type: 3, panel: c }), () => a({ type: 4, panel: c }))), g = A((c) => {
|
122
|
+
h.current !== c && w.current(c), u || a({ type: 0, index: c });
|
123
|
+
}), h = j(u ? e.selectedIndex : f.selectedIndex), O = S(() => ({ registerTab: F, registerPanel: L, change: g }), []);
|
123
124
|
W(() => {
|
124
|
-
|
125
|
+
a({ type: 0, index: o ?? n });
|
125
126
|
}, [o]), W(() => {
|
126
|
-
if (
|
127
|
-
let
|
128
|
-
|
127
|
+
if (h.current === void 0 || f.tabs.length <= 0) return;
|
128
|
+
let c = B(f.tabs, (y) => y.current);
|
129
|
+
c.some((y, D) => f.tabs[D] !== y) && g(c.indexOf(f.tabs[h.current]));
|
129
130
|
});
|
130
|
-
let K = { ref:
|
131
|
-
return
|
132
|
-
var
|
133
|
-
for (let
|
131
|
+
let K = { ref: $ };
|
132
|
+
return R.createElement(We, null, R.createElement(Z.Provider, { value: O }, R.createElement(X.Provider, { value: x }, x.tabs.length <= 0 && R.createElement(Ge, { onFocus: () => {
|
133
|
+
var c, y;
|
134
|
+
for (let D of E.current) if (((c = D.current) == null ? void 0 : c.tabIndex) === 0) return (y = D.current) == null || y.focus(), !0;
|
134
135
|
return !1;
|
135
|
-
} }),
|
136
|
+
} }), z({ ourProps: K, theirProps: d, slot: v, defaultTag: Je, name: "Tabs" }))));
|
136
137
|
}
|
137
|
-
let
|
138
|
-
function
|
139
|
-
let { orientation: n, selectedIndex: r } =
|
140
|
-
return
|
138
|
+
let Ye = "div";
|
139
|
+
function Qe(e, t) {
|
140
|
+
let { orientation: n, selectedIndex: r } = C("Tab.List"), l = q(t), s = S(() => ({ selectedIndex: r }), [r]);
|
141
|
+
return z({ ourProps: { ref: l, role: "tablist", "aria-orientation": n }, theirProps: e, slot: s, defaultTag: Ye, name: "Tabs.List" });
|
141
142
|
}
|
142
|
-
let
|
143
|
-
function
|
143
|
+
let Xe = "button";
|
144
|
+
function Ze(e, t) {
|
144
145
|
var n, r;
|
145
|
-
let l =
|
146
|
-
W(() =>
|
147
|
-
let L = be("tabs"),
|
148
|
-
|
149
|
-
let
|
150
|
-
var
|
151
|
-
let
|
152
|
-
if (
|
153
|
-
let $e = (
|
154
|
-
ae !== -1 &&
|
146
|
+
let l = ie(), { id: s = `headlessui-tabs-tab-${l}`, disabled: o = !1, autoFocus: d = !1, ...p } = e, { orientation: b, activation: u, selectedIndex: m, tabs: $, panels: f } = C("Tab"), a = ee("Tab"), v = C("Tab"), [w, E] = Q(null), x = U(null), F = q(x, t, E);
|
147
|
+
W(() => a.registerTab(x), [a, x]);
|
148
|
+
let L = be("tabs"), g = $.indexOf(x);
|
149
|
+
g === -1 && (g = L);
|
150
|
+
let h = g === m, O = A((i) => {
|
151
|
+
var _;
|
152
|
+
let H = i();
|
153
|
+
if (H === J.Success && u === "auto") {
|
154
|
+
let $e = (_ = Re(x)) == null ? void 0 : _.activeElement, ae = v.tabs.findIndex((we) => we.current === $e);
|
155
|
+
ae !== -1 && a.change(ae);
|
155
156
|
}
|
156
|
-
return
|
157
|
-
}), K =
|
158
|
-
let
|
159
|
-
if (
|
160
|
-
|
157
|
+
return H;
|
158
|
+
}), K = A((i) => {
|
159
|
+
let _ = $.map((H) => H.current).filter(Boolean);
|
160
|
+
if (i.key === T.Space || i.key === T.Enter) {
|
161
|
+
i.preventDefault(), i.stopPropagation(), a.change(g);
|
161
162
|
return;
|
162
163
|
}
|
163
|
-
switch (
|
164
|
-
case
|
165
|
-
case
|
166
|
-
return
|
167
|
-
case
|
168
|
-
case
|
169
|
-
return
|
164
|
+
switch (i.key) {
|
165
|
+
case T.Home:
|
166
|
+
case T.PageUp:
|
167
|
+
return i.preventDefault(), i.stopPropagation(), O(() => N(_, I.First));
|
168
|
+
case T.End:
|
169
|
+
case T.PageDown:
|
170
|
+
return i.preventDefault(), i.stopPropagation(), O(() => N(_, I.Last));
|
170
171
|
}
|
171
|
-
if (O(() =>
|
172
|
-
return
|
172
|
+
if (O(() => G(b, { vertical() {
|
173
|
+
return i.key === T.ArrowUp ? N(_, I.Previous | I.WrapAround) : i.key === T.ArrowDown ? N(_, I.Next | I.WrapAround) : J.Error;
|
173
174
|
}, horizontal() {
|
174
|
-
return
|
175
|
-
} })) === J.Success) return
|
176
|
-
}),
|
177
|
-
var
|
178
|
-
|
179
|
-
|
175
|
+
return i.key === T.ArrowLeft ? N(_, I.Previous | I.WrapAround) : i.key === T.ArrowRight ? N(_, I.Next | I.WrapAround) : J.Error;
|
176
|
+
} })) === J.Success) return i.preventDefault();
|
177
|
+
}), c = U(!1), y = A(() => {
|
178
|
+
var i;
|
179
|
+
c.current || (c.current = !0, (i = x.current) == null || i.focus({ preventScroll: !0 }), a.change(g), Me(() => {
|
180
|
+
c.current = !1;
|
180
181
|
}));
|
181
|
-
}),
|
182
|
-
|
183
|
-
}), { isFocusVisible: te, focusProps: he } = ce({ autoFocus:
|
184
|
-
return
|
182
|
+
}), D = A((i) => {
|
183
|
+
i.preventDefault();
|
184
|
+
}), { isFocusVisible: te, focusProps: he } = ce({ autoFocus: d }), { isHovered: re, hoverProps: Te } = Ne({ isDisabled: o }), { pressed: ne, pressProps: Ie } = Ce({ disabled: o }), Pe = S(() => ({ selected: h, hover: re, active: ne, focus: te, autofocus: d, disabled: o }), [h, re, te, ne, d, o]), _e = de({ ref: F, onKeyDown: K, onMouseDown: D, onClick: y, id: s, role: "tab", type: Le(e, w), "aria-controls": (r = (n = f[g]) == null ? void 0 : n.current) == null ? void 0 : r.id, "aria-selected": h, tabIndex: h ? 0 : -1, disabled: o || void 0, autoFocus: d }, he, Te, Ie);
|
185
|
+
return z({ ourProps: _e, theirProps: p, slot: Pe, defaultTag: Xe, name: "Tabs.Tab" });
|
185
186
|
}
|
186
|
-
let
|
187
|
-
function
|
188
|
-
let { selectedIndex: n } =
|
189
|
-
return
|
187
|
+
let et = "div";
|
188
|
+
function tt(e, t) {
|
189
|
+
let { selectedIndex: n } = C("Tab.Panels"), r = q(t), l = S(() => ({ selectedIndex: n }), [n]);
|
190
|
+
return z({ ourProps: { ref: r }, theirProps: e, slot: l, defaultTag: et, name: "Tabs.Panels" });
|
190
191
|
}
|
191
|
-
let
|
192
|
-
function
|
192
|
+
let rt = "div", nt = se.RenderStrategy | se.Static;
|
193
|
+
function at(e, t) {
|
193
194
|
var n, r, l, s;
|
194
|
-
let o =
|
195
|
-
W(() =>
|
196
|
-
let
|
197
|
-
|
198
|
-
let
|
199
|
-
return !
|
195
|
+
let o = ie(), { id: d = `headlessui-tabs-panel-${o}`, tabIndex: p = 0, ...b } = e, { selectedIndex: u, tabs: m, panels: $ } = C("Tab.Panel"), f = ee("Tab.Panel"), a = U(null), v = q(a, t);
|
196
|
+
W(() => f.registerPanel(a), [f, a]);
|
197
|
+
let w = be("panels"), E = $.indexOf(a);
|
198
|
+
E === -1 && (E = w);
|
199
|
+
let x = E === u, { isFocusVisible: F, focusProps: L } = ce(), g = S(() => ({ selected: x, focus: F }), [x, F]), h = de({ ref: v, id: d, role: "tabpanel", "aria-labelledby": (r = (n = m[E]) == null ? void 0 : n.current) == null ? void 0 : r.id, tabIndex: x ? p : -1 }, L);
|
200
|
+
return !x && ((l = b.unmount) == null || l) && !((s = b.static) != null && s) ? R.createElement(pe, { "aria-hidden": "true", ...h }) : z({ ourProps: h, theirProps: b, slot: g, defaultTag: rt, features: nt, visible: x, name: "Tabs.Panel" });
|
200
201
|
}
|
201
|
-
let
|
202
|
-
const
|
203
|
-
container:
|
204
|
-
group:
|
202
|
+
let lt = V(Ze), me = V(Ke), xe = V(Qe), ve = V(tt), ge = V(at), st = Object.assign(lt, { Group: me, List: xe, Panels: ve, Panel: ge });
|
203
|
+
const ot = "_container_rlke5_2", it = "_group_rlke5_6", ut = "_tab_rlke5_16", ct = "_list_rlke5_51", dt = "_tabs_rlke5_62", pt = "_buttons_rlke5_68", ft = "_m_rlke5_75", bt = "_s_rlke5_83", P = {
|
204
|
+
container: ot,
|
205
|
+
group: it,
|
205
206
|
"group-inner": "_group-inner_rlke5_9",
|
206
207
|
tab: ut,
|
207
|
-
list:
|
208
|
-
tabs:
|
209
|
-
buttons:
|
210
|
-
m:
|
211
|
-
s:
|
212
|
-
},
|
208
|
+
list: ct,
|
209
|
+
tabs: dt,
|
210
|
+
buttons: pt,
|
211
|
+
m: ft,
|
212
|
+
s: bt
|
213
|
+
}, yt = ke(
|
213
214
|
({
|
214
215
|
categories: e,
|
215
216
|
size: t = Ae.M,
|
216
217
|
showButtons: n = !0,
|
217
218
|
className: r,
|
218
219
|
selectedTabIndex: l,
|
219
|
-
onTabChange: s
|
220
|
-
|
221
|
-
|
220
|
+
onTabChange: s,
|
221
|
+
buttonsVariant: o = Fe.WHITE
|
222
|
+
}, d) => {
|
223
|
+
const [p, b] = Q(l || 0), u = U(null);
|
222
224
|
le(() => {
|
223
|
-
l !== void 0 && l !==
|
224
|
-
}, [
|
225
|
-
const
|
226
|
-
|
227
|
-
},
|
228
|
-
const a = (
|
229
|
-
|
230
|
-
},
|
231
|
-
const a = (
|
232
|
-
|
225
|
+
l !== void 0 && l !== p && b(l);
|
226
|
+
}, [p, l]);
|
227
|
+
const m = (a) => {
|
228
|
+
b(a), s == null || s(a);
|
229
|
+
}, $ = () => {
|
230
|
+
const a = (p + 1) % e.length;
|
231
|
+
m(a);
|
232
|
+
}, f = () => {
|
233
|
+
const a = (p - 1 + e.length) % e.length;
|
234
|
+
m(a);
|
233
235
|
};
|
234
236
|
return le(() => {
|
235
|
-
var
|
236
|
-
const a = (
|
237
|
-
`.${
|
237
|
+
var v;
|
238
|
+
const a = (v = u.current) == null ? void 0 : v.querySelector(
|
239
|
+
`.${P.tab}[data-active="true"]`
|
238
240
|
);
|
239
241
|
a && typeof a.scrollIntoView == "function" && a.scrollIntoView({
|
240
242
|
behavior: "smooth",
|
241
243
|
block: "nearest",
|
242
244
|
inline: "center"
|
243
245
|
});
|
244
|
-
}, [
|
246
|
+
}, [p]), /* @__PURE__ */ Y(
|
245
247
|
me,
|
246
248
|
{
|
247
|
-
ref:
|
248
|
-
className:
|
249
|
-
selectedIndex:
|
250
|
-
onChange:
|
249
|
+
ref: d,
|
250
|
+
className: Ee(P.group, P[t], r),
|
251
|
+
selectedIndex: p,
|
252
|
+
onChange: m,
|
251
253
|
children: [
|
252
|
-
/* @__PURE__ */ Y("div", { className:
|
253
|
-
/* @__PURE__ */ k(xe, { ref:
|
254
|
-
|
254
|
+
/* @__PURE__ */ Y("div", { className: P["group-inner"], children: [
|
255
|
+
/* @__PURE__ */ k(xe, { ref: u, className: P.list, children: /* @__PURE__ */ k("div", { className: P.tabs, children: e.map(({ name: a, notificationCount: v }, w) => /* @__PURE__ */ Y(
|
256
|
+
st,
|
255
257
|
{
|
256
|
-
className: `${
|
257
|
-
"data-active":
|
258
|
+
className: `${P.tab} ${p === w ? 'data-active="true"' : ""}`,
|
259
|
+
"data-active": p === w,
|
258
260
|
children: [
|
259
261
|
a,
|
260
|
-
|
262
|
+
v && /* @__PURE__ */ k(De, { count: v, size: "m" })
|
261
263
|
]
|
262
264
|
},
|
263
265
|
a
|
264
266
|
)) }) }),
|
265
|
-
n && /* @__PURE__ */ k("div", { className:
|
267
|
+
n && /* @__PURE__ */ k("div", { className: P.buttons, children: /* @__PURE__ */ k(
|
266
268
|
Se,
|
267
269
|
{
|
268
|
-
handlePrevTab:
|
269
|
-
handleNextTab:
|
270
|
+
handlePrevTab: f,
|
271
|
+
handleNextTab: $,
|
272
|
+
buttonsVariant: o
|
270
273
|
}
|
271
274
|
) })
|
272
275
|
] }),
|
273
|
-
/* @__PURE__ */ k(ve, { className:
|
276
|
+
/* @__PURE__ */ k(ve, { className: P.panels, children: e.map(({ name: a, content: v }) => /* @__PURE__ */ k(ge, { className: P.panel, children: v }, a)) })
|
274
277
|
]
|
275
278
|
}
|
276
279
|
);
|
277
280
|
}
|
278
281
|
);
|
279
282
|
export {
|
280
|
-
|
283
|
+
yt as TabTrail
|
281
284
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import l, { useId as u, useMemo as f } from "react";
|
2
|
-
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-
|
3
|
-
import { W as H, H as W } from "./keyboard-
|
2
|
+
import { z as p, U as h, a as v, l as E, f as b, W as $ } from "./label-D4GFpe5F.js";
|
3
|
+
import { W as H, H as W } from "./keyboard-mgWkd2Vh.js";
|
4
4
|
let P = "div";
|
5
5
|
function _(a, i) {
|
6
6
|
let d = `headlessui-control-${u()}`, [o, n] = p(), [m, s] = h(), c = v(), { disabled: e = c || !1, ...t } = a, r = f(() => ({ disabled: e }), [e]);
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { u as N, a as v } from "./keyboard-
|
1
|
+
import { u as N, a as v } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let m = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), F = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
3
3
|
var h = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(h || {}), x = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(x || {}), A = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(A || {});
|
4
4
|
function y(e = document.body) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { W as t, H as a } from "./keyboard-
|
1
|
+
import { W as t, H as a } from "./keyboard-mgWkd2Vh.js";
|
2
2
|
let l = "span";
|
3
3
|
var p = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(p || {});
|
4
4
|
function s(e, n) {
|