feat(Badge): add nowrap prop to purge custom classes

This commit is contained in:
Ilia Mashkov
2026-04-17 08:53:16 +03:00
parent 816d4b89ce
commit ef08512986
2 changed files with 9 additions and 2 deletions

View File

@@ -37,6 +37,11 @@ interface Props extends HTMLAttributes<HTMLSpanElement> {
* @default false
*/
dot?: boolean;
/**
* Prevent text wrapping
* @default false
*/
nowrap?: boolean;
/**
* Content snippet
*/
@@ -51,6 +56,7 @@ let {
variant = 'default',
size = 'xs',
dot = false,
nowrap = false,
children,
class: className,
...rest
@@ -63,6 +69,7 @@ let {
'font-mono uppercase tracking-wide',
labelSizeConfig[size],
badgeVariantConfig[variant],
nowrap && 'text-nowrap',
className,
)}
{...rest}