diff --git a/docs/components/badge.md b/docs/components/badge.md index 95f91289f..171c64d19 100644 --- a/docs/components/badge.md +++ b/docs/components/badge.md @@ -1,5 +1,7 @@ # Badge +## Colored badge + @@ -13,3 +15,58 @@ ``` + +## Badge with icon + + + + + + + + + + + + + + + + + + + + + + + + + + + +```vue + + + + + + + + + + + + + + + + + + + + + + + +``` + diff --git a/lib/components/base/Badge.vue b/lib/components/base/Badge.vue index 824c55a32..371d45c70 100644 --- a/lib/components/base/Badge.vue +++ b/lib/components/base/Badge.vue @@ -3,33 +3,71 @@ - - - + + + - - - - - - - - - - + + + + + + + + + + - - + + - - - + + + - + @@ -53,6 +91,87 @@ import { capitalizeString, } from '@' +import { useVIntl, defineMessages } from '@vintl/vintl' +const messages = defineMessages({ + acceptedLabel: { + id: 'omorphia.component.badge.label.accepted', + defaultMessage: 'Accepted', + }, + approvedLabel: { + id: 'omorphia.component.badge.label.approved', + defaultMessage: 'Approved', + }, + archivedLabel: { + id: 'omorphia.component.badge.label.archived', + defaultMessage: 'Archived', + }, + closedLabel: { + id: 'omorphia.component.badge.label.closed', + defaultMessage: 'Closed', + }, + creatorLabel: { + id: 'omorphia.component.badge.label.creator', + defaultMessage: 'Creator', + }, + draftLabel: { + id: 'omorphia.component.badge.label.draft', + defaultMessage: 'Draft', + }, + failedLabel: { + id: 'omorphia.component.badge.label.failed', + defaultMessage: 'Failed', + }, + listedLabel: { + id: 'omorphia.component.badge.label.listed', + defaultMessage: 'Listed', + }, + moderatorLabel: { + id: 'omorphia.component.badge.label.moderator', + defaultMessage: 'Moderator', + }, + modrinthTeamLabel: { + id: 'omorphia.component.badge.label.modrinth-team', + defaultMessage: 'Modrinth Team', + }, + pendingLabel: { + id: 'omorphia.component.badge.label.pending', + defaultMessage: 'Pending', + }, + privateLabel: { + id: 'omorphia.component.badge.label.private', + defaultMessage: 'Private', + }, + processedLabel: { + id: 'omorphia.component.badge.label.processed', + defaultMessage: 'Processed', + }, + rejectedLabel: { + id: 'omorphia.component.badge.label.rejected', + defaultMessage: 'Rejected', + }, + returnedLabel: { + id: 'omorphia.component.badge.label.returned', + defaultMessage: 'Returned', + }, + scheduledLabel: { + id: 'omorphia.component.badge.label.scheduled', + defaultMessage: 'Scheduled', + }, + underReviewLabel: { + id: 'omorphia.component.badge.label.under-review', + defaultMessage: 'Under review', + }, + unlistedLabel: { + id: 'omorphia.component.badge.label.unlisted', + defaultMessage: 'Unlisted', + }, + withheldLabel: { + id: 'omorphia.component.badge.label.withheld', + defaultMessage: 'Withheld', + }, +}) +const { formatMessage } = useVIntl() + defineProps({ type: { type: String, diff --git a/locales/en-US/index.json b/locales/en-US/index.json index c0a3243bc..a6629e385 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -1,4 +1,61 @@ { + "omorphia.component.badge.label.accepted": { + "defaultMessage": "Accepted" + }, + "omorphia.component.badge.label.approved": { + "defaultMessage": "Approved" + }, + "omorphia.component.badge.label.archived": { + "defaultMessage": "Archived" + }, + "omorphia.component.badge.label.closed": { + "defaultMessage": "Closed" + }, + "omorphia.component.badge.label.creator": { + "defaultMessage": "Creator" + }, + "omorphia.component.badge.label.draft": { + "defaultMessage": "Draft" + }, + "omorphia.component.badge.label.failed": { + "defaultMessage": "Failed" + }, + "omorphia.component.badge.label.listed": { + "defaultMessage": "Listed" + }, + "omorphia.component.badge.label.moderator": { + "defaultMessage": "Moderator" + }, + "omorphia.component.badge.label.modrinth-team": { + "defaultMessage": "Modrinth Team" + }, + "omorphia.component.badge.label.pending": { + "defaultMessage": "Pending" + }, + "omorphia.component.badge.label.private": { + "defaultMessage": "Private" + }, + "omorphia.component.badge.label.processed": { + "defaultMessage": "Processed" + }, + "omorphia.component.badge.label.rejected": { + "defaultMessage": "Rejected" + }, + "omorphia.component.badge.label.returned": { + "defaultMessage": "Returned" + }, + "omorphia.component.badge.label.scheduled": { + "defaultMessage": "Scheduled" + }, + "omorphia.component.badge.label.under-review": { + "defaultMessage": "Under review" + }, + "omorphia.component.badge.label.unlisted": { + "defaultMessage": "Unlisted" + }, + "omorphia.component.badge.label.withheld": { + "defaultMessage": "Withheld" + }, "omorphia.component.copy.action.copy": { "defaultMessage": "Copy code to clipboard" }