import * as React$1 from 'react';
import React__default, { ReactElement, Component, ErrorInfo, ReactNode } from 'react';
import { VariantProps } from 'class-variance-authority';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { UseFormRegisterReturn } from 'react-hook-form';
import { JSONEditorPropsOptional } from 'vanilla-jsoneditor';

declare function getClassForSize(size?: string): string;
declare function getIconClassForSize(size?: string): string;
interface makeClassNameProps {
    size?: string;
    defaultClassName?: string;
    className?: string;
    error?: string;
    errorClassName?: string;
    disabled?: boolean;
    extras?: Array<string | undefined>;
}
declare function makeClassName({ size, defaultClassName, className, error, errorClassName, disabled, extras }: makeClassNameProps): string;
declare const buttonVariants: (props?: ({
    variant?: "default" | "destructive" | "outline" | "ghost" | "link" | "primary" | "secondary" | "create" | "submit" | "alert" | "dark" | "none" | null | undefined;
    size?: "xs" | "sm" | "lg" | "xlg" | "default" | "icon" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
declare function createButtonClass({ className, type, variant, size }: IButtonClassProps): string;

interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
    asChild?: boolean;
}

type IButtonTypes = ButtonProps['variant'];
interface IButtonClassProps {
    size?: string | null;
    type?: IButtonTypes;
    variant?: IButtonTypes;
    className?: string;
    defaultClassName?: string;
}
interface IButtonProps extends IButtonClassProps {
    testId?: string;
    onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>) => void;
    onSubmit?: (e?: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement, MouseEvent>) => unknown;
    disabled?: boolean;
    children?: React.ReactNode[] | React.ReactNode;
    label?: string;
    href?: string;
    target?: string;
    asChild?: boolean;
}

declare function Button({ testId, type, variant, size, children, label, href, target, onClick, onSubmit, className, defaultClassName, disabled, asChild }: IButtonProps): ReactElement;

interface IFallbackProps {
    error: Error;
}
interface Props {
    children?: ReactNode;
    FallbackComponent?: React__default.ComponentType<IFallbackProps>;
}
interface State {
    hasError: boolean;
    error?: Error;
}
declare class ErrorBoundary extends Component<Props, State> {
    constructor(props: Props);
    state: State;
    static getDerivedStateFromError(error: Error): State;
    componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
    render(): ReactNode;
}

interface IPropsWithChildren {
    children?: ReactNode;
}
interface IPropsWithClassName {
    className?: string;
    defaultClassName?: string;
    size?: string;
}

interface ITableColumn<T> {
    id: string;
    label: string | ReactNode;
    textOnlyLabel?: string;
    accessor?: (row: T) => ReactNode;
    textOnlyAccessor?: (row: T) => string;
    sortable?: boolean;
    headerClassName?: string;
    cellClassName?: string;
}
interface ITableRow {
    fullSpanContent?: ReactNode;
    fullSpanClassName?: string;
}
interface ITableOptions {
    paged?: boolean;
    scrollable?: boolean;
    defaultClassName?: string;
    defaultHeaderClassName?: string;
    defaultCellClassName?: string;
    className?: string;
}
type IDefaultTableRow = Record<string, any> & ITableRow;
interface ITableProps<TRowType extends IDefaultTableRow = IDefaultTableRow> {
    className?: string;
    tbodyClassName?: string;
    theadClassName?: string;
    rowClassName?: string;
    columns: Array<ITableColumn<TRowType>>;
    data: TRowType[];
    options?: ITableOptions;
    defaultFullSpanClassName?: string;
    fullSpanClassName?: string;
}

interface ILabelProps {
    label?: string | ReactNode;
    children?: ReactNode;
    defaultClassName?: string;
    className?: string;
    disabled?: boolean;
}
interface IDescriptionProps {
    description?: string;
    defaultClassName?: string;
    className?: string;
    disabled?: boolean;
}
interface ISelectOptionProps {
    label: string;
    value: string | number;
    [key: string]: string | number | boolean | Record<string, unknown>;
}
interface IRadioGroupOptionProps {
    label: string | ReactNode;
    value: string | number;
    [key: string]: string | number | boolean | Record<string, unknown> | ReactNode;
}
interface IInputProps extends IPropsWithChildren {
    id: string;
    testId: string;
    label?: string | ReactNode;
    description?: string | ReactNode;
    before?: ReactNode;
    after?: ReactNode;
    size?: string;
    defaultClassName?: string;
    className?: string;
    defaultWrapperClassName?: string;
    wrapperClassName?: string;
    error?: string;
    disabled?: boolean;
    validator?: UseFormRegisterReturn<any>;
}
interface IValueInputProps {
    value?: string | number;
    placeholder?: string;
}
interface ICheckboxInputProps extends IInputProps {
    wrapperClassName?: string;
    align?: 'left' | 'right' | 'none';
    value: boolean;
    onChange?: (v: boolean) => void;
}
interface ITextAreaProps extends IInputProps, IValueInputProps {
    onChange?: (v?: string) => void;
    cleaner?: (v?: string) => string;
    autofocus?: boolean;
    onFocus?: () => void;
    onBlur?: () => void;
}
interface ITextInputProps extends ITextAreaProps {
    onSubmit?: (v?: string | number) => void;
    submitOnEnter?: boolean;
    type?: 'text' | 'password';
}
interface ISelectProps extends IInputProps, IValueInputProps {
    onChange?: (op?: ISelectOptionProps) => void;
    onFocus?: () => void;
    onBlur?: () => void;
    value?: string | number;
    includePrompt?: boolean;
    options: ISelectOptionProps[];
    clearable?: boolean;
    variant?: IButtonClassProps['variant'];
}
interface IRadioGroupProps extends Omit<ISelectProps, 'options' | 'includePrompt' | 'onChange'> {
    options: IRadioGroupOptionProps[];
    onChange?: (op?: IRadioGroupOptionProps) => void;
}
type ISliderRangeValues = [number, number];
interface IRangeProps {
    min: number;
    max: number;
    step: number;
}
interface ISliderSharedProps {
    thumbClass?: string;
    retainUndefinedOnLoad?: boolean;
}
interface ISliderRangeProps extends IInputProps, IRangeProps, ISliderSharedProps {
    range?: ISliderRangeValues;
    onChange?: (v: ISliderRangeValues) => void;
    onChangeComplete?: (v: ISliderRangeValues) => void;
    rangeClass?: string;
    startThumbClass?: string;
    endThumbClass?: string;
}
interface ISliderProps extends IInputProps, IRangeProps, ISliderSharedProps {
    value?: number;
    onChange?: (v: number) => void;
    onChangeComplete?: (v: number) => void;
}

declare function Checkbox({ id, testId, value, error, disabled, onChange, defaultClassName, className, defaultWrapperClassName, wrapperClassName, size, label, description, after, before, align }: ICheckboxInputProps): ReactElement;

declare function RadixRadioGroup({ children, onChange, value, id, testId, options, label, description, before, after, size, defaultClassName, disabled, className, error }: IRadioGroupProps): ReactElement;

declare function Description({ description, defaultClassName, className, disabled }: IDescriptionProps): ReactElement;

declare function Input({ id, testId, value, onChange, onSubmit, submitOnEnter, error, size, defaultClassName, className, wrapperClassName, defaultWrapperClassName, disabled, placeholder, label, description, before, after, cleaner, autofocus, onBlur, onFocus, type, validator }: ITextInputProps): ReactElement;

declare function Label({ label, children, defaultClassName, className, disabled }: ILabelProps): ReactElement;

interface IToolTipProps extends IPropsWithChildren {
    content: ReactNode;
    delay?: number;
    defaultOpen?: boolean;
    className?: string;
    side?: 'top' | 'right' | 'bottom' | 'left';
    contentDefaultClassName?: string;
    contentClassName?: string;
    tooltipWrapperClassName?: string;
    dark?: boolean;
    useSpan?: boolean;
}
declare const RadixTooltip: ({ children, content, delay, defaultOpen, className, side, contentDefaultClassName, contentClassName, dark, useSpan }: IToolTipProps) => ReactElement;

declare function Select({ children, placeholder, includePrompt, onChange, onFocus, onBlur, value, id, testId, options, label, description, before, after, size, variant, defaultClassName, disabled, className, defaultWrapperClassName, wrapperClassName, error, clearable }: ISelectProps): ReactElement;

declare const SliderRange: ({ id, testId, error, size, disabled, label, description, before, after, max, min, step, range, onChange, onChangeComplete, wrapperClassName, thumbClass, rangeClass, startThumbClass, endThumbClass, retainUndefinedOnLoad }: ISliderRangeProps) => ReactElement;

declare const SliderSingle: ({ id, testId, error, size, disabled, label, description, before, after, max, min, step, value, onChange, onChangeComplete, defaultClassName, wrapperClassName, className, thumbClass, retainUndefinedOnLoad }: ISliderProps) => ReactElement;

declare function TextArea({ id, testId, value, onChange, error, size, defaultClassName, disabled, className, defaultWrapperClassName, wrapperClassName, placeholder, label, description, before, after, cleaner, autofocus }: ITextAreaProps): ReactElement;

interface JSONEditorComponent extends JSONEditorPropsOptional {
    className?: string;
}
declare function SvelteJSONEditor(props: JSONEditorComponent): ReactElement;

interface ILoaderExtend {
    spinnerClassName?: string;
}
declare const Loader: ({ defaultClassName, className, size, spinnerClassName }: IPropsWithClassName & ILoaderExtend) => ReactElement;

declare const ViewWithLoader: ({ data, isLoading, isFetching, error, children, defaultLoaderClassName, loaderClassName, keepExistingContentWhileLoading, ErrorComponent, LoaderComponent }: {
    data: any;
    isLoading: boolean;
    isFetching?: boolean;
    error: Error | null;
    children: ReactNode;
    defaultLoaderClassName?: string;
    loaderClassName?: string;
    keepExistingContentWhileLoading?: boolean;
    ErrorComponent?: (props: {
        error: Error;
    }) => ReactElement;
    LoaderComponent?: React__default.FC<{
        className?: string;
    }>;
}) => ReactElement;

interface IDialogProps {
    open: boolean;
    onClickTrigger: React__default.MouseEventHandler<HTMLButtonElement> | undefined;
    onEscapeKeyDown: ((event: KeyboardEvent) => void) | undefined;
    onClickClose: React__default.MouseEventHandler<SVGElement> | undefined;
    trigger: ReactElement;
    triggerWrapperClassName?: string;
    title: string;
    body: ReactElement;
}
declare const MobileDialog: (props: IDialogProps) => ReactElement;

declare const Table: <T extends IDefaultTableRow>({ columns, data, className, tbodyClassName, theadClassName, rowClassName, options, defaultFullSpanClassName }: ITableProps<T>) => ReactElement;

interface ITab {
    id: string;
    label: ReactElement | string;
    content?: ReactElement | string;
    children?: ReactElement | string;
    className?: string;
    defaultClassName?: string;
    navClassName?: string;
    activeNavClassName?: string;
    disabled?: boolean;
}
interface ITabProps {
    tabs?: ITab[];
    defaultTab?: string;
    selectedTab?: string;
    className?: string;
    defaultContentClassName?: string;
    navClassName?: string;
    tabNavClassName?: string;
    defaultTabNavClassName?: string;
    activeTabNavClassName?: string;
    defaultActiveTabNavClassName?: string;
    onChange?: (tab: string) => void;
    afterTabNavElements?: ReactNode;
    beforeTabNavElements?: ReactNode;
}

declare function Tabs({ tabs, defaultTab, selectedTab, className, defaultContentClassName, navClassName, tabNavClassName, defaultTabNavClassName, activeTabNavClassName, defaultActiveTabNavClassName, onChange, beforeTabNavElements, afterTabNavElements }: ITabProps): ReactElement;

declare function Accordion({ tabs, defaultTab, selectedTab, className, defaultContentClassName, navClassName, tabNavClassName, defaultTabNavClassName, onChange }: Omit<ITabProps, 'onChange'> & {
    onChange?: (tab: string | undefined) => void;
}): ReactElement;
declare function MultiAccordion({ tabs, defaultTab, selectedTabs, selectAll, className, defaultContentClassName, navClassName, tabNavClassName, defaultTabNavClassName, onChange }: Omit<ITabProps, 'onChange' | 'selectedTab'> & {
    selectedTabs?: string[];
    selectAll?: boolean;
    onChange?: (tabs: string[]) => void;
}): ReactElement;

interface ISignUpProps {
    firstName?: string;
    lastName?: string;
    email?: string;
    password?: string;
    confirmPassword?: string;
    onSuccess?: () => void;
    onFailure?: () => void;
}
declare function SignUp({ firstName, lastName, email, password, confirmPassword, onSuccess, onFailure }: ISignUpProps): ReactElement;

interface ISignInProps {
    onSuccess?: () => void;
    onFailure?: () => void;
}
declare function SignIn({ onSuccess, onFailure }: ISignInProps): ReactElement;

interface IAuthProps {
    signUpProps?: ISignUpProps;
    signInProps?: ISignInProps;
}
declare function Auth({ signUpProps, signInProps }: IAuthProps): ReactElement;

interface IRequestPasswordReset {
    onSuccess?: () => void;
    onFailure?: () => void;
}
declare function RequestPasswordReset({ onSuccess, onFailure }: IRequestPasswordReset): ReactElement;

interface IResetPassword {
    password?: string;
    confirmPassword?: string;
    oneTimePassword?: string;
    onSuccess?: () => void;
    onFailure?: () => void;
}
declare function ResetPassword({ oneTimePassword, onSuccess, onFailure }: IResetPassword): ReactElement;

interface IEventDataProps {
    data?: any;
    nativeEvent?: Event;
}
interface IEventWithData extends IEventDataProps {
    type: string;
}
type IEventCallback = (event: IEventWithData) => void;
interface IEventManager {
    addEventListener: (eventType: string, callback: IEventCallback) => void;
    removeEventListener: (eventType: string, callback: IEventCallback) => void;
    dispatchEvent: (event: IEventWithData) => void;
}

declare class EventManager implements IEventManager {
    _eventListeners: Record<string, IEventCallback[]>;
    on(eventType: string, callback: IEventCallback): void;
    addEventListener(eventType: string, callback: IEventCallback): void;
    off(eventType: string, callback: IEventCallback): void;
    removeEventListener(eventType: string, callback: IEventCallback): void;
    dispatchEvent(event: IEventWithData): void;
    dispatchEventWithData(eventType: string, data?: any, nativeEvent?: Event): void;
}

declare class EventWithData implements IEventWithData {
    type: string;
    data: any;
    nativeEvent?: Event;
    constructor(type: string, props: IEventDataProps);
}

interface INumberFormatOptions {
    maxDecimals?: number;
}
declare function formatNumber(n: number | undefined, o?: INumberFormatOptions): string;
declare function formatNumbers(ns: Array<number | undefined>, o?: INumberFormatOptions): string[];
declare function formatRange(ns: number[], o: INumberFormatOptions): string;

declare const sleep: (waitTime: number) => Promise<void>;

declare const index_buttonVariants: typeof buttonVariants;
declare const index_createButtonClass: typeof createButtonClass;
declare const index_formatNumber: typeof formatNumber;
declare const index_formatNumbers: typeof formatNumbers;
declare const index_formatRange: typeof formatRange;
declare const index_getClassForSize: typeof getClassForSize;
declare const index_getIconClassForSize: typeof getIconClassForSize;
declare const index_makeClassName: typeof makeClassName;
declare const index_sleep: typeof sleep;
declare namespace index {
  export {
    index_buttonVariants as buttonVariants,
    index_createButtonClass as createButtonClass,
    index_formatNumber as formatNumber,
    index_formatNumbers as formatNumbers,
    index_formatRange as formatRange,
    index_getClassForSize as getClassForSize,
    index_getIconClassForSize as getIconClassForSize,
    index_makeClassName as makeClassName,
    index_sleep as sleep,
  };
}

export { Accordion, Auth, Button, Checkbox, Description, ErrorBoundary, EventManager, EventWithData, ICheckboxInputProps, IDefaultTableRow, IDescriptionProps, IEventCallback, IEventDataProps, IEventManager, IEventWithData, IInputProps, ILabelProps, IPropsWithChildren, IPropsWithClassName, IRadioGroupOptionProps, IRadioGroupProps, ISelectOptionProps, ISelectProps, ISliderProps, ISliderRangeProps, ISliderRangeValues, ITab, ITableColumn, ITableOptions, ITableProps, ITableRow, ITextAreaProps, ITextInputProps, Input, SvelteJSONEditor as JSONEditor, Label, Loader, MobileDialog, MultiAccordion, RadixRadioGroup as RadioGroup, RequestPasswordReset, ResetPassword, Select as SelectInput, SignIn, SignUp, SliderSingle as Slider, SliderRange, Table, Tabs, TextArea, RadixTooltip as Tooltip, ViewWithLoader, index as utils };
