import * as React from "react"; import { IconName } from "../Icon/Icon"; import { SwitchSize, SwitchVariant } from "./types"; import type { Placement } from "@floating-ui/react"; type Case = { name: string; value?: string | number; /** * 個別のアイテムを無効化 * @default false */ disabled?: boolean; }; type CaseWithIcon = Case & { icon: IconName; disabled?: boolean; }; export type SwitchProps = { cases: Case[] | CaseWithIcon[]; value: string | number; onChange?: (value: string | number) => void; /** * コンポーネントのサイズ * @default "medium" */ size?: SwitchSize; /** * コンポーネントのバリアント * @default "light" */ variant?: SwitchVariant; /** * コンポーネント全体を無効化 * @default false */ disabled?: boolean; /** * 幅を親要素に合わせる * @default false */ fullWidth?: boolean; /** * 幅を明示的に指定 */ width?: string | number; /** * ツールチップを表示するかどうか * @default false */ showTooltip?: boolean; /** * ツールチップの表示方向の優先順位 * @default ["top-start", "bottom-start", "auto"] */ tooltipPosition?: (Placement | "auto")[]; }; export type IndicatorStyle = { width?: number; left?: number; }; declare const Switch: React.ForwardRefExoticComponent>; export default Switch;