@spark-ui/components 17.0.1-beta.0 → 17.0.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/{Button-CcIRizse.mjs → Button-1M9DcZl0.mjs} +2 -2
- package/dist/{Button-CcIRizse.mjs.map → Button-1M9DcZl0.mjs.map} +1 -1
- package/dist/{Button-CXL2NOrq.js → Button-FZceRWG2.js} +2 -2
- package/dist/{Button-CXL2NOrq.js.map → Button-FZceRWG2.js.map} +1 -1
- package/dist/IconButton-BR1bJSQA.js +2 -0
- package/dist/IconButton-BR1bJSQA.js.map +1 -0
- package/dist/{IconButton-CP4JbWsI.mjs → IconButton-DdB3Pq13.mjs} +14 -14
- package/dist/IconButton-DdB3Pq13.mjs.map +1 -0
- package/dist/avatar/index.js +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/button/index.js +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/carousel/index.js +1 -1
- package/dist/carousel/index.mjs +1 -1
- package/dist/chip/index.js +1 -1
- package/dist/chip/index.js.map +1 -1
- package/dist/chip/index.mjs +1 -1
- package/dist/chip/index.mjs.map +1 -1
- package/dist/combobox/index.js +1 -1
- package/dist/combobox/index.js.map +1 -1
- package/dist/combobox/index.mjs +39 -39
- package/dist/combobox/index.mjs.map +1 -1
- package/dist/dialog/index.js +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/drawer/index.js +1 -1
- package/dist/drawer/index.mjs +1 -1
- package/dist/dropdown/index.js +1 -1
- package/dist/dropdown/index.js.map +1 -1
- package/dist/dropdown/index.mjs +1 -1
- package/dist/dropdown/index.mjs.map +1 -1
- package/dist/file-upload/index.js +1 -1
- package/dist/file-upload/index.mjs +2 -2
- package/dist/icon-button/index.js +1 -1
- package/dist/icon-button/index.mjs +1 -1
- package/dist/input/index.js +1 -1
- package/dist/input/index.js.map +1 -1
- package/dist/input/index.mjs +6 -6
- package/dist/input/index.mjs.map +1 -1
- package/dist/pagination/index.js +1 -1
- package/dist/pagination/index.mjs +2 -2
- package/dist/popover/index.js +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/scrolling-list/index.js +1 -1
- package/dist/scrolling-list/index.mjs +2 -2
- package/dist/select/index.js +1 -1
- package/dist/select/index.js.map +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/select/index.mjs.map +1 -1
- package/dist/snackbar/index.js +1 -1
- package/dist/snackbar/index.mjs +2 -2
- package/dist/stepper/index.js +1 -1
- package/dist/stepper/index.mjs +1 -1
- package/dist/tabs/Tabs.d.ts +3 -3
- package/dist/tabs/TabsContent.d.ts +4 -4
- package/dist/tabs/TabsContext.d.ts +2 -2
- package/dist/tabs/TabsList.d.ts +3 -3
- package/dist/tabs/TabsTrigger.d.ts +3 -3
- package/dist/tabs/index.js +1 -1
- package/dist/tabs/index.js.map +1 -1
- package/dist/tabs/index.mjs +183 -174
- package/dist/tabs/index.mjs.map +1 -1
- package/dist/tabs/useRenderSlot.d.ts +1 -0
- package/dist/tag/index.js +1 -1
- package/dist/tag/index.js.map +1 -1
- package/dist/tag/index.mjs +6 -6
- package/dist/tag/index.mjs.map +1 -1
- package/dist/textarea/index.js +1 -1
- package/dist/textarea/index.js.map +1 -1
- package/dist/textarea/index.mjs +14 -10
- package/dist/textarea/index.mjs.map +1 -1
- package/dist/toast/index.js +1 -1
- package/dist/toast/index.mjs +2 -2
- package/package.json +4 -4
- package/dist/IconButton-CP4JbWsI.mjs.map +0 -1
- package/dist/IconButton-JFDGiOOn.js +0 -2
- package/dist/IconButton-JFDGiOOn.js.map +0 -1
package/dist/tabs/index.mjs
CHANGED
|
@@ -1,99 +1,107 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Tabs as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { cva as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { jsx as o, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { Tabs as z } from "@base-ui/react/tabs";
|
|
3
|
+
import { createContext as O, useContext as A, useState as B, useRef as v, useEffect as w, forwardRef as j, useMemo as Q } from "react";
|
|
4
|
+
import { cva as b, cx as U } from "class-variance-authority";
|
|
5
|
+
import { S as X } from "../Slot-DLY1rJrG.mjs";
|
|
6
|
+
import { ArrowVerticalLeft as Y } from "@spark-ui/icons/ArrowVerticalLeft";
|
|
7
|
+
import { ArrowVerticalRight as Z } from "@spark-ui/icons/ArrowVerticalRight";
|
|
8
|
+
import { B as I } from "../Button-1M9DcZl0.mjs";
|
|
9
|
+
import { I as S } from "../Icon-BO327oHU.mjs";
|
|
10
|
+
import { useMergeRefs as D } from "@spark-ui/hooks/use-merge-refs";
|
|
11
|
+
import { MoreMenuHorizontal as _ } from "@spark-ui/icons/MoreMenuHorizontal";
|
|
12
|
+
import { I as ee } from "../IconButton-DdB3Pq13.mjs";
|
|
13
|
+
import { Popover as T } from "../popover/index.mjs";
|
|
14
|
+
import { makeVariants as te } from "@spark-ui/internal-utils";
|
|
15
|
+
const K = O({}), k = () => {
|
|
16
|
+
const t = A(K);
|
|
16
17
|
if (!t)
|
|
17
18
|
throw Error("useTabsContext must be used within a TabsContext Provider");
|
|
18
19
|
return t;
|
|
19
|
-
},
|
|
20
|
+
}, re = b([
|
|
20
21
|
"flex",
|
|
21
22
|
"data-[orientation=horizontal]:flex-col",
|
|
22
23
|
"data-[orientation=vertical]:flex-row",
|
|
23
24
|
"max-w-full"
|
|
24
|
-
])
|
|
25
|
+
]);
|
|
26
|
+
function y(t) {
|
|
27
|
+
return t ? ({ ...r }) => /* @__PURE__ */ o(X, { ...r }) : void 0;
|
|
28
|
+
}
|
|
29
|
+
const $ = ({
|
|
25
30
|
intent: t = "support",
|
|
26
31
|
size: r = "md",
|
|
27
32
|
/**
|
|
28
|
-
* Default
|
|
29
|
-
* see https://
|
|
33
|
+
* Default Base UI Primitive values
|
|
34
|
+
* see https://base-ui.com/react/components/tabs
|
|
30
35
|
*/
|
|
31
|
-
asChild:
|
|
36
|
+
asChild: l = !1,
|
|
32
37
|
forceMount: a = !1,
|
|
33
|
-
orientation:
|
|
38
|
+
orientation: n = "horizontal",
|
|
34
39
|
children: i,
|
|
35
|
-
className:
|
|
40
|
+
className: s,
|
|
36
41
|
ref: c,
|
|
37
42
|
...e
|
|
38
|
-
}) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
}) => {
|
|
44
|
+
const h = y(l);
|
|
45
|
+
return /* @__PURE__ */ o(
|
|
46
|
+
K.Provider,
|
|
47
|
+
{
|
|
48
|
+
value: {
|
|
49
|
+
intent: t,
|
|
50
|
+
size: r,
|
|
51
|
+
orientation: n,
|
|
52
|
+
forceMount: a
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ o(
|
|
55
|
+
z.Root,
|
|
56
|
+
{
|
|
57
|
+
ref: c,
|
|
58
|
+
orientation: n,
|
|
59
|
+
className: re({ className: s }),
|
|
60
|
+
"data-spark-component": "tabs",
|
|
61
|
+
render: h,
|
|
62
|
+
...e,
|
|
63
|
+
children: i
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
$.displayName = "Tabs";
|
|
70
|
+
const oe = b(["w-full p-lg", "focus-visible:u-outline-inset"], {
|
|
64
71
|
variants: {
|
|
65
72
|
forceMount: {
|
|
66
|
-
true: "data-[
|
|
73
|
+
true: "data-[hidden]:hidden",
|
|
67
74
|
false: ""
|
|
68
75
|
}
|
|
69
76
|
}
|
|
70
|
-
}),
|
|
77
|
+
}), R = ({
|
|
71
78
|
/**
|
|
72
|
-
* Default
|
|
73
|
-
* see https://
|
|
79
|
+
* Default Base UI Primitive values
|
|
80
|
+
* see https://base-ui.com/react/components/tabs
|
|
74
81
|
*/
|
|
75
82
|
children: t,
|
|
76
83
|
asChild: r = !1,
|
|
77
|
-
className:
|
|
84
|
+
className: l,
|
|
78
85
|
ref: a,
|
|
79
|
-
|
|
86
|
+
forceMount: n,
|
|
87
|
+
...i
|
|
80
88
|
}) => {
|
|
81
|
-
const { forceMount:
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
89
|
+
const { forceMount: s } = k(), c = y(r), e = s || n;
|
|
90
|
+
return /* @__PURE__ */ o(
|
|
91
|
+
z.Panel,
|
|
84
92
|
{
|
|
85
93
|
"data-spark-component": "tabs-content",
|
|
86
94
|
ref: a,
|
|
87
|
-
|
|
88
|
-
className:
|
|
89
|
-
|
|
90
|
-
...
|
|
95
|
+
keepMounted: e,
|
|
96
|
+
className: oe({ className: l, forceMount: e }),
|
|
97
|
+
render: c,
|
|
98
|
+
...i,
|
|
91
99
|
children: t
|
|
92
100
|
}
|
|
93
101
|
);
|
|
94
102
|
};
|
|
95
|
-
|
|
96
|
-
const
|
|
103
|
+
R.displayName = "Tabs.Content";
|
|
104
|
+
const ne = b(["relative flex"]), ie = b([
|
|
97
105
|
"flex w-full",
|
|
98
106
|
"data-[orientation=horizontal]:flex-row",
|
|
99
107
|
"data-[orientation=vertical]:flex-col",
|
|
@@ -101,64 +109,64 @@ const te = x(["relative flex"]), re = x([
|
|
|
101
109
|
"after:flex after:shrink after:grow after:border-outline",
|
|
102
110
|
"data-[orientation=horizontal]:after:border-b-sm",
|
|
103
111
|
"data-[orientation=vertical]:after:border-r-sm"
|
|
104
|
-
]),
|
|
112
|
+
]), E = b([
|
|
105
113
|
"h-auto! flex-none",
|
|
106
114
|
"border-b-sm border-outline",
|
|
107
115
|
"outline-hidden",
|
|
108
116
|
"focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset!"
|
|
109
|
-
]),
|
|
110
|
-
const [
|
|
111
|
-
return
|
|
117
|
+
]), se = (t, r) => {
|
|
118
|
+
const [l, a] = B({ width: void 0, height: void 0 }), n = v(null), i = v(r);
|
|
119
|
+
return w(() => {
|
|
112
120
|
i.current = r;
|
|
113
|
-
}, [r]),
|
|
114
|
-
const
|
|
115
|
-
if (!(!
|
|
116
|
-
return
|
|
117
|
-
const { inlineSize: e, blockSize:
|
|
118
|
-
i.current?.(c), a({ width: e, height:
|
|
119
|
-
}),
|
|
120
|
-
|
|
121
|
+
}, [r]), w(() => {
|
|
122
|
+
const s = t && "current" in t ? t.current : t;
|
|
123
|
+
if (!(!s || n.current))
|
|
124
|
+
return n.current = new ResizeObserver(([c]) => {
|
|
125
|
+
const { inlineSize: e, blockSize: h } = c?.borderBoxSize?.[0] ?? {};
|
|
126
|
+
i.current?.(c), a({ width: e, height: h });
|
|
127
|
+
}), n.current.observe(s), () => {
|
|
128
|
+
n.current && n.current.unobserve(s);
|
|
121
129
|
};
|
|
122
|
-
}, [t,
|
|
123
|
-
},
|
|
130
|
+
}, [t, n, i]), l;
|
|
131
|
+
}, W = ({
|
|
124
132
|
/**
|
|
125
|
-
* Default
|
|
126
|
-
* see https://
|
|
133
|
+
* Default Base UI Primitive values
|
|
134
|
+
* see https://base-ui.com/react/components/tabs
|
|
127
135
|
*/
|
|
128
136
|
asChild: t = !1,
|
|
129
137
|
loop: r = !1,
|
|
130
|
-
children:
|
|
138
|
+
children: l,
|
|
131
139
|
className: a,
|
|
132
|
-
ref:
|
|
140
|
+
ref: n,
|
|
133
141
|
...i
|
|
134
142
|
}) => {
|
|
135
|
-
const
|
|
143
|
+
const s = v(null), c = v(null), e = n || c, { orientation: h } = k(), C = y(t), { width: x } = se(s), [d, g] = B({
|
|
136
144
|
prev: "hidden",
|
|
137
145
|
next: "hidden"
|
|
138
146
|
});
|
|
139
|
-
|
|
140
|
-
typeof e == "function" || !e.current ||
|
|
147
|
+
w(() => {
|
|
148
|
+
typeof e == "function" || !e.current || g(h !== "horizontal" ? { prev: "hidden", next: "hidden" } : {
|
|
141
149
|
prev: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden",
|
|
142
150
|
next: e.current.scrollWidth > e.current.clientWidth ? "visible" : "hidden"
|
|
143
151
|
});
|
|
144
|
-
}, [
|
|
152
|
+
}, [h, e, x]), w(() => {
|
|
145
153
|
if (typeof e == "function" || !e.current || d.prev === "hidden" || r)
|
|
146
154
|
return;
|
|
147
155
|
const f = (u) => {
|
|
148
|
-
|
|
156
|
+
g({
|
|
149
157
|
prev: u.scrollLeft > 0 ? "visible" : "disabled",
|
|
150
158
|
next: u.scrollLeft + u.clientWidth < u.scrollWidth ? "visible" : "disabled"
|
|
151
159
|
});
|
|
152
|
-
},
|
|
153
|
-
return f(
|
|
160
|
+
}, p = e.current;
|
|
161
|
+
return f(p), p.addEventListener(
|
|
154
162
|
"scroll",
|
|
155
163
|
({ target: u }) => f(u)
|
|
156
|
-
), () =>
|
|
164
|
+
), () => p.removeEventListener(
|
|
157
165
|
"scroll",
|
|
158
166
|
({ target: u }) => f(u)
|
|
159
167
|
);
|
|
160
168
|
}, [e, d.prev, r]);
|
|
161
|
-
const
|
|
169
|
+
const N = () => {
|
|
162
170
|
if (typeof e == "function" || !e.current)
|
|
163
171
|
return;
|
|
164
172
|
const f = r && e.current.scrollLeft <= 0;
|
|
@@ -166,7 +174,7 @@ const te = x(["relative flex"]), re = x([
|
|
|
166
174
|
left: f ? e.current.scrollLeft + e.current.scrollWidth - e.current.clientWidth : e.current.scrollLeft - e.current.clientWidth,
|
|
167
175
|
behavior: "smooth"
|
|
168
176
|
});
|
|
169
|
-
},
|
|
177
|
+
}, P = () => {
|
|
170
178
|
if (typeof e == "function" || !e.current)
|
|
171
179
|
return;
|
|
172
180
|
const f = r && e.current.scrollLeft + e.current.clientWidth >= e.current.scrollWidth;
|
|
@@ -175,58 +183,59 @@ const te = x(["relative flex"]), re = x([
|
|
|
175
183
|
behavior: "smooth"
|
|
176
184
|
});
|
|
177
185
|
};
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
d.prev !== "hidden" && /* @__PURE__ */
|
|
180
|
-
|
|
186
|
+
return /* @__PURE__ */ F("div", { className: ne({ className: a }), ref: s, children: [
|
|
187
|
+
d.prev !== "hidden" && /* @__PURE__ */ o(
|
|
188
|
+
I,
|
|
181
189
|
{
|
|
182
190
|
shape: "square",
|
|
183
191
|
intent: "surface",
|
|
184
192
|
size: "sm",
|
|
185
|
-
className:
|
|
186
|
-
onClick:
|
|
193
|
+
className: E(),
|
|
194
|
+
onClick: N,
|
|
187
195
|
disabled: d.prev === "disabled",
|
|
188
196
|
"aria-label": "Scroll left",
|
|
189
|
-
children: /* @__PURE__ */
|
|
197
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Y, {}) })
|
|
190
198
|
}
|
|
191
199
|
),
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
-
|
|
200
|
+
/* @__PURE__ */ o(
|
|
201
|
+
z.List,
|
|
194
202
|
{
|
|
195
203
|
"data-spark-component": "tabs-list",
|
|
196
204
|
ref: e,
|
|
197
|
-
className:
|
|
198
|
-
|
|
199
|
-
|
|
205
|
+
className: ie(),
|
|
206
|
+
render: C,
|
|
207
|
+
loopFocus: r,
|
|
208
|
+
activateOnFocus: !0,
|
|
200
209
|
...i,
|
|
201
|
-
children:
|
|
210
|
+
children: l
|
|
202
211
|
}
|
|
203
212
|
),
|
|
204
|
-
d.next !== "hidden" && /* @__PURE__ */
|
|
205
|
-
|
|
213
|
+
d.next !== "hidden" && /* @__PURE__ */ o(
|
|
214
|
+
I,
|
|
206
215
|
{
|
|
207
216
|
shape: "square",
|
|
208
217
|
intent: "surface",
|
|
209
218
|
size: "sm",
|
|
210
|
-
className:
|
|
211
|
-
onClick:
|
|
219
|
+
className: E(),
|
|
220
|
+
onClick: P,
|
|
212
221
|
disabled: d.next === "disabled",
|
|
213
222
|
"aria-label": "Scroll right",
|
|
214
|
-
children: /* @__PURE__ */
|
|
223
|
+
children: /* @__PURE__ */ o(S, { children: /* @__PURE__ */ o(Z, {}) })
|
|
215
224
|
}
|
|
216
225
|
)
|
|
217
226
|
] });
|
|
218
227
|
};
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
const t = A(
|
|
228
|
+
W.displayName = "Tabs.List";
|
|
229
|
+
const L = O(void 0), q = () => {
|
|
230
|
+
const t = A(L);
|
|
222
231
|
if (!t)
|
|
223
232
|
throw new Error("TabsPopover components must be used within TabsPopover");
|
|
224
233
|
return t;
|
|
225
|
-
},
|
|
226
|
-
({ "aria-label": t, children: r, ...
|
|
227
|
-
const { popoverTriggerRef:
|
|
228
|
-
return /* @__PURE__ */
|
|
229
|
-
|
|
234
|
+
}, H = j(
|
|
235
|
+
({ "aria-label": t, children: r, ...l }, a) => {
|
|
236
|
+
const { popoverTriggerRef: n } = q(), i = D(a, n);
|
|
237
|
+
return /* @__PURE__ */ o(T.Trigger, { asChild: !0, ...l, children: /* @__PURE__ */ o(
|
|
238
|
+
ee,
|
|
230
239
|
{
|
|
231
240
|
ref: i,
|
|
232
241
|
size: "sm",
|
|
@@ -234,48 +243,48 @@ const P = E(void 0), K = () => {
|
|
|
234
243
|
design: "ghost",
|
|
235
244
|
"aria-label": t,
|
|
236
245
|
tabIndex: -1,
|
|
237
|
-
children: /* @__PURE__ */
|
|
246
|
+
children: /* @__PURE__ */ o(S, { children: r || /* @__PURE__ */ o(_, {}) })
|
|
238
247
|
}
|
|
239
248
|
) });
|
|
240
249
|
}
|
|
241
250
|
);
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
({ side: t, align: r = "start", className:
|
|
245
|
-
const { popoverSide: i } =
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
|
|
251
|
+
H.displayName = "Popover.Trigger";
|
|
252
|
+
const G = j(
|
|
253
|
+
({ side: t, align: r = "start", className: l, ...a }, n) => {
|
|
254
|
+
const { popoverSide: i } = q(), s = U("gap-sm flex flex-col", l);
|
|
255
|
+
return /* @__PURE__ */ o(
|
|
256
|
+
T.Content,
|
|
248
257
|
{
|
|
249
|
-
ref:
|
|
258
|
+
ref: n,
|
|
250
259
|
...a,
|
|
251
260
|
side: t ?? i,
|
|
252
261
|
align: r,
|
|
253
|
-
className:
|
|
262
|
+
className: s
|
|
254
263
|
}
|
|
255
264
|
);
|
|
256
265
|
}
|
|
257
266
|
);
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
const a =
|
|
267
|
+
G.displayName = "Popover.Content";
|
|
268
|
+
const J = ({ popoverSide: t, popoverTriggerRef: r, children: l }) => {
|
|
269
|
+
const a = Q(
|
|
261
270
|
() => ({ popoverSide: t, popoverTriggerRef: r }),
|
|
262
271
|
[t, r]
|
|
263
|
-
), i = Object.assign(((
|
|
264
|
-
Content:
|
|
265
|
-
Trigger:
|
|
272
|
+
), i = Object.assign(((s) => /* @__PURE__ */ o(L.Provider, { value: a, children: /* @__PURE__ */ o(T, { ...s, children: s.children }) })), T, {
|
|
273
|
+
Content: G,
|
|
274
|
+
Trigger: H
|
|
266
275
|
});
|
|
267
|
-
return /* @__PURE__ */
|
|
276
|
+
return /* @__PURE__ */ o(L.Provider, { value: a, children: l(i) });
|
|
268
277
|
};
|
|
269
|
-
|
|
270
|
-
const
|
|
278
|
+
J.displayName = "Popover";
|
|
279
|
+
const ae = b(
|
|
271
280
|
[
|
|
272
281
|
"px-md",
|
|
273
282
|
"relative flex flex-none items-center",
|
|
274
283
|
"border-outline",
|
|
275
284
|
"hover:not-disabled:bg-surface-hovered",
|
|
276
285
|
"after:absolute",
|
|
277
|
-
"data-[
|
|
278
|
-
"data-[
|
|
286
|
+
"data-[active]:font-bold",
|
|
287
|
+
"not-data-[active]:not-disabled:cursor-pointer",
|
|
279
288
|
"data-[orientation=horizontal]:border-b-sm data-[orientation=horizontal]:after:inset-x-0 data-[orientation=horizontal]:after:bottom-[-1px] data-[orientation=horizontal]:after:h-sz-2",
|
|
280
289
|
"data-[orientation=vertical]:border-r-sm data-[orientation=vertical]:after:inset-y-0 data-[orientation=vertical]:after:right-[-1px] data-[orientation=vertical]:after:w-sz-2",
|
|
281
290
|
"focus-visible:border-none focus-visible:bg-surface-hovered focus-visible:u-outline-inset",
|
|
@@ -289,9 +298,9 @@ const ne = x(
|
|
|
289
298
|
* Change the color scheme of the tabs
|
|
290
299
|
* @default support
|
|
291
300
|
*/
|
|
292
|
-
intent:
|
|
293
|
-
main: ["data-[
|
|
294
|
-
support: ["data-[
|
|
301
|
+
intent: te({
|
|
302
|
+
main: ["data-[active]:text-main data-[active]:after:bg-main"],
|
|
303
|
+
support: ["data-[active]:text-support data-[active]:after:bg-support"]
|
|
295
304
|
}),
|
|
296
305
|
/**
|
|
297
306
|
* Change the size of the tabs
|
|
@@ -324,65 +333,65 @@ const ne = x(
|
|
|
324
333
|
orientation: "horizontal"
|
|
325
334
|
}
|
|
326
335
|
}
|
|
327
|
-
),
|
|
336
|
+
), M = ({
|
|
328
337
|
/**
|
|
329
|
-
* Default
|
|
330
|
-
* see https://
|
|
338
|
+
* Default Base UI Primitive values
|
|
339
|
+
* see https://base-ui.com/react/components/tabs
|
|
331
340
|
*/
|
|
332
341
|
asChild: t = !1,
|
|
333
342
|
value: r,
|
|
334
|
-
disabled:
|
|
343
|
+
disabled: l = !1,
|
|
335
344
|
children: a,
|
|
336
|
-
className:
|
|
345
|
+
className: n,
|
|
337
346
|
ref: i,
|
|
338
|
-
onKeyDown:
|
|
347
|
+
onKeyDown: s,
|
|
339
348
|
renderMenu: c,
|
|
340
349
|
...e
|
|
341
350
|
}) => {
|
|
342
|
-
const { intent:
|
|
343
|
-
|
|
344
|
-
},
|
|
345
|
-
|
|
351
|
+
const { intent: h, size: C, orientation: x } = k(), d = v(null), g = v(null), N = y(t), P = D(i, g), f = (m) => {
|
|
352
|
+
m.key === "F10" && m.shiftKey && c && d.current && (m.preventDefault(), d.current.click()), s?.(m);
|
|
353
|
+
}, p = !!c, u = x === "vertical" ? "right" : "bottom", V = /* @__PURE__ */ o(
|
|
354
|
+
z.Tab,
|
|
346
355
|
{
|
|
347
356
|
"data-spark-component": "tabs-trigger",
|
|
348
|
-
ref:
|
|
349
|
-
className:
|
|
350
|
-
intent:
|
|
351
|
-
size:
|
|
352
|
-
hasMenu:
|
|
353
|
-
orientation:
|
|
354
|
-
className:
|
|
357
|
+
ref: P,
|
|
358
|
+
className: ae({
|
|
359
|
+
intent: h,
|
|
360
|
+
size: C,
|
|
361
|
+
hasMenu: p,
|
|
362
|
+
orientation: x ?? "horizontal",
|
|
363
|
+
className: n
|
|
355
364
|
}),
|
|
356
|
-
|
|
357
|
-
disabled:
|
|
365
|
+
render: N,
|
|
366
|
+
disabled: l,
|
|
358
367
|
value: r,
|
|
359
|
-
onFocus: ({ target:
|
|
368
|
+
onFocus: ({ target: m }) => m.scrollIntoView({
|
|
360
369
|
behavior: "smooth",
|
|
361
370
|
block: "nearest",
|
|
362
371
|
inline: "nearest"
|
|
363
372
|
}),
|
|
364
373
|
onKeyDown: f,
|
|
365
|
-
"aria-haspopup":
|
|
374
|
+
"aria-haspopup": p ? "true" : void 0,
|
|
366
375
|
...e,
|
|
367
376
|
children: a
|
|
368
377
|
}
|
|
369
378
|
);
|
|
370
|
-
return
|
|
371
|
-
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
] }) :
|
|
379
|
+
return p ? /* @__PURE__ */ F("div", { className: x === "vertical" ? "relative w-full" : "relative", children: [
|
|
380
|
+
V,
|
|
381
|
+
/* @__PURE__ */ o("div", { className: "right-md mr-md pointer-events-auto absolute top-1/2 -translate-y-1/2", children: /* @__PURE__ */ o(J, { popoverSide: u, popoverTriggerRef: d, children: (m) => c?.({ Popover: m }) }) })
|
|
382
|
+
] }) : V;
|
|
374
383
|
};
|
|
375
|
-
|
|
376
|
-
const
|
|
377
|
-
List:
|
|
378
|
-
Trigger:
|
|
379
|
-
Content:
|
|
384
|
+
M.displayName = "Tabs.Trigger";
|
|
385
|
+
const le = Object.assign($, {
|
|
386
|
+
List: W,
|
|
387
|
+
Trigger: M,
|
|
388
|
+
Content: R
|
|
380
389
|
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
390
|
+
le.displayName = "Tabs";
|
|
391
|
+
W.displayName = "Tabs.List";
|
|
392
|
+
M.displayName = "Tabs.Trigger";
|
|
393
|
+
R.displayName = "Tabs.Content";
|
|
385
394
|
export {
|
|
386
|
-
|
|
395
|
+
le as Tabs
|
|
387
396
|
};
|
|
388
397
|
//# sourceMappingURL=index.mjs.map
|