@moontra/moonui 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.global.js +1 -1
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/badge.tsx +14 -2
package/package.json
CHANGED
|
@@ -15,7 +15,9 @@ const badgeVariants = cva(
|
|
|
15
15
|
["inline-flex items-center justify-center gap-1.5",
|
|
16
16
|
"font-medium transition-colors duration-200",
|
|
17
17
|
"border focus:outline-none",
|
|
18
|
-
"focus-visible:ring-2 focus-visible:ring-offset-1"
|
|
18
|
+
"focus-visible:ring-2 focus-visible:ring-offset-1",
|
|
19
|
+
// Auto spacing between badges
|
|
20
|
+
"mr-2 mb-2 last:mr-0"],
|
|
19
21
|
{
|
|
20
22
|
variants: {
|
|
21
23
|
variant: {
|
|
@@ -106,6 +108,8 @@ export interface BadgeProps
|
|
|
106
108
|
leftIcon?: React.ReactNode;
|
|
107
109
|
rightIcon?: React.ReactNode;
|
|
108
110
|
variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'ghost' | 'pro' | 'admin';
|
|
111
|
+
/** Disable automatic spacing between badges */
|
|
112
|
+
noAutoSpacing?: boolean;
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
/**
|
|
@@ -121,6 +125,7 @@ export interface BadgeProps
|
|
|
121
125
|
* @param props.onRemove - Kaldırma işlevi
|
|
122
126
|
* @param props.leftIcon - Badge'in solunda görüntülenecek ikon
|
|
123
127
|
* @param props.rightIcon - Badge'in sağında görüntülenecek ikon
|
|
128
|
+
* @param props.noAutoSpacing - Otomatik spacing'i devre dışı bırak
|
|
124
129
|
*/
|
|
125
130
|
function Badge({
|
|
126
131
|
className,
|
|
@@ -133,6 +138,7 @@ function Badge({
|
|
|
133
138
|
onRemove,
|
|
134
139
|
leftIcon,
|
|
135
140
|
rightIcon,
|
|
141
|
+
noAutoSpacing,
|
|
136
142
|
children,
|
|
137
143
|
...props
|
|
138
144
|
}: BadgeProps) {
|
|
@@ -164,7 +170,13 @@ function Badge({
|
|
|
164
170
|
|
|
165
171
|
return (
|
|
166
172
|
<div
|
|
167
|
-
className={cn(
|
|
173
|
+
className={cn(
|
|
174
|
+
"moonui-theme",
|
|
175
|
+
badgeVariants({ variant, size, radius }),
|
|
176
|
+
// Remove auto-spacing if noAutoSpacing is true
|
|
177
|
+
noAutoSpacing && "mr-0 mb-0",
|
|
178
|
+
className
|
|
179
|
+
)}
|
|
168
180
|
data-removable={removable ? "" : undefined}
|
|
169
181
|
{...props}
|
|
170
182
|
>
|