@entro314labs/react-arc-tabs 1.0.5 → 1.0.7
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/ArcTabs.css +47 -27
- package/dist/index.cjs +41 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +41 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ArcTabs.css
CHANGED
|
@@ -2,9 +2,14 @@
|
|
|
2
2
|
--arc-radius: 14px;
|
|
3
3
|
--arc-gap: 10px;
|
|
4
4
|
--arc-border-width: 1px;
|
|
5
|
+
--arc-notch: clamp(8px, calc(var(--arc-radius) * 0.75), 16px);
|
|
5
6
|
--arc-motion-duration: 260ms;
|
|
6
7
|
--arc-motion-easing: cubic-bezier(0.22, 1, 0.36, 1);
|
|
7
8
|
|
|
9
|
+
/* Panel corner radii driven by active tab position */
|
|
10
|
+
--arc-panel-tl-radius: 0px;
|
|
11
|
+
--arc-panel-tr-radius: 0px;
|
|
12
|
+
|
|
8
13
|
--arc-accent: #5b4ff1;
|
|
9
14
|
--arc-text: #171a2c;
|
|
10
15
|
--arc-tab-bg: #e7ebff;
|
|
@@ -32,6 +37,7 @@
|
|
|
32
37
|
.arc-tabs__list {
|
|
33
38
|
position: relative;
|
|
34
39
|
display: flex;
|
|
40
|
+
min-width: 100%;
|
|
35
41
|
align-items: end;
|
|
36
42
|
gap: var(--arc-gap);
|
|
37
43
|
list-style: none;
|
|
@@ -42,10 +48,17 @@
|
|
|
42
48
|
border-top-left-radius: var(--arc-radius);
|
|
43
49
|
border-top-right-radius: var(--arc-radius);
|
|
44
50
|
background: var(--arc-strip-bg);
|
|
51
|
+
overflow: visible;
|
|
52
|
+
isolation: isolate;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.arc-tabs__list-scroll {
|
|
56
|
+
position: relative;
|
|
57
|
+
margin-bottom: calc(var(--arc-notch) * -1);
|
|
58
|
+
padding-bottom: var(--arc-notch);
|
|
45
59
|
overflow-x: auto;
|
|
46
|
-
overflow-y:
|
|
60
|
+
overflow-y: visible;
|
|
47
61
|
scrollbar-width: thin;
|
|
48
|
-
isolation: isolate;
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
.arc-tabs__item {
|
|
@@ -159,41 +172,45 @@
|
|
|
159
172
|
.arc-tabs__tab::after {
|
|
160
173
|
content: '';
|
|
161
174
|
position: absolute;
|
|
162
|
-
|
|
163
|
-
width: var(--arc-radius);
|
|
164
|
-
height: var(--arc-radius);
|
|
175
|
+
left: calc(var(--arc-notch) * -1);
|
|
165
176
|
opacity: 0;
|
|
166
177
|
pointer-events: none;
|
|
167
178
|
transform: translateY(var(--arc-gap));
|
|
168
|
-
background-color: transparent;
|
|
169
179
|
transition:
|
|
170
180
|
opacity var(--arc-motion-duration) var(--arc-motion-easing),
|
|
171
181
|
transform var(--arc-motion-duration) var(--arc-motion-easing);
|
|
172
182
|
}
|
|
173
183
|
|
|
174
184
|
.arc-tabs__tab::before {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
var(--arc-panel-bg) var(--arc-radius)
|
|
180
|
-
);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
.arc-tabs__tab[aria-selected='true']:not(:first-child)::before {
|
|
184
|
-
opacity: 1;
|
|
185
|
+
bottom: 0;
|
|
186
|
+
width: calc(100% + (var(--arc-notch) * 2));
|
|
187
|
+
height: var(--arc-border-width);
|
|
188
|
+
background: var(--arc-panel-bg);
|
|
185
189
|
}
|
|
186
190
|
|
|
187
191
|
.arc-tabs__tab::after {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
bottom: 0;
|
|
193
|
+
width: calc(100% + (var(--arc-notch) * 2));
|
|
194
|
+
height: calc(var(--arc-notch) + var(--arc-border-width));
|
|
195
|
+
background:
|
|
196
|
+
radial-gradient(
|
|
197
|
+
circle var(--arc-notch) at 0% 0%,
|
|
198
|
+
transparent calc(var(--arc-notch) - 0.5px),
|
|
199
|
+
var(--arc-panel-bg) calc(var(--arc-notch) + 0.5px)
|
|
200
|
+
)
|
|
201
|
+
left top / var(--arc-notch) var(--arc-notch) no-repeat,
|
|
202
|
+
radial-gradient(
|
|
203
|
+
circle var(--arc-notch) at 100% 0%,
|
|
204
|
+
transparent calc(var(--arc-notch) - 0.5px),
|
|
205
|
+
var(--arc-panel-bg) calc(var(--arc-notch) + 0.5px)
|
|
206
|
+
)
|
|
207
|
+
right top / var(--arc-notch) var(--arc-notch) no-repeat,
|
|
208
|
+
linear-gradient(var(--arc-panel-bg), var(--arc-panel-bg))
|
|
209
|
+
center top / calc(100% - var(--arc-notch) * 2) 100% no-repeat;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.arc-tabs__tab[aria-selected='true']::before,
|
|
213
|
+
.arc-tabs__tab[aria-selected='true']::after {
|
|
197
214
|
opacity: 1;
|
|
198
215
|
}
|
|
199
216
|
|
|
@@ -239,13 +256,16 @@
|
|
|
239
256
|
margin-top: 0;
|
|
240
257
|
border: var(--arc-border-width) solid var(--arc-panel-border);
|
|
241
258
|
border-top: none;
|
|
242
|
-
border-top-left-radius:
|
|
243
|
-
border-top-right-radius:
|
|
259
|
+
border-top-left-radius: var(--arc-panel-tl-radius);
|
|
260
|
+
border-top-right-radius: var(--arc-panel-tr-radius);
|
|
244
261
|
border-bottom-left-radius: var(--arc-radius);
|
|
245
262
|
border-bottom-right-radius: var(--arc-radius);
|
|
246
263
|
background: var(--arc-panel-bg);
|
|
247
264
|
padding: var(--arc-panel-padding);
|
|
248
265
|
box-shadow: 0 12px 32px color-mix(in srgb, var(--arc-accent) 12%, transparent);
|
|
266
|
+
transition:
|
|
267
|
+
border-top-left-radius var(--arc-motion-duration) var(--arc-motion-easing),
|
|
268
|
+
border-top-right-radius var(--arc-motion-duration) var(--arc-motion-easing);
|
|
249
269
|
}
|
|
250
270
|
|
|
251
271
|
.arc-tabs__panel[hidden] {
|
package/dist/index.cjs
CHANGED
|
@@ -126,6 +126,7 @@ function ArcTabs({
|
|
|
126
126
|
}, [focusedIndex, selectedIndex, items]);
|
|
127
127
|
const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items]);
|
|
128
128
|
const tabRefs = React.useRef([]);
|
|
129
|
+
const listScrollRef = React.useRef(null);
|
|
129
130
|
const listRef = React.useRef(null);
|
|
130
131
|
const activePanelRef = React.useRef(null);
|
|
131
132
|
const hasMountedRef = React.useRef(false);
|
|
@@ -191,13 +192,11 @@ function ArcTabs({
|
|
|
191
192
|
);
|
|
192
193
|
return;
|
|
193
194
|
}
|
|
194
|
-
const listElement = listRef.current;
|
|
195
195
|
const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
|
|
196
|
+
const listElement = listRef.current;
|
|
196
197
|
if (!listElement || !selectedTab) return;
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
|
|
200
|
-
const nextWidth = tabRect.width;
|
|
198
|
+
const nextX = selectedTab.offsetLeft;
|
|
199
|
+
const nextWidth = selectedTab.offsetWidth;
|
|
201
200
|
setIndicator((previous) => {
|
|
202
201
|
const changedX = Math.abs(previous.x - nextX) > 0.5;
|
|
203
202
|
const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
|
|
@@ -217,13 +216,11 @@ function ArcTabs({
|
|
|
217
216
|
React.useEffect(() => {
|
|
218
217
|
if (!showSlidingIndicator) return;
|
|
219
218
|
const listElement = listRef.current;
|
|
219
|
+
const listScrollElement = listScrollRef.current;
|
|
220
220
|
if (!listElement) return;
|
|
221
221
|
const onResize = () => {
|
|
222
222
|
syncIndicator();
|
|
223
223
|
};
|
|
224
|
-
const onScroll = () => {
|
|
225
|
-
syncIndicator();
|
|
226
|
-
};
|
|
227
224
|
const frame = requestAnimationFrame(syncIndicator);
|
|
228
225
|
let observer = null;
|
|
229
226
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -231,15 +228,16 @@ function ArcTabs({
|
|
|
231
228
|
syncIndicator();
|
|
232
229
|
});
|
|
233
230
|
observer.observe(listElement);
|
|
231
|
+
if (listScrollElement) {
|
|
232
|
+
observer.observe(listScrollElement);
|
|
233
|
+
}
|
|
234
234
|
tabRefs.current.forEach((tabElement) => {
|
|
235
235
|
if (tabElement) observer?.observe(tabElement);
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
|
-
listElement.addEventListener("scroll", onScroll, { passive: true });
|
|
239
238
|
window.addEventListener("resize", onResize);
|
|
240
239
|
return () => {
|
|
241
240
|
cancelAnimationFrame(frame);
|
|
242
|
-
listElement.removeEventListener("scroll", onScroll);
|
|
243
241
|
window.removeEventListener("resize", onResize);
|
|
244
242
|
observer?.disconnect();
|
|
245
243
|
};
|
|
@@ -363,7 +361,12 @@ function ArcTabs({
|
|
|
363
361
|
if (panelBorderColor) {
|
|
364
362
|
cssVars["--arc-panel-border"] = panelBorderColor;
|
|
365
363
|
}
|
|
364
|
+
cssVars["--arc-notch"] = "clamp(8px, calc(var(--arc-radius) * 0.75), 16px)";
|
|
366
365
|
cssVars["--arc-motion-duration"] = `${effectiveMotionDuration}ms`;
|
|
366
|
+
const isFirst = selectedIndex === 0;
|
|
367
|
+
const isLast = selectedIndex === items.length - 1;
|
|
368
|
+
cssVars["--arc-panel-tl-radius"] = isFirst ? "0px" : "var(--arc-radius)";
|
|
369
|
+
cssVars["--arc-panel-tr-radius"] = isLast ? "0px" : "var(--arc-radius)";
|
|
367
370
|
return cssVars;
|
|
368
371
|
}, [
|
|
369
372
|
style,
|
|
@@ -375,7 +378,9 @@ function ArcTabs({
|
|
|
375
378
|
tabHoverBackground,
|
|
376
379
|
panelBackground,
|
|
377
380
|
panelBorderColor,
|
|
378
|
-
effectiveMotionDuration
|
|
381
|
+
effectiveMotionDuration,
|
|
382
|
+
selectedIndex,
|
|
383
|
+
items.length
|
|
379
384
|
]);
|
|
380
385
|
const rootClassName = joinClassNames(
|
|
381
386
|
"arc-tabs",
|
|
@@ -400,7 +405,7 @@ function ArcTabs({
|
|
|
400
405
|
] });
|
|
401
406
|
const renderPanelContent = (item, state) => renderPanel ? renderPanel(item, state) : item.content;
|
|
402
407
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: rootClassName, style: themedStyle, ...rest, children: [
|
|
403
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
408
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: listScrollRef, className: "arc-tabs__list-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
404
409
|
"ul",
|
|
405
410
|
{
|
|
406
411
|
ref: listRef,
|
|
@@ -454,7 +459,7 @@ function ArcTabs({
|
|
|
454
459
|
})
|
|
455
460
|
]
|
|
456
461
|
}
|
|
457
|
-
),
|
|
462
|
+
) }),
|
|
458
463
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: joinClassNames("arc-tabs__panels", panelClassName), children: [
|
|
459
464
|
items.length === 0 && emptyState,
|
|
460
465
|
items.length > 0 && selectedItem === void 0 && emptyState,
|
|
@@ -602,6 +607,7 @@ function ArcTabsTailwind({
|
|
|
602
607
|
}, [focusedIndex, selectedIndex, items]);
|
|
603
608
|
const enabledIndices = React2.useMemo(() => getEnabledIndices2(items), [items]);
|
|
604
609
|
const tabRefs = React2.useRef([]);
|
|
610
|
+
const listScrollRef = React2.useRef(null);
|
|
605
611
|
const listRef = React2.useRef(null);
|
|
606
612
|
const activePanelRef = React2.useRef(null);
|
|
607
613
|
const hasMountedRef = React2.useRef(false);
|
|
@@ -667,13 +673,11 @@ function ArcTabsTailwind({
|
|
|
667
673
|
);
|
|
668
674
|
return;
|
|
669
675
|
}
|
|
670
|
-
const listElement = listRef.current;
|
|
671
676
|
const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
|
|
677
|
+
const listElement = listRef.current;
|
|
672
678
|
if (!listElement || !selectedTab) return;
|
|
673
|
-
const
|
|
674
|
-
const
|
|
675
|
-
const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
|
|
676
|
-
const nextWidth = tabRect.width;
|
|
679
|
+
const nextX = selectedTab.offsetLeft;
|
|
680
|
+
const nextWidth = selectedTab.offsetWidth;
|
|
677
681
|
setIndicator((previous) => {
|
|
678
682
|
const changedX = Math.abs(previous.x - nextX) > 0.5;
|
|
679
683
|
const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
|
|
@@ -693,13 +697,11 @@ function ArcTabsTailwind({
|
|
|
693
697
|
React2.useEffect(() => {
|
|
694
698
|
if (!showSlidingIndicator) return;
|
|
695
699
|
const listElement = listRef.current;
|
|
700
|
+
const listScrollElement = listScrollRef.current;
|
|
696
701
|
if (!listElement) return;
|
|
697
702
|
const onResize = () => {
|
|
698
703
|
syncIndicator();
|
|
699
704
|
};
|
|
700
|
-
const onScroll = () => {
|
|
701
|
-
syncIndicator();
|
|
702
|
-
};
|
|
703
705
|
const frame = requestAnimationFrame(syncIndicator);
|
|
704
706
|
let observer = null;
|
|
705
707
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -707,15 +709,16 @@ function ArcTabsTailwind({
|
|
|
707
709
|
syncIndicator();
|
|
708
710
|
});
|
|
709
711
|
observer.observe(listElement);
|
|
712
|
+
if (listScrollElement) {
|
|
713
|
+
observer.observe(listScrollElement);
|
|
714
|
+
}
|
|
710
715
|
tabRefs.current.forEach((tabElement) => {
|
|
711
716
|
if (tabElement) observer?.observe(tabElement);
|
|
712
717
|
});
|
|
713
718
|
}
|
|
714
|
-
listElement.addEventListener("scroll", onScroll, { passive: true });
|
|
715
719
|
window.addEventListener("resize", onResize);
|
|
716
720
|
return () => {
|
|
717
721
|
cancelAnimationFrame(frame);
|
|
718
|
-
listElement.removeEventListener("scroll", onScroll);
|
|
719
722
|
window.removeEventListener("resize", onResize);
|
|
720
723
|
observer?.disconnect();
|
|
721
724
|
};
|
|
@@ -839,7 +842,12 @@ function ArcTabsTailwind({
|
|
|
839
842
|
if (panelBorderColor) {
|
|
840
843
|
cssVars["--arc-panel-border"] = panelBorderColor;
|
|
841
844
|
}
|
|
845
|
+
cssVars["--arc-notch"] = "clamp(8px, calc(var(--arc-radius) * 0.75), 16px)";
|
|
842
846
|
cssVars["--arc-motion-duration"] = `${effectiveMotionDuration}ms`;
|
|
847
|
+
const isFirst = selectedIndex === 0;
|
|
848
|
+
const isLast = selectedIndex === items.length - 1;
|
|
849
|
+
cssVars["--arc-panel-tl-radius"] = isFirst ? "0px" : "var(--arc-radius)";
|
|
850
|
+
cssVars["--arc-panel-tr-radius"] = isLast ? "0px" : "var(--arc-radius)";
|
|
843
851
|
return cssVars;
|
|
844
852
|
}, [
|
|
845
853
|
style,
|
|
@@ -851,7 +859,9 @@ function ArcTabsTailwind({
|
|
|
851
859
|
tabHoverBackground,
|
|
852
860
|
panelBackground,
|
|
853
861
|
panelBorderColor,
|
|
854
|
-
effectiveMotionDuration
|
|
862
|
+
effectiveMotionDuration,
|
|
863
|
+
selectedIndex,
|
|
864
|
+
items.length
|
|
855
865
|
]);
|
|
856
866
|
const rootClassName = joinClassNames2(
|
|
857
867
|
"arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]",
|
|
@@ -859,12 +869,13 @@ function ArcTabsTailwind({
|
|
|
859
869
|
className
|
|
860
870
|
);
|
|
861
871
|
const listClassName = joinClassNames2(
|
|
862
|
-
"relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-
|
|
872
|
+
"relative m-0 flex min-w-full list-none items-end gap-[var(--arc-gap)] overflow-visible rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate",
|
|
863
873
|
classNames?.list,
|
|
864
874
|
tabsClassName
|
|
865
875
|
);
|
|
876
|
+
const listScrollClassName = "relative -mb-[var(--arc-notch)] overflow-x-auto overflow-y-visible pb-[var(--arc-notch)] [scrollbar-width:thin]";
|
|
866
877
|
const panelsClassName = joinClassNames2(
|
|
867
|
-
"relative z-[2] mt-0 rounded-
|
|
878
|
+
"relative z-[2] mt-0 rounded-bl-[var(--arc-radius)] rounded-br-[var(--arc-radius)] rounded-tl-[var(--arc-panel-tl-radius)] rounded-tr-[var(--arc-panel-tr-radius)] border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)] transition-[border-radius] duration-[var(--arc-motion-duration)] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
868
879
|
classNames?.panels,
|
|
869
880
|
panelClassName
|
|
870
881
|
);
|
|
@@ -896,7 +907,7 @@ function ArcTabsTailwind({
|
|
|
896
907
|
classNames?.indicator
|
|
897
908
|
);
|
|
898
909
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: rootClassName, style: themedStyle, "data-slot": "root", ...rest, children: [
|
|
899
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: listScrollRef, className: listScrollClassName, "data-slot": "list-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
900
911
|
"ul",
|
|
901
912
|
{
|
|
902
913
|
ref: listRef,
|
|
@@ -928,15 +939,13 @@ function ArcTabsTailwind({
|
|
|
928
939
|
classNames?.item
|
|
929
940
|
);
|
|
930
941
|
const tabClassName = joinClassNames2(
|
|
931
|
-
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-
|
|
942
|
+
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-notch)*-1)] before:h-[var(--arc-border-width)] before:w-[calc(100%+var(--arc-notch)*2)] before:translate-y-[var(--arc-gap)] before:bg-[var(--arc-panel-bg)] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:left-[calc(var(--arc-notch)*-1)] after:h-[calc(var(--arc-notch)+var(--arc-border-width))] after:w-[calc(100%+var(--arc-notch)*2)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_var(--arc-notch)_at_0%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_left_top/var(--arc-notch)_var(--arc-notch)_no-repeat,radial-gradient(circle_var(--arc-notch)_at_100%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_right_top/var(--arc-notch)_var(--arc-notch)_no-repeat,linear-gradient(var(--arc-panel-bg),_var(--arc-panel-bg))_center_top/calc(100%-var(--arc-notch)*2)_100%_no-repeat] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]",
|
|
932
943
|
sizeClassMap[size],
|
|
933
944
|
fit === "equal" && "w-full justify-center",
|
|
934
945
|
selected ? joinClassNames2(
|
|
935
|
-
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
946
|
+
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
936
947
|
motionPreset === "expressive" ? "bg-transparent" : "bg-[var(--arc-panel-bg)]"
|
|
937
948
|
) : "enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]",
|
|
938
|
-
selected && index > 0 && "before:opacity-100",
|
|
939
|
-
selected && index < items.length - 1 && "after:opacity-100",
|
|
940
949
|
selected ? classNames?.tabSelected : classNames?.tabUnselected,
|
|
941
950
|
disabled && classNames?.tabDisabled,
|
|
942
951
|
classNames?.tab
|
|
@@ -971,7 +980,7 @@ function ArcTabsTailwind({
|
|
|
971
980
|
})
|
|
972
981
|
]
|
|
973
982
|
}
|
|
974
|
-
),
|
|
983
|
+
) }),
|
|
975
984
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: panelsClassName, "data-slot": "panels", children: [
|
|
976
985
|
items.length === 0 && emptyState,
|
|
977
986
|
items.length > 0 && selectedItem === void 0 && emptyState,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ArcTabs.tsx","../src/ArcTabsTailwind.tsx"],"sourcesContent":["export { ArcTabs } from './ArcTabs'\nexport { ArcTabsTailwind } from './ArcTabsTailwind'\nexport type {\n ArcTabItem,\n ArcTabsActivationMode,\n ArcTabsFit,\n ArcTabsMotionPreset,\n ArcTabsProps,\n ArcTabsRenderState,\n ArcTabsSize,\n} from './ArcTabs'\nexport type { ArcTabsTailwindClassNames, ArcTabsTailwindProps } from './ArcTabsTailwind'\n","'use client'\n\nimport * as React from 'react'\n\nexport interface ArcTabItem {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n disabled?: boolean\n icon?: React.ReactNode\n badge?: React.ReactNode\n}\n\nexport type ArcTabsActivationMode = 'automatic' | 'manual'\nexport type ArcTabsSize = 'sm' | 'md' | 'lg'\nexport type ArcTabsFit = 'content' | 'equal'\nexport type ArcTabsMotionPreset = 'none' | 'subtle' | 'expressive'\n\nexport interface ArcTabsRenderState {\n index: number\n selected: boolean\n disabled: boolean\n}\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n items: ArcTabItem[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string, item: ArcTabItem, index: number) => void\n activationMode?: ArcTabsActivationMode\n keepMounted?: boolean\n size?: ArcTabsSize\n fit?: ArcTabsFit\n motionPreset?: ArcTabsMotionPreset\n motionDuration?: number\n ariaLabel?: string\n listId?: string\n tabsClassName?: string\n panelClassName?: string\n radius?: number\n gap?: number\n panelPadding?: number | string\n accentColor?: string\n tabBackground?: string\n tabHoverBackground?: string\n panelBackground?: string\n panelBorderColor?: string\n emptyState?: React.ReactNode\n renderTabLabel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n renderPanel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nexport function ArcTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n ...rest\n}: ArcTabsProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs',\n `arc-tabs--size-${size}`,\n `arc-tabs--fit-${fit}`,\n `arc-tabs--motion-${motionPreset}`,\n hasInteracted && 'arc-tabs--has-interacted',\n panelDirection !== 'none' && `arc-tabs--direction-${panelDirection}`,\n className,\n )\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? <span className=\"arc-tabs__icon\">{item.icon}</span> : null}\n <span className=\"arc-tabs__text\">{item.label}</span>\n {item.badge !== undefined ? <span className=\"arc-tabs__badge\">{item.badge}</span> : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n return (\n <div className={rootClassName} style={themedStyle} {...rest}>\n <ul\n ref={listRef}\n className={joinClassNames('arc-tabs__list', tabsClassName)}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={joinClassNames('arc-tabs__active-indicator', indicator.ready && 'is-ready')}\n style={indicatorStyle}\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n return (\n <li className=\"arc-tabs__item\" key={item.id} role=\"presentation\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className=\"arc-tabs__tab\"\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n\n <div className={joinClassNames('arc-tabs__panels', panelClassName)}>\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport * as React from 'react'\n\nimport type { ArcTabItem, ArcTabsProps, ArcTabsRenderState, ArcTabsSize } from './ArcTabs'\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsTailwindClassNames {\n root?: string\n list?: string\n indicator?: string\n item?: string\n tab?: string\n tabSelected?: string\n tabUnselected?: string\n tabDisabled?: string\n icon?: string\n text?: string\n badge?: string\n panels?: string\n panel?: string\n}\n\nexport interface ArcTabsTailwindProps extends ArcTabsProps {\n classNames?: ArcTabsTailwindClassNames\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nconst sizeClassMap: Record<ArcTabsSize, string> = {\n sm: 'min-h-9 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-4 py-2 text-[0.95rem]',\n lg: 'min-h-12 px-5 py-2.5 text-base',\n}\n\nexport function ArcTabsTailwind({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n classNames,\n ...rest\n}: ArcTabsTailwindProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]',\n classNames?.root,\n className,\n )\n\n const listClassName = joinClassNames(\n 'relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-x-auto overflow-y-clip rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate',\n classNames?.list,\n tabsClassName,\n )\n\n const panelsClassName = joinClassNames(\n 'relative z-[2] mt-0 rounded-b-[var(--arc-radius)] rounded-t-none border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)]',\n classNames?.panels,\n panelClassName,\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? (\n <span className={joinClassNames('inline-flex leading-none', classNames?.icon)}>\n {item.icon}\n </span>\n ) : null}\n <span className={joinClassNames('inline-block', classNames?.text)}>{item.label}</span>\n {item.badge !== undefined ? (\n <span\n className={joinClassNames(\n 'inline-flex min-w-5 items-center justify-center rounded-full bg-[var(--arc-accent)] px-1.5 py-0.5 text-[0.72em] font-bold text-white/95',\n classNames?.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const indicatorClassName = joinClassNames(\n 'pointer-events-none absolute left-0 top-0 z-[1] h-[calc(100%-var(--arc-gap))] w-[var(--arc-indicator-w)] translate-x-[var(--arc-indicator-x)] rounded-t-[var(--arc-radius)] rounded-b-none bg-[var(--arc-panel-bg)] opacity-0 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)] transition-[transform,width,opacity] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)]',\n indicator.ready && 'opacity-100',\n classNames?.indicator,\n )\n\n return (\n <div className={rootClassName} style={themedStyle} data-slot=\"root\" {...rest}>\n <ul\n ref={listRef}\n className={listClassName}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n data-slot=\"list\"\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={indicatorClassName}\n style={indicatorStyle}\n data-slot=\"indicator\"\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n const itemClassName = joinClassNames(\n fit === 'equal' ? 'relative z-[2] min-w-0 flex-1' : 'relative z-[2] shrink-0',\n classNames?.item,\n )\n\n const tabClassName = joinClassNames(\n \"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-radius)*-1)] before:h-[var(--arc-radius)] before:w-[var(--arc-radius)] before:translate-y-[var(--arc-gap)] before:bg-[radial-gradient(circle_at_100%_0,_transparent_calc(var(--arc-radius)-1px),_var(--arc-panel-bg)_var(--arc-radius))] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:right-[calc(var(--arc-radius)*-1)] after:h-[var(--arc-radius)] after:w-[var(--arc-radius)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_at_0_0,_transparent_calc(var(--arc-radius)-1px),_var(--arc-panel-bg)_var(--arc-radius))] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]',\n motionPreset === 'expressive' ? 'bg-transparent' : 'bg-[var(--arc-panel-bg)]',\n )\n : 'enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]',\n selected && index > 0 && 'before:opacity-100',\n selected && index < items.length - 1 && 'after:opacity-100',\n selected ? classNames?.tabSelected : classNames?.tabUnselected,\n disabled && classNames?.tabDisabled,\n classNames?.tab,\n )\n\n return (\n <li className={itemClassName} key={item.id} role=\"presentation\" data-slot=\"item\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className={tabClassName}\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n data-slot=\"tab\"\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n\n <div className={panelsClassName} data-slot=\"panels\">\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n data-slot=\"panel\"\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n data-slot=\"panel\"\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,YAAuB;AAuenB;AAnbJ,IAAM,iBAAiB,IAAI,UACzB,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AAEhC,IAAM,YAAY,CAAC,UACjB,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAE7C,IAAM,wBAAwB,CAAC,UAAwB,MAAM,UAAU,CAAC,SAAS,CAAC,KAAK,QAAQ;AAE/F,IAAM,oBAAoB,CAAC,UACzB,MAAM,OAAiB,CAAC,KAAK,MAAM,UAAU;AAC3C,MAAI,CAAC,KAAK,SAAU,KAAI,KAAK,KAAK;AAClC,SAAO;AACT,GAAG,CAAC,CAAC;AAEP,IAAM,sBAAsB,CAAC,gBAA0B,cAAsB,cAAsB;AACjG,MAAI,CAAC,eAAe,OAAQ,QAAO;AAEnC,QAAM,kBAAkB,eAAe,QAAQ,YAAY;AAC3D,MAAI,oBAAoB,IAAI;AAC1B,WAAO,cAAc,IAAK,eAAe,CAAC,KAAK,KAAO,eAAe,GAAG,EAAE,KAAK;AAAA,EACjF;AAEA,QAAM,gBAAgB,kBAAkB,YAAY,eAAe,UAAU,eAAe;AAC5F,SAAO,eAAe,YAAY,KAAK;AACzC;AAEO,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,OAAO;AAAA,EACP,MAAM;AAAA,EACN,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,YAAY;AAA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AA,UACb,aAAU;AAAA,UAET,6BAAmB,cAAc;AAAA,YAChC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,UAAU,QAAQ,aAAa,QAAQ;AAAA,UACzC,CAAC;AAAA;AAAA,MACH,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":["React","import_jsx_runtime","joinClassNames","toCssSize","findFirstEnabledIndex","getEnabledIndices","getNextEnabledIndex"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/ArcTabs.tsx","../src/ArcTabsTailwind.tsx"],"sourcesContent":["export { ArcTabs } from './ArcTabs'\nexport { ArcTabsTailwind } from './ArcTabsTailwind'\nexport type {\n ArcTabItem,\n ArcTabsActivationMode,\n ArcTabsFit,\n ArcTabsMotionPreset,\n ArcTabsProps,\n ArcTabsRenderState,\n ArcTabsSize,\n} from './ArcTabs'\nexport type { ArcTabsTailwindClassNames, ArcTabsTailwindProps } from './ArcTabsTailwind'\n","'use client'\n\nimport * as React from 'react'\n\nexport interface ArcTabItem {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n disabled?: boolean\n icon?: React.ReactNode\n badge?: React.ReactNode\n}\n\nexport type ArcTabsActivationMode = 'automatic' | 'manual'\nexport type ArcTabsSize = 'sm' | 'md' | 'lg'\nexport type ArcTabsFit = 'content' | 'equal'\nexport type ArcTabsMotionPreset = 'none' | 'subtle' | 'expressive'\n\nexport interface ArcTabsRenderState {\n index: number\n selected: boolean\n disabled: boolean\n}\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n items: ArcTabItem[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string, item: ArcTabItem, index: number) => void\n activationMode?: ArcTabsActivationMode\n keepMounted?: boolean\n size?: ArcTabsSize\n fit?: ArcTabsFit\n motionPreset?: ArcTabsMotionPreset\n motionDuration?: number\n ariaLabel?: string\n listId?: string\n tabsClassName?: string\n panelClassName?: string\n radius?: number\n gap?: number\n panelPadding?: number | string\n accentColor?: string\n tabBackground?: string\n tabHoverBackground?: string\n panelBackground?: string\n panelBorderColor?: string\n emptyState?: React.ReactNode\n renderTabLabel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n renderPanel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nexport function ArcTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n ...rest\n}: ArcTabsProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listScrollRef = React.useRef<HTMLDivElement | null>(null)\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n const listElement = listRef.current\n\n if (!listElement || !selectedTab) return\n\n const nextX = selectedTab.offsetLeft\n const nextWidth = selectedTab.offsetWidth\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n const listScrollElement = listScrollRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n if (listScrollElement) {\n observer.observe(listScrollElement)\n }\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-notch'] = 'clamp(8px, calc(var(--arc-radius) * 0.75), 16px)'\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n /* Panel top-corner rounding: when the active tab is NOT at the edge,\n the panel corner on that side gets a radius for a smoother visual connection */\n const isFirst = selectedIndex === 0\n const isLast = selectedIndex === items.length - 1\n cssVars['--arc-panel-tl-radius'] = isFirst ? '0px' : 'var(--arc-radius)'\n cssVars['--arc-panel-tr-radius'] = isLast ? '0px' : 'var(--arc-radius)'\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n selectedIndex,\n items.length,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs',\n `arc-tabs--size-${size}`,\n `arc-tabs--fit-${fit}`,\n `arc-tabs--motion-${motionPreset}`,\n hasInteracted && 'arc-tabs--has-interacted',\n panelDirection !== 'none' && `arc-tabs--direction-${panelDirection}`,\n className,\n )\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? <span className=\"arc-tabs__icon\">{item.icon}</span> : null}\n <span className=\"arc-tabs__text\">{item.label}</span>\n {item.badge !== undefined ? <span className=\"arc-tabs__badge\">{item.badge}</span> : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n return (\n <div className={rootClassName} style={themedStyle} {...rest}>\n <div ref={listScrollRef} className=\"arc-tabs__list-scroll\">\n <ul\n ref={listRef}\n className={joinClassNames('arc-tabs__list', tabsClassName)}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={joinClassNames('arc-tabs__active-indicator', indicator.ready && 'is-ready')}\n style={indicatorStyle}\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n return (\n <li className=\"arc-tabs__item\" key={item.id} role=\"presentation\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className=\"arc-tabs__tab\"\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n </div>\n\n <div className={joinClassNames('arc-tabs__panels', panelClassName)}>\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport * as React from 'react'\n\nimport type { ArcTabItem, ArcTabsProps, ArcTabsRenderState, ArcTabsSize } from './ArcTabs'\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsTailwindClassNames {\n root?: string\n list?: string\n indicator?: string\n item?: string\n tab?: string\n tabSelected?: string\n tabUnselected?: string\n tabDisabled?: string\n icon?: string\n text?: string\n badge?: string\n panels?: string\n panel?: string\n}\n\nexport interface ArcTabsTailwindProps extends ArcTabsProps {\n classNames?: ArcTabsTailwindClassNames\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nconst sizeClassMap: Record<ArcTabsSize, string> = {\n sm: 'min-h-9 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-4 py-2 text-[0.95rem]',\n lg: 'min-h-12 px-5 py-2.5 text-base',\n}\n\nexport function ArcTabsTailwind({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n classNames,\n ...rest\n}: ArcTabsTailwindProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listScrollRef = React.useRef<HTMLDivElement | null>(null)\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n const listElement = listRef.current\n\n if (!listElement || !selectedTab) return\n\n const nextX = selectedTab.offsetLeft\n const nextWidth = selectedTab.offsetWidth\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n const listScrollElement = listScrollRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n if (listScrollElement) {\n observer.observe(listScrollElement)\n }\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-notch'] = 'clamp(8px, calc(var(--arc-radius) * 0.75), 16px)'\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n const isFirst = selectedIndex === 0\n const isLast = selectedIndex === items.length - 1\n cssVars['--arc-panel-tl-radius'] = isFirst ? '0px' : 'var(--arc-radius)'\n cssVars['--arc-panel-tr-radius'] = isLast ? '0px' : 'var(--arc-radius)'\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n selectedIndex,\n items.length,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]',\n classNames?.root,\n className,\n )\n\n const listClassName = joinClassNames(\n 'relative m-0 flex min-w-full list-none items-end gap-[var(--arc-gap)] overflow-visible rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate',\n classNames?.list,\n tabsClassName,\n )\n\n const listScrollClassName =\n 'relative -mb-[var(--arc-notch)] overflow-x-auto overflow-y-visible pb-[var(--arc-notch)] [scrollbar-width:thin]'\n\n const panelsClassName = joinClassNames(\n 'relative z-[2] mt-0 rounded-bl-[var(--arc-radius)] rounded-br-[var(--arc-radius)] rounded-tl-[var(--arc-panel-tl-radius)] rounded-tr-[var(--arc-panel-tr-radius)] border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)] transition-[border-radius] duration-[var(--arc-motion-duration)] ease-[cubic-bezier(0.22,1,0.36,1)]',\n classNames?.panels,\n panelClassName,\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? (\n <span className={joinClassNames('inline-flex leading-none', classNames?.icon)}>\n {item.icon}\n </span>\n ) : null}\n <span className={joinClassNames('inline-block', classNames?.text)}>{item.label}</span>\n {item.badge !== undefined ? (\n <span\n className={joinClassNames(\n 'inline-flex min-w-5 items-center justify-center rounded-full bg-[var(--arc-accent)] px-1.5 py-0.5 text-[0.72em] font-bold text-white/95',\n classNames?.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const indicatorClassName = joinClassNames(\n 'pointer-events-none absolute left-0 top-0 z-[1] h-[calc(100%-var(--arc-gap))] w-[var(--arc-indicator-w)] translate-x-[var(--arc-indicator-x)] rounded-t-[var(--arc-radius)] rounded-b-none bg-[var(--arc-panel-bg)] opacity-0 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)] transition-[transform,width,opacity] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)]',\n indicator.ready && 'opacity-100',\n classNames?.indicator,\n )\n\n return (\n <div className={rootClassName} style={themedStyle} data-slot=\"root\" {...rest}>\n <div ref={listScrollRef} className={listScrollClassName} data-slot=\"list-scroll\">\n <ul\n ref={listRef}\n className={listClassName}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n data-slot=\"list\"\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={indicatorClassName}\n style={indicatorStyle}\n data-slot=\"indicator\"\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n const itemClassName = joinClassNames(\n fit === 'equal' ? 'relative z-[2] min-w-0 flex-1' : 'relative z-[2] shrink-0',\n classNames?.item,\n )\n\n const tabClassName = joinClassNames(\n \"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-notch)*-1)] before:h-[var(--arc-border-width)] before:w-[calc(100%+var(--arc-notch)*2)] before:translate-y-[var(--arc-gap)] before:bg-[var(--arc-panel-bg)] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:left-[calc(var(--arc-notch)*-1)] after:h-[calc(var(--arc-notch)+var(--arc-border-width))] after:w-[calc(100%+var(--arc-notch)*2)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_var(--arc-notch)_at_0%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_left_top/var(--arc-notch)_var(--arc-notch)_no-repeat,radial-gradient(circle_var(--arc-notch)_at_100%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_right_top/var(--arc-notch)_var(--arc-notch)_no-repeat,linear-gradient(var(--arc-panel-bg),_var(--arc-panel-bg))_center_top/calc(100%-var(--arc-notch)*2)_100%_no-repeat] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]',\n motionPreset === 'expressive' ? 'bg-transparent' : 'bg-[var(--arc-panel-bg)]',\n )\n : 'enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]',\n selected ? classNames?.tabSelected : classNames?.tabUnselected,\n disabled && classNames?.tabDisabled,\n classNames?.tab,\n )\n\n return (\n <li className={itemClassName} key={item.id} role=\"presentation\" data-slot=\"item\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className={tabClassName}\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n data-slot=\"tab\"\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n </div>\n\n <div className={panelsClassName} data-slot=\"panels\">\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n data-slot=\"panel\"\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n data-slot=\"panel\"\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;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B,cAAc;AAAA,YAChC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,UAAU,QAAQ,aAAa,QAAQ;AAAA,UACzC,CAAC;AAAA;AAAA,MACH,IACE;AAAA,OACN;AAAA,KACF;AAEJ;","names":["React","import_jsx_runtime","joinClassNames","toCssSize","findFirstEnabledIndex","getEnabledIndices","getNextEnabledIndex"]}
|
package/dist/index.js
CHANGED
|
@@ -89,6 +89,7 @@ function ArcTabs({
|
|
|
89
89
|
}, [focusedIndex, selectedIndex, items]);
|
|
90
90
|
const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items]);
|
|
91
91
|
const tabRefs = React.useRef([]);
|
|
92
|
+
const listScrollRef = React.useRef(null);
|
|
92
93
|
const listRef = React.useRef(null);
|
|
93
94
|
const activePanelRef = React.useRef(null);
|
|
94
95
|
const hasMountedRef = React.useRef(false);
|
|
@@ -154,13 +155,11 @@ function ArcTabs({
|
|
|
154
155
|
);
|
|
155
156
|
return;
|
|
156
157
|
}
|
|
157
|
-
const listElement = listRef.current;
|
|
158
158
|
const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
|
|
159
|
+
const listElement = listRef.current;
|
|
159
160
|
if (!listElement || !selectedTab) return;
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
|
|
163
|
-
const nextWidth = tabRect.width;
|
|
161
|
+
const nextX = selectedTab.offsetLeft;
|
|
162
|
+
const nextWidth = selectedTab.offsetWidth;
|
|
164
163
|
setIndicator((previous) => {
|
|
165
164
|
const changedX = Math.abs(previous.x - nextX) > 0.5;
|
|
166
165
|
const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
|
|
@@ -180,13 +179,11 @@ function ArcTabs({
|
|
|
180
179
|
React.useEffect(() => {
|
|
181
180
|
if (!showSlidingIndicator) return;
|
|
182
181
|
const listElement = listRef.current;
|
|
182
|
+
const listScrollElement = listScrollRef.current;
|
|
183
183
|
if (!listElement) return;
|
|
184
184
|
const onResize = () => {
|
|
185
185
|
syncIndicator();
|
|
186
186
|
};
|
|
187
|
-
const onScroll = () => {
|
|
188
|
-
syncIndicator();
|
|
189
|
-
};
|
|
190
187
|
const frame = requestAnimationFrame(syncIndicator);
|
|
191
188
|
let observer = null;
|
|
192
189
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -194,15 +191,16 @@ function ArcTabs({
|
|
|
194
191
|
syncIndicator();
|
|
195
192
|
});
|
|
196
193
|
observer.observe(listElement);
|
|
194
|
+
if (listScrollElement) {
|
|
195
|
+
observer.observe(listScrollElement);
|
|
196
|
+
}
|
|
197
197
|
tabRefs.current.forEach((tabElement) => {
|
|
198
198
|
if (tabElement) observer?.observe(tabElement);
|
|
199
199
|
});
|
|
200
200
|
}
|
|
201
|
-
listElement.addEventListener("scroll", onScroll, { passive: true });
|
|
202
201
|
window.addEventListener("resize", onResize);
|
|
203
202
|
return () => {
|
|
204
203
|
cancelAnimationFrame(frame);
|
|
205
|
-
listElement.removeEventListener("scroll", onScroll);
|
|
206
204
|
window.removeEventListener("resize", onResize);
|
|
207
205
|
observer?.disconnect();
|
|
208
206
|
};
|
|
@@ -326,7 +324,12 @@ function ArcTabs({
|
|
|
326
324
|
if (panelBorderColor) {
|
|
327
325
|
cssVars["--arc-panel-border"] = panelBorderColor;
|
|
328
326
|
}
|
|
327
|
+
cssVars["--arc-notch"] = "clamp(8px, calc(var(--arc-radius) * 0.75), 16px)";
|
|
329
328
|
cssVars["--arc-motion-duration"] = `${effectiveMotionDuration}ms`;
|
|
329
|
+
const isFirst = selectedIndex === 0;
|
|
330
|
+
const isLast = selectedIndex === items.length - 1;
|
|
331
|
+
cssVars["--arc-panel-tl-radius"] = isFirst ? "0px" : "var(--arc-radius)";
|
|
332
|
+
cssVars["--arc-panel-tr-radius"] = isLast ? "0px" : "var(--arc-radius)";
|
|
330
333
|
return cssVars;
|
|
331
334
|
}, [
|
|
332
335
|
style,
|
|
@@ -338,7 +341,9 @@ function ArcTabs({
|
|
|
338
341
|
tabHoverBackground,
|
|
339
342
|
panelBackground,
|
|
340
343
|
panelBorderColor,
|
|
341
|
-
effectiveMotionDuration
|
|
344
|
+
effectiveMotionDuration,
|
|
345
|
+
selectedIndex,
|
|
346
|
+
items.length
|
|
342
347
|
]);
|
|
343
348
|
const rootClassName = joinClassNames(
|
|
344
349
|
"arc-tabs",
|
|
@@ -363,7 +368,7 @@ function ArcTabs({
|
|
|
363
368
|
] });
|
|
364
369
|
const renderPanelContent = (item, state) => renderPanel ? renderPanel(item, state) : item.content;
|
|
365
370
|
return /* @__PURE__ */ jsxs("div", { className: rootClassName, style: themedStyle, ...rest, children: [
|
|
366
|
-
/* @__PURE__ */ jsxs(
|
|
371
|
+
/* @__PURE__ */ jsx("div", { ref: listScrollRef, className: "arc-tabs__list-scroll", children: /* @__PURE__ */ jsxs(
|
|
367
372
|
"ul",
|
|
368
373
|
{
|
|
369
374
|
ref: listRef,
|
|
@@ -417,7 +422,7 @@ function ArcTabs({
|
|
|
417
422
|
})
|
|
418
423
|
]
|
|
419
424
|
}
|
|
420
|
-
),
|
|
425
|
+
) }),
|
|
421
426
|
/* @__PURE__ */ jsxs("div", { className: joinClassNames("arc-tabs__panels", panelClassName), children: [
|
|
422
427
|
items.length === 0 && emptyState,
|
|
423
428
|
items.length > 0 && selectedItem === void 0 && emptyState,
|
|
@@ -565,6 +570,7 @@ function ArcTabsTailwind({
|
|
|
565
570
|
}, [focusedIndex, selectedIndex, items]);
|
|
566
571
|
const enabledIndices = React2.useMemo(() => getEnabledIndices2(items), [items]);
|
|
567
572
|
const tabRefs = React2.useRef([]);
|
|
573
|
+
const listScrollRef = React2.useRef(null);
|
|
568
574
|
const listRef = React2.useRef(null);
|
|
569
575
|
const activePanelRef = React2.useRef(null);
|
|
570
576
|
const hasMountedRef = React2.useRef(false);
|
|
@@ -630,13 +636,11 @@ function ArcTabsTailwind({
|
|
|
630
636
|
);
|
|
631
637
|
return;
|
|
632
638
|
}
|
|
633
|
-
const listElement = listRef.current;
|
|
634
639
|
const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
|
|
640
|
+
const listElement = listRef.current;
|
|
635
641
|
if (!listElement || !selectedTab) return;
|
|
636
|
-
const
|
|
637
|
-
const
|
|
638
|
-
const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
|
|
639
|
-
const nextWidth = tabRect.width;
|
|
642
|
+
const nextX = selectedTab.offsetLeft;
|
|
643
|
+
const nextWidth = selectedTab.offsetWidth;
|
|
640
644
|
setIndicator((previous) => {
|
|
641
645
|
const changedX = Math.abs(previous.x - nextX) > 0.5;
|
|
642
646
|
const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
|
|
@@ -656,13 +660,11 @@ function ArcTabsTailwind({
|
|
|
656
660
|
React2.useEffect(() => {
|
|
657
661
|
if (!showSlidingIndicator) return;
|
|
658
662
|
const listElement = listRef.current;
|
|
663
|
+
const listScrollElement = listScrollRef.current;
|
|
659
664
|
if (!listElement) return;
|
|
660
665
|
const onResize = () => {
|
|
661
666
|
syncIndicator();
|
|
662
667
|
};
|
|
663
|
-
const onScroll = () => {
|
|
664
|
-
syncIndicator();
|
|
665
|
-
};
|
|
666
668
|
const frame = requestAnimationFrame(syncIndicator);
|
|
667
669
|
let observer = null;
|
|
668
670
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -670,15 +672,16 @@ function ArcTabsTailwind({
|
|
|
670
672
|
syncIndicator();
|
|
671
673
|
});
|
|
672
674
|
observer.observe(listElement);
|
|
675
|
+
if (listScrollElement) {
|
|
676
|
+
observer.observe(listScrollElement);
|
|
677
|
+
}
|
|
673
678
|
tabRefs.current.forEach((tabElement) => {
|
|
674
679
|
if (tabElement) observer?.observe(tabElement);
|
|
675
680
|
});
|
|
676
681
|
}
|
|
677
|
-
listElement.addEventListener("scroll", onScroll, { passive: true });
|
|
678
682
|
window.addEventListener("resize", onResize);
|
|
679
683
|
return () => {
|
|
680
684
|
cancelAnimationFrame(frame);
|
|
681
|
-
listElement.removeEventListener("scroll", onScroll);
|
|
682
685
|
window.removeEventListener("resize", onResize);
|
|
683
686
|
observer?.disconnect();
|
|
684
687
|
};
|
|
@@ -802,7 +805,12 @@ function ArcTabsTailwind({
|
|
|
802
805
|
if (panelBorderColor) {
|
|
803
806
|
cssVars["--arc-panel-border"] = panelBorderColor;
|
|
804
807
|
}
|
|
808
|
+
cssVars["--arc-notch"] = "clamp(8px, calc(var(--arc-radius) * 0.75), 16px)";
|
|
805
809
|
cssVars["--arc-motion-duration"] = `${effectiveMotionDuration}ms`;
|
|
810
|
+
const isFirst = selectedIndex === 0;
|
|
811
|
+
const isLast = selectedIndex === items.length - 1;
|
|
812
|
+
cssVars["--arc-panel-tl-radius"] = isFirst ? "0px" : "var(--arc-radius)";
|
|
813
|
+
cssVars["--arc-panel-tr-radius"] = isLast ? "0px" : "var(--arc-radius)";
|
|
806
814
|
return cssVars;
|
|
807
815
|
}, [
|
|
808
816
|
style,
|
|
@@ -814,7 +822,9 @@ function ArcTabsTailwind({
|
|
|
814
822
|
tabHoverBackground,
|
|
815
823
|
panelBackground,
|
|
816
824
|
panelBorderColor,
|
|
817
|
-
effectiveMotionDuration
|
|
825
|
+
effectiveMotionDuration,
|
|
826
|
+
selectedIndex,
|
|
827
|
+
items.length
|
|
818
828
|
]);
|
|
819
829
|
const rootClassName = joinClassNames2(
|
|
820
830
|
"arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]",
|
|
@@ -822,12 +832,13 @@ function ArcTabsTailwind({
|
|
|
822
832
|
className
|
|
823
833
|
);
|
|
824
834
|
const listClassName = joinClassNames2(
|
|
825
|
-
"relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-
|
|
835
|
+
"relative m-0 flex min-w-full list-none items-end gap-[var(--arc-gap)] overflow-visible rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate",
|
|
826
836
|
classNames?.list,
|
|
827
837
|
tabsClassName
|
|
828
838
|
);
|
|
839
|
+
const listScrollClassName = "relative -mb-[var(--arc-notch)] overflow-x-auto overflow-y-visible pb-[var(--arc-notch)] [scrollbar-width:thin]";
|
|
829
840
|
const panelsClassName = joinClassNames2(
|
|
830
|
-
"relative z-[2] mt-0 rounded-
|
|
841
|
+
"relative z-[2] mt-0 rounded-bl-[var(--arc-radius)] rounded-br-[var(--arc-radius)] rounded-tl-[var(--arc-panel-tl-radius)] rounded-tr-[var(--arc-panel-tr-radius)] border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)] transition-[border-radius] duration-[var(--arc-motion-duration)] ease-[cubic-bezier(0.22,1,0.36,1)]",
|
|
831
842
|
classNames?.panels,
|
|
832
843
|
panelClassName
|
|
833
844
|
);
|
|
@@ -859,7 +870,7 @@ function ArcTabsTailwind({
|
|
|
859
870
|
classNames?.indicator
|
|
860
871
|
);
|
|
861
872
|
return /* @__PURE__ */ jsxs2("div", { className: rootClassName, style: themedStyle, "data-slot": "root", ...rest, children: [
|
|
862
|
-
/* @__PURE__ */ jsxs2(
|
|
873
|
+
/* @__PURE__ */ jsx2("div", { ref: listScrollRef, className: listScrollClassName, "data-slot": "list-scroll", children: /* @__PURE__ */ jsxs2(
|
|
863
874
|
"ul",
|
|
864
875
|
{
|
|
865
876
|
ref: listRef,
|
|
@@ -891,15 +902,13 @@ function ArcTabsTailwind({
|
|
|
891
902
|
classNames?.item
|
|
892
903
|
);
|
|
893
904
|
const tabClassName = joinClassNames2(
|
|
894
|
-
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-
|
|
905
|
+
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-notch)*-1)] before:h-[var(--arc-border-width)] before:w-[calc(100%+var(--arc-notch)*2)] before:translate-y-[var(--arc-gap)] before:bg-[var(--arc-panel-bg)] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:left-[calc(var(--arc-notch)*-1)] after:h-[calc(var(--arc-notch)+var(--arc-border-width))] after:w-[calc(100%+var(--arc-notch)*2)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_var(--arc-notch)_at_0%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_left_top/var(--arc-notch)_var(--arc-notch)_no-repeat,radial-gradient(circle_var(--arc-notch)_at_100%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_right_top/var(--arc-notch)_var(--arc-notch)_no-repeat,linear-gradient(var(--arc-panel-bg),_var(--arc-panel-bg))_center_top/calc(100%-var(--arc-notch)*2)_100%_no-repeat] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]",
|
|
895
906
|
sizeClassMap[size],
|
|
896
907
|
fit === "equal" && "w-full justify-center",
|
|
897
908
|
selected ? joinClassNames2(
|
|
898
|
-
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
909
|
+
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
899
910
|
motionPreset === "expressive" ? "bg-transparent" : "bg-[var(--arc-panel-bg)]"
|
|
900
911
|
) : "enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]",
|
|
901
|
-
selected && index > 0 && "before:opacity-100",
|
|
902
|
-
selected && index < items.length - 1 && "after:opacity-100",
|
|
903
912
|
selected ? classNames?.tabSelected : classNames?.tabUnselected,
|
|
904
913
|
disabled && classNames?.tabDisabled,
|
|
905
914
|
classNames?.tab
|
|
@@ -934,7 +943,7 @@ function ArcTabsTailwind({
|
|
|
934
943
|
})
|
|
935
944
|
]
|
|
936
945
|
}
|
|
937
|
-
),
|
|
946
|
+
) }),
|
|
938
947
|
/* @__PURE__ */ jsxs2("div", { className: panelsClassName, "data-slot": "panels", children: [
|
|
939
948
|
items.length === 0 && emptyState,
|
|
940
949
|
items.length > 0 && selectedItem === void 0 && emptyState,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ArcTabs.tsx","../src/ArcTabsTailwind.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nexport interface ArcTabItem {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n disabled?: boolean\n icon?: React.ReactNode\n badge?: React.ReactNode\n}\n\nexport type ArcTabsActivationMode = 'automatic' | 'manual'\nexport type ArcTabsSize = 'sm' | 'md' | 'lg'\nexport type ArcTabsFit = 'content' | 'equal'\nexport type ArcTabsMotionPreset = 'none' | 'subtle' | 'expressive'\n\nexport interface ArcTabsRenderState {\n index: number\n selected: boolean\n disabled: boolean\n}\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n items: ArcTabItem[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string, item: ArcTabItem, index: number) => void\n activationMode?: ArcTabsActivationMode\n keepMounted?: boolean\n size?: ArcTabsSize\n fit?: ArcTabsFit\n motionPreset?: ArcTabsMotionPreset\n motionDuration?: number\n ariaLabel?: string\n listId?: string\n tabsClassName?: string\n panelClassName?: string\n radius?: number\n gap?: number\n panelPadding?: number | string\n accentColor?: string\n tabBackground?: string\n tabHoverBackground?: string\n panelBackground?: string\n panelBorderColor?: string\n emptyState?: React.ReactNode\n renderTabLabel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n renderPanel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nexport function ArcTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n ...rest\n}: ArcTabsProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs',\n `arc-tabs--size-${size}`,\n `arc-tabs--fit-${fit}`,\n `arc-tabs--motion-${motionPreset}`,\n hasInteracted && 'arc-tabs--has-interacted',\n panelDirection !== 'none' && `arc-tabs--direction-${panelDirection}`,\n className,\n )\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? <span className=\"arc-tabs__icon\">{item.icon}</span> : null}\n <span className=\"arc-tabs__text\">{item.label}</span>\n {item.badge !== undefined ? <span className=\"arc-tabs__badge\">{item.badge}</span> : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n return (\n <div className={rootClassName} style={themedStyle} {...rest}>\n <ul\n ref={listRef}\n className={joinClassNames('arc-tabs__list', tabsClassName)}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={joinClassNames('arc-tabs__active-indicator', indicator.ready && 'is-ready')}\n style={indicatorStyle}\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n return (\n <li className=\"arc-tabs__item\" key={item.id} role=\"presentation\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className=\"arc-tabs__tab\"\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n\n <div className={joinClassNames('arc-tabs__panels', panelClassName)}>\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport * as React from 'react'\n\nimport type { ArcTabItem, ArcTabsProps, ArcTabsRenderState, ArcTabsSize } from './ArcTabs'\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsTailwindClassNames {\n root?: string\n list?: string\n indicator?: string\n item?: string\n tab?: string\n tabSelected?: string\n tabUnselected?: string\n tabDisabled?: string\n icon?: string\n text?: string\n badge?: string\n panels?: string\n panel?: string\n}\n\nexport interface ArcTabsTailwindProps extends ArcTabsProps {\n classNames?: ArcTabsTailwindClassNames\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nconst sizeClassMap: Record<ArcTabsSize, string> = {\n sm: 'min-h-9 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-4 py-2 text-[0.95rem]',\n lg: 'min-h-12 px-5 py-2.5 text-base',\n}\n\nexport function ArcTabsTailwind({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n classNames,\n ...rest\n}: ArcTabsTailwindProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]',\n classNames?.root,\n className,\n )\n\n const listClassName = joinClassNames(\n 'relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-x-auto overflow-y-clip rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate',\n classNames?.list,\n tabsClassName,\n )\n\n const panelsClassName = joinClassNames(\n 'relative z-[2] mt-0 rounded-b-[var(--arc-radius)] rounded-t-none border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)]',\n classNames?.panels,\n panelClassName,\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? (\n <span className={joinClassNames('inline-flex leading-none', classNames?.icon)}>\n {item.icon}\n </span>\n ) : null}\n <span className={joinClassNames('inline-block', classNames?.text)}>{item.label}</span>\n {item.badge !== undefined ? (\n <span\n className={joinClassNames(\n 'inline-flex min-w-5 items-center justify-center rounded-full bg-[var(--arc-accent)] px-1.5 py-0.5 text-[0.72em] font-bold text-white/95',\n classNames?.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const indicatorClassName = joinClassNames(\n 'pointer-events-none absolute left-0 top-0 z-[1] h-[calc(100%-var(--arc-gap))] w-[var(--arc-indicator-w)] translate-x-[var(--arc-indicator-x)] rounded-t-[var(--arc-radius)] rounded-b-none bg-[var(--arc-panel-bg)] opacity-0 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)] transition-[transform,width,opacity] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)]',\n indicator.ready && 'opacity-100',\n classNames?.indicator,\n )\n\n return (\n <div className={rootClassName} style={themedStyle} data-slot=\"root\" {...rest}>\n <ul\n ref={listRef}\n className={listClassName}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n data-slot=\"list\"\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={indicatorClassName}\n style={indicatorStyle}\n data-slot=\"indicator\"\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n const itemClassName = joinClassNames(\n fit === 'equal' ? 'relative z-[2] min-w-0 flex-1' : 'relative z-[2] shrink-0',\n classNames?.item,\n )\n\n const tabClassName = joinClassNames(\n \"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-radius)*-1)] before:h-[var(--arc-radius)] before:w-[var(--arc-radius)] before:translate-y-[var(--arc-gap)] before:bg-[radial-gradient(circle_at_100%_0,_transparent_calc(var(--arc-radius)-1px),_var(--arc-panel-bg)_var(--arc-radius))] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:right-[calc(var(--arc-radius)*-1)] after:h-[var(--arc-radius)] after:w-[var(--arc-radius)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_at_0_0,_transparent_calc(var(--arc-radius)-1px),_var(--arc-panel-bg)_var(--arc-radius))] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]',\n motionPreset === 'expressive' ? 'bg-transparent' : 'bg-[var(--arc-panel-bg)]',\n )\n : 'enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]',\n selected && index > 0 && 'before:opacity-100',\n selected && index < items.length - 1 && 'after:opacity-100',\n selected ? classNames?.tabSelected : classNames?.tabUnselected,\n disabled && classNames?.tabDisabled,\n classNames?.tab,\n )\n\n return (\n <li className={itemClassName} key={item.id} role=\"presentation\" data-slot=\"item\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className={tabClassName}\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n data-slot=\"tab\"\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n\n <div className={panelsClassName} data-slot=\"panels\">\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n data-slot=\"panel\"\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n data-slot=\"panel\"\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n"],"mappings":";AAEA,YA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EJ;","names":["React","Fragment","jsx","jsxs","joinClassNames","toCssSize","findFirstEnabledIndex","getEnabledIndices","getNextEnabledIndex"]}
|
|
1
|
+
{"version":3,"sources":["../src/ArcTabs.tsx","../src/ArcTabsTailwind.tsx"],"sourcesContent":["'use client'\n\nimport * as React from 'react'\n\nexport interface ArcTabItem {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n disabled?: boolean\n icon?: React.ReactNode\n badge?: React.ReactNode\n}\n\nexport type ArcTabsActivationMode = 'automatic' | 'manual'\nexport type ArcTabsSize = 'sm' | 'md' | 'lg'\nexport type ArcTabsFit = 'content' | 'equal'\nexport type ArcTabsMotionPreset = 'none' | 'subtle' | 'expressive'\n\nexport interface ArcTabsRenderState {\n index: number\n selected: boolean\n disabled: boolean\n}\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n items: ArcTabItem[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string, item: ArcTabItem, index: number) => void\n activationMode?: ArcTabsActivationMode\n keepMounted?: boolean\n size?: ArcTabsSize\n fit?: ArcTabsFit\n motionPreset?: ArcTabsMotionPreset\n motionDuration?: number\n ariaLabel?: string\n listId?: string\n tabsClassName?: string\n panelClassName?: string\n radius?: number\n gap?: number\n panelPadding?: number | string\n accentColor?: string\n tabBackground?: string\n tabHoverBackground?: string\n panelBackground?: string\n panelBorderColor?: string\n emptyState?: React.ReactNode\n renderTabLabel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n renderPanel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nexport function ArcTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n ...rest\n}: ArcTabsProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listScrollRef = React.useRef<HTMLDivElement | null>(null)\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n const listElement = listRef.current\n\n if (!listElement || !selectedTab) return\n\n const nextX = selectedTab.offsetLeft\n const nextWidth = selectedTab.offsetWidth\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n const listScrollElement = listScrollRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n if (listScrollElement) {\n observer.observe(listScrollElement)\n }\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-notch'] = 'clamp(8px, calc(var(--arc-radius) * 0.75), 16px)'\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n /* Panel top-corner rounding: when the active tab is NOT at the edge,\n the panel corner on that side gets a radius for a smoother visual connection */\n const isFirst = selectedIndex === 0\n const isLast = selectedIndex === items.length - 1\n cssVars['--arc-panel-tl-radius'] = isFirst ? '0px' : 'var(--arc-radius)'\n cssVars['--arc-panel-tr-radius'] = isLast ? '0px' : 'var(--arc-radius)'\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n selectedIndex,\n items.length,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs',\n `arc-tabs--size-${size}`,\n `arc-tabs--fit-${fit}`,\n `arc-tabs--motion-${motionPreset}`,\n hasInteracted && 'arc-tabs--has-interacted',\n panelDirection !== 'none' && `arc-tabs--direction-${panelDirection}`,\n className,\n )\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? <span className=\"arc-tabs__icon\">{item.icon}</span> : null}\n <span className=\"arc-tabs__text\">{item.label}</span>\n {item.badge !== undefined ? <span className=\"arc-tabs__badge\">{item.badge}</span> : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n return (\n <div className={rootClassName} style={themedStyle} {...rest}>\n <div ref={listScrollRef} className=\"arc-tabs__list-scroll\">\n <ul\n ref={listRef}\n className={joinClassNames('arc-tabs__list', tabsClassName)}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={joinClassNames('arc-tabs__active-indicator', indicator.ready && 'is-ready')}\n style={indicatorStyle}\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n return (\n <li className=\"arc-tabs__item\" key={item.id} role=\"presentation\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className=\"arc-tabs__tab\"\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n </div>\n\n <div className={joinClassNames('arc-tabs__panels', panelClassName)}>\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport * as React from 'react'\n\nimport type { ArcTabItem, ArcTabsProps, ArcTabsRenderState, ArcTabsSize } from './ArcTabs'\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsTailwindClassNames {\n root?: string\n list?: string\n indicator?: string\n item?: string\n tab?: string\n tabSelected?: string\n tabUnselected?: string\n tabDisabled?: string\n icon?: string\n text?: string\n badge?: string\n panels?: string\n panel?: string\n}\n\nexport interface ArcTabsTailwindProps extends ArcTabsProps {\n classNames?: ArcTabsTailwindClassNames\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nconst sizeClassMap: Record<ArcTabsSize, string> = {\n sm: 'min-h-9 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-4 py-2 text-[0.95rem]',\n lg: 'min-h-12 px-5 py-2.5 text-base',\n}\n\nexport function ArcTabsTailwind({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n classNames,\n ...rest\n}: ArcTabsTailwindProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listScrollRef = React.useRef<HTMLDivElement | null>(null)\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n const listElement = listRef.current\n\n if (!listElement || !selectedTab) return\n\n const nextX = selectedTab.offsetLeft\n const nextWidth = selectedTab.offsetWidth\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n const listScrollElement = listScrollRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n if (listScrollElement) {\n observer.observe(listScrollElement)\n }\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-notch'] = 'clamp(8px, calc(var(--arc-radius) * 0.75), 16px)'\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n const isFirst = selectedIndex === 0\n const isLast = selectedIndex === items.length - 1\n cssVars['--arc-panel-tl-radius'] = isFirst ? '0px' : 'var(--arc-radius)'\n cssVars['--arc-panel-tr-radius'] = isLast ? '0px' : 'var(--arc-radius)'\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n selectedIndex,\n items.length,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-strip-bg:#edf1ff] [--arc-tab-hover-bg:#dce3ff] [--arc-panel-bg:#ffffff] [--arc-panel-border:#cfd6f5] [--arc-panel-padding:1rem] [--arc-motion-duration:260ms] dark:[--arc-text:#edf1ff] dark:[--arc-tab-bg:#2c3555] dark:[--arc-strip-bg:#26304d] dark:[--arc-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]',\n classNames?.root,\n className,\n )\n\n const listClassName = joinClassNames(\n 'relative m-0 flex min-w-full list-none items-end gap-[var(--arc-gap)] overflow-visible rounded-t-[var(--arc-radius)] border border-b-0 border-[var(--arc-panel-border)] bg-[var(--arc-strip-bg)] px-[calc(var(--arc-gap)*0.6)] pb-[var(--arc-gap)] pt-[calc(var(--arc-gap)*0.6)] isolate',\n classNames?.list,\n tabsClassName,\n )\n\n const listScrollClassName =\n 'relative -mb-[var(--arc-notch)] overflow-x-auto overflow-y-visible pb-[var(--arc-notch)] [scrollbar-width:thin]'\n\n const panelsClassName = joinClassNames(\n 'relative z-[2] mt-0 rounded-bl-[var(--arc-radius)] rounded-br-[var(--arc-radius)] rounded-tl-[var(--arc-panel-tl-radius)] rounded-tr-[var(--arc-panel-tr-radius)] border border-t-0 border-[var(--arc-panel-border)] bg-[var(--arc-panel-bg)] p-[var(--arc-panel-padding)] shadow-[0_12px_32px_rgba(15,23,42,0.12)] transition-[border-radius] duration-[var(--arc-motion-duration)] ease-[cubic-bezier(0.22,1,0.36,1)]',\n classNames?.panels,\n panelClassName,\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? (\n <span className={joinClassNames('inline-flex leading-none', classNames?.icon)}>\n {item.icon}\n </span>\n ) : null}\n <span className={joinClassNames('inline-block', classNames?.text)}>{item.label}</span>\n {item.badge !== undefined ? (\n <span\n className={joinClassNames(\n 'inline-flex min-w-5 items-center justify-center rounded-full bg-[var(--arc-accent)] px-1.5 py-0.5 text-[0.72em] font-bold text-white/95',\n classNames?.badge,\n )}\n >\n {item.badge}\n </span>\n ) : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const indicatorClassName = joinClassNames(\n 'pointer-events-none absolute left-0 top-0 z-[1] h-[calc(100%-var(--arc-gap))] w-[var(--arc-indicator-w)] translate-x-[var(--arc-indicator-x)] rounded-t-[var(--arc-radius)] rounded-b-none bg-[var(--arc-panel-bg)] opacity-0 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)] transition-[transform,width,opacity] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)]',\n indicator.ready && 'opacity-100',\n classNames?.indicator,\n )\n\n return (\n <div className={rootClassName} style={themedStyle} data-slot=\"root\" {...rest}>\n <div ref={listScrollRef} className={listScrollClassName} data-slot=\"list-scroll\">\n <ul\n ref={listRef}\n className={listClassName}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n data-slot=\"list\"\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={indicatorClassName}\n style={indicatorStyle}\n data-slot=\"indicator\"\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n const itemClassName = joinClassNames(\n fit === 'equal' ? 'relative z-[2] min-w-0 flex-1' : 'relative z-[2] shrink-0',\n classNames?.item,\n )\n\n const tabClassName = joinClassNames(\n \"relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-[var(--arc-radius)] border border-[var(--arc-panel-border)] bg-[var(--arc-tab-bg)] text-inherit font-semibold leading-none select-none transition-[background-color,color,transform,border-color,box-shadow] [transition-duration:var(--arc-motion-duration)] [transition-timing-function:cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--arc-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--arc-panel-bg)] disabled:cursor-not-allowed disabled:opacity-45 before:pointer-events-none before:absolute before:bottom-0 before:left-[calc(var(--arc-notch)*-1)] before:h-[var(--arc-border-width)] before:w-[calc(100%+var(--arc-notch)*2)] before:translate-y-[var(--arc-gap)] before:bg-[var(--arc-panel-bg)] before:opacity-0 before:content-[''] before:transition-[opacity,transform] before:[transition-duration:var(--arc-motion-duration)] before:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)] after:pointer-events-none after:absolute after:bottom-0 after:left-[calc(var(--arc-notch)*-1)] after:h-[calc(var(--arc-notch)+var(--arc-border-width))] after:w-[calc(100%+var(--arc-notch)*2)] after:translate-y-[var(--arc-gap)] after:bg-[radial-gradient(circle_var(--arc-notch)_at_0%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_left_top/var(--arc-notch)_var(--arc-notch)_no-repeat,radial-gradient(circle_var(--arc-notch)_at_100%_0%,_transparent_calc(var(--arc-notch)-0.5px),_var(--arc-panel-bg)_calc(var(--arc-notch)+0.5px))_right_top/var(--arc-notch)_var(--arc-notch)_no-repeat,linear-gradient(var(--arc-panel-bg),_var(--arc-panel-bg))_center_top/calc(100%-var(--arc-notch)*2)_100%_no-repeat] after:opacity-0 after:content-[''] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]',\n motionPreset === 'expressive' ? 'bg-transparent' : 'bg-[var(--arc-panel-bg)]',\n )\n : 'enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]',\n selected ? classNames?.tabSelected : classNames?.tabUnselected,\n disabled && classNames?.tabDisabled,\n classNames?.tab,\n )\n\n return (\n <li className={itemClassName} key={item.id} role=\"presentation\" data-slot=\"item\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className={tabClassName}\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n data-slot=\"tab\"\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n </div>\n\n <div className={panelsClassName} data-slot=\"panels\">\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n data-slot=\"panel\"\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className={joinClassNames('outline-none', classNames?.panel)}\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n data-slot=\"panel\"\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n"],"mappings":";AAEA,YAAY,WAAW;AA+enB,mBACe,KADf;AA3bJ,IAAM,iBAAiB,IAAI,UACzB,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AAEhC,IAAM,YAAY,CAAC,UACjB,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAE7C,IAAM,wBAAwB,CAAC,UAAwB,MAAM,UAAU,CAAC,SAAS,CAAC,KAAK,QAAQ;AAE/F,IAAM,oBAAoB,CAAC,UACzB,MAAM,OAAiB,CAAC,KAAK,MAAM,UAAU;AAC3C,MAAI,CAAC,KAAK,SAAU,KAAI,KAAK,KAAK;AAClC,SAAO;AACT,GAAG,CAAC,CAAC;AAEP,IAAM,sBAAsB,CAAC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