import clsx from "clsx";
import {
Tab,
TabList,
type TabListProps,
TabPanel,
type TabPanelProps,
type TabProps,
Tabs,
type TabsProps,
} from "react-aria-components";
import buttonStyles from "./Button.module.css";
import styles from "./Tabs.module.css";
interface SendouTabsProps extends TabsProps {
/** Should there be padding above the panels. Defaults to true, pass in false if the panel content is managing its own padding. */
padded?: boolean;
/** Hide tabs if only one tab shown? Defaults to true. */
disappearing?: boolean;
}
/**
* Renders a set of accessible tabs using the provided props.
*
* This component is a wrapper around the `Tabs` component, forwarding all props.
*
* @param props - The properties to pass to the underlying `Tabs` component.
* @returns The rendered tab interface.
*
* @url https://react-spectrum.adobe.com/react-aria/Tabs.html
*
* @example
*
*
* Shooter
* Roller
* Charger
*
*
* Splattershot, Aerospray, etc.
*
*
* Splat Roller, Dynamo Roller, etc.
*
*
* Splat Charger, E-liter, etc.
*
*
*/
export function SendouTabs({
padded = true,
disappearing = true,
className,
...rest
}: SendouTabsProps) {
return (
);
}
interface SendouTabProps extends TabProps {
icon?: React.ReactNode;
number?: number;
children?: React.ReactNode;
}
export function SendouTab({ icon, children, number, ...rest }: SendouTabProps) {
return (
{icon}
{children}
{typeof number === "number" && number !== 0 && (
{number}
)}
);
}
interface SendouTabListProps extends TabListProps {
sticky?: boolean;
/** Should tabs take 100% width with equal distribution? */
fullWidth?: boolean;
}
export function SendouTabList({
sticky,
fullWidth,
...rest
}: SendouTabListProps) {
return (