@purpurds/tabs 8.5.0 → 8.5.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,25 +1,25 @@
1
- import { jsx as m, jsxs as Q } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import F, { forwardRef as ge, isValidElement as Ke, useRef as ee, useState as U, Children as q, useEffect as z } from "react";
1
+ import { jsx as m, jsxs as ee } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import O, { forwardRef as be, isValidElement as Ge, useRef as te, useState as U, Children as q, useEffect as Y } from "react";
4
4
  import "react-dom";
5
- function qe(e) {
5
+ function ke(e) {
6
6
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
7
7
  }
8
- var de = { exports: {} };
8
+ var le = { exports: {} };
9
9
  /*!
10
10
  Copyright (c) 2018 Jed Watson.
11
11
  Licensed under the MIT License (MIT), see
12
12
  http://jedwatson.github.io/classnames
13
13
  */
14
- var fe;
14
+ var de;
15
15
  function ze() {
16
- return fe || (fe = 1, (function(e) {
16
+ return de || (de = 1, (function(e) {
17
17
  (function() {
18
18
  var t = {}.hasOwnProperty;
19
19
  function r() {
20
- for (var n = "", c = 0; c < arguments.length; c++) {
21
- var i = arguments[c];
22
- i && (n = s(n, o.call(this, i)));
20
+ for (var n = "", i = 0; i < arguments.length; i++) {
21
+ var c = arguments[i];
22
+ c && (n = s(n, o.call(this, c)));
23
23
  }
24
24
  return n;
25
25
  }
@@ -32,20 +32,20 @@ function ze() {
32
32
  return r.apply(this, n);
33
33
  if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
34
34
  return n.toString();
35
- var c = "";
36
- for (var i in n)
37
- t.call(n, i) && n[i] && (c = s(c, this && this[i] || i));
38
- return c;
35
+ var i = "";
36
+ for (var c in n)
37
+ t.call(n, c) && n[c] && (i = s(i, this && this[c] || c));
38
+ return i;
39
39
  }
40
- function s(n, c) {
41
- return c ? n ? n + " " + c : n + c : n;
40
+ function s(n, i) {
41
+ return i ? n ? n + " " + i : n + i : n;
42
42
  }
43
43
  e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
44
44
  })();
45
- })(de)), de.exports;
45
+ })(le)), le.exports;
46
46
  }
47
- var Ye = ze();
48
- const Ze = /* @__PURE__ */ qe(Ye), Xe = {
47
+ var Ke = ze();
48
+ const qe = /* @__PURE__ */ ke(Ke), Ye = {
49
49
  "purpur-icon": "_purpur-icon_8u1lq_1",
50
50
  "purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
51
51
  "purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
@@ -53,72 +53,72 @@ const Ze = /* @__PURE__ */ qe(Ye), Xe = {
53
53
  "purpur-icon--md": "_purpur-icon--md_8u1lq_16",
54
54
  "purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
55
55
  "purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
56
- }, He = Ze.bind(Xe), pe = "purpur-icon", Je = "md", Qe = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), et = ({ content: e = "", title: t } = {}) => {
56
+ }, Ze = qe.bind(Ye), fe = "purpur-icon", Xe = "md", He = (e) => e.filter((t) => Object.keys(t).length >= 1).map((t) => `${t.name}="${t.value}"`).join(" "), Je = ({ content: e = "", title: t } = {}) => {
57
57
  const r = [
58
58
  { name: "xmlns", value: "http://www.w3.org/2000/svg" },
59
59
  { name: "fill", value: "currentColor" },
60
60
  { name: "viewBox", value: "0 0 24 24" },
61
61
  t ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
62
62
  ], o = t ? `<title>${t}</title>` : "";
63
- return `<svg ${Qe(r)}>${o}${e}</svg>`;
64
- }, tt = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), he = ({ svg: e, allyTitle: t, className: r, size: o = Je, ...s }) => {
65
- const n = et({
66
- content: tt(e.svg),
63
+ return `<svg ${He(r)}>${o}${e}</svg>`;
64
+ }, Qe = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), ge = ({ svg: e, allyTitle: t, className: r, size: o = Xe, ...s }) => {
65
+ const n = Je({
66
+ content: Qe(e.svg),
67
67
  title: t
68
- }), c = He(r, pe, `${pe}--${o}`);
69
- return /* @__PURE__ */ m("span", { className: c, dangerouslySetInnerHTML: { __html: n }, ...s });
68
+ }), i = Ze(fe, `${fe}--${o}`, r);
69
+ return /* @__PURE__ */ m("span", { className: i, dangerouslySetInnerHTML: { __html: n }, ...s });
70
70
  };
71
- he.displayName = "Icon";
72
- const nt = {
71
+ ge.displayName = "Icon";
72
+ const et = {
73
73
  name: "chevron-left",
74
74
  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>',
75
75
  keywords: ["chevron-left"],
76
76
  category: "utility"
77
- }, rt = {
77
+ }, tt = {
78
78
  name: "chevron-right",
79
79
  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>',
80
80
  keywords: ["chevron-right"],
81
81
  category: "utility"
82
82
  };
83
- function M(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
83
+ function A(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
84
84
  return function(s) {
85
85
  if (e == null || e(s), r === !1 || !s.defaultPrevented)
86
86
  return t == null ? void 0 : t(s);
87
87
  };
88
88
  }
89
- function se(e, t = []) {
89
+ function ie(e, t = []) {
90
90
  let r = [];
91
- function o(n, c) {
92
- const i = a.createContext(c), d = r.length;
93
- r = [...r, c];
94
- const u = (f) => {
91
+ function o(n, i) {
92
+ const c = u.createContext(i), d = r.length;
93
+ r = [...r, i];
94
+ const a = (f) => {
95
95
  var C;
96
- const { scope: v, children: g, ...S } = f, h = ((C = v == null ? void 0 : v[e]) == null ? void 0 : C[d]) || i, _ = a.useMemo(() => S, Object.values(S));
97
- return /* @__PURE__ */ m(h.Provider, { value: _, children: g });
96
+ const { scope: _, children: g, ...I } = f, h = ((C = _ == null ? void 0 : _[e]) == null ? void 0 : C[d]) || c, v = u.useMemo(() => I, Object.values(I));
97
+ return /* @__PURE__ */ m(h.Provider, { value: v, children: g });
98
98
  };
99
- u.displayName = n + "Provider";
100
- function l(f, v) {
99
+ a.displayName = n + "Provider";
100
+ function l(f, _) {
101
101
  var h;
102
- const g = ((h = v == null ? void 0 : v[e]) == null ? void 0 : h[d]) || i, S = a.useContext(g);
103
- if (S) return S;
104
- if (c !== void 0) return c;
102
+ const g = ((h = _ == null ? void 0 : _[e]) == null ? void 0 : h[d]) || c, I = u.useContext(g);
103
+ if (I) return I;
104
+ if (i !== void 0) return i;
105
105
  throw new Error(`\`${f}\` must be used within \`${n}\``);
106
106
  }
107
- return [u, l];
107
+ return [a, l];
108
108
  }
109
109
  const s = () => {
110
- const n = r.map((c) => a.createContext(c));
111
- return function(i) {
112
- const d = (i == null ? void 0 : i[e]) || n;
113
- return a.useMemo(
114
- () => ({ [`__scope${e}`]: { ...i, [e]: d } }),
115
- [i, d]
110
+ const n = r.map((i) => u.createContext(i));
111
+ return function(c) {
112
+ const d = (c == null ? void 0 : c[e]) || n;
113
+ return u.useMemo(
114
+ () => ({ [`__scope${e}`]: { ...c, [e]: d } }),
115
+ [c, d]
116
116
  );
117
117
  };
118
118
  };
119
- return s.scopeName = e, [o, ot(s, ...t)];
119
+ return s.scopeName = e, [o, nt(s, ...t)];
120
120
  }
121
- function ot(...e) {
121
+ function nt(...e) {
122
122
  const t = e[0];
123
123
  if (e.length === 1) return t;
124
124
  const r = () => {
@@ -127,133 +127,133 @@ function ot(...e) {
127
127
  scopeName: s.scopeName
128
128
  }));
129
129
  return function(n) {
130
- const c = o.reduce((i, { useScope: d, scopeName: u }) => {
131
- const f = d(n)[`__scope${u}`];
132
- return { ...i, ...f };
130
+ const i = o.reduce((c, { useScope: d, scopeName: a }) => {
131
+ const f = d(n)[`__scope${a}`];
132
+ return { ...c, ...f };
133
133
  }, {});
134
- return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
134
+ return u.useMemo(() => ({ [`__scope${t.scopeName}`]: i }), [i]);
135
135
  };
136
136
  };
137
137
  return r.scopeName = t.scopeName, r;
138
138
  }
139
- function me(e, t) {
139
+ function pe(e, t) {
140
140
  if (typeof e == "function")
141
141
  return e(t);
142
142
  e != null && (e.current = t);
143
143
  }
144
- function we(...e) {
144
+ function he(...e) {
145
145
  return (t) => {
146
146
  let r = !1;
147
147
  const o = e.map((s) => {
148
- const n = me(s, t);
148
+ const n = pe(s, t);
149
149
  return !r && typeof n == "function" && (r = !0), n;
150
150
  });
151
151
  if (r)
152
152
  return () => {
153
153
  for (let s = 0; s < o.length; s++) {
154
154
  const n = o[s];
155
- typeof n == "function" ? n() : me(e[s], null);
155
+ typeof n == "function" ? n() : pe(e[s], null);
156
156
  }
157
157
  };
158
158
  };
159
159
  }
160
- function Z(...e) {
161
- return a.useCallback(we(...e), e);
160
+ function X(...e) {
161
+ return u.useCallback(he(...e), e);
162
162
  }
163
163
  // @__NO_SIDE_EFFECTS__
164
- function re(e) {
165
- const t = /* @__PURE__ */ st(e), r = a.forwardRef((o, s) => {
166
- const { children: n, ...c } = o, i = a.Children.toArray(n), d = i.find(it);
164
+ function oe(e) {
165
+ const t = /* @__PURE__ */ rt(e), r = u.forwardRef((o, s) => {
166
+ const { children: n, ...i } = o, c = u.Children.toArray(n), d = c.find(st);
167
167
  if (d) {
168
- const u = d.props.children, l = i.map((f) => f === d ? a.Children.count(u) > 1 ? a.Children.only(null) : a.isValidElement(u) ? u.props.children : null : f);
169
- return /* @__PURE__ */ m(t, { ...c, ref: s, children: a.isValidElement(u) ? a.cloneElement(u, void 0, l) : null });
168
+ const a = d.props.children, l = c.map((f) => f === d ? u.Children.count(a) > 1 ? u.Children.only(null) : u.isValidElement(a) ? a.props.children : null : f);
169
+ return /* @__PURE__ */ m(t, { ...i, ref: s, children: u.isValidElement(a) ? u.cloneElement(a, void 0, l) : null });
170
170
  }
171
- return /* @__PURE__ */ m(t, { ...c, ref: s, children: n });
171
+ return /* @__PURE__ */ m(t, { ...i, ref: s, children: n });
172
172
  });
173
173
  return r.displayName = `${e}.Slot`, r;
174
174
  }
175
175
  // @__NO_SIDE_EFFECTS__
176
- function st(e) {
177
- const t = a.forwardRef((r, o) => {
176
+ function rt(e) {
177
+ const t = u.forwardRef((r, o) => {
178
178
  const { children: s, ...n } = r;
179
- if (a.isValidElement(s)) {
180
- const c = ut(s), i = at(n, s.props);
181
- return s.type !== a.Fragment && (i.ref = o ? we(o, c) : c), a.cloneElement(s, i);
179
+ if (u.isValidElement(s)) {
180
+ const i = ct(s), c = it(n, s.props);
181
+ return s.type !== u.Fragment && (c.ref = o ? he(o, i) : i), u.cloneElement(s, c);
182
182
  }
183
- return a.Children.count(s) > 1 ? a.Children.only(null) : null;
183
+ return u.Children.count(s) > 1 ? u.Children.only(null) : null;
184
184
  });
185
185
  return t.displayName = `${e}.SlotClone`, t;
186
186
  }
187
- var ct = Symbol("radix.slottable");
188
- function it(e) {
189
- return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ct;
187
+ var ot = Symbol("radix.slottable");
188
+ function st(e) {
189
+ return u.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ot;
190
190
  }
191
- function at(e, t) {
191
+ function it(e, t) {
192
192
  const r = { ...t };
193
193
  for (const o in t) {
194
194
  const s = e[o], n = t[o];
195
- /^on[A-Z]/.test(o) ? s && n ? r[o] = (...i) => {
196
- const d = n(...i);
197
- return s(...i), d;
195
+ /^on[A-Z]/.test(o) ? s && n ? r[o] = (...c) => {
196
+ const d = n(...c);
197
+ return s(...c), d;
198
198
  } : s && (r[o] = s) : o === "style" ? r[o] = { ...s, ...n } : o === "className" && (r[o] = [s, n].filter(Boolean).join(" "));
199
199
  }
200
200
  return { ...e, ...r };
201
201
  }
202
- function ut(e) {
202
+ function ct(e) {
203
203
  var o, s;
204
204
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning;
205
205
  return r ? e.ref : (t = (s = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : s.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
206
206
  }
207
- function lt(e) {
208
- const t = e + "CollectionProvider", [r, o] = se(t), [s, n] = r(
207
+ function ut(e) {
208
+ const t = e + "CollectionProvider", [r, o] = ie(t), [s, n] = r(
209
209
  t,
210
210
  { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
211
- ), c = (h) => {
212
- const { scope: _, children: C } = h, R = F.useRef(null), w = F.useRef(/* @__PURE__ */ new Map()).current;
213
- return /* @__PURE__ */ m(s, { scope: _, itemMap: w, collectionRef: R, children: C });
211
+ ), i = (h) => {
212
+ const { scope: v, children: C } = h, N = O.useRef(null), w = O.useRef(/* @__PURE__ */ new Map()).current;
213
+ return /* @__PURE__ */ m(s, { scope: v, itemMap: w, collectionRef: N, children: C });
214
214
  };
215
- c.displayName = t;
216
- const i = e + "CollectionSlot", d = /* @__PURE__ */ re(i), u = F.forwardRef(
217
- (h, _) => {
218
- const { scope: C, children: R } = h, w = n(i, C), b = Z(_, w.collectionRef);
219
- return /* @__PURE__ */ m(d, { ref: b, children: R });
215
+ i.displayName = t;
216
+ const c = e + "CollectionSlot", d = /* @__PURE__ */ oe(c), a = O.forwardRef(
217
+ (h, v) => {
218
+ const { scope: C, children: N } = h, w = n(c, C), b = X(v, w.collectionRef);
219
+ return /* @__PURE__ */ m(d, { ref: b, children: N });
220
220
  }
221
221
  );
222
- u.displayName = i;
223
- const l = e + "CollectionItemSlot", f = "data-radix-collection-item", v = /* @__PURE__ */ re(l), g = F.forwardRef(
224
- (h, _) => {
225
- const { scope: C, children: R, ...w } = h, b = F.useRef(null), N = Z(_, b), x = n(l, C);
226
- return F.useEffect(() => (x.itemMap.set(b, { ref: b, ...w }), () => void x.itemMap.delete(b))), /* @__PURE__ */ m(v, { [f]: "", ref: N, children: R });
222
+ a.displayName = c;
223
+ const l = e + "CollectionItemSlot", f = "data-radix-collection-item", _ = /* @__PURE__ */ oe(l), g = O.forwardRef(
224
+ (h, v) => {
225
+ const { scope: C, children: N, ...w } = h, b = O.useRef(null), R = X(v, b), x = n(l, C);
226
+ return O.useEffect(() => (x.itemMap.set(b, { ref: b, ...w }), () => void x.itemMap.delete(b))), /* @__PURE__ */ m(_, { [f]: "", ref: R, children: N });
227
227
  }
228
228
  );
229
229
  g.displayName = l;
230
- function S(h) {
231
- const _ = n(e + "CollectionConsumer", h);
232
- return F.useCallback(() => {
233
- const R = _.collectionRef.current;
234
- if (!R) return [];
235
- const w = Array.from(R.querySelectorAll(`[${f}]`));
236
- return Array.from(_.itemMap.values()).sort(
237
- (x, O) => w.indexOf(x.ref.current) - w.indexOf(O.ref.current)
230
+ function I(h) {
231
+ const v = n(e + "CollectionConsumer", h);
232
+ return O.useCallback(() => {
233
+ const N = v.collectionRef.current;
234
+ if (!N) return [];
235
+ const w = Array.from(N.querySelectorAll(`[${f}]`));
236
+ return Array.from(v.itemMap.values()).sort(
237
+ (x, $) => w.indexOf(x.ref.current) - w.indexOf($.ref.current)
238
238
  );
239
- }, [_.collectionRef, _.itemMap]);
239
+ }, [v.collectionRef, v.itemMap]);
240
240
  }
241
241
  return [
242
- { Provider: c, Slot: u, ItemSlot: g },
243
- S,
242
+ { Provider: i, Slot: a, ItemSlot: g },
243
+ I,
244
244
  o
245
245
  ];
246
246
  }
247
- var X = globalThis != null && globalThis.document ? a.useLayoutEffect : () => {
248
- }, dt = a[" useId ".trim().toString()] || (() => {
249
- }), ft = 0;
250
- function Ce(e) {
251
- const [t, r] = a.useState(dt());
252
- return X(() => {
253
- r((o) => o ?? String(ft++));
247
+ var H = globalThis != null && globalThis.document ? u.useLayoutEffect : () => {
248
+ }, at = u[" useId ".trim().toString()] || (() => {
249
+ }), lt = 0;
250
+ function we(e) {
251
+ const [t, r] = u.useState(at());
252
+ return H(() => {
253
+ r((o) => o ?? String(lt++));
254
254
  }, [e]), t ? `radix-${t}` : "";
255
255
  }
256
- var pt = [
256
+ var dt = [
257
257
  "a",
258
258
  "button",
259
259
  "div",
@@ -271,124 +271,124 @@ var pt = [
271
271
  "span",
272
272
  "svg",
273
273
  "ul"
274
- ], L = pt.reduce((e, t) => {
275
- const r = /* @__PURE__ */ re(`Primitive.${t}`), o = a.forwardRef((s, n) => {
276
- const { asChild: c, ...i } = s, d = c ? r : t;
277
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(d, { ...i, ref: n });
274
+ ], L = dt.reduce((e, t) => {
275
+ const r = /* @__PURE__ */ oe(`Primitive.${t}`), o = u.forwardRef((s, n) => {
276
+ const { asChild: i, ...c } = s, d = i ? r : t;
277
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ m(d, { ...c, ref: n });
278
278
  });
279
279
  return o.displayName = `Primitive.${t}`, { ...e, [t]: o };
280
280
  }, {});
281
- function mt(e) {
282
- const t = a.useRef(e);
283
- return a.useEffect(() => {
281
+ function ft(e) {
282
+ const t = u.useRef(e);
283
+ return u.useEffect(() => {
284
284
  t.current = e;
285
- }), a.useMemo(() => (...r) => {
285
+ }), u.useMemo(() => (...r) => {
286
286
  var o;
287
287
  return (o = t.current) == null ? void 0 : o.call(t, ...r);
288
288
  }, []);
289
289
  }
290
- var vt = a[" useInsertionEffect ".trim().toString()] || X;
291
- function Ie({
290
+ var pt = u[" useInsertionEffect ".trim().toString()] || H;
291
+ function Ce({
292
292
  prop: e,
293
293
  defaultProp: t,
294
294
  onChange: r = () => {
295
295
  },
296
296
  caller: o
297
297
  }) {
298
- const [s, n, c] = _t({
298
+ const [s, n, i] = mt({
299
299
  defaultProp: t,
300
300
  onChange: r
301
- }), i = e !== void 0, d = i ? e : s;
301
+ }), c = e !== void 0, d = c ? e : s;
302
302
  {
303
- const l = a.useRef(e !== void 0);
304
- a.useEffect(() => {
303
+ const l = u.useRef(e !== void 0);
304
+ u.useEffect(() => {
305
305
  const f = l.current;
306
- f !== i && console.warn(
307
- `${o} is changing from ${f ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
308
- ), l.current = i;
309
- }, [i, o]);
306
+ f !== c && console.warn(
307
+ `${o} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
308
+ ), l.current = c;
309
+ }, [c, o]);
310
310
  }
311
- const u = a.useCallback(
311
+ const a = u.useCallback(
312
312
  (l) => {
313
313
  var f;
314
- if (i) {
315
- const v = bt(l) ? l(e) : l;
316
- v !== e && ((f = c.current) == null || f.call(c, v));
314
+ if (c) {
315
+ const _ = _t(l) ? l(e) : l;
316
+ _ !== e && ((f = i.current) == null || f.call(i, _));
317
317
  } else
318
318
  n(l);
319
319
  },
320
- [i, e, n, c]
320
+ [c, e, n, i]
321
321
  );
322
- return [d, u];
322
+ return [d, a];
323
323
  }
324
- function _t({
324
+ function mt({
325
325
  defaultProp: e,
326
326
  onChange: t
327
327
  }) {
328
- const [r, o] = a.useState(e), s = a.useRef(r), n = a.useRef(t);
329
- return vt(() => {
328
+ const [r, o] = u.useState(e), s = u.useRef(r), n = u.useRef(t);
329
+ return pt(() => {
330
330
  n.current = t;
331
- }, [t]), a.useEffect(() => {
332
- var c;
333
- s.current !== r && ((c = n.current) == null || c.call(n, r), s.current = r);
331
+ }, [t]), u.useEffect(() => {
332
+ var i;
333
+ s.current !== r && ((i = n.current) == null || i.call(n, r), s.current = r);
334
334
  }, [r, s]), [r, o, n];
335
335
  }
336
- function bt(e) {
336
+ function _t(e) {
337
337
  return typeof e == "function";
338
338
  }
339
- var gt = a.createContext(void 0);
340
- function ye(e) {
341
- const t = a.useContext(gt);
339
+ var vt = u.createContext(void 0);
340
+ function Se(e) {
341
+ const t = u.useContext(vt);
342
342
  return e || t || "ltr";
343
343
  }
344
- var te = "rovingFocusGroup.onEntryFocus", ht = { bubbles: !1, cancelable: !0 }, G = "RovingFocusGroup", [oe, Se, wt] = lt(G), [Ct, Ne] = se(
345
- G,
346
- [wt]
347
- ), [It, yt] = Ct(G), Re = a.forwardRef(
348
- (e, t) => /* @__PURE__ */ m(oe.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(oe.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(St, { ...e, ref: t }) }) })
344
+ var ne = "rovingFocusGroup.onEntryFocus", bt = { bubbles: !1, cancelable: !0 }, W = "RovingFocusGroup", [se, ye, gt] = ut(W), [ht, Ie] = ie(
345
+ W,
346
+ [gt]
347
+ ), [wt, Ct] = ht(W), Re = u.forwardRef(
348
+ (e, t) => /* @__PURE__ */ m(se.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(se.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ m(St, { ...e, ref: t }) }) })
349
349
  );
350
- Re.displayName = G;
351
- var St = a.forwardRef((e, t) => {
350
+ Re.displayName = W;
351
+ var St = u.forwardRef((e, t) => {
352
352
  const {
353
353
  __scopeRovingFocusGroup: r,
354
354
  orientation: o,
355
355
  loop: s = !1,
356
356
  dir: n,
357
- currentTabStopId: c,
358
- defaultCurrentTabStopId: i,
357
+ currentTabStopId: i,
358
+ defaultCurrentTabStopId: c,
359
359
  onCurrentTabStopIdChange: d,
360
- onEntryFocus: u,
360
+ onEntryFocus: a,
361
361
  preventScrollOnEntryFocus: l = !1,
362
362
  ...f
363
- } = e, v = a.useRef(null), g = Z(t, v), S = ye(n), [h, _] = Ie({
364
- prop: c,
365
- defaultProp: i ?? null,
363
+ } = e, _ = u.useRef(null), g = X(t, _), I = Se(n), [h, v] = Ce({
364
+ prop: i,
365
+ defaultProp: c ?? null,
366
366
  onChange: d,
367
- caller: G
368
- }), [C, R] = a.useState(!1), w = mt(u), b = Se(r), N = a.useRef(!1), [x, O] = a.useState(0);
369
- return a.useEffect(() => {
370
- const I = v.current;
371
- if (I)
372
- return I.addEventListener(te, w), () => I.removeEventListener(te, w);
367
+ caller: W
368
+ }), [C, N] = u.useState(!1), w = ft(a), b = ye(r), R = u.useRef(!1), [x, $] = u.useState(0);
369
+ return u.useEffect(() => {
370
+ const y = _.current;
371
+ if (y)
372
+ return y.addEventListener(ne, w), () => y.removeEventListener(ne, w);
373
373
  }, [w]), /* @__PURE__ */ m(
374
- It,
374
+ wt,
375
375
  {
376
376
  scope: r,
377
377
  orientation: o,
378
- dir: S,
378
+ dir: I,
379
379
  loop: s,
380
380
  currentTabStopId: h,
381
- onItemFocus: a.useCallback(
382
- (I) => _(I),
383
- [_]
381
+ onItemFocus: u.useCallback(
382
+ (y) => v(y),
383
+ [v]
384
384
  ),
385
- onItemShiftTab: a.useCallback(() => R(!0), []),
386
- onFocusableItemAdd: a.useCallback(
387
- () => O((I) => I + 1),
385
+ onItemShiftTab: u.useCallback(() => N(!0), []),
386
+ onFocusableItemAdd: u.useCallback(
387
+ () => $((y) => y + 1),
388
388
  []
389
389
  ),
390
- onFocusableItemRemove: a.useCallback(
391
- () => O((I) => I - 1),
390
+ onFocusableItemRemove: u.useCallback(
391
+ () => $((y) => y - 1),
392
392
  []
393
393
  ),
394
394
  children: /* @__PURE__ */ m(
@@ -399,45 +399,45 @@ var St = a.forwardRef((e, t) => {
399
399
  ...f,
400
400
  ref: g,
401
401
  style: { outline: "none", ...e.style },
402
- onMouseDown: M(e.onMouseDown, () => {
403
- N.current = !0;
402
+ onMouseDown: A(e.onMouseDown, () => {
403
+ R.current = !0;
404
404
  }),
405
- onFocus: M(e.onFocus, (I) => {
406
- const J = !N.current;
407
- if (I.target === I.currentTarget && J && !C) {
408
- const D = new CustomEvent(te, ht);
409
- if (I.currentTarget.dispatchEvent(D), !D.defaultPrevented) {
410
- const V = b().filter((A) => A.focusable), B = V.find((A) => A.active), W = V.find((A) => A.id === h), K = [B, W, ...V].filter(
405
+ onFocus: A(e.onFocus, (y) => {
406
+ const Q = !R.current;
407
+ if (y.target === y.currentTarget && Q && !C) {
408
+ const F = new CustomEvent(ne, bt);
409
+ if (y.currentTarget.dispatchEvent(F), !F.defaultPrevented) {
410
+ const V = b().filter((E) => E.focusable), B = V.find((E) => E.active), j = V.find((E) => E.id === h), k = [B, j, ...V].filter(
411
411
  Boolean
412
- ).map((A) => A.ref.current);
413
- Ee(K, l);
412
+ ).map((E) => E.ref.current);
413
+ xe(k, l);
414
414
  }
415
415
  }
416
- N.current = !1;
416
+ R.current = !1;
417
417
  }),
418
- onBlur: M(e.onBlur, () => R(!1))
418
+ onBlur: A(e.onBlur, () => N(!1))
419
419
  }
420
420
  )
421
421
  }
422
422
  );
423
- }), Te = "RovingFocusGroupItem", xe = a.forwardRef(
423
+ }), Ne = "RovingFocusGroupItem", Te = u.forwardRef(
424
424
  (e, t) => {
425
425
  const {
426
426
  __scopeRovingFocusGroup: r,
427
427
  focusable: o = !0,
428
428
  active: s = !1,
429
429
  tabStopId: n,
430
- children: c,
431
- ...i
432
- } = e, d = Ce(), u = n || d, l = yt(Te, r), f = l.currentTabStopId === u, v = Se(r), { onFocusableItemAdd: g, onFocusableItemRemove: S, currentTabStopId: h } = l;
433
- return a.useEffect(() => {
430
+ children: i,
431
+ ...c
432
+ } = e, d = we(), a = n || d, l = Ct(Ne, r), f = l.currentTabStopId === a, _ = ye(r), { onFocusableItemAdd: g, onFocusableItemRemove: I, currentTabStopId: h } = l;
433
+ return u.useEffect(() => {
434
434
  if (o)
435
- return g(), () => S();
436
- }, [o, g, S]), /* @__PURE__ */ m(
437
- oe.ItemSlot,
435
+ return g(), () => I();
436
+ }, [o, g, I]), /* @__PURE__ */ m(
437
+ se.ItemSlot,
438
438
  {
439
439
  scope: r,
440
- id: u,
440
+ id: a,
441
441
  focusable: o,
442
442
  active: s,
443
443
  children: /* @__PURE__ */ m(
@@ -445,41 +445,41 @@ var St = a.forwardRef((e, t) => {
445
445
  {
446
446
  tabIndex: f ? 0 : -1,
447
447
  "data-orientation": l.orientation,
448
- ...i,
448
+ ...c,
449
449
  ref: t,
450
- onMouseDown: M(e.onMouseDown, (_) => {
451
- o ? l.onItemFocus(u) : _.preventDefault();
450
+ onMouseDown: A(e.onMouseDown, (v) => {
451
+ o ? l.onItemFocus(a) : v.preventDefault();
452
452
  }),
453
- onFocus: M(e.onFocus, () => l.onItemFocus(u)),
454
- onKeyDown: M(e.onKeyDown, (_) => {
455
- if (_.key === "Tab" && _.shiftKey) {
453
+ onFocus: A(e.onFocus, () => l.onItemFocus(a)),
454
+ onKeyDown: A(e.onKeyDown, (v) => {
455
+ if (v.key === "Tab" && v.shiftKey) {
456
456
  l.onItemShiftTab();
457
457
  return;
458
458
  }
459
- if (_.target !== _.currentTarget) return;
460
- const C = Tt(_, l.orientation, l.dir);
459
+ if (v.target !== v.currentTarget) return;
460
+ const C = Rt(v, l.orientation, l.dir);
461
461
  if (C !== void 0) {
462
- if (_.metaKey || _.ctrlKey || _.altKey || _.shiftKey) return;
463
- _.preventDefault();
464
- let w = v().filter((b) => b.focusable).map((b) => b.ref.current);
462
+ if (v.metaKey || v.ctrlKey || v.altKey || v.shiftKey) return;
463
+ v.preventDefault();
464
+ let w = _().filter((b) => b.focusable).map((b) => b.ref.current);
465
465
  if (C === "last") w.reverse();
466
466
  else if (C === "prev" || C === "next") {
467
467
  C === "prev" && w.reverse();
468
- const b = w.indexOf(_.currentTarget);
469
- w = l.loop ? xt(w, b + 1) : w.slice(b + 1);
468
+ const b = w.indexOf(v.currentTarget);
469
+ w = l.loop ? Nt(w, b + 1) : w.slice(b + 1);
470
470
  }
471
- setTimeout(() => Ee(w));
471
+ setTimeout(() => xe(w));
472
472
  }
473
473
  }),
474
- children: typeof c == "function" ? c({ isCurrentTabStop: f, hasTabStop: h != null }) : c
474
+ children: typeof i == "function" ? i({ isCurrentTabStop: f, hasTabStop: h != null }) : i
475
475
  }
476
476
  )
477
477
  }
478
478
  );
479
479
  }
480
480
  );
481
- xe.displayName = Te;
482
- var Nt = {
481
+ Te.displayName = Ne;
482
+ var yt = {
483
483
  ArrowLeft: "prev",
484
484
  ArrowUp: "prev",
485
485
  ArrowRight: "next",
@@ -489,33 +489,33 @@ var Nt = {
489
489
  PageDown: "last",
490
490
  End: "last"
491
491
  };
492
- function Rt(e, t) {
492
+ function It(e, t) {
493
493
  return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
494
494
  }
495
- function Tt(e, t, r) {
496
- const o = Rt(e.key, r);
495
+ function Rt(e, t, r) {
496
+ const o = It(e.key, r);
497
497
  if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(o)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(o)))
498
- return Nt[o];
498
+ return yt[o];
499
499
  }
500
- function Ee(e, t = !1) {
500
+ function xe(e, t = !1) {
501
501
  const r = document.activeElement;
502
502
  for (const o of e)
503
503
  if (o === r || (o.focus({ preventScroll: t }), document.activeElement !== r)) return;
504
504
  }
505
- function xt(e, t) {
505
+ function Nt(e, t) {
506
506
  return e.map((r, o) => e[(t + o) % e.length]);
507
507
  }
508
- var Et = Re, At = xe;
509
- function jt(e, t) {
510
- return a.useReducer((r, o) => t[r][o] ?? r, e);
508
+ var Tt = Re, xt = Te;
509
+ function Et(e, t) {
510
+ return u.useReducer((r, o) => t[r][o] ?? r, e);
511
511
  }
512
- var Ae = (e) => {
513
- const { present: t, children: r } = e, o = Mt(t), s = typeof r == "function" ? r({ present: o.isPresent }) : a.Children.only(r), n = Z(o.ref, Pt(s));
514
- return typeof r == "function" || o.isPresent ? a.cloneElement(s, { ref: n }) : null;
512
+ var Ee = (e) => {
513
+ const { present: t, children: r } = e, o = At(t), s = typeof r == "function" ? r({ present: o.isPresent }) : u.Children.only(r), n = X(o.ref, Mt(s));
514
+ return typeof r == "function" || o.isPresent ? u.cloneElement(s, { ref: n }) : null;
515
515
  };
516
- Ae.displayName = "Presence";
517
- function Mt(e) {
518
- const [t, r] = a.useState(), o = a.useRef(null), s = a.useRef(e), n = a.useRef("none"), c = e ? "mounted" : "unmounted", [i, d] = jt(c, {
516
+ Ee.displayName = "Presence";
517
+ function At(e) {
518
+ const [t, r] = u.useState(), o = u.useRef(null), s = u.useRef(e), n = u.useRef("none"), i = e ? "mounted" : "unmounted", [c, d] = Et(i, {
519
519
  mounted: {
520
520
  UNMOUNT: "unmounted",
521
521
  ANIMATION_OUT: "unmountSuspended"
@@ -528,84 +528,84 @@ function Mt(e) {
528
528
  MOUNT: "mounted"
529
529
  }
530
530
  });
531
- return a.useEffect(() => {
532
- const u = Y(o.current);
533
- n.current = i === "mounted" ? u : "none";
534
- }, [i]), X(() => {
535
- const u = o.current, l = s.current;
531
+ return u.useEffect(() => {
532
+ const a = Z(o.current);
533
+ n.current = c === "mounted" ? a : "none";
534
+ }, [c]), H(() => {
535
+ const a = o.current, l = s.current;
536
536
  if (l !== e) {
537
- const v = n.current, g = Y(u);
538
- e ? d("MOUNT") : g === "none" || (u == null ? void 0 : u.display) === "none" ? d("UNMOUNT") : d(l && v !== g ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
537
+ const _ = n.current, g = Z(a);
538
+ e ? d("MOUNT") : g === "none" || (a == null ? void 0 : a.display) === "none" ? d("UNMOUNT") : d(l && _ !== g ? "ANIMATION_OUT" : "UNMOUNT"), s.current = e;
539
539
  }
540
- }, [e, d]), X(() => {
540
+ }, [e, d]), H(() => {
541
541
  if (t) {
542
- let u;
542
+ let a;
543
543
  const l = t.ownerDocument.defaultView ?? window, f = (g) => {
544
- const h = Y(o.current).includes(CSS.escape(g.animationName));
544
+ const h = Z(o.current).includes(CSS.escape(g.animationName));
545
545
  if (g.target === t && h && (d("ANIMATION_END"), !s.current)) {
546
- const _ = t.style.animationFillMode;
547
- t.style.animationFillMode = "forwards", u = l.setTimeout(() => {
548
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = _);
546
+ const v = t.style.animationFillMode;
547
+ t.style.animationFillMode = "forwards", a = l.setTimeout(() => {
548
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = v);
549
549
  });
550
550
  }
551
- }, v = (g) => {
552
- g.target === t && (n.current = Y(o.current));
551
+ }, _ = (g) => {
552
+ g.target === t && (n.current = Z(o.current));
553
553
  };
554
- return t.addEventListener("animationstart", v), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
555
- l.clearTimeout(u), t.removeEventListener("animationstart", v), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
554
+ return t.addEventListener("animationstart", _), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
555
+ l.clearTimeout(a), t.removeEventListener("animationstart", _), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
556
556
  };
557
557
  } else
558
558
  d("ANIMATION_END");
559
559
  }, [t, d]), {
560
- isPresent: ["mounted", "unmountSuspended"].includes(i),
561
- ref: a.useCallback((u) => {
562
- o.current = u ? getComputedStyle(u) : null, r(u);
560
+ isPresent: ["mounted", "unmountSuspended"].includes(c),
561
+ ref: u.useCallback((a) => {
562
+ o.current = a ? getComputedStyle(a) : null, r(a);
563
563
  }, [])
564
564
  };
565
565
  }
566
- function Y(e) {
566
+ function Z(e) {
567
567
  return (e == null ? void 0 : e.animationName) || "none";
568
568
  }
569
- function Pt(e) {
569
+ function Mt(e) {
570
570
  var o, s;
571
571
  let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning;
572
572
  return r ? e.ref : (t = (s = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : s.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
573
573
  }
574
- var H = "Tabs", [$t] = se(H, [
575
- Ne
576
- ]), je = Ne(), [Ot, ce] = $t(H), Me = a.forwardRef(
574
+ var J = "Tabs", [Pt] = ie(J, [
575
+ Ie
576
+ ]), Ae = Ie(), [$t, ce] = Pt(J), Me = u.forwardRef(
577
577
  (e, t) => {
578
578
  const {
579
579
  __scopeTabs: r,
580
580
  value: o,
581
581
  onValueChange: s,
582
582
  defaultValue: n,
583
- orientation: c = "horizontal",
584
- dir: i,
583
+ orientation: i = "horizontal",
584
+ dir: c,
585
585
  activationMode: d = "automatic",
586
- ...u
587
- } = e, l = ye(i), [f, v] = Ie({
586
+ ...a
587
+ } = e, l = Se(c), [f, _] = Ce({
588
588
  prop: o,
589
589
  onChange: s,
590
590
  defaultProp: n ?? "",
591
- caller: H
591
+ caller: J
592
592
  });
593
593
  return /* @__PURE__ */ m(
594
- Ot,
594
+ $t,
595
595
  {
596
596
  scope: r,
597
- baseId: Ce(),
597
+ baseId: we(),
598
598
  value: f,
599
- onValueChange: v,
600
- orientation: c,
599
+ onValueChange: _,
600
+ orientation: i,
601
601
  dir: l,
602
602
  activationMode: d,
603
603
  children: /* @__PURE__ */ m(
604
604
  L.div,
605
605
  {
606
606
  dir: l,
607
- "data-orientation": c,
608
- ...u,
607
+ "data-orientation": i,
608
+ ...a,
609
609
  ref: t
610
610
  }
611
611
  )
@@ -613,15 +613,15 @@ var H = "Tabs", [$t] = se(H, [
613
613
  );
614
614
  }
615
615
  );
616
- Me.displayName = H;
617
- var Pe = "TabsList", $e = a.forwardRef(
616
+ Me.displayName = J;
617
+ var Pe = "TabsList", $e = u.forwardRef(
618
618
  (e, t) => {
619
- const { __scopeTabs: r, loop: o = !0, ...s } = e, n = ce(Pe, r), c = je(r);
619
+ const { __scopeTabs: r, loop: o = !0, ...s } = e, n = ce(Pe, r), i = Ae(r);
620
620
  return /* @__PURE__ */ m(
621
- Et,
621
+ Tt,
622
622
  {
623
623
  asChild: !0,
624
- ...c,
624
+ ...i,
625
625
  orientation: n.orientation,
626
626
  dir: n.dir,
627
627
  loop: o,
@@ -639,14 +639,14 @@ var Pe = "TabsList", $e = a.forwardRef(
639
639
  }
640
640
  );
641
641
  $e.displayName = Pe;
642
- var Oe = "TabsTrigger", Fe = a.forwardRef(
642
+ var Oe = "TabsTrigger", Fe = u.forwardRef(
643
643
  (e, t) => {
644
- const { __scopeTabs: r, value: o, disabled: s = !1, ...n } = e, c = ce(Oe, r), i = je(r), d = Ve(c.baseId, o), u = Be(c.baseId, o), l = o === c.value;
644
+ const { __scopeTabs: r, value: o, disabled: s = !1, ...n } = e, i = ce(Oe, r), c = Ae(r), d = Ve(i.baseId, o), a = Be(i.baseId, o), l = o === i.value;
645
645
  return /* @__PURE__ */ m(
646
- At,
646
+ xt,
647
647
  {
648
648
  asChild: !0,
649
- ...i,
649
+ ...c,
650
650
  focusable: !s,
651
651
  active: l,
652
652
  children: /* @__PURE__ */ m(
@@ -655,22 +655,22 @@ var Oe = "TabsTrigger", Fe = a.forwardRef(
655
655
  type: "button",
656
656
  role: "tab",
657
657
  "aria-selected": l,
658
- "aria-controls": u,
658
+ "aria-controls": a,
659
659
  "data-state": l ? "active" : "inactive",
660
660
  "data-disabled": s ? "" : void 0,
661
661
  disabled: s,
662
662
  id: d,
663
663
  ...n,
664
664
  ref: t,
665
- onMouseDown: M(e.onMouseDown, (f) => {
666
- !s && f.button === 0 && f.ctrlKey === !1 ? c.onValueChange(o) : f.preventDefault();
665
+ onMouseDown: A(e.onMouseDown, (f) => {
666
+ !s && f.button === 0 && f.ctrlKey === !1 ? i.onValueChange(o) : f.preventDefault();
667
667
  }),
668
- onKeyDown: M(e.onKeyDown, (f) => {
669
- [" ", "Enter"].includes(f.key) && c.onValueChange(o);
668
+ onKeyDown: A(e.onKeyDown, (f) => {
669
+ [" ", "Enter"].includes(f.key) && i.onValueChange(o);
670
670
  }),
671
- onFocus: M(e.onFocus, () => {
672
- const f = c.activationMode !== "manual";
673
- !l && !s && f && c.onValueChange(o);
671
+ onFocus: A(e.onFocus, () => {
672
+ const f = i.activationMode !== "manual";
673
+ !l && !s && f && i.onValueChange(o);
674
674
  })
675
675
  }
676
676
  )
@@ -679,29 +679,29 @@ var Oe = "TabsTrigger", Fe = a.forwardRef(
679
679
  }
680
680
  );
681
681
  Fe.displayName = Oe;
682
- var De = "TabsContent", Le = a.forwardRef(
682
+ var De = "TabsContent", Le = u.forwardRef(
683
683
  (e, t) => {
684
- const { __scopeTabs: r, value: o, forceMount: s, children: n, ...c } = e, i = ce(De, r), d = Ve(i.baseId, o), u = Be(i.baseId, o), l = o === i.value, f = a.useRef(l);
685
- return a.useEffect(() => {
686
- const v = requestAnimationFrame(() => f.current = !1);
687
- return () => cancelAnimationFrame(v);
688
- }, []), /* @__PURE__ */ m(Ae, { present: s || l, children: ({ present: v }) => /* @__PURE__ */ m(
684
+ const { __scopeTabs: r, value: o, forceMount: s, children: n, ...i } = e, c = ce(De, r), d = Ve(c.baseId, o), a = Be(c.baseId, o), l = o === c.value, f = u.useRef(l);
685
+ return u.useEffect(() => {
686
+ const _ = requestAnimationFrame(() => f.current = !1);
687
+ return () => cancelAnimationFrame(_);
688
+ }, []), /* @__PURE__ */ m(Ee, { present: s || l, children: ({ present: _ }) => /* @__PURE__ */ m(
689
689
  L.div,
690
690
  {
691
691
  "data-state": l ? "active" : "inactive",
692
- "data-orientation": i.orientation,
692
+ "data-orientation": c.orientation,
693
693
  role: "tabpanel",
694
694
  "aria-labelledby": d,
695
- hidden: !v,
696
- id: u,
695
+ hidden: !_,
696
+ id: a,
697
697
  tabIndex: 0,
698
- ...c,
698
+ ...i,
699
699
  ref: t,
700
700
  style: {
701
701
  ...e.style,
702
702
  animationDuration: f.current ? "0s" : void 0
703
703
  },
704
- children: v && n
704
+ children: _ && n
705
705
  }
706
706
  ) });
707
707
  }
@@ -713,25 +713,25 @@ function Ve(e, t) {
713
713
  function Be(e, t) {
714
714
  return `${e}-content-${t}`;
715
715
  }
716
- var Ft = Me, Dt = $e, Lt = Fe, Vt = Le;
717
- function Bt(e) {
716
+ var Ot = Me, Ft = $e, Dt = Fe, Lt = Le;
717
+ function Vt(e) {
718
718
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
719
719
  }
720
- var ne = { exports: {} };
720
+ var re = { exports: {} };
721
721
  /*!
722
722
  Copyright (c) 2018 Jed Watson.
723
723
  Licensed under the MIT License (MIT), see
724
724
  http://jedwatson.github.io/classnames
725
725
  */
726
- var ve;
727
- function Ut() {
728
- return ve || (ve = 1, (function(e) {
726
+ var me;
727
+ function Bt() {
728
+ return me || (me = 1, (function(e) {
729
729
  (function() {
730
730
  var t = {}.hasOwnProperty;
731
731
  function r() {
732
- for (var n = "", c = 0; c < arguments.length; c++) {
733
- var i = arguments[c];
734
- i && (n = s(n, o.call(this, i)));
732
+ for (var n = "", i = 0; i < arguments.length; i++) {
733
+ var c = arguments[i];
734
+ c && (n = s(n, o.call(this, c)));
735
735
  }
736
736
  return n;
737
737
  }
@@ -744,28 +744,28 @@ function Ut() {
744
744
  return r.apply(this, n);
745
745
  if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
746
746
  return n.toString();
747
- var c = "";
748
- for (var i in n)
749
- t.call(n, i) && n[i] && (c = s(c, this && this[i] || i));
750
- return c;
747
+ var i = "";
748
+ for (var c in n)
749
+ t.call(n, c) && n[c] && (i = s(i, this && this[c] || c));
750
+ return i;
751
751
  }
752
- function s(n, c) {
753
- return c ? n ? n + " " + c : n + c : n;
752
+ function s(n, i) {
753
+ return i ? n ? n + " " + i : n + i : n;
754
754
  }
755
755
  e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
756
756
  })();
757
- })(ne)), ne.exports;
757
+ })(re)), re.exports;
758
758
  }
759
- var Gt = Ut();
760
- const ie = /* @__PURE__ */ Bt(Gt), Wt = {
759
+ var Ut = Bt();
760
+ const ue = /* @__PURE__ */ Vt(Ut), Wt = {
761
761
  "purpur-tab-content": "_purpur-tab-content_1ugbi_1",
762
762
  "purpur-tab-content--force-mount": "_purpur-tab-content--force-mount_1ugbi_15"
763
- }, kt = ie.bind(Wt), _e = "purpur-tab-content", Kt = ge(
764
- ({ children: e, tabId: t, "data-testid": r, className: o, disableForceMount: s, ...n }, c) => /* @__PURE__ */ m(
765
- Vt,
763
+ }, jt = ue.bind(Wt), _e = "purpur-tab-content", Gt = be(
764
+ ({ children: e, tabId: t, "data-testid": r, className: o, disableForceMount: s, ...n }, i) => /* @__PURE__ */ m(
765
+ Lt,
766
766
  {
767
- ref: c,
768
- className: kt(_e, o, {
767
+ ref: i,
768
+ className: jt(_e, o, {
769
769
  [`${_e}--force-mount`]: !s
770
770
  }),
771
771
  "data-testid": r,
@@ -775,13 +775,13 @@ const ie = /* @__PURE__ */ Bt(Gt), Wt = {
775
775
  children: e
776
776
  }
777
777
  )
778
- ), qt = (e) => !!e && Ke(e) && !!e.props.name && !!e.props.tabId, zt = {
779
- "purpur-tab-header": "_purpur-tab-header_1vo2v_1",
780
- "purpur-tab-header--contained": "_purpur-tab-header--contained_1vo2v_36",
781
- "purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_1vo2v_36",
782
- "purpur-tab-header--line": "_purpur-tab-header--line_1vo2v_39",
783
- "purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_1vo2v_51"
784
- }, Yt = ie.bind(zt), be = "purpur-tab-header", Zt = ge(
778
+ ), kt = (e) => !!e && Ge(e) && !!e.props.name && !!e.props.tabId, zt = {
779
+ "purpur-tab-header": "_purpur-tab-header_znb0i_1",
780
+ "purpur-tab-header--contained": "_purpur-tab-header--contained_znb0i_36",
781
+ "purpur-tab-header--contained-negative": "_purpur-tab-header--contained-negative_znb0i_36",
782
+ "purpur-tab-header--line": "_purpur-tab-header--line_znb0i_39",
783
+ "purpur-tab-header--line-negative": "_purpur-tab-header--line-negative_znb0i_51"
784
+ }, Kt = ue.bind(zt), ve = "purpur-tab-header", qt = be(
785
785
  ({
786
786
  index: e,
787
787
  tabId: t,
@@ -789,182 +789,174 @@ const ie = /* @__PURE__ */ Bt(Gt), Wt = {
789
789
  negative: o,
790
790
  onFocus: s,
791
791
  "data-testid": n,
792
- children: c
793
- }, i) => /* @__PURE__ */ m(
794
- Lt,
792
+ children: i
793
+ }, c) => /* @__PURE__ */ m(
794
+ Dt,
795
795
  {
796
796
  id: `${t}-trigger`,
797
- className: Yt(be, `${be}--${r}${o ? "-negative" : ""}`),
797
+ className: Kt(ve, `${ve}--${r}${o ? "-negative" : ""}`),
798
798
  value: t,
799
799
  "data-testid": n,
800
800
  "data-index": e,
801
- ref: i,
801
+ ref: c,
802
802
  onFocus: s,
803
- children: c
803
+ children: i
804
804
  }
805
805
  )
806
- ), Xt = {
807
- "purpur-tabs__wrapper": "_purpur-tabs__wrapper_j1jjc_1",
808
- "purpur-tabs__scroll-button": "_purpur-tabs__scroll-button_j1jjc_9",
809
- "purpur-tabs__scroll-button--left": "_purpur-tabs__scroll-button--left_j1jjc_71",
810
- "purpur-tabs__scroll-button--right": "_purpur-tabs__scroll-button--right_j1jjc_74",
811
- "purpur-tabs__wrapper--scroll-end": "_purpur-tabs__wrapper--scroll-end_j1jjc_77",
812
- "purpur-tabs__wrapper--scroll-start": "_purpur-tabs__wrapper--scroll-start_j1jjc_80",
813
- "purpur-tabs--line": "_purpur-tabs--line_j1jjc_83",
814
- "purpur-tabs--line-negative": "_purpur-tabs--line-negative_j1jjc_83",
815
- "purpur-tabs__selected-border": "_purpur-tabs__selected-border_j1jjc_91",
816
- "purpur-tabs__content-wrapper": "_purpur-tabs__content-wrapper_j1jjc_115",
817
- "purpur-tabs--contained": "_purpur-tabs--contained_j1jjc_123",
818
- "purpur-tabs__list": "_purpur-tabs__list_j1jjc_123",
819
- "purpur-tabs--contained-negative": "_purpur-tabs--contained-negative_j1jjc_123",
820
- "purpur-tabs__content-container": "_purpur-tabs__content-container_j1jjc_126",
821
- "purpur-tabs--fullWidth": "_purpur-tabs--fullWidth_j1jjc_136"
822
- }, rn = ["line", "contained"], Ht = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), $ = ie.bind(Xt), T = "purpur-tabs", Jt = (e, t) => {
806
+ ), Yt = {
807
+ "purpur-tabs__wrapper": "_purpur-tabs__wrapper_1u905_1",
808
+ "purpur-tabs__scroll-button": "_purpur-tabs__scroll-button_1u905_9",
809
+ "purpur-tabs__scroll-button--left": "_purpur-tabs__scroll-button--left_1u905_71",
810
+ "purpur-tabs__scroll-button--right": "_purpur-tabs__scroll-button--right_1u905_74",
811
+ "purpur-tabs__wrapper--scroll-start": "_purpur-tabs__wrapper--scroll-start_1u905_77",
812
+ "purpur-tabs__wrapper--scroll-end": "_purpur-tabs__wrapper--scroll-end_1u905_80",
813
+ "purpur-tabs--line": "_purpur-tabs--line_1u905_83",
814
+ "purpur-tabs--line-negative": "_purpur-tabs--line-negative_1u905_83",
815
+ "purpur-tabs__selected-border": "_purpur-tabs__selected-border_1u905_91",
816
+ "purpur-tabs__content-wrapper": "_purpur-tabs__content-wrapper_1u905_115",
817
+ "purpur-tabs--contained": "_purpur-tabs--contained_1u905_123",
818
+ "purpur-tabs__list": "_purpur-tabs__list_1u905_123",
819
+ "purpur-tabs--contained-negative": "_purpur-tabs--contained-negative_1u905_123",
820
+ "purpur-tabs__content-container": "_purpur-tabs__content-container_1u905_126",
821
+ "purpur-tabs--fullWidth": "_purpur-tabs--fullWidth_1u905_136"
822
+ }, tn = ["line", "contained"], Zt = (e) => new CustomEvent("tabChangeDetail", { detail: { value: e } }), P = ue.bind(Yt), T = "purpur-tabs", Xt = (e, t) => {
823
823
  var d;
824
824
  if (typeof (e == null ? void 0 : e.getBoundingClientRect) != "function" || typeof (t == null ? void 0 : t.scroll) != "function")
825
825
  return;
826
- const r = e.getBoundingClientRect(), o = t.getBoundingClientRect(), s = t.clientWidth, n = parseInt((d = getComputedStyle(t).borderLeftWidth) == null ? void 0 : d.split("px")[0], 10), c = o.left + (isNaN(n) ? 0 : n);
827
- let i;
828
- r.right > o.right && (i = r.left + t.scrollLeft, i = i + r.width - s + s * 0.1, i = i - c), r.left < o.left && (i = r.left + t.scrollLeft, i = i - s * 0.1, i = i - c), i !== void 0 && t.scroll({ left: i, behavior: "smooth" });
829
- }, Qt = ({
826
+ const r = e.getBoundingClientRect(), o = t.getBoundingClientRect(), s = t.clientWidth, n = parseInt((d = getComputedStyle(t).borderLeftWidth) == null ? void 0 : d.split("px")[0], 10), i = o.left + (isNaN(n) ? 0 : n);
827
+ let c;
828
+ r.right > o.right && (c = r.left + t.scrollLeft, c = c + r.width - s + s * 0.1, c = c - i), r.left < o.left && (c = r.left + t.scrollLeft, c = c - s * 0.1, c = c - i), c !== void 0 && t.scroll({ left: c, behavior: "smooth" });
829
+ }, Ht = ({
830
830
  children: e,
831
831
  variant: t = "line",
832
832
  negative: r = !1,
833
833
  fullWidth: o = !1,
834
834
  onChange: s,
835
835
  className: n,
836
- defaultValue: c,
837
- animateHeight: i = !1,
836
+ defaultValue: i,
837
+ animateHeight: c = !1,
838
838
  "data-testid": d,
839
- value: u,
839
+ value: a,
840
840
  ...l
841
841
  }) => {
842
- const f = ee(null), [v, g] = U(-1), [S, h] = U({}), [_, C] = U(0), [R, w] = U(0), b = q.toArray(e).filter(qt), N = ee(null), x = ee(new Array(b.length)), O = 200, I = t === "line", J = $(
842
+ const f = te(null), [_, g] = U(-1), [I, h] = U({}), [v, C] = U(0), [N, w] = U(0), b = q.toArray(e).filter(kt), R = te(null), x = te(new Array(b.length)), $ = 200, y = t === "line", Q = P(
843
843
  T,
844
844
  `${T}--${t}${r ? "-negative" : ""}`,
845
845
  { [`${T}--fullWidth`]: o },
846
846
  n
847
- ), D = q.map(b, ({ props: { tabId: p } }) => p), V = () => {
848
- const p = D.findIndex((y) => y === c);
847
+ ), F = q.map(b, ({ props: { tabId: p } }) => p), V = () => {
848
+ const p = F.findIndex((S) => S === i);
849
849
  return p >= 0 ? p : 0;
850
850
  };
851
- z(() => {
852
- u && W(b.findIndex((p) => p.props.tabId === u));
853
- }, [b, u]);
854
- const [B, W] = U(V);
855
- if (new Set(D).size !== D.length)
851
+ Y(() => {
852
+ a && j(b.findIndex((p) => p.props.tabId === a));
853
+ }, [b, a]);
854
+ const [B, j] = U(V);
855
+ if (new Set(F).size !== F.length)
856
856
  throw new Error("tabId must be unique");
857
- const k = (p, y) => y || d ? `${y || d}-${p}` : void 0, K = () => {
858
- if (!I)
857
+ const G = (p, S) => S || d ? `${S || d}-${p}` : void 0, k = () => {
858
+ if (!y)
859
859
  return;
860
860
  const p = x.current[B];
861
861
  C((p == null ? void 0 : p.offsetLeft) || 0), w((p == null ? void 0 : p.getBoundingClientRect().width) || 0);
862
- }, A = (p) => {
863
- I && !u && W(b.findIndex((y) => y.props.tabId === p)), s == null || s(Ht(p));
862
+ }, E = (p) => {
863
+ y && !a && j(b.findIndex((S) => S.props.tabId === p)), s == null || s(Zt(p));
864
864
  }, Ue = (p) => {
865
- if (N != null && N.current) {
866
- const { scrollLeft: y } = N.current, P = p === "left" ? -O : O;
867
- N.current.scroll({ left: y + P, behavior: "smooth" });
865
+ if (R != null && R.current) {
866
+ const { scrollLeft: S } = R.current, M = p === "left" ? -$ : $;
867
+ R.current.scroll({ left: S + M, behavior: "smooth" });
868
868
  }
869
869
  }, ae = ({ side: p }) => /* @__PURE__ */ m(
870
870
  "button",
871
871
  {
872
- className: $(`${T}__scroll-button`, `${T}__scroll-button--${p}`),
872
+ className: P(`${T}__scroll-button`, `${T}__scroll-button--${p}`),
873
873
  onClick: () => Ue(p),
874
874
  type: "button",
875
875
  "aria-hidden": "true",
876
876
  tabIndex: -1,
877
- "data-testid": k("scroll-button"),
878
- children: /* @__PURE__ */ m(he, { svg: p === "left" ? nt : rt, size: "md" })
877
+ "data-testid": G("scroll-button"),
878
+ children: /* @__PURE__ */ m(ge, { svg: p === "left" ? et : tt, size: "md" })
879
879
  }
880
880
  );
881
- return z(() => {
881
+ return Y(() => {
882
882
  const p = () => {
883
- if (f.current && i) {
884
- const P = f.current.offsetHeight;
885
- g(P);
883
+ if (f.current && c) {
884
+ const M = f.current.offsetHeight;
885
+ g(M);
886
886
  }
887
- }, y = () => {
888
- p(), K();
887
+ }, S = () => {
888
+ p(), k();
889
889
  };
890
- return p(), window.addEventListener("resize", y), () => {
891
- window.removeEventListener("resize", y);
890
+ return p(), window.addEventListener("resize", S), () => {
891
+ window.removeEventListener("resize", S);
892
892
  };
893
- }, [B, i]), z(() => {
894
- K();
895
- }, [B, o, b.length, t]), z(() => {
896
- const p = (j) => {
897
- if (j.every((E) => E.isIntersecting) && j.length === b.length) {
893
+ }, [B, c]), Y(() => {
894
+ k();
895
+ }, [B, o, b.length, t]), Y(() => {
896
+ const p = R.current;
897
+ if (!p) return;
898
+ const S = () => {
899
+ const { scrollLeft: M, scrollWidth: z, clientWidth: K } = p, D = z > K, We = M <= 1, je = M + K >= z - 1;
900
+ if (!D) {
898
901
  h({});
899
902
  return;
900
903
  }
901
- j.forEach((E) => {
902
- const le = Number(E.target.getAttribute("data-index")), Ge = le === 0, We = le === b.length - 1;
903
- h((ke) => ({
904
- ...ke,
905
- ...Ge && {
906
- [`${T}__wrapper--scroll-end`]: !E.isIntersecting
907
- },
908
- ...We && {
909
- [`${T}__wrapper--scroll-start`]: !E.isIntersecting
910
- }
911
- }));
904
+ h({
905
+ [`${T}__wrapper--scroll-start`]: !We,
906
+ [`${T}__wrapper--scroll-end`]: !je
912
907
  });
913
- }, y = new IntersectionObserver(p, {
914
- threshold: [0.99],
915
- root: N.current
916
- }), P = x.current;
917
- return P.forEach((j) => y.observe(j)), () => {
918
- P.forEach((j) => y.unobserve(j));
919
908
  };
920
- }, [b.length]), /* @__PURE__ */ m(
921
- Ft,
909
+ return S(), p.addEventListener("scroll", S, { passive: !0 }), window.addEventListener("resize", S), () => {
910
+ p.removeEventListener("scroll", S), window.removeEventListener("resize", S);
911
+ };
912
+ }, []), /* @__PURE__ */ m(
913
+ Ot,
922
914
  {
923
- defaultValue: c ?? b[0].props.tabId,
924
- onValueChange: A,
915
+ defaultValue: i ?? b[0].props.tabId,
916
+ onValueChange: E,
925
917
  "data-testid": d,
926
- className: J,
927
- value: u,
918
+ className: Q,
919
+ value: a,
928
920
  ...l,
929
- children: /* @__PURE__ */ Q("div", { className: $(`${T}__container`), children: [
930
- /* @__PURE__ */ Q("div", { className: $(`${T}__wrapper`, S), children: [
931
- /* @__PURE__ */ Q(
932
- Dt,
921
+ children: /* @__PURE__ */ ee("div", { className: P(`${T}__container`), children: [
922
+ /* @__PURE__ */ ee("div", { className: P(`${T}__wrapper`, I), children: [
923
+ /* @__PURE__ */ ee(
924
+ Ft,
933
925
  {
934
926
  ref: (p) => {
935
- N.current = p;
927
+ R.current = p;
936
928
  },
937
- className: $(`${T}__list`),
929
+ className: P(`${T}__list`),
938
930
  children: [
939
- q.map(b, (p, y) => {
940
- const { name: P, tabId: j, "data-testid": ue } = p.props;
931
+ q.map(b, (p, S) => {
932
+ const { name: M, tabId: z, "data-testid": K } = p.props;
941
933
  return /* @__PURE__ */ m(
942
- Zt,
934
+ qt,
943
935
  {
944
- "data-testid": k("header", ue),
945
- index: y,
946
- tabId: j,
947
- ref: (E) => {
948
- E && (x.current[y] = E);
936
+ "data-testid": G("header", K),
937
+ index: S,
938
+ tabId: z,
939
+ ref: (D) => {
940
+ D && (x.current[S] = D);
949
941
  },
950
- onFocus: (E) => {
951
- Jt(E.target, N.current);
942
+ onFocus: (D) => {
943
+ Xt(D.target, R.current);
952
944
  },
953
945
  variant: t,
954
946
  negative: r,
955
- children: P
947
+ children: M
956
948
  }
957
949
  );
958
950
  }),
959
- I && /* @__PURE__ */ m(
951
+ y && /* @__PURE__ */ m(
960
952
  "div",
961
953
  {
962
- className: $(`${T}__selected-border`),
954
+ className: P(`${T}__selected-border`),
963
955
  style: {
964
- width: R,
965
- transform: `translateX(${_}px)`
956
+ width: N,
957
+ transform: `translateX(${v}px)`
966
958
  },
967
- "data-testid": k("selected-border")
959
+ "data-testid": G("selected-border")
968
960
  }
969
961
  )
970
962
  ]
@@ -976,19 +968,19 @@ const ie = /* @__PURE__ */ Bt(Gt), Wt = {
976
968
  /* @__PURE__ */ m(
977
969
  "div",
978
970
  {
979
- className: i ? $(`${T}__content-wrapper`) : "",
980
- style: { height: i && v > -1 ? `${v}px` : "auto" },
981
- children: /* @__PURE__ */ m("div", { ref: f, className: $(`${T}__content-container`), children: q.map(b, (p) => p) })
971
+ className: c ? P(`${T}__content-wrapper`) : "",
972
+ style: { height: c && _ > -1 ? `${_}px` : "auto" },
973
+ children: /* @__PURE__ */ m("div", { ref: f, className: P(`${T}__content-container`), children: q.map(b, (p) => p) })
982
974
  }
983
975
  )
984
976
  ] })
985
977
  }
986
978
  );
987
979
  };
988
- Qt.Content = Kt;
980
+ Ht.Content = Gt;
989
981
  export {
990
- Qt as Tabs,
991
- Ht as createTabChangeDetailEvent,
992
- rn as tabsVariants
982
+ Ht as Tabs,
983
+ Zt as createTabChangeDetailEvent,
984
+ tn as tabsVariants
993
985
  };
994
986
  //# sourceMappingURL=tabs.es.js.map