@spark-ui/components
Version:
Spark (Leboncoin design system) components.
94 lines (81 loc) • 3.25 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { Popover as Popover$2 } from 'radix-ui';
import { Ref, ReactNode, ReactElement } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
type PopoverIntent = 'surface' | 'main' | 'support' | 'accent' | 'basic' | 'success' | 'alert' | 'danger' | 'info' | 'neutral';
type PopoverProps = Popover$2.PopoverProps & {
intent?: PopoverIntent;
};
declare const Popover$1: {
({ children, intent, modal, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type AnchorProps = Popover$2.PopoverAnchorProps & {
ref?: Ref<HTMLDivElement>;
};
declare const Anchor: {
({ asChild, children, ref, ...rest }: AnchorProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type ArrowProps = Popover$2.PopoverArrowProps & {
ref?: Ref<SVGSVGElement>;
};
declare const Arrow: {
({ asChild, width, height, className, ref, ...rest }: ArrowProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type CloseButtonProps = Popover$2.PopoverCloseProps & {
'aria-label': string;
ref?: Ref<HTMLButtonElement>;
};
declare const CloseButton: {
({ "aria-label": ariaLabel, className, ref, ...rest }: CloseButtonProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const styles: (props?: ({
intent?: "main" | "surface" | "support" | "accent" | "basic" | "success" | "alert" | "danger" | "info" | "neutral" | null | undefined;
matchTriggerWidth?: boolean | null | undefined;
enforceBoundaries?: boolean | null | undefined;
inset?: boolean | null | undefined;
elevation?: "popover" | "dropdown" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type StylesProps = VariantProps<typeof styles>;
type ContentProps = Popover$2.PopoverContentProps & StylesProps & {
ref?: Ref<HTMLDivElement>;
};
declare const Content: {
({ className, children, matchTriggerWidth, align, arrowPadding, asChild, avoidCollisions, "aria-labelledby": ariaLabelledBy, collisionBoundary, collisionPadding, hideWhenDetached, side, sideOffset, sticky, inset, elevation, ref, ...rest }: ContentProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
interface HeaderProps {
children: ReactNode;
className?: string;
ref?: Ref<HTMLDivElement>;
}
declare const Header: {
({ children, className, ref, ...rest }: HeaderProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type PortalProps = Popover$2.PopoverPortalProps;
declare const Portal: {
({ children, ...rest }: PortalProps): ReactElement;
displayName: string;
};
type TriggerProps = Popover$2.PopoverTriggerProps & {
ref?: Ref<HTMLButtonElement>;
};
declare const Trigger: {
({ asChild, children, ref, ...rest }: TriggerProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const Popover: typeof Popover$1 & {
Anchor: typeof Anchor;
Arrow: typeof Arrow;
CloseButton: typeof CloseButton;
Content: typeof Content;
Header: typeof Header;
Portal: typeof Portal;
Trigger: typeof Trigger;
};
export { Popover };