UNPKG

@spark-ui/components

Version:

Spark (Leboncoin design system) components.

61 lines (55 loc) 2.11 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import * as collapsible from '@zag-js/collapsible'; import { ComponentProps, Ref, ComponentPropsWithoutRef } from 'react'; interface CollapsibleProps extends ComponentProps<'div'> { /** * Change the default rendered element for the one passed as a child, merging their props and behavior. */ asChild?: boolean; /** * The open state of the collapsible when it is initially rendered. Use when you do not need to control its open state. */ defaultOpen?: boolean; /** * When `true`, prevents the user from interacting with the collapsible. */ disabled?: boolean; /** * Event handler called when the open state of the collapsible changes. */ onOpenChange?: (open: boolean) => void; /** * The controlled open state of the collapsible. Must be used in conjunction with `onOpenChange`. */ open?: boolean; /** * The ids of the elements in the collapsible. Useful for composition */ ids?: collapsible.Props['ids']; ref?: Ref<HTMLDivElement>; } declare const Collapsible$1: { ({ asChild, children, defaultOpen, disabled, onOpenChange, open, ids, ref, ...props }: CollapsibleProps): react_jsx_runtime.JSX.Element; displayName: string; }; interface CollapsibleContentProps extends ComponentPropsWithoutRef<'div'> { asChild?: boolean; ref?: Ref<HTMLDivElement>; } declare const Content: { ({ asChild, className, children, ref, ...props }: CollapsibleContentProps): react_jsx_runtime.JSX.Element; displayName: string; }; interface CollapsibleTriggerProps extends ComponentPropsWithoutRef<'button'> { asChild?: boolean; ref?: Ref<HTMLButtonElement>; } declare const Trigger: { ({ asChild, children, ref, ...props }: CollapsibleTriggerProps): react_jsx_runtime.JSX.Element; displayName: string; }; declare const Collapsible: typeof Collapsible$1 & { Trigger: typeof Trigger; Content: typeof Content; }; export { Collapsible, type CollapsibleContentProps, type CollapsibleProps, type CollapsibleTriggerProps };