@spark-ui/components
Version:
Spark (Leboncoin design system) components.
41 lines (37 loc) • 1.92 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { ComponentPropsWithoutRef, Ref } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
declare const buttonStyles: (props?: ({
design?: "filled" | "ghost" | "outlined" | "tinted" | "contrast" | null | undefined;
intent?: "main" | "alert" | "support" | "accent" | "basic" | "success" | "info" | "neutral" | "danger" | "surface" | null | undefined;
size?: "sm" | "md" | "lg" | null | undefined;
shape?: "square" | "rounded" | "pill" | null | undefined;
disabled?: boolean | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type ButtonStylesProps = VariantProps<typeof buttonStyles>;
interface ButtonProps extends Omit<ComponentPropsWithoutRef<'button'>, 'disabled'>, ButtonStylesProps {
/**
* Change the component to the HTML tag or custom component of the only child.
*/
asChild?: boolean;
/**
* Display a spinner to indicate to the user that the button is loading something after they interacted with it.
*/
isLoading?: boolean;
/**
* If your loading state should only display a spinner, it's better to specify a label for it (a11y).
*/
loadingLabel?: string;
/**
* If your loading state should also display a label, you can use this prop instead of `loadingLabel`.
* **Please note that using this can result in layout shifting when the Button goes from loading state to normal state.**
*/
loadingText?: string;
ref?: Ref<HTMLButtonElement>;
}
declare const Button: {
({ children, design, disabled, intent, isLoading, loadingLabel, loadingText, shape, size, asChild, className, ref, ...others }: ButtonProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
export { Button, type ButtonProps };