@televet/kibble-ui 5.0.25-beta.8 → 5.0.25
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/chunks/tab.types-DSPWRVCF.js +2 -0
- package/dist/chunks/{tab.types-BUnGzQEp.js.map → tab.types-DSPWRVCF.js.map} +1 -1
- package/dist/chunks/{tab.types-CinNGFsi.js → tab.types-JAJ5Xxff.js} +171 -185
- package/dist/chunks/{tab.types-CinNGFsi.js.map → tab.types-JAJ5Xxff.js.map} +1 -1
- package/dist/cjs/components/Tabs/index.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/Tabs/index.js +1 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/tab.types-BUnGzQEp.js +0 -2
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as c } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import { I as L } from "./icon.component-PV_nHBId.js";
|
|
3
3
|
import { N as Y } from "./notificationCounter.component-6Q3q8jWj.js";
|
|
4
4
|
import { W as G } from "./heading.component-CpSAN3cv.js";
|
|
5
5
|
import { c as J } from "./create-slot-recipe-context-D_FXDJGp.js";
|
|
6
|
-
import { useState as Q, useEffect as Z, forwardRef as
|
|
7
|
-
import { a as te, b as x, d as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { useState as Q, useEffect as Z, forwardRef as y, useId as ee } from "react";
|
|
7
|
+
import { a as te, b as x, d as h, e as ae, c as N, u as se, f as oe, g as re, n as ne } from "./use-locale-context-DmcfCmf9.js";
|
|
8
|
+
import { a6 as R, s as ie, aa as ce, E as le, b2 as ue, r as m, aR as de, aS as ge, a1 as fe, f as pe, c as v, a3 as be, z as ve, O as Te, j as me, l as ye, b5 as he, q as Re, aD as Ce, _ as Pe, $ as Ve } from "./index-BcafYtXX.js";
|
|
9
|
+
import { u as Ee, s as j, R as $ } from "./render-strategy-DLvzMQD1.js";
|
|
10
10
|
import { c as Ae, d as Ie } from "./index-DcmJgLUo.js";
|
|
11
|
-
|
|
11
|
+
import { B as xe } from "./index-9BerxEcw.js";
|
|
12
|
+
function Fe(e, t) {
|
|
12
13
|
const [s, a] = Q(e);
|
|
13
14
|
return Z(() => {
|
|
14
15
|
const r = setTimeout(() => {
|
|
@@ -19,44 +20,44 @@ function xe(e, t) {
|
|
|
19
20
|
};
|
|
20
21
|
}, [e, t]), s;
|
|
21
22
|
}
|
|
22
|
-
const [B,
|
|
23
|
+
const [B, F] = te({
|
|
23
24
|
name: "TabsContext",
|
|
24
25
|
hookName: "useTabsContext",
|
|
25
26
|
providerName: "<TabsProvider />"
|
|
26
|
-
}), k =
|
|
27
|
-
const [s, a] = x()(e, ["value"]), r =
|
|
27
|
+
}), k = y((e, t) => {
|
|
28
|
+
const [s, a] = x()(e, ["value"]), r = F(), o = Ee(), n = Ae({
|
|
28
29
|
...o,
|
|
29
|
-
present:
|
|
30
|
+
present: Fe(r.value === e.value, 0),
|
|
30
31
|
immediate: !0
|
|
31
|
-
}), u =
|
|
32
|
-
return /* @__PURE__ */
|
|
32
|
+
}), u = R(r.getContentProps(s), n.getPresenceProps(), a);
|
|
33
|
+
return /* @__PURE__ */ c.jsx(Ie, { value: n, children: n.unmounted ? null : /* @__PURE__ */ c.jsx(h.div, { ...u, ref: ae(n.ref, t) }) });
|
|
33
34
|
});
|
|
34
35
|
k.displayName = "TabContent";
|
|
35
|
-
const
|
|
36
|
-
const s =
|
|
37
|
-
return /* @__PURE__ */
|
|
36
|
+
const D = y((e, t) => {
|
|
37
|
+
const s = F(), a = R(s.getIndicatorProps(), e);
|
|
38
|
+
return /* @__PURE__ */ c.jsx(h.div, { ...a, ref: t });
|
|
38
39
|
});
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
const s =
|
|
42
|
-
return /* @__PURE__ */
|
|
40
|
+
D.displayName = "TabIndicator";
|
|
41
|
+
const U = y((e, t) => {
|
|
42
|
+
const s = F(), a = R(s.getListProps(), e);
|
|
43
|
+
return /* @__PURE__ */ c.jsx(h.div, { ...a, ref: t });
|
|
43
44
|
});
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const [s, a] = x()(e, ["disabled", "value"]), r =
|
|
47
|
-
return /* @__PURE__ */
|
|
45
|
+
U.displayName = "TabList";
|
|
46
|
+
const W = y((e, t) => {
|
|
47
|
+
const [s, a] = x()(e, ["disabled", "value"]), r = F(), o = R(r.getTriggerProps(s), a);
|
|
48
|
+
return /* @__PURE__ */ c.jsx(h.button, { ...o, ref: t });
|
|
48
49
|
});
|
|
49
|
-
|
|
50
|
-
var
|
|
51
|
-
const s = `[role=tab][data-ownedby='${CSS.escape(
|
|
52
|
-
return
|
|
53
|
-
},
|
|
50
|
+
W.displayName = "TabTrigger";
|
|
51
|
+
var _e = pe("tabs").parts("root", "list", "trigger", "content", "indicator"), P = _e.build(), Ne = (e) => e.ids?.root ?? `tabs:${e.id}`, V = (e) => e.ids?.list ?? `tabs:${e.id}:list`, _ = (e, t) => e.ids?.content ?? `tabs:${e.id}:content-${t}`, T = (e, t) => e.ids?.trigger ?? `tabs:${e.id}:trigger-${t}`, M = (e) => e.ids?.indicator ?? `tabs:${e.id}:indicator`, we = (e) => e.getById(V(e)), Se = (e, t) => e.getById(_(e, t)), I = (e, t) => e.getById(T(e, t)), O = (e) => e.getById(M(e)), E = (e) => {
|
|
52
|
+
const s = `[role=tab][data-ownedby='${CSS.escape(V(e))}']:not([disabled])`;
|
|
53
|
+
return Re(we(e), s);
|
|
54
|
+
}, Le = (e) => Ve(E(e)), Oe = (e) => Pe(E(e)), je = (e, t) => ge(E(e), T(e, t.value), t.loopFocus), $e = (e, t) => de(E(e), T(e, t.value), t.loopFocus), X = (e) => ({
|
|
54
55
|
left: e?.offsetLeft ?? 0,
|
|
55
56
|
top: e?.offsetTop ?? 0,
|
|
56
57
|
width: e?.offsetWidth ?? 0,
|
|
57
58
|
height: e?.offsetHeight ?? 0
|
|
58
|
-
}),
|
|
59
|
-
const s =
|
|
59
|
+
}), Be = (e, t) => {
|
|
60
|
+
const s = he(E(e), T(e, t));
|
|
60
61
|
return H(X(s));
|
|
61
62
|
}, H = (e) => ({
|
|
62
63
|
width: `${e.width}px`,
|
|
@@ -64,8 +65,8 @@ var we = ve("tabs").parts("root", "list", "trigger", "content", "indicator"), C
|
|
|
64
65
|
left: `${e.left}px`,
|
|
65
66
|
top: `${e.top}px`
|
|
66
67
|
});
|
|
67
|
-
function
|
|
68
|
-
const { state: s, send: a, context: r, prop: o, scope: n } = e, u = o("translations"),
|
|
68
|
+
function ke(e, t) {
|
|
69
|
+
const { state: s, send: a, context: r, prop: o, scope: n } = e, u = o("translations"), g = s.matches("focused"), d = o("orientation") === "vertical", f = o("orientation") === "horizontal", w = o("composite");
|
|
69
70
|
function S(i) {
|
|
70
71
|
return {
|
|
71
72
|
selected: r.get("value") === i.value,
|
|
@@ -83,8 +84,8 @@ function Be(e, t) {
|
|
|
83
84
|
a({ type: "CLEAR_VALUE" });
|
|
84
85
|
},
|
|
85
86
|
setIndicatorRect(i) {
|
|
86
|
-
const
|
|
87
|
-
a({ type: "SET_INDICATOR_RECT", id:
|
|
87
|
+
const l = T(n, i);
|
|
88
|
+
a({ type: "SET_INDICATOR_RECT", id: l });
|
|
88
89
|
},
|
|
89
90
|
syncTabIndex() {
|
|
90
91
|
a({ type: "SYNC_TAB_INDEX" });
|
|
@@ -101,37 +102,37 @@ function Be(e, t) {
|
|
|
101
102
|
},
|
|
102
103
|
getRootProps() {
|
|
103
104
|
return t.element({
|
|
104
|
-
...
|
|
105
|
-
id:
|
|
105
|
+
...P.root.attrs,
|
|
106
|
+
id: Ne(n),
|
|
106
107
|
"data-orientation": o("orientation"),
|
|
107
|
-
"data-focus": v(
|
|
108
|
+
"data-focus": v(g),
|
|
108
109
|
dir: o("dir")
|
|
109
110
|
});
|
|
110
111
|
},
|
|
111
112
|
getListProps() {
|
|
112
113
|
return t.element({
|
|
113
|
-
...
|
|
114
|
-
id:
|
|
114
|
+
...P.list.attrs,
|
|
115
|
+
id: V(n),
|
|
115
116
|
role: "tablist",
|
|
116
117
|
dir: o("dir"),
|
|
117
|
-
"data-focus": v(
|
|
118
|
+
"data-focus": v(g),
|
|
118
119
|
"aria-orientation": o("orientation"),
|
|
119
120
|
"data-orientation": o("orientation"),
|
|
120
121
|
"aria-label": u?.listLabel,
|
|
121
122
|
onKeyDown(i) {
|
|
122
|
-
if (i.defaultPrevented || !
|
|
123
|
-
const
|
|
123
|
+
if (i.defaultPrevented || !Te(i) || me(i)) return;
|
|
124
|
+
const l = {
|
|
124
125
|
ArrowDown() {
|
|
125
|
-
|
|
126
|
+
f || a({ type: "ARROW_NEXT", key: "ArrowDown" });
|
|
126
127
|
},
|
|
127
128
|
ArrowUp() {
|
|
128
|
-
|
|
129
|
+
f || a({ type: "ARROW_PREV", key: "ArrowUp" });
|
|
129
130
|
},
|
|
130
131
|
ArrowLeft() {
|
|
131
|
-
|
|
132
|
+
d || a({ type: "ARROW_PREV", key: "ArrowLeft" });
|
|
132
133
|
},
|
|
133
134
|
ArrowRight() {
|
|
134
|
-
|
|
135
|
+
d || a({ type: "ARROW_NEXT", key: "ArrowRight" });
|
|
135
136
|
},
|
|
136
137
|
Home() {
|
|
137
138
|
a({ type: "HOME" });
|
|
@@ -140,13 +141,13 @@ function Be(e, t) {
|
|
|
140
141
|
a({ type: "END" });
|
|
141
142
|
}
|
|
142
143
|
};
|
|
143
|
-
let
|
|
144
|
+
let p = ye(i, {
|
|
144
145
|
dir: o("dir"),
|
|
145
146
|
orientation: o("orientation")
|
|
146
147
|
});
|
|
147
|
-
const
|
|
148
|
-
if (
|
|
149
|
-
i.preventDefault(),
|
|
148
|
+
const b = l[p];
|
|
149
|
+
if (b) {
|
|
150
|
+
i.preventDefault(), b(i);
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
153
|
}
|
|
@@ -154,56 +155,56 @@ function Be(e, t) {
|
|
|
154
155
|
},
|
|
155
156
|
getTriggerState: S,
|
|
156
157
|
getTriggerProps(i) {
|
|
157
|
-
const { value:
|
|
158
|
+
const { value: l, disabled: p } = i, b = S(i);
|
|
158
159
|
return t.button({
|
|
159
|
-
...
|
|
160
|
+
...P.trigger.attrs,
|
|
160
161
|
role: "tab",
|
|
161
162
|
type: "button",
|
|
162
|
-
disabled:
|
|
163
|
+
disabled: p,
|
|
163
164
|
dir: o("dir"),
|
|
164
165
|
"data-orientation": o("orientation"),
|
|
165
|
-
"data-disabled": v(
|
|
166
|
-
"aria-disabled":
|
|
167
|
-
"data-value":
|
|
168
|
-
"aria-selected":
|
|
169
|
-
"data-selected": v(
|
|
170
|
-
"data-focus": v(
|
|
171
|
-
"aria-controls":
|
|
172
|
-
"data-ownedby":
|
|
166
|
+
"data-disabled": v(p),
|
|
167
|
+
"aria-disabled": p,
|
|
168
|
+
"data-value": l,
|
|
169
|
+
"aria-selected": b.selected,
|
|
170
|
+
"data-selected": v(b.selected),
|
|
171
|
+
"data-focus": v(b.focused),
|
|
172
|
+
"aria-controls": b.selected ? _(n, l) : void 0,
|
|
173
|
+
"data-ownedby": V(n),
|
|
173
174
|
"data-ssr": v(r.get("ssr")),
|
|
174
|
-
id:
|
|
175
|
-
tabIndex:
|
|
175
|
+
id: T(n, l),
|
|
176
|
+
tabIndex: b.selected && w ? 0 : -1,
|
|
176
177
|
onFocus() {
|
|
177
|
-
a({ type: "TAB_FOCUS", value:
|
|
178
|
+
a({ type: "TAB_FOCUS", value: l });
|
|
178
179
|
},
|
|
179
|
-
onBlur(
|
|
180
|
-
|
|
180
|
+
onBlur(C) {
|
|
181
|
+
C.relatedTarget?.getAttribute("role") !== "tab" && a({ type: "TAB_BLUR" });
|
|
181
182
|
},
|
|
182
|
-
onClick(
|
|
183
|
-
|
|
183
|
+
onClick(C) {
|
|
184
|
+
C.defaultPrevented || be(C) || p || (ve() && C.currentTarget.focus(), a({ type: "TAB_CLICK", value: l }));
|
|
184
185
|
}
|
|
185
186
|
});
|
|
186
187
|
},
|
|
187
188
|
getContentProps(i) {
|
|
188
|
-
const { value:
|
|
189
|
+
const { value: l } = i, p = r.get("value") === l;
|
|
189
190
|
return t.element({
|
|
190
|
-
...
|
|
191
|
+
...P.content.attrs,
|
|
191
192
|
dir: o("dir"),
|
|
192
|
-
id:
|
|
193
|
-
tabIndex:
|
|
194
|
-
"aria-labelledby":
|
|
193
|
+
id: _(n, l),
|
|
194
|
+
tabIndex: w ? 0 : -1,
|
|
195
|
+
"aria-labelledby": T(n, l),
|
|
195
196
|
role: "tabpanel",
|
|
196
|
-
"data-ownedby":
|
|
197
|
-
"data-selected": v(
|
|
197
|
+
"data-ownedby": V(n),
|
|
198
|
+
"data-selected": v(p),
|
|
198
199
|
"data-orientation": o("orientation"),
|
|
199
|
-
hidden: !
|
|
200
|
+
hidden: !p
|
|
200
201
|
});
|
|
201
202
|
},
|
|
202
203
|
getIndicatorProps() {
|
|
203
|
-
const i = r.get("indicatorRect"),
|
|
204
|
+
const i = r.get("indicatorRect"), l = r.get("indicatorTransition");
|
|
204
205
|
return t.element({
|
|
205
206
|
id: M(n),
|
|
206
|
-
...
|
|
207
|
+
...P.indicator.attrs,
|
|
207
208
|
dir: o("dir"),
|
|
208
209
|
"data-orientation": o("orientation"),
|
|
209
210
|
style: {
|
|
@@ -215,15 +216,15 @@ function Be(e, t) {
|
|
|
215
216
|
position: "absolute",
|
|
216
217
|
willChange: "var(--transition-property)",
|
|
217
218
|
transitionProperty: "var(--transition-property)",
|
|
218
|
-
transitionDuration:
|
|
219
|
+
transitionDuration: l ? "var(--transition-duration, 150ms)" : "0ms",
|
|
219
220
|
transitionTimingFunction: "var(--transition-timing-function)",
|
|
220
|
-
[
|
|
221
|
+
[f ? "left" : "top"]: f ? "var(--left)" : "var(--top)"
|
|
221
222
|
}
|
|
222
223
|
});
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
226
|
}
|
|
226
|
-
var { createMachine:
|
|
227
|
+
var { createMachine: De } = ie(), Ue = De({
|
|
227
228
|
props({ props: e }) {
|
|
228
229
|
return {
|
|
229
230
|
dir: "ltr",
|
|
@@ -232,7 +233,7 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
232
233
|
loopFocus: !0,
|
|
233
234
|
composite: !0,
|
|
234
235
|
navigate(t) {
|
|
235
|
-
|
|
236
|
+
fe(t.node);
|
|
236
237
|
},
|
|
237
238
|
defaultValue: null,
|
|
238
239
|
...e
|
|
@@ -357,7 +358,7 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
357
358
|
},
|
|
358
359
|
actions: {
|
|
359
360
|
selectFocusedTab({ context: e, prop: t }) {
|
|
360
|
-
|
|
361
|
+
m(() => {
|
|
361
362
|
const s = e.get("focusedValue");
|
|
362
363
|
if (!s) return;
|
|
363
364
|
const r = t("deselectable") && e.get("value") === s ? null : s;
|
|
@@ -380,23 +381,23 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
380
381
|
e.set("value", null);
|
|
381
382
|
},
|
|
382
383
|
focusFirstTab({ scope: e }) {
|
|
383
|
-
|
|
384
|
-
|
|
384
|
+
m(() => {
|
|
385
|
+
Le(e)?.focus();
|
|
385
386
|
});
|
|
386
387
|
},
|
|
387
388
|
focusLastTab({ scope: e }) {
|
|
388
|
-
|
|
389
|
-
|
|
389
|
+
m(() => {
|
|
390
|
+
Oe(e)?.focus();
|
|
390
391
|
});
|
|
391
392
|
},
|
|
392
393
|
focusNextTab({ context: e, prop: t, scope: s, event: a }) {
|
|
393
394
|
const r = a.value ?? e.get("focusedValue");
|
|
394
395
|
if (!r) return;
|
|
395
|
-
const o =
|
|
396
|
+
const o = je(s, {
|
|
396
397
|
value: r,
|
|
397
398
|
loopFocus: t("loopFocus")
|
|
398
399
|
});
|
|
399
|
-
|
|
400
|
+
m(() => {
|
|
400
401
|
t("composite") ? o?.focus() : o?.dataset.value != null && e.set("focusedValue", o.dataset.value);
|
|
401
402
|
});
|
|
402
403
|
},
|
|
@@ -407,17 +408,17 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
407
408
|
value: r,
|
|
408
409
|
loopFocus: t("loopFocus")
|
|
409
410
|
});
|
|
410
|
-
|
|
411
|
+
m(() => {
|
|
411
412
|
t("composite") ? o?.focus() : o?.dataset.value != null && e.set("focusedValue", o.dataset.value);
|
|
412
413
|
});
|
|
413
414
|
},
|
|
414
415
|
syncTabIndex({ context: e, scope: t }) {
|
|
415
|
-
|
|
416
|
+
m(() => {
|
|
416
417
|
const s = e.get("value");
|
|
417
418
|
if (!s) return;
|
|
418
|
-
const a =
|
|
419
|
+
const a = Se(t, s);
|
|
419
420
|
if (!a) return;
|
|
420
|
-
|
|
421
|
+
Ce(a).length > 0 ? a.removeAttribute("tabindex") : a.setAttribute("tabindex", "0");
|
|
421
422
|
});
|
|
422
423
|
},
|
|
423
424
|
cleanupObserver({ refs: e }) {
|
|
@@ -434,7 +435,7 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
434
435
|
e.set("indicatorTransition", !1);
|
|
435
436
|
return;
|
|
436
437
|
}
|
|
437
|
-
I(s, a) && (e.set("indicatorRect",
|
|
438
|
+
I(s, a) && (e.set("indicatorRect", Be(s, a)), ue(() => {
|
|
438
439
|
e.set("indicatorTransition", !1);
|
|
439
440
|
}));
|
|
440
441
|
},
|
|
@@ -451,13 +452,13 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
451
452
|
}
|
|
452
453
|
const o = I(s, r), n = O(s);
|
|
453
454
|
if (!o || !n) return;
|
|
454
|
-
const u =
|
|
455
|
-
measure(
|
|
456
|
-
return X(
|
|
455
|
+
const u = le([o], {
|
|
456
|
+
measure(g) {
|
|
457
|
+
return X(g);
|
|
457
458
|
},
|
|
458
|
-
onEntry({ rects:
|
|
459
|
-
const [
|
|
460
|
-
e.set("indicatorRect", H(
|
|
459
|
+
onEntry({ rects: g }) {
|
|
460
|
+
const [d] = g;
|
|
461
|
+
e.set("indicatorRect", H(d));
|
|
461
462
|
}
|
|
462
463
|
});
|
|
463
464
|
t.set("indicatorCleanup", u);
|
|
@@ -471,7 +472,7 @@ var { createMachine: ke } = le(), We = ke({
|
|
|
471
472
|
}
|
|
472
473
|
}
|
|
473
474
|
});
|
|
474
|
-
|
|
475
|
+
N()([
|
|
475
476
|
"activationMode",
|
|
476
477
|
"composite",
|
|
477
478
|
"deselectable",
|
|
@@ -488,18 +489,18 @@ _()([
|
|
|
488
489
|
"value",
|
|
489
490
|
"defaultValue"
|
|
490
491
|
]);
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
const
|
|
492
|
+
N()(["disabled", "value"]);
|
|
493
|
+
N()(["value"]);
|
|
494
|
+
const We = (e) => {
|
|
494
495
|
const t = ee(), { getRootNode: s } = se(), { dir: a } = oe(), r = {
|
|
495
496
|
id: t,
|
|
496
497
|
dir: a,
|
|
497
498
|
getRootNode: s,
|
|
498
499
|
...e
|
|
499
|
-
}, o = re(
|
|
500
|
-
return
|
|
501
|
-
}, K =
|
|
502
|
-
const [s, a] =
|
|
500
|
+
}, o = re(Ue, r);
|
|
501
|
+
return ke(o, ne);
|
|
502
|
+
}, K = y((e, t) => {
|
|
503
|
+
const [s, a] = j(e), [r, o] = x()(a, [
|
|
503
504
|
"activationMode",
|
|
504
505
|
"composite",
|
|
505
506
|
"defaultValue",
|
|
@@ -513,55 +514,55 @@ const De = (e) => {
|
|
|
513
514
|
"orientation",
|
|
514
515
|
"translations",
|
|
515
516
|
"value"
|
|
516
|
-
]), n =
|
|
517
|
-
return /* @__PURE__ */
|
|
517
|
+
]), n = We(r), u = R(n.getRootProps(), o);
|
|
518
|
+
return /* @__PURE__ */ c.jsx(B, { value: n, children: /* @__PURE__ */ c.jsx($, { value: s, children: /* @__PURE__ */ c.jsx(h.div, { ...u, ref: t }) }) });
|
|
518
519
|
});
|
|
519
520
|
K.displayName = "TabsRoot";
|
|
520
|
-
const q =
|
|
521
|
-
const [s, a] =
|
|
522
|
-
return /* @__PURE__ */
|
|
521
|
+
const q = y((e, t) => {
|
|
522
|
+
const [s, a] = j(e), [{ value: r }, o] = x()(a, ["value"]), n = R(r.getRootProps(), o);
|
|
523
|
+
return /* @__PURE__ */ c.jsx(B, { value: r, children: /* @__PURE__ */ c.jsx($, { value: s, children: /* @__PURE__ */ c.jsx(h.div, { ...n, ref: t }) }) });
|
|
523
524
|
});
|
|
524
525
|
q.displayName = "TabsRootProvider";
|
|
525
526
|
const {
|
|
526
527
|
withProvider: z,
|
|
527
|
-
withContext:
|
|
528
|
+
withContext: A
|
|
528
529
|
} = J({ key: "tabs" });
|
|
529
530
|
z(q, "root", { forwardAsChild: !0 });
|
|
530
|
-
const
|
|
531
|
+
const Me = z(
|
|
531
532
|
K,
|
|
532
533
|
"root",
|
|
533
534
|
{ forwardAsChild: !0 }
|
|
534
|
-
),
|
|
535
|
-
|
|
535
|
+
), Xe = A(
|
|
536
|
+
W,
|
|
536
537
|
"trigger",
|
|
537
538
|
{ forwardAsChild: !0 }
|
|
538
|
-
),
|
|
539
|
+
), He = A(
|
|
539
540
|
k,
|
|
540
541
|
"content",
|
|
541
542
|
{ forwardAsChild: !0 }
|
|
542
543
|
);
|
|
543
|
-
|
|
544
|
-
const
|
|
545
|
-
|
|
544
|
+
A("div", "contentGroup");
|
|
545
|
+
const Ke = A(
|
|
546
|
+
U,
|
|
546
547
|
"list",
|
|
547
548
|
{ forwardAsChild: !0 }
|
|
548
549
|
);
|
|
549
|
-
|
|
550
|
-
|
|
550
|
+
A(
|
|
551
|
+
D,
|
|
551
552
|
"indicator",
|
|
552
553
|
{ forwardAsChild: !0 }
|
|
553
554
|
);
|
|
554
|
-
const
|
|
555
|
+
const qe = {
|
|
555
556
|
xs: "sm",
|
|
556
557
|
sm: "md",
|
|
557
558
|
md: "md",
|
|
558
559
|
lg: "lg"
|
|
559
|
-
},
|
|
560
|
+
}, ze = {
|
|
560
561
|
xs: "xs",
|
|
561
562
|
sm: "xs",
|
|
562
563
|
md: "sm",
|
|
563
564
|
lg: "md"
|
|
564
|
-
},
|
|
565
|
+
}, Ye = ({
|
|
565
566
|
iconName: e,
|
|
566
567
|
iconPosition: t = "left",
|
|
567
568
|
label: s,
|
|
@@ -570,8 +571,8 @@ const Ke = {
|
|
|
570
571
|
size: o = "md",
|
|
571
572
|
["data-testid"]: n = "kibble-tab",
|
|
572
573
|
...u
|
|
573
|
-
}) => /* @__PURE__ */
|
|
574
|
-
!!e && t === "left" && /* @__PURE__ */
|
|
574
|
+
}) => /* @__PURE__ */ c.jsxs(Xe, { className: "Tab", "data-testid": n, ...u, children: [
|
|
575
|
+
!!e && t === "left" && /* @__PURE__ */ c.jsx(
|
|
575
576
|
L,
|
|
576
577
|
{
|
|
577
578
|
className: "Tab__Icon",
|
|
@@ -581,18 +582,18 @@ const Ke = {
|
|
|
581
582
|
variant: "default"
|
|
582
583
|
}
|
|
583
584
|
),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
!!e && t === "right" && /* @__PURE__ */
|
|
586
|
-
r && /* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ c.jsx(G, { as: "span", className: "Tab__Label", "data-testid": `${n}-label`, size: ze[o], children: s }),
|
|
586
|
+
!!e && t === "right" && /* @__PURE__ */ c.jsx(L, { className: "Tab__Icon", "data-testid": `${n}-icon-right`, name: e, size: o }),
|
|
587
|
+
r && /* @__PURE__ */ c.jsx(
|
|
587
588
|
Y,
|
|
588
589
|
{
|
|
589
590
|
className: "Tab__NotificationCounter",
|
|
590
591
|
"data-testid": `${n}-notification-counter`,
|
|
591
592
|
...a,
|
|
592
|
-
size:
|
|
593
|
+
size: qe[o]
|
|
593
594
|
}
|
|
594
595
|
)
|
|
595
|
-
] }),
|
|
596
|
+
] }), ct = ({
|
|
596
597
|
align: e = "start",
|
|
597
598
|
onChange: t,
|
|
598
599
|
scrollable: s = !1,
|
|
@@ -601,58 +602,43 @@ const Ke = {
|
|
|
601
602
|
tabsContent: o,
|
|
602
603
|
["data-testid"]: n = "kibble-tabs",
|
|
603
604
|
...u
|
|
604
|
-
}) =>
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
605
|
+
}) => {
|
|
606
|
+
const g = /* @__PURE__ */ c.jsx(Ke, { className: "Tabs__List", "data-testid": `${n}-trigger-list`, children: r.map((d, f) => /* @__PURE__ */ c.jsx(
|
|
607
|
+
Ye,
|
|
608
|
+
{
|
|
609
|
+
...d,
|
|
610
|
+
"data-testid": `${n}-trigger-${d.value}`,
|
|
611
|
+
size: a,
|
|
612
|
+
...s && { style: { flexShrink: 0 } }
|
|
613
|
+
},
|
|
614
|
+
`tab-${f}`
|
|
615
|
+
)) });
|
|
616
|
+
return /* @__PURE__ */ c.jsxs(
|
|
617
|
+
Me,
|
|
618
|
+
{
|
|
619
|
+
className: "Tabs",
|
|
620
|
+
"data-testid": n,
|
|
621
|
+
justify: e || u.justify,
|
|
622
|
+
size: a,
|
|
623
|
+
onValueChange: ({ value: d }) => t?.(d),
|
|
624
|
+
...u,
|
|
625
|
+
children: [
|
|
626
|
+
s ? /* @__PURE__ */ c.jsx(xe, { overflowX: "auto", scrollbarWidth: "none", children: g }) : g,
|
|
627
|
+
!!o && o.map((d, f) => /* @__PURE__ */ c.jsx(
|
|
628
|
+
He,
|
|
629
|
+
{
|
|
630
|
+
"data-testid": `${n}-content-${r[f].value}`,
|
|
631
|
+
...d
|
|
629
632
|
},
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
...s && { style: { flexShrink: 0 } }
|
|
637
|
-
},
|
|
638
|
-
`tab-${g}`
|
|
639
|
-
))
|
|
640
|
-
}
|
|
641
|
-
),
|
|
642
|
-
!!o && o.map((d, g) => /* @__PURE__ */ l.jsx(
|
|
643
|
-
Xe,
|
|
644
|
-
{
|
|
645
|
-
"data-testid": `${n}-content-${r[g].value}`,
|
|
646
|
-
...d
|
|
647
|
-
},
|
|
648
|
-
`${n}-tabContent-${g}`
|
|
649
|
-
))
|
|
650
|
-
]
|
|
651
|
-
}
|
|
652
|
-
)), it = ["xs", "sm", "md", "lg"], lt = ["left", "right"];
|
|
633
|
+
`${n}-tabContent-${f}`
|
|
634
|
+
))
|
|
635
|
+
]
|
|
636
|
+
}
|
|
637
|
+
);
|
|
638
|
+
}, lt = ["xs", "sm", "md", "lg"], ut = ["left", "right"];
|
|
653
639
|
export {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
640
|
+
ct as T,
|
|
641
|
+
ut as a,
|
|
642
|
+
lt as t
|
|
657
643
|
};
|
|
658
|
-
//# sourceMappingURL=tab.types-
|
|
644
|
+
//# sourceMappingURL=tab.types-JAJ5Xxff.js.map
|