@adyen/adyen-platform-experience-web
Version:

18 lines • 909 B
TypeScript
export type TabbedControlOptions<OptionId extends string> = readonly {
id: OptionId;
disabled?: boolean;
}[];
export interface TabbedControlConfig<OptionId extends string, Options extends TabbedControlOptions<OptionId>> {
onChange?: <ActiveOption extends Options[number]>(activeOption: ActiveOption) => void;
activeOption?: OptionId;
options: Options;
}
export declare const useTabbedControl: <OptionId extends string, Options extends TabbedControlOptions<OptionId>>({ options, activeOption: activeOptionFromProps, onChange, }: TabbedControlConfig<OptionId, Options>) => {
readonly activeIndex: number;
readonly onClick: (event: MouseEvent) => void;
readonly onKeyDown: (event: KeyboardEvent) => void;
readonly refs: ((el: HTMLButtonElement | null) => any)[];
readonly uniqueId: string;
};
export default useTabbedControl;
//# sourceMappingURL=useTabbedControl.d.ts.map