@purpurds/tabs 5.30.1 → 5.32.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,6 +1,6 @@
1
1
  import { jsx as T, jsxs as ee } from "react/jsx-runtime";
2
- import * as me from "react";
3
- import E, { createContext as ne, useMemo as H, createElement as g, useContext as _e, useCallback as U, forwardRef as w, Children as P, isValidElement as K, cloneElement as se, Fragment as qe, useLayoutEffect as Le, useEffect as N, useRef as R, useState as O, useReducer as Ue } from "react";
2
+ import * as _e from "react";
3
+ import E, { createContext as ne, useMemo as H, createElement as g, useContext as ve, useCallback as L, forwardRef as w, Children as P, isValidElement as K, cloneElement as se, Fragment as qe, useLayoutEffect as Le, useEffect as N, useRef as R, useState as O, useReducer as Ue } from "react";
4
4
  import { flushSync as Ve } from "react-dom";
5
5
  function Be(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -114,20 +114,20 @@ function ae(e, t = []) {
114
114
  ...n,
115
115
  c
116
116
  ];
117
- function i(d) {
118
- const { scope: v, children: m, ...f } = d, h = (v == null ? void 0 : v[e][u]) || a, $ = H(
117
+ function i(l) {
118
+ const { scope: m, children: _, ...f } = l, h = (m == null ? void 0 : m[e][u]) || a, $ = H(
119
119
  () => f,
120
120
  Object.values(f)
121
121
  );
122
122
  return /* @__PURE__ */ g(h.Provider, {
123
123
  value: $
124
- }, m);
124
+ }, _);
125
125
  }
126
- function p(d, v) {
127
- const m = (v == null ? void 0 : v[e][u]) || a, f = _e(m);
126
+ function p(l, m) {
127
+ const _ = (m == null ? void 0 : m[e][u]) || a, f = ve(_);
128
128
  if (f) return f;
129
129
  if (c !== void 0) return c;
130
- throw new Error(`\`${d}\` must be used within \`${r}\``);
130
+ throw new Error(`\`${l}\` must be used within \`${r}\``);
131
131
  }
132
132
  return i.displayName = r + "Provider", [
133
133
  i,
@@ -169,10 +169,10 @@ function Je(...e) {
169
169
  );
170
170
  return function(r) {
171
171
  const c = o.reduce((a, { useScope: u, scopeName: i }) => {
172
- const d = u(r)[`__scope${i}`];
172
+ const l = u(r)[`__scope${i}`];
173
173
  return {
174
174
  ...a,
175
- ...d
175
+ ...l
176
176
  };
177
177
  }, {});
178
178
  return H(
@@ -196,7 +196,7 @@ function xe(...e) {
196
196
  );
197
197
  }
198
198
  function X(...e) {
199
- return U(xe(...e), e);
199
+ return L(xe(...e), e);
200
200
  }
201
201
  const J = /* @__PURE__ */ w((e, t) => {
202
202
  const { children: n, ...o } = e, s = P.toArray(n), r = s.find(tt);
@@ -250,30 +250,30 @@ function rt(e) {
250
250
  current: null
251
251
  },
252
252
  itemMap: /* @__PURE__ */ new Map()
253
- }), c = (m) => {
254
- const { scope: f, children: h } = m, $ = E.useRef(null), b = E.useRef(/* @__PURE__ */ new Map()).current;
253
+ }), c = (_) => {
254
+ const { scope: f, children: h } = _, $ = E.useRef(null), b = E.useRef(/* @__PURE__ */ new Map()).current;
255
255
  return /* @__PURE__ */ E.createElement(s, {
256
256
  scope: f,
257
257
  itemMap: b,
258
258
  collectionRef: $
259
259
  }, h);
260
- }, a = e + "CollectionSlot", u = /* @__PURE__ */ E.forwardRef((m, f) => {
261
- const { scope: h, children: $ } = m, b = r(a, h), _ = X(f, b.collectionRef);
260
+ }, a = e + "CollectionSlot", u = /* @__PURE__ */ E.forwardRef((_, f) => {
261
+ const { scope: h, children: $ } = _, b = r(a, h), v = X(f, b.collectionRef);
262
262
  return /* @__PURE__ */ E.createElement(J, {
263
- ref: _
263
+ ref: v
264
264
  }, $);
265
- }), i = e + "CollectionItemSlot", p = "data-radix-collection-item", d = /* @__PURE__ */ E.forwardRef((m, f) => {
266
- const { scope: h, children: $, ...b } = m, _ = E.useRef(null), D = X(f, _), y = r(i, h);
267
- return E.useEffect(() => (y.itemMap.set(_, {
268
- ref: _,
265
+ }), i = e + "CollectionItemSlot", p = "data-radix-collection-item", l = /* @__PURE__ */ E.forwardRef((_, f) => {
266
+ const { scope: h, children: $, ...b } = _, v = E.useRef(null), U = X(f, v), y = r(i, h);
267
+ return E.useEffect(() => (y.itemMap.set(v, {
268
+ ref: v,
269
269
  ...b
270
- }), () => void y.itemMap.delete(_))), /* @__PURE__ */ E.createElement(J, {
270
+ }), () => void y.itemMap.delete(v))), /* @__PURE__ */ E.createElement(J, {
271
271
  [p]: "",
272
- ref: D
272
+ ref: U
273
273
  }, $);
274
274
  });
275
- function v(m) {
276
- const f = r(e + "CollectionConsumer", m);
275
+ function m(_) {
276
+ const f = r(e + "CollectionConsumer", _);
277
277
  return E.useCallback(() => {
278
278
  const $ = f.collectionRef.current;
279
279
  if (!$) return [];
@@ -290,18 +290,18 @@ function rt(e) {
290
290
  {
291
291
  Provider: c,
292
292
  Slot: u,
293
- ItemSlot: d
293
+ ItemSlot: l
294
294
  },
295
- v,
295
+ m,
296
296
  o
297
297
  ];
298
298
  }
299
299
  const oe = globalThis != null && globalThis.document ? Le : () => {
300
- }, ot = me.useId || (() => {
300
+ }, ot = _e.useId || (() => {
301
301
  });
302
302
  let ct = 0;
303
303
  function Ie(e) {
304
- const [t, n] = me.useState(ot());
304
+ const [t, n] = _e.useState(ot());
305
305
  return oe(() => {
306
306
  e || n(
307
307
  (o) => o ?? String(ct++)
@@ -358,10 +358,10 @@ function Ce({ prop: e, defaultProp: t, onChange: n = () => {
358
358
  const [o, s] = at({
359
359
  defaultProp: t,
360
360
  onChange: n
361
- }), r = e !== void 0, c = r ? e : o, a = ie(n), u = U((i) => {
361
+ }), r = e !== void 0, c = r ? e : o, a = ie(n), u = L((i) => {
362
362
  if (r) {
363
- const d = typeof i == "function" ? i(e) : i;
364
- d !== e && a(d);
363
+ const l = typeof i == "function" ? i(e) : i;
364
+ l !== e && a(l);
365
365
  } else s(i);
366
366
  }, [
367
367
  r,
@@ -386,55 +386,55 @@ function at({ defaultProp: e, onChange: t }) {
386
386
  }
387
387
  const it = /* @__PURE__ */ ne(void 0);
388
388
  function ye(e) {
389
- const t = _e(it);
389
+ const t = ve(it);
390
390
  return e || t || "ltr";
391
391
  }
392
392
  const te = "rovingFocusGroup.onEntryFocus", ut = {
393
393
  bubbles: !1,
394
394
  cancelable: !0
395
- }, ue = "RovingFocusGroup", [ce, Se, lt] = rt(ue), [dt, we] = ae(ue, [
396
- lt
397
- ]), [ft, pt] = dt(ue), bt = /* @__PURE__ */ w((e, t) => /* @__PURE__ */ g(ce.Provider, {
395
+ }, ue = "RovingFocusGroup", [ce, Se, dt] = rt(ue), [lt, we] = ae(ue, [
396
+ dt
397
+ ]), [ft, pt] = lt(ue), bt = /* @__PURE__ */ w((e, t) => /* @__PURE__ */ g(ce.Provider, {
398
398
  scope: e.__scopeRovingFocusGroup
399
399
  }, /* @__PURE__ */ g(ce.Slot, {
400
400
  scope: e.__scopeRovingFocusGroup
401
401
  }, /* @__PURE__ */ g($t, C({}, e, {
402
402
  ref: t
403
403
  }))))), $t = /* @__PURE__ */ w((e, t) => {
404
- const { __scopeRovingFocusGroup: n, orientation: o, loop: s = !1, dir: r, currentTabStopId: c, defaultCurrentTabStopId: a, onCurrentTabStopIdChange: u, onEntryFocus: i, ...p } = e, d = R(null), v = X(t, d), m = ye(r), [f = null, h] = Ce({
404
+ 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), _ = ye(r), [f = null, h] = Ce({
405
405
  prop: c,
406
406
  defaultProp: a,
407
407
  onChange: u
408
- }), [$, b] = O(!1), _ = ie(i), D = Se(n), y = R(!1), [j, V] = O(0);
408
+ }), [$, b] = O(!1), v = ie(i), U = Se(n), y = R(!1), [j, V] = O(0);
409
409
  return N(() => {
410
- const x = d.current;
410
+ const x = l.current;
411
411
  if (x)
412
- return x.addEventListener(te, _), () => x.removeEventListener(te, _);
412
+ return x.addEventListener(te, v), () => x.removeEventListener(te, v);
413
413
  }, [
414
- _
414
+ v
415
415
  ]), /* @__PURE__ */ g(ft, {
416
416
  scope: n,
417
417
  orientation: o,
418
- dir: m,
418
+ dir: _,
419
419
  loop: s,
420
420
  currentTabStopId: f,
421
- onItemFocus: U(
421
+ onItemFocus: L(
422
422
  (x) => h(x),
423
423
  [
424
424
  h
425
425
  ]
426
426
  ),
427
- onItemShiftTab: U(
427
+ onItemShiftTab: L(
428
428
  () => b(!0),
429
429
  []
430
430
  ),
431
- onFocusableItemAdd: U(
431
+ onFocusableItemAdd: L(
432
432
  () => V(
433
433
  (x) => x + 1
434
434
  ),
435
435
  []
436
436
  ),
437
- onFocusableItemRemove: U(
437
+ onFocusableItemRemove: L(
438
438
  () => V(
439
439
  (x) => x - 1
440
440
  ),
@@ -444,7 +444,7 @@ const te = "rovingFocusGroup.onEntryFocus", ut = {
444
444
  tabIndex: $ || j === 0 ? -1 : 0,
445
445
  "data-orientation": o
446
446
  }, p, {
447
- ref: v,
447
+ ref: m,
448
448
  style: {
449
449
  outline: "none",
450
450
  ...e.style
@@ -457,18 +457,18 @@ const te = "rovingFocusGroup.onEntryFocus", ut = {
457
457
  if (x.target === x.currentTarget && W && !$) {
458
458
  const k = new CustomEvent(te, ut);
459
459
  if (x.currentTarget.dispatchEvent(k), !k.defaultPrevented) {
460
- const q = D().filter(
461
- (l) => l.focusable
462
- ), z = q.find(
463
- (l) => l.active
464
- ), Q = q.find(
465
- (l) => l.id === f
460
+ const D = U().filter(
461
+ (d) => d.focusable
462
+ ), z = D.find(
463
+ (d) => d.active
464
+ ), Q = D.find(
465
+ (d) => d.id === f
466
466
  ), Y = [
467
467
  z,
468
468
  Q,
469
- ...q
469
+ ...D
470
470
  ].filter(Boolean).map(
471
- (l) => l.ref.current
471
+ (d) => d.ref.current
472
472
  );
473
473
  Te(Y);
474
474
  }
@@ -480,15 +480,15 @@ const te = "rovingFocusGroup.onEntryFocus", ut = {
480
480
  () => b(!1)
481
481
  )
482
482
  })));
483
- }), vt = "RovingFocusGroupItem", mt = /* @__PURE__ */ w((e, t) => {
484
- const { __scopeRovingFocusGroup: n, focusable: o = !0, active: s = !1, tabStopId: r, ...c } = e, a = Ie(), u = r || a, i = pt(vt, n), p = i.currentTabStopId === u, d = Se(n), { onFocusableItemAdd: v, onFocusableItemRemove: m } = i;
483
+ }), mt = "RovingFocusGroupItem", _t = /* @__PURE__ */ w((e, t) => {
484
+ const { __scopeRovingFocusGroup: n, focusable: o = !0, active: s = !1, tabStopId: r, ...c } = e, a = Ie(), u = r || a, i = pt(mt, n), p = i.currentTabStopId === u, l = Se(n), { onFocusableItemAdd: m, onFocusableItemRemove: _ } = i;
485
485
  return N(() => {
486
486
  if (o)
487
- return v(), () => m();
487
+ return m(), () => _();
488
488
  }, [
489
489
  o,
490
- v,
491
- m
490
+ m,
491
+ _
492
492
  ]), /* @__PURE__ */ g(ce.ItemSlot, {
493
493
  scope: n,
494
494
  id: u,
@@ -515,16 +515,16 @@ const te = "rovingFocusGroup.onEntryFocus", ut = {
515
515
  const h = ht(f, i.orientation, i.dir);
516
516
  if (h !== void 0) {
517
517
  f.preventDefault();
518
- let b = d().filter(
519
- (_) => _.focusable
518
+ let b = l().filter(
519
+ (v) => v.focusable
520
520
  ).map(
521
- (_) => _.ref.current
521
+ (v) => v.ref.current
522
522
  );
523
523
  if (h === "last") b.reverse();
524
524
  else if (h === "prev" || h === "next") {
525
525
  h === "prev" && b.reverse();
526
- const _ = b.indexOf(f.currentTarget);
527
- b = i.loop ? xt(b, _ + 1) : b.slice(_ + 1);
526
+ const v = b.indexOf(f.currentTarget);
527
+ b = i.loop ? xt(b, v + 1) : b.slice(v + 1);
528
528
  }
529
529
  setTimeout(
530
530
  () => Te(b)
@@ -532,7 +532,7 @@ const te = "rovingFocusGroup.onEntryFocus", ut = {
532
532
  }
533
533
  })
534
534
  })));
535
- }), _t = {
535
+ }), vt = {
536
536
  ArrowLeft: "prev",
537
537
  ArrowUp: "prev",
538
538
  ArrowRight: "next",
@@ -554,7 +554,7 @@ function ht(e, t, n) {
554
554
  "ArrowUp",
555
555
  "ArrowDown"
556
556
  ].includes(o)))
557
- return _t[o];
557
+ return vt[o];
558
558
  }
559
559
  function Te(e) {
560
560
  const t = document.activeElement;
@@ -566,7 +566,7 @@ function xt(e, t) {
566
566
  (n, o) => e[(t + o) % e.length]
567
567
  );
568
568
  }
569
- const It = bt, Ct = mt;
569
+ const It = bt, Ct = _t;
570
570
  function yt(e, t) {
571
571
  return Ue((n, o) => {
572
572
  const s = t[n][o];
@@ -604,21 +604,21 @@ function St(e) {
604
604
  ]), oe(() => {
605
605
  const i = o.current, p = s.current;
606
606
  if (p !== e) {
607
- const v = r.current, m = Z(i);
608
- e ? u("MOUNT") : m === "none" || (i == null ? void 0 : i.display) === "none" ? u("UNMOUNT") : u(p && v !== m ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
607
+ const m = r.current, _ = Z(i);
608
+ e ? u("MOUNT") : _ === "none" || (i == null ? void 0 : i.display) === "none" ? u("UNMOUNT") : u(p && m !== _ ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
609
609
  }
610
610
  }, [
611
611
  e,
612
612
  u
613
613
  ]), oe(() => {
614
614
  if (t) {
615
- const i = (d) => {
616
- const m = Z(o.current).includes(d.animationName);
617
- d.target === t && m && Ve(
615
+ const i = (l) => {
616
+ const _ = Z(o.current).includes(l.animationName);
617
+ l.target === t && _ && Ve(
618
618
  () => u("ANIMATION_END")
619
619
  );
620
- }, p = (d) => {
621
- d.target === t && (r.current = Z(o.current));
620
+ }, p = (l) => {
621
+ l.target === t && (r.current = Z(o.current));
622
622
  };
623
623
  return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", i), t.addEventListener("animationend", i), () => {
624
624
  t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", i), t.removeEventListener("animationend", i);
@@ -633,7 +633,7 @@ function St(e) {
633
633
  "mounted",
634
634
  "unmountSuspended"
635
635
  ].includes(a),
636
- ref: U((i) => {
636
+ ref: L((i) => {
637
637
  i && (o.current = getComputedStyle(i)), n(i);
638
638
  }, [])
639
639
  };
@@ -643,8 +643,8 @@ function Z(e) {
643
643
  }
644
644
  const Ae = "Tabs", [wt, nn] = ae(Ae, [
645
645
  we
646
- ]), Ee = we(), [Tt, le] = wt(Ae), Nt = /* @__PURE__ */ w((e, t) => {
647
- const { __scopeTabs: n, value: o, onValueChange: s, defaultValue: r, orientation: c = "horizontal", dir: a, activationMode: u = "automatic", ...i } = e, p = ye(a), [d, v] = Ce({
646
+ ]), Ee = we(), [Tt, de] = wt(Ae), Nt = /* @__PURE__ */ w((e, t) => {
647
+ const { __scopeTabs: n, value: o, onValueChange: s, defaultValue: r, orientation: c = "horizontal", dir: a, activationMode: u = "automatic", ...i } = e, p = ye(a), [l, m] = Ce({
648
648
  prop: o,
649
649
  onChange: s,
650
650
  defaultProp: r
@@ -652,8 +652,8 @@ const Ae = "Tabs", [wt, nn] = ae(Ae, [
652
652
  return /* @__PURE__ */ g(Tt, {
653
653
  scope: n,
654
654
  baseId: Ie(),
655
- value: d,
656
- onValueChange: v,
655
+ value: l,
656
+ onValueChange: m,
657
657
  orientation: c,
658
658
  dir: p,
659
659
  activationMode: u
@@ -664,7 +664,7 @@ const Ae = "Tabs", [wt, nn] = ae(Ae, [
664
664
  ref: t
665
665
  })));
666
666
  }), At = "TabsList", Et = /* @__PURE__ */ w((e, t) => {
667
- const { __scopeTabs: n, loop: o = !0, ...s } = e, r = le(At, n), c = Ee(n);
667
+ const { __scopeTabs: n, loop: o = !0, ...s } = e, r = de(At, n), c = Ee(n);
668
668
  return /* @__PURE__ */ g(It, C({
669
669
  asChild: !0
670
670
  }, c, {
@@ -678,7 +678,7 @@ const Ae = "Tabs", [wt, nn] = ae(Ae, [
678
678
  ref: t
679
679
  })));
680
680
  }), Pt = "TabsTrigger", Rt = /* @__PURE__ */ w((e, t) => {
681
- const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, c = le(Pt, n), a = Ee(n), u = Pe(c.baseId, o), i = Re(c.baseId, o), p = o === c.value;
681
+ const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, c = de(Pt, n), a = Ee(n), u = Pe(c.baseId, o), i = Re(c.baseId, o), p = o === c.value;
682
682
  return /* @__PURE__ */ g(Ct, C({
683
683
  asChild: !0
684
684
  }, a, {
@@ -695,47 +695,47 @@ const Ae = "Tabs", [wt, nn] = ae(Ae, [
695
695
  id: u
696
696
  }, r, {
697
697
  ref: t,
698
- onMouseDown: F(e.onMouseDown, (d) => {
699
- !s && d.button === 0 && d.ctrlKey === !1 ? c.onValueChange(o) : d.preventDefault();
698
+ onMouseDown: F(e.onMouseDown, (l) => {
699
+ !s && l.button === 0 && l.ctrlKey === !1 ? c.onValueChange(o) : l.preventDefault();
700
700
  }),
701
- onKeyDown: F(e.onKeyDown, (d) => {
701
+ onKeyDown: F(e.onKeyDown, (l) => {
702
702
  [
703
703
  " ",
704
704
  "Enter"
705
- ].includes(d.key) && c.onValueChange(o);
705
+ ].includes(l.key) && c.onValueChange(o);
706
706
  }),
707
707
  onFocus: F(e.onFocus, () => {
708
- const d = c.activationMode !== "manual";
709
- !p && !s && d && c.onValueChange(o);
708
+ const l = c.activationMode !== "manual";
709
+ !p && !s && l && c.onValueChange(o);
710
710
  })
711
711
  })));
712
712
  }), Mt = "TabsContent", Ft = /* @__PURE__ */ w((e, t) => {
713
- const { __scopeTabs: n, value: o, forceMount: s, children: r, ...c } = e, a = le(Mt, n), u = Pe(a.baseId, o), i = Re(a.baseId, o), p = o === a.value, d = R(p);
713
+ const { __scopeTabs: n, value: o, forceMount: s, children: r, ...c } = e, a = de(Mt, n), u = Pe(a.baseId, o), i = Re(a.baseId, o), p = o === a.value, l = R(p);
714
714
  return N(() => {
715
- const v = requestAnimationFrame(
716
- () => d.current = !1
715
+ const m = requestAnimationFrame(
716
+ () => l.current = !1
717
717
  );
718
- return () => cancelAnimationFrame(v);
718
+ return () => cancelAnimationFrame(m);
719
719
  }, []), /* @__PURE__ */ g(
720
720
  Ne,
721
721
  {
722
722
  present: s || p
723
723
  },
724
- ({ present: v }) => /* @__PURE__ */ g(G.div, C({
724
+ ({ present: m }) => /* @__PURE__ */ g(G.div, C({
725
725
  "data-state": p ? "active" : "inactive",
726
726
  "data-orientation": a.orientation,
727
727
  role: "tabpanel",
728
728
  "aria-labelledby": u,
729
- hidden: !v,
729
+ hidden: !m,
730
730
  id: i,
731
731
  tabIndex: 0
732
732
  }, c, {
733
733
  ref: t,
734
734
  style: {
735
735
  ...e.style,
736
- animationDuration: d.current ? "0s" : void 0
736
+ animationDuration: l.current ? "0s" : void 0
737
737
  }
738
- }), v && r)
738
+ }), m && r)
739
739
  );
740
740
  });
741
741
  function Pe(e, t) {
@@ -785,9 +785,9 @@ var Me = { exports: {} };
785
785
  })();
786
786
  })(Me);
787
787
  var Vt = Me.exports;
788
- const de = /* @__PURE__ */ Ut(Vt), Bt = {
788
+ const le = /* @__PURE__ */ Ut(Vt), Bt = {
789
789
  "purpur-tab-content": "_purpur-tab-content_1x2zs_1"
790
- }, Gt = de.bind(Bt), jt = "purpur-tab-content", kt = w(
790
+ }, Gt = le.bind(Bt), jt = "purpur-tab-content", kt = w(
791
791
  ({ children: e, tabId: t, "data-testid": n, className: o, ...s }, r) => /* @__PURE__ */ T(
792
792
  Lt,
793
793
  {
@@ -805,7 +805,7 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
805
805
  "purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_18g3c_33",
806
806
  "purpur-tab-header--line": "_purpur-tab-header--line_18g3c_36",
807
807
  "purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_18g3c_48"
808
- }, Wt = de.bind(Kt), ve = "purpur-tab-header", Yt = w(
808
+ }, Wt = le.bind(Kt), me = "purpur-tab-header", Yt = w(
809
809
  ({
810
810
  index: e,
811
811
  tabId: t,
@@ -818,7 +818,7 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
818
818
  qt,
819
819
  {
820
820
  id: `${t}-trigger`,
821
- className: Wt([ve, `${ve}--${n}${o ? "-negative" : ""}`]),
821
+ className: Wt([me, `${me}--${n}${o ? "-negative" : ""}`]),
822
822
  value: t,
823
823
  "data-testid": r,
824
824
  "data-index": e,
@@ -842,7 +842,7 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
842
842
  "purpur-tabs--contained-negative": "_purpur-tabs--contained-negative_1dpqy_103",
843
843
  "purpur-tabs__content-container": "_purpur-tabs__content-container_1dpqy_106",
844
844
  "purpur-tabs--fullWidth": "_purpur-tabs--fullWidth_1dpqy_115"
845
- }, rn = ["line", "contained"], Ht = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), L = de.bind(Zt), S = "purpur-tabs", Xt = (e, t) => {
845
+ }, rn = ["line", "contained"], Ht = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), q = le.bind(Zt), S = "purpur-tabs", Xt = (e, t) => {
846
846
  var u;
847
847
  if (typeof (e == null ? void 0 : e.getBoundingClientRect) != "function" || typeof (t == null ? void 0 : t.scroll) != "function")
848
848
  return;
@@ -861,43 +861,43 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
861
861
  value: u,
862
862
  ...i
863
863
  }) => {
864
- const [p, d] = O({}), [v, m] = O(0), [f, h] = O(0), $ = P.toArray(e).filter(zt), b = R(), _ = R(new Array($.length)), D = 200, y = t === "line", j = L([
864
+ const [p, l] = O({}), [m, _] = O(0), [f, h] = O(0), $ = P.toArray(e).filter(zt), b = R(), v = R(new Array($.length)), U = 200, y = t === "line", j = q([
865
865
  S,
866
866
  `${S}--${t}${n ? "-negative" : ""}`,
867
867
  { [`${S}--fullWidth`]: o },
868
868
  r
869
- ]), V = P.map($, ({ props: { tabId: l } }) => l), x = () => {
870
- const l = V.findIndex((I) => I === c);
871
- return l >= 0 ? l : 0;
869
+ ]), V = P.map($, ({ props: { tabId: d } }) => d), x = () => {
870
+ const d = V.findIndex((I) => I === c);
871
+ return d >= 0 ? d : 0;
872
872
  };
873
873
  N(() => {
874
- u && k($.findIndex((l) => l.props.tabId === u));
874
+ u && k($.findIndex((d) => d.props.tabId === u));
875
875
  }, [$, u]);
876
876
  const [W, k] = O(x);
877
877
  if (new Set(V).size !== V.length)
878
878
  throw new Error("tabId must be unique");
879
- const q = (l, I) => I || a ? `${I || a}-${l}` : void 0, z = () => {
879
+ const D = (d, I) => I || a ? `${I || a}-${d}` : void 0, z = () => {
880
880
  if (!y)
881
881
  return;
882
- const l = _.current[W];
883
- m((l == null ? void 0 : l.offsetLeft) || 0), h((l == null ? void 0 : l.getBoundingClientRect().width) || 0);
884
- }, Q = (l) => {
885
- y && !u && k($.findIndex((I) => I.props.tabId === l)), s == null || s(Ht(l));
886
- }, fe = (l) => {
882
+ const d = v.current[W];
883
+ _((d == null ? void 0 : d.offsetLeft) || 0), h((d == null ? void 0 : d.getBoundingClientRect().width) || 0);
884
+ }, Q = (d) => {
885
+ y && !u && k($.findIndex((I) => I.props.tabId === d)), s == null || s(Ht(d));
886
+ }, fe = (d) => {
887
887
  if (b != null && b.current) {
888
- const { scrollLeft: I } = b.current, B = l === "left" ? -D : D;
888
+ const { scrollLeft: I } = b.current, B = d === "left" ? -200 : U;
889
889
  b.current.scroll({ left: I + B, behavior: "smooth" });
890
890
  }
891
- }, Y = ({ side: l }) => /* @__PURE__ */ T(
891
+ }, Y = ({ side: d }) => /* @__PURE__ */ T(
892
892
  "button",
893
893
  {
894
- className: L(`${S}__scroll-button`, `${S}__scroll-button--${l}`),
895
- onClick: () => fe(l),
894
+ className: q(`${S}__scroll-button`, `${S}__scroll-button--${d}`),
895
+ onClick: () => fe(d),
896
896
  type: "button",
897
897
  "aria-hidden": "true",
898
898
  tabIndex: -1,
899
- "data-testid": q("scroll-button"),
900
- children: /* @__PURE__ */ T(he, { svg: l === "left" ? ze : Ke, size: "md" })
899
+ "data-testid": D("scroll-button"),
900
+ children: /* @__PURE__ */ T(he, { svg: d === "left" ? ze : Ke, size: "md" })
901
901
  }
902
902
  );
903
903
  return N(() => (window.addEventListener("resize", z), () => {
@@ -905,14 +905,14 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
905
905
  }), []), N(() => {
906
906
  z();
907
907
  }, [W, o, $.length, t]), N(() => {
908
- const l = (M) => {
908
+ const d = (M) => {
909
909
  if (M.every((A) => A.isIntersecting) && M.length === $.length) {
910
- d({});
910
+ l({});
911
911
  return;
912
912
  }
913
913
  M.forEach((A) => {
914
914
  const be = Number(A.target.getAttribute("data-index")), Fe = be === 0, Oe = be === $.length - 1;
915
- d((De) => ({
915
+ l((De) => ({
916
916
  ...De,
917
917
  ...Fe && {
918
918
  [`${S}__wrapper--scroll-end`]: !A.isIntersecting
@@ -922,10 +922,10 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
922
922
  }
923
923
  }));
924
924
  });
925
- }, I = new IntersectionObserver(l, {
925
+ }, I = new IntersectionObserver(d, {
926
926
  threshold: [0.99],
927
927
  root: b.current
928
- }), B = _.current;
928
+ }), B = v.current;
929
929
  return B.forEach((M) => I.observe(M)), () => {
930
930
  B.forEach((M) => I.unobserve(M));
931
931
  };
@@ -938,26 +938,26 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
938
938
  className: j,
939
939
  value: u,
940
940
  ...i,
941
- children: /* @__PURE__ */ ee("div", { className: L(`${S}__container`), children: [
942
- /* @__PURE__ */ ee("div", { className: L([`${S}__wrapper`, p]), children: [
941
+ children: /* @__PURE__ */ ee("div", { className: q(`${S}__container`), children: [
942
+ /* @__PURE__ */ ee("div", { className: q([`${S}__wrapper`, p]), children: [
943
943
  /* @__PURE__ */ ee(
944
944
  Dt,
945
945
  {
946
- ref: (l) => {
947
- b.current = l;
946
+ ref: (d) => {
947
+ b.current = d;
948
948
  },
949
- className: L(`${S}__list`),
949
+ className: q(`${S}__list`),
950
950
  children: [
951
- P.map($, (l, I) => {
952
- const { name: B, tabId: M, "data-testid": pe } = l.props;
951
+ P.map($, (d, I) => {
952
+ const { name: B, tabId: M, "data-testid": pe } = d.props;
953
953
  return /* @__PURE__ */ T(
954
954
  Yt,
955
955
  {
956
- "data-testid": q("header", pe),
956
+ "data-testid": D("header", pe),
957
957
  index: I,
958
958
  tabId: M,
959
959
  ref: (A) => {
960
- A && (_.current[I] = A);
960
+ A && (v.current[I] = A);
961
961
  },
962
962
  onFocus: (A) => {
963
963
  Xt(A.target, b.current);
@@ -971,12 +971,12 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
971
971
  y && /* @__PURE__ */ T(
972
972
  "div",
973
973
  {
974
- className: L(`${S}__selected-border`),
974
+ className: q(`${S}__selected-border`),
975
975
  style: {
976
976
  width: f,
977
- transform: `translateX(${v}px)`
977
+ transform: `translateX(${m}px)`
978
978
  },
979
- "data-testid": q("selected-border")
979
+ "data-testid": D("selected-border")
980
980
  }
981
981
  )
982
982
  ]
@@ -985,7 +985,7 @@ const de = /* @__PURE__ */ Ut(Vt), Bt = {
985
985
  /* @__PURE__ */ T(Y, { side: "left" }),
986
986
  /* @__PURE__ */ T(Y, { side: "right" })
987
987
  ] }),
988
- /* @__PURE__ */ T("div", { className: L(`${S}__content-container`), children: P.map($, (l) => l) })
988
+ /* @__PURE__ */ T("div", { className: q(`${S}__content-container`), children: P.map($, (d) => d) })
989
989
  ] })
990
990
  }
991
991
  );