@entro314labs/react-arc-tabs 1.0.2 → 1.0.3
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 +20 -20
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/ArcTabs.css
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
border-bottom-right-radius: 0;
|
|
61
61
|
transform: translateX(var(--arc-indicator-x, 0px));
|
|
62
62
|
background: var(--arc-panel-bg);
|
|
63
|
-
box-shadow: 0
|
|
63
|
+
box-shadow: 0 var(--arc-gap) 0 var(--arc-panel-bg);
|
|
64
64
|
opacity: 0;
|
|
65
65
|
pointer-events: none;
|
|
66
66
|
transition:
|
|
@@ -153,41 +153,41 @@
|
|
|
153
153
|
content: '';
|
|
154
154
|
position: absolute;
|
|
155
155
|
bottom: 0;
|
|
156
|
-
width: calc(var(--arc-radius)
|
|
156
|
+
width: calc(var(--arc-radius) * 2);
|
|
157
157
|
height: calc(var(--arc-radius) * 2);
|
|
158
158
|
opacity: 0;
|
|
159
159
|
pointer-events: none;
|
|
160
|
-
transform: translateY(
|
|
160
|
+
transform: translateY(var(--arc-gap));
|
|
161
161
|
background-color: transparent;
|
|
162
|
-
box-shadow: 0 var(--arc-radius) 0 var(--arc-panel-bg);
|
|
163
162
|
transition:
|
|
164
163
|
opacity var(--arc-motion-duration) var(--arc-motion-easing),
|
|
165
164
|
transform var(--arc-motion-duration) var(--arc-motion-easing);
|
|
166
165
|
}
|
|
167
166
|
|
|
168
|
-
.arc-tabs__tab[aria-selected='true']::before,
|
|
169
|
-
.arc-tabs__tab[aria-selected='true']::after {
|
|
170
|
-
opacity: 1;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
167
|
.arc-tabs__tab::before {
|
|
174
|
-
left: calc(var(--arc-
|
|
168
|
+
left: calc(var(--arc-radius) * -2);
|
|
169
|
+
background: radial-gradient(
|
|
170
|
+
circle at 100% 0,
|
|
171
|
+
transparent calc(var(--arc-radius) - 0.5px),
|
|
172
|
+
var(--arc-panel-bg) var(--arc-radius)
|
|
173
|
+
);
|
|
175
174
|
}
|
|
176
175
|
|
|
177
|
-
.arc-tabs__tab:not(:first-child)::before {
|
|
178
|
-
|
|
179
|
-
border-bottom-right-radius: var(--arc-radius);
|
|
180
|
-
box-shadow: var(--arc-border-width) var(--arc-radius) 0 var(--arc-panel-bg);
|
|
176
|
+
.arc-tabs__tab[aria-selected='true']:not(:first-child)::before {
|
|
177
|
+
opacity: 1;
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
.arc-tabs__tab::after {
|
|
184
|
-
right: calc(var(--arc-
|
|
181
|
+
right: calc(var(--arc-radius) * -2);
|
|
182
|
+
background: radial-gradient(
|
|
183
|
+
circle at 0 0,
|
|
184
|
+
transparent calc(var(--arc-radius) - 0.5px),
|
|
185
|
+
var(--arc-panel-bg) var(--arc-radius)
|
|
186
|
+
);
|
|
185
187
|
}
|
|
186
188
|
|
|
187
|
-
.arc-tabs__tab:not(:last-child)::after {
|
|
188
|
-
|
|
189
|
-
border-bottom-left-radius: var(--arc-radius);
|
|
190
|
-
box-shadow: calc(var(--arc-border-width) * -1) var(--arc-radius) 0 var(--arc-panel-bg);
|
|
189
|
+
.arc-tabs__tab[aria-selected='true']:not(:last-child)::after {
|
|
190
|
+
opacity: 1;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
.arc-tabs__tab[aria-selected='true'] {
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
background: var(--arc-panel-bg);
|
|
198
198
|
border-bottom-left-radius: 0;
|
|
199
199
|
border-bottom-right-radius: 0;
|
|
200
|
-
box-shadow: 0
|
|
200
|
+
box-shadow: 0 var(--arc-gap) 0 var(--arc-panel-bg);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
.arc-tabs--motion-expressive .arc-tabs__tab[aria-selected='true'] {
|
package/dist/index.cjs
CHANGED
|
@@ -891,7 +891,7 @@ function ArcTabsTailwind({
|
|
|
891
891
|
[indicator.x, indicator.width]
|
|
892
892
|
);
|
|
893
893
|
const indicatorClassName = joinClassNames2(
|
|
894
|
-
"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:
|
|
894
|
+
"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)]",
|
|
895
895
|
indicator.ready && "opacity-100",
|
|
896
896
|
classNames?.indicator
|
|
897
897
|
);
|
|
@@ -928,15 +928,15 @@ function ArcTabsTailwind({
|
|
|
928
928
|
classNames?.item
|
|
929
929
|
);
|
|
930
930
|
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-
|
|
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)]",
|
|
932
932
|
sizeClassMap[size],
|
|
933
933
|
fit === "equal" && "w-full justify-center",
|
|
934
934
|
selected ? joinClassNames2(
|
|
935
|
-
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)]
|
|
935
|
+
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
936
936
|
motionPreset === "expressive" ? "bg-transparent" : "bg-[var(--arc-panel-bg)]"
|
|
937
937
|
) : "enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]",
|
|
938
|
-
index > 0 && "before
|
|
939
|
-
index < items.length - 1 && "after:
|
|
938
|
+
selected && index > 0 && "before:opacity-100",
|
|
939
|
+
selected && index < items.length - 1 && "after:opacity-100",
|
|
940
940
|
selected ? classNames?.tabSelected : classNames?.tabUnselected,
|
|
941
941
|
disabled && classNames?.tabDisabled,
|
|
942
942
|
classNames?.tab
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/ArcTabs.tsx","../src/ArcTabsTailwind.tsx"],"sourcesContent":["export { ArcTabs } from './ArcTabs'\nexport { ArcTabsTailwind } from './ArcTabsTailwind'\nexport type {\n ArcTabItem,\n ArcTabsActivationMode,\n ArcTabsFit,\n ArcTabsMotionPreset,\n ArcTabsProps,\n ArcTabsRenderState,\n ArcTabsSize,\n} from './ArcTabs'\nexport type { ArcTabsTailwindClassNames, ArcTabsTailwindProps } from './ArcTabsTailwind'\n","'use client'\n\nimport * as React from 'react'\n\nexport interface ArcTabItem {\n id: string\n label: React.ReactNode\n content: React.ReactNode\n disabled?: boolean\n icon?: React.ReactNode\n badge?: React.ReactNode\n}\n\nexport type ArcTabsActivationMode = 'automatic' | 'manual'\nexport type ArcTabsSize = 'sm' | 'md' | 'lg'\nexport type ArcTabsFit = 'content' | 'equal'\nexport type ArcTabsMotionPreset = 'none' | 'subtle' | 'expressive'\n\nexport interface ArcTabsRenderState {\n index: number\n selected: boolean\n disabled: boolean\n}\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n items: ArcTabItem[]\n value?: string\n defaultValue?: string\n onValueChange?: (value: string, item: ArcTabItem, index: number) => void\n activationMode?: ArcTabsActivationMode\n keepMounted?: boolean\n size?: ArcTabsSize\n fit?: ArcTabsFit\n motionPreset?: ArcTabsMotionPreset\n motionDuration?: number\n ariaLabel?: string\n listId?: string\n tabsClassName?: string\n panelClassName?: string\n radius?: number\n gap?: number\n panelPadding?: number | string\n accentColor?: string\n tabBackground?: string\n tabHoverBackground?: string\n panelBackground?: string\n panelBorderColor?: string\n emptyState?: React.ReactNode\n renderTabLabel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n renderPanel?: (item: ArcTabItem, state: ArcTabsRenderState) => React.ReactNode\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nexport function ArcTabs({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n ...rest\n}: ArcTabsProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs',\n `arc-tabs--size-${size}`,\n `arc-tabs--fit-${fit}`,\n `arc-tabs--motion-${motionPreset}`,\n hasInteracted && 'arc-tabs--has-interacted',\n panelDirection !== 'none' && `arc-tabs--direction-${panelDirection}`,\n className,\n )\n\n const indicatorStyle = React.useMemo<CSSVarStyle>(\n () => ({\n '--arc-indicator-x': `${indicator.x}px`,\n '--arc-indicator-w': `${indicator.width}px`,\n }),\n [indicator.x, indicator.width],\n )\n\n const renderDefaultLabel = (item: ArcTabItem) => (\n <>\n {item.icon ? <span className=\"arc-tabs__icon\">{item.icon}</span> : null}\n <span className=\"arc-tabs__text\">{item.label}</span>\n {item.badge !== undefined ? <span className=\"arc-tabs__badge\">{item.badge}</span> : null}\n </>\n )\n\n const renderPanelContent = (item: ArcTabItem, state: ArcTabsRenderState) =>\n renderPanel ? renderPanel(item, state) : item.content\n\n return (\n <div className={rootClassName} style={themedStyle} {...rest}>\n <ul\n ref={listRef}\n className={joinClassNames('arc-tabs__list', tabsClassName)}\n role=\"tablist\"\n aria-label={ariaLabel}\n id={`${baseId}-list`}\n >\n {showSlidingIndicator ? (\n <li\n aria-hidden=\"true\"\n role=\"presentation\"\n className={joinClassNames('arc-tabs__active-indicator', indicator.ready && 'is-ready')}\n style={indicatorStyle}\n />\n ) : null}\n\n {items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n const tabIndexValue = disabled\n ? -1\n : focusedIndex === index || (focusedIndex === -1 && selected)\n ? 0\n : -1\n\n return (\n <li className=\"arc-tabs__item\" key={item.id} role=\"presentation\">\n <button\n id={tabId}\n ref={(node) => {\n tabRefs.current[index] = node\n }}\n type=\"button\"\n role=\"tab\"\n aria-selected={selected}\n aria-controls={panelId}\n tabIndex={tabIndexValue}\n disabled={disabled}\n className=\"arc-tabs__tab\"\n onFocus={() => {\n setFocusedIndex(index)\n }}\n onClick={() => {\n selectTab(index)\n }}\n onKeyDown={(event) => {\n handleTabKeyDown(event, index)\n }}\n >\n {renderTabLabel ? renderTabLabel(item, state) : renderDefaultLabel(item)}\n </button>\n </li>\n )\n })}\n </ul>\n\n <div className={joinClassNames('arc-tabs__panels', panelClassName)}>\n {items.length === 0 && emptyState}\n\n {items.length > 0 && selectedItem === undefined && emptyState}\n\n {items.length > 0 && selectedItem !== undefined && keepMounted\n ? items.map((item, index) => {\n const selected = index === selectedIndex\n const disabled = Boolean(item.disabled)\n const tabId = `${baseId}-tab-${index}`\n const panelId = `${baseId}-panel-${index}`\n const state: ArcTabsRenderState = { index, selected, disabled }\n\n return (\n <section\n key={item.id}\n ref={(node) => {\n if (selected) {\n activePanelRef.current = node\n }\n }}\n id={panelId}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={tabId}\n aria-hidden={!selected}\n hidden={!selected}\n >\n {renderPanelContent(item, state)}\n </section>\n )\n })\n : null}\n\n {items.length > 0 && selectedItem !== undefined && !keepMounted ? (\n <section\n ref={(node) => {\n activePanelRef.current = node\n }}\n id={`${baseId}-panel-${selectedIndex}`}\n className=\"arc-tabs__panel\"\n role=\"tabpanel\"\n aria-labelledby={`${baseId}-tab-${selectedIndex}`}\n aria-hidden={false}\n >\n {renderPanelContent(selectedItem, {\n index: selectedIndex,\n selected: true,\n disabled: Boolean(selectedItem.disabled),\n })}\n </section>\n ) : null}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport * as React from 'react'\n\nimport type { ArcTabItem, ArcTabsProps, ArcTabsRenderState, ArcTabsSize } from './ArcTabs'\n\ntype CSSVarStyle = React.CSSProperties & Record<`--${string}`, string | number>\n\nexport interface ArcTabsTailwindClassNames {\n root?: string\n list?: string\n indicator?: string\n item?: string\n tab?: string\n tabSelected?: string\n tabUnselected?: string\n tabDisabled?: string\n icon?: string\n text?: string\n badge?: string\n panels?: string\n panel?: string\n}\n\nexport interface ArcTabsTailwindProps extends ArcTabsProps {\n classNames?: ArcTabsTailwindClassNames\n}\n\nconst joinClassNames = (...parts: Array<string | undefined | false | null>) =>\n parts.filter(Boolean).join(' ')\n\nconst toCssSize = (value: number | string | undefined) =>\n typeof value === 'number' ? `${value}px` : value\n\nconst findFirstEnabledIndex = (items: ArcTabItem[]) => items.findIndex((item) => !item.disabled)\n\nconst getEnabledIndices = (items: ArcTabItem[]) =>\n items.reduce<number[]>((acc, item, index) => {\n if (!item.disabled) acc.push(index)\n return acc\n }, [])\n\nconst getNextEnabledIndex = (enabledIndices: number[], currentIndex: number, direction: 1 | -1) => {\n if (!enabledIndices.length) return -1\n\n const currentPosition = enabledIndices.indexOf(currentIndex)\n if (currentPosition === -1) {\n return direction === 1 ? (enabledIndices[0] ?? -1) : (enabledIndices.at(-1) ?? -1)\n }\n\n const nextPosition = (currentPosition + direction + enabledIndices.length) % enabledIndices.length\n return enabledIndices[nextPosition] ?? -1\n}\n\nconst sizeClassMap: Record<ArcTabsSize, string> = {\n sm: 'min-h-9 px-3 py-1.5 text-sm',\n md: 'min-h-10 px-4 py-2 text-[0.95rem]',\n lg: 'min-h-12 px-5 py-2.5 text-base',\n}\n\nexport function ArcTabsTailwind({\n items,\n value,\n defaultValue,\n onValueChange,\n activationMode = 'automatic',\n keepMounted = true,\n size = 'md',\n fit = 'content',\n motionPreset = 'subtle',\n motionDuration = 260,\n ariaLabel = 'Tabs',\n listId,\n tabsClassName,\n panelClassName,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n emptyState = null,\n renderTabLabel,\n renderPanel,\n className,\n style,\n classNames,\n ...rest\n}: ArcTabsTailwindProps) {\n const reactId = React.useId()\n const baseId = React.useMemo(\n () => (listId ?? `arc-tabs-${reactId}`).replace(/:/g, ''),\n [listId, reactId],\n )\n\n const isControlled = value !== undefined\n\n const firstEnabledIndex = React.useMemo(() => findFirstEnabledIndex(items), [items])\n\n const [uncontrolledValue, setUncontrolledValue] = React.useState<string | undefined>(() => {\n const requested = defaultValue\n const requestedMatch = items.find((item) => !item.disabled && item.id === requested)\n if (requestedMatch) return requestedMatch.id\n return firstEnabledIndex >= 0 ? items[firstEnabledIndex]?.id : undefined\n })\n\n const rawValue = isControlled ? value : uncontrolledValue\n\n const strictSelectedIndex = React.useMemo(\n () => items.findIndex((item) => !item.disabled && item.id === rawValue),\n [items, rawValue],\n )\n\n const selectedIndex = strictSelectedIndex >= 0 ? strictSelectedIndex : firstEnabledIndex\n\n const selectedItem = selectedIndex >= 0 ? items[selectedIndex] : undefined\n\n React.useEffect(() => {\n if (isControlled) return\n if (strictSelectedIndex !== -1) return\n\n if (firstEnabledIndex !== -1) {\n const fallbackId = items[firstEnabledIndex]?.id\n setUncontrolledValue(fallbackId)\n } else {\n setUncontrolledValue(undefined)\n }\n }, [isControlled, strictSelectedIndex, firstEnabledIndex, items])\n\n const [focusedIndex, setFocusedIndex] = React.useState<number>(selectedIndex)\n\n React.useEffect(() => {\n if (selectedIndex === -1) {\n setFocusedIndex(-1)\n return\n }\n\n if (focusedIndex < 0 || focusedIndex >= items.length || items[focusedIndex]?.disabled) {\n setFocusedIndex(selectedIndex)\n }\n }, [focusedIndex, selectedIndex, items])\n\n const enabledIndices = React.useMemo(() => getEnabledIndices(items), [items])\n\n const tabRefs = React.useRef<Array<HTMLButtonElement | null>>([])\n const listRef = React.useRef<HTMLUListElement | null>(null)\n const activePanelRef = React.useRef<HTMLElement | null>(null)\n const hasMountedRef = React.useRef(false)\n const previousSelectedIndexRef = React.useRef(selectedIndex)\n\n const [hasInteracted, setHasInteracted] = React.useState(false)\n const [panelDirection, setPanelDirection] = React.useState<'forward' | 'backward' | 'none'>(\n 'none',\n )\n const [indicator, setIndicator] = React.useState({\n x: 0,\n width: 0,\n ready: false,\n })\n\n const effectiveMotionDuration = motionPreset === 'none' ? 0 : Math.max(0, motionDuration)\n const showSlidingIndicator = motionPreset === 'expressive' && selectedIndex >= 0\n\n React.useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, items.length)\n }, [items.length])\n\n React.useEffect(() => {\n const previous = previousSelectedIndexRef.current\n\n if (!hasMountedRef.current) {\n hasMountedRef.current = true\n previousSelectedIndexRef.current = selectedIndex\n return\n }\n\n if (previous !== selectedIndex) {\n setHasInteracted(true)\n\n if (selectedIndex >= 0 && previous >= 0) {\n setPanelDirection(selectedIndex > previous ? 'forward' : 'backward')\n }\n }\n\n previousSelectedIndexRef.current = selectedIndex\n }, [selectedIndex])\n\n const focusTabIndex = React.useCallback((index: number) => {\n if (index < 0) return\n setFocusedIndex(index)\n tabRefs.current[index]?.focus()\n }, [])\n\n const selectTab = React.useCallback(\n (index: number) => {\n const item = items[index]\n if (!item || item.disabled) return\n if (index === selectedIndex) {\n setFocusedIndex(index)\n return\n }\n\n setHasInteracted(true)\n if (selectedIndex >= 0) {\n setPanelDirection(index > selectedIndex ? 'forward' : 'backward')\n }\n\n if (!isControlled) {\n setUncontrolledValue(item.id)\n }\n\n setFocusedIndex(index)\n onValueChange?.(item.id, item, index)\n },\n [items, selectedIndex, isControlled, onValueChange],\n )\n\n const syncIndicator = React.useCallback(() => {\n if (!showSlidingIndicator) {\n setIndicator((previous) =>\n previous.ready || previous.width !== 0 || previous.x !== 0\n ? { x: 0, width: 0, ready: false }\n : previous,\n )\n return\n }\n\n const listElement = listRef.current\n const selectedTab = selectedIndex >= 0 ? (tabRefs.current[selectedIndex] ?? null) : null\n\n if (!listElement || !selectedTab) return\n\n const listRect = listElement.getBoundingClientRect()\n const tabRect = selectedTab.getBoundingClientRect()\n const nextX = tabRect.left - listRect.left + listElement.scrollLeft\n const nextWidth = tabRect.width\n\n setIndicator((previous) => {\n const changedX = Math.abs(previous.x - nextX) > 0.5\n const changedWidth = Math.abs(previous.width - nextWidth) > 0.5\n if (!changedX && !changedWidth && previous.ready) {\n return previous\n }\n\n return {\n x: nextX,\n width: nextWidth,\n ready: true,\n }\n })\n }, [selectedIndex, showSlidingIndicator])\n\n React.useEffect(() => {\n syncIndicator()\n }, [syncIndicator, items.length, size, fit])\n\n React.useEffect(() => {\n if (!showSlidingIndicator) return\n\n const listElement = listRef.current\n if (!listElement) return\n\n const onResize = () => {\n syncIndicator()\n }\n const onScroll = () => {\n syncIndicator()\n }\n\n const frame = requestAnimationFrame(syncIndicator)\n\n let observer: ResizeObserver | null = null\n if (typeof ResizeObserver !== 'undefined') {\n observer = new ResizeObserver(() => {\n syncIndicator()\n })\n observer.observe(listElement)\n tabRefs.current.forEach((tabElement) => {\n if (tabElement) observer?.observe(tabElement)\n })\n }\n\n listElement.addEventListener('scroll', onScroll, { passive: true })\n window.addEventListener('resize', onResize)\n\n return () => {\n cancelAnimationFrame(frame)\n listElement.removeEventListener('scroll', onScroll)\n window.removeEventListener('resize', onResize)\n observer?.disconnect()\n }\n }, [showSlidingIndicator, syncIndicator, items.length])\n\n React.useEffect(() => {\n if (!hasInteracted || motionPreset === 'none' || effectiveMotionDuration <= 0) {\n return\n }\n\n const panelElement = activePanelRef.current\n if (!panelElement || typeof panelElement.animate !== 'function') {\n return\n }\n\n if (\n typeof globalThis.window !== 'undefined' &&\n globalThis.matchMedia?.('(prefers-reduced-motion: reduce)').matches\n ) {\n return\n }\n\n const offsetX =\n motionPreset === 'expressive'\n ? panelDirection === 'forward'\n ? 20\n : panelDirection === 'backward'\n ? -20\n : 0\n : 0\n\n const offsetY = motionPreset === 'expressive' ? 10 : 6\n const startScale = motionPreset === 'expressive' ? 0.985 : 0.995\n\n const animation = panelElement.animate(\n [\n {\n opacity: 0,\n transform: `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${startScale})`,\n filter: 'blur(1px)',\n },\n {\n opacity: 1,\n transform: 'translate3d(0, 0, 0) scale(1)',\n filter: 'blur(0px)',\n },\n ],\n {\n duration: effectiveMotionDuration,\n easing: 'cubic-bezier(0.22, 1, 0.36, 1)',\n fill: 'both',\n },\n )\n\n return () => {\n animation.cancel()\n }\n }, [selectedIndex, hasInteracted, motionPreset, panelDirection, effectiveMotionDuration])\n\n const handleTabKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLButtonElement>, index: number) => {\n if (!enabledIndices.length) return\n\n switch (event.key) {\n case 'ArrowRight': {\n event.preventDefault()\n const next = getNextEnabledIndex(enabledIndices, index, 1)\n if (next !== -1) {\n focusTabIndex(next)\n if (activationMode === 'automatic') selectTab(next)\n }\n break\n }\n case 'ArrowLeft': {\n event.preventDefault()\n const previous = getNextEnabledIndex(enabledIndices, index, -1)\n if (previous !== -1) {\n focusTabIndex(previous)\n if (activationMode === 'automatic') selectTab(previous)\n }\n break\n }\n case 'Home': {\n event.preventDefault()\n const first = enabledIndices[0]\n if (first !== undefined) {\n focusTabIndex(first)\n if (activationMode === 'automatic') selectTab(first)\n }\n break\n }\n case 'End': {\n event.preventDefault()\n const last = enabledIndices.at(-1)\n if (last !== undefined) {\n focusTabIndex(last)\n if (activationMode === 'automatic') selectTab(last)\n }\n break\n }\n case 'Enter':\n case ' ':\n case 'Spacebar': {\n if (activationMode === 'manual') {\n event.preventDefault()\n selectTab(index)\n }\n break\n }\n default:\n break\n }\n },\n [activationMode, enabledIndices, focusTabIndex, selectTab],\n )\n\n const themedStyle = React.useMemo<React.CSSProperties>(() => {\n const cssVars: CSSVarStyle = { ...style }\n\n if (radius !== undefined) {\n cssVars['--arc-radius'] = `${radius}px`\n }\n if (gap !== undefined) {\n cssVars['--arc-gap'] = `${gap}px`\n }\n\n const panelPaddingValue = toCssSize(panelPadding)\n if (panelPaddingValue !== undefined) {\n cssVars['--arc-panel-padding'] = panelPaddingValue\n }\n if (accentColor) {\n cssVars['--arc-accent'] = accentColor\n }\n if (tabBackground) {\n cssVars['--arc-tab-bg'] = tabBackground\n }\n if (tabHoverBackground) {\n cssVars['--arc-tab-hover-bg'] = tabHoverBackground\n }\n if (panelBackground) {\n cssVars['--arc-panel-bg'] = panelBackground\n }\n if (panelBorderColor) {\n cssVars['--arc-panel-border'] = panelBorderColor\n }\n cssVars['--arc-motion-duration'] = `${effectiveMotionDuration}ms`\n\n return cssVars\n }, [\n style,\n radius,\n gap,\n panelPadding,\n accentColor,\n tabBackground,\n tabHoverBackground,\n panelBackground,\n panelBorderColor,\n effectiveMotionDuration,\n ])\n\n const rootClassName = joinClassNames(\n 'arc-tabs-tw w-full text-[var(--arc-text)] [--arc-radius:14px] [--arc-gap:10px] [--arc-border-width:1px] [--arc-accent:#5b4ff1] [--arc-text:#171a2c] [--arc-tab-bg:#e7ebff] [--arc-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_calc(var(--arc-gap)+var(--arc-border-width))_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-border-width)*-1)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)+var(--arc-border-width))] before:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] before:bg-transparent before:opacity-0 before:content-[''] before:[box-shadow:0_var(--arc-radius)_0_var(--arc-panel-bg)] 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-border-width)*-1)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)+var(--arc-border-width))] after:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] after:bg-transparent after:opacity-0 after:content-[''] after:[box-shadow:0_var(--arc-radius)_0_var(--arc-panel-bg)] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_calc(var(--arc-gap)+var(--arc-border-width))_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 index > 0 &&\n 'before:-translate-x-full before:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] before:rounded-br-[var(--arc-radius)] before:[box-shadow:var(--arc-border-width)_var(--arc-radius)_0_var(--arc-panel-bg)]',\n index < items.length - 1 &&\n 'after:translate-x-full after:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] after:rounded-bl-[var(--arc-radius)] after:[box-shadow:calc(var(--arc-border-width)*-1)_var(--arc-radius)_0_var(--arc-panel-bg)]',\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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AAC,cAClD;AAAA,QAAC;AAAA;AAAA,UACC,KAAK,CAAC,SAAS;AACb,2BAAe,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 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;AAEO,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA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,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
|
@@ -854,7 +854,7 @@ function ArcTabsTailwind({
|
|
|
854
854
|
[indicator.x, indicator.width]
|
|
855
855
|
);
|
|
856
856
|
const indicatorClassName = joinClassNames2(
|
|
857
|
-
"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:
|
|
857
|
+
"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)]",
|
|
858
858
|
indicator.ready && "opacity-100",
|
|
859
859
|
classNames?.indicator
|
|
860
860
|
);
|
|
@@ -891,15 +891,15 @@ function ArcTabsTailwind({
|
|
|
891
891
|
classNames?.item
|
|
892
892
|
);
|
|
893
893
|
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-
|
|
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)]",
|
|
895
895
|
sizeClassMap[size],
|
|
896
896
|
fit === "equal" && "w-full justify-center",
|
|
897
897
|
selected ? joinClassNames2(
|
|
898
|
-
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)]
|
|
898
|
+
"z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] [box-shadow:0_var(--arc-gap)_0_var(--arc-panel-bg)]",
|
|
899
899
|
motionPreset === "expressive" ? "bg-transparent" : "bg-[var(--arc-panel-bg)]"
|
|
900
900
|
) : "enabled:hover:bg-[var(--arc-tab-hover-bg)] enabled:hover:translate-y-px enabled:active:translate-y-[2px]",
|
|
901
|
-
index > 0 && "before
|
|
902
|
-
index < items.length - 1 && "after:
|
|
901
|
+
selected && index > 0 && "before:opacity-100",
|
|
902
|
+
selected && index < items.length - 1 && "after:opacity-100",
|
|
903
903
|
selected ? classNames?.tabSelected : classNames?.tabUnselected,
|
|
904
904
|
disabled && classNames?.tabDisabled,
|
|
905
905
|
classNames?.tab
|
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_calc(var(--arc-gap)+var(--arc-border-width))_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-border-width)*-1)] before:h-[calc(var(--arc-radius)*2)] before:w-[calc(var(--arc-radius)+var(--arc-border-width))] before:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] before:bg-transparent before:opacity-0 before:content-[''] before:[box-shadow:0_var(--arc-radius)_0_var(--arc-panel-bg)] 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-border-width)*-1)] after:h-[calc(var(--arc-radius)*2)] after:w-[calc(var(--arc-radius)+var(--arc-border-width))] after:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] after:bg-transparent after:opacity-0 after:content-[''] after:[box-shadow:0_var(--arc-radius)_0_var(--arc-panel-bg)] after:transition-[opacity,transform] after:[transition-duration:var(--arc-motion-duration)] after:[transition-timing-function:cubic-bezier(0.22,1,0.36,1)]\",\n sizeClassMap[size],\n fit === 'equal' && 'w-full justify-center',\n selected\n ? joinClassNames(\n 'z-[3] rounded-b-none border-[var(--arc-panel-bg)] text-[var(--arc-accent)] before:opacity-100 after:opacity-100 [box-shadow:0_calc(var(--arc-gap)+var(--arc-border-width))_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 index > 0 &&\n 'before:-translate-x-full before:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] before:rounded-br-[var(--arc-radius)] before:[box-shadow:var(--arc-border-width)_var(--arc-radius)_0_var(--arc-panel-bg)]',\n index < items.length - 1 &&\n 'after:translate-x-full after:translate-y-[calc(var(--arc-gap)+var(--arc-border-width))] after:rounded-bl-[var(--arc-radius)] after:[box-shadow:calc(var(--arc-border-width)*-1)_var(--arc-radius)_0_var(--arc-panel-bg)]',\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,mBACe,KADf;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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AiB;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"]}
|
|
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,mBACe,KADf;AAnbJ,IAAM,iBAAiB,IAAI,UACzB,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AAEhC,IAAM,YAAY,CAAC,UACjB,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAE7C,IAAM,wBAAwB,CAAC,UAAwB,MAAM,UAAU,CAAC,SAAS,CAAC,KAAK,QAAQ;AAE/F,IAAM,oBAAoB,CAAC,UACzB,MAAM,OAAiB,CAAC,KAAK,MAAM,UAAU;AAC3C,MAAI,CAAC,KAAK,SAAU,KAAI,KAAK,KAAK;AAClC,SAAO;AACT,GAAG,CAAC,CAAC;AAEP,IAAM,sBAAsB,CAAC,gBAA0B,cAAsB,cAAsB;AACjG,MAAI,CAAC,eAAe,OAAQ,QAAO;AAEnC,QAAM,kBAAkB,eAAe,QAAQ,YAAY;AAC3D,MAAI,oBAAoB,IAAI;AAC1B,WAAO,cAAc,IAAK,eAAe,CAAC,KAAK,KAAO,eAAe,GAAG,EAAE,KAAK;AAAA,EACjF;AAEA,QAAM,gBAAgB,kBAAkB,YAAY,eAAe,UAAU,eAAe;AAC5F,SAAO,eAAe,YAAY,KAAK;AACzC;AAEO,SAAS,QAAQ;AAAA,EACtB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,OAAO;AAAA,EAC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