UNPKG

@payfit/unity-components

Version:

156 lines (155 loc) 3.61 kB
import { VariantProps } from '@payfit/unity-themes'; import { AriaRole, PropsWithChildren, ReactNode } from 'react'; declare const badge: import('tailwind-variants').TVReturnType<{ variant: { success: { root: string; }; warning: { root: string; }; danger: { root: string; }; neutral: { root: string; }; promo: { root: string[]; }; attention: { root: string; }; numeric: { root: string; }; contextual: { root: string; }; }; }, { root: string[]; prefix: string; }, undefined, { variant: { success: { root: string; }; warning: { root: string; }; danger: { root: string; }; neutral: { root: string; }; promo: { root: string[]; }; attention: { root: string; }; numeric: { root: string; }; contextual: { root: string; }; }; }, { root: string[]; prefix: string; }, import('tailwind-variants').TVReturnType<{ variant: { success: { root: string; }; warning: { root: string; }; danger: { root: string; }; neutral: { root: string; }; promo: { root: string[]; }; attention: { root: string; }; numeric: { root: string; }; contextual: { root: string; }; }; }, { root: string[]; prefix: string; }, undefined, unknown, unknown, undefined>>; export type BadgeProps = PropsWithChildren<{ /** * To add classes to the badge */ className?: string; /** * Defines the visual style of the badge * @default 'neutral' */ variant?: VariantProps<typeof badge>['variant']; /** * Explicit ARIA role for the badge. If not provided, will be determined by variant */ role?: Extract<AriaRole, 'status' | 'alert'>; /** * Changes the root element to a different HTML element. The default element is a `<span>`. * @default false */ asChild?: boolean; /** * Optional leading visual rendered before the badge content. */ prefix?: ReactNode; /** * Accessible label for the badge */ 'aria-label'?: string; }>; /** * The Badge component is a visual label or indicator used to convey status or highlight content. */ declare const Badge: import('react').ForwardRefExoticComponent<{ /** * To add classes to the badge */ className?: string; /** * Defines the visual style of the badge * @default 'neutral' */ variant?: VariantProps<typeof badge>["variant"]; /** * Explicit ARIA role for the badge. If not provided, will be determined by variant */ role?: Extract<AriaRole, "status" | "alert">; /** * Changes the root element to a different HTML element. The default element is a `<span>`. * @default false */ asChild?: boolean; /** * Optional leading visual rendered before the badge content. */ prefix?: ReactNode; /** * Accessible label for the badge */ 'aria-label'?: string; } & { children?: ReactNode | undefined; } & import('react').RefAttributes<HTMLSpanElement>>; export { Badge };