@lax-wp/design-system 0.14.6 → 0.14.8

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.
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as ke } from "react/jsx-runtime";
2
- import { useSensors as Rt, useSensor as Ze, MouseSensor as zt, TouchSensor as Wt, DndContext as Pt, closestCenter as Ft } from "@dnd-kit/core";
2
+ import { useSensors as Rt, useSensor as Ze, MouseSensor as Wt, TouchSensor as Pt, DndContext as Ft, closestCenter as zt } from "@dnd-kit/core";
3
3
  import { SortableContext as Bt, horizontalListSortingStrategy as jt, arrayMove as Ke } from "@dnd-kit/sortable";
4
4
  import { Dropdown as ye } from "antd";
5
5
  import l from "../../../_virtual/index.es.js";
@@ -17,13 +17,13 @@ import Ce from "../../tooltip/Tooltip.es.js";
17
17
  import { EditIcon as Xt } from "../../icons/EditIcon.es.js";
18
18
  import { toast as Zt } from "react-toastify";
19
19
  import { TabSwitch as Se } from "./TabSwitch.es.js";
20
- import { PinIcon as se, ArrowOutwardIcon as Kt, ArrowUpwardIcon as en, ArrowDownwardIcon as tn, ContentCopyIcon as nn, VisibilityOffIcon as sn, VisibilityIcon as on, UnpinFilledIcon as an, DeleteIcon as rn } from "../../icon/icons.generated.es.js";
20
+ import { PinIcon as oe, ArrowOutwardIcon as Kt, ArrowUpwardIcon as en, ArrowDownwardIcon as tn, ContentCopyIcon as nn, VisibilityOffIcon as on, VisibilityIcon as sn, UnpinFilledIcon as an, DeleteIcon as rn } from "../../icon/icons.generated.es.js";
21
21
  import { SortableTab as tt } from "./SortableTab.es.js";
22
22
  import { DropableWrapper as ln } from "./DropableWrapper.es.js";
23
23
  import { MoreButton as cn } from "./MoreButton.es.js";
24
24
  import { TabOptions as dn } from "./TabOptions.es.js";
25
25
  import { TabDragOverlay as un } from "./TabDragOverlay.es.js";
26
- const mn = () => Math.random().toString(16).slice(2, 13), oe = [
26
+ const mn = () => Math.random().toString(16).slice(2, 13), se = [
27
27
  "[&_.ant-dropdown-menu-item]:!outline-none",
28
28
  "[&_.ant-dropdown-menu-submenu-title]:!outline-none",
29
29
  "[&_.ant-dropdown-menu-item:focus-visible_.option-button-inner]:ring-2",
@@ -55,24 +55,24 @@ const Ie = (T) => {
55
55
  PIN: "Pin",
56
56
  UNPIN: "Unpin",
57
57
  EDIT: "Edit"
58
- }, Pn = ({
58
+ }, Fn = ({
59
59
  variant: T = "default",
60
60
  tabs: _ = [],
61
- activeTab: r,
61
+ activeTab: i,
62
62
  onTabClick: nt,
63
63
  suffixRecord: $,
64
- isLoading: st,
64
+ isLoading: ot,
65
65
  size: O = "md",
66
66
  className: ve,
67
67
  draggable: E = !1,
68
68
  showAllItems: A = !1,
69
- copyLink: ot = !1,
69
+ copyLink: st = !1,
70
70
  isDisabled: at = !1,
71
71
  color: ae = "light",
72
- iconsOnly: rt = !1,
73
- tabIcons: re = {},
74
- height: it = "h-6",
75
- fullWidth: ie = !1,
72
+ iconsOnly: it = !1,
73
+ tabIcons: ie = {},
74
+ height: rt = "h-6",
75
+ fullWidth: re = !1,
76
76
  fitContentWidth: lt = !1,
77
77
  disableAnimation: ct = !1,
78
78
  onEdit: _e,
@@ -90,29 +90,29 @@ const Ie = (T) => {
90
90
  linkConfig: m,
91
91
  showTabOptions: pt = !0
92
92
  }) => {
93
- const x = Yt(), Le = S ? x?.getTabSettings(S) : void 0, le = dt ?? Le?.tab_items, Y = ut ?? Le?.tab_options, [ce, ft] = w(""), [I, J] = w(!1), [U, bt] = w(0), [d, de] = w([]), [q, ht] = w([]), [xt, Q] = w(null), [D, X] = w(null), [gt, Me] = w(!1), [He, Ue] = w(
93
+ const x = Yt(), Le = S ? x?.getTabSettings(S) : void 0, le = dt ?? Le?.tab_items, Y = ut ?? Le?.tab_options, [ce, ft] = w(""), [I, J] = w(!1), [U, ht] = w(0), [d, de] = w([]), [q, bt] = w([]), [xt, Q] = w(null), [D, X] = w(null), [gt, Me] = w(!1), [He, Ue] = w(
94
94
  Y ?? At
95
- ), [ue, wt] = w(""), [Re, kt] = w("contains"), { showCounts: k, lockOrder: R, sortOrder: me } = He, { t: u } = $t(), Z = Te(null), yt = Te(null), ze = Te(U), { measureText: z } = Jt(), W = M(() => mn(), []), Tt = Rt(
96
- Ze(zt, { activationConstraint: { distance: 5 } }),
97
- Ze(Wt, { activationConstraint: { delay: 300, tolerance: 5 } })
95
+ ), [ue, wt] = w(""), [Re, kt] = w("contains"), { showCounts: k, lockOrder: R, sortOrder: me } = He, { t: u } = $t(), Z = Te(null), yt = Te(null), We = Te(U), { measureText: W } = Jt(), P = M(() => mn(), []), Tt = Rt(
96
+ Ze(Wt, { activationConstraint: { distance: 5 } }),
97
+ Ze(Pt, { activationConstraint: { delay: 300, tolerance: 5 } })
98
98
  ), p = M(() => $ && Object.fromEntries(
99
99
  Object.entries($).map(([e, t]) => [
100
100
  e,
101
101
  Gt(t)
102
102
  ])
103
- ), [$]), We = M(() => q.filter(({ is_hidden: e }) => !e), [q]), V = M(() => q.filter(({ is_hidden: e }) => e), [q]), Pe = M(
104
- () => We.filter(({ name: e }) => {
103
+ ), [$]), Pe = M(() => q.filter(({ is_hidden: e }) => !e), [q]), V = M(() => q.filter(({ is_hidden: e }) => e), [q]), Fe = M(
104
+ () => Pe.filter(({ name: e }) => {
105
105
  if (!ue) return !0;
106
- const t = (e ?? "").toLowerCase(), s = ue.toLowerCase();
107
- return Re === "contains" ? t.includes(s) : !t.includes(s);
106
+ const t = (e ?? "").toLowerCase(), o = ue.toLowerCase();
107
+ return Re === "contains" ? t.includes(o) : !t.includes(o);
108
108
  }),
109
- [We, ue, Re]
109
+ [Pe, ue, Re]
110
110
  ), a = M(
111
- () => [...Pe].sort((e, t) => e.is_pinned && !t.is_pinned ? -1 : !e.is_pinned && t.is_pinned ? 1 : 0),
112
- [Pe]
113
- ), Ct = U < a.length, K = A ? a.length : Ct ? U : a.length, Fe = a.findIndex((e) => e.name === r) >= K, Be = d.length - K - (Fe ? 1 : 0);
114
- ze.current = U;
115
- const P = v(
111
+ () => [...Fe].sort((e, t) => e.is_pinned && !t.is_pinned ? -1 : !e.is_pinned && t.is_pinned ? 1 : 0),
112
+ [Fe]
113
+ ), Ct = U < a.length, K = A ? a.length : Ct ? U : a.length, ze = a.findIndex((e) => e.name === i) >= K, Be = d.length - K - (ze ? 1 : 0);
114
+ We.current = U;
115
+ const F = v(
116
116
  (e) => {
117
117
  de(e), Ve?.(e), S && x?.persistTabSettings && x.persistTabSettings({ tab_type: S, tab_items: e });
118
118
  },
@@ -125,42 +125,42 @@ const Ie = (T) => {
125
125
  ), je = (e) => e.is_pinned ? 32 : 0, pe = v(
126
126
  (e) => {
127
127
  if (!e) return;
128
- const t = E ? 30 : 0, s = k ? 190 : 84, i = O === "sm" ? 4 : 8, o = 32;
128
+ const t = E ? 30 : 0, o = k ? 190 : 84, r = O === "sm" ? 4 : 8, s = 32;
129
129
  let f = 0, te = 0, g = 0;
130
- const b = e - (H?.width || 0) - t, Ye = ze.current, Je = Ye < a.length, qe = V.length > 0;
131
- for (let h = 0; h < a.length; h++) {
132
- const N = a[h], ne = p?.[N.name] ? String(p?.[N.name]) : "", xe = k && ne ? z(ne, {
130
+ const h = e - (H?.width || 0) - t, Ye = We.current, Je = Ye < a.length, qe = V.length > 0;
131
+ for (let b = 0; b < a.length; b++) {
132
+ const N = a[b], ne = p?.[N.name] ? String(p?.[N.name]) : "", xe = k && ne ? W(ne, {
133
133
  fontSize: "16px",
134
134
  fontWeight: "500",
135
135
  fontFamily: "Inter, system-ui, -apple-system, sans-serif"
136
- }) + 18 + 2 : 0, ge = z(N?.name || "", {
136
+ }) + 18 + 2 : 0, ge = W(N?.name || "", {
137
137
  fontSize: "16px",
138
138
  fontWeight: "600",
139
139
  fontFamily: "Inter, system-ui, -apple-system, sans-serif"
140
- }), we = C ? je(N) : 0, Xe = ge + xe + o + i + we;
141
- if (N.name === r && (te = Xe), f += Xe, b > f + (Je || qe ? s : 0) + h * 25)
142
- g = h + 1;
140
+ }), we = C ? je(N) : 0, Xe = ge + xe + s + r + we;
141
+ if (N.name === i && (te = Xe), f += Xe, h > f + (Je || qe ? o : 0) + b * 25)
142
+ g = b + 1;
143
143
  else
144
144
  break;
145
145
  }
146
146
  const Qe = a.length - g;
147
147
  if (Qe + V.length === 1 && V.length === 0 && Qe === 1 && g < a.length) {
148
- const h = a[g];
149
- if (h) {
150
- const N = p?.[h.name] ? String(p?.[h.name]) : "", ne = k && N ? z(N, {
148
+ const b = a[g];
149
+ if (b) {
150
+ const N = p?.[b.name] ? String(p?.[b.name]) : "", ne = k && N ? W(N, {
151
151
  fontSize: "16px",
152
152
  fontWeight: "500",
153
153
  fontFamily: "Inter, system-ui, -apple-system, sans-serif"
154
- }) + 18 + 2 : 0, xe = z(h?.name || "", {
154
+ }) + 18 + 2 : 0, xe = W(b?.name || "", {
155
155
  fontSize: "16px",
156
156
  fontWeight: "600",
157
157
  fontFamily: "Inter, system-ui, -apple-system, sans-serif"
158
- }), ge = C ? je(h) : 0, we = xe + ne + o + i + ge;
159
- b >= f + we && (g += 1);
158
+ }), ge = C ? je(b) : 0, we = xe + ne + s + r + ge;
159
+ h >= f + we && (g += 1);
160
160
  }
161
161
  }
162
162
  const Ut = A ? a.length : g;
163
- a.findIndex((h) => h.name === r) >= Ut && (f += te, b < f + (Je || qe ? s : 0) && (g = Math.max(g - 1, 0))), g !== Ye && bt(g);
163
+ a.findIndex((b) => b.name === i) >= Ut && (f += te, h < f + (Je || qe ? o : 0) && (g = Math.max(g - 1, 0))), g !== Ye && ht(g);
164
164
  },
165
165
  [
166
166
  a,
@@ -169,11 +169,11 @@ const Ie = (T) => {
169
169
  C,
170
170
  p,
171
171
  H?.width,
172
- r,
172
+ i,
173
173
  O,
174
174
  E,
175
175
  V.length,
176
- z
176
+ W
177
177
  ]
178
178
  ), fe = v(
179
179
  () => {
@@ -186,53 +186,53 @@ const Ie = (T) => {
186
186
  return new URLSearchParams();
187
187
  },
188
188
  [m, x]
189
- ), be = v(
189
+ ), he = v(
190
190
  (e, t) => (m && (t === m.defaultLink ? e.delete(m.key) : e.set(m.key, t), m.onResolve?.(e)), e),
191
191
  [m]
192
- ), F = v(
193
- (e) => m ? `?${be(fe(), e).toString()}` : void 0,
194
- [be, fe, m]
195
- ), Nt = ot || !!m, It = v(
192
+ ), z = v(
193
+ (e) => m ? `?${he(fe(), e).toString()}` : void 0,
194
+ [he, fe, m]
195
+ ), Nt = st || !!m, It = v(
196
196
  async (e) => {
197
- const t = F(e), s = typeof window < "u" ? window.location.origin : "", i = typeof window < "u" ? window.location.pathname : "", o = t ? `${s}${i}${t}` : `${s}${i}`;
198
- await navigator.clipboard.writeText(o), Zt.success(u("Link copied to clipboard"), {
197
+ const t = z(e), o = typeof window < "u" ? window.location.origin : "", r = typeof window < "u" ? window.location.pathname : "", s = t ? `${o}${r}${t}` : `${o}${r}`;
198
+ await navigator.clipboard.writeText(s), Zt.success(u("Link copied to clipboard"), {
199
199
  toastId: "Link copied to clipboard"
200
- }), Ee?.(e, o);
200
+ }), Ee?.(e, s);
201
201
  },
202
- [F, u, Ee]
202
+ [z, u, Ee]
203
203
  ), B = (e) => {
204
204
  if (J(!1), nt?.(e), m && x?.navigate) {
205
- const t = be(fe(), e);
205
+ const t = he(fe(), e);
206
206
  x.navigate(`?${t.toString()}`);
207
207
  }
208
208
  }, $e = (e) => {
209
209
  if (a.length <= 1) return;
210
210
  const t = d.map(
211
- (o) => o.name === e ? { ...o, is_hidden: !0 } : o
212
- ), s = a.findIndex((o) => o.name === e), i = s === 0 ? 1 : s - 1;
213
- B(a[i].name), P(t);
211
+ (s) => s.name === e ? { ...s, is_hidden: !0 } : s
212
+ ), o = a.findIndex((s) => s.name === e), r = o === 0 ? 1 : o - 1;
213
+ B(a[r].name), F(t);
214
214
  }, vt = (e) => {
215
215
  const t = d.map(
216
- (s) => s.name === e ? { ...s, is_hidden: !1 } : s
216
+ (o) => o.name === e ? { ...o, is_hidden: !1 } : o
217
217
  );
218
- J(!1), P(t);
218
+ J(!1), F(t);
219
219
  }, ee = (e) => {
220
220
  if (!C) return;
221
221
  const t = d.map(
222
- (s) => s.name === e ? { ...s, is_pinned: !s.is_pinned } : s
222
+ (o) => o.name === e ? { ...o, is_pinned: !o.is_pinned } : o
223
223
  );
224
- P(t);
224
+ F(t);
225
225
  }, Ae = (e, t) => {
226
- const s = d.findIndex(({ name: o }) => o === e), i = t === "left" ? s - (d[s - 1]?.name === r ? 2 : 1) : s + 1;
227
- P(Ke(d, s, i));
226
+ const o = d.findIndex(({ name: s }) => s === e), r = t === "left" ? o - (d[o - 1]?.name === i ? 2 : 1) : o + 1;
227
+ F(Ke(d, o, r));
228
228
  }, Ge = () => J(!I), _t = (e) => X(e.active.id), Ot = (e) => {
229
- const { active: t, over: s } = e;
230
- if (s?.id === "more-tabs") {
229
+ const { active: t, over: o } = e;
230
+ if (o?.id === "more-tabs") {
231
231
  $e(t.id), X(null), Q(null);
232
232
  return;
233
233
  }
234
- const i = d.findIndex(({ name: f }) => f === t.id), o = d.findIndex(({ name: f }) => f === s?.id);
235
- P(Ke(d, i, o)), X(null), Q(null);
234
+ const r = d.findIndex(({ name: f }) => f === t.id), s = d.findIndex(({ name: f }) => f === o?.id);
235
+ F(Ke(d, r, s)), X(null), Q(null);
236
236
  }, Et = () => {
237
237
  X(null), Q(null);
238
238
  }, Dt = (e) => {
@@ -240,13 +240,13 @@ const Ie = (T) => {
240
240
  }, Vt = () => {
241
241
  }, Lt = (e, t) => {
242
242
  wt(e), kt(t);
243
- }, he = (e, t = !1, s = !1) => {
244
- const o = d.find((b) => b.name === e)?.is_pinned, f = [
243
+ }, be = (e, t = !1, o = !1) => {
244
+ const s = d.find((h) => h.name === e)?.is_pinned, f = [
245
245
  {
246
246
  label: /* @__PURE__ */ n(
247
247
  y,
248
248
  {
249
- icon: /* @__PURE__ */ n(Kt, { size: 18, className: "text-inherit dark:text-inherit" }),
249
+ icon: /* @__PURE__ */ n(Kt, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
250
250
  text: u("Select Tab"),
251
251
  className: "text-black-900 dark:text-white"
252
252
  }
@@ -258,7 +258,7 @@ const Ie = (T) => {
258
258
  label: /* @__PURE__ */ n(
259
259
  y,
260
260
  {
261
- icon: /* @__PURE__ */ n(en, { size: 18, className: "text-inherit dark:text-inherit" }),
261
+ icon: /* @__PURE__ */ n(en, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
262
262
  text: u("Move Up"),
263
263
  isDisabled: R,
264
264
  className: "text-black-900 dark:text-white"
@@ -272,7 +272,7 @@ const Ie = (T) => {
272
272
  label: /* @__PURE__ */ n(
273
273
  y,
274
274
  {
275
- icon: /* @__PURE__ */ n(tn, { size: 18, className: "text-inherit dark:text-inherit" }),
275
+ icon: /* @__PURE__ */ n(tn, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
276
276
  text: u("Move Down"),
277
277
  isDisabled: R,
278
278
  className: "text-black-900 dark:text-white"
@@ -286,7 +286,7 @@ const Ie = (T) => {
286
286
  label: /* @__PURE__ */ n(
287
287
  y,
288
288
  {
289
- icon: /* @__PURE__ */ n(nn, { size: 18, className: "text-inherit dark:text-inherit" }),
289
+ icon: /* @__PURE__ */ n(nn, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
290
290
  text: u("Copy Link"),
291
291
  className: "text-black-900 dark:text-white"
292
292
  }
@@ -298,7 +298,7 @@ const Ie = (T) => {
298
298
  label: /* @__PURE__ */ n(
299
299
  y,
300
300
  {
301
- icon: /* @__PURE__ */ n(sn, { size: 18, className: "text-inherit dark:text-inherit" }),
301
+ icon: /* @__PURE__ */ n(on, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
302
302
  text: u("Hide"),
303
303
  className: "text-black-900 dark:text-white"
304
304
  }
@@ -310,7 +310,7 @@ const Ie = (T) => {
310
310
  label: /* @__PURE__ */ n(
311
311
  y,
312
312
  {
313
- icon: /* @__PURE__ */ n(on, { size: 18, className: "text-inherit dark:text-inherit" }),
313
+ icon: /* @__PURE__ */ n(sn, { className: "w-icon h-icon text-inherit dark:text-inherit" }),
314
314
  text: u("Unhide"),
315
315
  className: "text-black-900 dark:text-white"
316
316
  }
@@ -322,13 +322,13 @@ const Ie = (T) => {
322
322
  label: /* @__PURE__ */ n(
323
323
  y,
324
324
  {
325
- icon: o ? /* @__PURE__ */ n(an, { size: 20, className: "rotate-12 text-inherit dark:text-inherit" }) : /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }),
326
- text: u(o ? "Unpin" : "Pin"),
325
+ icon: s ? /* @__PURE__ */ n(an, { className: "w-icon h-icon rotate-12 text-inherit dark:text-inherit" }) : /* @__PURE__ */ n(oe, { className: "w-icon h-icon rotate-45 text-inherit dark:text-inherit" }),
326
+ text: u(s ? "Unpin" : "Pin"),
327
327
  className: "text-black-900 dark:text-white",
328
328
  notVisible: !C
329
329
  }
330
330
  ),
331
- key: o ? c.UNPIN : c.PIN,
331
+ key: s ? c.UNPIN : c.PIN,
332
332
  onClick: () => ee(e)
333
333
  },
334
334
  {
@@ -336,7 +336,7 @@ const Ie = (T) => {
336
336
  y,
337
337
  {
338
338
  className: "text-black-900 dark:text-white",
339
- icon: /* @__PURE__ */ n(Xt, {}),
339
+ icon: /* @__PURE__ */ n(Xt, { className: "w-icon h-icon" }),
340
340
  text: u("Edit"),
341
341
  notVisible: !_e
342
342
  }
@@ -349,7 +349,7 @@ const Ie = (T) => {
349
349
  y,
350
350
  {
351
351
  className: "text-error-600 dark:text-error-600",
352
- icon: /* @__PURE__ */ n(rn, { size: 18, className: "text-error-600 dark:text-error-600" }),
352
+ icon: /* @__PURE__ */ n(rn, { className: "w-icon h-icon text-error-600 dark:text-error-600" }),
353
353
  text: u("Delete"),
354
354
  notVisible: !Oe
355
355
  }
@@ -359,8 +359,8 @@ const Ie = (T) => {
359
359
  }
360
360
  ], te = [c.HIDE, c.UNHIDE], g = [c.SELECT, c.MOVE_LEFT, c.MOVE_RIGHT, c.UNHIDE];
361
361
  return f.filter(
362
- (b) => t ? b.key === c.UNHIDE : s ? !te.includes(b.key) : !g.includes(b.key)
363
- ).filter((b) => Nt ? !0 : b.key !== c.COPY_LINK).filter((b) => a.length === 1 ? b.key !== c.HIDE : !0);
362
+ (h) => t ? h.key === c.UNHIDE : o ? !te.includes(h.key) : !g.includes(h.key)
363
+ ).filter((h) => Nt ? !0 : h.key !== c.COPY_LINK).filter((h) => a.length === 1 ? h.key !== c.HIDE : !0);
364
364
  }, L = (e, t) => ({
365
365
  classValue: {
366
366
  default: l("relative inline-flex pt-2 pb-3 px-2 pl-3 sm:px-2 rounded-t-sm group"),
@@ -387,8 +387,8 @@ const Ie = (T) => {
387
387
  j(() => {
388
388
  if (!Z.current || T === "switch") return;
389
389
  const e = new ResizeObserver((t) => {
390
- const s = t[0].contentRect.width;
391
- pe(s);
390
+ const o = t[0].contentRect.width;
391
+ pe(o);
392
392
  });
393
393
  return e.observe(Z.current), pe(Z.current.clientWidth), () => e.disconnect();
394
394
  }, [pe, T]);
@@ -397,20 +397,20 @@ const Ie = (T) => {
397
397
  if (le?.length) {
398
398
  let e = [...le];
399
399
  _.forEach((t) => {
400
- e.find((s) => s.name === t) || e.push({ name: t, is_default: !1, is_hidden: !1, is_pinned: !1 });
400
+ e.find((o) => o.name === t) || e.push({ name: t, is_default: !1, is_hidden: !1, is_pinned: !1 });
401
401
  }), e = e.filter(
402
- (t, s, i) => _.includes(t.name) && s === i.findIndex((o) => o.name === t.name)
402
+ (t, o, r) => _.includes(t.name) && o === r.findIndex((s) => s.name === t.name)
403
403
  ), de(e);
404
404
  } else
405
405
  de(
406
- _.map((e) => ({ name: e, is_default: !1, is_hidden: !1, is_pinned: !1 })).filter((e, t, s) => t === s.findIndex((i) => i.name === e.name))
406
+ _.map((e) => ({ name: e, is_default: !1, is_hidden: !1, is_pinned: !1 })).filter((e, t, o) => t === o.findIndex((r) => r.name === e.name))
407
407
  );
408
408
  }, [Mt, Ht]), j(() => {
409
409
  Y && Ue(Y);
410
410
  }, [Y]), j(() => {
411
411
  if (!d.length) return;
412
412
  const e = [...d];
413
- me === "asc" ? e.sort((t, s) => t.name.localeCompare(s.name)) : me === "desc" && e.sort((t, s) => s.name.localeCompare(t.name)), ht(e);
413
+ me === "asc" ? e.sort((t, o) => t.name.localeCompare(o.name)) : me === "desc" && e.sort((t, o) => o.name.localeCompare(t.name)), bt(e);
414
414
  }, [d, me]), j(() => {
415
415
  Ie(I);
416
416
  }, [I]), T === "switch" ? /* @__PURE__ */ n("div", { className: l("inline", ve), children: /* @__PURE__ */ n(
@@ -421,11 +421,11 @@ const Ie = (T) => {
421
421
  className: l(
422
422
  "inline-flex grow-0 p-1 rounded-lg",
423
423
  ae === "dark" ? "border-[1.5px] border-neutral-800 bg-neutral-800 dark:border-black-800" : "bg-neutral-100 dark:bg-black-700",
424
- ie ? "w-full" : "w-auto"
424
+ re ? "w-full" : "w-auto"
425
425
  ),
426
426
  children: _.map((e) => {
427
- const t = r === e, s = re?.[e], i = d.find((f) => f.name === e), o = C && i?.is_pinned;
428
- return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex", ie ? "w-full" : "w-auto"), children: /* @__PURE__ */ n(
427
+ const t = i === e, o = ie?.[e], r = d.find((f) => f.name === e), s = C && r?.is_pinned;
428
+ return /* @__PURE__ */ n("li", { role: "presentation", className: l("inline-flex", re ? "w-full" : "w-auto"), children: /* @__PURE__ */ n(
429
429
  Se,
430
430
  {
431
431
  title: e,
@@ -433,12 +433,12 @@ const Ie = (T) => {
433
433
  role: "tab",
434
434
  ariaSelected: t,
435
435
  tabIndex: 0,
436
- icon: o ? /* @__PURE__ */ n(Ce, { title: "Unpin", children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(se, { className: "rotate-45 w-icon h-icon text-inherit dark:text-inherit" }) }) }) : s,
437
- iconsOnly: rt,
436
+ icon: s ? /* @__PURE__ */ n(Ce, { title: "Unpin", children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(oe, { className: "rotate-45 w-icon h-icon text-inherit dark:text-inherit" }) }) }) : o,
437
+ iconsOnly: it,
438
438
  classValue: l(
439
439
  "relative py-0.5 border-gray-200",
440
- it,
441
- ie ? "w-full flex items-center justify-center" : "px-2"
440
+ rt,
441
+ re ? "w-full flex items-center justify-center" : "px-2"
442
442
  ),
443
443
  selectedClassValue: l(
444
444
  "absolute inset-0 rounded-md z-0",
@@ -449,10 +449,10 @@ const Ie = (T) => {
449
449
  t ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-700 dark:text-neutral-100"
450
450
  ),
451
451
  isSelected: t,
452
- href: F(e),
452
+ href: z(e),
453
453
  onClick: at ? void 0 : () => B(e),
454
454
  suffixRecord: p,
455
- selectedId: W,
455
+ selectedId: P,
456
456
  color: ae,
457
457
  disableAnimation: ct
458
458
  }
@@ -467,13 +467,13 @@ const Ie = (T) => {
467
467
  onMouseEnter: () => Me(!0),
468
468
  onMouseLeave: () => Me(!1),
469
469
  children: /* @__PURE__ */ ke(
470
- Pt,
470
+ Ft,
471
471
  {
472
472
  sensors: Tt,
473
473
  onDragEnd: Ot,
474
474
  onDragStart: _t,
475
475
  onDragCancel: Et,
476
- collisionDetection: Ft,
476
+ collisionDetection: zt,
477
477
  onDragOver: Dt,
478
478
  children: [
479
479
  /* @__PURE__ */ ke(
@@ -488,7 +488,7 @@ const Ie = (T) => {
488
488
  ),
489
489
  ref: yt,
490
490
  children: [
491
- st ? /* @__PURE__ */ n("div", { className: "skeleton bg-neutral-300 dark:bg-black-700 animate-pulse h-10 min-w-[100px] w-full rounded" }) : /* @__PURE__ */ ke(
491
+ ot ? /* @__PURE__ */ n("div", { className: "skeleton bg-neutral-300 dark:bg-black-700 animate-pulse h-10 min-w-[100px] w-full rounded" }) : /* @__PURE__ */ ke(
492
492
  Bt,
493
493
  {
494
494
  items: a.map(({ name: e }) => e),
@@ -497,7 +497,7 @@ const Ie = (T) => {
497
497
  disabled: !E || R,
498
498
  children: [
499
499
  a.slice(0, K).map(({ name: e, is_pinned: t }) => {
500
- const s = r === e && !I, i = C && t;
500
+ const o = i === e && !I, r = C && t;
501
501
  return /* @__PURE__ */ n(
502
502
  tt,
503
503
  {
@@ -510,21 +510,21 @@ const Ie = (T) => {
510
510
  showCounts: k,
511
511
  title: e,
512
512
  role: "tab",
513
- ariaSelected: s,
513
+ ariaSelected: o,
514
514
  tabIndex: 0,
515
515
  classValue: l(
516
- L("classValue", s),
516
+ L("classValue", o),
517
517
  G ? "w-full justify-center" : ""
518
518
  ),
519
- selectedClassValue: L("selectedClassValue", s),
520
- textClassValue: L("textClassValue", s),
521
- isSelected: s,
522
- tabOptions: s && E ? /* @__PURE__ */ n(
519
+ selectedClassValue: L("selectedClassValue", o),
520
+ textClassValue: L("textClassValue", o),
521
+ isSelected: o,
522
+ tabOptions: o && E ? /* @__PURE__ */ n(
523
523
  ye,
524
524
  {
525
525
  menu: {
526
- items: he(e),
527
- className: oe
526
+ items: be(e),
527
+ className: se
528
528
  },
529
529
  trigger: ["click"],
530
530
  onOpenChange: Ie,
@@ -544,22 +544,22 @@ const Ie = (T) => {
544
544
  }
545
545
  ) : null,
546
546
  draggingTab: D === e,
547
- href: F(e),
547
+ href: z(e),
548
548
  onClick: () => B(e),
549
549
  suffixRecord: p,
550
- selectedId: W,
551
- icon: i ? /* @__PURE__ */ n(Ce, { title: u("Unpin"), children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : re?.[e] ?? null
550
+ selectedId: P,
551
+ icon: r ? /* @__PURE__ */ n(Ce, { title: u("Unpin"), children: /* @__PURE__ */ n("span", { onClick: () => ee(e), children: /* @__PURE__ */ n(oe, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : ie?.[e] ?? null
552
552
  }
553
553
  ) }, e)
554
554
  },
555
555
  e
556
556
  );
557
557
  }),
558
- r && Fe ? /* @__PURE__ */ n(tt, { title: r, isDragging: D === r, children: /* @__PURE__ */ n("li", { role: "presentation", className: l("sm:mr-2"), children: /* @__PURE__ */ n(
558
+ i && ze ? /* @__PURE__ */ n(tt, { title: i, isDragging: D === i, children: /* @__PURE__ */ n("li", { role: "presentation", className: l("sm:mr-2"), children: /* @__PURE__ */ n(
559
559
  Se,
560
560
  {
561
561
  showCounts: k,
562
- title: r,
562
+ title: i,
563
563
  role: "tab",
564
564
  ariaSelected: !0,
565
565
  tabIndex: 0,
@@ -571,8 +571,8 @@ const Ie = (T) => {
571
571
  ye,
572
572
  {
573
573
  menu: {
574
- items: he(r),
575
- className: oe
574
+ items: be(i),
575
+ className: se
576
576
  },
577
577
  trigger: ["click"],
578
578
  onOpenChange: Ie,
@@ -583,13 +583,13 @@ const Ie = (T) => {
583
583
  children: /* @__PURE__ */ n(et, { sx: { fontSize: 20 }, className: "text-primary-600" })
584
584
  }
585
585
  ) : null,
586
- draggingTab: D === r,
587
- href: F(r),
586
+ draggingTab: D === i,
587
+ href: z(i),
588
588
  suffixRecord: p,
589
- selectedId: W,
590
- icon: C && d.find((e) => e.name === r)?.is_pinned ? /* @__PURE__ */ n(Ce, { title: u("Pinned"), children: /* @__PURE__ */ n("span", { onClick: () => ee(r), children: /* @__PURE__ */ n(se, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : re?.[r] ?? null
589
+ selectedId: P,
590
+ icon: C && d.find((e) => e.name === i)?.is_pinned ? /* @__PURE__ */ n(Ce, { title: u("Pinned"), children: /* @__PURE__ */ n("span", { onClick: () => ee(i), children: /* @__PURE__ */ n(oe, { size: 20, className: "rotate-45 text-inherit dark:text-inherit" }) }) }) : ie?.[i] ?? null
591
591
  }
592
- ) }, r) }, r) : null,
592
+ ) }, i) }, i) : null,
593
593
  (U < a.length && !A || V.length > 0) && Be > 0 ? /* @__PURE__ */ n(ln, { id: "more-tabs", children: /* @__PURE__ */ n(
594
594
  ye,
595
595
  {
@@ -619,7 +619,7 @@ const Ie = (T) => {
619
619
  }
620
620
  ) })
621
621
  },
622
- ...a.slice(K).filter((e) => e.name !== r).concat(V).filter(
622
+ ...a.slice(K).filter((e) => e.name !== i).concat(V).filter(
623
623
  ({ name: e }) => typeof e == "string" && (e ?? "").toLowerCase().includes(ce.toLowerCase())
624
624
  ).map(({ name: e, is_hidden: t }) => ({
625
625
  key: e,
@@ -640,11 +640,11 @@ const Ie = (T) => {
640
640
  }
641
641
  }
642
642
  ),
643
- popupClassName: oe,
644
- children: I ? he(e, t, !0) : null
643
+ popupClassName: se,
644
+ children: I ? be(e, t, !0) : null
645
645
  }))
646
646
  ],
647
- className: oe
647
+ className: se
648
648
  },
649
649
  openClassName: "max-h-[350px] overflow-y-auto",
650
650
  trigger: ["click"],
@@ -660,7 +660,7 @@ const Ie = (T) => {
660
660
  draggingOver: xt,
661
661
  suffixRecord: p,
662
662
  handleShowMoreDropdown: Ge,
663
- selectedId: W,
663
+ selectedId: P,
664
664
  showMoreDropdown: I
665
665
  }
666
666
  )
@@ -701,7 +701,7 @@ const Ie = (T) => {
701
701
  suffixRecord: p,
702
702
  size: O,
703
703
  variant: T,
704
- selectedId: W,
704
+ selectedId: P,
705
705
  parentContainer: mt
706
706
  }
707
707
  ) : null
@@ -712,6 +712,6 @@ const Ie = (T) => {
712
712
  );
713
713
  };
714
714
  export {
715
- Pn as Tabs
715
+ Fn as Tabs
716
716
  };
717
717
  //# sourceMappingURL=Tabs.es.js.map