From d56664abf968a8963db4d30c391d52c62b59b840 Mon Sep 17 00:00:00 2001 From: Padreug Date: Tue, 9 Jun 2026 17:02:57 +0200 Subject: [PATCH] feat(ui): install shadcn Badge; use for accommodation status pills MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the Badge primitive at src/components/ui/badge with the standard default / secondary / destructive / outline variants. Replace the two hand-rolled status pill patterns in AccommodationView (rooms + cabins) with : - Room "Open" pill → variant="default" (filled gold on green) - Room/Cabin "Coming soon" pill → variant="outline" (border + muted) Keeps the small-caps tracking and 10px size via class overrides so the visual rhythm against the room/cabin Card titles is preserved. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/components/ui/badge/Badge.vue | 17 +++++++++++++++++ src/components/ui/badge/index.ts | 26 ++++++++++++++++++++++++++ src/views/AccommodationView.vue | 20 +++++++++----------- 3 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 src/components/ui/badge/Badge.vue create mode 100644 src/components/ui/badge/index.ts diff --git a/src/components/ui/badge/Badge.vue b/src/components/ui/badge/Badge.vue new file mode 100644 index 0000000..0374568 --- /dev/null +++ b/src/components/ui/badge/Badge.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/components/ui/badge/index.ts b/src/components/ui/badge/index.ts new file mode 100644 index 0000000..98a768d --- /dev/null +++ b/src/components/ui/badge/index.ts @@ -0,0 +1,26 @@ +import type { VariantProps } from "class-variance-authority" +import { cva } from "class-variance-authority" + +export { default as Badge } from "./Badge.vue" + +export const badgeVariants = cva( + "inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", + { + variants: { + variant: { + default: + "border-transparent bg-primary text-primary-foreground hover:bg-primary/80", + secondary: + "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80", + destructive: + "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80", + outline: "text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + }, +) + +export type BadgeVariants = VariantProps diff --git a/src/views/AccommodationView.vue b/src/views/AccommodationView.vue index f0bab13..a84aad4 100644 --- a/src/views/AccommodationView.vue +++ b/src/views/AccommodationView.vue @@ -3,6 +3,7 @@ import { useI18n } from 'vue-i18n' import { RouterLink } from 'vue-router' import { Button } from '@/components/ui/button' import { Card, CardContent } from '@/components/ui/card' +import { Badge } from '@/components/ui/badge' const { t, tm, rt } = useI18n() @@ -96,20 +97,16 @@ const exteriorItems = tm('accommodation.exterior.items') as string[]

{{ t(`accommodation.rooms.${room.key}.name`) }}

- {{ room.open ? t('accommodation.statusOpen') : t('accommodation.statusComingSoon') }} - +

{{ t(`accommodation.rooms.${room.key}.summary`) }} @@ -142,11 +139,12 @@ const exteriorItems = tm('accommodation.exterior.items') as string[]

{{ t(`accommodation.cabins.${cabin.key}`) }}

- {{ t('accommodation.statusComingSoon') }} - +