@entro314labs/react-arc-tabs 1.0.3 → 1.0.6

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 CHANGED
@@ -8,6 +8,7 @@
8
8
  --arc-accent: #5b4ff1;
9
9
  --arc-text: #171a2c;
10
10
  --arc-tab-bg: #e7ebff;
11
+ --arc-strip-bg: #edf1ff;
11
12
  --arc-tab-hover-bg: #dce3ff;
12
13
  --arc-panel-bg: #ffffff;
13
14
  --arc-panel-border: #cfd6f5;
@@ -21,6 +22,7 @@
21
22
  .arc-tabs {
22
23
  --arc-text: #edf1ff;
23
24
  --arc-tab-bg: #2c3555;
25
+ --arc-strip-bg: #26304d;
24
26
  --arc-tab-hover-bg: #374268;
25
27
  --arc-panel-bg: #1c243b;
26
28
  --arc-panel-border: #46527e;
@@ -30,15 +32,28 @@
30
32
  .arc-tabs__list {
31
33
  position: relative;
32
34
  display: flex;
35
+ min-width: 100%;
33
36
  align-items: end;
34
37
  gap: var(--arc-gap);
35
38
  list-style: none;
36
39
  margin: 0;
37
- padding: 0 0 var(--arc-gap);
40
+ padding: calc(var(--arc-gap) * 0.6) calc(var(--arc-gap) * 0.6) var(--arc-gap);
41
+ border: var(--arc-border-width) solid var(--arc-panel-border);
42
+ border-bottom: none;
43
+ border-top-left-radius: var(--arc-radius);
44
+ border-top-right-radius: var(--arc-radius);
45
+ background: var(--arc-strip-bg);
46
+ overflow: visible;
47
+ isolation: isolate;
48
+ }
49
+
50
+ .arc-tabs__list-scroll {
51
+ position: relative;
52
+ margin-bottom: calc(var(--arc-radius) * -1);
53
+ padding-bottom: var(--arc-radius);
38
54
  overflow-x: auto;
39
- overflow-y: clip;
55
+ overflow-y: visible;
40
56
  scrollbar-width: thin;
41
- isolation: isolate;
42
57
  }
43
58
 
44
59
  .arc-tabs__item {
@@ -153,8 +168,8 @@
153
168
  content: '';
154
169
  position: absolute;
155
170
  bottom: 0;
156
- width: calc(var(--arc-radius) * 2);
157
- height: calc(var(--arc-radius) * 2);
171
+ width: var(--arc-radius);
172
+ height: var(--arc-radius);
158
173
  opacity: 0;
159
174
  pointer-events: none;
160
175
  transform: translateY(var(--arc-gap));
@@ -165,7 +180,7 @@
165
180
  }
166
181
 
167
182
  .arc-tabs__tab::before {
168
- left: calc(var(--arc-radius) * -2);
183
+ left: calc(var(--arc-radius) * -1);
169
184
  background: radial-gradient(
170
185
  circle at 100% 0,
171
186
  transparent calc(var(--arc-radius) - 0.5px),
@@ -178,7 +193,7 @@
178
193
  }
179
194
 
180
195
  .arc-tabs__tab::after {
181
- right: calc(var(--arc-radius) * -2);
196
+ right: calc(var(--arc-radius) * -1);
182
197
  background: radial-gradient(
183
198
  circle at 0 0,
184
199
  transparent calc(var(--arc-radius) - 0.5px),
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 listRect = listElement.getBoundingClientRect();
198
- const tabRect = selectedTab.getBoundingClientRect();
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
  };
@@ -400,7 +398,7 @@ function ArcTabs({
400
398
  ] });
401
399
  const renderPanelContent = (item, state) => renderPanel ? renderPanel(item, state) : item.content;
402
400
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: rootClassName, style: themedStyle, ...rest, children: [
403
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
401
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ref: listScrollRef, className: "arc-tabs__list-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
404
402
  "ul",
405
403
  {
406
404
  ref: listRef,
@@ -454,7 +452,7 @@ function ArcTabs({
454
452
  })
455
453
  ]
456
454
  }
457
- ),
455
+ ) }),
458
456
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: joinClassNames("arc-tabs__panels", panelClassName), children: [
459
457
  items.length === 0 && emptyState,
460
458
  items.length > 0 && selectedItem === void 0 && emptyState,
@@ -602,6 +600,7 @@ function ArcTabsTailwind({
602
600
  }, [focusedIndex, selectedIndex, items]);
603
601
  const enabledIndices = React2.useMemo(() => getEnabledIndices2(items), [items]);
604
602
  const tabRefs = React2.useRef([]);
603
+ const listScrollRef = React2.useRef(null);
605
604
  const listRef = React2.useRef(null);
606
605
  const activePanelRef = React2.useRef(null);
607
606
  const hasMountedRef = React2.useRef(false);
@@ -667,13 +666,11 @@ function ArcTabsTailwind({
667
666
  );
668
667
  return;
669
668
  }
670
- const listElement = listRef.current;
671
669
  const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
670
+ const listElement = listRef.current;
672
671
  if (!listElement || !selectedTab) return;
673
- const listRect = listElement.getBoundingClientRect();
674
- const tabRect = selectedTab.getBoundingClientRect();
675
- const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
676
- const nextWidth = tabRect.width;
672
+ const nextX = selectedTab.offsetLeft;
673
+ const nextWidth = selectedTab.offsetWidth;
677
674
  setIndicator((previous) => {
678
675
  const changedX = Math.abs(previous.x - nextX) > 0.5;
679
676
  const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
@@ -693,13 +690,11 @@ function ArcTabsTailwind({
693
690
  React2.useEffect(() => {
694
691
  if (!showSlidingIndicator) return;
695
692
  const listElement = listRef.current;
693
+ const listScrollElement = listScrollRef.current;
696
694
  if (!listElement) return;
697
695
  const onResize = () => {
698
696
  syncIndicator();
699
697
  };
700
- const onScroll = () => {
701
- syncIndicator();
702
- };
703
698
  const frame = requestAnimationFrame(syncIndicator);
704
699
  let observer = null;
705
700
  if (typeof ResizeObserver !== "undefined") {
@@ -707,15 +702,16 @@ function ArcTabsTailwind({
707
702
  syncIndicator();
708
703
  });
709
704
  observer.observe(listElement);
705
+ if (listScrollElement) {
706
+ observer.observe(listScrollElement);
707
+ }
710
708
  tabRefs.current.forEach((tabElement) => {
711
709
  if (tabElement) observer?.observe(tabElement);
712
710
  });
713
711
  }
714
- listElement.addEventListener("scroll", onScroll, { passive: true });
715
712
  window.addEventListener("resize", onResize);
716
713
  return () => {
717
714
  cancelAnimationFrame(frame);
718
- listElement.removeEventListener("scroll", onScroll);
719
715
  window.removeEventListener("resize", onResize);
720
716
  observer?.disconnect();
721
717
  };
@@ -854,15 +850,16 @@ function ArcTabsTailwind({
854
850
  effectiveMotionDuration
855
851
  ]);
856
852
  const rootClassName = joinClassNames2(
857
- "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-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-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]",
853
+ "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]",
858
854
  classNames?.root,
859
855
  className
860
856
  );
861
857
  const listClassName = joinClassNames2(
862
- "relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-x-auto overflow-y-clip p-0 pb-[var(--arc-gap)] isolate",
858
+ "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
859
  classNames?.list,
864
860
  tabsClassName
865
861
  );
862
+ const listScrollClassName = "relative -mb-[var(--arc-radius)] overflow-x-auto overflow-y-visible pb-[var(--arc-radius)] [scrollbar-width:thin]";
866
863
  const panelsClassName = joinClassNames2(
867
864
  "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)]",
868
865
  classNames?.panels,
@@ -896,7 +893,7 @@ function ArcTabsTailwind({
896
893
  classNames?.indicator
897
894
  );
898
895
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: rootClassName, style: themedStyle, "data-slot": "root", ...rest, children: [
899
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
896
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { ref: listScrollRef, className: listScrollClassName, "data-slot": "list-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
900
897
  "ul",
901
898
  {
902
899
  ref: listRef,
@@ -928,7 +925,7 @@ function ArcTabsTailwind({
928
925
  classNames?.item
929
926
  );
930
927
  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-radius)*-2)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)*2)] 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)*-2)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)*2)] 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)]",
928
+ "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)]",
932
929
  sizeClassMap[size],
933
930
  fit === "equal" && "w-full justify-center",
934
931
  selected ? joinClassNames2(
@@ -971,7 +968,7 @@ function ArcTabsTailwind({
971
968
  })
972
969
  ]
973
970
  }
974
- ),
971
+ ) }),
975
972
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: panelsClassName, "data-slot": "panels", children: [
976
973
  items.length === 0 && emptyState,
977
974
  items.length > 0 && selectedItem === void 0 && emptyState,
@@ -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-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-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 p-0 pb-[var(--arc-gap)] 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)*-2)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)*2)] 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)*-2)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)*2)] 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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,UAAU;AAAA,UAC3B;AAAA,UACA,IAAI,GAAG,MAAM,UAAU,aAAa;AAAA,UACpC,WAAWA,gBAAe,gBAAgB,YAAY,KAAK;AAAA,UAC3D,MAAK;AAAA,UACL,mBAAiB,GAAG,MAAM,QAAQ,aAAa;AAAA,UAC/C,eAAa;AAAA,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-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 <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-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 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-radius)] overflow-x-auto overflow-y-visible pb-[var(--arc-radius)] [scrollbar-width:thin]'\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 <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-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 </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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEA,YAAuB;AAqenB;AAjbJ,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;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,UAC3B;AAAA,UACA,IAAI,GAAG,MAAM,UAAU,aAAa;AAAA,UACpC,WAAWA,gBAAe,gBAAgB,YAAY,KAAK;AAAA,UAC3D,MAAK;AAAA,UACL,mBAAiB,GAAG,MAAM,QAAQ,aAAa;AAAA,UAC/C,eAAa;AAAA,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"]}
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 listRect = listElement.getBoundingClientRect();
161
- const tabRect = selectedTab.getBoundingClientRect();
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
  };
@@ -363,7 +361,7 @@ function ArcTabs({
363
361
  ] });
364
362
  const renderPanelContent = (item, state) => renderPanel ? renderPanel(item, state) : item.content;
365
363
  return /* @__PURE__ */ jsxs("div", { className: rootClassName, style: themedStyle, ...rest, children: [
366
- /* @__PURE__ */ jsxs(
364
+ /* @__PURE__ */ jsx("div", { ref: listScrollRef, className: "arc-tabs__list-scroll", children: /* @__PURE__ */ jsxs(
367
365
  "ul",
368
366
  {
369
367
  ref: listRef,
@@ -417,7 +415,7 @@ function ArcTabs({
417
415
  })
418
416
  ]
419
417
  }
420
- ),
418
+ ) }),
421
419
  /* @__PURE__ */ jsxs("div", { className: joinClassNames("arc-tabs__panels", panelClassName), children: [
422
420
  items.length === 0 && emptyState,
423
421
  items.length > 0 && selectedItem === void 0 && emptyState,
@@ -565,6 +563,7 @@ function ArcTabsTailwind({
565
563
  }, [focusedIndex, selectedIndex, items]);
566
564
  const enabledIndices = React2.useMemo(() => getEnabledIndices2(items), [items]);
567
565
  const tabRefs = React2.useRef([]);
566
+ const listScrollRef = React2.useRef(null);
568
567
  const listRef = React2.useRef(null);
569
568
  const activePanelRef = React2.useRef(null);
570
569
  const hasMountedRef = React2.useRef(false);
@@ -630,13 +629,11 @@ function ArcTabsTailwind({
630
629
  );
631
630
  return;
632
631
  }
633
- const listElement = listRef.current;
634
632
  const selectedTab = selectedIndex >= 0 ? tabRefs.current[selectedIndex] ?? null : null;
633
+ const listElement = listRef.current;
635
634
  if (!listElement || !selectedTab) return;
636
- const listRect = listElement.getBoundingClientRect();
637
- const tabRect = selectedTab.getBoundingClientRect();
638
- const nextX = tabRect.left - listRect.left + listElement.scrollLeft;
639
- const nextWidth = tabRect.width;
635
+ const nextX = selectedTab.offsetLeft;
636
+ const nextWidth = selectedTab.offsetWidth;
640
637
  setIndicator((previous) => {
641
638
  const changedX = Math.abs(previous.x - nextX) > 0.5;
642
639
  const changedWidth = Math.abs(previous.width - nextWidth) > 0.5;
@@ -656,13 +653,11 @@ function ArcTabsTailwind({
656
653
  React2.useEffect(() => {
657
654
  if (!showSlidingIndicator) return;
658
655
  const listElement = listRef.current;
656
+ const listScrollElement = listScrollRef.current;
659
657
  if (!listElement) return;
660
658
  const onResize = () => {
661
659
  syncIndicator();
662
660
  };
663
- const onScroll = () => {
664
- syncIndicator();
665
- };
666
661
  const frame = requestAnimationFrame(syncIndicator);
667
662
  let observer = null;
668
663
  if (typeof ResizeObserver !== "undefined") {
@@ -670,15 +665,16 @@ function ArcTabsTailwind({
670
665
  syncIndicator();
671
666
  });
672
667
  observer.observe(listElement);
668
+ if (listScrollElement) {
669
+ observer.observe(listScrollElement);
670
+ }
673
671
  tabRefs.current.forEach((tabElement) => {
674
672
  if (tabElement) observer?.observe(tabElement);
675
673
  });
676
674
  }
677
- listElement.addEventListener("scroll", onScroll, { passive: true });
678
675
  window.addEventListener("resize", onResize);
679
676
  return () => {
680
677
  cancelAnimationFrame(frame);
681
- listElement.removeEventListener("scroll", onScroll);
682
678
  window.removeEventListener("resize", onResize);
683
679
  observer?.disconnect();
684
680
  };
@@ -817,15 +813,16 @@ function ArcTabsTailwind({
817
813
  effectiveMotionDuration
818
814
  ]);
819
815
  const rootClassName = joinClassNames2(
820
- "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-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-tab-hover-bg:#374268] dark:[--arc-panel-bg:#1c243b] dark:[--arc-panel-border:#46527e]",
816
+ "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]",
821
817
  classNames?.root,
822
818
  className
823
819
  );
824
820
  const listClassName = joinClassNames2(
825
- "relative m-0 flex list-none items-end gap-[var(--arc-gap)] overflow-x-auto overflow-y-clip p-0 pb-[var(--arc-gap)] isolate",
821
+ "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
822
  classNames?.list,
827
823
  tabsClassName
828
824
  );
825
+ const listScrollClassName = "relative -mb-[var(--arc-radius)] overflow-x-auto overflow-y-visible pb-[var(--arc-radius)] [scrollbar-width:thin]";
829
826
  const panelsClassName = joinClassNames2(
830
827
  "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)]",
831
828
  classNames?.panels,
@@ -859,7 +856,7 @@ function ArcTabsTailwind({
859
856
  classNames?.indicator
860
857
  );
861
858
  return /* @__PURE__ */ jsxs2("div", { className: rootClassName, style: themedStyle, "data-slot": "root", ...rest, children: [
862
- /* @__PURE__ */ jsxs2(
859
+ /* @__PURE__ */ jsx2("div", { ref: listScrollRef, className: listScrollClassName, "data-slot": "list-scroll", children: /* @__PURE__ */ jsxs2(
863
860
  "ul",
864
861
  {
865
862
  ref: listRef,
@@ -891,7 +888,7 @@ function ArcTabsTailwind({
891
888
  classNames?.item
892
889
  );
893
890
  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-radius)*-2)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)*2)] 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)*-2)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)*2)] 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)]",
891
+ "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)]",
895
892
  sizeClassMap[size],
896
893
  fit === "equal" && "w-full justify-center",
897
894
  selected ? joinClassNames2(
@@ -934,7 +931,7 @@ function ArcTabsTailwind({
934
931
  })
935
932
  ]
936
933
  }
937
- ),
934
+ ) }),
938
935
  /* @__PURE__ */ jsxs2("div", { className: panelsClassName, "data-slot": "panels", children: [
939
936
  items.length === 0 && emptyState,
940
937
  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-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-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 p-0 pb-[var(--arc-gap)] 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)*-2)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)*2)] 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)*-2)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)*2)] 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,YAAY,WAAW;AAuenB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ment","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-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 <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-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 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-radius)] overflow-x-auto overflow-y-visible pb-[var(--arc-radius)] [scrollbar-width:thin]'\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 <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-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 </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;AAqenB,mBACe,KADf;AAjbJ,IAAM,iBAAiB,IAAI,UACzB,MAAM,OAAO,OAAO,EAAE,KAAK,GAA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M,WAAW,QAAQ,KAAK,QAAQ;AACtC,cAAM,QAAQ,GAAG,MAAM,QAAQ,KAAK;AACpC,cAAM,UAAU,GAAG,MAAM,UAAU,KAAK;AACxC,cAAM,QAA4B,EAAE,OAAO,UAAU,SAAS;AAE9D,eACE,gBAAAD;AAAA,UAAC;AAAA;AAAA,YAEC,KAAK,CAAC,SAAS;AACb,kBAAI,UAAU;AACZ,+BAAe,UAAU;AAAA,cAC3B;AAAA,YACF;AAAA,YACA,IAAI;AAAA,YACJ,WAAWE,gBAAe,gBAAgB,YAAY,KAAK;AAAA,YAC3D,MAAK;AAAA,YACL,mBAAiB;AAAA,YACjB,eAAa,CAAC;AAAA,YACd,QAAQ,CAAC;AAAA,YACT,aAAU;AAAA,YAET,6BAAmB,MAAM,KAAK;AAAA;AAAA,UAd1B,KAAK;AAAA,QAeZ;AAAA,MAEJ,CAAC,IACD;AAAA,MAEH,MAAM,SAAS,KAAK,iBAAiB,UAAa,CAAC,cAClD,gBAAAF;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,CAAC,SAAS;AACb,2BAAe,UAAU;AAAA,UAC3B;AAAA,UACA,IAAI,GAAG,MAAM,UAAU,aAAa;AAAA,UACpC,WAAWE,gBAAe,gBAAgB,YAAY,KAAK;AAAA,UAC3D,MAAK;AAAA,UACL,mBAAiB,GAAG,MAAM,QAAQ,aAAa;AAAA,UAC/C,eAAa;AAAA,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","Fragment","jsx","jsxs","joinClassNames","toCssSize","findFirstEnabledIndex","getEnabledIndices","getNextEnabledIndex"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@entro314labs/react-arc-tabs",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "private": false,
5
5
  "description": "Reusable arc-style tabs component for React and Next.js projects",
6
6
  "keywords": [