@purpurds/tabs 6.0.0 → 6.0.2
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 +15 -51
- package/dist/tabs.cjs.js +3 -3
- package/dist/tabs.cjs.js.map +1 -1
- package/dist/tabs.es.js +629 -682
- package/dist/tabs.es.js.map +1 -1
- package/package.json +7 -7
package/dist/tabs.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { jsx as m, Fragment as Be, jsxs as X } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import P, { forwardRef as pe, isValidElement as je, useState as U, Children as B, useRef as ae, useEffect as j } from "react";
|
|
4
|
+
import "react-dom";
|
|
5
5
|
function Ge(e) {
|
|
6
6
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
7
7
|
}
|
|
8
|
-
var
|
|
8
|
+
var me = { exports: {} };
|
|
9
9
|
/*!
|
|
10
10
|
Copyright (c) 2018 Jed Watson.
|
|
11
11
|
Licensed under the MIT License (MIT), see
|
|
@@ -15,9 +15,9 @@ var he = { exports: {} };
|
|
|
15
15
|
(function() {
|
|
16
16
|
var t = {}.hasOwnProperty;
|
|
17
17
|
function n() {
|
|
18
|
-
for (var r = "",
|
|
19
|
-
var
|
|
20
|
-
|
|
18
|
+
for (var r = "", i = 0; i < arguments.length; i++) {
|
|
19
|
+
var c = arguments[i];
|
|
20
|
+
c && (r = s(r, o.call(this, c)));
|
|
21
21
|
}
|
|
22
22
|
return r;
|
|
23
23
|
}
|
|
@@ -30,19 +30,19 @@ var he = { exports: {} };
|
|
|
30
30
|
return n.apply(this, r);
|
|
31
31
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
32
32
|
return r.toString();
|
|
33
|
-
var
|
|
34
|
-
for (var
|
|
35
|
-
t.call(r,
|
|
36
|
-
return
|
|
33
|
+
var i = "";
|
|
34
|
+
for (var c in r)
|
|
35
|
+
t.call(r, c) && r[c] && (i = s(i, this && this[c] || c));
|
|
36
|
+
return i;
|
|
37
37
|
}
|
|
38
|
-
function s(r,
|
|
39
|
-
return
|
|
38
|
+
function s(r, i) {
|
|
39
|
+
return i ? r ? r + " " + i : r + i : r;
|
|
40
40
|
}
|
|
41
41
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
42
42
|
})();
|
|
43
|
-
})(
|
|
44
|
-
var
|
|
45
|
-
const ke = /* @__PURE__ */ Ge(
|
|
43
|
+
})(me);
|
|
44
|
+
var We = me.exports;
|
|
45
|
+
const ke = /* @__PURE__ */ Ge(We), Ke = {
|
|
46
46
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
47
47
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
48
48
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -50,268 +50,216 @@ const ke = /* @__PURE__ */ Ge(je), Ke = {
|
|
|
50
50
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
51
51
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
52
52
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
53
|
-
}, ze = ke.bind(Ke),
|
|
53
|
+
}, ze = ke.bind(Ke), ue = "purpur-icon", Ye = "md", Ze = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Xe = ({ content: e = "", title: t } = {}) => {
|
|
54
54
|
const n = [
|
|
55
55
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
56
56
|
{ name: "fill", value: "currentColor" },
|
|
57
57
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
58
58
|
t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
59
59
|
], o = t ? `<title>${t}</title>` : "";
|
|
60
|
-
return `<svg ${
|
|
61
|
-
},
|
|
60
|
+
return `<svg ${Ze(n)}>${o}${e}</svg>`;
|
|
61
|
+
}, Je = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), _e = ({
|
|
62
62
|
["data-testid"]: e,
|
|
63
63
|
svg: t,
|
|
64
64
|
allyTitle: n,
|
|
65
65
|
className: o,
|
|
66
|
-
size: s =
|
|
66
|
+
size: s = Ye,
|
|
67
67
|
...r
|
|
68
68
|
}) => {
|
|
69
|
-
const
|
|
70
|
-
content:
|
|
69
|
+
const i = Xe({
|
|
70
|
+
content: Je(t.svg),
|
|
71
71
|
title: n
|
|
72
|
-
}),
|
|
73
|
-
return /* @__PURE__ */
|
|
72
|
+
}), c = ze(o, ue, `${ue}--${s}`);
|
|
73
|
+
return /* @__PURE__ */ m(
|
|
74
74
|
"span",
|
|
75
75
|
{
|
|
76
76
|
"aria-label": n,
|
|
77
|
-
className:
|
|
77
|
+
className: c,
|
|
78
78
|
"data-testid": e,
|
|
79
|
-
dangerouslySetInnerHTML: { __html:
|
|
79
|
+
dangerouslySetInnerHTML: { __html: i },
|
|
80
80
|
...r
|
|
81
81
|
}
|
|
82
82
|
);
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
const
|
|
84
|
+
_e.displayName = "Icon";
|
|
85
|
+
const Qe = {
|
|
86
86
|
name: "chevron-left",
|
|
87
87
|
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>',
|
|
88
88
|
keywords: ["chevron-left"],
|
|
89
89
|
category: "utility"
|
|
90
|
-
},
|
|
90
|
+
}, He = {
|
|
91
91
|
name: "chevron-right",
|
|
92
92
|
svg: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M7.809 3.924a.9.9 0 0 0 .115 1.267L16.094 12l-8.17 6.809a.9.9 0 0 0 1.152 1.382l9-7.5a.9.9 0 0 0 0-1.382l-9-7.5a.9.9 0 0 0-1.267.115Z" clip-rule="evenodd"/></svg>',
|
|
93
93
|
keywords: ["chevron-right"],
|
|
94
94
|
category: "utility"
|
|
95
95
|
};
|
|
96
|
-
function
|
|
97
|
-
return C = Object.assign ? Object.assign.bind() : function(e) {
|
|
98
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
99
|
-
var n = arguments[t];
|
|
100
|
-
for (var o in n) ({}).hasOwnProperty.call(n, o) && (e[o] = n[o]);
|
|
101
|
-
}
|
|
102
|
-
return e;
|
|
103
|
-
}, C.apply(null, arguments);
|
|
104
|
-
}
|
|
105
|
-
function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
96
|
+
function x(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
106
97
|
return function(s) {
|
|
107
|
-
if (e == null || e(s), n === !1 || !s.defaultPrevented)
|
|
98
|
+
if (e == null || e(s), n === !1 || !s.defaultPrevented)
|
|
99
|
+
return t == null ? void 0 : t(s);
|
|
108
100
|
};
|
|
109
101
|
}
|
|
110
|
-
function
|
|
102
|
+
function te(e, t = []) {
|
|
111
103
|
let n = [];
|
|
112
|
-
function o(r,
|
|
113
|
-
const
|
|
114
|
-
n = [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
value: $
|
|
125
|
-
}, _);
|
|
126
|
-
}
|
|
127
|
-
function p(l, m) {
|
|
128
|
-
const _ = (m == null ? void 0 : m[e][u]) || a, f = ge(_);
|
|
104
|
+
function o(r, i) {
|
|
105
|
+
const c = a.createContext(i), u = n.length;
|
|
106
|
+
n = [...n, i];
|
|
107
|
+
const l = (d) => {
|
|
108
|
+
var _;
|
|
109
|
+
const { scope: b, children: h, ...f } = d, y = ((_ = b == null ? void 0 : b[e]) == null ? void 0 : _[u]) || c, v = a.useMemo(() => f, Object.values(f));
|
|
110
|
+
return /* @__PURE__ */ m(y.Provider, { value: v, children: h });
|
|
111
|
+
};
|
|
112
|
+
l.displayName = r + "Provider";
|
|
113
|
+
function g(d, b) {
|
|
114
|
+
var y;
|
|
115
|
+
const h = ((y = b == null ? void 0 : b[e]) == null ? void 0 : y[u]) || c, f = a.useContext(h);
|
|
129
116
|
if (f) return f;
|
|
130
|
-
if (
|
|
131
|
-
throw new Error(`\`${
|
|
117
|
+
if (i !== void 0) return i;
|
|
118
|
+
throw new Error(`\`${d}\` must be used within \`${r}\``);
|
|
132
119
|
}
|
|
133
|
-
return
|
|
134
|
-
i,
|
|
135
|
-
p
|
|
136
|
-
];
|
|
120
|
+
return [l, g];
|
|
137
121
|
}
|
|
138
122
|
const s = () => {
|
|
139
|
-
const r = n.map((
|
|
140
|
-
return function(
|
|
141
|
-
const u = (
|
|
142
|
-
return
|
|
143
|
-
() => ({
|
|
144
|
-
|
|
145
|
-
...a,
|
|
146
|
-
[e]: u
|
|
147
|
-
}
|
|
148
|
-
}),
|
|
149
|
-
[
|
|
150
|
-
a,
|
|
151
|
-
u
|
|
152
|
-
]
|
|
123
|
+
const r = n.map((i) => a.createContext(i));
|
|
124
|
+
return function(c) {
|
|
125
|
+
const u = (c == null ? void 0 : c[e]) || r;
|
|
126
|
+
return a.useMemo(
|
|
127
|
+
() => ({ [`__scope${e}`]: { ...c, [e]: u } }),
|
|
128
|
+
[c, u]
|
|
153
129
|
);
|
|
154
130
|
};
|
|
155
131
|
};
|
|
156
|
-
return s.scopeName = e, [
|
|
157
|
-
o,
|
|
158
|
-
Qe(s, ...t)
|
|
159
|
-
];
|
|
132
|
+
return s.scopeName = e, [o, et(s, ...t)];
|
|
160
133
|
}
|
|
161
|
-
function
|
|
134
|
+
function et(...e) {
|
|
162
135
|
const t = e[0];
|
|
163
136
|
if (e.length === 1) return t;
|
|
164
137
|
const n = () => {
|
|
165
|
-
const o = e.map(
|
|
166
|
-
(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
})
|
|
170
|
-
);
|
|
138
|
+
const o = e.map((s) => ({
|
|
139
|
+
useScope: s(),
|
|
140
|
+
scopeName: s.scopeName
|
|
141
|
+
}));
|
|
171
142
|
return function(r) {
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
return {
|
|
175
|
-
...a,
|
|
176
|
-
...l
|
|
177
|
-
};
|
|
143
|
+
const i = o.reduce((c, { useScope: u, scopeName: l }) => {
|
|
144
|
+
const d = u(r)[`__scope${l}`];
|
|
145
|
+
return { ...c, ...d };
|
|
178
146
|
}, {});
|
|
179
|
-
return
|
|
180
|
-
() => ({
|
|
181
|
-
[`__scope${t.scopeName}`]: c
|
|
182
|
-
}),
|
|
183
|
-
[
|
|
184
|
-
c
|
|
185
|
-
]
|
|
186
|
-
);
|
|
147
|
+
return a.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
|
|
187
148
|
};
|
|
188
149
|
};
|
|
189
150
|
return n.scopeName = t.scopeName, n;
|
|
190
151
|
}
|
|
191
|
-
function
|
|
192
|
-
typeof e == "function"
|
|
152
|
+
function le(e, t) {
|
|
153
|
+
if (typeof e == "function")
|
|
154
|
+
return e(t);
|
|
155
|
+
e != null && (e.current = t);
|
|
193
156
|
}
|
|
194
|
-
function
|
|
195
|
-
return (t) =>
|
|
196
|
-
|
|
197
|
-
|
|
157
|
+
function ge(...e) {
|
|
158
|
+
return (t) => {
|
|
159
|
+
let n = !1;
|
|
160
|
+
const o = e.map((s) => {
|
|
161
|
+
const r = le(s, t);
|
|
162
|
+
return !n && typeof r == "function" && (n = !0), r;
|
|
163
|
+
});
|
|
164
|
+
if (n)
|
|
165
|
+
return () => {
|
|
166
|
+
for (let s = 0; s < o.length; s++) {
|
|
167
|
+
const r = o[s];
|
|
168
|
+
typeof r == "function" ? r() : le(e[s], null);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
};
|
|
198
172
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
173
|
+
function W(...e) {
|
|
174
|
+
return a.useCallback(ge(...e), e);
|
|
201
175
|
}
|
|
202
|
-
|
|
203
|
-
const { children: n, ...o } = e, s =
|
|
176
|
+
var k = a.forwardRef((e, t) => {
|
|
177
|
+
const { children: n, ...o } = e, s = a.Children.toArray(n), r = s.find(nt);
|
|
204
178
|
if (r) {
|
|
205
|
-
const
|
|
206
|
-
return /* @__PURE__ */
|
|
207
|
-
ref: t
|
|
208
|
-
}), /* @__PURE__ */ z(c) ? /* @__PURE__ */ se(c, void 0, a) : null);
|
|
179
|
+
const i = r.props.children, c = s.map((u) => u === r ? a.Children.count(i) > 1 ? a.Children.only(null) : a.isValidElement(i) ? i.props.children : null : u);
|
|
180
|
+
return /* @__PURE__ */ m(Q, { ...o, ref: t, children: a.isValidElement(i) ? a.cloneElement(i, void 0, c) : null });
|
|
209
181
|
}
|
|
210
|
-
return /* @__PURE__ */
|
|
211
|
-
ref: t
|
|
212
|
-
}), n);
|
|
182
|
+
return /* @__PURE__ */ m(Q, { ...o, ref: t, children: n });
|
|
213
183
|
});
|
|
214
|
-
|
|
215
|
-
|
|
184
|
+
k.displayName = "Slot";
|
|
185
|
+
var Q = a.forwardRef((e, t) => {
|
|
216
186
|
const { children: n, ...o } = e;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
ref
|
|
220
|
-
}
|
|
187
|
+
if (a.isValidElement(n)) {
|
|
188
|
+
const s = ot(n), r = rt(o, n.props);
|
|
189
|
+
return n.type !== a.Fragment && (r.ref = t ? ge(t, s) : s), a.cloneElement(n, r);
|
|
190
|
+
}
|
|
191
|
+
return a.Children.count(n) > 1 ? a.Children.only(null) : null;
|
|
221
192
|
});
|
|
222
|
-
|
|
223
|
-
|
|
193
|
+
Q.displayName = "SlotClone";
|
|
194
|
+
var tt = ({ children: e }) => /* @__PURE__ */ m(Be, { children: e });
|
|
224
195
|
function nt(e) {
|
|
225
|
-
return
|
|
196
|
+
return a.isValidElement(e) && e.type === tt;
|
|
226
197
|
}
|
|
227
198
|
function rt(e, t) {
|
|
228
|
-
const n = {
|
|
229
|
-
...t
|
|
230
|
-
};
|
|
199
|
+
const n = { ...t };
|
|
231
200
|
for (const o in t) {
|
|
232
201
|
const s = e[o], r = t[o];
|
|
233
|
-
/^on[A-Z]/.test(o) ? s && r ? n[o] = (...
|
|
234
|
-
r(...
|
|
235
|
-
} : s && (n[o] = s) : o === "style" ? n[o] = {
|
|
236
|
-
...s,
|
|
237
|
-
...r
|
|
238
|
-
} : o === "className" && (n[o] = [
|
|
239
|
-
s,
|
|
240
|
-
r
|
|
241
|
-
].filter(Boolean).join(" "));
|
|
202
|
+
/^on[A-Z]/.test(o) ? s && r ? n[o] = (...c) => {
|
|
203
|
+
r(...c), s(...c);
|
|
204
|
+
} : s && (n[o] = s) : o === "style" ? n[o] = { ...s, ...r } : o === "className" && (n[o] = [s, r].filter(Boolean).join(" "));
|
|
242
205
|
}
|
|
243
|
-
return {
|
|
244
|
-
...e,
|
|
245
|
-
...n
|
|
246
|
-
};
|
|
206
|
+
return { ...e, ...n };
|
|
247
207
|
}
|
|
248
208
|
function ot(e) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
[
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
function
|
|
277
|
-
const f = r(e + "CollectionConsumer",
|
|
278
|
-
return
|
|
279
|
-
const
|
|
280
|
-
if (
|
|
281
|
-
const
|
|
209
|
+
var o, s;
|
|
210
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
211
|
+
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);
|
|
212
|
+
}
|
|
213
|
+
function st(e) {
|
|
214
|
+
const t = e + "CollectionProvider", [n, o] = te(t), [s, r] = n(
|
|
215
|
+
t,
|
|
216
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
217
|
+
), i = (h) => {
|
|
218
|
+
const { scope: f, children: y } = h, v = P.useRef(null), _ = P.useRef(/* @__PURE__ */ new Map()).current;
|
|
219
|
+
return /* @__PURE__ */ m(s, { scope: f, itemMap: _, collectionRef: v, children: y });
|
|
220
|
+
};
|
|
221
|
+
i.displayName = t;
|
|
222
|
+
const c = e + "CollectionSlot", u = P.forwardRef(
|
|
223
|
+
(h, f) => {
|
|
224
|
+
const { scope: y, children: v } = h, _ = r(c, y), w = W(f, _.collectionRef);
|
|
225
|
+
return /* @__PURE__ */ m(k, { ref: w, children: v });
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
u.displayName = c;
|
|
229
|
+
const l = e + "CollectionItemSlot", g = "data-radix-collection-item", d = P.forwardRef(
|
|
230
|
+
(h, f) => {
|
|
231
|
+
const { scope: y, children: v, ..._ } = h, w = P.useRef(null), E = W(f, w), N = r(l, y);
|
|
232
|
+
return P.useEffect(() => (N.itemMap.set(w, { ref: w, ..._ }), () => void N.itemMap.delete(w))), /* @__PURE__ */ m(k, { [g]: "", ref: E, children: v });
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
d.displayName = l;
|
|
236
|
+
function b(h) {
|
|
237
|
+
const f = r(e + "CollectionConsumer", h);
|
|
238
|
+
return P.useCallback(() => {
|
|
239
|
+
const v = f.collectionRef.current;
|
|
240
|
+
if (!v) return [];
|
|
241
|
+
const _ = Array.from(v.querySelectorAll(`[${g}]`));
|
|
282
242
|
return Array.from(f.itemMap.values()).sort(
|
|
283
|
-
(
|
|
243
|
+
(N, A) => _.indexOf(N.ref.current) - _.indexOf(A.ref.current)
|
|
284
244
|
);
|
|
285
|
-
}, [
|
|
286
|
-
f.collectionRef,
|
|
287
|
-
f.itemMap
|
|
288
|
-
]);
|
|
245
|
+
}, [f.collectionRef, f.itemMap]);
|
|
289
246
|
}
|
|
290
247
|
return [
|
|
291
|
-
{
|
|
292
|
-
|
|
293
|
-
Slot: u,
|
|
294
|
-
ItemSlot: l
|
|
295
|
-
},
|
|
296
|
-
m,
|
|
248
|
+
{ Provider: i, Slot: u, ItemSlot: d },
|
|
249
|
+
b,
|
|
297
250
|
o
|
|
298
251
|
];
|
|
299
252
|
}
|
|
300
|
-
|
|
301
|
-
},
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
(o) => o ?? String(st++)
|
|
309
|
-
);
|
|
310
|
-
}, [
|
|
311
|
-
e
|
|
312
|
-
]), e || (t ? `radix-${t}` : "");
|
|
253
|
+
var H = globalThis != null && globalThis.document ? a.useLayoutEffect : () => {
|
|
254
|
+
}, it = a.useId || (() => {
|
|
255
|
+
}), ct = 0;
|
|
256
|
+
function be(e) {
|
|
257
|
+
const [t, n] = a.useState(it());
|
|
258
|
+
return H(() => {
|
|
259
|
+
e || n((o) => o ?? String(ct++));
|
|
260
|
+
}, [e]), e || (t ? `radix-${t}` : "");
|
|
313
261
|
}
|
|
314
|
-
|
|
262
|
+
var at = [
|
|
315
263
|
"a",
|
|
316
264
|
"button",
|
|
317
265
|
"div",
|
|
@@ -328,212 +276,190 @@ const at = [
|
|
|
328
276
|
"span",
|
|
329
277
|
"svg",
|
|
330
278
|
"ul"
|
|
331
|
-
],
|
|
332
|
-
const n =
|
|
333
|
-
const { asChild: r, ...
|
|
334
|
-
return
|
|
335
|
-
window[Symbol.for("radix-ui")] = !0;
|
|
336
|
-
}, []), /* @__PURE__ */ g(a, C({}, c, {
|
|
337
|
-
ref: s
|
|
338
|
-
}));
|
|
279
|
+
], D = at.reduce((e, t) => {
|
|
280
|
+
const n = a.forwardRef((o, s) => {
|
|
281
|
+
const { asChild: r, ...i } = o, c = r ? k : t;
|
|
282
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(c, { ...i, ref: s });
|
|
339
283
|
});
|
|
340
|
-
return n.displayName = `Primitive.${t}`, {
|
|
341
|
-
...e,
|
|
342
|
-
[t]: n
|
|
343
|
-
};
|
|
284
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
344
285
|
}, {});
|
|
345
|
-
function
|
|
346
|
-
const t =
|
|
347
|
-
return
|
|
286
|
+
function ne(e) {
|
|
287
|
+
const t = a.useRef(e);
|
|
288
|
+
return a.useEffect(() => {
|
|
348
289
|
t.current = e;
|
|
349
|
-
}),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
290
|
+
}), a.useMemo(() => (...n) => {
|
|
291
|
+
var o;
|
|
292
|
+
return (o = t.current) == null ? void 0 : o.call(t, ...n);
|
|
293
|
+
}, []);
|
|
294
|
+
}
|
|
295
|
+
function ve({
|
|
296
|
+
prop: e,
|
|
297
|
+
defaultProp: t,
|
|
298
|
+
onChange: n = () => {
|
|
299
|
+
}
|
|
300
|
+
}) {
|
|
301
|
+
const [o, s] = ut({ defaultProp: t, onChange: n }), r = e !== void 0, i = r ? e : o, c = ne(n), u = a.useCallback(
|
|
302
|
+
(l) => {
|
|
303
|
+
if (r) {
|
|
304
|
+
const d = typeof l == "function" ? l(e) : l;
|
|
305
|
+
d !== e && c(d);
|
|
306
|
+
} else
|
|
307
|
+
s(l);
|
|
353
308
|
},
|
|
354
|
-
[]
|
|
309
|
+
[r, e, s, c]
|
|
355
310
|
);
|
|
311
|
+
return [i, u];
|
|
356
312
|
}
|
|
357
|
-
function
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (r) {
|
|
364
|
-
const l = typeof i == "function" ? i(e) : i;
|
|
365
|
-
l !== e && a(l);
|
|
366
|
-
} else s(i);
|
|
367
|
-
}, [
|
|
368
|
-
r,
|
|
369
|
-
e,
|
|
370
|
-
s,
|
|
371
|
-
a
|
|
372
|
-
]);
|
|
373
|
-
return [
|
|
374
|
-
c,
|
|
375
|
-
u
|
|
376
|
-
];
|
|
377
|
-
}
|
|
378
|
-
function it({ defaultProp: e, onChange: t }) {
|
|
379
|
-
const n = F(e), [o] = n, s = R(o), r = ie(t);
|
|
380
|
-
return N(() => {
|
|
313
|
+
function ut({
|
|
314
|
+
defaultProp: e,
|
|
315
|
+
onChange: t
|
|
316
|
+
}) {
|
|
317
|
+
const n = a.useState(e), [o] = n, s = a.useRef(o), r = ne(t);
|
|
318
|
+
return a.useEffect(() => {
|
|
381
319
|
s.current !== o && (r(o), s.current = o);
|
|
382
|
-
}, [
|
|
383
|
-
o,
|
|
384
|
-
s,
|
|
385
|
-
r
|
|
386
|
-
]), n;
|
|
320
|
+
}, [o, s, r]), n;
|
|
387
321
|
}
|
|
388
|
-
|
|
389
|
-
function
|
|
390
|
-
const t =
|
|
322
|
+
var lt = a.createContext(void 0);
|
|
323
|
+
function he(e) {
|
|
324
|
+
const t = a.useContext(lt);
|
|
391
325
|
return e || t || "ltr";
|
|
392
326
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
ref: t
|
|
404
|
-
}))))), mt = /* @__PURE__ */ w((e, t) => {
|
|
405
|
-
const { __scopeRovingFocusGroup: n, orientation: o, loop: s = !1, dir: r, currentTabStopId: c, defaultCurrentTabStopId: a, onCurrentTabStopIdChange: u, onEntryFocus: i, ...p } = e, l = R(null), m = X(t, l), _ = Se(r), [f = null, h] = ye({
|
|
406
|
-
prop: c,
|
|
407
|
-
defaultProp: a,
|
|
408
|
-
onChange: u
|
|
409
|
-
}), [$, b] = F(!1), v = ie(i), U = we(n), y = R(!1), [j, V] = F(0);
|
|
410
|
-
return N(() => {
|
|
411
|
-
const x = l.current;
|
|
412
|
-
if (x)
|
|
413
|
-
return x.addEventListener(te, v), () => x.removeEventListener(te, v);
|
|
414
|
-
}, [
|
|
415
|
-
v
|
|
416
|
-
]), /* @__PURE__ */ g(pt, {
|
|
417
|
-
scope: n,
|
|
327
|
+
var J = "rovingFocusGroup.onEntryFocus", dt = { bubbles: !1, cancelable: !0 }, K = "RovingFocusGroup", [ee, ye, ft] = st(K), [pt, Ce] = te(
|
|
328
|
+
K,
|
|
329
|
+
[ft]
|
|
330
|
+
), [mt, _t] = pt(K), we = a.forwardRef(
|
|
331
|
+
(e, t) => /* @__PURE__ */ m(ee.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(ee.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(gt, { ...e, ref: t }) }) })
|
|
332
|
+
);
|
|
333
|
+
we.displayName = K;
|
|
334
|
+
var gt = a.forwardRef((e, t) => {
|
|
335
|
+
const {
|
|
336
|
+
__scopeRovingFocusGroup: n,
|
|
418
337
|
orientation: o,
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
currentTabStopId:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
338
|
+
loop: s = !1,
|
|
339
|
+
dir: r,
|
|
340
|
+
currentTabStopId: i,
|
|
341
|
+
defaultCurrentTabStopId: c,
|
|
342
|
+
onCurrentTabStopIdChange: u,
|
|
343
|
+
onEntryFocus: l,
|
|
344
|
+
preventScrollOnEntryFocus: g = !1,
|
|
345
|
+
...d
|
|
346
|
+
} = e, b = a.useRef(null), h = W(t, b), f = he(r), [y = null, v] = ve({
|
|
347
|
+
prop: i,
|
|
348
|
+
defaultProp: c,
|
|
349
|
+
onChange: u
|
|
350
|
+
}), [_, w] = a.useState(!1), E = ne(l), N = ye(n), A = a.useRef(!1), [L, q] = a.useState(0);
|
|
351
|
+
return a.useEffect(() => {
|
|
352
|
+
const I = b.current;
|
|
353
|
+
if (I)
|
|
354
|
+
return I.addEventListener(J, E), () => I.removeEventListener(J, E);
|
|
355
|
+
}, [E]), /* @__PURE__ */ m(
|
|
356
|
+
mt,
|
|
357
|
+
{
|
|
358
|
+
scope: n,
|
|
359
|
+
orientation: o,
|
|
360
|
+
dir: f,
|
|
361
|
+
loop: s,
|
|
362
|
+
currentTabStopId: y,
|
|
363
|
+
onItemFocus: a.useCallback(
|
|
364
|
+
(I) => v(I),
|
|
365
|
+
[v]
|
|
435
366
|
),
|
|
436
|
-
[]
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
(x) => x - 1
|
|
367
|
+
onItemShiftTab: a.useCallback(() => w(!0), []),
|
|
368
|
+
onFocusableItemAdd: a.useCallback(
|
|
369
|
+
() => q((I) => I + 1),
|
|
370
|
+
[]
|
|
441
371
|
),
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
].filter(Boolean).map(
|
|
472
|
-
(d) => d.ref.current
|
|
473
|
-
);
|
|
474
|
-
Ne(Y);
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
y.current = !1;
|
|
478
|
-
}),
|
|
479
|
-
onBlur: O(
|
|
480
|
-
e.onBlur,
|
|
481
|
-
() => b(!1)
|
|
482
|
-
)
|
|
483
|
-
})));
|
|
484
|
-
}), _t = "RovingFocusGroupItem", vt = /* @__PURE__ */ w((e, t) => {
|
|
485
|
-
const { __scopeRovingFocusGroup: n, focusable: o = !0, active: s = !1, tabStopId: r, ...c } = e, a = Ce(), u = r || a, i = bt(_t, n), p = i.currentTabStopId === u, l = we(n), { onFocusableItemAdd: m, onFocusableItemRemove: _ } = i;
|
|
486
|
-
return N(() => {
|
|
487
|
-
if (o)
|
|
488
|
-
return m(), () => _();
|
|
489
|
-
}, [
|
|
490
|
-
o,
|
|
491
|
-
m,
|
|
492
|
-
_
|
|
493
|
-
]), /* @__PURE__ */ g(ce.ItemSlot, {
|
|
494
|
-
scope: n,
|
|
495
|
-
id: u,
|
|
496
|
-
focusable: o,
|
|
497
|
-
active: s
|
|
498
|
-
}, /* @__PURE__ */ g(G.span, C({
|
|
499
|
-
tabIndex: p ? 0 : -1,
|
|
500
|
-
"data-orientation": i.orientation
|
|
501
|
-
}, c, {
|
|
502
|
-
ref: t,
|
|
503
|
-
onMouseDown: O(e.onMouseDown, (f) => {
|
|
504
|
-
o ? i.onItemFocus(u) : f.preventDefault();
|
|
505
|
-
}),
|
|
506
|
-
onFocus: O(
|
|
507
|
-
e.onFocus,
|
|
508
|
-
() => i.onItemFocus(u)
|
|
509
|
-
),
|
|
510
|
-
onKeyDown: O(e.onKeyDown, (f) => {
|
|
511
|
-
if (f.key === "Tab" && f.shiftKey) {
|
|
512
|
-
i.onItemShiftTab();
|
|
513
|
-
return;
|
|
514
|
-
}
|
|
515
|
-
if (f.target !== f.currentTarget) return;
|
|
516
|
-
const h = xt(f, i.orientation, i.dir);
|
|
517
|
-
if (h !== void 0) {
|
|
518
|
-
f.preventDefault();
|
|
519
|
-
let b = l().filter(
|
|
520
|
-
(v) => v.focusable
|
|
521
|
-
).map(
|
|
522
|
-
(v) => v.ref.current
|
|
523
|
-
);
|
|
524
|
-
if (h === "last") b.reverse();
|
|
525
|
-
else if (h === "prev" || h === "next") {
|
|
526
|
-
h === "prev" && b.reverse();
|
|
527
|
-
const v = b.indexOf(f.currentTarget);
|
|
528
|
-
b = i.loop ? It(b, v + 1) : b.slice(v + 1);
|
|
372
|
+
onFocusableItemRemove: a.useCallback(
|
|
373
|
+
() => q((I) => I - 1),
|
|
374
|
+
[]
|
|
375
|
+
),
|
|
376
|
+
children: /* @__PURE__ */ m(
|
|
377
|
+
D.div,
|
|
378
|
+
{
|
|
379
|
+
tabIndex: _ || L === 0 ? -1 : 0,
|
|
380
|
+
"data-orientation": o,
|
|
381
|
+
...d,
|
|
382
|
+
ref: h,
|
|
383
|
+
style: { outline: "none", ...e.style },
|
|
384
|
+
onMouseDown: x(e.onMouseDown, () => {
|
|
385
|
+
A.current = !0;
|
|
386
|
+
}),
|
|
387
|
+
onFocus: x(e.onFocus, (I) => {
|
|
388
|
+
const V = !A.current;
|
|
389
|
+
if (I.target === I.currentTarget && V && !_) {
|
|
390
|
+
const F = new CustomEvent(J, dt);
|
|
391
|
+
if (I.currentTarget.dispatchEvent(F), !F.defaultPrevented) {
|
|
392
|
+
const M = N().filter((C) => C.focusable), z = M.find((C) => C.active), Y = M.find((C) => C.id === y), p = [z, Y, ...M].filter(
|
|
393
|
+
Boolean
|
|
394
|
+
).map((C) => C.ref.current);
|
|
395
|
+
Ne(p, g);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
A.current = !1;
|
|
399
|
+
}),
|
|
400
|
+
onBlur: x(e.onBlur, () => w(!1))
|
|
529
401
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
402
|
+
)
|
|
403
|
+
}
|
|
404
|
+
);
|
|
405
|
+
}), Ie = "RovingFocusGroupItem", Se = a.forwardRef(
|
|
406
|
+
(e, t) => {
|
|
407
|
+
const {
|
|
408
|
+
__scopeRovingFocusGroup: n,
|
|
409
|
+
focusable: o = !0,
|
|
410
|
+
active: s = !1,
|
|
411
|
+
tabStopId: r,
|
|
412
|
+
...i
|
|
413
|
+
} = e, c = be(), u = r || c, l = _t(Ie, n), g = l.currentTabStopId === u, d = ye(n), { onFocusableItemAdd: b, onFocusableItemRemove: h } = l;
|
|
414
|
+
return a.useEffect(() => {
|
|
415
|
+
if (o)
|
|
416
|
+
return b(), () => h();
|
|
417
|
+
}, [o, b, h]), /* @__PURE__ */ m(
|
|
418
|
+
ee.ItemSlot,
|
|
419
|
+
{
|
|
420
|
+
scope: n,
|
|
421
|
+
id: u,
|
|
422
|
+
focusable: o,
|
|
423
|
+
active: s,
|
|
424
|
+
children: /* @__PURE__ */ m(
|
|
425
|
+
D.span,
|
|
426
|
+
{
|
|
427
|
+
tabIndex: g ? 0 : -1,
|
|
428
|
+
"data-orientation": l.orientation,
|
|
429
|
+
...i,
|
|
430
|
+
ref: t,
|
|
431
|
+
onMouseDown: x(e.onMouseDown, (f) => {
|
|
432
|
+
o ? l.onItemFocus(u) : f.preventDefault();
|
|
433
|
+
}),
|
|
434
|
+
onFocus: x(e.onFocus, () => l.onItemFocus(u)),
|
|
435
|
+
onKeyDown: x(e.onKeyDown, (f) => {
|
|
436
|
+
if (f.key === "Tab" && f.shiftKey) {
|
|
437
|
+
l.onItemShiftTab();
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (f.target !== f.currentTarget) return;
|
|
441
|
+
const y = ht(f, l.orientation, l.dir);
|
|
442
|
+
if (y !== void 0) {
|
|
443
|
+
if (f.metaKey || f.ctrlKey || f.altKey || f.shiftKey) return;
|
|
444
|
+
f.preventDefault();
|
|
445
|
+
let _ = d().filter((w) => w.focusable).map((w) => w.ref.current);
|
|
446
|
+
if (y === "last") _.reverse();
|
|
447
|
+
else if (y === "prev" || y === "next") {
|
|
448
|
+
y === "prev" && _.reverse();
|
|
449
|
+
const w = _.indexOf(f.currentTarget);
|
|
450
|
+
_ = l.loop ? yt(_, w + 1) : _.slice(w + 1);
|
|
451
|
+
}
|
|
452
|
+
setTimeout(() => Ne(_));
|
|
453
|
+
}
|
|
454
|
+
})
|
|
455
|
+
}
|
|
456
|
+
)
|
|
533
457
|
}
|
|
534
|
-
|
|
535
|
-
}
|
|
536
|
-
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
Se.displayName = Ie;
|
|
462
|
+
var bt = {
|
|
537
463
|
ArrowLeft: "prev",
|
|
538
464
|
ArrowUp: "prev",
|
|
539
465
|
ArrowRight: "next",
|
|
@@ -543,48 +469,33 @@ const te = "rovingFocusGroup.onEntryFocus", dt = {
|
|
|
543
469
|
PageDown: "last",
|
|
544
470
|
End: "last"
|
|
545
471
|
};
|
|
546
|
-
function
|
|
472
|
+
function vt(e, t) {
|
|
547
473
|
return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
|
|
548
474
|
}
|
|
549
|
-
function
|
|
550
|
-
const o =
|
|
551
|
-
if (!(t === "vertical" && [
|
|
552
|
-
|
|
553
|
-
"ArrowRight"
|
|
554
|
-
].includes(o)) && !(t === "horizontal" && [
|
|
555
|
-
"ArrowUp",
|
|
556
|
-
"ArrowDown"
|
|
557
|
-
].includes(o)))
|
|
558
|
-
return gt[o];
|
|
475
|
+
function ht(e, t, n) {
|
|
476
|
+
const o = vt(e.key, n);
|
|
477
|
+
if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
|
|
478
|
+
return bt[o];
|
|
559
479
|
}
|
|
560
|
-
function Ne(e) {
|
|
561
|
-
const
|
|
562
|
-
for (const
|
|
563
|
-
if (
|
|
480
|
+
function Ne(e, t = !1) {
|
|
481
|
+
const n = document.activeElement;
|
|
482
|
+
for (const o of e)
|
|
483
|
+
if (o === n || (o.focus({ preventScroll: t }), document.activeElement !== n)) return;
|
|
564
484
|
}
|
|
565
|
-
function
|
|
566
|
-
return e.map(
|
|
567
|
-
(n, o) => e[(t + o) % e.length]
|
|
568
|
-
);
|
|
485
|
+
function yt(e, t) {
|
|
486
|
+
return e.map((n, o) => e[(t + o) % e.length]);
|
|
569
487
|
}
|
|
570
|
-
|
|
571
|
-
function
|
|
572
|
-
return
|
|
573
|
-
const s = t[n][o];
|
|
574
|
-
return s ?? n;
|
|
575
|
-
}, e);
|
|
488
|
+
var Ct = we, wt = Se;
|
|
489
|
+
function It(e, t) {
|
|
490
|
+
return a.useReducer((n, o) => t[n][o] ?? n, e);
|
|
576
491
|
}
|
|
577
|
-
|
|
578
|
-
const { present: t, children: n } = e, o =
|
|
579
|
-
|
|
580
|
-
}) : P.only(n), r = X(o.ref, s.ref);
|
|
581
|
-
return typeof n == "function" || o.isPresent ? /* @__PURE__ */ se(s, {
|
|
582
|
-
ref: r
|
|
583
|
-
}) : null;
|
|
492
|
+
var Re = (e) => {
|
|
493
|
+
const { present: t, children: n } = e, o = St(t), s = typeof n == "function" ? n({ present: o.isPresent }) : a.Children.only(n), r = W(o.ref, Nt(s));
|
|
494
|
+
return typeof n == "function" || o.isPresent ? a.cloneElement(s, { ref: r }) : null;
|
|
584
495
|
};
|
|
585
|
-
|
|
586
|
-
function
|
|
587
|
-
const [t, n] =
|
|
496
|
+
Re.displayName = "Presence";
|
|
497
|
+
function St(e) {
|
|
498
|
+
const [t, n] = a.useState(), o = a.useRef({}), s = a.useRef(e), r = a.useRef("none"), i = e ? "mounted" : "unmounted", [c, u] = It(i, {
|
|
588
499
|
mounted: {
|
|
589
500
|
UNMOUNT: "unmounted",
|
|
590
501
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -597,159 +508,195 @@ function wt(e) {
|
|
|
597
508
|
MOUNT: "mounted"
|
|
598
509
|
}
|
|
599
510
|
});
|
|
600
|
-
return
|
|
601
|
-
const
|
|
602
|
-
r.current =
|
|
603
|
-
}, [
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
const m = r.current, _ = Z(i);
|
|
609
|
-
e ? u("MOUNT") : _ === "none" || (i == null ? void 0 : i.display) === "none" ? u("UNMOUNT") : u(p && m !== _ ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
|
|
511
|
+
return a.useEffect(() => {
|
|
512
|
+
const l = G(o.current);
|
|
513
|
+
r.current = c === "mounted" ? l : "none";
|
|
514
|
+
}, [c]), H(() => {
|
|
515
|
+
const l = o.current, g = s.current;
|
|
516
|
+
if (g !== e) {
|
|
517
|
+
const b = r.current, h = G(l);
|
|
518
|
+
e ? u("MOUNT") : h === "none" || (l == null ? void 0 : l.display) === "none" ? u("UNMOUNT") : u(g && b !== h ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
|
|
610
519
|
}
|
|
611
|
-
}, [
|
|
612
|
-
e,
|
|
613
|
-
u
|
|
614
|
-
]), oe(() => {
|
|
520
|
+
}, [e, u]), H(() => {
|
|
615
521
|
if (t) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
522
|
+
let l;
|
|
523
|
+
const g = t.ownerDocument.defaultView ?? window, d = (h) => {
|
|
524
|
+
const y = G(o.current).includes(h.animationName);
|
|
525
|
+
if (h.target === t && y && (u("ANIMATION_END"), !s.current)) {
|
|
526
|
+
const v = t.style.animationFillMode;
|
|
527
|
+
t.style.animationFillMode = "forwards", l = g.setTimeout(() => {
|
|
528
|
+
t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}, b = (h) => {
|
|
532
|
+
h.target === t && (r.current = G(o.current));
|
|
623
533
|
};
|
|
624
|
-
return t.addEventListener("animationstart",
|
|
625
|
-
t.removeEventListener("animationstart",
|
|
534
|
+
return t.addEventListener("animationstart", b), t.addEventListener("animationcancel", d), t.addEventListener("animationend", d), () => {
|
|
535
|
+
g.clearTimeout(l), t.removeEventListener("animationstart", b), t.removeEventListener("animationcancel", d), t.removeEventListener("animationend", d);
|
|
626
536
|
};
|
|
627
537
|
} else
|
|
628
538
|
u("ANIMATION_END");
|
|
629
|
-
}, [
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
isPresent: [
|
|
634
|
-
"mounted",
|
|
635
|
-
"unmountSuspended"
|
|
636
|
-
].includes(a),
|
|
637
|
-
ref: L((i) => {
|
|
638
|
-
i && (o.current = getComputedStyle(i)), n(i);
|
|
539
|
+
}, [t, u]), {
|
|
540
|
+
isPresent: ["mounted", "unmountSuspended"].includes(c),
|
|
541
|
+
ref: a.useCallback((l) => {
|
|
542
|
+
l && (o.current = getComputedStyle(l)), n(l);
|
|
639
543
|
}, [])
|
|
640
544
|
};
|
|
641
545
|
}
|
|
642
|
-
function
|
|
546
|
+
function G(e) {
|
|
643
547
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
644
548
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
})
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}), /* @__PURE__ */ g(G.button, C({
|
|
689
|
-
type: "button",
|
|
690
|
-
role: "tab",
|
|
691
|
-
"aria-selected": p,
|
|
692
|
-
"aria-controls": i,
|
|
693
|
-
"data-state": p ? "active" : "inactive",
|
|
694
|
-
"data-disabled": s ? "" : void 0,
|
|
695
|
-
disabled: s,
|
|
696
|
-
id: u
|
|
697
|
-
}, r, {
|
|
698
|
-
ref: t,
|
|
699
|
-
onMouseDown: O(e.onMouseDown, (l) => {
|
|
700
|
-
!s && l.button === 0 && l.ctrlKey === !1 ? c.onValueChange(o) : l.preventDefault();
|
|
701
|
-
}),
|
|
702
|
-
onKeyDown: O(e.onKeyDown, (l) => {
|
|
703
|
-
[
|
|
704
|
-
" ",
|
|
705
|
-
"Enter"
|
|
706
|
-
].includes(l.key) && c.onValueChange(o);
|
|
707
|
-
}),
|
|
708
|
-
onFocus: O(e.onFocus, () => {
|
|
709
|
-
const l = c.activationMode !== "manual";
|
|
710
|
-
!p && !s && l && c.onValueChange(o);
|
|
711
|
-
})
|
|
712
|
-
})));
|
|
713
|
-
}), Ot = "TabsContent", Ft = /* @__PURE__ */ w((e, t) => {
|
|
714
|
-
const { __scopeTabs: n, value: o, forceMount: s, children: r, ...c } = e, a = de(Ot, n), u = Re(a.baseId, o), i = Me(a.baseId, o), p = o === a.value, l = R(p);
|
|
715
|
-
return N(() => {
|
|
716
|
-
const m = requestAnimationFrame(
|
|
717
|
-
() => l.current = !1
|
|
549
|
+
function Nt(e) {
|
|
550
|
+
var o, s;
|
|
551
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
552
|
+
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);
|
|
553
|
+
}
|
|
554
|
+
var re = "Tabs", [Rt, Yt] = te(re, [
|
|
555
|
+
Ce
|
|
556
|
+
]), Te = Ce(), [Tt, oe] = Rt(re), xe = a.forwardRef(
|
|
557
|
+
(e, t) => {
|
|
558
|
+
const {
|
|
559
|
+
__scopeTabs: n,
|
|
560
|
+
value: o,
|
|
561
|
+
onValueChange: s,
|
|
562
|
+
defaultValue: r,
|
|
563
|
+
orientation: i = "horizontal",
|
|
564
|
+
dir: c,
|
|
565
|
+
activationMode: u = "automatic",
|
|
566
|
+
...l
|
|
567
|
+
} = e, g = he(c), [d, b] = ve({
|
|
568
|
+
prop: o,
|
|
569
|
+
onChange: s,
|
|
570
|
+
defaultProp: r
|
|
571
|
+
});
|
|
572
|
+
return /* @__PURE__ */ m(
|
|
573
|
+
Tt,
|
|
574
|
+
{
|
|
575
|
+
scope: n,
|
|
576
|
+
baseId: be(),
|
|
577
|
+
value: d,
|
|
578
|
+
onValueChange: b,
|
|
579
|
+
orientation: i,
|
|
580
|
+
dir: g,
|
|
581
|
+
activationMode: u,
|
|
582
|
+
children: /* @__PURE__ */ m(
|
|
583
|
+
D.div,
|
|
584
|
+
{
|
|
585
|
+
dir: g,
|
|
586
|
+
"data-orientation": i,
|
|
587
|
+
...l,
|
|
588
|
+
ref: t
|
|
589
|
+
}
|
|
590
|
+
)
|
|
591
|
+
}
|
|
718
592
|
);
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
},
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
593
|
+
}
|
|
594
|
+
);
|
|
595
|
+
xe.displayName = re;
|
|
596
|
+
var Ee = "TabsList", Ae = a.forwardRef(
|
|
597
|
+
(e, t) => {
|
|
598
|
+
const { __scopeTabs: n, loop: o = !0, ...s } = e, r = oe(Ee, n), i = Te(n);
|
|
599
|
+
return /* @__PURE__ */ m(
|
|
600
|
+
Ct,
|
|
601
|
+
{
|
|
602
|
+
asChild: !0,
|
|
603
|
+
...i,
|
|
604
|
+
orientation: r.orientation,
|
|
605
|
+
dir: r.dir,
|
|
606
|
+
loop: o,
|
|
607
|
+
children: /* @__PURE__ */ m(
|
|
608
|
+
D.div,
|
|
609
|
+
{
|
|
610
|
+
role: "tablist",
|
|
611
|
+
"aria-orientation": r.orientation,
|
|
612
|
+
...s,
|
|
613
|
+
ref: t
|
|
614
|
+
}
|
|
615
|
+
)
|
|
738
616
|
}
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
617
|
+
);
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
Ae.displayName = Ee;
|
|
621
|
+
var Me = "TabsTrigger", Pe = a.forwardRef(
|
|
622
|
+
(e, t) => {
|
|
623
|
+
const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, i = oe(Me, n), c = Te(n), u = $e(i.baseId, o), l = De(i.baseId, o), g = o === i.value;
|
|
624
|
+
return /* @__PURE__ */ m(
|
|
625
|
+
wt,
|
|
626
|
+
{
|
|
627
|
+
asChild: !0,
|
|
628
|
+
...c,
|
|
629
|
+
focusable: !s,
|
|
630
|
+
active: g,
|
|
631
|
+
children: /* @__PURE__ */ m(
|
|
632
|
+
D.button,
|
|
633
|
+
{
|
|
634
|
+
type: "button",
|
|
635
|
+
role: "tab",
|
|
636
|
+
"aria-selected": g,
|
|
637
|
+
"aria-controls": l,
|
|
638
|
+
"data-state": g ? "active" : "inactive",
|
|
639
|
+
"data-disabled": s ? "" : void 0,
|
|
640
|
+
disabled: s,
|
|
641
|
+
id: u,
|
|
642
|
+
...r,
|
|
643
|
+
ref: t,
|
|
644
|
+
onMouseDown: x(e.onMouseDown, (d) => {
|
|
645
|
+
!s && d.button === 0 && d.ctrlKey === !1 ? i.onValueChange(o) : d.preventDefault();
|
|
646
|
+
}),
|
|
647
|
+
onKeyDown: x(e.onKeyDown, (d) => {
|
|
648
|
+
[" ", "Enter"].includes(d.key) && i.onValueChange(o);
|
|
649
|
+
}),
|
|
650
|
+
onFocus: x(e.onFocus, () => {
|
|
651
|
+
const d = i.activationMode !== "manual";
|
|
652
|
+
!g && !s && d && i.onValueChange(o);
|
|
653
|
+
})
|
|
654
|
+
}
|
|
655
|
+
)
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
);
|
|
660
|
+
Pe.displayName = Me;
|
|
661
|
+
var Oe = "TabsContent", Fe = a.forwardRef(
|
|
662
|
+
(e, t) => {
|
|
663
|
+
const { __scopeTabs: n, value: o, forceMount: s, children: r, ...i } = e, c = oe(Oe, n), u = $e(c.baseId, o), l = De(c.baseId, o), g = o === c.value, d = a.useRef(g);
|
|
664
|
+
return a.useEffect(() => {
|
|
665
|
+
const b = requestAnimationFrame(() => d.current = !1);
|
|
666
|
+
return () => cancelAnimationFrame(b);
|
|
667
|
+
}, []), /* @__PURE__ */ m(Re, { present: s || g, children: ({ present: b }) => /* @__PURE__ */ m(
|
|
668
|
+
D.div,
|
|
669
|
+
{
|
|
670
|
+
"data-state": g ? "active" : "inactive",
|
|
671
|
+
"data-orientation": c.orientation,
|
|
672
|
+
role: "tabpanel",
|
|
673
|
+
"aria-labelledby": u,
|
|
674
|
+
hidden: !b,
|
|
675
|
+
id: l,
|
|
676
|
+
tabIndex: 0,
|
|
677
|
+
...i,
|
|
678
|
+
ref: t,
|
|
679
|
+
style: {
|
|
680
|
+
...e.style,
|
|
681
|
+
animationDuration: d.current ? "0s" : void 0
|
|
682
|
+
},
|
|
683
|
+
children: b && r
|
|
684
|
+
}
|
|
685
|
+
) });
|
|
686
|
+
}
|
|
687
|
+
);
|
|
688
|
+
Fe.displayName = Oe;
|
|
689
|
+
function $e(e, t) {
|
|
743
690
|
return `${e}-trigger-${t}`;
|
|
744
691
|
}
|
|
745
|
-
function
|
|
692
|
+
function De(e, t) {
|
|
746
693
|
return `${e}-content-${t}`;
|
|
747
694
|
}
|
|
748
|
-
|
|
749
|
-
function
|
|
695
|
+
var xt = xe, Et = Ae, At = Pe, Mt = Fe;
|
|
696
|
+
function Pt(e) {
|
|
750
697
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
751
698
|
}
|
|
752
|
-
var
|
|
699
|
+
var Le = { exports: {} };
|
|
753
700
|
/*!
|
|
754
701
|
Copyright (c) 2018 Jed Watson.
|
|
755
702
|
Licensed under the MIT License (MIT), see
|
|
@@ -759,9 +706,9 @@ var Oe = { exports: {} };
|
|
|
759
706
|
(function() {
|
|
760
707
|
var t = {}.hasOwnProperty;
|
|
761
708
|
function n() {
|
|
762
|
-
for (var r = "",
|
|
763
|
-
var
|
|
764
|
-
|
|
709
|
+
for (var r = "", i = 0; i < arguments.length; i++) {
|
|
710
|
+
var c = arguments[i];
|
|
711
|
+
c && (r = s(r, o.call(this, c)));
|
|
765
712
|
}
|
|
766
713
|
return r;
|
|
767
714
|
}
|
|
@@ -774,22 +721,22 @@ var Oe = { exports: {} };
|
|
|
774
721
|
return n.apply(this, r);
|
|
775
722
|
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
776
723
|
return r.toString();
|
|
777
|
-
var
|
|
778
|
-
for (var
|
|
779
|
-
t.call(r,
|
|
780
|
-
return
|
|
724
|
+
var i = "";
|
|
725
|
+
for (var c in r)
|
|
726
|
+
t.call(r, c) && r[c] && (i = s(i, this && this[c] || c));
|
|
727
|
+
return i;
|
|
781
728
|
}
|
|
782
|
-
function s(r,
|
|
783
|
-
return
|
|
729
|
+
function s(r, i) {
|
|
730
|
+
return i ? r ? r + " " + i : r + i : r;
|
|
784
731
|
}
|
|
785
732
|
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
|
|
786
733
|
})();
|
|
787
|
-
})(
|
|
788
|
-
var
|
|
789
|
-
const
|
|
734
|
+
})(Le);
|
|
735
|
+
var Ot = Le.exports;
|
|
736
|
+
const se = /* @__PURE__ */ Pt(Ot), Ft = {
|
|
790
737
|
"purpur-tab-content": "_purpur-tab-content_1ugbi_1",
|
|
791
738
|
"purpur-tab-content--force-mount": "_purpur-tab-content--force-mount_1ugbi_15"
|
|
792
|
-
},
|
|
739
|
+
}, $t = se.bind(Ft), de = "purpur-tab-content", Dt = pe(
|
|
793
740
|
({
|
|
794
741
|
children: e,
|
|
795
742
|
tabId: t,
|
|
@@ -797,14 +744,14 @@ const le = /* @__PURE__ */ Vt(Bt), Gt = {
|
|
|
797
744
|
className: o,
|
|
798
745
|
disableForceMount: s,
|
|
799
746
|
...r
|
|
800
|
-
},
|
|
801
|
-
|
|
747
|
+
}, i) => /* @__PURE__ */ m(
|
|
748
|
+
Mt,
|
|
802
749
|
{
|
|
803
|
-
ref:
|
|
804
|
-
className:
|
|
805
|
-
|
|
750
|
+
ref: i,
|
|
751
|
+
className: $t([
|
|
752
|
+
de,
|
|
806
753
|
o,
|
|
807
|
-
{ [`${
|
|
754
|
+
{ [`${de}--force-mount`]: !s }
|
|
808
755
|
]),
|
|
809
756
|
"data-testid": n,
|
|
810
757
|
value: t,
|
|
@@ -813,13 +760,13 @@ const le = /* @__PURE__ */ Vt(Bt), Gt = {
|
|
|
813
760
|
children: e
|
|
814
761
|
}
|
|
815
762
|
)
|
|
816
|
-
),
|
|
763
|
+
), Lt = (e) => !!e && je(e) && !!e.props.name && !!e.props.tabId, qt = {
|
|
817
764
|
"purpur-tab-header": "_purpur-tab-header_18g3c_1",
|
|
818
765
|
"purpur-tab-header--contained": "_purpur-tab-header--contained_18g3c_33",
|
|
819
766
|
"purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_18g3c_33",
|
|
820
767
|
"purpur-tab-header--line": "_purpur-tab-header--line_18g3c_36",
|
|
821
768
|
"purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_18g3c_48"
|
|
822
|
-
},
|
|
769
|
+
}, Vt = se.bind(qt), fe = "purpur-tab-header", Ut = pe(
|
|
823
770
|
({
|
|
824
771
|
index: e,
|
|
825
772
|
tabId: t,
|
|
@@ -827,21 +774,21 @@ const le = /* @__PURE__ */ Vt(Bt), Gt = {
|
|
|
827
774
|
negative: o,
|
|
828
775
|
onFocus: s,
|
|
829
776
|
"data-testid": r,
|
|
830
|
-
children:
|
|
831
|
-
},
|
|
832
|
-
|
|
777
|
+
children: i
|
|
778
|
+
}, c) => /* @__PURE__ */ m(
|
|
779
|
+
At,
|
|
833
780
|
{
|
|
834
781
|
id: `${t}-trigger`,
|
|
835
|
-
className:
|
|
782
|
+
className: Vt([fe, `${fe}--${n}${o ? "-negative" : ""}`]),
|
|
836
783
|
value: t,
|
|
837
784
|
"data-testid": r,
|
|
838
785
|
"data-index": e,
|
|
839
|
-
ref:
|
|
786
|
+
ref: c,
|
|
840
787
|
onFocus: s,
|
|
841
|
-
children:
|
|
788
|
+
children: i
|
|
842
789
|
}
|
|
843
790
|
)
|
|
844
|
-
),
|
|
791
|
+
), Bt = {
|
|
845
792
|
"purpur-tabs__wrapper": "_purpur-tabs__wrapper_1dpqy_1",
|
|
846
793
|
"purpur-tabs__scroll-button": "_purpur-tabs__scroll-button_1dpqy_9",
|
|
847
794
|
"purpur-tabs__scroll-button--left": "_purpur-tabs__scroll-button--left_1dpqy_63",
|
|
@@ -856,158 +803,158 @@ const le = /* @__PURE__ */ Vt(Bt), Gt = {
|
|
|
856
803
|
"purpur-tabs--contained-negative": "_purpur-tabs--contained-negative_1dpqy_103",
|
|
857
804
|
"purpur-tabs__content-container": "_purpur-tabs__content-container_1dpqy_106",
|
|
858
805
|
"purpur-tabs--fullWidth": "_purpur-tabs--fullWidth_1dpqy_115"
|
|
859
|
-
},
|
|
806
|
+
}, Zt = ["line", "contained"], jt = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), O = se.bind(Bt), S = "purpur-tabs", Gt = (e, t) => {
|
|
860
807
|
var u;
|
|
861
808
|
if (typeof (e == null ? void 0 : e.getBoundingClientRect) != "function" || typeof (t == null ? void 0 : t.scroll) != "function")
|
|
862
809
|
return;
|
|
863
|
-
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), s = t.clientWidth, r = parseInt((u = getComputedStyle(t).borderLeftWidth) == null ? void 0 : u.split("px")[0], 10),
|
|
864
|
-
let
|
|
865
|
-
n.right > o.right && (
|
|
866
|
-
},
|
|
810
|
+
const n = e.getBoundingClientRect(), o = t.getBoundingClientRect(), s = t.clientWidth, r = parseInt((u = getComputedStyle(t).borderLeftWidth) == null ? void 0 : u.split("px")[0], 10), i = o.left + (isNaN(r) ? 0 : r);
|
|
811
|
+
let c;
|
|
812
|
+
n.right > o.right && (c = n.left + t.scrollLeft, c = c + n.width - s + s * 0.1, c = c - i), n.left < o.left && (c = n.left + t.scrollLeft, c = c - s * 0.1, c = c - i), c !== void 0 && t.scroll({ left: c, behavior: "smooth" });
|
|
813
|
+
}, Wt = ({
|
|
867
814
|
children: e,
|
|
868
815
|
variant: t = "line",
|
|
869
816
|
negative: n = !1,
|
|
870
817
|
fullWidth: o = !1,
|
|
871
818
|
onChange: s,
|
|
872
819
|
className: r,
|
|
873
|
-
defaultValue:
|
|
874
|
-
"data-testid":
|
|
820
|
+
defaultValue: i,
|
|
821
|
+
"data-testid": c,
|
|
875
822
|
value: u,
|
|
876
|
-
...
|
|
823
|
+
...l
|
|
877
824
|
}) => {
|
|
878
|
-
const [
|
|
825
|
+
const [g, d] = U({}), [b, h] = U(0), [f, y] = U(0), v = B.toArray(e).filter(Lt), _ = ae(), w = ae(new Array(v.length)), E = 200, N = t === "line", A = O([
|
|
879
826
|
S,
|
|
880
827
|
`${S}--${t}${n ? "-negative" : ""}`,
|
|
881
828
|
{ [`${S}--fullWidth`]: o },
|
|
882
829
|
r
|
|
883
|
-
]),
|
|
884
|
-
const
|
|
885
|
-
return
|
|
830
|
+
]), L = B.map(v, ({ props: { tabId: p } }) => p), q = () => {
|
|
831
|
+
const p = L.findIndex((C) => C === i);
|
|
832
|
+
return p >= 0 ? p : 0;
|
|
886
833
|
};
|
|
887
|
-
|
|
888
|
-
u &&
|
|
889
|
-
}, [
|
|
890
|
-
const [
|
|
891
|
-
if (new Set(
|
|
834
|
+
j(() => {
|
|
835
|
+
u && V(v.findIndex((p) => p.props.tabId === u));
|
|
836
|
+
}, [v, u]);
|
|
837
|
+
const [I, V] = U(q);
|
|
838
|
+
if (new Set(L).size !== L.length)
|
|
892
839
|
throw new Error("tabId must be unique");
|
|
893
|
-
const
|
|
894
|
-
if (!
|
|
840
|
+
const F = (p, C) => C || c ? `${C || c}-${p}` : void 0, M = () => {
|
|
841
|
+
if (!N)
|
|
895
842
|
return;
|
|
896
|
-
const
|
|
897
|
-
|
|
898
|
-
},
|
|
899
|
-
|
|
900
|
-
},
|
|
901
|
-
if (
|
|
902
|
-
const { scrollLeft:
|
|
903
|
-
|
|
843
|
+
const p = w.current[I];
|
|
844
|
+
h((p == null ? void 0 : p.offsetLeft) || 0), y((p == null ? void 0 : p.getBoundingClientRect().width) || 0);
|
|
845
|
+
}, z = (p) => {
|
|
846
|
+
N && !u && V(v.findIndex((C) => C.props.tabId === p)), s == null || s(jt(p));
|
|
847
|
+
}, Y = (p) => {
|
|
848
|
+
if (_ != null && _.current) {
|
|
849
|
+
const { scrollLeft: C } = _.current, $ = p === "left" ? -200 : E;
|
|
850
|
+
_.current.scroll({ left: C + $, behavior: "smooth" });
|
|
904
851
|
}
|
|
905
|
-
},
|
|
852
|
+
}, Z = ({ side: p }) => /* @__PURE__ */ m(
|
|
906
853
|
"button",
|
|
907
854
|
{
|
|
908
|
-
className:
|
|
909
|
-
onClick: () =>
|
|
855
|
+
className: O(`${S}__scroll-button`, `${S}__scroll-button--${p}`),
|
|
856
|
+
onClick: () => Y(p),
|
|
910
857
|
type: "button",
|
|
911
858
|
"aria-hidden": "true",
|
|
912
859
|
tabIndex: -1,
|
|
913
|
-
"data-testid":
|
|
914
|
-
children: /* @__PURE__ */
|
|
860
|
+
"data-testid": F("scroll-button"),
|
|
861
|
+
children: /* @__PURE__ */ m(_e, { svg: p === "left" ? Qe : He, size: "md" })
|
|
915
862
|
}
|
|
916
863
|
);
|
|
917
|
-
return
|
|
918
|
-
window.removeEventListener("resize",
|
|
919
|
-
}), []),
|
|
920
|
-
|
|
921
|
-
}, [
|
|
922
|
-
const
|
|
923
|
-
if (
|
|
924
|
-
|
|
864
|
+
return j(() => (window.addEventListener("resize", M), () => {
|
|
865
|
+
window.removeEventListener("resize", M);
|
|
866
|
+
}), []), j(() => {
|
|
867
|
+
M();
|
|
868
|
+
}, [I, o, v.length, t]), j(() => {
|
|
869
|
+
const p = (T) => {
|
|
870
|
+
if (T.every((R) => R.isIntersecting) && T.length === v.length) {
|
|
871
|
+
d({});
|
|
925
872
|
return;
|
|
926
873
|
}
|
|
927
|
-
|
|
928
|
-
const
|
|
929
|
-
|
|
930
|
-
...
|
|
931
|
-
...
|
|
932
|
-
[`${S}__wrapper--scroll-end`]: !
|
|
874
|
+
T.forEach((R) => {
|
|
875
|
+
const ce = Number(R.target.getAttribute("data-index")), qe = ce === 0, Ve = ce === v.length - 1;
|
|
876
|
+
d((Ue) => ({
|
|
877
|
+
...Ue,
|
|
878
|
+
...qe && {
|
|
879
|
+
[`${S}__wrapper--scroll-end`]: !R.isIntersecting
|
|
933
880
|
},
|
|
934
|
-
...
|
|
935
|
-
[`${S}__wrapper--scroll-start`]: !
|
|
881
|
+
...Ve && {
|
|
882
|
+
[`${S}__wrapper--scroll-start`]: !R.isIntersecting
|
|
936
883
|
}
|
|
937
884
|
}));
|
|
938
885
|
});
|
|
939
|
-
},
|
|
886
|
+
}, C = new IntersectionObserver(p, {
|
|
940
887
|
threshold: [0.99],
|
|
941
|
-
root:
|
|
942
|
-
}),
|
|
943
|
-
return
|
|
944
|
-
|
|
888
|
+
root: _.current
|
|
889
|
+
}), $ = w.current;
|
|
890
|
+
return $.forEach((T) => C.observe(T)), () => {
|
|
891
|
+
$.forEach((T) => C.unobserve(T));
|
|
945
892
|
};
|
|
946
|
-
}, [
|
|
947
|
-
|
|
893
|
+
}, [v.length]), /* @__PURE__ */ m(
|
|
894
|
+
xt,
|
|
948
895
|
{
|
|
949
|
-
defaultValue:
|
|
950
|
-
onValueChange:
|
|
951
|
-
"data-testid":
|
|
952
|
-
className:
|
|
896
|
+
defaultValue: i ?? v[0].props.tabId,
|
|
897
|
+
onValueChange: z,
|
|
898
|
+
"data-testid": c,
|
|
899
|
+
className: A,
|
|
953
900
|
value: u,
|
|
954
|
-
...
|
|
955
|
-
children: /* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
|
|
901
|
+
...l,
|
|
902
|
+
children: /* @__PURE__ */ X("div", { className: O(`${S}__container`), children: [
|
|
903
|
+
/* @__PURE__ */ X("div", { className: O([`${S}__wrapper`, g]), children: [
|
|
904
|
+
/* @__PURE__ */ X(
|
|
905
|
+
Et,
|
|
959
906
|
{
|
|
960
|
-
ref: (
|
|
961
|
-
|
|
907
|
+
ref: (p) => {
|
|
908
|
+
_.current = p;
|
|
962
909
|
},
|
|
963
|
-
className:
|
|
910
|
+
className: O(`${S}__list`),
|
|
964
911
|
children: [
|
|
965
|
-
|
|
966
|
-
const { name:
|
|
967
|
-
return /* @__PURE__ */
|
|
968
|
-
|
|
912
|
+
B.map(v, (p, C) => {
|
|
913
|
+
const { name: $, tabId: T, "data-testid": ie } = p.props;
|
|
914
|
+
return /* @__PURE__ */ m(
|
|
915
|
+
Ut,
|
|
969
916
|
{
|
|
970
|
-
"data-testid":
|
|
971
|
-
index:
|
|
972
|
-
tabId:
|
|
973
|
-
ref: (
|
|
974
|
-
|
|
917
|
+
"data-testid": F("header", ie),
|
|
918
|
+
index: C,
|
|
919
|
+
tabId: T,
|
|
920
|
+
ref: (R) => {
|
|
921
|
+
R && (w.current[C] = R);
|
|
975
922
|
},
|
|
976
|
-
onFocus: (
|
|
977
|
-
|
|
923
|
+
onFocus: (R) => {
|
|
924
|
+
Gt(R.target, _.current);
|
|
978
925
|
},
|
|
979
926
|
variant: t,
|
|
980
927
|
negative: n,
|
|
981
|
-
children:
|
|
928
|
+
children: $
|
|
982
929
|
}
|
|
983
930
|
);
|
|
984
931
|
}),
|
|
985
|
-
|
|
932
|
+
N && /* @__PURE__ */ m(
|
|
986
933
|
"div",
|
|
987
934
|
{
|
|
988
|
-
className:
|
|
935
|
+
className: O(`${S}__selected-border`),
|
|
989
936
|
style: {
|
|
990
937
|
width: f,
|
|
991
|
-
transform: `translateX(${
|
|
938
|
+
transform: `translateX(${b}px)`
|
|
992
939
|
},
|
|
993
|
-
"data-testid":
|
|
940
|
+
"data-testid": F("selected-border")
|
|
994
941
|
}
|
|
995
942
|
)
|
|
996
943
|
]
|
|
997
944
|
}
|
|
998
945
|
),
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ m(Z, { side: "left" }),
|
|
947
|
+
/* @__PURE__ */ m(Z, { side: "right" })
|
|
1001
948
|
] }),
|
|
1002
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ m("div", { className: O(`${S}__content-container`), children: B.map(v, (p) => p) })
|
|
1003
950
|
] })
|
|
1004
951
|
}
|
|
1005
952
|
);
|
|
1006
953
|
};
|
|
1007
|
-
|
|
954
|
+
Wt.Content = Dt;
|
|
1008
955
|
export {
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
956
|
+
Wt as Tabs,
|
|
957
|
+
jt as createTabChangeDetailEvent,
|
|
958
|
+
Zt as tabsVariants
|
|
1012
959
|
};
|
|
1013
960
|
//# sourceMappingURL=tabs.es.js.map
|