@helpwave/hightide
Version:
helpwave's component and theming library
65 lines (62 loc) • 2.15 kB
TypeScript
import * as react from 'react';
import { PropsWithChildren, ReactNode } from 'react';
import * as react_jsx_runtime from 'react/jsx-runtime';
type IconBuilder = (expanded: boolean) => ReactNode;
type ExpandableProps = PropsWithChildren<{
label: ReactNode;
icon?: IconBuilder;
isExpanded?: boolean;
onChange?: (isExpanded: boolean) => void;
/**
* Whether the expansion should only happen when the header is clicked or on the entire component
*/
clickOnlyOnHeader?: boolean;
disabled?: boolean;
className?: string;
headerClassName?: string;
contentClassName?: string;
contentExpandedClassName?: string;
}>;
type ExpansionIconProps = {
isExpanded: boolean;
className?: string;
};
declare const ExpansionIcon: ({ isExpanded, className }: ExpansionIconProps) => react_jsx_runtime.JSX.Element;
/**
* A Component for showing and hiding content
*/
declare const Expandable: react.ForwardRefExoticComponent<{
label: ReactNode;
icon?: IconBuilder;
isExpanded?: boolean;
onChange?: (isExpanded: boolean) => void;
/**
* Whether the expansion should only happen when the header is clicked or on the entire component
*/
clickOnlyOnHeader?: boolean;
disabled?: boolean;
className?: string;
headerClassName?: string;
contentClassName?: string;
contentExpandedClassName?: string;
} & {
children?: ReactNode | undefined;
} & react.RefAttributes<HTMLDivElement>>;
declare const ExpandableUncontrolled: react.ForwardRefExoticComponent<{
label: ReactNode;
icon?: IconBuilder;
isExpanded?: boolean;
onChange?: (isExpanded: boolean) => void;
/**
* Whether the expansion should only happen when the header is clicked or on the entire component
*/
clickOnlyOnHeader?: boolean;
disabled?: boolean;
className?: string;
headerClassName?: string;
contentClassName?: string;
contentExpandedClassName?: string;
} & {
children?: ReactNode | undefined;
} & react.RefAttributes<HTMLDivElement>>;
export { Expandable, type ExpandableProps, ExpandableUncontrolled, ExpansionIcon, type ExpansionIconProps };