@purpurds/tabs 5.13.0 → 5.14.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
- import { jsx as T, jsxs as ee } from "react/jsx-runtime";
1
+ import { jsx as w, jsxs as ee } from "react/jsx-runtime";
2
2
  import * as ve from "react";
3
- import A, { createContext as ne, useMemo as W, createElement as x, useContext as me, useCallback as B, forwardRef as S, Children as E, isValidElement as k, cloneElement as se, Fragment as Fe, useLayoutEffect as De, useEffect as P, useRef as R, useState as D, useReducer as qe } from "react";
3
+ import A, { createContext as ne, useMemo as W, createElement as x, useContext as me, useCallback as V, forwardRef as S, Children as E, isValidElement as k, cloneElement as se, Fragment as Fe, useLayoutEffect as De, useEffect as P, useRef as R, useState as D, useReducer as qe } from "react";
4
4
  import { flushSync as Le } from "react-dom";
5
5
  function Ue(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
@@ -41,8 +41,8 @@ var _e = { exports: {} };
41
41
  e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
42
42
  })();
43
43
  })(_e);
44
- var Be = _e.exports;
45
- const Ve = /* @__PURE__ */ Ue(Be), Ge = {
44
+ var Ve = _e.exports;
45
+ const Be = /* @__PURE__ */ Ue(Ve), je = {
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,7 +50,7 @@ const Ve = /* @__PURE__ */ Ue(Be), Ge = {
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
- }, je = {
53
+ }, Ge = {
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"],
@@ -60,7 +60,7 @@ const Ve = /* @__PURE__ */ Ue(Be), Ge = {
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
- }, Ke = Ve.bind(Ge), be = "purpur-icon", ze = "md", We = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Ye = ({ content: e = "", title: t } = {}) => {
63
+ }, ze = Be.bind(je), be = "purpur-icon", Ke = "md", We = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Ye = ({ 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" },
@@ -73,14 +73,14 @@ const Ve = /* @__PURE__ */ Ue(Be), Ge = {
73
73
  svg: t,
74
74
  allyTitle: n,
75
75
  className: o,
76
- size: s = ze,
76
+ size: s = Ke,
77
77
  ...r
78
78
  }) => {
79
79
  const c = Ye({
80
80
  content: Ze(t.svg),
81
81
  title: n
82
- }), a = Ke(o, be, `${be}--${s}`);
83
- return /* @__PURE__ */ T(
82
+ }), a = ze(o, be, `${be}--${s}`);
83
+ return /* @__PURE__ */ w(
84
84
  "span",
85
85
  {
86
86
  "aria-label": n,
@@ -91,15 +91,15 @@ const Ve = /* @__PURE__ */ Ue(Be), Ge = {
91
91
  }
92
92
  );
93
93
  };
94
- function C() {
95
- return C = Object.assign ? Object.assign.bind() : function(e) {
94
+ function I() {
95
+ return I = Object.assign ? Object.assign.bind() : function(e) {
96
96
  for (var t = 1; t < arguments.length; t++) {
97
97
  var n = arguments[t];
98
98
  for (var o in n)
99
99
  Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
100
100
  }
101
101
  return e;
102
- }, C.apply(this, arguments);
102
+ }, I.apply(this, arguments);
103
103
  }
104
104
  function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
105
105
  return function(s) {
@@ -196,17 +196,17 @@ function ge(...e) {
196
196
  );
197
197
  }
198
198
  function Y(...e) {
199
- return B(ge(...e), e);
199
+ return V(ge(...e), e);
200
200
  }
201
201
  const Z = /* @__PURE__ */ S((e, t) => {
202
202
  const { children: n, ...o } = e, s = E.toArray(n), r = s.find(et);
203
203
  if (r) {
204
204
  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);
205
- return /* @__PURE__ */ x(re, C({}, o, {
205
+ return /* @__PURE__ */ x(re, I({}, o, {
206
206
  ref: t
207
207
  }), /* @__PURE__ */ k(c) ? /* @__PURE__ */ se(c, void 0, a) : null);
208
208
  }
209
- return /* @__PURE__ */ x(re, C({}, o, {
209
+ return /* @__PURE__ */ x(re, I({}, o, {
210
210
  ref: t
211
211
  }), n);
212
212
  });
@@ -263,11 +263,11 @@ function nt(e) {
263
263
  ref: h
264
264
  }, m);
265
265
  }), i = e + "CollectionItemSlot", p = "data-radix-collection-item", l = /* @__PURE__ */ A.forwardRef((v, d) => {
266
- const { scope: b, children: m, ..._ } = v, h = A.useRef(null), F = Y(d, h), w = r(i, b);
267
- return A.useEffect(() => (w.itemMap.set(h, {
266
+ const { scope: b, children: m, ..._ } = v, h = A.useRef(null), F = Y(d, h), T = r(i, b);
267
+ return A.useEffect(() => (T.itemMap.set(h, {
268
268
  ref: h,
269
269
  ..._
270
- }), () => void w.itemMap.delete(h))), /* @__PURE__ */ A.createElement(Z, {
270
+ }), () => void T.itemMap.delete(h))), /* @__PURE__ */ A.createElement(Z, {
271
271
  [p]: "",
272
272
  ref: F
273
273
  }, m);
@@ -279,7 +279,7 @@ function nt(e) {
279
279
  if (!m) return [];
280
280
  const _ = Array.from(m.querySelectorAll(`[${p}]`));
281
281
  return Array.from(d.itemMap.values()).sort(
282
- (w, q) => _.indexOf(w.ref.current) - _.indexOf(q.ref.current)
282
+ (T, q) => _.indexOf(T.ref.current) - _.indexOf(q.ref.current)
283
283
  );
284
284
  }, [
285
285
  d.collectionRef,
@@ -327,12 +327,12 @@ const ct = [
327
327
  "span",
328
328
  "svg",
329
329
  "ul"
330
- ], j = ct.reduce((e, t) => {
330
+ ], G = ct.reduce((e, t) => {
331
331
  const n = /* @__PURE__ */ S((o, s) => {
332
332
  const { asChild: r, ...c } = o, a = r ? Z : t;
333
333
  return P(() => {
334
334
  window[Symbol.for("radix-ui")] = !0;
335
- }, []), /* @__PURE__ */ x(a, C({}, c, {
335
+ }, []), /* @__PURE__ */ x(a, I({}, c, {
336
336
  ref: s
337
337
  }));
338
338
  });
@@ -358,7 +358,7 @@ function xe({ prop: e, defaultProp: t, onChange: n = () => {
358
358
  const [o, s] = st({
359
359
  defaultProp: t,
360
360
  onChange: n
361
- }), r = e !== void 0, c = r ? e : o, a = ie(n), u = B((i) => {
361
+ }), r = e !== void 0, c = r ? e : o, a = ie(n), u = V((i) => {
362
362
  if (r) {
363
363
  const l = typeof i == "function" ? i(e) : i;
364
364
  l !== e && a(l);
@@ -385,31 +385,31 @@ function st({ defaultProp: e, onChange: t }) {
385
385
  ]), n;
386
386
  }
387
387
  const at = /* @__PURE__ */ ne(void 0);
388
- function Ie(e) {
388
+ function Ce(e) {
389
389
  const t = me(at);
390
390
  return e || t || "ltr";
391
391
  }
392
392
  const te = "rovingFocusGroup.onEntryFocus", it = {
393
393
  bubbles: !1,
394
394
  cancelable: !0
395
- }, ue = "RovingFocusGroup", [ce, Ce, ut] = nt(ue), [lt, ye] = ae(ue, [
395
+ }, ue = "RovingFocusGroup", [ce, Ie, ut] = nt(ue), [lt, ye] = ae(ue, [
396
396
  ut
397
397
  ]), [dt, ft] = lt(ue), pt = /* @__PURE__ */ S((e, t) => /* @__PURE__ */ x(ce.Provider, {
398
398
  scope: e.__scopeRovingFocusGroup
399
399
  }, /* @__PURE__ */ x(ce.Slot, {
400
400
  scope: e.__scopeRovingFocusGroup
401
- }, /* @__PURE__ */ x(bt, C({}, e, {
401
+ }, /* @__PURE__ */ x(bt, I({}, e, {
402
402
  ref: t
403
403
  }))))), bt = /* @__PURE__ */ S((e, t) => {
404
- const { __scopeRovingFocusGroup: n, orientation: o, loop: s = !1, dir: r, currentTabStopId: c, defaultCurrentTabStopId: a, onCurrentTabStopIdChange: u, onEntryFocus: i, ...p } = e, l = R(null), $ = Y(t, l), v = Ie(r), [d = null, b] = xe({
404
+ const { __scopeRovingFocusGroup: n, orientation: o, loop: s = !1, dir: r, currentTabStopId: c, defaultCurrentTabStopId: a, onCurrentTabStopIdChange: u, onEntryFocus: i, ...p } = e, l = R(null), $ = Y(t, l), v = Ce(r), [d = null, b] = xe({
405
405
  prop: c,
406
406
  defaultProp: a,
407
407
  onChange: u
408
- }), [m, _] = D(!1), h = ie(i), F = Ce(n), w = R(!1), [q, K] = D(0);
408
+ }), [m, _] = D(!1), h = ie(i), F = Ie(n), T = R(!1), [q, z] = D(0);
409
409
  return P(() => {
410
- const I = l.current;
411
- if (I)
412
- return I.addEventListener(te, h), () => I.removeEventListener(te, h);
410
+ const C = l.current;
411
+ if (C)
412
+ return C.addEventListener(te, h), () => C.removeEventListener(te, h);
413
413
  }, [
414
414
  h
415
415
  ]), /* @__PURE__ */ x(dt, {
@@ -418,29 +418,29 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
418
418
  dir: v,
419
419
  loop: s,
420
420
  currentTabStopId: d,
421
- onItemFocus: B(
422
- (I) => b(I),
421
+ onItemFocus: V(
422
+ (C) => b(C),
423
423
  [
424
424
  b
425
425
  ]
426
426
  ),
427
- onItemShiftTab: B(
427
+ onItemShiftTab: V(
428
428
  () => _(!0),
429
429
  []
430
430
  ),
431
- onFocusableItemAdd: B(
432
- () => K(
433
- (I) => I + 1
431
+ onFocusableItemAdd: V(
432
+ () => z(
433
+ (C) => C + 1
434
434
  ),
435
435
  []
436
436
  ),
437
- onFocusableItemRemove: B(
438
- () => K(
439
- (I) => I - 1
437
+ onFocusableItemRemove: V(
438
+ () => z(
439
+ (C) => C - 1
440
440
  ),
441
441
  []
442
442
  )
443
- }, /* @__PURE__ */ x(j.div, C({
443
+ }, /* @__PURE__ */ x(G.div, I({
444
444
  tabIndex: m || q === 0 ? -1 : 0,
445
445
  "data-orientation": o
446
446
  }, p, {
@@ -450,13 +450,13 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
450
450
  ...e.style
451
451
  },
452
452
  onMouseDown: O(e.onMouseDown, () => {
453
- w.current = !0;
453
+ T.current = !0;
454
454
  }),
455
- onFocus: O(e.onFocus, (I) => {
456
- const H = !w.current;
457
- if (I.target === I.currentTarget && H && !m) {
458
- const V = new CustomEvent(te, it);
459
- if (I.currentTarget.dispatchEvent(V), !V.defaultPrevented) {
455
+ onFocus: O(e.onFocus, (C) => {
456
+ const H = !T.current;
457
+ if (C.target === C.currentTarget && H && !m) {
458
+ const B = new CustomEvent(te, it);
459
+ if (C.currentTarget.dispatchEvent(B), !B.defaultPrevented) {
460
460
  const L = F().filter(
461
461
  (g) => g.focusable
462
462
  ), X = L.find(
@@ -473,7 +473,7 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
473
473
  Se(f);
474
474
  }
475
475
  }
476
- w.current = !1;
476
+ T.current = !1;
477
477
  }),
478
478
  onBlur: O(
479
479
  e.onBlur,
@@ -481,7 +481,7 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
481
481
  )
482
482
  })));
483
483
  }), $t = "RovingFocusGroupItem", vt = /* @__PURE__ */ S((e, t) => {
484
- const { __scopeRovingFocusGroup: n, focusable: o = !0, active: s = !1, tabStopId: r, ...c } = e, a = he(), u = r || a, i = ft($t, n), p = i.currentTabStopId === u, l = Ce(n), { onFocusableItemAdd: $, onFocusableItemRemove: v } = i;
484
+ const { __scopeRovingFocusGroup: n, focusable: o = !0, active: s = !1, tabStopId: r, ...c } = e, a = he(), u = r || a, i = ft($t, n), p = i.currentTabStopId === u, l = Ie(n), { onFocusableItemAdd: $, onFocusableItemRemove: v } = i;
485
485
  return P(() => {
486
486
  if (o)
487
487
  return $(), () => v();
@@ -494,7 +494,7 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
494
494
  id: u,
495
495
  focusable: o,
496
496
  active: s
497
- }, /* @__PURE__ */ x(j.span, C({
497
+ }, /* @__PURE__ */ x(G.span, I({
498
498
  tabIndex: p ? 0 : -1,
499
499
  "data-orientation": i.orientation
500
500
  }, c, {
@@ -566,14 +566,14 @@ function ht(e, t) {
566
566
  (n, o) => e[(t + o) % e.length]
567
567
  );
568
568
  }
569
- const xt = pt, It = vt;
570
- function Ct(e, t) {
569
+ const xt = pt, Ct = vt;
570
+ function It(e, t) {
571
571
  return qe((n, o) => {
572
572
  const s = t[n][o];
573
573
  return s ?? n;
574
574
  }, e);
575
575
  }
576
- const Te = (e) => {
576
+ const we = (e) => {
577
577
  const { present: t, children: n } = e, o = yt(t), s = typeof n == "function" ? n({
578
578
  present: o.isPresent
579
579
  }) : E.only(n), r = Y(o.ref, s.ref);
@@ -581,9 +581,9 @@ const Te = (e) => {
581
581
  ref: r
582
582
  }) : null;
583
583
  };
584
- Te.displayName = "Presence";
584
+ we.displayName = "Presence";
585
585
  function yt(e) {
586
- const [t, n] = D(), o = R({}), s = R(e), r = R("none"), c = e ? "mounted" : "unmounted", [a, u] = Ct(c, {
586
+ const [t, n] = D(), o = R({}), s = R(e), r = R("none"), c = e ? "mounted" : "unmounted", [a, u] = It(c, {
587
587
  mounted: {
588
588
  UNMOUNT: "unmounted",
589
589
  ANIMATION_OUT: "unmountSuspended"
@@ -597,14 +597,14 @@ function yt(e) {
597
597
  }
598
598
  });
599
599
  return P(() => {
600
- const i = z(o.current);
600
+ const i = K(o.current);
601
601
  r.current = a === "mounted" ? i : "none";
602
602
  }, [
603
603
  a
604
604
  ]), oe(() => {
605
605
  const i = o.current, p = s.current;
606
606
  if (p !== e) {
607
- const $ = r.current, v = z(i);
607
+ const $ = r.current, v = K(i);
608
608
  e ? u("MOUNT") : v === "none" || (i == null ? void 0 : i.display) === "none" ? u("UNMOUNT") : u(p && $ !== v ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
609
609
  }
610
610
  }, [
@@ -613,12 +613,12 @@ function yt(e) {
613
613
  ]), oe(() => {
614
614
  if (t) {
615
615
  const i = (l) => {
616
- const v = z(o.current).includes(l.animationName);
616
+ const v = K(o.current).includes(l.animationName);
617
617
  l.target === t && v && Le(
618
618
  () => u("ANIMATION_END")
619
619
  );
620
620
  }, p = (l) => {
621
- l.target === t && (r.current = z(o.current));
621
+ l.target === t && (r.current = K(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,23 +633,23 @@ function yt(e) {
633
633
  "mounted",
634
634
  "unmountSuspended"
635
635
  ].includes(a),
636
- ref: B((i) => {
636
+ ref: V((i) => {
637
637
  i && (o.current = getComputedStyle(i)), n(i);
638
638
  }, [])
639
639
  };
640
640
  }
641
- function z(e) {
641
+ function K(e) {
642
642
  return (e == null ? void 0 : e.animationName) || "none";
643
643
  }
644
- const we = "Tabs", [St, tn] = ae(we, [
644
+ const Te = "Tabs", [St, tn] = ae(Te, [
645
645
  ye
646
- ]), Ne = ye(), [Tt, le] = St(we), wt = /* @__PURE__ */ S((e, t) => {
647
- const { __scopeTabs: n, value: o, onValueChange: s, defaultValue: r, orientation: c = "horizontal", dir: a, activationMode: u = "automatic", ...i } = e, p = Ie(a), [l, $] = xe({
646
+ ]), Ne = ye(), [wt, le] = St(Te), Tt = /* @__PURE__ */ S((e, t) => {
647
+ const { __scopeTabs: n, value: o, onValueChange: s, defaultValue: r, orientation: c = "horizontal", dir: a, activationMode: u = "automatic", ...i } = e, p = Ce(a), [l, $] = xe({
648
648
  prop: o,
649
649
  onChange: s,
650
650
  defaultProp: r
651
651
  });
652
- return /* @__PURE__ */ x(Tt, {
652
+ return /* @__PURE__ */ x(wt, {
653
653
  scope: n,
654
654
  baseId: he(),
655
655
  value: l,
@@ -657,7 +657,7 @@ const we = "Tabs", [St, tn] = ae(we, [
657
657
  orientation: c,
658
658
  dir: p,
659
659
  activationMode: u
660
- }, /* @__PURE__ */ x(j.div, C({
660
+ }, /* @__PURE__ */ x(G.div, I({
661
661
  dir: p,
662
662
  "data-orientation": c
663
663
  }, i, {
@@ -665,13 +665,13 @@ const we = "Tabs", [St, tn] = ae(we, [
665
665
  })));
666
666
  }), Nt = "TabsList", At = /* @__PURE__ */ S((e, t) => {
667
667
  const { __scopeTabs: n, loop: o = !0, ...s } = e, r = le(Nt, n), c = Ne(n);
668
- return /* @__PURE__ */ x(xt, C({
668
+ return /* @__PURE__ */ x(xt, I({
669
669
  asChild: !0
670
670
  }, c, {
671
671
  orientation: r.orientation,
672
672
  dir: r.dir,
673
673
  loop: o
674
- }), /* @__PURE__ */ x(j.div, C({
674
+ }), /* @__PURE__ */ x(G.div, I({
675
675
  role: "tablist",
676
676
  "aria-orientation": r.orientation
677
677
  }, s, {
@@ -679,12 +679,12 @@ const we = "Tabs", [St, tn] = ae(we, [
679
679
  })));
680
680
  }), Et = "TabsTrigger", Pt = /* @__PURE__ */ S((e, t) => {
681
681
  const { __scopeTabs: n, value: o, disabled: s = !1, ...r } = e, c = le(Et, n), a = Ne(n), u = Ae(c.baseId, o), i = Ee(c.baseId, o), p = o === c.value;
682
- return /* @__PURE__ */ x(It, C({
682
+ return /* @__PURE__ */ x(Ct, I({
683
683
  asChild: !0
684
684
  }, a, {
685
685
  focusable: !s,
686
686
  active: p
687
- }), /* @__PURE__ */ x(j.button, C({
687
+ }), /* @__PURE__ */ x(G.button, I({
688
688
  type: "button",
689
689
  role: "tab",
690
690
  "aria-selected": p,
@@ -717,11 +717,11 @@ const we = "Tabs", [St, tn] = ae(we, [
717
717
  );
718
718
  return () => cancelAnimationFrame($);
719
719
  }, []), /* @__PURE__ */ x(
720
- Te,
720
+ we,
721
721
  {
722
722
  present: s || p
723
723
  },
724
- ({ present: $ }) => /* @__PURE__ */ x(j.div, C({
724
+ ({ present: $ }) => /* @__PURE__ */ x(G.div, I({
725
725
  "data-state": p ? "active" : "inactive",
726
726
  "data-orientation": a.orientation,
727
727
  role: "tabpanel",
@@ -744,7 +744,7 @@ function Ae(e, t) {
744
744
  function Ee(e, t) {
745
745
  return `${e}-content-${t}`;
746
746
  }
747
- const Ot = wt, Ft = At, Dt = Pt, qt = Mt;
747
+ const Ot = Tt, Ft = At, Dt = Pt, qt = Mt;
748
748
  function Lt(e) {
749
749
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
750
750
  }
@@ -785,27 +785,27 @@ var Pe = { exports: {} };
785
785
  })();
786
786
  })(Pe);
787
787
  var Ut = Pe.exports;
788
- const de = /* @__PURE__ */ Lt(Ut), Bt = {
788
+ const de = /* @__PURE__ */ Lt(Ut), Vt = {
789
789
  "purpur-tab-content": "_purpur-tab-content_1x2zs_1"
790
- }, Vt = de.bind(Bt), Gt = "purpur-tab-content", jt = S(
791
- ({ children: e, tabId: t, "data-testid": n, className: o, ...s }, r) => /* @__PURE__ */ T(
790
+ }, Bt = de.bind(Vt), jt = "purpur-tab-content", Gt = S(
791
+ ({ children: e, tabId: t, "data-testid": n, className: o, ...s }, r) => /* @__PURE__ */ w(
792
792
  qt,
793
793
  {
794
794
  ref: r,
795
- className: Vt([Gt, o]),
795
+ className: Bt([jt, o]),
796
796
  "data-testid": n,
797
797
  value: t,
798
798
  ...s,
799
799
  children: e
800
800
  }
801
801
  )
802
- ), kt = (e) => !!e && k(e) && !!e.props.name && !!e.props.tabId, Kt = {
802
+ ), kt = (e) => !!e && k(e) && !!e.props.name && !!e.props.tabId, zt = {
803
803
  "purpur-tab-header": "_purpur-tab-header_18g3c_1",
804
804
  "purpur-tab-header--contained": "_purpur-tab-header--contained_18g3c_33",
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
- }, zt = de.bind(Kt), $e = "purpur-tab-header", Wt = S(
808
+ }, Kt = de.bind(zt), $e = "purpur-tab-header", Wt = S(
809
809
  ({
810
810
  index: e,
811
811
  tabId: t,
@@ -814,11 +814,11 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
814
814
  onFocus: s,
815
815
  "data-testid": r,
816
816
  children: c
817
- }, a) => /* @__PURE__ */ T(
817
+ }, a) => /* @__PURE__ */ w(
818
818
  Dt,
819
819
  {
820
820
  id: `${t}-trigger`,
821
- className: zt([$e, `${$e}--${n}${o ? "-negative" : ""}`]),
821
+ className: Kt([$e, `${$e}--${n}${o ? "-negative" : ""}`]),
822
822
  value: t,
823
823
  "data-testid": r,
824
824
  "data-index": e,
@@ -860,30 +860,30 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
860
860
  "data-testid": a,
861
861
  ...u
862
862
  }) => {
863
- const [i, p] = D({}), [l, $] = D(0), [v, d] = D(0), b = E.toArray(e).filter(kt), m = R(), _ = R(new Array(b.length)), h = 200, F = t === "line", w = U([
863
+ const [i, p] = D({}), [l, $] = D(0), [v, d] = D(0), b = E.toArray(e).filter(kt), m = R(), _ = R(new Array(b.length)), h = 200, F = t === "line", T = U([
864
864
  y,
865
865
  `${y}--${t}${n ? "-negative" : ""}`,
866
866
  { [`${y}--fullWidth`]: o },
867
867
  r
868
- ]), q = E.map(b, ({ props: { tabId: f } }) => f), K = () => {
868
+ ]), q = E.map(b, ({ props: { tabId: f } }) => f), z = () => {
869
869
  const f = q.findIndex((g) => g === c);
870
870
  return f >= 0 ? f : 0;
871
- }, [I, H] = D(K);
871
+ }, [C, H] = D(z);
872
872
  if (new Set(q).size !== q.length)
873
873
  throw new Error("tabId must be unique");
874
- const V = (f, g) => g || a ? `${g || a}-${f}` : void 0, L = () => {
874
+ const B = (f, g) => g || a ? `${g || a}-${f}` : void 0, L = () => {
875
875
  if (!F)
876
876
  return;
877
- const f = _.current[I];
877
+ const f = _.current[C];
878
878
  $((f == null ? void 0 : f.offsetLeft) || 0), d((f == null ? void 0 : f.getBoundingClientRect().width) || 0);
879
879
  }, X = (f) => {
880
880
  F && H(b.findIndex((g) => g.props.tabId === f)), s == null || s(Zt(f));
881
881
  }, J = (f) => {
882
882
  if (m != null && m.current) {
883
- const { scrollLeft: g } = m.current, G = f === "left" ? -h : h;
884
- m.current.scroll({ left: g + G, behavior: "smooth" });
883
+ const { scrollLeft: g } = m.current, j = f === "left" ? -h : h;
884
+ m.current.scroll({ left: g + j, behavior: "smooth" });
885
885
  }
886
- }, Q = ({ side: f }) => /* @__PURE__ */ T(
886
+ }, Q = ({ side: f }) => /* @__PURE__ */ w(
887
887
  "button",
888
888
  {
889
889
  className: U(`${y}__scroll-button`, `${y}__scroll-button--${f}`),
@@ -891,15 +891,15 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
891
891
  type: "button",
892
892
  "aria-hidden": "true",
893
893
  tabIndex: -1,
894
- "data-testid": V("scroll-button"),
895
- children: /* @__PURE__ */ T(He, { svg: f === "left" ? je : ke, size: "md" })
894
+ "data-testid": B("scroll-button"),
895
+ children: /* @__PURE__ */ w(He, { svg: f === "left" ? Ge : ke, size: "md" })
896
896
  }
897
897
  );
898
898
  return P(() => (window.addEventListener("resize", L), () => {
899
899
  window.removeEventListener("resize", L);
900
900
  }), []), P(() => {
901
901
  L();
902
- }, [I, o, b.length, t]), P(() => {
902
+ }, [C, o, b.length, t]), P(() => {
903
903
  const f = (M) => {
904
904
  if (M.every((N) => N.isIntersecting) && M.length === b.length) {
905
905
  p({});
@@ -920,17 +920,17 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
920
920
  }, g = new IntersectionObserver(f, {
921
921
  threshold: [0.99],
922
922
  root: m.current
923
- }), G = _.current;
924
- return G.forEach((M) => g.observe(M)), () => {
925
- G.forEach((M) => g.unobserve(M));
923
+ }), j = _.current;
924
+ return j.forEach((M) => g.observe(M)), () => {
925
+ j.forEach((M) => g.unobserve(M));
926
926
  };
927
- }, [b.length]), /* @__PURE__ */ T(
927
+ }, [b.length]), /* @__PURE__ */ w(
928
928
  Ot,
929
929
  {
930
930
  defaultValue: c ?? b[0].props.tabId,
931
931
  onValueChange: X,
932
932
  "data-testid": a,
933
- className: w,
933
+ className: T,
934
934
  ...u,
935
935
  children: /* @__PURE__ */ ee("div", { className: U(`${y}__container`), children: [
936
936
  /* @__PURE__ */ ee("div", { className: U([`${y}__wrapper`, i]), children: [
@@ -943,11 +943,11 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
943
943
  className: U(`${y}__list`),
944
944
  children: [
945
945
  E.map(b, (f, g) => {
946
- const { name: G, tabId: M, "data-testid": fe } = f.props;
947
- return /* @__PURE__ */ T(
946
+ const { name: j, tabId: M, "data-testid": fe } = f.props;
947
+ return /* @__PURE__ */ w(
948
948
  Wt,
949
949
  {
950
- "data-testid": V("header", fe),
950
+ "data-testid": B("header", fe),
951
951
  index: g,
952
952
  tabId: M,
953
953
  ref: (N) => {
@@ -958,11 +958,11 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
958
958
  },
959
959
  variant: t,
960
960
  negative: n,
961
- children: G
961
+ children: j
962
962
  }
963
963
  );
964
964
  }),
965
- F && /* @__PURE__ */ T(
965
+ F && /* @__PURE__ */ w(
966
966
  "div",
967
967
  {
968
968
  className: U(`${y}__selected-border`),
@@ -970,21 +970,21 @@ const de = /* @__PURE__ */ Lt(Ut), Bt = {
970
970
  width: v,
971
971
  transform: `translateX(${l}px)`
972
972
  },
973
- "data-testid": V("selected-border")
973
+ "data-testid": B("selected-border")
974
974
  }
975
975
  )
976
976
  ]
977
977
  }
978
978
  ),
979
- /* @__PURE__ */ T(Q, { side: "left" }),
980
- /* @__PURE__ */ T(Q, { side: "right" })
979
+ /* @__PURE__ */ w(Q, { side: "left" }),
980
+ /* @__PURE__ */ w(Q, { side: "right" })
981
981
  ] }),
982
- /* @__PURE__ */ T("div", { className: U(`${y}__content-container`), children: E.map(b, (f) => f) })
982
+ /* @__PURE__ */ w("div", { className: U(`${y}__content-container`), children: E.map(b, (f) => f) })
983
983
  ] })
984
984
  }
985
985
  );
986
986
  };
987
- Xt.Content = jt;
987
+ Xt.Content = Gt;
988
988
  export {
989
989
  Xt as Tabs,
990
990
  Zt as createTabChangeDetailEvent,