@purpurds/tabs 5.11.0 → 5.11.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/LICENSE.txt +1 -1
- package/dist/tab-content.d.ts +1 -1
- package/dist/tab-content.d.ts.map +1 -1
- package/dist/tabs.cjs.js +1 -1
- package/dist/tabs.cjs.js.map +1 -1
- package/dist/tabs.es.js +10 -19
- package/dist/tabs.es.js.map +1 -1
- package/package.json +13 -13
- package/src/tab-content.test.tsx +2 -2
- package/src/tabs.stories.tsx +30 -5
- package/readme.mdx +0 -56
- package/src/tab-content.stories.tsx +0 -43
package/dist/tabs.es.js
CHANGED
|
@@ -72,7 +72,7 @@ const Ve = /* @__PURE__ */ Ue(Be), Ge = {
|
|
|
72
72
|
["data-testid"]: e,
|
|
73
73
|
svg: t,
|
|
74
74
|
allyTitle: n,
|
|
75
|
-
className: o
|
|
75
|
+
className: o,
|
|
76
76
|
size: s = ze,
|
|
77
77
|
...r
|
|
78
78
|
}) => {
|
|
@@ -103,8 +103,7 @@ function C() {
|
|
|
103
103
|
}
|
|
104
104
|
function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
|
|
105
105
|
return function(s) {
|
|
106
|
-
if (e == null || e(s), n === !1 || !s.defaultPrevented)
|
|
107
|
-
return t == null ? void 0 : t(s);
|
|
106
|
+
if (e == null || e(s), n === !1 || !s.defaultPrevented) return t == null ? void 0 : t(s);
|
|
108
107
|
};
|
|
109
108
|
}
|
|
110
109
|
function ae(e, t = []) {
|
|
@@ -126,10 +125,8 @@ function ae(e, t = []) {
|
|
|
126
125
|
}
|
|
127
126
|
function p(l, $) {
|
|
128
127
|
const v = ($ == null ? void 0 : $[e][u]) || a, d = me(v);
|
|
129
|
-
if (d)
|
|
130
|
-
|
|
131
|
-
if (c !== void 0)
|
|
132
|
-
return c;
|
|
128
|
+
if (d) return d;
|
|
129
|
+
if (c !== void 0) return c;
|
|
133
130
|
throw new Error(`\`${l}\` must be used within \`${r}\``);
|
|
134
131
|
}
|
|
135
132
|
return i.displayName = r + "Provider", [
|
|
@@ -162,8 +159,7 @@ function ae(e, t = []) {
|
|
|
162
159
|
}
|
|
163
160
|
function Xe(...e) {
|
|
164
161
|
const t = e[0];
|
|
165
|
-
if (e.length === 1)
|
|
166
|
-
return t;
|
|
162
|
+
if (e.length === 1) return t;
|
|
167
163
|
const n = () => {
|
|
168
164
|
const o = e.map(
|
|
169
165
|
(s) => ({
|
|
@@ -280,8 +276,7 @@ function nt(e) {
|
|
|
280
276
|
const d = r(e + "CollectionConsumer", v);
|
|
281
277
|
return A.useCallback(() => {
|
|
282
278
|
const m = d.collectionRef.current;
|
|
283
|
-
if (!m)
|
|
284
|
-
return [];
|
|
279
|
+
if (!m) return [];
|
|
285
280
|
const _ = Array.from(m.querySelectorAll(`[${p}]`));
|
|
286
281
|
return Array.from(d.itemMap.values()).sort(
|
|
287
282
|
(w, q) => _.indexOf(w.ref.current) - _.indexOf(q.ref.current)
|
|
@@ -367,8 +362,7 @@ function xe({ prop: e, defaultProp: t, onChange: n = () => {
|
|
|
367
362
|
if (r) {
|
|
368
363
|
const l = typeof i == "function" ? i(e) : i;
|
|
369
364
|
l !== e && a(l);
|
|
370
|
-
} else
|
|
371
|
-
s(i);
|
|
365
|
+
} else s(i);
|
|
372
366
|
}, [
|
|
373
367
|
r,
|
|
374
368
|
e,
|
|
@@ -517,8 +511,7 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
|
|
|
517
511
|
i.onItemShiftTab();
|
|
518
512
|
return;
|
|
519
513
|
}
|
|
520
|
-
if (d.target !== d.currentTarget)
|
|
521
|
-
return;
|
|
514
|
+
if (d.target !== d.currentTarget) return;
|
|
522
515
|
const b = gt(d, i.orientation, i.dir);
|
|
523
516
|
if (b !== void 0) {
|
|
524
517
|
d.preventDefault();
|
|
@@ -527,8 +520,7 @@ const te = "rovingFocusGroup.onEntryFocus", it = {
|
|
|
527
520
|
).map(
|
|
528
521
|
(h) => h.ref.current
|
|
529
522
|
);
|
|
530
|
-
if (b === "last")
|
|
531
|
-
_.reverse();
|
|
523
|
+
if (b === "last") _.reverse();
|
|
532
524
|
else if (b === "prev" || b === "next") {
|
|
533
525
|
b === "prev" && _.reverse();
|
|
534
526
|
const h = _.indexOf(d.currentTarget);
|
|
@@ -567,8 +559,7 @@ function gt(e, t, n) {
|
|
|
567
559
|
function Se(e) {
|
|
568
560
|
const t = document.activeElement;
|
|
569
561
|
for (const n of e)
|
|
570
|
-
if (n === t || (n.focus(), document.activeElement !== t))
|
|
571
|
-
return;
|
|
562
|
+
if (n === t || (n.focus(), document.activeElement !== t)) return;
|
|
572
563
|
}
|
|
573
564
|
function ht(e, t) {
|
|
574
565
|
return e.map(
|