@purpurds/tabs 4.6.0 → 5.0.0

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