@uva-glass/component-library
Version:
React components UvA
24 lines (23 loc) • 958 B
TypeScript
export type CheckboxLeaf = {
itemName: string;
itemValue: string;
disabled?: boolean;
};
export type CheckboxBranch = {
itemName: string;
children: CheckboxLeaf[];
};
export interface CheckboxTreeProps {
/** The title of the component. */
title?: string;
/** Array of checkbox groups with a label and array of children (itemName, itemValue and disabled boolean). */
checkboxTree: CheckboxBranch[];
/** Array of selected values. */
selectedValues?: string[];
/** `true` if the font-weight needs to be unset; otherwise, `false`. The default is `false`. */
noLabelFrontWeight?: boolean;
/** Returns array of selected values. */
onChange?: (value: string[]) => void;
}
/** Represents a component to render a tree of checkboxes. */
export declare const CheckboxTree: ({ title, checkboxTree, selectedValues, noLabelFrontWeight, onChange, }: CheckboxTreeProps) => import("react/jsx-runtime").JSX.Element;