import type { ReactNode } from "react"; import { ButtonSize, ButtonColor } from "../Button/Button"; export type DropdownButtonColor = Exclude; export type ContextMenu2ButtonContent = { type?: undefined; text: string; onClick: () => void; divideTop?: boolean; disabled?: boolean; icon?: ReactNode; color?: "danger"; checked?: boolean; onChange?: (checked: boolean) => void; }; export type ContextMenu2HeadingContent = { type: "heading"; text: string; divideTop?: boolean; }; export type ContextMenu2HelpTextContent = { type: "helpText"; text: string; prepend?: ReactNode; divideTop?: boolean; }; export type ContextMenu2ContentProp = ContextMenu2ButtonContent | ContextMenu2HeadingContent | ContextMenu2HelpTextContent; export type DropdownButtonProps = { size?: ButtonSize; color?: DropdownButtonColor; onClick?: () => void; split?: boolean; /** * ContextMenu2のコンテンツ */ contents?: ContextMenu2ContentProp[]; disabled?: boolean; children?: React.ReactNode; /** * ボタンに表示するアイコン */ icon?: ReactNode; /** * ボタンに表示する選択値。undefinedの場合はchildrenが使用されます。 */ selectedValue?: string; /** * ドロップダウンメニューの幅 */ menuWidth?: number; /** * ローディング状態を表示するかどうか。文字列を指定した場合はそれがローディングテキストとして使用されます。 * - `true`: デフォルトの"Loading..."テキストを使用 * - `string`: 指定した文字列をローディングテキストとして使用 * - `false` または `undefined`: ローディング状態を表示しない * * ボタンの内容に応じた動作: * - アイコンのみ: スピナーのみを表示(ローディングテキストは無視) * - テキストのみ: ローディングテキストのみを表示(`true`の場合はデフォルトで"Loading...") * - アイコン + テキスト: スピナー + ローディングテキストを表示(`true`の場合はデフォルトで"Loading...") */ loading?: boolean | string; /** * ドロップダウンメニューを開くトグルボタンに付ける accessible name。 * - split=true のときの分割トリガー(矢印のみのボタン) * - 単一トリガーが children を持たないとき(アイコンのみ/ローディング中) * のフォールバックとして使用されます。split モードのメインボタン (左側 * の onClick 用ボタン) には適用されないので、そちらが icon-only になる * 場合は呼び出し側で `children` か aria-label を渡してください。 * @default "メニューを開く" */ toggleAriaLabel?: string; }; export type DropdownButtonSizeConfig = { arrowIconSize: number; arrowButtonPadding: string; }; export declare const DROPDOWN_BUTTON_SIZES: Record;