@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
@@ -1,233 +0,0 @@
1
- <script setup lang="ts">
2
- import type { ButtonProps } from "#ui/components/Button.vue";
3
-
4
- const props = withDefaults(
5
- defineProps<{
6
- title: string;
7
- description?: string;
8
- headline?: string;
9
- backgroundVideo?: string;
10
- /** First frame of the video as an image; the LCP element (#273). */
11
- poster?: string;
12
- /** The first link is the one primary action, the others are quiet (#327). */
13
- links: ButtonProps[];
14
- usps?: {
15
- title?: string;
16
- subtitle?: string;
17
- icon?: string;
18
- link?: string;
19
- }[];
20
- }>(),
21
- {
22
- description: undefined,
23
- headline: undefined,
24
- backgroundVideo: undefined,
25
- poster: undefined,
26
- usps: () => [],
27
- },
28
- );
29
-
30
- // The poster is server-rendered and preloaded, so the largest paint is a
31
- // small image instead of a multi-megabyte video. The video only joins on
32
- // wide screens after hydration; phones never request it (#273).
33
- const VIDEO_MEDIA_QUERY = "(min-width: 768px)";
34
- const showVideo = ref(false);
35
- const videoRef = ref<HTMLVideoElement>();
36
-
37
- useHead(() => ({
38
- link: props.poster
39
- ? [
40
- {
41
- key: "hero-poster-preload",
42
- rel: "preload",
43
- as: "image",
44
- href: props.poster,
45
- fetchpriority: "high",
46
- },
47
- ]
48
- : [],
49
- }));
50
-
51
- onMounted(() => {
52
- const wide = props.backgroundVideo
53
- ? window.matchMedia?.(VIDEO_MEDIA_QUERY)
54
- : undefined;
55
- if (wide) {
56
- showVideo.value = wide.matches;
57
- wide.addEventListener("change", (event) => {
58
- showVideo.value = event.matches;
59
- });
60
- }
61
-
62
- // Handle video playback on bfcache restore
63
- window.addEventListener("pageshow", (event) => {
64
- if (event.persisted && videoRef.value) {
65
- videoRef.value.play();
66
- }
67
- });
68
- });
69
-
70
- // Live status line: opening state from the business hours (client only, the
71
- // browser's clock decides, #275) and the delivery time from the plugin.
72
- const { status } = useStoreStatus();
73
- const { deliveryTime, isCheckoutEnabled } = useShopBiteConfig();
74
-
75
- const statusLabel = computed(() => {
76
- if (!status.value) return undefined;
77
- if (status.value.open) return `Geöffnet bis ${status.value.closesAt}`;
78
- return status.value.nextOpening
79
- ? `Geschlossen · öffnet ${status.value.nextOpening}`
80
- : "Geschlossen";
81
- });
82
-
83
- const primaryLink = computed(() => props.links[0]);
84
- const secondaryLinks = computed(() => props.links.slice(1));
85
- </script>
86
-
87
- <template>
88
- <!-- Direction A of the canvas "Startseite Hero": full-bleed photo with a
89
- bottom-to-top gradient instead of a flat overlay, the content bottom
90
- left inside the container width, one primary action (#327). -->
91
- <div
92
- class="relative isolate flex min-h-[520px] flex-col justify-end overflow-hidden bg-neutral-950 sm:min-h-[560px]"
93
- >
94
- <!-- No CSS blur on the poster: blur the image file itself (see docs);
95
- a filter on a full-screen image delays the first paint on phones. -->
96
- <img
97
- v-if="poster"
98
- :src="poster"
99
- alt=""
100
- fetchpriority="high"
101
- class="absolute inset-0 -z-20 h-full w-full object-cover"
102
- />
103
- <video
104
- v-if="showVideo"
105
- ref="videoRef"
106
- autoplay
107
- loop
108
- muted
109
- playsinline
110
- preload="metadata"
111
- :poster="poster"
112
- class="absolute inset-0 -z-10 h-full w-full scale-105 object-cover blur-sm"
113
- >
114
- <source :src="backgroundVideo" type="video/mp4" />
115
- </video>
116
- <div
117
- class="absolute inset-0 -z-10 bg-gradient-to-b from-neutral-950/15 via-neutral-950/35 to-neutral-950/85"
118
- aria-hidden="true"
119
- />
120
-
121
- <UContainer>
122
- <div
123
- class="flex max-w-2xl flex-col gap-4 py-6 text-white sm:gap-5 sm:py-10 lg:py-14"
124
- >
125
- <div
126
- v-if="usps.length > 0"
127
- class="flex flex-wrap items-center gap-x-4 gap-y-2 text-sm"
128
- >
129
- <component
130
- :is="usp.link ? 'a' : 'span'"
131
- v-for="(usp, index) in usps"
132
- :key="index"
133
- :href="usp.link"
134
- :target="usp.link ? '_blank' : undefined"
135
- :rel="usp.link ? 'noopener' : undefined"
136
- class="inline-flex items-center gap-1.5 text-white/90"
137
- >
138
- <UIcon v-if="usp.icon" :name="usp.icon" class="size-4 shrink-0" />
139
- <span v-if="usp.title" class="font-semibold text-white">
140
- {{ usp.title }}
141
- </span>
142
- <span v-if="usp.subtitle" class="text-white/80">
143
- {{ usp.subtitle }}
144
- </span>
145
- </component>
146
- </div>
147
-
148
- <div class="flex flex-col gap-2">
149
- <span
150
- v-if="headline"
151
- class="text-xs font-semibold tracking-widest text-white/80 uppercase"
152
- >
153
- {{ headline }}
154
- </span>
155
- <h1
156
- class="text-4xl font-extrabold tracking-tight text-balance sm:text-5xl lg:text-6xl"
157
- >
158
- {{ title }}
159
- </h1>
160
- <p
161
- v-if="description"
162
- class="text-base text-pretty text-white/90 sm:text-lg"
163
- >
164
- {{ description }}
165
- </p>
166
- </div>
167
-
168
- <!-- Fixed height: the status arrives after mounting (#327, #365).
169
- Phones get one row each for status and delivery, so a long
170
- status cannot wrap the line; from sm both share one row and the
171
- delivery time waits for the status. -->
172
- <div
173
- class="grid items-center text-sm text-white/90 sm:flex sm:min-h-6 sm:gap-x-4"
174
- :class="
175
- isCheckoutEnabled
176
- ? 'grid-rows-[1.5rem_1.5rem]'
177
- : 'grid-rows-[1.5rem]'
178
- "
179
- aria-live="polite"
180
- >
181
- <span
182
- v-if="statusLabel"
183
- class="row-start-1 flex min-w-0 items-center gap-2"
184
- data-testid="hero-status"
185
- >
186
- <span
187
- class="size-2 shrink-0 rounded-full"
188
- :class="
189
- status?.open
190
- ? 'bg-green-400 shadow-[0_0_0_3px_rgba(74,222,128,0.3)]'
191
- : 'bg-neutral-400'
192
- "
193
- aria-hidden="true"
194
- />
195
- <span class="truncate">{{ statusLabel }}</span>
196
- </span>
197
- <span
198
- v-if="isCheckoutEnabled"
199
- class="row-start-2 inline-flex items-center gap-1.5"
200
- :class="{ 'sm:hidden': !statusLabel }"
201
- data-testid="hero-delivery"
202
- >
203
- <UIcon name="i-lucide-bike" class="size-4" />
204
- Lieferung ca. {{ deliveryTime }} Min
205
- </span>
206
- </div>
207
-
208
- <div
209
- v-if="links.length > 0"
210
- class="flex flex-col items-stretch gap-3 sm:flex-row sm:items-center"
211
- >
212
- <UButton
213
- v-if="primaryLink"
214
- v-bind="primaryLink"
215
- color="primary"
216
- variant="solid"
217
- size="xl"
218
- class="justify-center px-6 shadow-lg shadow-primary/30"
219
- />
220
- <UButton
221
- v-for="(link, index) in secondaryLinks"
222
- :key="index"
223
- v-bind="link"
224
- color="neutral"
225
- variant="ghost"
226
- size="xl"
227
- class="justify-center bg-transparent text-white hover:bg-white/10 active:bg-white/10"
228
- />
229
- </div>
230
- </div>
231
- </UContainer>
232
- </div>
233
- </template>
@@ -1,148 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Schemas } from "#shopware";
3
-
4
- // Tiles of the menu sections directly below the hero (#388): the children
5
- // of the menu root (`menuCategoryId`, else the navigation root) with the
6
- // category photo from Shopware (`category.media`) or, without one, the
7
- // section icon on the brand colour. Every tile links to its listing.
8
- const props = withDefaults(
9
- defineProps<{
10
- title?: string;
11
- description?: string;
12
- headline?: string;
13
- /** Tiles shown before the "all sections" tile. */
14
- limit?: number;
15
- }>(),
16
- {
17
- title: "Unsere Speisekarte",
18
- description: undefined,
19
- headline: undefined,
20
- limit: 8,
21
- },
22
- );
23
-
24
- const { apiClient } = useShopwareContext();
25
- const config = useRuntimeConfig();
26
- const rootId = config.public.shopBite.menuCategoryId || "main-navigation";
27
-
28
- const { data: categories } = await useAsyncData(
29
- "home-menu-categories",
30
- async () => {
31
- const response = await apiClient.invoke(
32
- "readNavigation post /navigation/{activeId}/{rootId}",
33
- {
34
- body: {
35
- depth: 1,
36
- // Sent as a POST body so the projection is honoured (#312).
37
- includes: {
38
- category: [
39
- "id",
40
- "name",
41
- "translated",
42
- "seoUrl",
43
- "customFields",
44
- "media",
45
- ],
46
- media: ["url", "thumbnails", "metaData"],
47
- media_thumbnail: ["url", "width"],
48
- },
49
- },
50
- pathParams: { activeId: "main-navigation", rootId },
51
- },
52
- );
53
- return response.data;
54
- },
55
- );
56
-
57
- const tiles = computed(() =>
58
- (categories.value ?? []).filter((category) => category.seoUrl),
59
- );
60
- const visible = computed(() => tiles.value.slice(0, props.limit));
61
- const hasMore = computed(() => tiles.value.length > props.limit);
62
-
63
- function name(category: Schemas["Category"]) {
64
- return category.translated?.name ?? category.name;
65
- }
66
-
67
- function icon(category: Schemas["Category"]) {
68
- return (
69
- (category.customFields as Record<string, string> | null)
70
- ?.shopbite_category_icon ?? "i-lucide-utensils"
71
- );
72
- }
73
- </script>
74
-
75
- <template>
76
- <UPageSection
77
- v-if="tiles.length > 0"
78
- id="speisekarte"
79
- :title="title"
80
- :description="description"
81
- :headline="headline"
82
- :ui="{ container: 'py-12 sm:py-16 lg:py-20' }"
83
- >
84
- <ul
85
- class="grid grid-cols-2 gap-3 sm:grid-cols-3 sm:gap-4 lg:grid-cols-4"
86
- data-testid="menu-categories"
87
- >
88
- <li v-for="category in visible" :key="category.id">
89
- <NuxtLink
90
- :to="category.seoUrl"
91
- class="group relative isolate flex aspect-[4/3] overflow-hidden rounded-xl bg-neutral-950 ring ring-default transition-shadow hover:shadow-lg hover:ring-primary/40 focus-visible:outline-2 focus-visible:outline-primary"
92
- >
93
- <img
94
- v-if="category.media?.url"
95
- :src="category.media.url"
96
- :srcset="mediaSrcSet(category.media)"
97
- sizes="(min-width: 1024px) 300px, (min-width: 640px) 33vw, 50vw"
98
- :width="mediaSize(category.media)?.width"
99
- :height="mediaSize(category.media)?.height"
100
- alt=""
101
- loading="lazy"
102
- decoding="async"
103
- class="absolute inset-0 -z-20 h-full w-full object-cover transition-transform duration-500 group-hover:scale-105"
104
- />
105
- <div
106
- v-else
107
- class="absolute inset-0 -z-20 flex items-center justify-center bg-gradient-to-br from-brand-500 to-brand-800 text-white/80"
108
- aria-hidden="true"
109
- >
110
- <UIcon :name="icon(category)" class="size-12 sm:size-16" />
111
- </div>
112
- <div
113
- class="absolute inset-0 -z-10 bg-gradient-to-t from-neutral-950/85 via-neutral-950/30 to-transparent"
114
- aria-hidden="true"
115
- />
116
- <span
117
- class="mt-auto flex w-full items-center justify-between gap-2 p-3 text-white sm:p-4"
118
- >
119
- <span class="flex min-w-0 items-center gap-2">
120
- <UIcon
121
- v-if="category.media?.url"
122
- :name="icon(category)"
123
- class="size-4 shrink-0 text-white/80"
124
- />
125
- <span class="truncate text-base font-bold sm:text-lg">
126
- {{ name(category) }}
127
- </span>
128
- </span>
129
- <UIcon
130
- name="i-lucide-arrow-right"
131
- class="size-4 shrink-0 text-white/80 transition-transform group-hover:translate-x-0.5"
132
- />
133
- </span>
134
- </NuxtLink>
135
- </li>
136
- <li v-if="hasMore">
137
- <NuxtLink
138
- to="/speisekarte/"
139
- class="flex aspect-[4/3] flex-col items-center justify-center gap-2 rounded-xl bg-elevated text-primary ring ring-default transition-shadow hover:shadow-lg hover:ring-primary/40 focus-visible:outline-2 focus-visible:outline-primary"
140
- >
141
- <UIcon name="i-lucide-layout-grid" class="size-8" />
142
- <span class="font-bold">Alle Kategorien</span>
143
- <span class="text-sm text-muted">{{ tiles.length }} Bereiche</span>
144
- </NuxtLink>
145
- </li>
146
- </ul>
147
- </UPageSection>
148
- </template>
@@ -1,63 +0,0 @@
1
- <script setup lang="ts">
2
- import type { CarouselItem } from "#ui/components/Carousel.vue";
3
- import type { ButtonProps } from "#ui/components/Button.vue";
4
-
5
- type ImageProp = {
6
- image: string;
7
- alt: string;
8
- };
9
-
10
- type ImageCarousel = CarouselItem & ImageProp;
11
-
12
- defineProps<{
13
- title: string;
14
- description?: string | undefined;
15
- headline?: string | undefined;
16
- images: ImageCarousel[] | undefined;
17
- links?: ButtonProps[] | undefined;
18
- }>();
19
-
20
- // The gallery sits below the fold: a fixed aspect ratio reserves the space
21
- // (no layout shift) and the slides load lazily (#273).
22
- const imageClass = "aspect-[4/3] w-full rounded-lg object-cover";
23
- </script>
24
-
25
- <template>
26
- <UPageSection
27
- :title="title"
28
- :description="description"
29
- :headline="headline"
30
- :links="links"
31
- >
32
- <template #body>
33
- <ClientOnly>
34
- <UCarousel
35
- v-slot="{ item }"
36
- arrows
37
- :items="images"
38
- class="w-full max-w-2xl mx-auto"
39
- >
40
- <img
41
- :src="item.image"
42
- :alt="item.alt"
43
- loading="lazy"
44
- decoding="async"
45
- :class="imageClass"
46
- />
47
- </UCarousel>
48
- <template #fallback>
49
- <div class="w-full max-w-2xl mx-auto">
50
- <img
51
- v-if="images?.[0]"
52
- :src="images[0].image"
53
- :alt="images[0].alt"
54
- loading="lazy"
55
- decoding="async"
56
- :class="imageClass"
57
- />
58
- </div>
59
- </template>
60
- </ClientOnly>
61
- </template>
62
- </UPageSection>
63
- </template>
@@ -1,29 +0,0 @@
1
- <script setup lang="ts">
2
- interface Props {
3
- size?: "sm" | "md" | "lg";
4
- text?: string;
5
- }
6
-
7
- const props = withDefaults(defineProps<Props>(), {
8
- size: "md",
9
- text: "Loading...",
10
- });
11
-
12
- const sizeClasses = {
13
- sm: "w-4 h-4",
14
- md: "w-8 h-8",
15
- lg: "w-12 h-12",
16
- } as const;
17
-
18
- const spinnerSize = computed(() => sizeClasses[props.size]);
19
- </script>
20
-
21
- <template>
22
- <div class="flex flex-col items-center justify-center gap-3 p-8">
23
- <div
24
- class="animate-spin rounded-full border-2 border-gray-300 border-t-primary"
25
- :class="spinnerSize"
26
- />
27
- <p v-if="text" class="text-gray-600">{{ text }}</p>
28
- </div>
29
- </template>
@@ -1,39 +0,0 @@
1
- <script setup lang="ts">
2
- import type { NavigationMenuItem } from "@nuxt/ui";
3
- import type { Schemas } from "#shopware";
4
- import { useNavigation } from "~/composables/useNavigation";
5
-
6
- const { menuCardNavigation } = useNavigation(true);
7
-
8
- const mapCategoryToNavItem = (
9
- category: Schemas["Category"],
10
- ): NavigationMenuItem => {
11
- const label = category.translated?.name ?? "";
12
-
13
- return {
14
- label,
15
- description: `${label} Kategorie`,
16
- to: category.seoUrl,
17
- defaultOpen: true,
18
- icon: (category.customFields as Record<string, unknown> | undefined)
19
- ?.shopbite_category_icon as string | undefined,
20
- children: (category.children ?? []).map(mapCategoryToNavItem),
21
- };
22
- };
23
-
24
- const navItems = computed<NavigationMenuItem[]>(() => {
25
- return (menuCardNavigation.value ?? []).map(mapCategoryToNavItem);
26
- });
27
- </script>
28
-
29
- <template>
30
- <div>
31
- <h2 class="text-3xl md:text-4xl mb-3 pb-2">Speisekarte</h2>
32
- <UNavigationMenu
33
- variant="link"
34
- orientation="vertical"
35
- class="data-[orientation=vertical]:w-48"
36
- :items="navItems"
37
- />
38
- </div>
39
- </template>
@@ -1,177 +0,0 @@
1
- <script setup lang="ts">
2
- import type { Schemas } from "#shopware";
3
-
4
- const props = defineProps<{
5
- product: Schemas["Product"];
6
- withFavoriteButton: boolean;
7
- // The whole card opens the product quick view (`select`), see
8
- // useProductQuickView (#325).
9
- selectable: boolean;
10
- // Deep link of the product (#289). The name becomes a link stretched over
11
- // the card, so crawlers find the URL; a plain click still opens the quick
12
- // view in place, a modified click opens the link.
13
- href?: string;
14
- }>();
15
-
16
- const emit = defineEmits<{
17
- select: [product: Schemas["Product"]];
18
- }>();
19
-
20
- const { product } = toRefs(props);
21
-
22
- const sortedProperties = computed(
23
- () =>
24
- product.value.sortedProperties as Schemas["PropertyGroup"][] | undefined,
25
- );
26
-
27
- const { getFormattedPrice } = useCommercePrice();
28
- const { quantity: inCartQuantity } = useProductCartQuantity(
29
- () => product.value.id,
30
- );
31
-
32
- const coverMedia = computed(() => product.value.cover?.media);
33
- const isAvailable = computed(() => productIsAvailable(product.value));
34
-
35
- const linked = computed(() => props.selectable && !!props.href);
36
-
37
- function select() {
38
- if (props.selectable) emit("select", product.value);
39
- }
40
-
41
- // Enter/Space on the card itself; a focused link handles Enter natively.
42
- function onKeydown(event: KeyboardEvent) {
43
- if (linked.value) return;
44
- event.preventDefault();
45
- select();
46
- }
47
-
48
- function onLinkClick(event: MouseEvent) {
49
- if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
50
- // new tab or window: let the browser follow the link, no quick view
51
- event.stopPropagation();
52
- return;
53
- }
54
- // the card's click handler opens the quick view
55
- event.preventDefault();
56
- }
57
- </script>
58
-
59
- <template>
60
- <AnimatedSection
61
- :id="`product-card-${product.id}`"
62
- animation="fade-up"
63
- duration="duration-1000"
64
- delay="delay-100"
65
- >
66
- <article
67
- class="relative flex h-full flex-col overflow-hidden rounded-xl bg-default shadow-md ring ring-default transition-shadow"
68
- :class="{
69
- 'cursor-pointer hover:shadow-lg hover:ring-primary/40': selectable,
70
- 'focus-visible:outline-2 focus-visible:outline-primary':
71
- selectable && !linked,
72
- 'has-[a:focus-visible]:outline-2 has-[a:focus-visible]:outline-primary':
73
- linked,
74
- }"
75
- :role="selectable && !linked ? 'button' : undefined"
76
- :tabindex="selectable && !linked ? 0 : undefined"
77
- :aria-haspopup="selectable && !linked ? 'dialog' : undefined"
78
- :aria-label="
79
- selectable && !linked
80
- ? `${product.translated.name ?? product.name} auswählen`
81
- : undefined
82
- "
83
- @click="select"
84
- @keydown.enter="onKeydown"
85
- @keydown.space="onKeydown"
86
- >
87
- <div v-if="coverMedia?.url" class="relative">
88
- <img
89
- :src="coverMedia.url"
90
- :srcset="mediaSrcSet(coverMedia)"
91
- sizes="(min-width: 1280px) 400px, 100vw"
92
- :width="mediaSize(coverMedia)?.width"
93
- :height="mediaSize(coverMedia)?.height"
94
- :alt="product.translated.name ?? product.name"
95
- loading="lazy"
96
- decoding="async"
97
- class="h-44 w-full object-cover"
98
- />
99
- <div class="absolute top-2.5 left-2.5 flex gap-1.5">
100
- <ProductCardDietBadges
101
- :sorted-properties="sortedProperties"
102
- variant="overlay"
103
- />
104
- </div>
105
- </div>
106
-
107
- <!-- Stops the click so the wishlist toggle does not open the quick view. -->
108
- <div
109
- v-if="withFavoriteButton"
110
- class="absolute top-2.5 right-2.5 z-10"
111
- @click.stop
112
- @keydown.stop
113
- >
114
- <AddToWishlist
115
- :product="product"
116
- variant="soft"
117
- class="rounded-full bg-default/90"
118
- />
119
- </div>
120
-
121
- <div class="flex flex-1 flex-col gap-3 p-4">
122
- <div
123
- class="flex items-start justify-between gap-3"
124
- :class="{ 'pr-10': withFavoriteButton && !coverMedia?.url }"
125
- >
126
- <div class="flex min-w-0 flex-col gap-0.5">
127
- <span
128
- class="flex items-center gap-1 text-xs font-semibold text-primary"
129
- >
130
- #{{ product.productNumber }}
131
- <ProductCardKitchen :sorted-properties="sortedProperties" />
132
- </span>
133
- <h3 class="text-lg font-bold text-pretty text-highlighted">
134
- <a
135
- v-if="linked"
136
- :href="href"
137
- aria-haspopup="dialog"
138
- class="after:absolute after:inset-0 focus-visible:outline-none"
139
- @click="onLinkClick"
140
- >{{ product.translated.name ?? product.name }}</a
141
- >
142
- <template v-else>
143
- {{ product.translated.name ?? product.name }}
144
- </template>
145
- </h3>
146
- <p v-if="product.description" class="text-sm text-default">
147
- {{ product.description }}
148
- </p>
149
- </div>
150
- <div class="flex shrink-0 flex-col items-end">
151
- <span class="text-lg font-bold whitespace-nowrap text-highlighted">
152
- {{ getFormattedPrice(product.calculatedPrice.totalPrice) }}
153
- </span>
154
- <span
155
- v-if="!isAvailable"
156
- class="text-xs whitespace-nowrap text-error"
157
- >
158
- Ausverkauft
159
- </span>
160
- <span
161
- v-else-if="inCartQuantity > 0"
162
- class="text-xs whitespace-nowrap text-muted"
163
- data-testid="in-cart-quantity"
164
- >
165
- {{ inCartQuantity }}× im Warenkorb
166
- </span>
167
- </div>
168
- </div>
169
-
170
- <ProductCardIngredients
171
- :sorted-properties="sortedProperties"
172
- :with-diet-badges="!coverMedia?.url"
173
- />
174
- </div>
175
- </article>
176
- </AnimatedSection>
177
- </template>