@spark-ui/components
Version:
Spark (Leboncoin design system) components.
48 lines (43 loc) • 1.76 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { HTMLAttributes, Ref, PropsWithChildren } from 'react';
import * as class_variance_authority_types from 'class-variance-authority/types';
import { VariantProps } from 'class-variance-authority';
declare const styles: (props?: ({
intent?: "main" | "support" | "accent" | "success" | "alert" | "danger" | "info" | "neutral" | "surface" | "basic" | null | undefined;
size?: "sm" | "md" | null | undefined;
type?: "relative" | "standalone" | null | undefined;
} & class_variance_authority_types.ClassProp) | undefined) => string;
type StylesProps = VariantProps<typeof styles>;
interface BadgeItemProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'aria-label'>, StylesProps {
/**
* Numeric value used as indicator inside the component.
*/
count?: number;
/**
* Maximum numeric value to be dispayed as a count value.
* @default 99
*/
overflowCount?: number;
/**
* A custom label for accessibility purposes. It can also be defined as a builder function
* to handle dynamic inner data to create a custom label.
*/
'aria-label'?: string | (({ count, overflowCount }: {
count?: number;
overflowCount?: number;
}) => string);
/**
* Describes the way the component is displayed: relative to another element or just standalone.
* @default 'relative'
*/
type?: 'relative' | 'standalone';
ref?: Ref<HTMLSpanElement>;
}
type BadgeProps = PropsWithChildren<Omit<BadgeItemProps, 'type'>> & {
ref?: Ref<HTMLElement>;
};
declare const Badge: {
({ children, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
displayName: string;
};
export { Badge, type BadgeProps };