@spark-ui/components
Version:
Spark (Leboncoin design system) components.
143 lines (128 loc) • 4.48 kB
text/typescript
import { Dialog as Dialog$1 } from 'radix-ui';
import { ReactElement, ReactNode, Ref } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
import * as react_jsx_runtime from 'react/jsx-runtime';
interface DialogProps {
/**
* Children of the component.
*/
children?: Dialog$1.DialogProps['children'];
/**
* Specifies if the dialog is open or not.
*/
open?: Dialog$1.DialogProps['open'];
/**
* Default open state.
*/
defaultOpen?: Dialog$1.DialogProps['defaultOpen'];
/**
* Handler executen on every dialog open state change.
*/
onOpenChange?: Dialog$1.DialogProps['onOpenChange'];
/**
* Specifies if the dialog is a modal.
*/
modal?: Dialog$1.DialogProps['modal'];
}
declare const Dialog: {
({ children, ...rest }: DialogProps): ReactElement;
displayName: string;
};
declare const dialogBodyStyles: (props?: ({
inset?: boolean | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type DialogBodyStylesProps = VariantProps<typeof dialogBodyStyles>;
interface BodyProps extends DialogBodyStylesProps {
children: ReactNode;
className?: string;
tabIndex?: number;
ref?: Ref<HTMLDivElement>;
}
declare const Body: {
({ children, className, inset, ref, ...rest }: BodyProps): ReactElement;
displayName: string;
};
type CloseProps = Dialog$1.DialogCloseProps & {
ref?: Ref<HTMLButtonElement>;
};
declare const Close: {
(props: CloseProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const dialogContentStyles: (props?: ({
size?: "fullscreen" | "sm" | "md" | "lg" | null | undefined;
isNarrow?: boolean | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type DialogContentStylesProps = VariantProps<typeof dialogContentStyles>;
interface ContentProps extends Dialog$1.DialogContentProps, DialogContentStylesProps {
/**
* When set to true, the content will adjust its width to fit the content rather than taking up the full available width.
*/
isNarrow?: boolean;
ref?: Ref<HTMLDivElement>;
}
declare const Content: {
({ children, className, isNarrow, size, onInteractOutside, ref, ...rest }: ContentProps): ReactElement;
displayName: string;
};
type DescriptionProps = Dialog$1.DialogDescriptionProps & {
ref?: Ref<HTMLParagraphElement>;
};
declare const Description: {
(props: DescriptionProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
interface FooterProps {
children: ReactNode;
className?: string;
ref?: Ref<HTMLDivElement>;
}
declare const Footer: {
({ children, className, ref, ...rest }: FooterProps): ReactElement;
displayName: string;
};
interface HeaderProps {
children: ReactNode;
className?: string;
ref?: Ref<HTMLDivElement>;
}
declare const Header: {
({ children, className, ref, ...rest }: HeaderProps): ReactElement;
displayName: string;
};
type OverlayProps = Dialog$1.DialogOverlayProps & {
ref?: Ref<HTMLDivElement>;
};
declare const Overlay: {
({ className, ref, ...rest }: OverlayProps): ReactElement | null;
displayName: string;
};
type PortalProps = Dialog$1.DialogPortalProps;
declare const Portal: {
({ children, ...rest }: PortalProps): ReactElement;
displayName: string;
};
type TitleProps = Dialog$1.DialogTitleProps & {
ref?: Ref<HTMLHeadingElement>;
};
declare const Title: {
({ className, ref, ...others }: TitleProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
interface TriggerProps {
/**
* Children of the component.
*/
children?: ReactNode;
/**
* Change the component to the HTML tag or custom component of the only child.
*/
asChild?: Dialog$1.DialogTriggerProps['asChild'];
ref?: Ref<HTMLButtonElement>;
}
declare const Trigger: {
(props: TriggerProps): ReactElement;
displayName: string;
};
export { Body as B, type CloseProps as C, Dialog as D, Footer as F, Header as H, Overlay as O, Portal as P, Trigger as T, Content as a, Close as b, Title as c, Description as d, type DialogProps as e, type ContentProps as f, type HeaderProps as g, type BodyProps as h, type FooterProps as i, type TriggerProps as j, type OverlayProps as k, type PortalProps as l, type TitleProps as m, type DescriptionProps as n };