import clsx from "clsx"; import { forwardRef } from "react"; import styles from "./styles.module.scss"; export const tabClassNames = { tab: styles.Block, tabActive: styles["Block--active"], list: styles.list, panel: styles.panel, group: styles.group, }; type TabApi = ReturnType> & { Group: typeof TabGroup; List: typeof TabList; Panel: typeof TabPanel; }; type BaseProps = { className?: string; children: React.ReactNode; }; export type TabGroupProps = BaseProps; function TabGroup({ children, className }: TabGroupProps) { return
{children}
; } type TabListProps = BaseProps; function TabList({ children, className }: TabListProps) { return
{children}
; } export type TabPanelProps = BaseProps; function TabPanel({ children, className }: TabPanelProps) { return
{children}
; } type TabProps = { active?: boolean } & BaseProps; export const Tab = forwardRef( ({ active, children, className }, ref) => { return ( ); } ) as TabApi; Tab.displayName = "Tab"; Tab.Group = TabGroup; Tab.List = TabList; Tab.Panel = TabPanel;