import React, { forwardRef } from 'react'; import { cn, focusRing, surfaceClasses } from '../common'; import { useTabsContext } from './_internal/tabsContext'; /* ───────────────────────────────────────────────────────────────────────── PixelTabsPanel — tabpanel content region for a single tab value. ───────────────────────────────────────────────────────────────────────── */ /** Public prop bag for {@link PixelTabsPanel}. */ export interface PixelTabsPanelProps extends Omit, 'role'> { /** Tab id this panel belongs to — must match a {@link PixelTabsTrigger} value. */ value: string; /** Override the root's keepMounted setting for this panel. */ keepMounted?: boolean; /** Render with surface-aware border + radius chrome. Defaults to false (no chrome). */ bordered?: boolean; } export const PixelTabsPanel = forwardRef( function PixelTabsPanel({ value, keepMounted, bordered = false, className, children, ...rest }, ref) { const ctx = useTabsContext('PixelTabs.Panel'); const s = surfaceClasses(ctx.surface); const selected = ctx.active === value; const shouldMount = (keepMounted ?? ctx.keepMounted) || selected; if (!shouldMount) return null; return ( ); }, ); PixelTabsPanel.displayName = 'PixelTabs.Panel';