@purpurds/tabs 5.18.3 → 5.19.1

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