@shopbite-de/storefront 1.31.3 → 2.0.1
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/.github/workflows/ci.yaml +87 -0
- package/.gitignore +5 -0
- package/CLAUDE.md +27 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +103 -61
- package/app/components/AddToWishlist.vue +15 -25
- package/app/components/Address/Card.vue +6 -11
- package/app/components/Address/Detail.vue +23 -23
- package/app/components/Address/Fields.vue +175 -73
- package/app/components/Address/Form.vue +107 -106
- package/app/components/Cart/Bar.vue +6 -9
- package/app/components/Cart/Item.vue +48 -63
- package/app/components/Cart/QuickView.vue +38 -25
- package/app/components/Cart/Upsell.vue +24 -62
- package/app/components/Category/Breadcrumb.vue +29 -3
- package/app/components/Category/FilterGroup.vue +20 -41
- package/app/components/Category/Listing.vue +100 -130
- package/app/components/Category/SearchInput.vue +22 -19
- package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
- package/app/components/Checkout/LoginOrRegister.vue +28 -29
- package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
- package/app/components/Checkout/Summary.vue +90 -60
- package/app/components/Checkout/VoucherInput.vue +40 -27
- package/app/components/Contact/Form.vue +164 -192
- package/app/components/DemoBanner.vue +5 -5
- package/app/components/Footer/StoreStatus.vue +2 -2
- package/app/components/Footer.vue +125 -57
- package/app/components/Header.vue +283 -18
- package/app/components/Home/Categories.vue +116 -0
- package/app/components/Home/Facts.vue +71 -0
- package/app/components/Home/Faq.vue +34 -16
- package/app/components/Home/Hero.vue +172 -0
- package/app/components/Home/Highlights.vue +29 -37
- package/app/components/Home/Restaurant.vue +102 -0
- package/app/components/Menu/BonCard.vue +180 -0
- package/app/components/Menu/CartPanel.vue +24 -0
- package/app/components/Menu/CategoryIndex.vue +54 -0
- package/app/components/Menu/OrderMode.vue +20 -0
- package/app/components/Menu/SectionHeader.vue +38 -0
- package/app/components/Navigation/MobileTop.vue +23 -15
- package/app/components/Order/Confirmation.vue +119 -0
- package/app/components/Order/Detail.vue +80 -88
- package/app/components/Product/CardSkeleton.vue +8 -12
- package/app/components/Product/Configurator.vue +8 -16
- package/app/components/Product/CrossSelling.vue +75 -83
- package/app/components/Product/DeselectIngredient.vue +17 -22
- package/app/components/Product/Detail.vue +35 -27
- package/app/components/Product/QuickView.vue +80 -51
- package/app/components/SalesChannelSwitch.vue +14 -28
- package/app/components/Sb/Button.vue +70 -0
- package/app/components/Sb/Checkbox.vue +73 -0
- package/app/components/Sb/Chip.vue +51 -0
- package/app/components/Sb/ChoiceGroup.vue +82 -0
- package/app/components/Sb/ConfirmDialog.vue +60 -0
- package/app/components/Sb/Field.vue +77 -0
- package/app/components/Sb/Icon.vue +66 -0
- package/app/components/Sb/IconButton.vue +55 -0
- package/app/components/Sb/Input.vue +23 -0
- package/app/components/Sb/SegmentedControl.vue +34 -0
- package/app/components/Sb/Select.vue +49 -0
- package/app/components/Sb/Sheet.vue +83 -0
- package/app/components/Sb/Stars.vue +60 -0
- package/app/components/Sb/StatusPill.vue +38 -0
- package/app/components/Sb/Stepper.vue +72 -0
- package/app/components/User/AccountHeader.vue +16 -0
- package/app/components/User/AuthPanel.vue +41 -0
- package/app/components/User/Detail.vue +32 -29
- package/app/components/User/LoginForm.vue +92 -98
- package/app/components/User/RegistrationForm.vue +285 -249
- package/app/components/Wishlist.vue +55 -155
- package/app/composables/useCartMutations.ts +9 -27
- package/app/composables/useCheckoutMethodGuard.ts +2 -24
- package/app/composables/useContactForm.ts +66 -0
- package/app/composables/useHomeMenuCategories.ts +41 -0
- package/app/composables/useNavigation.ts +10 -2
- package/app/composables/useOrderMode.ts +65 -0
- package/app/composables/useRegistrationForm.ts +161 -0
- package/app/composables/useRestaurantSchema.ts +1 -1
- package/app/composables/useShareLink.ts +3 -13
- package/app/composables/useSortingSelection.ts +13 -0
- package/app/composables/useThemePreset.ts +24 -0
- package/app/composables/useVoucherCode.ts +7 -16
- package/app/composables/useWishlistActions.ts +0 -51
- package/app/error.vue +31 -9
- package/app/layouts/account.vue +45 -50
- package/app/layouts/default.vue +2 -3
- package/app/layouts/listing.vue +3 -5
- package/app/pages/[...all].vue +8 -4
- package/app/pages/account/recover/password/index.vue +113 -80
- package/app/pages/anmelden.vue +11 -10
- package/app/pages/bestellung/[id]/erfolg.vue +1 -15
- package/app/pages/bestellung/[id]/fehler.vue +63 -51
- package/app/pages/bestellung/[id]/index.vue +3 -85
- package/app/pages/bestellung/kasse.vue +29 -0
- package/app/pages/bestellung.vue +8 -60
- package/app/pages/index.vue +12 -52
- package/app/pages/kontakt.vue +27 -7
- package/app/pages/konto/adressen.vue +106 -102
- package/app/pages/konto/bestellung/[id].vue +9 -43
- package/app/pages/konto/bestellungen.vue +55 -33
- package/app/pages/konto/index.vue +47 -62
- package/app/pages/konto/profil.vue +162 -100
- package/app/pages/maintenance.vue +8 -6
- package/app/pages/merkliste.vue +7 -8
- package/app/pages/passwort-vergessen.vue +92 -75
- package/app/pages/registrierung/bestaetigen.vue +20 -48
- package/app/pages/registrierung/index.vue +16 -7
- package/app/pages/suche.vue +94 -95
- package/app/plugins/theme-preset.ts +9 -0
- package/app/utils/highlight.ts +25 -0
- package/app/utils/product.ts +9 -0
- package/app/validation/registrationSchema.ts +1 -1
- package/modules/theme.ts +123 -0
- package/nuxt.config.ts +30 -16
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +3 -0
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -0
- package/test/layer/nuxt.config.ts +8 -0
- package/test/nuxt/AccountPagesPreset.test.ts +191 -0
- package/test/nuxt/AuthPagesPreset.test.ts +87 -0
- package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
- package/test/nuxt/CartItem.test.ts +18 -3
- package/test/nuxt/CartUpsell.test.ts +1 -2
- package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
- package/test/nuxt/CheckoutOnePage.test.ts +115 -0
- package/test/nuxt/CheckoutSummary.test.ts +6 -6
- package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
- package/test/nuxt/ContactFormPreset.test.ts +115 -0
- package/test/nuxt/FooterStoreStatus.test.ts +2 -2
- package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
- package/test/nuxt/HomeFaq.test.ts +3 -2
- package/test/nuxt/MenuBonCard.test.ts +122 -0
- package/test/nuxt/OrderPagesPreset.test.ts +132 -0
- package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
- package/test/nuxt/ProductCrossSelling.test.ts +2 -1
- package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
- package/test/nuxt/ProductSheetPreset.test.ts +105 -0
- package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
- package/test/nuxt/RegistrationForm.test.ts +89 -270
- package/test/nuxt/SbBaseComponents.test.ts +170 -0
- package/test/nuxt/SbStars.test.ts +25 -0
- package/test/nuxt/useCartMutations.test.ts +3 -17
- package/test/nuxt/useCartUpsell.test.ts +1 -1
- package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
- package/test/nuxt/useShareLink.test.ts +1 -9
- package/test/nuxt/useWishlistActions.test.ts +3 -26
- package/test/unit/highlight.spec.ts +31 -0
- package/test/unit/product.spec.ts +12 -0
- package/test/unit/themePresets.spec.ts +61 -0
- package/app/app.config.ts +0 -19
- package/app/components/AnimatedSection.vue +0 -74
- package/app/components/BottomNavi.vue +0 -70
- package/app/components/Category/Header.vue +0 -48
- package/app/components/Checkout/PaymentMethod.vue +0 -30
- package/app/components/Checkout/ShippingMethod.vue +0 -30
- package/app/components/Cta.vue +0 -30
- package/app/components/Feature/Card.vue +0 -121
- package/app/components/Features.vue +0 -42
- package/app/components/Footer/Contact.vue +0 -82
- package/app/components/Header/Body.vue +0 -82
- package/app/components/Header/Right.vue +0 -187
- package/app/components/Header/Title.vue +0 -10
- package/app/components/Hero.vue +0 -233
- package/app/components/Home/MenuCategories.vue +0 -148
- package/app/components/ImageGallery.vue +0 -63
- package/app/components/Loading.vue +0 -29
- package/app/components/Navigation/DesktopLeft.vue +0 -39
- package/app/components/Product/Card.vue +0 -177
- package/app/components/Product/CardCompact.vue +0 -72
- package/app/components/Product/CardDietBadges.vue +0 -43
- package/app/components/Product/CardIngredients.vue +0 -35
- package/app/components/Product/CardKitchen.vue +0 -34
- package/app/components/Product/SearchBar.vue +0 -95
- package/app/components/PublicAnnouncement.vue +0 -17
- package/app/pages/bestellung/bestaetigen.vue +0 -16
- package/app/pages/bestellung/warenkorb.vue +0 -49
- package/app/pages/bestellung/zahlung-versand.vue +0 -25
- package/test/nuxt/AddressFields.test.ts +0 -222
- package/test/nuxt/AnimatedSection.test.ts +0 -67
- package/test/nuxt/ContactForm.test.ts +0 -207
- package/test/nuxt/FooterContact.test.ts +0 -102
- package/test/nuxt/HeaderRight.test.ts +0 -142
- package/test/nuxt/Hero.test.ts +0 -126
- package/test/nuxt/HomeMenuCategories.test.ts +0 -94
- package/test/nuxt/LoginForm.test.ts +0 -159
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Hero of the presets, variant "editorial" (#444): kicker, headline with
|
|
4
|
+
* the highlighted part in the accent colour, text, buttons and the store
|
|
5
|
+
* status; on tablets and up a portrait photo with an arched top and the
|
|
6
|
+
* Google rating on it. Phones get no photo and do not download it.
|
|
7
|
+
*/
|
|
8
|
+
type HeroLink = { label: string; to: string; target?: string };
|
|
9
|
+
type HeroUsp = {
|
|
10
|
+
title?: string;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
link?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
title: string;
|
|
18
|
+
description?: string;
|
|
19
|
+
headline?: string;
|
|
20
|
+
poster?: string;
|
|
21
|
+
links?: HeroLink[];
|
|
22
|
+
usps?: HeroUsp[];
|
|
23
|
+
}>();
|
|
24
|
+
|
|
25
|
+
const titleParts = computed(() => splitHighlight(props.title));
|
|
26
|
+
|
|
27
|
+
// The Google usp of content/index.yml ("4.5 ⭐", "720+ Reviews") becomes
|
|
28
|
+
// the rating card.
|
|
29
|
+
const rating = computed(() => {
|
|
30
|
+
const usp = props.usps?.find((item) => item.icon?.includes("google"));
|
|
31
|
+
if (!usp) return null;
|
|
32
|
+
const value = (usp.title ?? "").replace(/[^\d.,]/g, "").replace(".", ",");
|
|
33
|
+
if (!value) return null;
|
|
34
|
+
return {
|
|
35
|
+
value,
|
|
36
|
+
stars: Number(value.replace(",", ".")),
|
|
37
|
+
label: usp.subtitle ?? "",
|
|
38
|
+
link: usp.link,
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const { status } = useStoreStatus();
|
|
43
|
+
const { deliveryTime } = useShopBiteConfig();
|
|
44
|
+
|
|
45
|
+
const statusLabel = computed(() => {
|
|
46
|
+
if (!status.value) return "";
|
|
47
|
+
if (status.value.open) return `Jetzt geöffnet bis ${status.value.closesAt}`;
|
|
48
|
+
return status.value.nextOpening
|
|
49
|
+
? `Geschlossen, öffnet ${status.value.nextOpening}`
|
|
50
|
+
: "Geschlossen";
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// 1×1 transparent GIF: phones keep the <img> but load nothing (#444).
|
|
54
|
+
const BLANK =
|
|
55
|
+
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<section
|
|
60
|
+
class="mx-auto grid w-full max-w-(--sb-container) items-center gap-12 px-4 pt-8 pb-14 sm:px-6 lg:px-8 sm:pt-16 sm:pb-20 lg:grid-cols-[minmax(0,1.08fr)_minmax(0,0.92fr)] lg:gap-[72px]"
|
|
61
|
+
>
|
|
62
|
+
<div class="flex flex-col gap-5 font-body text-sb-ink sm:gap-7">
|
|
63
|
+
<div v-if="headline" class="flex items-center gap-3.5">
|
|
64
|
+
<span
|
|
65
|
+
class="text-xs font-bold tracking-[0.14em] text-sb-accent uppercase"
|
|
66
|
+
>{{ headline }}</span
|
|
67
|
+
>
|
|
68
|
+
<span class="h-[1.5px] w-16 bg-sb-line" aria-hidden="true" />
|
|
69
|
+
</div>
|
|
70
|
+
<h1
|
|
71
|
+
class="font-display text-[40px] leading-[1.05] sm:text-6xl lg:text-[76px] lg:leading-[1.02]"
|
|
72
|
+
>
|
|
73
|
+
<template v-for="(part, index) in titleParts" :key="index">
|
|
74
|
+
<span v-if="part.highlight" class="text-sb-accent">{{
|
|
75
|
+
part.text
|
|
76
|
+
}}</span>
|
|
77
|
+
<template v-else>{{ part.text }}</template>
|
|
78
|
+
</template>
|
|
79
|
+
</h1>
|
|
80
|
+
<p
|
|
81
|
+
v-if="description"
|
|
82
|
+
class="max-w-[520px] text-base leading-relaxed sm:text-[19px]"
|
|
83
|
+
>
|
|
84
|
+
{{ description }}
|
|
85
|
+
</p>
|
|
86
|
+
<div
|
|
87
|
+
v-if="links?.length"
|
|
88
|
+
class="flex flex-col gap-2.5 sm:flex-row sm:flex-wrap"
|
|
89
|
+
>
|
|
90
|
+
<SbButton
|
|
91
|
+
v-for="(link, index) in links"
|
|
92
|
+
:key="link.to"
|
|
93
|
+
:to="link.to"
|
|
94
|
+
:target="link.target"
|
|
95
|
+
:variant="index === 0 ? 'primary' : 'secondary'"
|
|
96
|
+
size="lg"
|
|
97
|
+
>
|
|
98
|
+
{{ link.label }}
|
|
99
|
+
<template v-if="index === 0" #trailing
|
|
100
|
+
><SbIcon name="chevron-right"
|
|
101
|
+
/></template>
|
|
102
|
+
</SbButton>
|
|
103
|
+
</div>
|
|
104
|
+
<ClientOnly>
|
|
105
|
+
<p
|
|
106
|
+
v-if="statusLabel"
|
|
107
|
+
class="flex flex-wrap items-center gap-x-5 gap-y-1 text-[14.5px]"
|
|
108
|
+
role="status"
|
|
109
|
+
>
|
|
110
|
+
<span
|
|
111
|
+
class="inline-flex items-center gap-2 font-bold"
|
|
112
|
+
:class="status?.open ? 'text-sb-primary-ink' : ''"
|
|
113
|
+
>
|
|
114
|
+
<span
|
|
115
|
+
class="size-2 rounded-full"
|
|
116
|
+
:class="status?.open ? 'bg-sb-primary' : 'bg-sb-danger'"
|
|
117
|
+
aria-hidden="true"
|
|
118
|
+
/>
|
|
119
|
+
{{ statusLabel }}
|
|
120
|
+
</span>
|
|
121
|
+
<span>Lieferung ca. {{ deliveryTime }} Min</span>
|
|
122
|
+
</p>
|
|
123
|
+
<template #fallback>
|
|
124
|
+
<span class="h-6" aria-hidden="true" />
|
|
125
|
+
</template>
|
|
126
|
+
</ClientOnly>
|
|
127
|
+
<p
|
|
128
|
+
v-if="rating"
|
|
129
|
+
class="flex flex-wrap items-center gap-x-2 gap-y-1 border-t border-sb-line pt-3 text-sm sm:hidden"
|
|
130
|
+
>
|
|
131
|
+
<SbStars :value="rating.stars" />
|
|
132
|
+
<span class="font-bold whitespace-nowrap"
|
|
133
|
+
>{{ rating.value }} von 5</span
|
|
134
|
+
>
|
|
135
|
+
<span class="whitespace-nowrap text-sb-ink-muted"
|
|
136
|
+
>{{ rating.label }} bei Google</span
|
|
137
|
+
>
|
|
138
|
+
</p>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div v-if="poster" class="relative hidden sm:block">
|
|
142
|
+
<picture>
|
|
143
|
+
<source media="(min-width: 640px)" :srcset="poster" />
|
|
144
|
+
<img
|
|
145
|
+
:src="BLANK"
|
|
146
|
+
alt=""
|
|
147
|
+
width="880"
|
|
148
|
+
height="1100"
|
|
149
|
+
fetchpriority="high"
|
|
150
|
+
class="block aspect-[4/5] w-full rounded-[999px_999px_20px_20px] object-cover"
|
|
151
|
+
/>
|
|
152
|
+
</picture>
|
|
153
|
+
<component
|
|
154
|
+
:is="rating.link ? 'a' : 'div'"
|
|
155
|
+
v-if="rating"
|
|
156
|
+
:href="rating.link"
|
|
157
|
+
:target="rating.link ? '_blank' : undefined"
|
|
158
|
+
:rel="rating.link ? 'noopener' : undefined"
|
|
159
|
+
class="absolute bottom-10 -left-7 flex items-center gap-3.5 rounded-sb-card bg-sb-surface px-5 py-4 text-sb-ink shadow-xl focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
160
|
+
>
|
|
161
|
+
<span class="font-display text-4xl leading-none">{{
|
|
162
|
+
rating.value
|
|
163
|
+
}}</span>
|
|
164
|
+
<span class="flex flex-col gap-1 text-[13px]">
|
|
165
|
+
<SbStars :value="rating.stars" />
|
|
166
|
+
<span class="font-bold">von 5 bei Google</span>
|
|
167
|
+
<span class="text-sb-ink-muted">{{ rating.label }}</span>
|
|
168
|
+
</span>
|
|
169
|
+
</component>
|
|
170
|
+
</div>
|
|
171
|
+
</section>
|
|
172
|
+
</template>
|
|
@@ -1,61 +1,53 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
// without top sellers.
|
|
2
|
+
/**
|
|
3
|
+
* "Oft bestellt" of the presets (#444): the top sellers as bon cards with
|
|
4
|
+
* quick add, a tap on the name opens the quick view. Renders nothing
|
|
5
|
+
* without top sellers.
|
|
6
|
+
*/
|
|
8
7
|
withDefaults(
|
|
9
8
|
defineProps<{
|
|
10
9
|
title?: string;
|
|
11
|
-
description?: string;
|
|
12
|
-
headline?: string;
|
|
13
10
|
}>(),
|
|
14
|
-
{
|
|
15
|
-
title: "Beliebt bei unseren Gästen",
|
|
16
|
-
description: undefined,
|
|
17
|
-
headline: undefined,
|
|
18
|
-
},
|
|
11
|
+
{ title: "Oft bestellt" },
|
|
19
12
|
);
|
|
20
13
|
|
|
21
14
|
const { loadTopSellers } = useTopSellers();
|
|
22
|
-
|
|
23
15
|
const { data: topSellers } = await useAsyncData("top-sellers", () =>
|
|
24
16
|
loadTopSellers(),
|
|
25
17
|
);
|
|
26
18
|
|
|
27
19
|
const products = computed(() => topSellers.value ?? []);
|
|
28
20
|
const quickView = useProductQuickView(products);
|
|
21
|
+
const { menuView } = useThemePreset();
|
|
29
22
|
</script>
|
|
30
23
|
|
|
31
24
|
<template>
|
|
32
|
-
<
|
|
33
|
-
v-if="products.length
|
|
25
|
+
<section
|
|
26
|
+
v-if="products.length"
|
|
34
27
|
id="highlights"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:headline="headline"
|
|
38
|
-
:links="[
|
|
39
|
-
{
|
|
40
|
-
label: 'Zur Speisekarte',
|
|
41
|
-
to: '/speisekarte/',
|
|
42
|
-
color: 'primary',
|
|
43
|
-
variant: 'subtle',
|
|
44
|
-
trailingIcon: 'i-lucide-arrow-right',
|
|
45
|
-
},
|
|
46
|
-
]"
|
|
47
|
-
:ui="{ container: 'py-12 sm:py-16 lg:py-20' }"
|
|
28
|
+
aria-labelledby="home-highlights-title"
|
|
29
|
+
class="mx-auto w-full max-w-(--sb-container) px-4 py-14 sm:px-6 lg:px-8 sm:py-24"
|
|
48
30
|
>
|
|
49
|
-
<div
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
<div class="mb-7 flex items-baseline justify-between gap-5">
|
|
32
|
+
<h2
|
|
33
|
+
id="home-highlights-title"
|
|
34
|
+
class="font-display text-[32px] leading-tight text-sb-ink sm:text-5xl"
|
|
35
|
+
>
|
|
36
|
+
{{ title }}
|
|
37
|
+
</h2>
|
|
38
|
+
<NuxtLink
|
|
39
|
+
to="/speisekarte/"
|
|
40
|
+
class="inline-flex min-h-11 items-center font-body font-bold text-sb-primary-ink underline underline-offset-4 focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
41
|
+
>
|
|
42
|
+
Zur Speisekarte
|
|
43
|
+
</NuxtLink>
|
|
44
|
+
</div>
|
|
45
|
+
<div class="grid grid-cols-1 gap-3 md:grid-cols-2 lg:grid-cols-3">
|
|
46
|
+
<MenuBonCard
|
|
54
47
|
v-for="product in products"
|
|
55
48
|
:key="product.id"
|
|
56
49
|
:product="product"
|
|
57
|
-
:
|
|
58
|
-
:selectable="true"
|
|
50
|
+
:photo="menuView === 'bonPhoto'"
|
|
59
51
|
:href="productDeepLink(product)"
|
|
60
52
|
@select="quickView.show"
|
|
61
53
|
/>
|
|
@@ -65,5 +57,5 @@ const quickView = useProductQuickView(products);
|
|
|
65
57
|
v-model:open="quickView.open.value"
|
|
66
58
|
:product="quickView.product.value"
|
|
67
59
|
/>
|
|
68
|
-
</
|
|
60
|
+
</section>
|
|
69
61
|
</template>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Restaurant band of the presets (#444): dark brand band with the first
|
|
4
|
+
* gallery photo, title, text, the opening hours (in the SSR HTML, local
|
|
5
|
+
* SEO #290), the gallery links and the address.
|
|
6
|
+
*/
|
|
7
|
+
type GalleryLink = { label: string; to: string };
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
headline?: string;
|
|
13
|
+
image?: string;
|
|
14
|
+
links?: GalleryLink[];
|
|
15
|
+
}>();
|
|
16
|
+
|
|
17
|
+
const titleParts = computed(() => splitHighlight(props.title ?? ""));
|
|
18
|
+
|
|
19
|
+
const { site } = useRuntimeConfig().public;
|
|
20
|
+
const { businessHours, refresh } = useBusinessHours();
|
|
21
|
+
onServerPrefetch(() => refresh());
|
|
22
|
+
|
|
23
|
+
const openingHours = computed(() =>
|
|
24
|
+
groupOpeningHours(businessHours.value ?? []),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const address = [
|
|
28
|
+
site.address.street,
|
|
29
|
+
[site.address.postalCode, site.address.city].filter(Boolean).join(" "),
|
|
30
|
+
]
|
|
31
|
+
.filter(Boolean)
|
|
32
|
+
.join(", ");
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<section
|
|
37
|
+
id="restaurant"
|
|
38
|
+
aria-labelledby="home-restaurant-title"
|
|
39
|
+
class="bg-sb-band text-sb-on-band"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
class="mx-auto grid w-full max-w-(--sb-container) items-center gap-10 px-4 py-14 sm:px-6 lg:px-8 sm:py-28 lg:grid-cols-2 lg:gap-20"
|
|
43
|
+
>
|
|
44
|
+
<img
|
|
45
|
+
v-if="image"
|
|
46
|
+
:src="image"
|
|
47
|
+
alt=""
|
|
48
|
+
loading="lazy"
|
|
49
|
+
decoding="async"
|
|
50
|
+
class="aspect-[4/3] w-full rounded-[20px] object-cover"
|
|
51
|
+
/>
|
|
52
|
+
<div class="flex flex-col gap-5 font-body">
|
|
53
|
+
<span
|
|
54
|
+
v-if="headline"
|
|
55
|
+
class="text-xs font-bold tracking-[0.14em] uppercase opacity-80"
|
|
56
|
+
>{{ headline }}</span
|
|
57
|
+
>
|
|
58
|
+
<h2
|
|
59
|
+
id="home-restaurant-title"
|
|
60
|
+
class="font-display text-[34px] leading-[1.08] sm:text-[56px] sm:leading-[1.05]"
|
|
61
|
+
>
|
|
62
|
+
<template v-for="(part, index) in titleParts" :key="index">
|
|
63
|
+
<span v-if="part.highlight" class="opacity-80">{{
|
|
64
|
+
part.text
|
|
65
|
+
}}</span>
|
|
66
|
+
<template v-else>{{ part.text }}</template>
|
|
67
|
+
</template>
|
|
68
|
+
</h2>
|
|
69
|
+
<p v-if="description" class="text-[17px] leading-relaxed opacity-85">
|
|
70
|
+
{{ description }}
|
|
71
|
+
</p>
|
|
72
|
+
<dl
|
|
73
|
+
v-if="openingHours.length"
|
|
74
|
+
class="grid grid-cols-[auto_1fr] text-[15px] tabular-nums"
|
|
75
|
+
>
|
|
76
|
+
<template v-for="row in openingHours" :key="row.days">
|
|
77
|
+
<dt class="border-b border-current/15 py-2.5">{{ row.days }}</dt>
|
|
78
|
+
<dd class="border-b border-current/15 py-2.5 text-right">
|
|
79
|
+
{{ row.intervals.length ? row.intervals.join(" · ") : "Ruhetag" }}
|
|
80
|
+
</dd>
|
|
81
|
+
</template>
|
|
82
|
+
</dl>
|
|
83
|
+
<div class="flex flex-col gap-2.5 pt-1 sm:flex-row sm:flex-wrap">
|
|
84
|
+
<NuxtLink
|
|
85
|
+
v-for="(link, index) in links ?? []"
|
|
86
|
+
:key="link.to"
|
|
87
|
+
:to="link.to"
|
|
88
|
+
:class="[
|
|
89
|
+
'inline-flex min-h-13 items-center justify-center gap-2 rounded-sb-control px-6 font-bold focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-on-band',
|
|
90
|
+
index === 0
|
|
91
|
+
? 'bg-sb-on-band text-sb-band'
|
|
92
|
+
: 'border-[1.5px] border-current/40',
|
|
93
|
+
]"
|
|
94
|
+
>
|
|
95
|
+
{{ link.label }}
|
|
96
|
+
</NuxtLink>
|
|
97
|
+
</div>
|
|
98
|
+
<p v-if="address" class="text-[14.5px] opacity-85">{{ address }}</p>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</section>
|
|
102
|
+
</template>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Menu item of the presets (#441): the "bon". The menu number sits on a
|
|
6
|
+
* strip with a perforation, like on a kitchen ticket; `photo` puts the
|
|
7
|
+
* cover on top (grill preset). The name is a link stretched over the card
|
|
8
|
+
* and opens the quick view; the button adds a product without variants
|
|
9
|
+
* straight to the cart and shows the quantity once it is in there.
|
|
10
|
+
*/
|
|
11
|
+
const props = defineProps<{
|
|
12
|
+
product: Schemas["Product"];
|
|
13
|
+
href?: string;
|
|
14
|
+
photo?: boolean;
|
|
15
|
+
}>();
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits<{
|
|
18
|
+
select: [product: Schemas["Product"]];
|
|
19
|
+
}>();
|
|
20
|
+
|
|
21
|
+
const name = computed(
|
|
22
|
+
() => props.product.translated?.name ?? props.product.name ?? "",
|
|
23
|
+
);
|
|
24
|
+
const sortedProperties = computed(
|
|
25
|
+
() =>
|
|
26
|
+
props.product.sortedProperties as Schemas["PropertyGroup"][] | undefined,
|
|
27
|
+
);
|
|
28
|
+
const ingredients = computed(() =>
|
|
29
|
+
getMainIngredients(sortedProperties.value)
|
|
30
|
+
.map((option) => option.translated?.name ?? option.name)
|
|
31
|
+
.join(", "),
|
|
32
|
+
);
|
|
33
|
+
const diets = computed(() =>
|
|
34
|
+
getDiets(sortedProperties.value).map((diet) =>
|
|
35
|
+
diet === "vegan" ? "Vegan" : "Vegetarisch",
|
|
36
|
+
),
|
|
37
|
+
);
|
|
38
|
+
// Read before the name; the strip with the number is aria-hidden. Built in
|
|
39
|
+
// script: a trailing space in the template would be condensed away.
|
|
40
|
+
// The strip has a fixed width so the cards line up (#441); menu numbers
|
|
41
|
+
// are "21" in most shops, but can be "LF-30" or "LF-35-normal": the type
|
|
42
|
+
// shrinks, very long numbers wrap.
|
|
43
|
+
const numberSize = computed(() => {
|
|
44
|
+
const length = props.product.productNumber.length;
|
|
45
|
+
if (length <= 2) return "text-2xl sm:text-[28px] whitespace-nowrap";
|
|
46
|
+
if (length === 3) return "text-xl sm:text-[22px] whitespace-nowrap";
|
|
47
|
+
if (length <= 5) return "text-[15px] sm:text-lg whitespace-nowrap";
|
|
48
|
+
if (length === 6) return "text-[13px] sm:text-[15px] whitespace-nowrap";
|
|
49
|
+
// Variant numbers like "LF-35-normal": two lines, broken anywhere.
|
|
50
|
+
return "text-xs sm:text-[13px] leading-tight [overflow-wrap:anywhere]";
|
|
51
|
+
});
|
|
52
|
+
const numberLabel = computed(() => `Nr. ${props.product.productNumber} `);
|
|
53
|
+
const cover = computed(() =>
|
|
54
|
+
props.photo ? props.product.cover?.media : undefined,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const needsChoice = computed(() => productNeedsChoice(props.product));
|
|
58
|
+
const available = computed(() => productIsAvailable(props.product));
|
|
59
|
+
|
|
60
|
+
const { getFormattedPrice } = useCommercePrice();
|
|
61
|
+
const price = computed(() => {
|
|
62
|
+
const formatted = getFormattedPrice(
|
|
63
|
+
props.product.calculatedPrice?.totalPrice,
|
|
64
|
+
);
|
|
65
|
+
return needsChoice.value ? `ab ${formatted}` : formatted;
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { quantity } = useProductCartQuantity(() => props.product.id);
|
|
69
|
+
const { setSelectedProduct, addToCart, isLoading } = useAddToCart();
|
|
70
|
+
|
|
71
|
+
const buttonLabel = computed(() => {
|
|
72
|
+
if (needsChoice.value) return `${name.value} auswählen`;
|
|
73
|
+
if (quantity.value > 0)
|
|
74
|
+
return `${name.value}, ${quantity.value} im Warenkorb, noch eine hinzufügen`;
|
|
75
|
+
return `${name.value} hinzufügen`;
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
function select() {
|
|
79
|
+
emit("select", props.product);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function add() {
|
|
83
|
+
if (needsChoice.value) {
|
|
84
|
+
select();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setSelectedProduct(props.product);
|
|
88
|
+
await addToCart();
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function onLinkClick(event: MouseEvent) {
|
|
92
|
+
// A modified click opens the deep link in a new tab or window.
|
|
93
|
+
if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
select();
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<article
|
|
101
|
+
class="relative flex flex-col overflow-hidden rounded-sb-card bg-sb-surface text-sb-ink has-[a:focus-visible]:outline-3 has-[a:focus-visible]:outline-offset-2 has-[a:focus-visible]:outline-sb-focus"
|
|
102
|
+
>
|
|
103
|
+
<img
|
|
104
|
+
v-if="cover?.url"
|
|
105
|
+
:src="cover.url"
|
|
106
|
+
:srcset="mediaSrcSet(cover)"
|
|
107
|
+
sizes="(min-width: 1024px) 360px, 100vw"
|
|
108
|
+
:width="mediaSize(cover)?.width"
|
|
109
|
+
:height="mediaSize(cover)?.height"
|
|
110
|
+
alt=""
|
|
111
|
+
loading="lazy"
|
|
112
|
+
decoding="async"
|
|
113
|
+
class="aspect-[4/3] w-full object-cover"
|
|
114
|
+
/>
|
|
115
|
+
<div
|
|
116
|
+
class="grid flex-1 grid-cols-[60px_minmax(0,1fr)] sm:grid-cols-[72px_minmax(0,1fr)]"
|
|
117
|
+
>
|
|
118
|
+
<span
|
|
119
|
+
aria-hidden="true"
|
|
120
|
+
:class="[
|
|
121
|
+
'flex items-center justify-center border-r-2 border-dashed border-sb-line bg-sb-muted px-1.5 text-center font-display tabular-nums',
|
|
122
|
+
numberSize,
|
|
123
|
+
]"
|
|
124
|
+
>
|
|
125
|
+
{{ product.productNumber }}
|
|
126
|
+
</span>
|
|
127
|
+
<div class="flex min-w-0 flex-col gap-1.5 py-4 pr-4 pl-4 sm:pl-[18px]">
|
|
128
|
+
<h3
|
|
129
|
+
class="font-body text-[16.5px] leading-snug font-bold hyphens-auto [overflow-wrap:anywhere]"
|
|
130
|
+
>
|
|
131
|
+
<a
|
|
132
|
+
v-if="href"
|
|
133
|
+
:href="href"
|
|
134
|
+
aria-haspopup="dialog"
|
|
135
|
+
class="after:absolute after:inset-0 hover:underline hover:underline-offset-4 focus-visible:outline-none"
|
|
136
|
+
@click="onLinkClick"
|
|
137
|
+
><span class="sr-only">{{ numberLabel }}</span
|
|
138
|
+
>{{ name }}</a
|
|
139
|
+
>
|
|
140
|
+
<template v-else>
|
|
141
|
+
<span class="sr-only">{{ numberLabel }}</span
|
|
142
|
+
>{{ name }}
|
|
143
|
+
</template>
|
|
144
|
+
</h3>
|
|
145
|
+
<p
|
|
146
|
+
v-if="diets.length"
|
|
147
|
+
class="text-[13px] font-semibold text-sb-primary-ink"
|
|
148
|
+
>
|
|
149
|
+
{{ diets.join(" · ") }}
|
|
150
|
+
</p>
|
|
151
|
+
<p v-if="ingredients" class="text-sm leading-snug text-sb-ink-muted">
|
|
152
|
+
{{ ingredients }}
|
|
153
|
+
</p>
|
|
154
|
+
<div class="mt-auto flex items-center justify-between pt-1.5">
|
|
155
|
+
<span class="text-base font-bold tabular-nums">{{ price }}</span>
|
|
156
|
+
<span
|
|
157
|
+
v-if="!available"
|
|
158
|
+
class="text-sm font-semibold text-sb-ink-muted"
|
|
159
|
+
>Ausverkauft</span
|
|
160
|
+
>
|
|
161
|
+
<!-- above the stretched link, so it adds instead of opening -->
|
|
162
|
+
<SbIconButton
|
|
163
|
+
v-else
|
|
164
|
+
:label="buttonLabel"
|
|
165
|
+
:variant="quantity > 0 && !needsChoice ? 'primary' : 'tint'"
|
|
166
|
+
:disabled="isLoading"
|
|
167
|
+
:aria-haspopup="needsChoice ? 'dialog' : undefined"
|
|
168
|
+
class="z-10"
|
|
169
|
+
data-testid="menu-add"
|
|
170
|
+
@click="add"
|
|
171
|
+
>
|
|
172
|
+
<SbIcon v-if="needsChoice" name="chevron-right" />
|
|
173
|
+
<template v-else-if="quantity > 0">{{ quantity }}</template>
|
|
174
|
+
<SbIcon v-else name="plus" />
|
|
175
|
+
</SbIconButton>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</article>
|
|
180
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Cart next to the menu on desktop (#443): order mode, the cart lines with
|
|
4
|
+
* steppers, totals and "Zur Kasse". Phones use the cart bar and the sheet.
|
|
5
|
+
* The cart loads on the client, so the panel renders after mounting.
|
|
6
|
+
*/
|
|
7
|
+
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<aside
|
|
12
|
+
v-if="isCheckoutEnabled"
|
|
13
|
+
aria-labelledby="cart-panel-title"
|
|
14
|
+
class="sticky top-6 flex flex-col gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6 font-body text-sb-ink"
|
|
15
|
+
>
|
|
16
|
+
<h2 id="cart-panel-title" class="font-display text-[28px] leading-none">
|
|
17
|
+
Ihre Bestellung
|
|
18
|
+
</h2>
|
|
19
|
+
<MenuOrderMode />
|
|
20
|
+
<ClientOnly>
|
|
21
|
+
<LazyCartQuickView :with-to-cart-button="true" />
|
|
22
|
+
</ClientOnly>
|
|
23
|
+
</aside>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
|
+
import { useNavigation } from "~/composables/useNavigation";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Category index of the presets on desktop (#441): the menu sections as a
|
|
7
|
+
* word list in the display font, sub-categories indented. The current
|
|
8
|
+
* category is underlined in the accent colour (the text stays ink: no red
|
|
9
|
+
* on controls) and marked `aria-current`.
|
|
10
|
+
*/
|
|
11
|
+
const { menuCardNavigation } = useNavigation(true);
|
|
12
|
+
const route = useRoute();
|
|
13
|
+
|
|
14
|
+
type Entry = { label: string; to: string; depth: number };
|
|
15
|
+
|
|
16
|
+
function flatten(categories: Schemas["Category"][], depth = 0): Entry[] {
|
|
17
|
+
return categories.flatMap((category) => [
|
|
18
|
+
{
|
|
19
|
+
label: category.translated?.name ?? category.name ?? "",
|
|
20
|
+
to: category.seoUrl ?? "",
|
|
21
|
+
depth,
|
|
22
|
+
},
|
|
23
|
+
...flatten(category.children ?? [], depth + 1),
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const entries = computed(() => flatten(menuCardNavigation.value ?? []));
|
|
28
|
+
|
|
29
|
+
function isCurrent(to: string) {
|
|
30
|
+
const normalize = (path: string) => path.replace(/\/+$/, "").toLowerCase();
|
|
31
|
+
return to !== "" && normalize(route.path) === normalize(to);
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<nav aria-label="Kategorien" class="sticky top-6">
|
|
37
|
+
<ul class="flex flex-col border-t-[1.5px] border-sb-ink">
|
|
38
|
+
<li v-for="entry in entries" :key="entry.to">
|
|
39
|
+
<NuxtLink
|
|
40
|
+
:to="entry.to"
|
|
41
|
+
:aria-current="isCurrent(entry.to) ? 'page' : undefined"
|
|
42
|
+
:class="[
|
|
43
|
+
'flex min-h-11 items-center border-b border-sb-line text-sb-ink hover:text-sb-primary-ink focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus aria-[current=page]:font-semibold aria-[current=page]:underline aria-[current=page]:decoration-sb-accent aria-[current=page]:decoration-2 aria-[current=page]:underline-offset-[7px]',
|
|
44
|
+
entry.depth === 0
|
|
45
|
+
? 'font-display text-xl'
|
|
46
|
+
: 'pl-4 font-body text-[15px]',
|
|
47
|
+
]"
|
|
48
|
+
>
|
|
49
|
+
{{ entry.label }}
|
|
50
|
+
</NuxtLink>
|
|
51
|
+
</li>
|
|
52
|
+
</ul>
|
|
53
|
+
</nav>
|
|
54
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* Delivery or pickup above the menu and in the cart panel (#443). Loads
|
|
4
|
+
* the shipping methods on mount (client only: they depend on the session)
|
|
5
|
+
* and renders nothing when there is no choice.
|
|
6
|
+
*/
|
|
7
|
+
const { options, selectable, selectedId, load } = useOrderMode();
|
|
8
|
+
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
9
|
+
|
|
10
|
+
onMounted(load);
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<SbSegmentedControl
|
|
15
|
+
v-if="isCheckoutEnabled && selectable && selectedId"
|
|
16
|
+
v-model="selectedId"
|
|
17
|
+
label="Bestellart"
|
|
18
|
+
:options="options"
|
|
19
|
+
/>
|
|
20
|
+
</template>
|