fictoan-react
Version:
A full-featured, designer-friendly, yet performant framework with plain-English props and focus on rapid iteration.
38 lines (37 loc) • 1.63 kB
TypeScript
import { default as React, ReactNode } from 'react';
import { CardProps } from '../Card/Card';
export type TickPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right" | "centre-left" | "center-left" | "centre-right" | "center-right" | "centre-top" | "center-top" | "center-bottom" | "centre-bottom" | "centre" | "center";
export interface OptionCardsProviderProps {
children: ReactNode;
allowMultipleSelections?: boolean;
showTickIcon?: boolean;
tickPosition?: TickPosition;
onSelectionChange?: (selectedIds: Set<string>) => void;
selectionLimit?: number;
defaultSelectedIds?: Set<string>;
}
export interface OptionCardProps extends CardProps {
id: string;
children: ReactNode;
disabled?: boolean;
}
export interface OptionCardsGroupRef {
selectAllOptions: () => void;
clearAllOptions: () => void;
setSelectedOptions: (ids: string[]) => void;
setSelectedIds: (ids: Set<string>) => void;
}
export declare const OptionCardsGroup: React.ForwardRefExoticComponent<OptionCardsProviderProps & React.RefAttributes<OptionCardsGroupRef>>;
export declare const useOptionCard: (id: string) => {
isSelected: boolean;
toggleSelection: () => void;
showTickIcon: boolean | undefined;
};
export declare const useOptionCardsGroup: () => {
selectAllOptions: (() => void) | undefined;
clearAllOptions: (() => void) | undefined;
setSelectedOptions: ((ids: string[]) => void) | undefined;
setSelectedIds: ((ids: Set<string>) => void) | undefined;
};
export declare const OptionCard: React.FC<OptionCardProps>;
//# sourceMappingURL=OptionCard.d.ts.map