krypton-ui
Version:
<h1 align="center"> <p align="center"><a href="https://krypton-ui.com"><img src="https://user-images.githubusercontent.com/7073241/224507377-395bffc0-9ff7-4d74-865b-f734394a7e7e.png" alt="Krypton" width="200"></a></p> </h1>
49 lines (48 loc) • 1.63 kB
TypeScript
import { ComponentPropsWithoutRef } from "react";
import { Color } from "../../types";
export type Orientation = "horizontal" | "vertical";
export type Alignment = "left" | "right";
type TabCommonType = {
children: React.ReactNode;
activeTab?: number;
};
type VariantTabsType = {
orientation?: Orientation;
alignment?: Alignment;
};
type OnChangeColorType = {
onChange?: (value: number) => void;
color?: Color;
};
type TabType = VariantTabsType & OnChangeColorType & {
label?: string | React.ReactNode;
value?: number;
disabled?: boolean;
active?: boolean;
alignment?: Alignment;
};
type TabPanelType = TabCommonType & {
index?: number;
};
export type VariantTabsStyledProps = VariantTabsType;
export type LinkStyledProps = VariantTabsStyledProps & {
disabled: boolean;
onClick: () => void;
color?: Color;
active?: boolean;
};
export type PanelStyledProps = {
activeTab?: number;
index?: number;
};
export type ContentStyledProps = {
orientation?: Orientation;
};
export type TabListProps = ComponentPropsWithoutRef<"ul"> & TabCommonType & VariantTabsType & OnChangeColorType;
export type TabPanelsProps = ComponentPropsWithoutRef<"div"> & TabCommonType & VariantTabsType;
export type TabsProps = ComponentPropsWithoutRef<"div"> & TabCommonType & VariantTabsType;
export type TabProps = ComponentPropsWithoutRef<"li"> & TabType;
export type TabPanelProps = ComponentPropsWithoutRef<"div"> & TabPanelType;
export type TabContentProps = ComponentPropsWithoutRef<"div"> & TabCommonType;
export type TabsVariantsProps = VariantTabsType & TabType;
export {};