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