@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.
Files changed (193) hide show
  1. package/.github/workflows/ci.yaml +54 -0
  2. package/.nuxtrc +1 -1
  3. package/CLAUDE.md +23 -8
  4. package/app/app.vue +10 -6
  5. package/app/assets/css/main.css +100 -61
  6. package/app/components/AddToWishlist.vue +15 -25
  7. package/app/components/Address/Card.vue +6 -11
  8. package/app/components/Address/Detail.vue +23 -23
  9. package/app/components/Address/Fields.vue +175 -73
  10. package/app/components/Address/Form.vue +107 -106
  11. package/app/components/Cart/Bar.vue +6 -9
  12. package/app/components/Cart/Item.vue +48 -63
  13. package/app/components/Cart/QuickView.vue +38 -25
  14. package/app/components/Cart/Upsell.vue +24 -62
  15. package/app/components/Category/Breadcrumb.vue +29 -3
  16. package/app/components/Category/FilterGroup.vue +20 -41
  17. package/app/components/Category/Listing.vue +100 -130
  18. package/app/components/Category/SearchInput.vue +22 -19
  19. package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
  20. package/app/components/Checkout/LoginOrRegister.vue +28 -29
  21. package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
  22. package/app/components/Checkout/Summary.vue +90 -60
  23. package/app/components/Checkout/VoucherInput.vue +40 -27
  24. package/app/components/Contact/Form.vue +164 -192
  25. package/app/components/DemoBanner.vue +5 -5
  26. package/app/components/Footer/StoreStatus.vue +2 -2
  27. package/app/components/Footer.vue +125 -57
  28. package/app/components/Header.vue +283 -18
  29. package/app/components/Home/Categories.vue +116 -0
  30. package/app/components/Home/Facts.vue +71 -0
  31. package/app/components/Home/Faq.vue +34 -16
  32. package/app/components/Home/Hero.vue +172 -0
  33. package/app/components/Home/Highlights.vue +29 -37
  34. package/app/components/Home/Restaurant.vue +102 -0
  35. package/app/components/Menu/BonCard.vue +180 -0
  36. package/app/components/Menu/CartPanel.vue +24 -0
  37. package/app/components/Menu/CategoryIndex.vue +54 -0
  38. package/app/components/Menu/OrderMode.vue +20 -0
  39. package/app/components/Menu/SectionHeader.vue +38 -0
  40. package/app/components/Navigation/MobileTop.vue +23 -15
  41. package/app/components/Order/Confirmation.vue +119 -0
  42. package/app/components/Order/Detail.vue +80 -88
  43. package/app/components/Product/CardSkeleton.vue +8 -12
  44. package/app/components/Product/Configurator.vue +8 -16
  45. package/app/components/Product/CrossSelling.vue +75 -83
  46. package/app/components/Product/DeselectIngredient.vue +17 -22
  47. package/app/components/Product/Detail.vue +35 -27
  48. package/app/components/Product/QuickView.vue +80 -51
  49. package/app/components/SalesChannelSwitch.vue +14 -28
  50. package/app/components/Sb/Button.vue +70 -0
  51. package/app/components/Sb/Checkbox.vue +73 -0
  52. package/app/components/Sb/Chip.vue +51 -0
  53. package/app/components/Sb/ChoiceGroup.vue +82 -0
  54. package/app/components/Sb/ConfirmDialog.vue +60 -0
  55. package/app/components/Sb/Field.vue +77 -0
  56. package/app/components/Sb/Icon.vue +66 -0
  57. package/app/components/Sb/IconButton.vue +55 -0
  58. package/app/components/Sb/Input.vue +23 -0
  59. package/app/components/Sb/SegmentedControl.vue +34 -0
  60. package/app/components/Sb/Select.vue +49 -0
  61. package/app/components/Sb/Sheet.vue +83 -0
  62. package/app/components/Sb/Stars.vue +60 -0
  63. package/app/components/Sb/StatusPill.vue +38 -0
  64. package/app/components/Sb/Stepper.vue +72 -0
  65. package/app/components/User/AccountHeader.vue +16 -0
  66. package/app/components/User/AuthPanel.vue +41 -0
  67. package/app/components/User/Detail.vue +32 -29
  68. package/app/components/User/LoginForm.vue +92 -98
  69. package/app/components/User/RegistrationForm.vue +285 -249
  70. package/app/components/Wishlist.vue +55 -155
  71. package/app/composables/useCartMutations.ts +9 -27
  72. package/app/composables/useCheckoutMethodGuard.ts +2 -24
  73. package/app/composables/useContactForm.ts +66 -0
  74. package/app/composables/useHomeMenuCategories.ts +41 -0
  75. package/app/composables/useNavigation.ts +10 -2
  76. package/app/composables/useOrderMode.ts +65 -0
  77. package/app/composables/useRegistrationForm.ts +161 -0
  78. package/app/composables/useRestaurantSchema.ts +1 -1
  79. package/app/composables/useShareLink.ts +3 -13
  80. package/app/composables/useSortingSelection.ts +13 -0
  81. package/app/composables/useThemePreset.ts +15 -0
  82. package/app/composables/useVoucherCode.ts +7 -16
  83. package/app/composables/useWishlistActions.ts +0 -51
  84. package/app/error.vue +31 -9
  85. package/app/layouts/account.vue +45 -50
  86. package/app/layouts/default.vue +2 -3
  87. package/app/layouts/listing.vue +3 -5
  88. package/app/pages/[...all].vue +8 -4
  89. package/app/pages/account/recover/password/index.vue +113 -80
  90. package/app/pages/anmelden.vue +11 -10
  91. package/app/pages/bestellung/[id]/erfolg.vue +1 -15
  92. package/app/pages/bestellung/[id]/fehler.vue +63 -51
  93. package/app/pages/bestellung/[id]/index.vue +3 -85
  94. package/app/pages/bestellung/kasse.vue +29 -0
  95. package/app/pages/bestellung.vue +8 -60
  96. package/app/pages/index.vue +12 -52
  97. package/app/pages/kontakt.vue +27 -7
  98. package/app/pages/konto/adressen.vue +106 -102
  99. package/app/pages/konto/bestellung/[id].vue +9 -43
  100. package/app/pages/konto/bestellungen.vue +55 -33
  101. package/app/pages/konto/index.vue +47 -62
  102. package/app/pages/konto/profil.vue +162 -100
  103. package/app/pages/maintenance.vue +8 -6
  104. package/app/pages/merkliste.vue +7 -8
  105. package/app/pages/passwort-vergessen.vue +92 -75
  106. package/app/pages/registrierung/bestaetigen.vue +20 -48
  107. package/app/pages/registrierung/index.vue +16 -7
  108. package/app/pages/suche.vue +94 -95
  109. package/app/plugins/theme-preset.ts +9 -0
  110. package/app/utils/highlight.ts +25 -0
  111. package/app/utils/product.ts +9 -0
  112. package/app/validation/registrationSchema.ts +1 -1
  113. package/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
  114. package/docs/notes/2026-10-07-listing-payload.md +38 -0
  115. package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
  116. package/modules/theme.ts +115 -0
  117. package/nuxt.config.ts +27 -15
  118. package/package.json +6 -8
  119. package/playwright.config.ts +11 -0
  120. package/server/api/listing/[categoryId].get.ts +10 -11
  121. package/server/api/product/[productId].get.ts +4 -2
  122. package/server/api/product/variant.get.ts +1 -2
  123. package/server/api/search.get.ts +7 -12
  124. package/shared/theme/presets.ts +303 -0
  125. package/test/a11y/presets.test.ts +225 -0
  126. package/test/nuxt/AccountPagesPreset.test.ts +191 -0
  127. package/test/nuxt/AuthPagesPreset.test.ts +87 -0
  128. package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
  129. package/test/nuxt/CartItem.test.ts +18 -3
  130. package/test/nuxt/CartUpsell.test.ts +1 -2
  131. package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
  132. package/test/nuxt/CheckoutOnePage.test.ts +115 -0
  133. package/test/nuxt/CheckoutSummary.test.ts +6 -6
  134. package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
  135. package/test/nuxt/ContactFormPreset.test.ts +115 -0
  136. package/test/nuxt/FooterStoreStatus.test.ts +2 -2
  137. package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
  138. package/test/nuxt/HomeFaq.test.ts +3 -2
  139. package/test/nuxt/MenuBonCard.test.ts +122 -0
  140. package/test/nuxt/OrderPagesPreset.test.ts +132 -0
  141. package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
  142. package/test/nuxt/ProductCrossSelling.test.ts +2 -1
  143. package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
  144. package/test/nuxt/ProductSheetPreset.test.ts +105 -0
  145. package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
  146. package/test/nuxt/RegistrationForm.test.ts +89 -270
  147. package/test/nuxt/SbBaseComponents.test.ts +170 -0
  148. package/test/nuxt/SbStars.test.ts +25 -0
  149. package/test/nuxt/useCartMutations.test.ts +3 -17
  150. package/test/nuxt/useCartUpsell.test.ts +1 -1
  151. package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
  152. package/test/nuxt/useShareLink.test.ts +1 -9
  153. package/test/nuxt/useWishlistActions.test.ts +3 -26
  154. package/test/unit/highlight.spec.ts +31 -0
  155. package/test/unit/product.spec.ts +12 -0
  156. package/test/unit/themePresets.spec.ts +61 -0
  157. package/app/app.config.ts +0 -19
  158. package/app/components/AnimatedSection.vue +0 -74
  159. package/app/components/BottomNavi.vue +0 -70
  160. package/app/components/Category/Header.vue +0 -48
  161. package/app/components/Checkout/PaymentMethod.vue +0 -30
  162. package/app/components/Checkout/ShippingMethod.vue +0 -30
  163. package/app/components/Cta.vue +0 -30
  164. package/app/components/Feature/Card.vue +0 -121
  165. package/app/components/Features.vue +0 -42
  166. package/app/components/Footer/Contact.vue +0 -82
  167. package/app/components/Header/Body.vue +0 -82
  168. package/app/components/Header/Right.vue +0 -187
  169. package/app/components/Header/Title.vue +0 -10
  170. package/app/components/Hero.vue +0 -233
  171. package/app/components/Home/MenuCategories.vue +0 -148
  172. package/app/components/ImageGallery.vue +0 -63
  173. package/app/components/Loading.vue +0 -29
  174. package/app/components/Navigation/DesktopLeft.vue +0 -39
  175. package/app/components/Product/Card.vue +0 -177
  176. package/app/components/Product/CardCompact.vue +0 -72
  177. package/app/components/Product/CardDietBadges.vue +0 -43
  178. package/app/components/Product/CardIngredients.vue +0 -35
  179. package/app/components/Product/CardKitchen.vue +0 -34
  180. package/app/components/Product/Category.vue +0 -160
  181. package/app/components/Product/SearchBar.vue +0 -95
  182. package/app/components/PublicAnnouncement.vue +0 -17
  183. package/app/pages/bestellung/bestaetigen.vue +0 -16
  184. package/app/pages/bestellung/warenkorb.vue +0 -49
  185. package/app/pages/bestellung/zahlung-versand.vue +0 -25
  186. package/test/nuxt/AddressFields.test.ts +0 -222
  187. package/test/nuxt/AnimatedSection.test.ts +0 -67
  188. package/test/nuxt/ContactForm.test.ts +0 -207
  189. package/test/nuxt/FooterContact.test.ts +0 -102
  190. package/test/nuxt/HeaderRight.test.ts +0 -142
  191. package/test/nuxt/Hero.test.ts +0 -126
  192. package/test/nuxt/HomeMenuCategories.test.ts +0 -94
  193. 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
- import ProductCard from "~/components/Product/Card.vue";
3
-
4
- // The top sellers (`markAsTopseller`) as a grid of the regular product
5
- // cards; a tap opens the quick view (#325). Replaces the horizontal
6
- // scroller and the marquee of the old home page (#388). Renders nothing
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
- <UPageSection
33
- v-if="products.length > 0"
25
+ <section
26
+ v-if="products.length"
34
27
  id="highlights"
35
- :title="title"
36
- :description="description"
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
- class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4"
51
- data-testid="highlights"
52
- >
53
- <ProductCard
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
- :with-favorite-button="false"
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
- </UPageSection>
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>