@shopbite-de/storefront 1.31.3 → 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 (185) hide show
  1. package/.github/workflows/ci.yaml +54 -0
  2. package/CLAUDE.md +23 -8
  3. package/app/app.vue +10 -6
  4. package/app/assets/css/main.css +100 -61
  5. package/app/components/AddToWishlist.vue +15 -25
  6. package/app/components/Address/Card.vue +6 -11
  7. package/app/components/Address/Detail.vue +23 -23
  8. package/app/components/Address/Fields.vue +175 -73
  9. package/app/components/Address/Form.vue +107 -106
  10. package/app/components/Cart/Bar.vue +6 -9
  11. package/app/components/Cart/Item.vue +48 -63
  12. package/app/components/Cart/QuickView.vue +38 -25
  13. package/app/components/Cart/Upsell.vue +24 -62
  14. package/app/components/Category/Breadcrumb.vue +29 -3
  15. package/app/components/Category/FilterGroup.vue +20 -41
  16. package/app/components/Category/Listing.vue +100 -130
  17. package/app/components/Category/SearchInput.vue +22 -19
  18. package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
  19. package/app/components/Checkout/LoginOrRegister.vue +28 -29
  20. package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
  21. package/app/components/Checkout/Summary.vue +90 -60
  22. package/app/components/Checkout/VoucherInput.vue +40 -27
  23. package/app/components/Contact/Form.vue +164 -192
  24. package/app/components/DemoBanner.vue +5 -5
  25. package/app/components/Footer/StoreStatus.vue +2 -2
  26. package/app/components/Footer.vue +125 -57
  27. package/app/components/Header.vue +283 -18
  28. package/app/components/Home/Categories.vue +116 -0
  29. package/app/components/Home/Facts.vue +71 -0
  30. package/app/components/Home/Faq.vue +34 -16
  31. package/app/components/Home/Hero.vue +172 -0
  32. package/app/components/Home/Highlights.vue +29 -37
  33. package/app/components/Home/Restaurant.vue +102 -0
  34. package/app/components/Menu/BonCard.vue +180 -0
  35. package/app/components/Menu/CartPanel.vue +24 -0
  36. package/app/components/Menu/CategoryIndex.vue +54 -0
  37. package/app/components/Menu/OrderMode.vue +20 -0
  38. package/app/components/Menu/SectionHeader.vue +38 -0
  39. package/app/components/Navigation/MobileTop.vue +23 -15
  40. package/app/components/Order/Confirmation.vue +119 -0
  41. package/app/components/Order/Detail.vue +80 -88
  42. package/app/components/Product/CardSkeleton.vue +8 -12
  43. package/app/components/Product/Configurator.vue +8 -16
  44. package/app/components/Product/CrossSelling.vue +75 -83
  45. package/app/components/Product/DeselectIngredient.vue +17 -22
  46. package/app/components/Product/Detail.vue +35 -27
  47. package/app/components/Product/QuickView.vue +80 -51
  48. package/app/components/SalesChannelSwitch.vue +14 -28
  49. package/app/components/Sb/Button.vue +70 -0
  50. package/app/components/Sb/Checkbox.vue +73 -0
  51. package/app/components/Sb/Chip.vue +51 -0
  52. package/app/components/Sb/ChoiceGroup.vue +82 -0
  53. package/app/components/Sb/ConfirmDialog.vue +60 -0
  54. package/app/components/Sb/Field.vue +77 -0
  55. package/app/components/Sb/Icon.vue +66 -0
  56. package/app/components/Sb/IconButton.vue +55 -0
  57. package/app/components/Sb/Input.vue +23 -0
  58. package/app/components/Sb/SegmentedControl.vue +34 -0
  59. package/app/components/Sb/Select.vue +49 -0
  60. package/app/components/Sb/Sheet.vue +83 -0
  61. package/app/components/Sb/Stars.vue +60 -0
  62. package/app/components/Sb/StatusPill.vue +38 -0
  63. package/app/components/Sb/Stepper.vue +72 -0
  64. package/app/components/User/AccountHeader.vue +16 -0
  65. package/app/components/User/AuthPanel.vue +41 -0
  66. package/app/components/User/Detail.vue +32 -29
  67. package/app/components/User/LoginForm.vue +92 -98
  68. package/app/components/User/RegistrationForm.vue +285 -249
  69. package/app/components/Wishlist.vue +55 -155
  70. package/app/composables/useCartMutations.ts +9 -27
  71. package/app/composables/useCheckoutMethodGuard.ts +2 -24
  72. package/app/composables/useContactForm.ts +66 -0
  73. package/app/composables/useHomeMenuCategories.ts +41 -0
  74. package/app/composables/useNavigation.ts +10 -2
  75. package/app/composables/useOrderMode.ts +65 -0
  76. package/app/composables/useRegistrationForm.ts +161 -0
  77. package/app/composables/useRestaurantSchema.ts +1 -1
  78. package/app/composables/useShareLink.ts +3 -13
  79. package/app/composables/useSortingSelection.ts +13 -0
  80. package/app/composables/useThemePreset.ts +15 -0
  81. package/app/composables/useVoucherCode.ts +7 -16
  82. package/app/composables/useWishlistActions.ts +0 -51
  83. package/app/error.vue +31 -9
  84. package/app/layouts/account.vue +45 -50
  85. package/app/layouts/default.vue +2 -3
  86. package/app/layouts/listing.vue +3 -5
  87. package/app/pages/[...all].vue +8 -4
  88. package/app/pages/account/recover/password/index.vue +113 -80
  89. package/app/pages/anmelden.vue +11 -10
  90. package/app/pages/bestellung/[id]/erfolg.vue +1 -15
  91. package/app/pages/bestellung/[id]/fehler.vue +63 -51
  92. package/app/pages/bestellung/[id]/index.vue +3 -85
  93. package/app/pages/bestellung/kasse.vue +29 -0
  94. package/app/pages/bestellung.vue +8 -60
  95. package/app/pages/index.vue +12 -52
  96. package/app/pages/kontakt.vue +27 -7
  97. package/app/pages/konto/adressen.vue +106 -102
  98. package/app/pages/konto/bestellung/[id].vue +9 -43
  99. package/app/pages/konto/bestellungen.vue +55 -33
  100. package/app/pages/konto/index.vue +47 -62
  101. package/app/pages/konto/profil.vue +162 -100
  102. package/app/pages/maintenance.vue +8 -6
  103. package/app/pages/merkliste.vue +7 -8
  104. package/app/pages/passwort-vergessen.vue +92 -75
  105. package/app/pages/registrierung/bestaetigen.vue +20 -48
  106. package/app/pages/registrierung/index.vue +16 -7
  107. package/app/pages/suche.vue +94 -95
  108. package/app/plugins/theme-preset.ts +9 -0
  109. package/app/utils/highlight.ts +25 -0
  110. package/app/utils/product.ts +9 -0
  111. package/app/validation/registrationSchema.ts +1 -1
  112. package/modules/theme.ts +115 -0
  113. package/nuxt.config.ts +27 -15
  114. package/package.json +6 -8
  115. package/playwright.config.ts +11 -0
  116. package/server/api/listing/[categoryId].get.ts +3 -0
  117. package/shared/theme/presets.ts +303 -0
  118. package/test/a11y/presets.test.ts +225 -0
  119. package/test/nuxt/AccountPagesPreset.test.ts +191 -0
  120. package/test/nuxt/AuthPagesPreset.test.ts +87 -0
  121. package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
  122. package/test/nuxt/CartItem.test.ts +18 -3
  123. package/test/nuxt/CartUpsell.test.ts +1 -2
  124. package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
  125. package/test/nuxt/CheckoutOnePage.test.ts +115 -0
  126. package/test/nuxt/CheckoutSummary.test.ts +6 -6
  127. package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
  128. package/test/nuxt/ContactFormPreset.test.ts +115 -0
  129. package/test/nuxt/FooterStoreStatus.test.ts +2 -2
  130. package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
  131. package/test/nuxt/HomeFaq.test.ts +3 -2
  132. package/test/nuxt/MenuBonCard.test.ts +122 -0
  133. package/test/nuxt/OrderPagesPreset.test.ts +132 -0
  134. package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
  135. package/test/nuxt/ProductCrossSelling.test.ts +2 -1
  136. package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
  137. package/test/nuxt/ProductSheetPreset.test.ts +105 -0
  138. package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
  139. package/test/nuxt/RegistrationForm.test.ts +89 -270
  140. package/test/nuxt/SbBaseComponents.test.ts +170 -0
  141. package/test/nuxt/SbStars.test.ts +25 -0
  142. package/test/nuxt/useCartMutations.test.ts +3 -17
  143. package/test/nuxt/useCartUpsell.test.ts +1 -1
  144. package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
  145. package/test/nuxt/useShareLink.test.ts +1 -9
  146. package/test/nuxt/useWishlistActions.test.ts +3 -26
  147. package/test/unit/highlight.spec.ts +31 -0
  148. package/test/unit/product.spec.ts +12 -0
  149. package/test/unit/themePresets.spec.ts +61 -0
  150. package/app/app.config.ts +0 -19
  151. package/app/components/AnimatedSection.vue +0 -74
  152. package/app/components/BottomNavi.vue +0 -70
  153. package/app/components/Category/Header.vue +0 -48
  154. package/app/components/Checkout/PaymentMethod.vue +0 -30
  155. package/app/components/Checkout/ShippingMethod.vue +0 -30
  156. package/app/components/Cta.vue +0 -30
  157. package/app/components/Feature/Card.vue +0 -121
  158. package/app/components/Features.vue +0 -42
  159. package/app/components/Footer/Contact.vue +0 -82
  160. package/app/components/Header/Body.vue +0 -82
  161. package/app/components/Header/Right.vue +0 -187
  162. package/app/components/Header/Title.vue +0 -10
  163. package/app/components/Hero.vue +0 -233
  164. package/app/components/Home/MenuCategories.vue +0 -148
  165. package/app/components/ImageGallery.vue +0 -63
  166. package/app/components/Loading.vue +0 -29
  167. package/app/components/Navigation/DesktopLeft.vue +0 -39
  168. package/app/components/Product/Card.vue +0 -177
  169. package/app/components/Product/CardCompact.vue +0 -72
  170. package/app/components/Product/CardDietBadges.vue +0 -43
  171. package/app/components/Product/CardIngredients.vue +0 -35
  172. package/app/components/Product/CardKitchen.vue +0 -34
  173. package/app/components/Product/SearchBar.vue +0 -95
  174. package/app/components/PublicAnnouncement.vue +0 -17
  175. package/app/pages/bestellung/bestaetigen.vue +0 -16
  176. package/app/pages/bestellung/warenkorb.vue +0 -49
  177. package/app/pages/bestellung/zahlung-versand.vue +0 -25
  178. package/test/nuxt/AddressFields.test.ts +0 -222
  179. package/test/nuxt/AnimatedSection.test.ts +0 -67
  180. package/test/nuxt/ContactForm.test.ts +0 -207
  181. package/test/nuxt/FooterContact.test.ts +0 -102
  182. package/test/nuxt/HeaderRight.test.ts +0 -142
  183. package/test/nuxt/Hero.test.ts +0 -126
  184. package/test/nuxt/HomeMenuCategories.test.ts +0 -94
  185. package/test/nuxt/LoginForm.test.ts +0 -159
@@ -1,36 +1,21 @@
1
1
  <script setup lang="ts">
2
2
  import { z } from "zod";
3
- import type { FormSubmitEvent } from "#ui/types";
4
- import { useSalutations } from "@shopware/composables";
5
3
 
6
- const { apiClient } = useShopwareContext();
7
- const { getSalutations } = useSalutations();
8
- const toast = useToast();
9
-
10
- const salutations = computed(() =>
11
- getSalutations.value.map((salutation) => ({
12
- label: salutation.displayName,
13
- value: salutation.id,
14
- })),
15
- );
16
-
17
- const schema = z.object({
18
- salutationId: z.string().optional(),
19
- firstName: z.string().optional(),
20
- lastName: z.string().optional(),
21
- email: z.string().email("Ungültige E-Mail-Adresse"),
22
- phone: z.string().optional(),
23
- subject: z.string().min(3, "Bitte gib einen Betreff an"),
24
- comment: z
25
- .string()
26
- .min(10, "Die Nachricht muss mindestens 10 Zeichen lang sein"),
27
- hp: z.string().optional(),
4
+ /**
5
+ * Contact form of the presets (#445): the same call as Contact/Form.vue
6
+ * (useContactForm), checked on submit with errors at the fields; the
7
+ * first invalid field gets focus, the result shows in the page.
8
+ */
9
+ const { send } = useContactForm();
10
+
11
+ const schema = contactFormSchema.extend({
12
+ email: z.string().email("Bitte geben Sie eine gültige E-Mail-Adresse ein."),
13
+ subject: z.string().min(3, "Bitte geben Sie einen Betreff an."),
14
+ comment: z.string().min(10, "Die Nachricht braucht mindestens 10 Zeichen."),
28
15
  });
16
+ type Field = keyof z.output<typeof schema>;
29
17
 
30
- type Schema = z.output<typeof schema>;
31
-
32
- const state = reactive({
33
- salutationId: "",
18
+ const empty = () => ({
34
19
  firstName: "",
35
20
  lastName: "",
36
21
  email: "",
@@ -39,183 +24,170 @@ const state = reactive({
39
24
  comment: "",
40
25
  hp: "",
41
26
  });
42
-
43
- const loading = ref(false);
44
- const submitted = ref(false);
45
- const successMessage = ref("");
46
-
47
- async function onSubmit(event: FormSubmitEvent<Schema>) {
48
- if (event.data.hp) {
49
- console.warn("Honeypot filled, submission ignored.");
50
- successMessage.value = "Deine Nachricht wurde erfolgreich versendet.";
51
- submitted.value = true;
27
+ const state = reactive(empty());
28
+ const errors = ref<Partial<Record<Field, string>>>({});
29
+ const sending = ref(false);
30
+ const result = ref<{ ok: boolean; message: string } | null>(null);
31
+ const form = ref<HTMLFormElement | null>(null);
32
+ const resultBox = ref<HTMLElement | null>(null);
33
+
34
+ async function onSubmit() {
35
+ result.value = null;
36
+ const parsed = schema.safeParse(state);
37
+ if (!parsed.success) {
38
+ const next: typeof errors.value = {};
39
+ for (const issue of parsed.error.issues) {
40
+ next[issue.path[0] as Field] ??= issue.message;
41
+ }
42
+ errors.value = next;
43
+ await nextTick();
44
+ form.value?.querySelector<HTMLElement>('[aria-invalid="true"]')?.focus();
52
45
  return;
53
46
  }
54
- loading.value = true;
55
- const salutation = event.data.salutationId || salutations.value.at(-1)?.value;
47
+ errors.value = {};
48
+ sending.value = true;
56
49
  try {
57
- const result = await apiClient.invoke(
58
- "sendContactMail post /contact-form",
59
- {
60
- body: {
61
- salutationId: salutation,
62
- firstName: event.data.firstName,
63
- lastName: event.data.lastName,
64
- email: event.data.email,
65
- phone: event.data.phone,
66
- subject: event.data.subject,
67
- comment: event.data.comment,
68
- },
69
- },
50
+ const message = await send(
51
+ parsed.data,
52
+ "Vielen Dank, Ihre Nachricht ist bei uns angekommen.",
70
53
  );
71
-
72
- const resultData = result?.data as Record<string, unknown> | undefined;
73
- const msg =
74
- typeof resultData?.individualSuccessMessage === "string"
75
- ? (resultData.individualSuccessMessage as string).trim()
76
- : "";
77
- successMessage.value =
78
- msg && msg.length > 0
79
- ? msg
80
- : "Deine Nachricht wurde erfolgreich versendet.";
81
- submitted.value = true;
82
-
83
- toast.add({
84
- title: "Erfolg!",
85
- description: successMessage.value,
86
- color: "success",
87
- });
88
-
89
- // Reset form
90
- state.salutationId = "";
91
- state.firstName = "";
92
- state.lastName = "";
93
- state.email = "";
94
- state.phone = "";
95
- state.subject = "";
96
- state.comment = "";
97
- state.hp = "";
54
+ result.value = { ok: true, message };
55
+ Object.assign(state, empty());
98
56
  } catch (error) {
99
57
  console.error("Error sending contact mail:", error);
100
- toast.add({
101
- title: "Fehler!",
102
- description:
103
- "Deine Nachricht konnte nicht versendet werden. Bitte versuche es später erneut.",
104
- color: "error",
105
- });
58
+ result.value = {
59
+ ok: false,
60
+ message:
61
+ "Die Nachricht konnte nicht gesendet werden. Bitte versuchen Sie es später noch einmal.",
62
+ };
106
63
  } finally {
107
- loading.value = false;
64
+ sending.value = false;
108
65
  }
66
+ await nextTick();
67
+ resultBox.value?.focus();
109
68
  }
110
69
  </script>
111
70
 
112
71
  <template>
113
- <div v-if="submitted" class="space-y-4 text-center">
114
- <UAlert
115
- color="success"
116
- variant="soft"
117
- icon="i-lucide-check-circle"
118
- :title="successMessage"
119
- />
120
- <UButton variant="link" @click="submitted = false">
121
- Weiteres Formular senden
122
- </UButton>
123
- </div>
124
-
125
- <UForm
126
- v-else
127
- :schema="schema"
128
- :state="state"
129
- class="space-y-4"
130
- @submit="onSubmit"
131
- >
132
- <UFormField label="Anrede" name="salutationId">
133
- <USelect
134
- v-model="state.salutationId"
135
- :items="salutations"
136
- placeholder="Bitte wählen"
137
- class="w-full"
138
- />
139
- </UFormField>
140
-
141
- <div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
142
- <UFormField label="Vorname" name="firstName">
143
- <UInput
144
- v-model="state.firstName"
145
- placeholder="Dein Vorname"
146
- class="w-full"
72
+ <div class="flex flex-col gap-4 font-body text-sb-ink">
73
+ <div
74
+ v-if="result?.ok"
75
+ ref="resultBox"
76
+ role="status"
77
+ tabindex="-1"
78
+ class="flex flex-col items-start gap-4 rounded-sb-card bg-sb-primary-tint p-6 text-sb-primary-ink"
79
+ >
80
+ <p class="font-semibold">{{ result.message }}</p>
81
+ <SbButton variant="secondary" @click="result = null"
82
+ >Weitere Nachricht schreiben</SbButton
83
+ >
84
+ </div>
85
+ <form
86
+ v-else
87
+ ref="form"
88
+ novalidate
89
+ class="relative flex flex-col gap-4"
90
+ @submit.prevent="onSubmit"
91
+ >
92
+ <p
93
+ v-if="result"
94
+ ref="resultBox"
95
+ role="alert"
96
+ tabindex="-1"
97
+ class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
98
+ >
99
+ {{ result.message }}
100
+ </p>
101
+ <div class="grid gap-4 sm:grid-cols-2">
102
+ <SbField v-slot="{ id, describedBy }" label="Vorname" optional>
103
+ <SbInput
104
+ :id="id"
105
+ v-model="state.firstName"
106
+ name="firstName"
107
+ autocomplete="given-name"
108
+ :aria-describedby="describedBy"
109
+ />
110
+ </SbField>
111
+ <SbField v-slot="{ id, describedBy }" label="Nachname" optional>
112
+ <SbInput
113
+ :id="id"
114
+ v-model="state.lastName"
115
+ name="lastName"
116
+ autocomplete="family-name"
117
+ :aria-describedby="describedBy"
118
+ />
119
+ </SbField>
120
+ </div>
121
+ <SbField
122
+ v-slot="{ id, describedBy, invalid }"
123
+ label="E-Mail"
124
+ hint="Für unsere Antwort"
125
+ :error="errors.email"
126
+ >
127
+ <SbInput
128
+ :id="id"
129
+ v-model="state.email"
130
+ name="email"
131
+ type="email"
132
+ autocomplete="email"
133
+ :aria-describedby="describedBy"
134
+ :invalid="invalid"
147
135
  />
148
- </UFormField>
149
-
150
- <UFormField label="Nachname" name="lastName">
151
- <UInput
152
- v-model="state.lastName"
153
- placeholder="Dein Nachname"
154
- class="w-full"
136
+ </SbField>
137
+ <SbField v-slot="{ id, describedBy }" label="Telefon" optional>
138
+ <SbInput
139
+ :id="id"
140
+ v-model="state.phone"
141
+ name="phone"
142
+ type="tel"
143
+ autocomplete="tel"
144
+ :aria-describedby="describedBy"
155
145
  />
156
- </UFormField>
157
- </div>
158
-
159
- <UFormField label="E-Mail" name="email" required>
160
- <UInput
161
- v-model="state.email"
162
- type="email"
163
- placeholder="Deine E-Mail-Adresse"
164
- class="w-full"
165
- />
166
- </UFormField>
167
-
168
- <UFormField label="Telefon" name="phone">
169
- <UInput
170
- v-model="state.phone"
171
- type="tel"
172
- placeholder="Deine Telefonnummer"
173
- class="w-full"
174
- />
175
- </UFormField>
176
-
177
- <UFormField label="Betreff" name="subject" required>
178
- <UInput
179
- v-model="state.subject"
180
- placeholder="Worum geht es?"
181
- class="w-full"
182
- />
183
- </UFormField>
184
-
185
- <UFormField label="Nachricht" name="comment" required>
186
- <UTextarea
187
- v-model="state.comment"
188
- placeholder="Wie können wir dir helfen?"
189
- class="w-full"
190
- />
191
- </UFormField>
192
-
193
- <!-- Honeypot field -->
194
- <div class="hidden-field" aria-hidden="true">
195
- <UFormField label="Address" name="hp">
196
- <UInput
197
- v-model="state.hp"
198
- type="text"
199
- placeholder="Address"
200
- tabindex="-1"
201
- autocomplete="off"
146
+ </SbField>
147
+ <SbField
148
+ v-slot="{ id, describedBy, invalid }"
149
+ label="Betreff"
150
+ :error="errors.subject"
151
+ >
152
+ <SbInput
153
+ :id="id"
154
+ v-model="state.subject"
155
+ name="subject"
156
+ :aria-describedby="describedBy"
157
+ :invalid="invalid"
202
158
  />
203
- </UFormField>
204
- </div>
205
-
206
- <UButton type="submit" :loading="loading" block> Absenden </UButton>
207
- </UForm>
159
+ </SbField>
160
+ <SbField
161
+ v-slot="{ id, describedBy, invalid }"
162
+ label="Nachricht"
163
+ :error="errors.comment"
164
+ >
165
+ <textarea
166
+ :id="id"
167
+ v-model="state.comment"
168
+ name="comment"
169
+ rows="6"
170
+ :aria-describedby="describedBy"
171
+ :aria-invalid="invalid || undefined"
172
+ class="w-full rounded-sb-control border-[1.5px] border-sb-control bg-sb-surface px-3.5 py-3 font-body text-base text-sb-ink focus-visible:outline-3 focus-visible:outline-offset-1 focus-visible:outline-sb-focus aria-invalid:border-sb-danger"
173
+ />
174
+ </SbField>
175
+ <!-- honeypot: hidden from people and assistive technology -->
176
+ <div class="absolute size-0 overflow-hidden opacity-0" aria-hidden="true">
177
+ <label>
178
+ Adresse
179
+ <input
180
+ v-model="state.hp"
181
+ name="hp"
182
+ type="text"
183
+ tabindex="-1"
184
+ autocomplete="off"
185
+ />
186
+ </label>
187
+ </div>
188
+ <SbButton type="submit" size="lg" :loading="sending" class="self-start"
189
+ >Nachricht senden</SbButton
190
+ >
191
+ </form>
192
+ </div>
208
193
  </template>
209
-
210
- <style scoped>
211
- .hidden-field {
212
- opacity: 0;
213
- position: absolute;
214
- top: 0;
215
- left: 0;
216
- height: 0;
217
- width: 0;
218
- z-index: -1;
219
- overflow: hidden;
220
- }
221
- </style>
@@ -5,9 +5,9 @@
5
5
  </script>
6
6
 
7
7
  <template>
8
- <UBanner
9
- color="warning"
10
- icon="i-lucide-flask-conical"
11
- title="Demo-Shop: Bestellungen werden nicht bearbeitet und nicht ausgeliefert."
12
- />
8
+ <div
9
+ class="bg-sb-ink px-4 py-2.5 text-center font-body text-sm font-semibold text-sb-bg"
10
+ >
11
+ Demo-Shop: Bestellungen werden nicht bearbeitet und nicht ausgeliefert.
12
+ </div>
13
13
  </template>
@@ -18,10 +18,10 @@ const text = computed(() => {
18
18
  <p v-if="status" role="status" class="flex items-center gap-2 text-sm">
19
19
  <span
20
20
  class="size-2 shrink-0 rounded-full"
21
- :class="status.open ? 'bg-success' : 'bg-dimmed'"
21
+ :class="status.open ? 'bg-sb-primary' : 'bg-sb-danger'"
22
22
  aria-hidden="true"
23
23
  />
24
- <span class="text-default">{{ text }}</span>
24
+ <span class="text-sb-ink">{{ text }}</span>
25
25
  </p>
26
26
  <template #fallback>
27
27
  <p class="h-5" aria-hidden="true" />
@@ -1,72 +1,140 @@
1
1
  <script setup lang="ts">
2
- import { useNavigation } from "~/composables/useNavigation";
3
- import type {
4
- FooterColumn,
5
- FooterColumnLink,
6
- NavigationMenuItem,
7
- } from "@nuxt/ui";
2
+ import {
3
+ useNavigation,
4
+ type NavigationMenuItem,
5
+ } from "~/composables/useNavigation";
8
6
 
7
+ /**
8
+ * Footer of the presets (#455): shop name, address, phone, Google link,
9
+ * opening hours with today's status (in the SSR HTML, local SEO #290) and
10
+ * the footer navigation as link columns. No colour mode switch: the
11
+ * preset fixes light or dark.
12
+ */
9
13
  const { footerMenu } = useNavigation(true);
10
14
 
11
- const menuItemToFooterColumnLink = (
12
- item: NavigationMenuItem,
13
- ): FooterColumnLink => ({
14
- label: item.label ?? "",
15
- to: item.to as string | undefined,
16
- target: item.target as string | undefined,
17
- icon: item.icon,
18
- });
15
+ const { site } = useRuntimeConfig().public;
16
+ const { businessHours, refresh } = useBusinessHours();
17
+ onServerPrefetch(() => refresh());
19
18
 
20
- const menuItemsToFooterColumns = (
21
- items: NavigationMenuItem[],
22
- ): FooterColumn[] =>
23
- items.map((item) => ({
24
- label: item.label ?? "",
25
- children: item.children?.map(menuItemToFooterColumnLink) ?? [],
26
- }));
19
+ const openingHours = computed(() =>
20
+ groupOpeningHours(businessHours.value ?? []),
21
+ );
22
+ const locality = [site.address.postalCode, site.address.city]
23
+ .filter(Boolean)
24
+ .join(" ");
25
+ const year = new Date().getFullYear();
26
+
27
+ function linkTarget(link: NavigationMenuItem): string | undefined {
28
+ return typeof link.target === "string" ? link.target : undefined;
29
+ }
27
30
 
28
- const footerColumns = computed<FooterColumn[]>(() =>
29
- menuItemsToFooterColumns(footerMenu.value),
31
+ const columns = computed(() =>
32
+ footerMenu.value.filter((column) => column.children?.length),
30
33
  );
31
34
  </script>
32
35
 
33
36
  <template>
34
- <USeparator class="h-px" />
35
-
36
- <UFooter :ui="{ top: 'border-b border-default' }">
37
- <template #top>
38
- <UContainer>
39
- <FooterContact />
40
- <UFooterColumns :columns="footerColumns" />
41
- </UContainer>
42
- </template>
43
-
44
- <template #left>
45
- <NuxtLink
46
- to="https://shopbite.de"
47
- class="text-sm text-muted"
48
- target="_blank"
37
+ <footer
38
+ class="border-t border-sb-line bg-sb-bg font-body text-sb-ink"
39
+ aria-labelledby="footer-title"
40
+ >
41
+ <div
42
+ class="mx-auto flex w-full max-w-(--sb-container) flex-col gap-12 px-4 pt-14 pb-10 sm:px-6 lg:px-8"
43
+ >
44
+ <div
45
+ class="grid gap-10 md:grid-cols-2 lg:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_minmax(0,1.4fr)]"
49
46
  >
50
- Bestellsystem von ShopBite • © {{ new Date().getFullYear() }}
51
- </NuxtLink>
52
- </template>
47
+ <address class="flex flex-col gap-3 not-italic">
48
+ <h2 id="footer-title" class="font-display text-[28px] leading-none">
49
+ {{ site.name }}
50
+ </h2>
51
+ <p
52
+ v-if="site.address.street || locality"
53
+ class="text-[15px] leading-relaxed text-sb-ink-muted"
54
+ >
55
+ <template v-if="site.address.street"
56
+ >{{ site.address.street }}<br
57
+ /></template>
58
+ {{ locality }}
59
+ </p>
60
+ <a
61
+ v-if="site.telephone"
62
+ :href="toTelHref(site.telephone)"
63
+ class="inline-flex min-h-11 items-center gap-2 self-start font-bold text-sb-ink hover:text-sb-primary-ink focus-visible:outline-3 focus-visible:outline-sb-focus"
64
+ >
65
+ <SbIcon name="phone" :size="16" />
66
+ {{ site.telephone }}
67
+ </a>
68
+ <a
69
+ v-if="site.googleBusinessProfileUrl"
70
+ :href="site.googleBusinessProfileUrl"
71
+ target="_blank"
72
+ rel="noopener"
73
+ class="inline-flex min-h-11 items-center self-start text-[15px] text-sb-ink-muted underline underline-offset-4 hover:text-sb-ink focus-visible:outline-3 focus-visible:outline-sb-focus"
74
+ >
75
+ Auf Google ansehen
76
+ </a>
77
+ </address>
53
78
 
54
- <p class="text-muted text-sm">
55
- Alle Preise inkl. gesetzlicher Mehrwertsteuer zzgl. Versandkosten, wenn
56
- nicht anders beschrieben
57
- </p>
79
+ <section
80
+ v-if="openingHours.length"
81
+ id="oeffnungszeiten"
82
+ class="flex scroll-mt-24 flex-col gap-3"
83
+ aria-labelledby="footer-hours"
84
+ >
85
+ <h2 id="footer-hours" class="text-sm font-bold">Öffnungszeiten</h2>
86
+ <FooterStoreStatus />
87
+ <dl class="grid grid-cols-[auto_1fr] gap-x-6 gap-y-1.5 text-[15px]">
88
+ <template v-for="row in openingHours" :key="row.days">
89
+ <dt class="font-semibold">{{ row.days }}</dt>
90
+ <dd class="text-sb-ink-muted tabular-nums">
91
+ {{
92
+ row.intervals.length ? row.intervals.join(", ") : "Ruhetag"
93
+ }}
94
+ </dd>
95
+ </template>
96
+ </dl>
97
+ </section>
58
98
 
59
- <template #right>
60
- <UColorModeButton />
99
+ <div
100
+ v-if="columns.length"
101
+ class="grid grid-cols-2 gap-8 sm:grid-cols-3 md:col-span-2 lg:col-span-1"
102
+ >
103
+ <nav
104
+ v-for="column in columns"
105
+ :key="column.label"
106
+ :aria-label="column.label"
107
+ class="flex flex-col gap-1"
108
+ >
109
+ <h2 class="mb-1 text-sm font-bold">{{ column.label }}</h2>
110
+ <NuxtLink
111
+ v-for="link in column.children"
112
+ :key="String(link.to)"
113
+ :to="link.to"
114
+ :target="linkTarget(link)"
115
+ class="inline-flex min-h-9 items-center text-[15px] text-sb-ink-muted hover:text-sb-ink focus-visible:outline-3 focus-visible:outline-sb-focus"
116
+ >
117
+ {{ link.label }}
118
+ </NuxtLink>
119
+ </nav>
120
+ </div>
121
+ </div>
61
122
 
62
- <UButton
63
- to="https://github.com/shopbite-de/storefront"
64
- target="_blank"
65
- icon="i-simple-icons-github"
66
- aria-label="ShopBite on GitHub"
67
- color="neutral"
68
- variant="ghost"
69
- />
70
- </template>
71
- </UFooter>
123
+ <div
124
+ class="flex flex-col gap-3 border-t border-sb-line pt-6 text-[13px] text-sb-ink-muted sm:flex-row sm:items-center sm:justify-between"
125
+ >
126
+ <p>
127
+ © {{ year }} {{ site.name }} · Alle Preise inkl. MwSt., zzgl.
128
+ Liefergebühr, wenn nicht anders angegeben
129
+ </p>
130
+ <a
131
+ href="https://shopbite.de"
132
+ target="_blank"
133
+ rel="noopener"
134
+ class="inline-flex min-h-11 items-center hover:text-sb-ink focus-visible:outline-3 focus-visible:outline-sb-focus"
135
+ >Online bestellen mit ShopBite</a
136
+ >
137
+ </div>
138
+ </div>
139
+ </footer>
72
140
  </template>