Skip to content

Commit

Permalink
fix: Deprecate the "notification" variant of Badge (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuh committed Jun 18, 2024
1 parent 1b902ba commit 74bf5f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion components/badge/w-badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ const props = defineProps({
variant: {
type: String,
default: 'neutral',
validator: (value) => ['neutral', 'info', 'positive', 'warning', 'negative', 'disabled', 'notification', 'price'].includes(value),
validator: (value) => {
if (value === 'notification') {
console.warn('Warp Badge: The "notification" variant is deprecated - Do not use!');
return true;
}
return ['neutral', 'info', 'positive', 'warning', 'negative', 'disabled', 'price'].includes(value);
},
},
position: {
type: String,
Expand Down
1 change: 0 additions & 1 deletion dev/pages/BadgeExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const badgeVariants = [
{ name: 'warning', radio },
{ name: 'negative', radio },
{ name: 'disabled', radio },
{ name: 'notification', radio },
{ name: 'price', radio },
];
const badgePositions = [
Expand Down

0 comments on commit 74bf5f2

Please sign in to comment.