welcome-ui 9.0.0-alpha.4 → 9.0.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/README.md +47 -3
- package/dist/2W3RN7C5-bkX-rIa3.js +61 -0
- package/dist/4I4MLMKD-BLxAidnq.js +43 -0
- package/dist/Accordion.js +6 -6
- package/dist/Alert.js +1 -1
- package/dist/AspectRatio.js +1 -1
- package/dist/Avatar.js +1 -1
- package/dist/{4CMBR7SL-Dhp8uJop.js → B7UTNDHN-BlIblHCu.js} +59 -59
- package/dist/Badge.js +1 -1
- package/dist/Breadcrumb.css +1 -1
- package/dist/Breadcrumb.js +27 -27
- package/dist/Button.js +2 -2
- package/dist/ButtonGroup.js +1 -1
- package/dist/Card.js +1 -1
- package/dist/Checkbox.css +1 -1
- package/dist/Checkbox.js +22 -22
- package/dist/CloseButton.js +3 -3
- package/dist/{SYRFVSLH-CHNUB1rW.js → DSAASPLT-BaaCUKsb.js} +7 -7
- package/dist/DatePicker.js +5 -5
- package/dist/DateTimePicker.js +2 -2
- package/dist/Drawer.css +1 -1
- package/dist/Drawer.js +67 -67
- package/dist/DropdownMenu.js +261 -259
- package/dist/Field.js +1 -1
- package/dist/FieldGroup.js +1 -1
- package/dist/FileDrop.js +194 -221
- package/dist/FileUpload.js +2 -2
- package/dist/GVVKDT6A-bET6V7Py.js +724 -0
- package/dist/Hint.js +1 -1
- package/dist/{Icon-BisRi8B3.js → Icon-EG7O4YwD.js} +1 -1
- package/dist/Icon.js +12 -12
- package/dist/InputText.js +1 -1
- package/dist/{ASMQKSDT-SH1qSiMi.js → KPUWHTQJ-D2TPji47.js} +30 -30
- package/dist/Label.js +3 -3
- package/dist/Link.css +1 -1
- package/dist/Link.js +27 -27
- package/dist/Loader.js +1 -1
- package/dist/Logo.js +1 -1
- package/dist/Modal.js +10 -10
- package/dist/{JC64G2H7-DPy9R0De.js → NI3IVY7K-Ztb3-XAv.js} +571 -571
- package/dist/{P4IRICAX-7kH4HzWI.js → NMGNQVTG-C6TqBngP.js} +5 -5
- package/dist/{LVA2YJMS-NUHCRwFZ.js → OE2EFRVA-C3721cM3.js} +316 -315
- package/dist/{ITI7HKP4-C5xLpoVY.js → OLVWQA7U-DysaSaZj.js} +59 -59
- package/dist/Pagination.css +1 -1
- package/dist/Pagination.js +81 -73
- package/dist/PasswordInput.js +17 -18
- package/dist/Popover.js +14 -14
- package/dist/{YV4JVR4I-CVFstk2K.js → RTNCFSKZ-qpPg689E.js} +75 -73
- package/dist/Radio.css +1 -1
- package/dist/Radio.js +29 -29
- package/dist/RadioGroup.js +21 -21
- package/dist/RadioTab.js +2 -2
- package/dist/{P2CTZE2T-D1TepwxQ.js → SBSPVDDI-DJKkC1eb.js} +43 -43
- package/dist/{NLEBE274-B4zy25kL.js → SQZLCNLX-CHDXnZ16.js} +16 -16
- package/dist/Search.js +2 -2
- package/dist/Select.js +170 -181
- package/dist/Slider.js +1 -1
- package/dist/Swiper.css +1 -1
- package/dist/Swiper.js +151 -151
- package/dist/{VGCJ63VH-CVhs4PYt.js → T22PY7TE-C1N0q8Kn.js} +109 -109
- package/dist/Table.js +1 -1
- package/dist/Tabs.js +303 -308
- package/dist/Tag.js +3 -3
- package/dist/Text.js +1 -1
- package/dist/Textarea.js +1 -1
- package/dist/TimePicker.js +2 -2
- package/dist/Toast.js +1 -1
- package/dist/Toggle.js +2 -2
- package/dist/Tooltip.js +72 -72
- package/dist/VariantIcon.js +3 -3
- package/dist/WelcomeLoader.js +1 -1
- package/dist/XCKGTAUF-DkxWCbaW.js +25 -0
- package/dist/Y67KZUMI-DFEgrUv2.js +15 -0
- package/dist/{AXB53BZF-BHeessqV.js → ZTXFEM5L-CkrIQCN1.js} +7 -7
- package/dist/{field-icon-size-Du58qHNC.js → field-icon-size-Z5NulTSk.js} +216 -224
- package/dist/{index-5rXezknO.js → index-BC2bF45u.js} +1 -1
- package/dist/{index-C8GsqBDe.js → index-BeetbagJ.js} +1 -1
- package/dist/{index-BJLXLdM3.js → index-Bt79XJ8R.js} +1 -1
- package/dist/{index-Dcq5gh3E.js → index-BtwrJ6N4.js} +1 -1
- package/dist/{index-DL4-ut3P.js → index-CCASZBtz.js} +1 -1
- package/dist/{index-lbUBMgHp.js → index-CPqDZeah.js} +2 -2
- package/dist/{index-CTgip19b.js → index-CQEPCbEE.js} +1 -1
- package/dist/{index-CnxSNAPH.js → index-Crpe9CvH.js} +1 -1
- package/dist/{index-CWVOLBDY.js → index-D5a8Oe6k.js} +1 -1
- package/dist/{index-C1jjVTAc.js → index-D8dq-I5s.js} +1 -1
- package/dist/{index-Cvtm6uuS.js → index-DkwTwo3z.js} +1 -1
- package/dist/{index-BG2aV9o8.js → index-DnO8yBVT.js} +1 -1
- package/dist/index.css +0 -0
- package/dist/tslib.es6-DpB4Y59c.js +683 -0
- package/dist/types/components/Pagination/index.d.ts +1 -2
- package/dist/types/components/Pagination/types.d.ts +5 -2
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +1 -1
- package/dist/types/components/PasswordInput/types.d.ts +1 -1
- package/dist/types/components/Tabs/components/TabList/index.d.ts +1 -1
- package/dist/types/components/Tabs/index.d.ts +1 -1
- package/dist/types/components/Tabs/types.d.ts +1 -2
- package/dist/types/components/Tabs/utils.d.ts +1 -2
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/types/utils/theme/index.d.ts +0 -0
- package/dist/types/utils/useForkRef.d.ts +7 -1
- package/dist/useForkRef-D807AV7D.js +22 -0
- package/dist/{utils-BNMgUIHQ.js → utils-BpbIqM56.js} +1 -1
- package/dist/utils.js +2 -2
- package/package.json +5 -5
- package/dist/BYC7LY2E-DbSoi9cN.js +0 -673
- package/dist/KUU7WJ55-CsIy9XMu.js +0 -61
- package/dist/MTZPJQMC-D_TnSwZf.js +0 -15
- package/dist/QYJ6MIDR-Dm7lYMh6.js +0 -43
- package/dist/X5NMLKT6-PeY306ft.js +0 -25
- package/dist/index--0U5Rubs.js +0 -644
- /package/dist/{index-PAaZGbyz.js → index-CdiHdiVB.js} +0 -0
package/dist/Tabs.js
CHANGED
|
@@ -1,216 +1,69 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as P, jsxs as
|
|
3
|
-
import { C as
|
|
4
|
-
import {
|
|
5
|
-
import { m as
|
|
6
|
-
import
|
|
7
|
-
import { c as
|
|
8
|
-
import { f as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { u as Oe,
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
[
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function Be(t = {}) {
|
|
21
|
-
var s = t, {
|
|
22
|
-
composite: o,
|
|
23
|
-
combobox: e
|
|
24
|
-
} = s, n = Se(s, [
|
|
25
|
-
"composite",
|
|
26
|
-
"combobox"
|
|
27
|
-
]);
|
|
28
|
-
const r = [
|
|
29
|
-
"items",
|
|
30
|
-
"renderedItems",
|
|
31
|
-
"moves",
|
|
32
|
-
"orientation",
|
|
33
|
-
"virtualFocus",
|
|
34
|
-
"includesBaseElement",
|
|
35
|
-
"baseElement",
|
|
36
|
-
"focusLoop",
|
|
37
|
-
"focusShift",
|
|
38
|
-
"focusWrap"
|
|
39
|
-
], m = Pe(
|
|
40
|
-
n.store,
|
|
41
|
-
X(o, r),
|
|
42
|
-
X(e, r)
|
|
43
|
-
), i = m == null ? void 0 : m.getState(), d = Me(M(k({}, n), {
|
|
44
|
-
store: m,
|
|
45
|
-
// We need to explicitly set the default value of `includesBaseElement` to
|
|
46
|
-
// `false` since we don't want the composite store to default it to `true`
|
|
47
|
-
// when the activeId state is null, which could be the case when rendering
|
|
48
|
-
// combobox with tab.
|
|
49
|
-
includesBaseElement: O(
|
|
50
|
-
n.includesBaseElement,
|
|
51
|
-
i == null ? void 0 : i.includesBaseElement,
|
|
52
|
-
!1
|
|
53
|
-
),
|
|
54
|
-
orientation: O(
|
|
55
|
-
n.orientation,
|
|
56
|
-
i == null ? void 0 : i.orientation,
|
|
57
|
-
"horizontal"
|
|
58
|
-
),
|
|
59
|
-
focusLoop: O(n.focusLoop, i == null ? void 0 : i.focusLoop, !0)
|
|
60
|
-
})), a = Ve(), _ = M(k({}, d.getState()), {
|
|
61
|
-
selectedId: O(
|
|
62
|
-
n.selectedId,
|
|
63
|
-
i == null ? void 0 : i.selectedId,
|
|
64
|
-
n.defaultSelectedId
|
|
65
|
-
),
|
|
66
|
-
selectOnMove: O(
|
|
67
|
-
n.selectOnMove,
|
|
68
|
-
i == null ? void 0 : i.selectOnMove,
|
|
69
|
-
!0
|
|
70
|
-
)
|
|
71
|
-
}), c = Te(_, d, m);
|
|
72
|
-
z(
|
|
73
|
-
c,
|
|
74
|
-
() => w(c, ["moves"], () => {
|
|
75
|
-
const { activeId: u, selectOnMove: p } = c.getState();
|
|
76
|
-
if (!p || !u) return;
|
|
77
|
-
const I = d.item(u);
|
|
78
|
-
I && (I.dimmed || I.disabled || c.setState("selectedId", I.id));
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
let b = !0;
|
|
82
|
-
z(
|
|
83
|
-
c,
|
|
84
|
-
() => Ee(c, ["selectedId"], (u, p) => {
|
|
85
|
-
if (!b) {
|
|
86
|
-
b = !0;
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
o && u.selectedId === p.selectedId || c.setState("activeId", u.selectedId);
|
|
90
|
-
})
|
|
91
|
-
), z(
|
|
92
|
-
c,
|
|
93
|
-
() => w(c, ["selectedId", "renderedItems"], (u) => {
|
|
94
|
-
if (u.selectedId !== void 0) return;
|
|
95
|
-
const { activeId: p, renderedItems: I } = c.getState(), S = d.item(p);
|
|
96
|
-
if (S && !S.disabled && !S.dimmed)
|
|
97
|
-
c.setState("selectedId", S.id);
|
|
98
|
-
else {
|
|
99
|
-
const T = I.find(
|
|
100
|
-
(C) => !C.disabled && !C.dimmed
|
|
101
|
-
);
|
|
102
|
-
c.setState("selectedId", T == null ? void 0 : T.id);
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
), z(
|
|
106
|
-
c,
|
|
107
|
-
() => w(c, ["renderedItems"], (u) => {
|
|
108
|
-
const p = u.renderedItems;
|
|
109
|
-
if (p.length)
|
|
110
|
-
return w(a, ["renderedItems"], (I) => {
|
|
111
|
-
const S = I.renderedItems;
|
|
112
|
-
S.some((C) => !C.tabId) && S.forEach((C, R) => {
|
|
113
|
-
if (C.tabId) return;
|
|
114
|
-
const N = p[R];
|
|
115
|
-
N && a.renderItem(M(k({}, C), { tabId: N.id }));
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
})
|
|
119
|
-
);
|
|
120
|
-
let x = null;
|
|
121
|
-
return z(c, () => {
|
|
122
|
-
const u = () => {
|
|
123
|
-
x = c.getState().selectedId;
|
|
124
|
-
}, p = () => {
|
|
125
|
-
b = !1, c.setState("selectedId", x);
|
|
126
|
-
};
|
|
127
|
-
if (o && "setSelectElement" in o)
|
|
128
|
-
return J(
|
|
129
|
-
w(o, ["value"], u),
|
|
130
|
-
w(o, ["mounted"], p)
|
|
131
|
-
);
|
|
132
|
-
if (e)
|
|
133
|
-
return J(
|
|
134
|
-
w(e, ["selectedValue"], u),
|
|
135
|
-
w(e, ["mounted"], p)
|
|
136
|
-
);
|
|
137
|
-
}), M(k(k({}, d), c), {
|
|
138
|
-
panels: a,
|
|
139
|
-
setSelectedId: (u) => c.setState("selectedId", u),
|
|
140
|
-
select: (u) => {
|
|
141
|
-
c.setState("selectedId", u), d.move(u);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
function je(t, s, o) {
|
|
146
|
-
Q(s, [o.composite, o.combobox]), t = Fe(t, s, o), Y(t, o, "selectedId", "setSelectedId"), Y(t, o, "selectOnMove");
|
|
147
|
-
const [e, n] = ae(() => t.panels, {});
|
|
148
|
-
return Q(n, [t, n]), Object.assign(
|
|
149
|
-
le(() => h(v({}, t), { panels: e }), [t, e]),
|
|
150
|
-
{ composite: o.composite, combobox: o.combobox }
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
function Nt(t = {}) {
|
|
154
|
-
const s = Re(), o = Ae() || s;
|
|
155
|
-
t = h(v({}, t), {
|
|
156
|
-
composite: t.composite !== void 0 ? t.composite : o,
|
|
157
|
-
combobox: t.combobox !== void 0 ? t.combobox : s
|
|
158
|
-
});
|
|
159
|
-
const [e, n] = ae(Be, t);
|
|
160
|
-
return je(e, n, t);
|
|
161
|
-
}
|
|
162
|
-
var G = se(
|
|
163
|
-
[oe],
|
|
164
|
-
[te]
|
|
165
|
-
), He = G.useScopedContext, me = G.useProviderContext, fe = G.ScopedContextProvider, Ke = "button", qe = B(function(s) {
|
|
166
|
-
var o = s, {
|
|
2
|
+
import { jsx as P, jsxs as fe } from "react/jsx-runtime";
|
|
3
|
+
import { C as ee, a as te, h as U, b as be, j as pe } from "./SBSPVDDI-DJKkC1eb.js";
|
|
4
|
+
import { e as oe, v as ve, f as B, c as W, b as j, _ as H, i as K, w as se, A as Ie, d as h, a as v, u as V, x as ne, ad as Se, p as xe, W as he, F as _e, G as D, H as O, I as k, S as J, K as Q } from "./OE2EFRVA-C3721cM3.js";
|
|
5
|
+
import { u as A, m as ge, o as X, c as Ce, s as z, a as w, f as Pe, b as re, d as Y } from "./RTNCFSKZ-qpPg689E.js";
|
|
6
|
+
import ae, { useCallback as ce, useRef as F, useEffect as Z, useState as q, createContext as ie, useMemo as Te, cloneElement as Ee, forwardRef as le } from "react";
|
|
7
|
+
import { c as M } from "./index-CdiHdiVB.js";
|
|
8
|
+
import { f as we } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
9
|
+
import { u as Re, b as ye } from "./OLVWQA7U-DysaSaZj.js";
|
|
10
|
+
import { m as $e, g as Ne, u as Le } from "./useForkRef-D807AV7D.js";
|
|
11
|
+
import { u as Oe, a as ke } from "./use-viewport-CgrficYB.js";
|
|
12
|
+
import { u as ze, d as Ae } from "./T22PY7TE-C1N0q8Kn.js";
|
|
13
|
+
import { P as De, a as Me } from "./Y67KZUMI-DFEgrUv2.js";
|
|
14
|
+
import { c as Ve, a as Fe, u as Be } from "./B7UTNDHN-BlIblHCu.js";
|
|
15
|
+
var G = oe(
|
|
16
|
+
[te],
|
|
17
|
+
[ee]
|
|
18
|
+
), We = G.useScopedContext, de = G.useProviderContext, ue = G.ScopedContextProvider, je = "button", He = W(function(r) {
|
|
19
|
+
var t = r, {
|
|
167
20
|
store: e,
|
|
168
|
-
getItem:
|
|
169
|
-
} =
|
|
21
|
+
getItem: s
|
|
22
|
+
} = t, n = H(t, [
|
|
170
23
|
"store",
|
|
171
24
|
"getItem"
|
|
172
25
|
]), m;
|
|
173
|
-
const i =
|
|
26
|
+
const i = We();
|
|
174
27
|
e = e || i, K(
|
|
175
28
|
e,
|
|
176
29
|
process.env.NODE_ENV !== "production" && "Tab must be wrapped in a TabList component."
|
|
177
30
|
);
|
|
178
|
-
const d =
|
|
31
|
+
const d = se(), a = n.id || d, _ = Ie(n), c = ce(
|
|
179
32
|
(f) => {
|
|
180
|
-
const
|
|
181
|
-
return
|
|
33
|
+
const R = h(v({}, f), { dimmed: _ });
|
|
34
|
+
return s ? s(R) : R;
|
|
182
35
|
},
|
|
183
|
-
[_,
|
|
184
|
-
), b =
|
|
36
|
+
[_, s]
|
|
37
|
+
), b = n.onClick, x = V((f) => {
|
|
185
38
|
b == null || b(f), !f.defaultPrevented && (e == null || e.setSelectedId(a));
|
|
186
39
|
}), u = e.panels.useState(
|
|
187
40
|
(f) => {
|
|
188
|
-
var
|
|
189
|
-
return (
|
|
41
|
+
var R;
|
|
42
|
+
return (R = f.items.find((l) => l.tabId === a)) == null ? void 0 : R.id;
|
|
190
43
|
}
|
|
191
|
-
), p = d ?
|
|
192
|
-
if (
|
|
44
|
+
), p = d ? n.shouldRegisterItem : !1, I = e.useState((f) => !!a && f.activeId === a), S = e.useState((f) => !!a && f.selectedId === a), T = e.useState((f) => !!e.item(f.activeId)), g = I || S && !T, y = S || ((m = n.accessibleWhenDisabled) != null ? m : !0);
|
|
45
|
+
if (A(
|
|
193
46
|
e.combobox || e.composite,
|
|
194
47
|
"virtualFocus"
|
|
195
|
-
) && (
|
|
48
|
+
) && (n = h(v({}, n), {
|
|
196
49
|
tabIndex: -1
|
|
197
|
-
})),
|
|
50
|
+
})), n = h(v({
|
|
198
51
|
id: a,
|
|
199
52
|
role: "tab",
|
|
200
53
|
"aria-selected": S,
|
|
201
54
|
"aria-controls": u || void 0
|
|
202
|
-
},
|
|
55
|
+
}, n), {
|
|
203
56
|
onClick: x
|
|
204
57
|
}), e.composite) {
|
|
205
58
|
const f = {
|
|
206
59
|
id: a,
|
|
207
|
-
accessibleWhenDisabled:
|
|
60
|
+
accessibleWhenDisabled: y,
|
|
208
61
|
store: e.composite,
|
|
209
|
-
shouldRegisterItem:
|
|
210
|
-
rowId:
|
|
211
|
-
render:
|
|
62
|
+
shouldRegisterItem: g && p,
|
|
63
|
+
rowId: n.rowId,
|
|
64
|
+
render: n.render
|
|
212
65
|
};
|
|
213
|
-
|
|
66
|
+
n = h(v({}, n), {
|
|
214
67
|
render: /* @__PURE__ */ P(
|
|
215
68
|
U,
|
|
216
69
|
h(v({}, f), {
|
|
@@ -219,53 +72,53 @@ var G = se(
|
|
|
219
72
|
)
|
|
220
73
|
});
|
|
221
74
|
}
|
|
222
|
-
return
|
|
75
|
+
return n = be(h(v({
|
|
223
76
|
store: e
|
|
224
|
-
},
|
|
225
|
-
accessibleWhenDisabled:
|
|
77
|
+
}, n), {
|
|
78
|
+
accessibleWhenDisabled: y,
|
|
226
79
|
getItem: c,
|
|
227
80
|
shouldRegisterItem: p
|
|
228
|
-
})),
|
|
229
|
-
}),
|
|
230
|
-
|
|
231
|
-
const
|
|
232
|
-
return j(
|
|
81
|
+
})), n;
|
|
82
|
+
}), Ke = ve(
|
|
83
|
+
B(function(r) {
|
|
84
|
+
const t = He(r);
|
|
85
|
+
return j(je, t);
|
|
233
86
|
})
|
|
234
|
-
),
|
|
235
|
-
function(
|
|
236
|
-
var
|
|
237
|
-
const
|
|
238
|
-
e = e ||
|
|
87
|
+
), qe = "div", Ge = W(
|
|
88
|
+
function(r) {
|
|
89
|
+
var t = r, { store: e } = t, s = H(t, ["store"]);
|
|
90
|
+
const n = de();
|
|
91
|
+
e = e || n, K(
|
|
239
92
|
e,
|
|
240
93
|
process.env.NODE_ENV !== "production" && "TabList must receive a `store` prop or be wrapped in a TabProvider component."
|
|
241
94
|
);
|
|
242
95
|
const m = e.useState(
|
|
243
96
|
(i) => i.orientation === "both" ? void 0 : i.orientation
|
|
244
97
|
);
|
|
245
|
-
return
|
|
246
|
-
|
|
247
|
-
(i) => /* @__PURE__ */ P(
|
|
98
|
+
return s = ne(
|
|
99
|
+
s,
|
|
100
|
+
(i) => /* @__PURE__ */ P(ue, { value: e, children: i }),
|
|
248
101
|
[e]
|
|
249
|
-
), e.composite && (
|
|
102
|
+
), e.composite && (s = v({
|
|
250
103
|
focusable: !1
|
|
251
|
-
},
|
|
104
|
+
}, s)), s = v({
|
|
252
105
|
role: "tablist",
|
|
253
106
|
"aria-orientation": m
|
|
254
|
-
},
|
|
107
|
+
}, s), s = Re(v({ store: e }, s)), s;
|
|
255
108
|
}
|
|
256
|
-
),
|
|
257
|
-
const
|
|
258
|
-
return j(
|
|
259
|
-
}),
|
|
260
|
-
function(
|
|
261
|
-
var
|
|
109
|
+
), Ue = B(function(r) {
|
|
110
|
+
const t = Ge(r);
|
|
111
|
+
return j(qe, t);
|
|
112
|
+
}), Je = "div", Qe = W(
|
|
113
|
+
function(r) {
|
|
114
|
+
var t = r, {
|
|
262
115
|
store: e,
|
|
263
|
-
unmountOnHide:
|
|
264
|
-
tabId:
|
|
116
|
+
unmountOnHide: s,
|
|
117
|
+
tabId: n,
|
|
265
118
|
getItem: m,
|
|
266
119
|
scrollRestoration: i,
|
|
267
120
|
scrollElement: d
|
|
268
|
-
} =
|
|
121
|
+
} = t, a = H(t, [
|
|
269
122
|
"store",
|
|
270
123
|
"unmountOnHide",
|
|
271
124
|
"tabId",
|
|
@@ -273,187 +126,329 @@ var G = se(
|
|
|
273
126
|
"scrollRestoration",
|
|
274
127
|
"scrollElement"
|
|
275
128
|
]);
|
|
276
|
-
const _ =
|
|
129
|
+
const _ = de();
|
|
277
130
|
e = e || _, K(
|
|
278
131
|
e,
|
|
279
132
|
process.env.NODE_ENV !== "production" && "TabPanel must receive a `store` prop or be wrapped in a TabProvider component."
|
|
280
133
|
);
|
|
281
|
-
const c =
|
|
134
|
+
const c = F(null), b = se(a.id), x = A(
|
|
282
135
|
e.panels,
|
|
283
136
|
() => {
|
|
284
137
|
var l;
|
|
285
|
-
return
|
|
138
|
+
return n || ((l = e == null ? void 0 : e.panels.item(b)) == null ? void 0 : l.tabId);
|
|
286
139
|
}
|
|
287
|
-
), u =
|
|
140
|
+
), u = A(
|
|
288
141
|
e,
|
|
289
142
|
(l) => !!x && l.selectedId === x
|
|
290
|
-
), p =
|
|
143
|
+
), p = ze({ open: u }), I = A(p, "mounted"), S = F(
|
|
291
144
|
/* @__PURE__ */ new Map()
|
|
292
|
-
), T =
|
|
145
|
+
), T = V(() => {
|
|
293
146
|
const l = c.current;
|
|
294
147
|
return l ? d ? typeof d == "function" ? d(l) : "current" in d ? d.current : d : l : null;
|
|
295
148
|
});
|
|
296
149
|
Z(() => {
|
|
297
150
|
var l, E;
|
|
298
151
|
if (!i || !I) return;
|
|
299
|
-
const
|
|
300
|
-
if (!
|
|
152
|
+
const C = T();
|
|
153
|
+
if (!C) return;
|
|
301
154
|
if (i === "reset") {
|
|
302
|
-
|
|
155
|
+
C.scroll(0, 0);
|
|
303
156
|
return;
|
|
304
157
|
}
|
|
305
158
|
if (!x) return;
|
|
306
159
|
const $ = S.current.get(x);
|
|
307
|
-
|
|
160
|
+
C.scroll((l = $ == null ? void 0 : $.x) != null ? l : 0, (E = $ == null ? void 0 : $.y) != null ? E : 0);
|
|
308
161
|
const L = () => {
|
|
309
162
|
S.current.set(x, {
|
|
310
|
-
x:
|
|
311
|
-
y:
|
|
163
|
+
x: C.scrollLeft,
|
|
164
|
+
y: C.scrollTop
|
|
312
165
|
});
|
|
313
166
|
};
|
|
314
|
-
return
|
|
315
|
-
|
|
167
|
+
return C.addEventListener("scroll", L), () => {
|
|
168
|
+
C.removeEventListener("scroll", L);
|
|
316
169
|
};
|
|
317
170
|
}, [i, I, x, T, e]);
|
|
318
|
-
const [
|
|
171
|
+
const [g, y] = q(!1);
|
|
319
172
|
Z(() => {
|
|
320
173
|
const l = c.current;
|
|
321
174
|
if (!l) return;
|
|
322
|
-
const E =
|
|
323
|
-
|
|
175
|
+
const E = Se(l);
|
|
176
|
+
y(!!E.length);
|
|
324
177
|
}, []);
|
|
325
|
-
const N =
|
|
178
|
+
const N = ce(
|
|
326
179
|
(l) => {
|
|
327
|
-
const E = h(v({}, l), { id: b || l.id, tabId:
|
|
180
|
+
const E = h(v({}, l), { id: b || l.id, tabId: n });
|
|
328
181
|
return m ? m(E) : E;
|
|
329
182
|
},
|
|
330
|
-
[b,
|
|
331
|
-
), f = a.onKeyDown,
|
|
183
|
+
[b, n, m]
|
|
184
|
+
), f = a.onKeyDown, R = V((l) => {
|
|
332
185
|
if (f == null || f(l), l.defaultPrevented || !(e != null && e.composite)) return;
|
|
333
|
-
const
|
|
186
|
+
const C = {
|
|
334
187
|
ArrowLeft: e.previous,
|
|
335
188
|
ArrowRight: e.next,
|
|
336
189
|
Home: e.first,
|
|
337
190
|
End: e.last
|
|
338
191
|
}[l.key];
|
|
339
|
-
if (!
|
|
340
|
-
const { selectedId: $ } = e.getState(), L =
|
|
192
|
+
if (!C) return;
|
|
193
|
+
const { selectedId: $ } = e.getState(), L = C({ activeId: $ });
|
|
341
194
|
L && (l.preventDefault(), e.move(L));
|
|
342
195
|
});
|
|
343
|
-
return a =
|
|
196
|
+
return a = ne(
|
|
344
197
|
a,
|
|
345
|
-
(l) => /* @__PURE__ */ P(
|
|
198
|
+
(l) => /* @__PURE__ */ P(ue, { value: e, children: l }),
|
|
346
199
|
[e]
|
|
347
200
|
), a = h(v({
|
|
348
201
|
id: b,
|
|
349
202
|
role: "tabpanel",
|
|
350
203
|
"aria-labelledby": x || void 0
|
|
351
204
|
}, a), {
|
|
352
|
-
children:
|
|
353
|
-
ref:
|
|
354
|
-
onKeyDown:
|
|
355
|
-
}), a =
|
|
205
|
+
children: s && !I ? null : a.children,
|
|
206
|
+
ref: xe(c, a.ref),
|
|
207
|
+
onKeyDown: R
|
|
208
|
+
}), a = he(v({
|
|
356
209
|
// If the tab panel is rendered as part of another composite widget such
|
|
357
210
|
// as combobox, it should not be focusable.
|
|
358
|
-
focusable: !e.composite && !
|
|
359
|
-
}, a)), a =
|
|
211
|
+
focusable: !e.composite && !g
|
|
212
|
+
}, a)), a = Ae(v({ store: p }, a)), a = pe(h(v({ store: e.panels }, a), { getItem: N })), a;
|
|
360
213
|
}
|
|
361
|
-
),
|
|
362
|
-
const
|
|
363
|
-
return j(
|
|
364
|
-
})
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
function et(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
214
|
+
), Xe = B(function(r) {
|
|
215
|
+
const t = Qe(r);
|
|
216
|
+
return j(Je, t);
|
|
217
|
+
}), Ye = oe(
|
|
218
|
+
[Me, te],
|
|
219
|
+
[De, ee]
|
|
220
|
+
), Ze = Ye.useContext;
|
|
221
|
+
ie(!1);
|
|
222
|
+
ie(null);
|
|
223
|
+
function et(o = {}) {
|
|
224
|
+
var r = o, {
|
|
225
|
+
composite: t,
|
|
226
|
+
combobox: e
|
|
227
|
+
} = r, s = _e(r, [
|
|
228
|
+
"composite",
|
|
229
|
+
"combobox"
|
|
230
|
+
]);
|
|
231
|
+
const n = [
|
|
232
|
+
"items",
|
|
233
|
+
"renderedItems",
|
|
234
|
+
"moves",
|
|
235
|
+
"orientation",
|
|
236
|
+
"virtualFocus",
|
|
237
|
+
"includesBaseElement",
|
|
238
|
+
"baseElement",
|
|
239
|
+
"focusLoop",
|
|
240
|
+
"focusShift",
|
|
241
|
+
"focusWrap"
|
|
242
|
+
], m = ge(
|
|
243
|
+
s.store,
|
|
244
|
+
X(t, n),
|
|
245
|
+
X(e, n)
|
|
246
|
+
), i = m == null ? void 0 : m.getState(), d = Ve(D(k({}, s), {
|
|
247
|
+
store: m,
|
|
248
|
+
// We need to explicitly set the default value of `includesBaseElement` to
|
|
249
|
+
// `false` since we don't want the composite store to default it to `true`
|
|
250
|
+
// when the activeId state is null, which could be the case when rendering
|
|
251
|
+
// combobox with tab.
|
|
252
|
+
includesBaseElement: O(
|
|
253
|
+
s.includesBaseElement,
|
|
254
|
+
i == null ? void 0 : i.includesBaseElement,
|
|
255
|
+
!1
|
|
256
|
+
),
|
|
257
|
+
orientation: O(
|
|
258
|
+
s.orientation,
|
|
259
|
+
i == null ? void 0 : i.orientation,
|
|
260
|
+
"horizontal"
|
|
261
|
+
),
|
|
262
|
+
focusLoop: O(s.focusLoop, i == null ? void 0 : i.focusLoop, !0)
|
|
263
|
+
})), a = Fe(), _ = D(k({}, d.getState()), {
|
|
264
|
+
selectedId: O(
|
|
265
|
+
s.selectedId,
|
|
266
|
+
i == null ? void 0 : i.selectedId,
|
|
267
|
+
s.defaultSelectedId
|
|
268
|
+
),
|
|
269
|
+
selectOnMove: O(
|
|
270
|
+
s.selectOnMove,
|
|
271
|
+
i == null ? void 0 : i.selectOnMove,
|
|
272
|
+
!0
|
|
273
|
+
)
|
|
274
|
+
}), c = Ce(_, d, m);
|
|
275
|
+
z(
|
|
276
|
+
c,
|
|
277
|
+
() => w(c, ["moves"], () => {
|
|
278
|
+
const { activeId: u, selectOnMove: p } = c.getState();
|
|
279
|
+
if (!p || !u) return;
|
|
280
|
+
const I = d.item(u);
|
|
281
|
+
I && (I.dimmed || I.disabled || c.setState("selectedId", I.id));
|
|
282
|
+
})
|
|
283
|
+
);
|
|
284
|
+
let b = !0;
|
|
285
|
+
z(
|
|
286
|
+
c,
|
|
287
|
+
() => Pe(c, ["selectedId"], (u, p) => {
|
|
288
|
+
if (!b) {
|
|
289
|
+
b = !0;
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
t && u.selectedId === p.selectedId || c.setState("activeId", u.selectedId);
|
|
293
|
+
})
|
|
294
|
+
), z(
|
|
295
|
+
c,
|
|
296
|
+
() => w(c, ["selectedId", "renderedItems"], (u) => {
|
|
297
|
+
if (u.selectedId !== void 0) return;
|
|
298
|
+
const { activeId: p, renderedItems: I } = c.getState(), S = d.item(p);
|
|
299
|
+
if (S && !S.disabled && !S.dimmed)
|
|
300
|
+
c.setState("selectedId", S.id);
|
|
301
|
+
else {
|
|
302
|
+
const T = I.find(
|
|
303
|
+
(g) => !g.disabled && !g.dimmed
|
|
304
|
+
);
|
|
305
|
+
c.setState("selectedId", T == null ? void 0 : T.id);
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
), z(
|
|
309
|
+
c,
|
|
310
|
+
() => w(c, ["renderedItems"], (u) => {
|
|
311
|
+
const p = u.renderedItems;
|
|
312
|
+
if (p.length)
|
|
313
|
+
return w(a, ["renderedItems"], (I) => {
|
|
314
|
+
const S = I.renderedItems;
|
|
315
|
+
S.some((g) => !g.tabId) && S.forEach((g, y) => {
|
|
316
|
+
if (g.tabId) return;
|
|
317
|
+
const N = p[y];
|
|
318
|
+
N && a.renderItem(D(k({}, g), { tabId: N.id }));
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
})
|
|
322
|
+
);
|
|
323
|
+
let x = null;
|
|
324
|
+
return z(c, () => {
|
|
325
|
+
const u = () => {
|
|
326
|
+
x = c.getState().selectedId;
|
|
327
|
+
}, p = () => {
|
|
328
|
+
b = !1, c.setState("selectedId", x);
|
|
329
|
+
};
|
|
330
|
+
if (t && "setSelectElement" in t)
|
|
331
|
+
return J(
|
|
332
|
+
w(t, ["value"], u),
|
|
333
|
+
w(t, ["mounted"], p)
|
|
334
|
+
);
|
|
335
|
+
if (e)
|
|
336
|
+
return J(
|
|
337
|
+
w(e, ["selectedValue"], u),
|
|
338
|
+
w(e, ["mounted"], p)
|
|
339
|
+
);
|
|
340
|
+
}), D(k(k({}, d), c), {
|
|
341
|
+
panels: a,
|
|
342
|
+
setSelectedId: (u) => c.setState("selectedId", u),
|
|
343
|
+
select: (u) => {
|
|
344
|
+
c.setState("selectedId", u), d.move(u);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
function tt(o, r, t) {
|
|
349
|
+
Q(r, [t.composite, t.combobox]), o = Be(o, r, t), Y(o, t, "selectedId", "setSelectedId"), Y(o, t, "selectOnMove");
|
|
350
|
+
const [e, s] = re(() => o.panels, {});
|
|
351
|
+
return Q(s, [o, s]), Object.assign(
|
|
352
|
+
Te(() => h(v({}, o), { panels: e }), [o, e]),
|
|
353
|
+
{ composite: t.composite, combobox: t.combobox }
|
|
354
|
+
);
|
|
374
355
|
}
|
|
375
|
-
function
|
|
376
|
-
const
|
|
377
|
-
|
|
356
|
+
function Ot(o = {}) {
|
|
357
|
+
const r = ye(), t = Ze() || r;
|
|
358
|
+
o = h(v({}, o), {
|
|
359
|
+
composite: o.composite !== void 0 ? o.composite : t,
|
|
360
|
+
combobox: o.combobox !== void 0 ? o.combobox : r
|
|
361
|
+
});
|
|
362
|
+
const [e, s] = re(et, o);
|
|
363
|
+
return tt(e, s, o);
|
|
378
364
|
}
|
|
379
|
-
|
|
380
|
-
typeof
|
|
365
|
+
const me = (o) => {
|
|
366
|
+
if (!o || typeof window > "u") return 1;
|
|
367
|
+
const r = Number(window.getComputedStyle(o).scale);
|
|
368
|
+
return isNaN(r) ? me(o.parentElement) : r;
|
|
369
|
+
};
|
|
370
|
+
function ot(o, r) {
|
|
371
|
+
const [t, e] = q(null), s = ae.Children.map(r, (n) => n.props.id === o ? Ee(n, {
|
|
372
|
+
...n.props,
|
|
373
|
+
ref: $e(e, Ne(n))
|
|
374
|
+
}) : n);
|
|
375
|
+
return { activeTab: t, tabs: s };
|
|
381
376
|
}
|
|
382
|
-
const
|
|
383
|
-
root:
|
|
377
|
+
const st = "_root_102tt_2", nt = {
|
|
378
|
+
root: st
|
|
384
379
|
};
|
|
385
|
-
function
|
|
386
|
-
const [e,
|
|
387
|
-
return
|
|
388
|
-
const i =
|
|
389
|
-
if (!i || !
|
|
390
|
-
const d = i.getBoundingClientRect(), a =
|
|
391
|
-
if (
|
|
380
|
+
function rt({ activeTab: o, listRef: r, orientation: t }) {
|
|
381
|
+
const [e, s] = q({}), { height: n, width: m } = Oe();
|
|
382
|
+
return ke(() => {
|
|
383
|
+
const i = r.current;
|
|
384
|
+
if (!i || !o) return;
|
|
385
|
+
const d = i.getBoundingClientRect(), a = o.getBoundingClientRect(), _ = me(i);
|
|
386
|
+
if (t === "vertical") {
|
|
392
387
|
const c = a.top - d.top, b = a.height;
|
|
393
|
-
|
|
388
|
+
s({
|
|
394
389
|
offset: c,
|
|
395
|
-
orientation:
|
|
390
|
+
orientation: t,
|
|
396
391
|
size: b
|
|
397
392
|
});
|
|
398
393
|
} else {
|
|
399
394
|
const c = (a.left - d.left + i.scrollLeft) / _, b = a.width / _;
|
|
400
|
-
|
|
395
|
+
s({
|
|
401
396
|
offset: isNaN(c) ? 0 : c,
|
|
402
|
-
orientation:
|
|
397
|
+
orientation: t,
|
|
403
398
|
size: isNaN(b) ? 0 : b
|
|
404
399
|
});
|
|
405
400
|
}
|
|
406
|
-
}, [
|
|
401
|
+
}, [r, o, m, n, t]), e;
|
|
407
402
|
}
|
|
408
|
-
const
|
|
409
|
-
const e =
|
|
403
|
+
const at = M(nt), ct = ({ activeTab: o, listRef: r, orientation: t }) => {
|
|
404
|
+
const e = rt({ activeTab: o, listRef: r, orientation: t }), s = {
|
|
410
405
|
"--active-bar-offset": `${e.offset}px`,
|
|
411
406
|
"--active-bar-size": `${e.size}px`
|
|
412
407
|
};
|
|
413
|
-
return /* @__PURE__ */ P("span", { className:
|
|
414
|
-
},
|
|
415
|
-
root:
|
|
408
|
+
return /* @__PURE__ */ P("span", { className: at("root", `orientation-${t}`), style: s });
|
|
409
|
+
}, it = "_root_axn0q_2", lt = {
|
|
410
|
+
root: it,
|
|
416
411
|
"size-md": "_size-md_axn0q_18",
|
|
417
412
|
"size-sm": "_size-sm_axn0q_21"
|
|
418
|
-
},
|
|
419
|
-
({ children:
|
|
420
|
-
const m =
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
|
|
413
|
+
}, dt = M(lt), ut = le(
|
|
414
|
+
({ children: o, className: r, size: t = "md", store: e, ...s }, n) => {
|
|
415
|
+
const m = F(), [, i] = Le(n, m), { orientation: d, selectedId: a } = A(e), { activeTab: _, tabs: c } = ot(a, o), b = ae.Children.count(o) > 1;
|
|
416
|
+
return /* @__PURE__ */ fe(
|
|
417
|
+
Ue,
|
|
423
418
|
{
|
|
424
|
-
className:
|
|
419
|
+
className: dt("root", `size-${t}`, r),
|
|
425
420
|
ref: i,
|
|
426
421
|
store: e,
|
|
427
|
-
...
|
|
422
|
+
...s,
|
|
428
423
|
children: [
|
|
429
424
|
c,
|
|
430
|
-
b ? /* @__PURE__ */ P(
|
|
425
|
+
b ? /* @__PURE__ */ P(ct, { activeTab: _, listRef: m, orientation: d }) : null
|
|
431
426
|
]
|
|
432
427
|
}
|
|
433
428
|
);
|
|
434
429
|
}
|
|
435
|
-
),
|
|
436
|
-
root:
|
|
437
|
-
},
|
|
438
|
-
({ children:
|
|
439
|
-
),
|
|
440
|
-
root:
|
|
441
|
-
},
|
|
442
|
-
({ as:
|
|
443
|
-
|
|
430
|
+
), mt = "_root_1kepd_2", ft = {
|
|
431
|
+
root: mt
|
|
432
|
+
}, bt = M(ft), pt = le(
|
|
433
|
+
({ children: o, store: r, tabId: t, ...e }, s) => /* @__PURE__ */ P(Xe, { className: bt("root"), ref: s, store: r, tabId: t, ...e, children: o })
|
|
434
|
+
), vt = "_root_wlfaw_2", It = {
|
|
435
|
+
root: vt
|
|
436
|
+
}, St = M(It), xt = we(
|
|
437
|
+
({ as: o, children: r, className: t, id: e, store: s, ...n }, m) => /* @__PURE__ */ P(
|
|
438
|
+
Ke,
|
|
444
439
|
{
|
|
445
|
-
className:
|
|
440
|
+
className: St("root", t),
|
|
446
441
|
id: e,
|
|
447
442
|
ref: m,
|
|
448
|
-
render:
|
|
449
|
-
store:
|
|
450
|
-
...
|
|
451
|
-
children:
|
|
443
|
+
render: o ? /* @__PURE__ */ P(o, {}) : void 0,
|
|
444
|
+
store: s,
|
|
445
|
+
...n,
|
|
446
|
+
children: r
|
|
452
447
|
}
|
|
453
448
|
)
|
|
454
|
-
),
|
|
449
|
+
), kt = Object.assign(xt, { List: ut, Panel: pt });
|
|
455
450
|
export {
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
451
|
+
kt as Tab,
|
|
452
|
+
xt as TabComponent,
|
|
453
|
+
Ot as useTab
|
|
459
454
|
};
|