{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "tabs-glass", "type": "registry:ui", "title": "Tabs Glass", "description": "TabsGlass Component (Radix UI based)", "dependencies": [ "@radix-ui/react-tabs", "react", "shadcn-glass-ui" ], "registryDependencies": [ "cn" ], "files": [ { "path": "components/glass/ui/tabs-glass.tsx", "type": "registry:component", "content": "/* eslint-disable react-refresh/only-export-components */\n/**\n * TabsGlass Component (Radix UI based)\n *\n * Glass-themed tab navigation built on Radix UI primitives with:\n * - 100% shadcn/ui type compatibility\n * - Theme-aware styling (glass/light/aurora)\n * - Active tab indicator\n * - Full keyboard navigation (Arrow keys, Home, End)\n * - Support for orientation, dir, activationMode\n *\n * @since v2.2.6 - Migrated to Radix UI primitives for full type compatibility\n */\n\nimport * as React from 'react';\nimport * as TabsPrimitive from '@radix-ui/react-tabs';\nimport { cn } from '@/lib/utils';\nimport '@/glass-theme.css';\n\n// ========================================\n// TYPES\n// ========================================\n\n/**\n * Legacy TabItem interface for backwards compatibility\n */\nexport interface TabItem {\n readonly id: string;\n readonly label: string;\n}\n\n/**\n * Props for TabsGlass Root component\n *\n * Extends Radix UI Tabs.Root props for 100% shadcn/ui compatibility.\n * All Radix props are supported including: value, defaultValue, onValueChange,\n * orientation, dir, activationMode.\n *\n * **Type Compatibility (v2.3.1+):**\n * - Extends `React.ComponentPropsWithoutRef`\n * - No more `as unknown as` type assertions needed\n * - Full IntelliSense for all Radix props\n *\n * **New props from Radix:**\n * - `orientation`: 'horizontal' | 'vertical' - Tab layout direction\n * - `dir`: 'ltr' | 'rtl' - Text direction for RTL support\n * - `activationMode`: 'automatic' | 'manual' - Tab activation behavior\n *\n * @accessibility\n * - **Keyboard Navigation:** Arrow keys navigate between tabs (respects orientation)\n * - **Focus Management:** Visible focus ring using CSS variables\n * - **Screen Readers:** Radix UI handles all ARIA attributes automatically\n * - **RTL Support:** Full RTL support via `dir` prop\n *\n * @example\n * ```tsx\n * // Basic usage\n * \n * \n * Tab 1\n * Tab 2\n * \n * Content 1\n * Content 2\n * \n *\n * // Vertical tabs\n * \n * \n * Tab 1\n * Tab 2\n * \n * Content 1\n * \n *\n * // Manual activation (click required, not focus)\n * \n * ...\n * \n * ```\n *\n * @since v2.3.0 - Added shadcn/ui compatible separate exports\n * @since v2.2.6 - Migrated to Radix UI primitives\n */\nexport type TabsRootProps = React.ComponentPropsWithoutRef;\n\n/**\n * Props for TabsList component\n */\nexport type TabsListProps = React.ComponentPropsWithoutRef;\n\n/**\n * Props for TabsTrigger component\n */\nexport type TabsTriggerProps = React.ComponentPropsWithoutRef;\n\n/**\n * Props for TabsContent component\n */\nexport type TabsContentProps = React.ComponentPropsWithoutRef;\n\n// ========================================\n// COMPONENTS\n// ========================================\n\n/**\n * TabsRoot - Root container for tabs\n */\nfunction TabsRoot({ className, ...props }: TabsRootProps) {\n return (\n \n );\n}\n\n/**\n * TabsList - Container for tab triggers\n */\nconst TabsList = React.forwardRef, TabsListProps>(\n ({ className, ...props }, ref) => (\n \n )\n);\n\nTabsList.displayName = 'TabsList';\n\n/**\n * TabsTrigger - Individual tab button\n */\nconst TabsTrigger = React.forwardRef<\n React.ElementRef,\n TabsTriggerProps\n>(({ className, children, ...props }, ref) => (\n \n {children}\n \n));\n\nTabsTrigger.displayName = 'TabsTrigger';\n\n/**\n * TabsContent - Content panel for a tab\n */\nconst TabsContent = React.forwardRef<\n React.ElementRef,\n TabsContentProps\n>(({ className, ...props }, ref) => (\n \n));\n\nTabsContent.displayName = 'TabsContent';\n\n// ========================================\n// COMPOUND COMPONENT EXPORT\n// ========================================\n\n/**\n * TabsGlass - Compound Component API\n *\n * @example\n * ```tsx\n * // Compound API (TabsGlass.Root pattern)\n * \n * \n * Overview\n * Analytics\n * \n * \n *

Overview content

\n *
\n * \n *

Analytics content

\n *
\n *
\n *\n * // shadcn/ui compatible API (separate imports)\n * import { Tabs, TabsList, TabsTrigger, TabsContent } from 'shadcn-glass-ui'\n * \n * \n * Overview\n * Analytics\n * \n * Overview content\n * Analytics content\n * \n * ```\n *\n * @since v1.0.0 - Legacy API removed (tabs/activeTab/onChange props)\n * @since v2.3.0 - Added shadcn/ui compatible separate exports\n * @since v2.2.6 - Migrated to Radix UI primitives\n */\nexport const TabsGlass = {\n Root: TabsRoot,\n List: TabsList,\n Trigger: TabsTrigger,\n Content: TabsContent,\n};\n\n// ========================================\n// SHADCN/UI COMPATIBLE EXPORTS\n// ========================================\n\n/**\n * Tabs - shadcn/ui compatible alias for TabsGlass.Root\n */\nexport const Tabs = TabsRoot;\n\nexport { TabsList, TabsTrigger, TabsContent };\n" } ], "categories": [ "ui" ], "cssVars": { "light": { "--glass-bg": "rgba(255, 255, 255, 0.1)", "--glass-border": "rgba(255, 255, 255, 0.2)", "--blur-sm": "8px", "--blur-md": "16px", "--blur-lg": "24px" }, "dark": { "--glass-bg": "rgba(255, 255, 255, 0.05)", "--glass-border": "rgba(255, 255, 255, 0.1)", "--blur-sm": "8px", "--blur-md": "16px", "--blur-lg": "24px" } } }