@spark-ui/components
Version:
Spark (Leboncoin design system) components.
98 lines (87 loc) • 3.71 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { ComponentPropsWithoutRef, MouseEvent, Ref } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
declare const chipStyles: (props?: ({
design?: "outlined" | "tinted" | "dashed" | null | undefined;
intent?: "main" | "support" | "basic" | "accent" | "success" | "alert" | "danger" | "info" | "neutral" | "surface" | null | undefined;
disabled?: boolean | null | undefined;
hasClearButton?: boolean | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ChipStylesProps = VariantProps<typeof chipStyles>;
type ChipPrimitiveProps = Omit<ComponentPropsWithoutRef<'button'>, 'onClick' | 'disabled' | 'type'>;
interface ChipProps extends ChipPrimitiveProps, Omit<ChipStylesProps, 'hasClearButton'> {
/**
* Configures a toggleButton aria-pressed initial value
*/
defaultPressed?: boolean;
/**
* Configures a toggleButton aria-pressed value
*/
pressed?: boolean;
/**
* Change the component to the HTML tag or custom component of the only child.
*/
asChild?: boolean;
/**
* Event handler fired each clicking event
*/
onClick?: (event: MouseEvent<HTMLButtonElement>, args: {
pressed: boolean;
value?: number | string | readonly string[];
}) => void;
/**
* Clear chip handler
*/
onClear?: (event?: MouseEvent<HTMLButtonElement>) => void;
ref?: Ref<HTMLButtonElement | HTMLDivElement>;
}
declare const Chip$1: {
({ design, disabled, children, intent, defaultPressed, pressed, asChild, className, onClick, onClear, ref: forwardedRef, ...otherProps }: ChipProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const chipClearButtonWrapperStyles: (props?: ({
disabled?: boolean | null | undefined;
isBordered?: boolean | null | undefined;
design?: "outlined" | "tinted" | "dashed" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ChipClearButtonStylesProps = VariantProps<typeof chipClearButtonWrapperStyles>;
interface ChipClearButtonProps extends ComponentPropsWithoutRef<'span'>, ChipClearButtonStylesProps {
label: string;
ref?: Ref<HTMLSpanElement>;
}
declare const ChipClearButton: {
({ children, tabIndex, label, ref: forwardedRef, }: ChipClearButtonProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type ChipContentProps = ComponentPropsWithoutRef<'span'> & {
ref?: Ref<HTMLSpanElement>;
};
declare const ChipContent: {
({ children, className, ref: forwardedRef }: ChipContentProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type ChipIconProps = ComponentPropsWithoutRef<'span'> & {
ref?: Ref<HTMLSpanElement>;
};
type ChipLeadingIconProps = ChipIconProps & {
ref?: Ref<HTMLSpanElement>;
};
declare const ChipLeadingIcon: {
({ className, ref: forwardedRef, ...props }: ChipLeadingIconProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
type ChipTrailingIconProps = ChipIconProps & {
ref?: Ref<HTMLSpanElement>;
};
declare const ChipTrailingIcon: {
({ className, ref: forwardedRef, ...props }: ChipTrailingIconProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
declare const Chip: typeof Chip$1 & {
Content: typeof ChipContent;
LeadingIcon: typeof ChipLeadingIcon;
TrailingIcon: typeof ChipTrailingIcon;
ClearButton: typeof ChipClearButton;
};
export { Chip, type ChipClearButtonProps, type ChipContentProps, type ChipLeadingIconProps, type ChipTrailingIconProps };