@shopbite-de/storefront 1.31.2 → 2.0.0
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 +54 -0
- package/.nuxtrc +1 -1
- package/CLAUDE.md +23 -8
- package/app/app.vue +10 -6
- package/app/assets/css/main.css +100 -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 +15 -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/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
- package/docs/notes/2026-10-07-listing-payload.md +38 -0
- package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
- package/modules/theme.ts +115 -0
- package/nuxt.config.ts +27 -15
- package/package.json +6 -8
- package/playwright.config.ts +11 -0
- package/server/api/listing/[categoryId].get.ts +10 -11
- package/server/api/product/[productId].get.ts +4 -2
- package/server/api/product/variant.get.ts +1 -2
- package/server/api/search.get.ts +7 -12
- package/shared/theme/presets.ts +303 -0
- package/test/a11y/presets.test.ts +225 -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/Category.vue +0 -160
- 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
|
@@ -1,25 +1,290 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { useUser } from "@shopware/composables";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Header of the presets (#455): logo, main navigation, store status,
|
|
6
|
+
* phone, account, wishlist and the cart button with the item count, which
|
|
7
|
+
* opens the cart sheet (#443). On phones a menu button opens a sheet with
|
|
8
|
+
* the navigation and the account links. Logic as in Header/Right.vue.
|
|
9
|
+
*/
|
|
2
10
|
const { mainMenu } = useNavigation(false);
|
|
3
|
-
// The logo link's accessible name; Nuxt UI's default is "Nuxt UI" (#275).
|
|
4
11
|
const { site, shopBite } = useRuntimeConfig().public;
|
|
12
|
+
const { colorMode } = useThemePreset();
|
|
13
|
+
// A logo URL from runtime config (NUXT_PUBLIC_SHOP_BITE_LOGO_URL, e.g. the
|
|
14
|
+
// lead demos) wins over the files in public/; the dark presets use dark/.
|
|
15
|
+
const logoSrc = computed(
|
|
16
|
+
() =>
|
|
17
|
+
(shopBite as { logoUrl?: string }).logoUrl ||
|
|
18
|
+
(colorMode === "dark" ? "/dark/Logo.png" : "/light/Logo.png"),
|
|
19
|
+
);
|
|
20
|
+
const route = useRoute();
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
open: cartOpen,
|
|
24
|
+
mounted: cartMounted,
|
|
25
|
+
show: openCart,
|
|
26
|
+
} = useCartQuickView();
|
|
27
|
+
const { count: cartCount } = useCart();
|
|
28
|
+
const { count: wishlistCount } = useWishlist();
|
|
29
|
+
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
30
|
+
const { isLoggedIn, isGuestSession, logout } = useUser();
|
|
31
|
+
const { status } = useStoreStatus();
|
|
32
|
+
|
|
33
|
+
// The cart button pops when a product goes into the cart (#325).
|
|
34
|
+
const { onCartItemAdded } = useProductEvents();
|
|
35
|
+
const cartPop = ref(0);
|
|
36
|
+
onCartItemAdded(() => {
|
|
37
|
+
cartPop.value++;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const menuOpen = ref(false);
|
|
41
|
+
const menuMounted = ref(false);
|
|
42
|
+
async function openMenu() {
|
|
43
|
+
if (!menuMounted.value) {
|
|
44
|
+
menuMounted.value = true;
|
|
45
|
+
await nextTick();
|
|
46
|
+
}
|
|
47
|
+
menuOpen.value = true;
|
|
48
|
+
}
|
|
49
|
+
watch(
|
|
50
|
+
() => route.fullPath,
|
|
51
|
+
() => {
|
|
52
|
+
menuOpen.value = false;
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const hasAccount = computed(() => isLoggedIn.value || isGuestSession.value);
|
|
57
|
+
|
|
58
|
+
const statusLabel = computed(() => {
|
|
59
|
+
if (!status.value) return "";
|
|
60
|
+
if (status.value.open) return `Geöffnet bis ${status.value.closesAt}`;
|
|
61
|
+
return status.value.nextOpening
|
|
62
|
+
? `Öffnet ${status.value.nextOpening}`
|
|
63
|
+
: "Geschlossen";
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const cartLabel = computed(() =>
|
|
67
|
+
cartCount.value === 1
|
|
68
|
+
? "Warenkorb, 1 Artikel"
|
|
69
|
+
: `Warenkorb, ${cartCount.value} Artikel`,
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
function isCurrent(to: unknown) {
|
|
73
|
+
if (typeof to !== "string") return false;
|
|
74
|
+
const normalize = (path: string) => path.replace(/\/+$/, "").toLowerCase();
|
|
75
|
+
return normalize(route.path).startsWith(normalize(to)) && to !== "/";
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function logoutHandler() {
|
|
79
|
+
logout();
|
|
80
|
+
menuOpen.value = false;
|
|
81
|
+
}
|
|
5
82
|
</script>
|
|
6
83
|
|
|
7
84
|
<template>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
85
|
+
<header
|
|
86
|
+
class="sticky top-0 z-40 border-b border-sb-line bg-sb-bg/95 font-body text-sb-ink backdrop-blur supports-[backdrop-filter]:bg-sb-bg/85"
|
|
87
|
+
>
|
|
88
|
+
<div
|
|
89
|
+
class="mx-auto flex h-16 w-full max-w-(--sb-container) items-center justify-between gap-4 px-4 sm:h-20 sm:px-6 lg:px-8"
|
|
90
|
+
>
|
|
91
|
+
<NuxtLink
|
|
92
|
+
to="/"
|
|
93
|
+
class="flex shrink-0 items-center focus-visible:outline-3 focus-visible:outline-offset-4 focus-visible:outline-sb-focus"
|
|
94
|
+
:aria-label="`${site.name}, zur Startseite`"
|
|
95
|
+
>
|
|
96
|
+
<img
|
|
97
|
+
:src="logoSrc"
|
|
98
|
+
alt=""
|
|
99
|
+
width="150"
|
|
100
|
+
height="48"
|
|
101
|
+
class="h-9 w-auto sm:h-11"
|
|
102
|
+
/>
|
|
103
|
+
</NuxtLink>
|
|
104
|
+
|
|
105
|
+
<nav
|
|
106
|
+
aria-label="Hauptnavigation"
|
|
107
|
+
class="hidden items-center gap-8 lg:flex"
|
|
108
|
+
>
|
|
109
|
+
<NuxtLink
|
|
110
|
+
v-for="item in mainMenu"
|
|
111
|
+
:key="String(item.to)"
|
|
112
|
+
:to="item.to"
|
|
113
|
+
:aria-current="isCurrent(item.to) ? 'page' : undefined"
|
|
114
|
+
class="inline-flex min-h-11 items-center text-[15px] font-semibold hover:text-sb-primary-ink focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus aria-[current=page]:underline aria-[current=page]:decoration-sb-accent aria-[current=page]:decoration-2 aria-[current=page]:underline-offset-8"
|
|
115
|
+
>
|
|
116
|
+
{{ item.label }}
|
|
117
|
+
</NuxtLink>
|
|
118
|
+
<LazySalesChannelSwitch v-if="shopBite.feature.multiChannel" />
|
|
119
|
+
</nav>
|
|
120
|
+
|
|
121
|
+
<div class="flex items-center gap-1.5 sm:gap-2">
|
|
122
|
+
<ClientOnly>
|
|
123
|
+
<!-- Wrappers do the hiding: the base components set their own
|
|
124
|
+
display, which would win over a `hidden` passed to them. -->
|
|
125
|
+
<span v-if="statusLabel" class="hidden xl:block">
|
|
126
|
+
<SbStatusPill
|
|
127
|
+
:tone="status?.open ? 'open' : 'closed'"
|
|
128
|
+
role="status"
|
|
129
|
+
>
|
|
130
|
+
{{ statusLabel }}
|
|
131
|
+
</SbStatusPill>
|
|
132
|
+
</span>
|
|
133
|
+
</ClientOnly>
|
|
134
|
+
<SbIconButton
|
|
135
|
+
v-if="site.telephone"
|
|
136
|
+
:to="toTelHref(site.telephone)"
|
|
137
|
+
:label="`Anrufen: ${site.telephone}`"
|
|
138
|
+
variant="ghost"
|
|
139
|
+
>
|
|
140
|
+
<SbIcon name="phone" />
|
|
141
|
+
</SbIconButton>
|
|
142
|
+
<span class="hidden sm:block">
|
|
143
|
+
<SbIconButton
|
|
144
|
+
:to="hasAccount ? '/konto' : '/anmelden'"
|
|
145
|
+
:label="hasAccount ? 'Mein Konto' : 'Anmelden'"
|
|
146
|
+
variant="ghost"
|
|
147
|
+
>
|
|
148
|
+
<svg
|
|
149
|
+
width="18"
|
|
150
|
+
height="18"
|
|
151
|
+
viewBox="0 0 24 24"
|
|
152
|
+
fill="none"
|
|
153
|
+
stroke="currentColor"
|
|
154
|
+
stroke-width="2"
|
|
155
|
+
stroke-linecap="round"
|
|
156
|
+
aria-hidden="true"
|
|
157
|
+
>
|
|
158
|
+
<circle cx="12" cy="8" r="4" />
|
|
159
|
+
<path d="M4 21c1.5-4 4.5-6 8-6s6.5 2 8 6" />
|
|
160
|
+
</svg>
|
|
161
|
+
</SbIconButton>
|
|
162
|
+
</span>
|
|
163
|
+
<span class="hidden sm:block">
|
|
164
|
+
<SbIconButton
|
|
165
|
+
to="/merkliste"
|
|
166
|
+
:label="
|
|
167
|
+
wishlistCount
|
|
168
|
+
? `Merkliste, ${wishlistCount} gemerkt`
|
|
169
|
+
: 'Merkliste'
|
|
170
|
+
"
|
|
171
|
+
variant="ghost"
|
|
172
|
+
>
|
|
173
|
+
<svg
|
|
174
|
+
width="18"
|
|
175
|
+
height="18"
|
|
176
|
+
viewBox="0 0 24 24"
|
|
177
|
+
fill="none"
|
|
178
|
+
stroke="currentColor"
|
|
179
|
+
stroke-width="2"
|
|
180
|
+
stroke-linecap="round"
|
|
181
|
+
stroke-linejoin="round"
|
|
182
|
+
aria-hidden="true"
|
|
183
|
+
>
|
|
184
|
+
<path
|
|
185
|
+
d="M19 14c1.5-1.5 3-3.2 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.8 0-3 .5-4.5 2-1.5-1.5-2.7-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4 3 5.5l7 7z"
|
|
186
|
+
/>
|
|
187
|
+
</svg>
|
|
188
|
+
<span
|
|
189
|
+
v-if="wishlistCount"
|
|
190
|
+
aria-hidden="true"
|
|
191
|
+
class="absolute top-1 right-1 flex min-w-4 items-center justify-center rounded-full bg-sb-ink px-1 text-[11px] leading-4 font-bold text-sb-surface"
|
|
192
|
+
>{{ wishlistCount }}</span
|
|
193
|
+
>
|
|
194
|
+
</SbIconButton>
|
|
195
|
+
</span>
|
|
196
|
+
<SbButton
|
|
197
|
+
v-if="isCheckoutEnabled"
|
|
198
|
+
:key="cartPop"
|
|
199
|
+
:class="{ 'motion-safe:animate-cart-pop': cartPop > 0 }"
|
|
200
|
+
aria-haspopup="dialog"
|
|
201
|
+
:aria-label="cartLabel"
|
|
202
|
+
@click="openCart"
|
|
203
|
+
>
|
|
204
|
+
<svg
|
|
205
|
+
width="18"
|
|
206
|
+
height="18"
|
|
207
|
+
viewBox="0 0 24 24"
|
|
208
|
+
fill="none"
|
|
209
|
+
stroke="currentColor"
|
|
210
|
+
stroke-width="2"
|
|
211
|
+
stroke-linecap="round"
|
|
212
|
+
stroke-linejoin="round"
|
|
213
|
+
aria-hidden="true"
|
|
214
|
+
>
|
|
215
|
+
<path d="M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z" />
|
|
216
|
+
<path d="M3 6h18" />
|
|
217
|
+
<path d="M16 10a4 4 0 0 1-8 0" />
|
|
218
|
+
</svg>
|
|
219
|
+
<span class="hidden sm:inline" aria-hidden="true">Warenkorb</span>
|
|
220
|
+
<span
|
|
221
|
+
v-if="cartCount"
|
|
222
|
+
aria-hidden="true"
|
|
223
|
+
class="min-w-5 rounded-full bg-sb-on-primary/20 px-1.5 text-sm tabular-nums"
|
|
224
|
+
>{{ cartCount }}</span
|
|
225
|
+
>
|
|
226
|
+
</SbButton>
|
|
227
|
+
<span class="lg:hidden">
|
|
228
|
+
<SbIconButton
|
|
229
|
+
label="Menü öffnen"
|
|
230
|
+
variant="ghost"
|
|
231
|
+
aria-haspopup="dialog"
|
|
232
|
+
@click="openMenu"
|
|
233
|
+
>
|
|
234
|
+
<svg
|
|
235
|
+
width="20"
|
|
236
|
+
height="20"
|
|
237
|
+
viewBox="0 0 24 24"
|
|
238
|
+
fill="none"
|
|
239
|
+
stroke="currentColor"
|
|
240
|
+
stroke-width="2"
|
|
241
|
+
stroke-linecap="round"
|
|
242
|
+
aria-hidden="true"
|
|
243
|
+
>
|
|
244
|
+
<path d="M4 7h16M4 12h16M4 17h16" />
|
|
245
|
+
</svg>
|
|
246
|
+
</SbIconButton>
|
|
247
|
+
</span>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
</header>
|
|
251
|
+
|
|
252
|
+
<SbSheet v-if="menuMounted" v-model:open="menuOpen" title="Menü">
|
|
253
|
+
<nav aria-label="Hauptnavigation mobil" class="flex flex-col font-body">
|
|
254
|
+
<NuxtLink
|
|
255
|
+
v-for="item in mainMenu"
|
|
256
|
+
:key="String(item.to)"
|
|
257
|
+
:to="item.to"
|
|
258
|
+
:aria-current="isCurrent(item.to) ? 'page' : undefined"
|
|
259
|
+
class="flex min-h-14 items-center justify-between border-b border-sb-line font-display text-2xl text-sb-ink focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
260
|
+
>
|
|
261
|
+
{{ item.label }}
|
|
262
|
+
<SbIcon name="chevron-right" class="text-sb-ink-muted" />
|
|
263
|
+
</NuxtLink>
|
|
264
|
+
</nav>
|
|
265
|
+
<div class="mt-6 flex flex-col gap-2 font-body">
|
|
266
|
+
<template v-if="hasAccount">
|
|
267
|
+
<SbButton variant="secondary" to="/konto">Mein Konto</SbButton>
|
|
268
|
+
<SbButton variant="secondary" to="/konto/bestellungen"
|
|
269
|
+
>Bestellungen</SbButton
|
|
270
|
+
>
|
|
271
|
+
<SbButton variant="ghost" @click="logoutHandler">Abmelden</SbButton>
|
|
272
|
+
</template>
|
|
273
|
+
<template v-else>
|
|
274
|
+
<SbButton variant="secondary" to="/anmelden">Anmelden</SbButton>
|
|
275
|
+
<SbButton variant="ghost" to="/registrierung">Registrieren</SbButton>
|
|
276
|
+
</template>
|
|
277
|
+
<SbButton variant="ghost" to="/merkliste">Merkliste</SbButton>
|
|
278
|
+
</div>
|
|
279
|
+
<div v-if="shopBite.feature.multiChannel" class="mt-4">
|
|
280
|
+
<LazySalesChannelSwitch />
|
|
281
|
+
</div>
|
|
282
|
+
</SbSheet>
|
|
283
|
+
|
|
284
|
+
<SbSheet v-if="cartMounted" v-model:open="cartOpen" title="Ihre Bestellung">
|
|
285
|
+
<LazyCartQuickView
|
|
286
|
+
:with-to-cart-button="true"
|
|
287
|
+
@go-to-cart="cartOpen = false"
|
|
288
|
+
/>
|
|
289
|
+
</SbSheet>
|
|
25
290
|
</template>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Menu sections of the presets on the home page (#444): a word list in the
|
|
6
|
+
* display font on the darker band, no dish counts. On desktop one photo
|
|
7
|
+
* follows the hovered or focused section (category media from Shopware);
|
|
8
|
+
* phones get the words stacked and no photo.
|
|
9
|
+
*/
|
|
10
|
+
withDefaults(
|
|
11
|
+
defineProps<{
|
|
12
|
+
title?: string;
|
|
13
|
+
}>(),
|
|
14
|
+
{ title: "Speisekarte" },
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const { categories } = await useHomeMenuCategories();
|
|
18
|
+
|
|
19
|
+
const sections = computed(() =>
|
|
20
|
+
(categories.value ?? []).filter((category) => category.seoUrl),
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
const activeId = ref<string | null>(null);
|
|
24
|
+
const active = computed<Schemas["Category"] | undefined>(
|
|
25
|
+
() =>
|
|
26
|
+
sections.value.find((category) => category.id === activeId.value) ??
|
|
27
|
+
sections.value.find((category) => category.media?.url),
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
function name(category: Schemas["Category"]) {
|
|
31
|
+
return category.translated?.name ?? category.name;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<section
|
|
37
|
+
v-if="sections.length"
|
|
38
|
+
id="speisekarte"
|
|
39
|
+
aria-labelledby="home-menu-title"
|
|
40
|
+
class="bg-sb-muted"
|
|
41
|
+
>
|
|
42
|
+
<div
|
|
43
|
+
:class="[
|
|
44
|
+
'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-24 lg:gap-[72px]',
|
|
45
|
+
active?.media?.url
|
|
46
|
+
? 'lg:grid-cols-[minmax(0,1.35fr)_minmax(0,0.65fr)]'
|
|
47
|
+
: '',
|
|
48
|
+
]"
|
|
49
|
+
>
|
|
50
|
+
<div class="flex flex-col gap-7 font-body text-sb-ink">
|
|
51
|
+
<div class="flex items-center gap-3.5">
|
|
52
|
+
<h2
|
|
53
|
+
id="home-menu-title"
|
|
54
|
+
class="font-body text-xs font-bold tracking-[0.14em] text-sb-accent uppercase"
|
|
55
|
+
>
|
|
56
|
+
{{ title }}
|
|
57
|
+
</h2>
|
|
58
|
+
<span class="h-[1.5px] w-16 bg-sb-control" aria-hidden="true" />
|
|
59
|
+
</div>
|
|
60
|
+
<ul
|
|
61
|
+
class="flex flex-col border-t-[1.5px] border-sb-ink lg:flex-row lg:flex-wrap lg:items-baseline lg:gap-x-5 lg:border-0"
|
|
62
|
+
>
|
|
63
|
+
<li
|
|
64
|
+
v-for="(category, index) in sections"
|
|
65
|
+
:key="category.id"
|
|
66
|
+
class="lg:flex lg:items-baseline lg:gap-5"
|
|
67
|
+
>
|
|
68
|
+
<NuxtLink
|
|
69
|
+
:to="category.seoUrl ?? ''"
|
|
70
|
+
class="flex min-h-14 items-center justify-between border-b border-sb-line font-display text-[32px] leading-tight text-sb-ink hover:underline hover:decoration-sb-accent hover:decoration-[3px] hover:underline-offset-8 focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus lg:min-h-0 lg:border-0 lg:text-[56px]"
|
|
71
|
+
@mouseenter="activeId = category.id"
|
|
72
|
+
@focus="activeId = category.id"
|
|
73
|
+
>
|
|
74
|
+
{{ name(category) }}
|
|
75
|
+
<SbIcon
|
|
76
|
+
name="chevron-right"
|
|
77
|
+
class="text-sb-ink-muted lg:hidden"
|
|
78
|
+
/>
|
|
79
|
+
</NuxtLink>
|
|
80
|
+
<span
|
|
81
|
+
v-if="index < sections.length - 1"
|
|
82
|
+
class="hidden font-display text-[44px] text-sb-control lg:inline"
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
>·</span
|
|
85
|
+
>
|
|
86
|
+
</li>
|
|
87
|
+
</ul>
|
|
88
|
+
<NuxtLink
|
|
89
|
+
to="/speisekarte/"
|
|
90
|
+
class="inline-flex min-h-11 items-center gap-2 self-start font-bold text-sb-primary-ink underline underline-offset-4 focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
91
|
+
>
|
|
92
|
+
Ganze Speisekarte öffnen
|
|
93
|
+
<SbIcon name="chevron-right" />
|
|
94
|
+
</NuxtLink>
|
|
95
|
+
</div>
|
|
96
|
+
<figure
|
|
97
|
+
v-if="active?.media?.url"
|
|
98
|
+
class="m-0 hidden flex-col gap-3 lg:flex"
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
>
|
|
101
|
+
<img
|
|
102
|
+
:src="active.media.url"
|
|
103
|
+
:srcset="mediaSrcSet(active.media)"
|
|
104
|
+
sizes="400px"
|
|
105
|
+
alt=""
|
|
106
|
+
loading="lazy"
|
|
107
|
+
decoding="async"
|
|
108
|
+
class="aspect-[4/5] w-full rounded-[20px] object-cover"
|
|
109
|
+
/>
|
|
110
|
+
<figcaption class="font-body text-sm font-bold text-sb-ink">
|
|
111
|
+
{{ name(active) }}
|
|
112
|
+
</figcaption>
|
|
113
|
+
</figure>
|
|
114
|
+
</div>
|
|
115
|
+
</section>
|
|
116
|
+
</template>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
/** One entry of `features.features` in content/index.yml. */
|
|
3
|
+
export type FeatureCardProps = {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
kind?: "hours" | "delivery" | "reservation";
|
|
8
|
+
lead?: string;
|
|
9
|
+
link?: { label: string; to: string };
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Facts row under the hero of the presets (#444): the `features` of
|
|
14
|
+
* content/index.yml as four columns with a strong top rule. Today's hours
|
|
15
|
+
* and the delivery time are live, like on the feature cards (#332).
|
|
16
|
+
*/
|
|
17
|
+
const props = defineProps<{ features: FeatureCardProps[] }>();
|
|
18
|
+
|
|
19
|
+
const { businessHours } = useBusinessHours();
|
|
20
|
+
const { deliveryTime } = useShopBiteConfig();
|
|
21
|
+
|
|
22
|
+
const items = computed(() =>
|
|
23
|
+
props.features.map((feature) => {
|
|
24
|
+
let lead = feature.lead ?? "";
|
|
25
|
+
if (feature.kind === "hours" && businessHours.value) {
|
|
26
|
+
lead = formatTodayHours(businessHours.value, new Date());
|
|
27
|
+
}
|
|
28
|
+
if (feature.kind === "delivery") {
|
|
29
|
+
lead = `In ca. ${deliveryTime.value} Minuten bei Ihnen`;
|
|
30
|
+
}
|
|
31
|
+
return { ...feature, lead };
|
|
32
|
+
}),
|
|
33
|
+
);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<section
|
|
38
|
+
aria-label="Auf einen Blick"
|
|
39
|
+
class="mx-auto w-full max-w-(--sb-container) px-4 pb-16 sm:px-6 lg:px-8 sm:pb-24"
|
|
40
|
+
>
|
|
41
|
+
<ul
|
|
42
|
+
class="grid grid-cols-1 gap-x-8 gap-y-6 font-body text-sb-ink sm:grid-cols-2 lg:grid-cols-4"
|
|
43
|
+
>
|
|
44
|
+
<li
|
|
45
|
+
v-for="item in items"
|
|
46
|
+
:key="item.title"
|
|
47
|
+
class="flex flex-col gap-1.5 border-t-[1.5px] border-sb-ink pt-4"
|
|
48
|
+
>
|
|
49
|
+
<h2 class="font-body text-[15px] font-bold">{{ item.title }}</h2>
|
|
50
|
+
<ClientOnly v-if="item.kind === 'hours'">
|
|
51
|
+
<p v-if="item.lead" class="text-[14.5px] font-semibold">
|
|
52
|
+
{{ item.lead }}
|
|
53
|
+
</p>
|
|
54
|
+
</ClientOnly>
|
|
55
|
+
<p v-else-if="item.lead" class="text-[14.5px] font-semibold">
|
|
56
|
+
{{ item.lead }}
|
|
57
|
+
</p>
|
|
58
|
+
<p class="text-[14.5px] leading-normal text-sb-ink-muted">
|
|
59
|
+
{{ item.description }}
|
|
60
|
+
</p>
|
|
61
|
+
<NuxtLink
|
|
62
|
+
v-if="item.link"
|
|
63
|
+
:to="item.link.to"
|
|
64
|
+
class="mt-1 inline-flex min-h-11 items-center self-start text-[14.5px] font-bold text-sb-primary-ink underline underline-offset-4 focus-visible:outline-3 focus-visible:outline-sb-focus"
|
|
65
|
+
>
|
|
66
|
+
{{ item.link.label }}
|
|
67
|
+
</NuxtLink>
|
|
68
|
+
</li>
|
|
69
|
+
</ul>
|
|
70
|
+
</section>
|
|
71
|
+
</template>
|
|
@@ -18,6 +18,8 @@ const props = withDefaults(
|
|
|
18
18
|
},
|
|
19
19
|
);
|
|
20
20
|
|
|
21
|
+
// Presets: two columns, questions in the display font (#444).
|
|
22
|
+
|
|
21
23
|
useHead(() => ({
|
|
22
24
|
script: [
|
|
23
25
|
{
|
|
@@ -30,29 +32,45 @@ useHead(() => ({
|
|
|
30
32
|
</script>
|
|
31
33
|
|
|
32
34
|
<template>
|
|
33
|
-
<
|
|
35
|
+
<section
|
|
34
36
|
id="faq"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
:headline="headline"
|
|
38
|
-
:ui="{ container: 'py-12 sm:py-16 lg:py-20' }"
|
|
37
|
+
aria-labelledby="home-faq-title"
|
|
38
|
+
class="mx-auto grid w-full max-w-(--sb-container) gap-8 px-4 py-14 font-body text-sb-ink sm:px-6 lg:px-8 sm:py-28 lg:grid-cols-[minmax(0,0.8fr)_minmax(0,1.2fr)] lg:gap-20"
|
|
39
39
|
>
|
|
40
|
-
<div
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
<div class="flex flex-col gap-4">
|
|
41
|
+
<span
|
|
42
|
+
v-if="headline"
|
|
43
|
+
class="text-xs font-bold tracking-[0.14em] text-sb-accent uppercase"
|
|
44
|
+
>{{ headline }}</span
|
|
45
|
+
>
|
|
46
|
+
<h2
|
|
47
|
+
id="home-faq-title"
|
|
48
|
+
class="font-display text-[32px] leading-tight sm:text-5xl"
|
|
49
|
+
>
|
|
50
|
+
{{ title }}
|
|
51
|
+
</h2>
|
|
52
|
+
<p v-if="description" class="text-sb-ink-muted">{{ description }}</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="border-t-[1.5px] border-sb-ink" data-testid="faq">
|
|
55
|
+
<details
|
|
56
|
+
v-for="(item, index) in items"
|
|
57
|
+
:key="item.question"
|
|
58
|
+
class="group border-b border-sb-line"
|
|
59
|
+
:open="index === 0"
|
|
60
|
+
>
|
|
45
61
|
<summary
|
|
46
|
-
class="flex cursor-pointer list-none items-center justify-between gap-
|
|
62
|
+
class="flex min-h-16 cursor-pointer list-none items-center justify-between gap-6 py-4 font-display text-xl sm:text-2xl focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus [&::-webkit-details-marker]:hidden"
|
|
47
63
|
>
|
|
48
64
|
{{ item.question }}
|
|
49
|
-
<
|
|
50
|
-
name="
|
|
51
|
-
class="
|
|
65
|
+
<SbIcon
|
|
66
|
+
name="plus"
|
|
67
|
+
class="shrink-0 transition-transform group-open:rotate-45 motion-reduce:transition-none"
|
|
52
68
|
/>
|
|
53
69
|
</summary>
|
|
54
|
-
<p class="
|
|
70
|
+
<p class="max-w-[620px] pb-5 leading-relaxed text-sb-ink">
|
|
71
|
+
{{ item.answer }}
|
|
72
|
+
</p>
|
|
55
73
|
</details>
|
|
56
74
|
</div>
|
|
57
|
-
</
|
|
75
|
+
</section>
|
|
58
76
|
</template>
|