welcome-ui 10.0.0-alpha.11 → 10.0.0-alpha.12
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/Alert.css +1 -1
- package/dist/Alert.js +62 -62
- package/dist/Icon.js +212 -211
- package/dist/Select.js +350 -332
- package/dist/Swiper.js +201 -191
- package/dist/Tabs.css +1 -1
- package/dist/Tabs.js +320 -319
- package/dist/types/components/Icon/icons.d.ts +2 -2
- package/dist/types/components/Select/types.d.ts +1 -0
- package/dist/types/components/Tabs/Tab.d.ts +2 -0
- package/dist/types/components/Tabs/{components/TabPanel/index.d.ts → TabPanel.d.ts} +1 -1
- package/dist/types/components/Tabs/index.d.ts +6 -5
- package/dist/types/components/Tabs/types.d.ts +6 -12
- package/dist/types/components/Tabs/utils.d.ts +4 -7
- package/package.json +1 -1
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +0 -5
- package/dist/types/components/Tabs/components/TabList/index.d.ts +0 -3
- package/dist/use-viewport-CgrficYB.js +0 -17
- package/dist/useForkRef-D807AV7D.js +0 -22
package/dist/Tabs.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './Tabs.css';
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { C as
|
|
5
|
-
import { e as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { c as
|
|
9
|
-
import { f as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
14
|
-
import { P as
|
|
15
|
-
import { c as
|
|
16
|
-
var
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
),
|
|
20
|
-
var t =
|
|
3
|
+
import { jsx as T, jsxs as pe } from "react/jsx-runtime";
|
|
4
|
+
import { C as X, a as Y, h as A, b as fe, j as ve } from "./SBSPVDDI-CmtnvvUX.js";
|
|
5
|
+
import { e as ee, y as Ie, f as F, c as W, b as j, _ as B, i as H, l as te, F as ge, d as S, a as f, u as $, k as oe, af as xe, v as Se, Z as Pe, M as Ce, A as M, z as O, B as V, V as U, C as Z } from "./OE2EFRVA-Dg1R6gaC.js";
|
|
6
|
+
import { u as Te, b as _e } from "./OLVWQA7U-Dia3UUnG.js";
|
|
7
|
+
import he, { useCallback as ne, useRef as q, useEffect as G, useState as ke, createContext as re, useMemo as ye, forwardRef as se, cloneElement as Ee, isValidElement as we } from "react";
|
|
8
|
+
import { c as ae } from "./index-PAaZGbyz.js";
|
|
9
|
+
import { b as D, m as Ne, o as J, c as Re, s as z, d as y, f as Le, u as ce, a as Q } from "./RTNCFSKZ-BywELldk.js";
|
|
10
|
+
import { Badge as Oe } from "./Badge.js";
|
|
11
|
+
import { f as Ve } from "./forwardRefWithAs-8eP3ZN15.js";
|
|
12
|
+
import { Icon as ze } from "./Icon.js";
|
|
13
|
+
import { u as De, d as Me } from "./T22PY7TE-gLuJpoOm.js";
|
|
14
|
+
import { P as $e, b as Fe } from "./Y67KZUMI-BwLWwpNF.js";
|
|
15
|
+
import { c as We, a as je, u as Be } from "./B7UTNDHN-BghjolIs.js";
|
|
16
|
+
var K = ee(
|
|
17
|
+
[Y],
|
|
18
|
+
[X]
|
|
19
|
+
), He = K.useScopedContext, ie = K.useProviderContext, le = K.ScopedContextProvider, Ke = "button", Ae = W(function(s) {
|
|
20
|
+
var t = s, {
|
|
21
21
|
store: e,
|
|
22
|
-
getItem:
|
|
23
|
-
} = t,
|
|
22
|
+
getItem: n
|
|
23
|
+
} = t, a = B(t, [
|
|
24
24
|
"store",
|
|
25
25
|
"getItem"
|
|
26
|
-
]),
|
|
27
|
-
const
|
|
28
|
-
e = e ||
|
|
26
|
+
]), b;
|
|
27
|
+
const c = He();
|
|
28
|
+
e = e || c, H(
|
|
29
29
|
e,
|
|
30
30
|
process.env.NODE_ENV !== "production" && "Tab must be wrapped in a TabList component."
|
|
31
31
|
);
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
const
|
|
35
|
-
return
|
|
32
|
+
const u = te(), r = a.id || u, _ = ge(a), i = ne(
|
|
33
|
+
(m) => {
|
|
34
|
+
const E = S(f({}, m), { dimmed: _ });
|
|
35
|
+
return n ? n(E) : E;
|
|
36
36
|
},
|
|
37
|
-
[
|
|
38
|
-
),
|
|
39
|
-
|
|
40
|
-
}),
|
|
41
|
-
(
|
|
42
|
-
var
|
|
43
|
-
return (
|
|
37
|
+
[_, n]
|
|
38
|
+
), v = a.onClick, I = $((m) => {
|
|
39
|
+
v == null || v(m), !m.defaultPrevented && (e == null || e.setSelectedId(r));
|
|
40
|
+
}), d = e.panels.useState(
|
|
41
|
+
(m) => {
|
|
42
|
+
var E;
|
|
43
|
+
return (E = m.items.find((l) => l.tabId === r)) == null ? void 0 : E.id;
|
|
44
44
|
}
|
|
45
|
-
), p =
|
|
46
|
-
if (
|
|
45
|
+
), p = u ? a.shouldRegisterItem : !1, g = e.useState((m) => !!r && m.activeId === r), x = e.useState((m) => !!r && m.selectedId === r), h = e.useState((m) => !!e.item(m.activeId)), P = g || x && !h, w = x || ((b = a.accessibleWhenDisabled) != null ? b : !0);
|
|
46
|
+
if (D(
|
|
47
47
|
e.combobox || e.composite,
|
|
48
48
|
"virtualFocus"
|
|
49
|
-
) && (
|
|
49
|
+
) && (a = S(f({}, a), {
|
|
50
50
|
tabIndex: -1
|
|
51
|
-
})),
|
|
52
|
-
id:
|
|
51
|
+
})), a = S(f({
|
|
52
|
+
id: r,
|
|
53
53
|
role: "tab",
|
|
54
|
-
"aria-selected":
|
|
55
|
-
"aria-controls":
|
|
56
|
-
},
|
|
57
|
-
onClick:
|
|
54
|
+
"aria-selected": x,
|
|
55
|
+
"aria-controls": d || void 0
|
|
56
|
+
}, a), {
|
|
57
|
+
onClick: I
|
|
58
58
|
}), e.composite) {
|
|
59
|
-
const
|
|
60
|
-
id:
|
|
59
|
+
const m = {
|
|
60
|
+
id: r,
|
|
61
61
|
accessibleWhenDisabled: w,
|
|
62
62
|
store: e.composite,
|
|
63
|
-
shouldRegisterItem:
|
|
64
|
-
rowId:
|
|
65
|
-
render:
|
|
63
|
+
shouldRegisterItem: P && p,
|
|
64
|
+
rowId: a.rowId,
|
|
65
|
+
render: a.render
|
|
66
66
|
};
|
|
67
|
-
|
|
68
|
-
render: /* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
render: e.combobox && e.composite !== e.combobox ? /* @__PURE__ */
|
|
67
|
+
a = S(f({}, a), {
|
|
68
|
+
render: /* @__PURE__ */ T(
|
|
69
|
+
A,
|
|
70
|
+
S(f({}, m), {
|
|
71
|
+
render: e.combobox && e.composite !== e.combobox ? /* @__PURE__ */ T(A, S(f({}, m), { store: e.combobox })) : m.render
|
|
72
72
|
})
|
|
73
73
|
)
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return a = fe(S(f({
|
|
77
77
|
store: e
|
|
78
|
-
},
|
|
78
|
+
}, a), {
|
|
79
79
|
accessibleWhenDisabled: w,
|
|
80
|
-
getItem:
|
|
80
|
+
getItem: i,
|
|
81
81
|
shouldRegisterItem: p
|
|
82
|
-
})),
|
|
83
|
-
}),
|
|
84
|
-
F(function(
|
|
85
|
-
const t =
|
|
86
|
-
return j(
|
|
82
|
+
})), a;
|
|
83
|
+
}), Ue = Ie(
|
|
84
|
+
F(function(s) {
|
|
85
|
+
const t = Ae(s);
|
|
86
|
+
return j(Ke, t);
|
|
87
87
|
})
|
|
88
|
-
),
|
|
89
|
-
function(
|
|
90
|
-
var t =
|
|
91
|
-
const
|
|
92
|
-
e = e ||
|
|
88
|
+
), Ze = "div", qe = W(
|
|
89
|
+
function(s) {
|
|
90
|
+
var t = s, { store: e } = t, n = B(t, ["store"]);
|
|
91
|
+
const a = ie();
|
|
92
|
+
e = e || a, H(
|
|
93
93
|
e,
|
|
94
94
|
process.env.NODE_ENV !== "production" && "TabList must receive a `store` prop or be wrapped in a TabProvider component."
|
|
95
95
|
);
|
|
96
|
-
const
|
|
97
|
-
(
|
|
96
|
+
const b = e.useState(
|
|
97
|
+
(c) => c.orientation === "both" ? void 0 : c.orientation
|
|
98
98
|
);
|
|
99
|
-
return
|
|
100
|
-
|
|
101
|
-
(
|
|
99
|
+
return n = oe(
|
|
100
|
+
n,
|
|
101
|
+
(c) => /* @__PURE__ */ T(le, { value: e, children: c }),
|
|
102
102
|
[e]
|
|
103
|
-
), e.composite && (
|
|
103
|
+
), e.composite && (n = f({
|
|
104
104
|
focusable: !1
|
|
105
|
-
},
|
|
105
|
+
}, n)), n = f({
|
|
106
106
|
role: "tablist",
|
|
107
|
-
"aria-orientation":
|
|
108
|
-
},
|
|
107
|
+
"aria-orientation": b
|
|
108
|
+
}, n), n = Te(f({ store: e }, n)), n;
|
|
109
109
|
}
|
|
110
|
-
),
|
|
111
|
-
const t =
|
|
112
|
-
return j(
|
|
113
|
-
}),
|
|
114
|
-
function(
|
|
115
|
-
var t =
|
|
110
|
+
), Ge = F(function(s) {
|
|
111
|
+
const t = qe(s);
|
|
112
|
+
return j(Ze, t);
|
|
113
|
+
}), Je = "div", Qe = W(
|
|
114
|
+
function(s) {
|
|
115
|
+
var t = s, {
|
|
116
116
|
store: e,
|
|
117
|
-
unmountOnHide:
|
|
118
|
-
tabId:
|
|
119
|
-
getItem:
|
|
120
|
-
scrollRestoration:
|
|
121
|
-
scrollElement:
|
|
122
|
-
} = t,
|
|
117
|
+
unmountOnHide: n,
|
|
118
|
+
tabId: a,
|
|
119
|
+
getItem: b,
|
|
120
|
+
scrollRestoration: c,
|
|
121
|
+
scrollElement: u
|
|
122
|
+
} = t, r = B(t, [
|
|
123
123
|
"store",
|
|
124
124
|
"unmountOnHide",
|
|
125
125
|
"tabId",
|
|
@@ -127,109 +127,109 @@ var Z = oe(
|
|
|
127
127
|
"scrollRestoration",
|
|
128
128
|
"scrollElement"
|
|
129
129
|
]);
|
|
130
|
-
const
|
|
131
|
-
e = e ||
|
|
130
|
+
const _ = ie();
|
|
131
|
+
e = e || _, H(
|
|
132
132
|
e,
|
|
133
133
|
process.env.NODE_ENV !== "production" && "TabPanel must receive a `store` prop or be wrapped in a TabProvider component."
|
|
134
134
|
);
|
|
135
|
-
const
|
|
135
|
+
const i = q(null), v = te(r.id), I = D(
|
|
136
136
|
e.panels,
|
|
137
137
|
() => {
|
|
138
138
|
var l;
|
|
139
|
-
return
|
|
139
|
+
return a || ((l = e == null ? void 0 : e.panels.item(v)) == null ? void 0 : l.tabId);
|
|
140
140
|
}
|
|
141
|
-
),
|
|
141
|
+
), d = D(
|
|
142
142
|
e,
|
|
143
|
-
(l) => !!
|
|
144
|
-
), p =
|
|
143
|
+
(l) => !!I && l.selectedId === I
|
|
144
|
+
), p = De({ open: d }), g = D(p, "mounted"), x = q(
|
|
145
145
|
/* @__PURE__ */ new Map()
|
|
146
|
-
),
|
|
147
|
-
const l =
|
|
148
|
-
return l ?
|
|
146
|
+
), h = $(() => {
|
|
147
|
+
const l = i.current;
|
|
148
|
+
return l ? u ? typeof u == "function" ? u(l) : "current" in u ? u.current : u : l : null;
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
var l,
|
|
152
|
-
if (!
|
|
153
|
-
const
|
|
154
|
-
if (!
|
|
155
|
-
if (
|
|
156
|
-
|
|
150
|
+
G(() => {
|
|
151
|
+
var l, k;
|
|
152
|
+
if (!c || !g) return;
|
|
153
|
+
const C = h();
|
|
154
|
+
if (!C) return;
|
|
155
|
+
if (c === "reset") {
|
|
156
|
+
C.scroll(0, 0);
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
if (!
|
|
160
|
-
const
|
|
161
|
-
|
|
159
|
+
if (!I) return;
|
|
160
|
+
const N = x.current.get(I);
|
|
161
|
+
C.scroll((l = N == null ? void 0 : N.x) != null ? l : 0, (k = N == null ? void 0 : N.y) != null ? k : 0);
|
|
162
162
|
const L = () => {
|
|
163
|
-
|
|
164
|
-
x:
|
|
165
|
-
y:
|
|
163
|
+
x.current.set(I, {
|
|
164
|
+
x: C.scrollLeft,
|
|
165
|
+
y: C.scrollTop
|
|
166
166
|
});
|
|
167
167
|
};
|
|
168
|
-
return
|
|
169
|
-
|
|
168
|
+
return C.addEventListener("scroll", L), () => {
|
|
169
|
+
C.removeEventListener("scroll", L);
|
|
170
170
|
};
|
|
171
|
-
}, [
|
|
172
|
-
const [
|
|
173
|
-
|
|
174
|
-
const l =
|
|
171
|
+
}, [c, g, I, h, e]);
|
|
172
|
+
const [P, w] = ke(!1);
|
|
173
|
+
G(() => {
|
|
174
|
+
const l = i.current;
|
|
175
175
|
if (!l) return;
|
|
176
|
-
const
|
|
177
|
-
w(!!
|
|
176
|
+
const k = xe(l);
|
|
177
|
+
w(!!k.length);
|
|
178
178
|
}, []);
|
|
179
|
-
const
|
|
179
|
+
const R = ne(
|
|
180
180
|
(l) => {
|
|
181
|
-
const
|
|
182
|
-
return
|
|
181
|
+
const k = S(f({}, l), { id: v || l.id, tabId: a });
|
|
182
|
+
return b ? b(k) : k;
|
|
183
183
|
},
|
|
184
|
-
[
|
|
185
|
-
),
|
|
186
|
-
if (
|
|
187
|
-
const
|
|
184
|
+
[v, a, b]
|
|
185
|
+
), m = r.onKeyDown, E = $((l) => {
|
|
186
|
+
if (m == null || m(l), l.defaultPrevented || !(e != null && e.composite)) return;
|
|
187
|
+
const C = {
|
|
188
188
|
ArrowLeft: e.previous,
|
|
189
189
|
ArrowRight: e.next,
|
|
190
190
|
Home: e.first,
|
|
191
191
|
End: e.last
|
|
192
192
|
}[l.key];
|
|
193
|
-
if (!
|
|
194
|
-
const { selectedId:
|
|
193
|
+
if (!C) return;
|
|
194
|
+
const { selectedId: N } = e.getState(), L = C({ activeId: N });
|
|
195
195
|
L && (l.preventDefault(), e.move(L));
|
|
196
196
|
});
|
|
197
|
-
return
|
|
198
|
-
|
|
199
|
-
(l) => /* @__PURE__ */
|
|
197
|
+
return r = oe(
|
|
198
|
+
r,
|
|
199
|
+
(l) => /* @__PURE__ */ T(le, { value: e, children: l }),
|
|
200
200
|
[e]
|
|
201
|
-
),
|
|
202
|
-
id:
|
|
201
|
+
), r = S(f({
|
|
202
|
+
id: v,
|
|
203
203
|
role: "tabpanel",
|
|
204
|
-
"aria-labelledby":
|
|
205
|
-
},
|
|
206
|
-
children:
|
|
207
|
-
ref:
|
|
208
|
-
onKeyDown:
|
|
209
|
-
}),
|
|
204
|
+
"aria-labelledby": I || void 0
|
|
205
|
+
}, r), {
|
|
206
|
+
children: n && !g ? null : r.children,
|
|
207
|
+
ref: Se(i, r.ref),
|
|
208
|
+
onKeyDown: E
|
|
209
|
+
}), r = Pe(f({
|
|
210
210
|
// If the tab panel is rendered as part of another composite widget such
|
|
211
211
|
// as combobox, it should not be focusable.
|
|
212
|
-
focusable: !e.composite && !
|
|
213
|
-
},
|
|
212
|
+
focusable: !e.composite && !P
|
|
213
|
+
}, r)), r = Me(f({ store: p }, r)), r = ve(S(f({ store: e.panels }, r), { getItem: R })), r;
|
|
214
214
|
}
|
|
215
|
-
),
|
|
216
|
-
const t =
|
|
217
|
-
return j(
|
|
218
|
-
}),
|
|
219
|
-
[
|
|
220
|
-
[
|
|
221
|
-
),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
function
|
|
225
|
-
var
|
|
215
|
+
), Xe = F(function(s) {
|
|
216
|
+
const t = Qe(s);
|
|
217
|
+
return j(Je, t);
|
|
218
|
+
}), Ye = ee(
|
|
219
|
+
[Fe, Y],
|
|
220
|
+
[$e, X]
|
|
221
|
+
), et = Ye.useContext;
|
|
222
|
+
re(!1);
|
|
223
|
+
re(null);
|
|
224
|
+
function tt(o = {}) {
|
|
225
|
+
var s = o, {
|
|
226
226
|
composite: t,
|
|
227
227
|
combobox: e
|
|
228
|
-
} =
|
|
228
|
+
} = s, n = Ce(s, [
|
|
229
229
|
"composite",
|
|
230
230
|
"combobox"
|
|
231
231
|
]);
|
|
232
|
-
const
|
|
232
|
+
const a = [
|
|
233
233
|
"items",
|
|
234
234
|
"renderedItems",
|
|
235
235
|
"moves",
|
|
@@ -240,224 +240,225 @@ function nt(o = {}) {
|
|
|
240
240
|
"focusLoop",
|
|
241
241
|
"focusShift",
|
|
242
242
|
"focusWrap"
|
|
243
|
-
],
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
),
|
|
248
|
-
store:
|
|
243
|
+
], b = Ne(
|
|
244
|
+
n.store,
|
|
245
|
+
J(t, a),
|
|
246
|
+
J(e, a)
|
|
247
|
+
), c = b == null ? void 0 : b.getState(), u = We(M(V({}, n), {
|
|
248
|
+
store: b,
|
|
249
249
|
// We need to explicitly set the default value of `includesBaseElement` to
|
|
250
250
|
// `false` since we don't want the composite store to default it to `true`
|
|
251
251
|
// when the activeId state is null, which could be the case when rendering
|
|
252
252
|
// combobox with tab.
|
|
253
|
-
includesBaseElement:
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
includesBaseElement: O(
|
|
254
|
+
n.includesBaseElement,
|
|
255
|
+
c == null ? void 0 : c.includesBaseElement,
|
|
256
256
|
!1
|
|
257
257
|
),
|
|
258
|
-
orientation:
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
orientation: O(
|
|
259
|
+
n.orientation,
|
|
260
|
+
c == null ? void 0 : c.orientation,
|
|
261
261
|
"horizontal"
|
|
262
262
|
),
|
|
263
|
-
focusLoop:
|
|
264
|
-
})),
|
|
265
|
-
selectedId:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
263
|
+
focusLoop: O(n.focusLoop, c == null ? void 0 : c.focusLoop, !0)
|
|
264
|
+
})), r = je(), _ = M(V({}, u.getState()), {
|
|
265
|
+
selectedId: O(
|
|
266
|
+
n.selectedId,
|
|
267
|
+
c == null ? void 0 : c.selectedId,
|
|
268
|
+
n.defaultSelectedId
|
|
269
269
|
),
|
|
270
|
-
selectOnMove:
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
selectOnMove: O(
|
|
271
|
+
n.selectOnMove,
|
|
272
|
+
c == null ? void 0 : c.selectOnMove,
|
|
273
273
|
!0
|
|
274
274
|
)
|
|
275
|
-
}),
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
() => y(
|
|
279
|
-
const { activeId:
|
|
280
|
-
if (!p || !
|
|
281
|
-
const
|
|
282
|
-
|
|
275
|
+
}), i = Re(_, u, b);
|
|
276
|
+
z(
|
|
277
|
+
i,
|
|
278
|
+
() => y(i, ["moves"], () => {
|
|
279
|
+
const { activeId: d, selectOnMove: p } = i.getState();
|
|
280
|
+
if (!p || !d) return;
|
|
281
|
+
const g = u.item(d);
|
|
282
|
+
g && (g.dimmed || g.disabled || i.setState("selectedId", g.id));
|
|
283
283
|
})
|
|
284
284
|
);
|
|
285
|
-
let
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
() =>
|
|
289
|
-
if (!
|
|
290
|
-
|
|
285
|
+
let v = !0;
|
|
286
|
+
z(
|
|
287
|
+
i,
|
|
288
|
+
() => Le(i, ["selectedId"], (d, p) => {
|
|
289
|
+
if (!v) {
|
|
290
|
+
v = !0;
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
t &&
|
|
293
|
+
t && d.selectedId === p.selectedId || i.setState("activeId", d.selectedId);
|
|
294
294
|
})
|
|
295
|
-
),
|
|
296
|
-
|
|
297
|
-
() => y(
|
|
298
|
-
if (
|
|
299
|
-
const { activeId: p, renderedItems:
|
|
300
|
-
if (
|
|
301
|
-
|
|
295
|
+
), z(
|
|
296
|
+
i,
|
|
297
|
+
() => y(i, ["selectedId", "renderedItems"], (d) => {
|
|
298
|
+
if (d.selectedId !== void 0) return;
|
|
299
|
+
const { activeId: p, renderedItems: g } = i.getState(), x = u.item(p);
|
|
300
|
+
if (x && !x.disabled && !x.dimmed)
|
|
301
|
+
i.setState("selectedId", x.id);
|
|
302
302
|
else {
|
|
303
|
-
const
|
|
304
|
-
(
|
|
303
|
+
const h = g.find(
|
|
304
|
+
(P) => !P.disabled && !P.dimmed
|
|
305
305
|
);
|
|
306
|
-
|
|
306
|
+
i.setState("selectedId", h == null ? void 0 : h.id);
|
|
307
307
|
}
|
|
308
308
|
})
|
|
309
|
-
),
|
|
310
|
-
|
|
311
|
-
() => y(
|
|
312
|
-
const p =
|
|
309
|
+
), z(
|
|
310
|
+
i,
|
|
311
|
+
() => y(i, ["renderedItems"], (d) => {
|
|
312
|
+
const p = d.renderedItems;
|
|
313
313
|
if (p.length)
|
|
314
|
-
return y(
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
if (
|
|
318
|
-
const
|
|
319
|
-
|
|
314
|
+
return y(r, ["renderedItems"], (g) => {
|
|
315
|
+
const x = g.renderedItems;
|
|
316
|
+
x.some((P) => !P.tabId) && x.forEach((P, w) => {
|
|
317
|
+
if (P.tabId) return;
|
|
318
|
+
const R = p[w];
|
|
319
|
+
R && r.renderItem(M(V({}, P), { tabId: R.id }));
|
|
320
320
|
});
|
|
321
321
|
});
|
|
322
322
|
})
|
|
323
323
|
);
|
|
324
|
-
let
|
|
325
|
-
return
|
|
326
|
-
const
|
|
327
|
-
|
|
324
|
+
let I = null;
|
|
325
|
+
return z(i, () => {
|
|
326
|
+
const d = () => {
|
|
327
|
+
I = i.getState().selectedId;
|
|
328
328
|
}, p = () => {
|
|
329
|
-
|
|
329
|
+
v = !1, i.setState("selectedId", I);
|
|
330
330
|
};
|
|
331
331
|
if (t && "setSelectElement" in t)
|
|
332
|
-
return
|
|
333
|
-
y(t, ["value"],
|
|
332
|
+
return U(
|
|
333
|
+
y(t, ["value"], d),
|
|
334
334
|
y(t, ["mounted"], p)
|
|
335
335
|
);
|
|
336
336
|
if (e)
|
|
337
|
-
return
|
|
338
|
-
y(e, ["selectedValue"],
|
|
337
|
+
return U(
|
|
338
|
+
y(e, ["selectedValue"], d),
|
|
339
339
|
y(e, ["mounted"], p)
|
|
340
340
|
);
|
|
341
|
-
}),
|
|
342
|
-
panels:
|
|
343
|
-
setSelectedId: (
|
|
344
|
-
select: (
|
|
345
|
-
|
|
341
|
+
}), M(V(V({}, u), i), {
|
|
342
|
+
panels: r,
|
|
343
|
+
setSelectedId: (d) => i.setState("selectedId", d),
|
|
344
|
+
select: (d) => {
|
|
345
|
+
i.setState("selectedId", d), u.move(d);
|
|
346
346
|
}
|
|
347
347
|
});
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
|
|
351
|
-
const [e,
|
|
352
|
-
return
|
|
353
|
-
|
|
349
|
+
function ot(o, s, t) {
|
|
350
|
+
Z(s, [t.composite, t.combobox]), o = Be(o, s, t), Q(o, t, "selectedId", "setSelectedId"), Q(o, t, "selectOnMove");
|
|
351
|
+
const [e, n] = ce(() => o.panels, {});
|
|
352
|
+
return Z(n, [o, n]), Object.assign(
|
|
353
|
+
ye(() => S(f({}, o), { panels: e }), [o, e]),
|
|
354
354
|
{ composite: t.composite, combobox: t.combobox }
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
const
|
|
359
|
-
o =
|
|
357
|
+
function St(o = {}) {
|
|
358
|
+
const s = _e(), t = et() || s;
|
|
359
|
+
o = S(f({}, o), {
|
|
360
360
|
composite: o.composite !== void 0 ? o.composite : t,
|
|
361
|
-
combobox: o.combobox !== void 0 ? o.combobox :
|
|
361
|
+
combobox: o.combobox !== void 0 ? o.combobox : s
|
|
362
362
|
});
|
|
363
|
-
const [e,
|
|
364
|
-
return
|
|
365
|
-
}
|
|
366
|
-
const me = (o) => {
|
|
367
|
-
if (!o || typeof window > "u") return 1;
|
|
368
|
-
const r = Number(window.getComputedStyle(o).scale);
|
|
369
|
-
return isNaN(r) ? me(o.parentElement) : r;
|
|
370
|
-
};
|
|
371
|
-
function at(o, r) {
|
|
372
|
-
const [t, e] = U(null), s = ae.Children.map(r, (n) => n.props.id === o ? Re(n, {
|
|
373
|
-
...n.props,
|
|
374
|
-
ref: Oe(e, Be(n))
|
|
375
|
-
}) : n);
|
|
376
|
-
return { activeTab: t, tabs: s };
|
|
363
|
+
const [e, n] = ce(tt, o);
|
|
364
|
+
return ot(e, n, o);
|
|
377
365
|
}
|
|
378
|
-
const
|
|
379
|
-
root:
|
|
366
|
+
const nt = "_root_nt8z5_2", de = {
|
|
367
|
+
root: nt,
|
|
368
|
+
"size-lg": "_size-lg_nt8z5_55",
|
|
369
|
+
"size-md": "_size-md_nt8z5_62",
|
|
370
|
+
"tab-list": "_tab-list_nt8z5_72"
|
|
380
371
|
};
|
|
381
|
-
function
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
372
|
+
function rt({
|
|
373
|
+
icon: o,
|
|
374
|
+
iconColor: s,
|
|
375
|
+
isActive: t
|
|
376
|
+
}) {
|
|
377
|
+
if (!o) return null;
|
|
378
|
+
if (typeof o != "string") return o;
|
|
379
|
+
const e = (() => {
|
|
380
|
+
switch (s) {
|
|
381
|
+
case "blue":
|
|
382
|
+
return t ? "text-background-accent-blue-strong" : "text-background-accent-blue-primary";
|
|
383
|
+
case "green":
|
|
384
|
+
return t ? "text-background-accent-green-strong" : "text-background-accent-green-primary";
|
|
385
|
+
case "orange":
|
|
386
|
+
return t ? "text-background-accent-orange-strong" : "text-background-accent-orange-primary";
|
|
387
|
+
case "pink":
|
|
388
|
+
return t ? "text-background-accent-pink-strong" : "text-background-accent-pink-primary";
|
|
389
|
+
case "teal":
|
|
390
|
+
return t ? "text-background-accent-teal-strong" : "text-background-accent-teal-primary";
|
|
391
|
+
case "violet":
|
|
392
|
+
return t ? "text-background-accent-violet-strong" : "text-background-accent-violet-primary";
|
|
393
|
+
case "warm":
|
|
394
|
+
return t ? "text-background-accent-warm-strong" : "text-background-accent-warm-primary";
|
|
395
|
+
default:
|
|
396
|
+
return "";
|
|
401
397
|
}
|
|
402
|
-
}
|
|
398
|
+
})();
|
|
399
|
+
return /* @__PURE__ */ T(ze, { className: e, name: o });
|
|
403
400
|
}
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
401
|
+
const st = ae(de), ue = Ve(
|
|
402
|
+
({
|
|
403
|
+
as: o,
|
|
404
|
+
badge: s,
|
|
405
|
+
children: t,
|
|
406
|
+
className: e,
|
|
407
|
+
icon: n,
|
|
408
|
+
iconColor: a = "violet",
|
|
409
|
+
id: b,
|
|
410
|
+
size: c = "lg",
|
|
411
|
+
store: u,
|
|
412
|
+
...r
|
|
413
|
+
}, _) => {
|
|
414
|
+
const { selectedId: i } = D(u), v = i === b, I = rt({
|
|
415
|
+
icon: n,
|
|
416
|
+
iconColor: a,
|
|
417
|
+
isActive: v
|
|
418
|
+
}), d = v ? "neutral" : "warm";
|
|
419
|
+
return /* @__PURE__ */ pe(
|
|
420
|
+
Ue,
|
|
421
421
|
{
|
|
422
|
-
className:
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
422
|
+
className: st("root", `size-${c}`, e),
|
|
423
|
+
id: b,
|
|
424
|
+
ref: _,
|
|
425
|
+
render: o ? /* @__PURE__ */ T(o, {}) : void 0,
|
|
426
|
+
store: u,
|
|
427
|
+
...r,
|
|
426
428
|
children: [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
+
I,
|
|
430
|
+
t,
|
|
431
|
+
s ? /* @__PURE__ */ T(Oe, { size: c, variant: d, children: s }) : null
|
|
429
432
|
]
|
|
430
433
|
}
|
|
431
434
|
);
|
|
432
435
|
}
|
|
433
436
|
);
|
|
434
|
-
|
|
435
|
-
const
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
({ children: o,
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
)
|
|
437
|
+
ue.displayName = "Tabs.Tab";
|
|
438
|
+
const me = se(({ children: o, ...s }, t) => /* @__PURE__ */ T(Xe, { ref: t, ...s, children: o }));
|
|
439
|
+
me.displayName = "Tabs.Panel";
|
|
440
|
+
const at = ae(de), be = se(
|
|
441
|
+
({ children: o, className: s, size: t = "lg", store: e, ...n }, a) => {
|
|
442
|
+
const b = he.Children.map(
|
|
443
|
+
o,
|
|
444
|
+
(c) => we(c) ? Ee(c, { size: t }) : c
|
|
445
|
+
);
|
|
446
|
+
return /* @__PURE__ */ T(
|
|
447
|
+
Ge,
|
|
448
|
+
{
|
|
449
|
+
className: at("tab-list", `size-${t}`, s),
|
|
450
|
+
ref: a,
|
|
451
|
+
store: e,
|
|
452
|
+
...n,
|
|
453
|
+
children: b
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
}
|
|
456
457
|
);
|
|
457
|
-
|
|
458
|
-
const
|
|
458
|
+
be.displayName = "Tabs";
|
|
459
|
+
const Pt = Object.assign(be, { Panel: me, Tab: ue });
|
|
459
460
|
export {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
461
|
+
Pt as Tabs,
|
|
462
|
+
be as TabsComponent,
|
|
463
|
+
St as useTab
|
|
463
464
|
};
|