@purpurds/tabs 7.1.0 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +1 -1
- package/dist/styles.css +1 -1
- package/dist/tab-content.d.ts +5 -3
- package/dist/tab-content.d.ts.map +1 -1
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.cjs.js.map +1 -1
- package/dist/tabs.es.js +218 -218
- package/dist/tabs.es.js.map +1 -1
- package/package.json +7 -7
- package/src/tab-content.tsx +5 -3
- package/src/tab-header.module.scss +2 -0
- package/src/tabs.module.scss +1 -0
- package/src/tabs.stories.tsx +64 -0
package/dist/tabs.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as m, Fragment as
|
|
1
|
+
import { jsx as m, Fragment as qe, jsxs as J } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import
|
|
3
|
+
import O, { forwardRef as we, isValidElement as Ye, useRef as Q, useState as B, Children as z, useEffect as K } from "react";
|
|
4
4
|
import "react-dom";
|
|
5
5
|
function Ze(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
@@ -53,7 +53,7 @@ const Je = /* @__PURE__ */ Ze(Xe), Qe = {
|
|
|
53
53
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
54
54
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
55
55
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
56
|
-
}, et = Je.bind(Qe),
|
|
56
|
+
}, et = Je.bind(Qe), _e = "purpur-icon", tt = "md", nt = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), rt = ({ content: e = "", title: t } = {}) => {
|
|
57
57
|
const n = [
|
|
58
58
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
59
59
|
{ name: "fill", value: "currentColor" },
|
|
@@ -61,7 +61,7 @@ const Je = /* @__PURE__ */ Ze(Xe), Qe = {
|
|
|
61
61
|
t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
62
62
|
], o = t ? `<title>${t}</title>` : "";
|
|
63
63
|
return `<svg ${nt(n)}>${o}${e}</svg>`;
|
|
64
|
-
}, ot = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(),
|
|
64
|
+
}, ot = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), Ce = ({
|
|
65
65
|
["data-testid"]: e,
|
|
66
66
|
svg: t,
|
|
67
67
|
allyTitle: n,
|
|
@@ -72,7 +72,7 @@ const Je = /* @__PURE__ */ Ze(Xe), Qe = {
|
|
|
72
72
|
const i = rt({
|
|
73
73
|
content: ot(t.svg),
|
|
74
74
|
title: n
|
|
75
|
-
}), c = et(o,
|
|
75
|
+
}), c = et(o, _e, `${_e}--${s}`);
|
|
76
76
|
return /* @__PURE__ */ m(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
@@ -83,7 +83,7 @@ const Je = /* @__PURE__ */ Ze(Xe), Qe = {
|
|
|
83
83
|
}
|
|
84
84
|
);
|
|
85
85
|
};
|
|
86
|
-
|
|
86
|
+
Ce.displayName = "Icon";
|
|
87
87
|
const st = {
|
|
88
88
|
name: "chevron-left",
|
|
89
89
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M16.175 3.905a.9.9 0 0 1-.08 1.27L8.36 12l7.736 6.825a.9.9 0 0 1-1.191 1.35l-8.5-7.5a.9.9 0 0 1 0-1.35l8.5-7.5a.9.9 0 0 1 1.27.08Z" clip-rule="evenodd"/></svg>',
|
|
@@ -108,18 +108,18 @@ function se(e, t = []) {
|
|
|
108
108
|
n = [...n, i];
|
|
109
109
|
const u = (d) => {
|
|
110
110
|
var h;
|
|
111
|
-
const { scope:
|
|
112
|
-
return /* @__PURE__ */ m(
|
|
111
|
+
const { scope: v, children: b, ...f } = d, g = ((h = v == null ? void 0 : v[e]) == null ? void 0 : h[l]) || c, y = a.useMemo(() => f, Object.values(f));
|
|
112
|
+
return /* @__PURE__ */ m(g.Provider, { value: y, children: b });
|
|
113
113
|
};
|
|
114
114
|
u.displayName = r + "Provider";
|
|
115
|
-
function
|
|
116
|
-
var
|
|
117
|
-
const
|
|
115
|
+
function _(d, v) {
|
|
116
|
+
var g;
|
|
117
|
+
const b = ((g = v == null ? void 0 : v[e]) == null ? void 0 : g[l]) || c, f = a.useContext(b);
|
|
118
118
|
if (f) return f;
|
|
119
119
|
if (i !== void 0) return i;
|
|
120
120
|
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
121
121
|
}
|
|
122
|
-
return [u,
|
|
122
|
+
return [u, _];
|
|
123
123
|
}
|
|
124
124
|
const s = () => {
|
|
125
125
|
const r = n.map((i) => a.createContext(i));
|
|
@@ -151,29 +151,29 @@ function ct(...e) {
|
|
|
151
151
|
};
|
|
152
152
|
return n.scopeName = t.scopeName, n;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
154
|
+
function ve(e, t) {
|
|
155
155
|
if (typeof e == "function")
|
|
156
156
|
return e(t);
|
|
157
157
|
e != null && (e.current = t);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function ye(...e) {
|
|
160
160
|
return (t) => {
|
|
161
161
|
let n = !1;
|
|
162
162
|
const o = e.map((s) => {
|
|
163
|
-
const r =
|
|
163
|
+
const r = ve(s, t);
|
|
164
164
|
return !n && typeof r == "function" && (n = !0), r;
|
|
165
165
|
});
|
|
166
166
|
if (n)
|
|
167
167
|
return () => {
|
|
168
168
|
for (let s = 0; s < o.length; s++) {
|
|
169
169
|
const r = o[s];
|
|
170
|
-
typeof r == "function" ? r() :
|
|
170
|
+
typeof r == "function" ? r() : ve(e[s], null);
|
|
171
171
|
}
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
174
|
}
|
|
175
175
|
function Y(...e) {
|
|
176
|
-
return a.useCallback(
|
|
176
|
+
return a.useCallback(ye(...e), e);
|
|
177
177
|
}
|
|
178
178
|
var Z = a.forwardRef((e, t) => {
|
|
179
179
|
const { children: n, ...o } = e, s = a.Children.toArray(n), r = s.find(ut);
|
|
@@ -188,12 +188,12 @@ var ne = a.forwardRef((e, t) => {
|
|
|
188
188
|
const { children: n, ...o } = e;
|
|
189
189
|
if (a.isValidElement(n)) {
|
|
190
190
|
const s = dt(n), r = lt(o, n.props);
|
|
191
|
-
return n.type !== a.Fragment && (r.ref = t ?
|
|
191
|
+
return n.type !== a.Fragment && (r.ref = t ? ye(t, s) : s), a.cloneElement(n, r);
|
|
192
192
|
}
|
|
193
193
|
return a.Children.count(n) > 1 ? a.Children.only(null) : null;
|
|
194
194
|
});
|
|
195
195
|
ne.displayName = "SlotClone";
|
|
196
|
-
var at = ({ children: e }) => /* @__PURE__ */ m(
|
|
196
|
+
var at = ({ children: e }) => /* @__PURE__ */ m(qe, { children: e });
|
|
197
197
|
function ut(e) {
|
|
198
198
|
return a.isValidElement(e) && e.type === at;
|
|
199
199
|
}
|
|
@@ -216,39 +216,39 @@ function ft(e) {
|
|
|
216
216
|
const t = e + "CollectionProvider", [n, o] = se(t), [s, r] = n(
|
|
217
217
|
t,
|
|
218
218
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
219
|
-
), i = (
|
|
220
|
-
const { scope: f, children:
|
|
221
|
-
return /* @__PURE__ */ m(s, { scope: f, itemMap: h, collectionRef:
|
|
219
|
+
), i = (b) => {
|
|
220
|
+
const { scope: f, children: g } = b, y = O.useRef(null), h = O.useRef(/* @__PURE__ */ new Map()).current;
|
|
221
|
+
return /* @__PURE__ */ m(s, { scope: f, itemMap: h, collectionRef: y, children: g });
|
|
222
222
|
};
|
|
223
223
|
i.displayName = t;
|
|
224
|
-
const c = e + "CollectionSlot", l =
|
|
225
|
-
(
|
|
226
|
-
const { scope:
|
|
227
|
-
return /* @__PURE__ */ m(Z, { ref:
|
|
224
|
+
const c = e + "CollectionSlot", l = O.forwardRef(
|
|
225
|
+
(b, f) => {
|
|
226
|
+
const { scope: g, children: y } = b, h = r(c, g), w = Y(f, h.collectionRef);
|
|
227
|
+
return /* @__PURE__ */ m(Z, { ref: w, children: y });
|
|
228
228
|
}
|
|
229
229
|
);
|
|
230
230
|
l.displayName = c;
|
|
231
|
-
const u = e + "CollectionItemSlot",
|
|
232
|
-
(
|
|
233
|
-
const { scope:
|
|
234
|
-
return
|
|
231
|
+
const u = e + "CollectionItemSlot", _ = "data-radix-collection-item", d = O.forwardRef(
|
|
232
|
+
(b, f) => {
|
|
233
|
+
const { scope: g, children: y, ...h } = b, w = O.useRef(null), j = Y(f, w), C = r(u, g);
|
|
234
|
+
return O.useEffect(() => (C.itemMap.set(w, { ref: w, ...h }), () => void C.itemMap.delete(w))), /* @__PURE__ */ m(Z, { [_]: "", ref: j, children: y });
|
|
235
235
|
}
|
|
236
236
|
);
|
|
237
237
|
d.displayName = u;
|
|
238
|
-
function
|
|
239
|
-
const f = r(e + "CollectionConsumer",
|
|
240
|
-
return
|
|
241
|
-
const
|
|
242
|
-
if (!
|
|
243
|
-
const h = Array.from(
|
|
238
|
+
function v(b) {
|
|
239
|
+
const f = r(e + "CollectionConsumer", b);
|
|
240
|
+
return O.useCallback(() => {
|
|
241
|
+
const y = f.collectionRef.current;
|
|
242
|
+
if (!y) return [];
|
|
243
|
+
const h = Array.from(y.querySelectorAll(`[${_}]`));
|
|
244
244
|
return Array.from(f.itemMap.values()).sort(
|
|
245
|
-
(
|
|
245
|
+
(C, N) => h.indexOf(C.ref.current) - h.indexOf(N.ref.current)
|
|
246
246
|
);
|
|
247
247
|
}, [f.collectionRef, f.itemMap]);
|
|
248
248
|
}
|
|
249
249
|
return [
|
|
250
250
|
{ Provider: i, Slot: l, ItemSlot: d },
|
|
251
|
-
|
|
251
|
+
v,
|
|
252
252
|
o
|
|
253
253
|
];
|
|
254
254
|
}
|
|
@@ -261,7 +261,7 @@ function Ie(e) {
|
|
|
261
261
|
n((o) => o ?? String(mt++));
|
|
262
262
|
}, [e]), t ? `radix-${t}` : "";
|
|
263
263
|
}
|
|
264
|
-
var
|
|
264
|
+
var _t = [
|
|
265
265
|
"a",
|
|
266
266
|
"button",
|
|
267
267
|
"div",
|
|
@@ -278,7 +278,7 @@ var gt = [
|
|
|
278
278
|
"span",
|
|
279
279
|
"svg",
|
|
280
280
|
"ul"
|
|
281
|
-
],
|
|
281
|
+
], $ = _t.reduce((e, t) => {
|
|
282
282
|
const n = a.forwardRef((o, s) => {
|
|
283
283
|
const { asChild: r, ...i } = o, c = r ? Z : t;
|
|
284
284
|
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(c, { ...i, ref: s });
|
|
@@ -300,7 +300,7 @@ function Se({
|
|
|
300
300
|
onChange: n = () => {
|
|
301
301
|
}
|
|
302
302
|
}) {
|
|
303
|
-
const [o, s] =
|
|
303
|
+
const [o, s] = vt({ defaultProp: t, onChange: n }), r = e !== void 0, i = r ? e : o, c = ie(n), l = a.useCallback(
|
|
304
304
|
(u) => {
|
|
305
305
|
if (r) {
|
|
306
306
|
const d = typeof u == "function" ? u(e) : u;
|
|
@@ -312,7 +312,7 @@ function Se({
|
|
|
312
312
|
);
|
|
313
313
|
return [i, l];
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function vt({
|
|
316
316
|
defaultProp: e,
|
|
317
317
|
onChange: t
|
|
318
318
|
}) {
|
|
@@ -321,15 +321,15 @@ function _t({
|
|
|
321
321
|
s.current !== o && (r(o), s.current = o);
|
|
322
322
|
}, [o, s, r]), n;
|
|
323
323
|
}
|
|
324
|
-
var
|
|
324
|
+
var bt = a.createContext(void 0);
|
|
325
325
|
function Ne(e) {
|
|
326
|
-
const t = a.useContext(
|
|
326
|
+
const t = a.useContext(bt);
|
|
327
327
|
return e || t || "ltr";
|
|
328
328
|
}
|
|
329
|
-
var ee = "rovingFocusGroup.onEntryFocus",
|
|
329
|
+
var ee = "rovingFocusGroup.onEntryFocus", gt = { bubbles: !1, cancelable: !0 }, H = "RovingFocusGroup", [oe, Re, ht] = ft(H), [wt, Te] = se(
|
|
330
330
|
H,
|
|
331
331
|
[ht]
|
|
332
|
-
), [
|
|
332
|
+
), [Ct, yt] = wt(H), xe = a.forwardRef(
|
|
333
333
|
(e, t) => /* @__PURE__ */ m(oe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(oe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(It, { ...e, ref: t }) }) })
|
|
334
334
|
);
|
|
335
335
|
xe.displayName = H;
|
|
@@ -343,30 +343,30 @@ var It = a.forwardRef((e, t) => {
|
|
|
343
343
|
defaultCurrentTabStopId: c,
|
|
344
344
|
onCurrentTabStopIdChange: l,
|
|
345
345
|
onEntryFocus: u,
|
|
346
|
-
preventScrollOnEntryFocus:
|
|
346
|
+
preventScrollOnEntryFocus: _ = !1,
|
|
347
347
|
...d
|
|
348
|
-
} = e,
|
|
348
|
+
} = e, v = a.useRef(null), b = Y(t, v), f = Ne(r), [g = null, y] = Se({
|
|
349
349
|
prop: i,
|
|
350
350
|
defaultProp: c,
|
|
351
351
|
onChange: l
|
|
352
|
-
}), [h,
|
|
352
|
+
}), [h, w] = a.useState(!1), j = ie(u), C = Re(n), N = a.useRef(!1), [D, U] = a.useState(0);
|
|
353
353
|
return a.useEffect(() => {
|
|
354
|
-
const I =
|
|
354
|
+
const I = v.current;
|
|
355
355
|
if (I)
|
|
356
|
-
return I.addEventListener(ee,
|
|
357
|
-
}, [
|
|
358
|
-
|
|
356
|
+
return I.addEventListener(ee, j), () => I.removeEventListener(ee, j);
|
|
357
|
+
}, [j]), /* @__PURE__ */ m(
|
|
358
|
+
Ct,
|
|
359
359
|
{
|
|
360
360
|
scope: n,
|
|
361
361
|
orientation: o,
|
|
362
362
|
dir: f,
|
|
363
363
|
loop: s,
|
|
364
|
-
currentTabStopId:
|
|
364
|
+
currentTabStopId: g,
|
|
365
365
|
onItemFocus: a.useCallback(
|
|
366
|
-
(I) =>
|
|
367
|
-
[
|
|
366
|
+
(I) => y(I),
|
|
367
|
+
[y]
|
|
368
368
|
),
|
|
369
|
-
onItemShiftTab: a.useCallback(() =>
|
|
369
|
+
onItemShiftTab: a.useCallback(() => w(!0), []),
|
|
370
370
|
onFocusableItemAdd: a.useCallback(
|
|
371
371
|
() => U((I) => I + 1),
|
|
372
372
|
[]
|
|
@@ -376,12 +376,12 @@ var It = a.forwardRef((e, t) => {
|
|
|
376
376
|
[]
|
|
377
377
|
),
|
|
378
378
|
children: /* @__PURE__ */ m(
|
|
379
|
-
|
|
379
|
+
$.div,
|
|
380
380
|
{
|
|
381
|
-
tabIndex: h ||
|
|
381
|
+
tabIndex: h || D === 0 ? -1 : 0,
|
|
382
382
|
"data-orientation": o,
|
|
383
383
|
...d,
|
|
384
|
-
ref:
|
|
384
|
+
ref: b,
|
|
385
385
|
style: { outline: "none", ...e.style },
|
|
386
386
|
onMouseDown: A(e.onMouseDown, () => {
|
|
387
387
|
N.current = !0;
|
|
@@ -389,17 +389,17 @@ var It = a.forwardRef((e, t) => {
|
|
|
389
389
|
onFocus: A(e.onFocus, (I) => {
|
|
390
390
|
const X = !N.current;
|
|
391
391
|
if (I.target === I.currentTarget && X && !h) {
|
|
392
|
-
const
|
|
393
|
-
if (I.currentTarget.dispatchEvent(
|
|
394
|
-
const L =
|
|
392
|
+
const F = new CustomEvent(ee, gt);
|
|
393
|
+
if (I.currentTarget.dispatchEvent(F), !F.defaultPrevented) {
|
|
394
|
+
const L = C().filter((x) => x.focusable), V = L.find((x) => x.active), G = L.find((x) => x.id === g), k = [V, G, ...L].filter(
|
|
395
395
|
Boolean
|
|
396
396
|
).map((x) => x.ref.current);
|
|
397
|
-
|
|
397
|
+
je(k, _);
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
N.current = !1;
|
|
401
401
|
}),
|
|
402
|
-
onBlur: A(e.onBlur, () =>
|
|
402
|
+
onBlur: A(e.onBlur, () => w(!1))
|
|
403
403
|
}
|
|
404
404
|
)
|
|
405
405
|
}
|
|
@@ -412,11 +412,11 @@ var It = a.forwardRef((e, t) => {
|
|
|
412
412
|
active: s = !1,
|
|
413
413
|
tabStopId: r,
|
|
414
414
|
...i
|
|
415
|
-
} = e, c = Ie(), l = r || c, u =
|
|
415
|
+
} = e, c = Ie(), l = r || c, u = yt(Ee, n), _ = u.currentTabStopId === l, d = Re(n), { onFocusableItemAdd: v, onFocusableItemRemove: b } = u;
|
|
416
416
|
return a.useEffect(() => {
|
|
417
417
|
if (o)
|
|
418
|
-
return
|
|
419
|
-
}, [o,
|
|
418
|
+
return v(), () => b();
|
|
419
|
+
}, [o, v, b]), /* @__PURE__ */ m(
|
|
420
420
|
oe.ItemSlot,
|
|
421
421
|
{
|
|
422
422
|
scope: n,
|
|
@@ -424,9 +424,9 @@ var It = a.forwardRef((e, t) => {
|
|
|
424
424
|
focusable: o,
|
|
425
425
|
active: s,
|
|
426
426
|
children: /* @__PURE__ */ m(
|
|
427
|
-
|
|
427
|
+
$.span,
|
|
428
428
|
{
|
|
429
|
-
tabIndex:
|
|
429
|
+
tabIndex: _ ? 0 : -1,
|
|
430
430
|
"data-orientation": u.orientation,
|
|
431
431
|
...i,
|
|
432
432
|
ref: t,
|
|
@@ -440,18 +440,18 @@ var It = a.forwardRef((e, t) => {
|
|
|
440
440
|
return;
|
|
441
441
|
}
|
|
442
442
|
if (f.target !== f.currentTarget) return;
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
443
|
+
const g = Rt(f, u.orientation, u.dir);
|
|
444
|
+
if (g !== void 0) {
|
|
445
445
|
if (f.metaKey || f.ctrlKey || f.altKey || f.shiftKey) return;
|
|
446
446
|
f.preventDefault();
|
|
447
|
-
let h = d().filter((
|
|
448
|
-
if (
|
|
449
|
-
else if (
|
|
450
|
-
|
|
451
|
-
const
|
|
452
|
-
h = u.loop ? Tt(h,
|
|
447
|
+
let h = d().filter((w) => w.focusable).map((w) => w.ref.current);
|
|
448
|
+
if (g === "last") h.reverse();
|
|
449
|
+
else if (g === "prev" || g === "next") {
|
|
450
|
+
g === "prev" && h.reverse();
|
|
451
|
+
const w = h.indexOf(f.currentTarget);
|
|
452
|
+
h = u.loop ? Tt(h, w + 1) : h.slice(w + 1);
|
|
453
453
|
}
|
|
454
|
-
setTimeout(() =>
|
|
454
|
+
setTimeout(() => je(h));
|
|
455
455
|
}
|
|
456
456
|
})
|
|
457
457
|
}
|
|
@@ -479,7 +479,7 @@ function Rt(e, t, n) {
|
|
|
479
479
|
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
480
480
|
return St[o];
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function je(e, t = !1) {
|
|
483
483
|
const n = document.activeElement;
|
|
484
484
|
for (const o of e)
|
|
485
485
|
if (o === n || (o.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
@@ -491,12 +491,12 @@ var xt = xe, Et = Ae;
|
|
|
491
491
|
function At(e, t) {
|
|
492
492
|
return a.useReducer((n, o) => t[n][o] ?? n, e);
|
|
493
493
|
}
|
|
494
|
-
var
|
|
495
|
-
const { present: t, children: n } = e, o =
|
|
494
|
+
var Me = (e) => {
|
|
495
|
+
const { present: t, children: n } = e, o = jt(t), s = typeof n == "function" ? n({ present: o.isPresent }) : a.Children.only(n), r = Y(o.ref, Mt(s));
|
|
496
496
|
return typeof n == "function" || o.isPresent ? a.cloneElement(s, { ref: r }) : null;
|
|
497
497
|
};
|
|
498
|
-
|
|
499
|
-
function
|
|
498
|
+
Me.displayName = "Presence";
|
|
499
|
+
function jt(e) {
|
|
500
500
|
const [t, n] = a.useState(), o = a.useRef({}), s = a.useRef(e), r = a.useRef("none"), i = e ? "mounted" : "unmounted", [c, l] = At(i, {
|
|
501
501
|
mounted: {
|
|
502
502
|
UNMOUNT: "unmounted",
|
|
@@ -511,30 +511,30 @@ function Mt(e) {
|
|
|
511
511
|
}
|
|
512
512
|
});
|
|
513
513
|
return a.useEffect(() => {
|
|
514
|
-
const u =
|
|
514
|
+
const u = q(o.current);
|
|
515
515
|
r.current = c === "mounted" ? u : "none";
|
|
516
516
|
}, [c]), re(() => {
|
|
517
|
-
const u = o.current,
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
520
|
-
e ? l("MOUNT") :
|
|
517
|
+
const u = o.current, _ = s.current;
|
|
518
|
+
if (_ !== e) {
|
|
519
|
+
const v = r.current, b = q(u);
|
|
520
|
+
e ? l("MOUNT") : b === "none" || (u == null ? void 0 : u.display) === "none" ? l("UNMOUNT") : l(_ && v !== b ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
|
|
521
521
|
}
|
|
522
522
|
}, [e, l]), re(() => {
|
|
523
523
|
if (t) {
|
|
524
524
|
let u;
|
|
525
|
-
const
|
|
526
|
-
const
|
|
527
|
-
if (
|
|
528
|
-
const
|
|
529
|
-
t.style.animationFillMode = "forwards", u =
|
|
530
|
-
t.style.animationFillMode === "forwards" && (t.style.animationFillMode =
|
|
525
|
+
const _ = t.ownerDocument.defaultView ?? window, d = (b) => {
|
|
526
|
+
const g = q(o.current).includes(b.animationName);
|
|
527
|
+
if (b.target === t && g && (l("ANIMATION_END"), !s.current)) {
|
|
528
|
+
const y = t.style.animationFillMode;
|
|
529
|
+
t.style.animationFillMode = "forwards", u = _.setTimeout(() => {
|
|
530
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
|
|
531
531
|
});
|
|
532
532
|
}
|
|
533
|
-
},
|
|
534
|
-
|
|
533
|
+
}, v = (b) => {
|
|
534
|
+
b.target === t && (r.current = q(o.current));
|
|
535
535
|
};
|
|
536
|
-
return t.addEventListener("animationstart",
|
|
537
|
-
|
|
536
|
+
return t.addEventListener("animationstart", v), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
|
|
537
|
+
_.clearTimeout(u), t.removeEventListener("animationstart", v), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
|
|
538
538
|
};
|
|
539
539
|
} else
|
|
540
540
|
l("ANIMATION_END");
|
|
@@ -545,17 +545,17 @@ function Mt(e) {
|
|
|
545
545
|
}, [])
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function q(e) {
|
|
549
549
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function Mt(e) {
|
|
552
552
|
var o, s;
|
|
553
553
|
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
554
554
|
return n ? e.ref : (t = (s = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : s.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
555
555
|
}
|
|
556
|
-
var ce = "Tabs", [
|
|
556
|
+
var ce = "Tabs", [Pt, nn] = se(ce, [
|
|
557
557
|
Te
|
|
558
|
-
]),
|
|
558
|
+
]), Pe = Te(), [Ot, ae] = Pt(ce), Oe = a.forwardRef(
|
|
559
559
|
(e, t) => {
|
|
560
560
|
const {
|
|
561
561
|
__scopeTabs: n,
|
|
@@ -566,25 +566,25 @@ var ce = "Tabs", [Ot, nn] = se(ce, [
|
|
|
566
566
|
dir: c,
|
|
567
567
|
activationMode: l = "automatic",
|
|
568
568
|
...u
|
|
569
|
-
} = e,
|
|
569
|
+
} = e, _ = Ne(c), [d, v] = Se({
|
|
570
570
|
prop: o,
|
|
571
571
|
onChange: s,
|
|
572
572
|
defaultProp: r
|
|
573
573
|
});
|
|
574
574
|
return /* @__PURE__ */ m(
|
|
575
|
-
|
|
575
|
+
Ot,
|
|
576
576
|
{
|
|
577
577
|
scope: n,
|
|
578
578
|
baseId: Ie(),
|
|
579
579
|
value: d,
|
|
580
|
-
onValueChange:
|
|
580
|
+
onValueChange: v,
|
|
581
581
|
orientation: i,
|
|
582
|
-
dir:
|
|
582
|
+
dir: _,
|
|
583
583
|
activationMode: l,
|
|
584
584
|
children: /* @__PURE__ */ m(
|
|
585
|
-
|
|
585
|
+
$.div,
|
|
586
586
|
{
|
|
587
|
-
dir:
|
|
587
|
+
dir: _,
|
|
588
588
|
"data-orientation": i,
|
|
589
589
|
...u,
|
|
590
590
|
ref: t
|
|
@@ -594,10 +594,10 @@ var ce = "Tabs", [Ot, nn] = se(ce, [
|
|
|
594
594
|
);
|
|
595
595
|
}
|
|
596
596
|
);
|
|
597
|
-
|
|
598
|
-
var
|
|
597
|
+
Oe.displayName = ce;
|
|
598
|
+
var Fe = "TabsList", $e = a.forwardRef(
|
|
599
599
|
(e, t) => {
|
|
600
|
-
const { __scopeTabs: n, loop: o = !0, ...s } = e, r = ae(
|
|
600
|
+
const { __scopeTabs: n, loop: o = !0, ...s } = e, r = ae(Fe, n), i = Pe(n);
|
|
601
601
|
return /* @__PURE__ */ m(
|
|
602
602
|
xt,
|
|
603
603
|
{
|
|
@@ -607,7 +607,7 @@ var $e = "TabsList", De = a.forwardRef(
|
|
|
607
607
|
dir: r.dir,
|
|
608
608
|
loop: o,
|
|
609
609
|
children: /* @__PURE__ */ m(
|
|
610
|
-
|
|
610
|
+
$.div,
|
|
611
611
|
{
|
|
612
612
|
role: "tablist",
|
|
613
613
|
"aria-orientation": r.orientation,
|
|
@@ -619,25 +619,25 @@ var $e = "TabsList", De = a.forwardRef(
|
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
621
|
);
|
|
622
|
-
|
|
623
|
-
var
|
|
622
|
+
$e.displayName = Fe;
|
|
623
|
+
var De = "TabsTrigger", Le = a.forwardRef(
|
|
624
624
|
(e, t) => {
|
|
625
|
-
const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, i = ae(
|
|
625
|
+
const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, i = ae(De, n), c = Pe(n), l = Ue(i.baseId, o), u = Ge(i.baseId, o), _ = o === i.value;
|
|
626
626
|
return /* @__PURE__ */ m(
|
|
627
627
|
Et,
|
|
628
628
|
{
|
|
629
629
|
asChild: !0,
|
|
630
630
|
...c,
|
|
631
631
|
focusable: !s,
|
|
632
|
-
active:
|
|
632
|
+
active: _,
|
|
633
633
|
children: /* @__PURE__ */ m(
|
|
634
|
-
|
|
634
|
+
$.button,
|
|
635
635
|
{
|
|
636
636
|
type: "button",
|
|
637
637
|
role: "tab",
|
|
638
|
-
"aria-selected":
|
|
638
|
+
"aria-selected": _,
|
|
639
639
|
"aria-controls": u,
|
|
640
|
-
"data-state":
|
|
640
|
+
"data-state": _ ? "active" : "inactive",
|
|
641
641
|
"data-disabled": s ? "" : void 0,
|
|
642
642
|
disabled: s,
|
|
643
643
|
id: l,
|
|
@@ -651,7 +651,7 @@ var qe = "TabsTrigger", Le = a.forwardRef(
|
|
|
651
651
|
}),
|
|
652
652
|
onFocus: A(e.onFocus, () => {
|
|
653
653
|
const d = i.activationMode !== "manual";
|
|
654
|
-
!
|
|
654
|
+
!_ && !s && d && i.onValueChange(o);
|
|
655
655
|
})
|
|
656
656
|
}
|
|
657
657
|
)
|
|
@@ -659,21 +659,21 @@ var qe = "TabsTrigger", Le = a.forwardRef(
|
|
|
659
659
|
);
|
|
660
660
|
}
|
|
661
661
|
);
|
|
662
|
-
Le.displayName =
|
|
662
|
+
Le.displayName = De;
|
|
663
663
|
var Ve = "TabsContent", Be = a.forwardRef(
|
|
664
664
|
(e, t) => {
|
|
665
|
-
const { __scopeTabs: n, value: o, forceMount: s, children: r, ...i } = e, c = ae(Ve, n), l = Ue(c.baseId, o), u =
|
|
665
|
+
const { __scopeTabs: n, value: o, forceMount: s, children: r, ...i } = e, c = ae(Ve, n), l = Ue(c.baseId, o), u = Ge(c.baseId, o), _ = o === c.value, d = a.useRef(_);
|
|
666
666
|
return a.useEffect(() => {
|
|
667
|
-
const
|
|
668
|
-
return () => cancelAnimationFrame(
|
|
669
|
-
}, []), /* @__PURE__ */ m(
|
|
670
|
-
|
|
667
|
+
const v = requestAnimationFrame(() => d.current = !1);
|
|
668
|
+
return () => cancelAnimationFrame(v);
|
|
669
|
+
}, []), /* @__PURE__ */ m(Me, { present: s || _, children: ({ present: v }) => /* @__PURE__ */ m(
|
|
670
|
+
$.div,
|
|
671
671
|
{
|
|
672
|
-
"data-state":
|
|
672
|
+
"data-state": _ ? "active" : "inactive",
|
|
673
673
|
"data-orientation": c.orientation,
|
|
674
674
|
role: "tabpanel",
|
|
675
675
|
"aria-labelledby": l,
|
|
676
|
-
hidden: !
|
|
676
|
+
hidden: !v,
|
|
677
677
|
id: u,
|
|
678
678
|
tabIndex: 0,
|
|
679
679
|
...i,
|
|
@@ -682,7 +682,7 @@ var Ve = "TabsContent", Be = a.forwardRef(
|
|
|
682
682
|
...e.style,
|
|
683
683
|
animationDuration: d.current ? "0s" : void 0
|
|
684
684
|
},
|
|
685
|
-
children:
|
|
685
|
+
children: v && r
|
|
686
686
|
}
|
|
687
687
|
) });
|
|
688
688
|
}
|
|
@@ -691,10 +691,10 @@ Be.displayName = Ve;
|
|
|
691
691
|
function Ue(e, t) {
|
|
692
692
|
return `${e}-trigger-${t}`;
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Ge(e, t) {
|
|
695
695
|
return `${e}-content-${t}`;
|
|
696
696
|
}
|
|
697
|
-
var
|
|
697
|
+
var Ft = Oe, $t = $e, Dt = Le, Lt = Be;
|
|
698
698
|
function Vt(e) {
|
|
699
699
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
700
700
|
}
|
|
@@ -704,9 +704,9 @@ var te = { exports: {} };
|
|
|
704
704
|
Licensed under the MIT License (MIT), see
|
|
705
705
|
http://jedwatson.github.io/classnames
|
|
706
706
|
*/
|
|
707
|
-
var
|
|
707
|
+
var be;
|
|
708
708
|
function Bt() {
|
|
709
|
-
return
|
|
709
|
+
return be || (be = 1, function(e) {
|
|
710
710
|
(function() {
|
|
711
711
|
var t = {}.hasOwnProperty;
|
|
712
712
|
function n() {
|
|
@@ -738,10 +738,10 @@ function Bt() {
|
|
|
738
738
|
}(te)), te.exports;
|
|
739
739
|
}
|
|
740
740
|
var Ut = Bt();
|
|
741
|
-
const ue = /* @__PURE__ */ Vt(Ut),
|
|
741
|
+
const ue = /* @__PURE__ */ Vt(Ut), Gt = {
|
|
742
742
|
"purpur-tab-content": "_purpur-tab-content_1ugbi_1",
|
|
743
743
|
"purpur-tab-content--force-mount": "_purpur-tab-content--force-mount_1ugbi_15"
|
|
744
|
-
},
|
|
744
|
+
}, Wt = ue.bind(Gt), ge = "purpur-tab-content", kt = we(
|
|
745
745
|
({
|
|
746
746
|
children: e,
|
|
747
747
|
tabId: t,
|
|
@@ -753,10 +753,10 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
753
753
|
Lt,
|
|
754
754
|
{
|
|
755
755
|
ref: i,
|
|
756
|
-
className:
|
|
757
|
-
|
|
756
|
+
className: Wt([
|
|
757
|
+
ge,
|
|
758
758
|
o,
|
|
759
|
-
{ [`${
|
|
759
|
+
{ [`${ge}--force-mount`]: !s }
|
|
760
760
|
]),
|
|
761
761
|
"data-testid": n,
|
|
762
762
|
value: t,
|
|
@@ -765,13 +765,13 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
765
765
|
children: e
|
|
766
766
|
}
|
|
767
767
|
)
|
|
768
|
-
),
|
|
769
|
-
"purpur-tab-header": "_purpur-tab-
|
|
770
|
-
"purpur-tab-header--contained": "_purpur-tab-header--
|
|
771
|
-
"purpur-tab-header--contained-negative": "_purpur-tab-header--contained-
|
|
772
|
-
"purpur-tab-header--line": "_purpur-tab-header--
|
|
773
|
-
"purpur-tab-header--line-negative": "_purpur-tab-header--line-
|
|
774
|
-
},
|
|
768
|
+
), zt = (e) => !!e && Ye(e) && !!e.props.name && !!e.props.tabId, Kt = {
|
|
769
|
+
"purpur-tab-header": "_purpur-tab-header_1thzh_1",
|
|
770
|
+
"purpur-tab-header--contained": "_purpur-tab-header--contained_1thzh_35",
|
|
771
|
+
"purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_1thzh_35",
|
|
772
|
+
"purpur-tab-header--line": "_purpur-tab-header--line_1thzh_38",
|
|
773
|
+
"purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_1thzh_50"
|
|
774
|
+
}, qt = ue.bind(Kt), he = "purpur-tab-header", Yt = we(
|
|
775
775
|
({
|
|
776
776
|
index: e,
|
|
777
777
|
tabId: t,
|
|
@@ -781,10 +781,10 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
781
781
|
"data-testid": r,
|
|
782
782
|
children: i
|
|
783
783
|
}, c) => /* @__PURE__ */ m(
|
|
784
|
-
|
|
784
|
+
Dt,
|
|
785
785
|
{
|
|
786
786
|
id: `${t}-trigger`,
|
|
787
|
-
className:
|
|
787
|
+
className: qt([he, `${he}--${n}${o ? "-negative" : ""}`]),
|
|
788
788
|
value: t,
|
|
789
789
|
"data-testid": r,
|
|
790
790
|
"data-index": e,
|
|
@@ -794,22 +794,22 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
794
794
|
}
|
|
795
795
|
)
|
|
796
796
|
), Zt = {
|
|
797
|
-
"purpur-tabs__wrapper": "_purpur-
|
|
798
|
-
"purpur-tabs__scroll-button": "_purpur-tabs__scroll-
|
|
799
|
-
"purpur-tabs__scroll-button--left": "_purpur-tabs__scroll-button--
|
|
800
|
-
"purpur-tabs__scroll-button--right": "_purpur-tabs__scroll-button--
|
|
801
|
-
"purpur-tabs__wrapper--scroll-end": "_purpur-tabs__wrapper--scroll-
|
|
802
|
-
"purpur-tabs__wrapper--scroll-start": "_purpur-tabs__wrapper--scroll-
|
|
803
|
-
"purpur-tabs--line": "_purpur-tabs--
|
|
804
|
-
"purpur-tabs--line-negative": "_purpur-tabs--line-
|
|
805
|
-
"purpur-tabs__selected-border": "_purpur-tabs__selected-
|
|
806
|
-
"purpur-tabs__content-wrapper": "_purpur-tabs__content-
|
|
807
|
-
"purpur-tabs--contained": "_purpur-tabs--
|
|
808
|
-
"purpur-tabs__list": "_purpur-
|
|
809
|
-
"purpur-tabs--contained-negative": "_purpur-tabs--contained-
|
|
810
|
-
"purpur-tabs__content-container": "_purpur-tabs__content-
|
|
811
|
-
"purpur-tabs--fullWidth": "_purpur-tabs--
|
|
812
|
-
}, rn = ["line", "contained"], Ht = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }),
|
|
797
|
+
"purpur-tabs__wrapper": "_purpur-tabs__wrapper_j1jjc_1",
|
|
798
|
+
"purpur-tabs__scroll-button": "_purpur-tabs__scroll-button_j1jjc_9",
|
|
799
|
+
"purpur-tabs__scroll-button--left": "_purpur-tabs__scroll-button--left_j1jjc_71",
|
|
800
|
+
"purpur-tabs__scroll-button--right": "_purpur-tabs__scroll-button--right_j1jjc_74",
|
|
801
|
+
"purpur-tabs__wrapper--scroll-end": "_purpur-tabs__wrapper--scroll-end_j1jjc_77",
|
|
802
|
+
"purpur-tabs__wrapper--scroll-start": "_purpur-tabs__wrapper--scroll-start_j1jjc_80",
|
|
803
|
+
"purpur-tabs--line": "_purpur-tabs--line_j1jjc_83",
|
|
804
|
+
"purpur-tabs--line-negative": "_purpur-tabs--line-negative_j1jjc_83",
|
|
805
|
+
"purpur-tabs__selected-border": "_purpur-tabs__selected-border_j1jjc_91",
|
|
806
|
+
"purpur-tabs__content-wrapper": "_purpur-tabs__content-wrapper_j1jjc_115",
|
|
807
|
+
"purpur-tabs--contained": "_purpur-tabs--contained_j1jjc_123",
|
|
808
|
+
"purpur-tabs__list": "_purpur-tabs__list_j1jjc_123",
|
|
809
|
+
"purpur-tabs--contained-negative": "_purpur-tabs--contained-negative_j1jjc_123",
|
|
810
|
+
"purpur-tabs__content-container": "_purpur-tabs__content-container_j1jjc_126",
|
|
811
|
+
"purpur-tabs--fullWidth": "_purpur-tabs--fullWidth_j1jjc_136"
|
|
812
|
+
}, rn = ["line", "contained"], Ht = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), P = ue.bind(Zt), R = "purpur-tabs", Xt = (e, t) => {
|
|
813
813
|
var l;
|
|
814
814
|
if (typeof (e == null ? void 0 : e.getBoundingClientRect) != "function" || typeof (t == null ? void 0 : t.scroll) != "function")
|
|
815
815
|
return;
|
|
@@ -827,75 +827,75 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
827
827
|
animateHeight: c = !1,
|
|
828
828
|
"data-testid": l,
|
|
829
829
|
value: u,
|
|
830
|
-
...
|
|
830
|
+
..._
|
|
831
831
|
}) => {
|
|
832
|
-
const d = Q(null), [
|
|
832
|
+
const d = Q(null), [v, b] = B(-1), [f, g] = B({}), [y, h] = B(0), [w, j] = B(0), C = z.toArray(e).filter(zt), N = Q(null), D = Q(new Array(C.length)), U = 200, I = t === "line", X = P([
|
|
833
833
|
R,
|
|
834
834
|
`${R}--${t}${n ? "-negative" : ""}`,
|
|
835
835
|
{ [`${R}--fullWidth`]: o },
|
|
836
836
|
r
|
|
837
|
-
]),
|
|
838
|
-
const p =
|
|
837
|
+
]), F = z.map(C, ({ props: { tabId: p } }) => p), L = () => {
|
|
838
|
+
const p = F.findIndex((S) => S === i);
|
|
839
839
|
return p >= 0 ? p : 0;
|
|
840
840
|
};
|
|
841
841
|
K(() => {
|
|
842
|
-
u &&
|
|
843
|
-
}, [
|
|
844
|
-
const [V,
|
|
845
|
-
if (new Set(
|
|
842
|
+
u && G(C.findIndex((p) => p.props.tabId === u));
|
|
843
|
+
}, [C, u]);
|
|
844
|
+
const [V, G] = B(L);
|
|
845
|
+
if (new Set(F).size !== F.length)
|
|
846
846
|
throw new Error("tabId must be unique");
|
|
847
|
-
const
|
|
847
|
+
const W = (p, S) => S || l ? `${S || l}-${p}` : void 0, k = () => {
|
|
848
848
|
if (!I)
|
|
849
849
|
return;
|
|
850
|
-
const p =
|
|
851
|
-
h((p == null ? void 0 : p.offsetLeft) || 0),
|
|
850
|
+
const p = D.current[V];
|
|
851
|
+
h((p == null ? void 0 : p.offsetLeft) || 0), j((p == null ? void 0 : p.getBoundingClientRect().width) || 0);
|
|
852
852
|
}, x = (p) => {
|
|
853
|
-
I && !u &&
|
|
854
|
-
},
|
|
853
|
+
I && !u && G(C.findIndex((S) => S.props.tabId === p)), s == null || s(Ht(p));
|
|
854
|
+
}, We = (p) => {
|
|
855
855
|
if (N != null && N.current) {
|
|
856
|
-
const { scrollLeft: S } = N.current,
|
|
857
|
-
N.current.scroll({ left: S +
|
|
856
|
+
const { scrollLeft: S } = N.current, M = p === "left" ? -200 : U;
|
|
857
|
+
N.current.scroll({ left: S + M, behavior: "smooth" });
|
|
858
858
|
}
|
|
859
859
|
}, le = ({ side: p }) => /* @__PURE__ */ m(
|
|
860
860
|
"button",
|
|
861
861
|
{
|
|
862
|
-
className:
|
|
863
|
-
onClick: () =>
|
|
862
|
+
className: P(`${R}__scroll-button`, `${R}__scroll-button--${p}`),
|
|
863
|
+
onClick: () => We(p),
|
|
864
864
|
type: "button",
|
|
865
865
|
"aria-hidden": "true",
|
|
866
866
|
tabIndex: -1,
|
|
867
|
-
"data-testid":
|
|
868
|
-
children: /* @__PURE__ */ m(
|
|
867
|
+
"data-testid": W("scroll-button"),
|
|
868
|
+
children: /* @__PURE__ */ m(Ce, { svg: p === "left" ? st : it, size: "md" })
|
|
869
869
|
}
|
|
870
870
|
);
|
|
871
871
|
return K(() => {
|
|
872
872
|
const p = () => {
|
|
873
873
|
if (d.current && c) {
|
|
874
|
-
const
|
|
875
|
-
|
|
874
|
+
const M = d.current.offsetHeight;
|
|
875
|
+
b(M);
|
|
876
876
|
}
|
|
877
877
|
}, S = () => {
|
|
878
|
-
p(),
|
|
878
|
+
p(), k();
|
|
879
879
|
};
|
|
880
880
|
return p(), window.addEventListener("resize", S), () => {
|
|
881
881
|
window.removeEventListener("resize", S);
|
|
882
882
|
};
|
|
883
883
|
}, [V, c]), K(() => {
|
|
884
|
-
|
|
885
|
-
}, [V, o,
|
|
884
|
+
k();
|
|
885
|
+
}, [V, o, C.length, t]), K(() => {
|
|
886
886
|
const p = (E) => {
|
|
887
|
-
if (E.every((T) => T.isIntersecting) && E.length ===
|
|
888
|
-
|
|
887
|
+
if (E.every((T) => T.isIntersecting) && E.length === C.length) {
|
|
888
|
+
g({});
|
|
889
889
|
return;
|
|
890
890
|
}
|
|
891
891
|
E.forEach((T) => {
|
|
892
|
-
const fe = Number(T.target.getAttribute("data-index")),
|
|
893
|
-
|
|
892
|
+
const fe = Number(T.target.getAttribute("data-index")), ke = fe === 0, ze = fe === C.length - 1;
|
|
893
|
+
g((Ke) => ({
|
|
894
894
|
...Ke,
|
|
895
|
-
...
|
|
895
|
+
...ke && {
|
|
896
896
|
[`${R}__wrapper--scroll-end`]: !T.isIntersecting
|
|
897
897
|
},
|
|
898
|
-
...
|
|
898
|
+
...ze && {
|
|
899
899
|
[`${R}__wrapper--scroll-start`]: !T.isIntersecting
|
|
900
900
|
}
|
|
901
901
|
}));
|
|
@@ -903,58 +903,58 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
903
903
|
}, S = new IntersectionObserver(p, {
|
|
904
904
|
threshold: [0.99],
|
|
905
905
|
root: N.current
|
|
906
|
-
}),
|
|
907
|
-
return
|
|
908
|
-
|
|
906
|
+
}), M = D.current;
|
|
907
|
+
return M.forEach((E) => S.observe(E)), () => {
|
|
908
|
+
M.forEach((E) => S.unobserve(E));
|
|
909
909
|
};
|
|
910
|
-
}, [
|
|
911
|
-
|
|
910
|
+
}, [C.length]), /* @__PURE__ */ m(
|
|
911
|
+
Ft,
|
|
912
912
|
{
|
|
913
|
-
defaultValue: i ??
|
|
913
|
+
defaultValue: i ?? C[0].props.tabId,
|
|
914
914
|
onValueChange: x,
|
|
915
915
|
"data-testid": l,
|
|
916
916
|
className: X,
|
|
917
917
|
value: u,
|
|
918
|
-
...
|
|
919
|
-
children: /* @__PURE__ */ J("div", { className:
|
|
920
|
-
/* @__PURE__ */ J("div", { className:
|
|
918
|
+
..._,
|
|
919
|
+
children: /* @__PURE__ */ J("div", { className: P(`${R}__container`), children: [
|
|
920
|
+
/* @__PURE__ */ J("div", { className: P([`${R}__wrapper`, f]), children: [
|
|
921
921
|
/* @__PURE__ */ J(
|
|
922
|
-
|
|
922
|
+
$t,
|
|
923
923
|
{
|
|
924
924
|
ref: (p) => {
|
|
925
925
|
N.current = p;
|
|
926
926
|
},
|
|
927
|
-
className:
|
|
927
|
+
className: P(`${R}__list`),
|
|
928
928
|
children: [
|
|
929
|
-
|
|
930
|
-
const { name:
|
|
929
|
+
z.map(C, (p, S) => {
|
|
930
|
+
const { name: M, tabId: E, "data-testid": de } = p.props;
|
|
931
931
|
return /* @__PURE__ */ m(
|
|
932
932
|
Yt,
|
|
933
933
|
{
|
|
934
|
-
"data-testid":
|
|
934
|
+
"data-testid": W("header", de),
|
|
935
935
|
index: S,
|
|
936
936
|
tabId: E,
|
|
937
937
|
ref: (T) => {
|
|
938
|
-
T && (
|
|
938
|
+
T && (D.current[S] = T);
|
|
939
939
|
},
|
|
940
940
|
onFocus: (T) => {
|
|
941
941
|
Xt(T.target, N.current);
|
|
942
942
|
},
|
|
943
943
|
variant: t,
|
|
944
944
|
negative: n,
|
|
945
|
-
children:
|
|
945
|
+
children: M
|
|
946
946
|
}
|
|
947
947
|
);
|
|
948
948
|
}),
|
|
949
949
|
I && /* @__PURE__ */ m(
|
|
950
950
|
"div",
|
|
951
951
|
{
|
|
952
|
-
className:
|
|
952
|
+
className: P(`${R}__selected-border`),
|
|
953
953
|
style: {
|
|
954
|
-
width:
|
|
955
|
-
transform: `translateX(${
|
|
954
|
+
width: w,
|
|
955
|
+
transform: `translateX(${y}px)`
|
|
956
956
|
},
|
|
957
|
-
"data-testid":
|
|
957
|
+
"data-testid": W("selected-border")
|
|
958
958
|
}
|
|
959
959
|
)
|
|
960
960
|
]
|
|
@@ -966,16 +966,16 @@ const ue = /* @__PURE__ */ Vt(Ut), jt = {
|
|
|
966
966
|
/* @__PURE__ */ m(
|
|
967
967
|
"div",
|
|
968
968
|
{
|
|
969
|
-
className:
|
|
970
|
-
style: { height: c &&
|
|
971
|
-
children: /* @__PURE__ */ m("div", { ref: d, className:
|
|
969
|
+
className: P(`${R}__content-wrapper`),
|
|
970
|
+
style: { height: c && v > -1 ? `${v}px` : "auto" },
|
|
971
|
+
children: /* @__PURE__ */ m("div", { ref: d, className: P(`${R}__content-container`), children: z.map(C, (p) => p) })
|
|
972
972
|
}
|
|
973
973
|
)
|
|
974
974
|
] })
|
|
975
975
|
}
|
|
976
976
|
);
|
|
977
977
|
};
|
|
978
|
-
Jt.Content =
|
|
978
|
+
Jt.Content = kt;
|
|
979
979
|
export {
|
|
980
980
|
Jt as Tabs,
|
|
981
981
|
Ht as createTabChangeDetailEvent,
|