@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
@@ -44,37 +44,40 @@ async function handleAddressUpdate() {
44
44
  onMounted(() => {
45
45
  refreshUserAddresses();
46
46
  });
47
+
48
+ // Presets: plain text in the checkout section instead of a card (#443).
47
49
  </script>
48
50
 
49
51
  <template>
50
- <UCard class="mb-4">
51
- <div>{{ fullName }}</div>
52
- <div>{{ user?.email }}</div>
53
- <USeparator
54
- color="primary"
55
- class="my-6"
56
- :decorative="true"
57
- :label="
58
- areAddressesDifferent ? 'Lieferadresse' : 'Liefer- und Rechnungsadresse'
59
- "
60
- />
61
- <AddressDetail
62
- :address="userDefaultShippingAddress"
63
- :with-edit-button="withEditButton"
64
- @update:address="handleAddressUpdate"
65
- />
66
- <USeparator
67
- v-if="areAddressesDifferent"
68
- class="my-6"
69
- color="primary"
70
- :decorative="true"
71
- label="Rechnungsadresse"
72
- />
73
- <AddressDetail
52
+ <div class="flex flex-col gap-4 font-body text-sb-ink">
53
+ <p>
54
+ <strong class="block">{{ fullName }}</strong>
55
+ <span class="text-sb-ink-muted">{{ user?.email }}</span>
56
+ </p>
57
+ <div class="flex flex-col gap-2 border-t border-sb-line pt-4">
58
+ <h3 class="text-sm font-bold">
59
+ {{
60
+ areAddressesDifferent
61
+ ? "Lieferadresse"
62
+ : "Liefer- und Rechnungsadresse"
63
+ }}
64
+ </h3>
65
+ <AddressDetail
66
+ :address="userDefaultShippingAddress"
67
+ :with-edit-button="withEditButton"
68
+ @update:address="handleAddressUpdate"
69
+ />
70
+ </div>
71
+ <div
74
72
  v-if="areAddressesDifferent"
75
- :address="userDefaultBillingAddress"
76
- :with-edit-button="withEditButton"
77
- @update:address="handleAddressUpdate"
78
- />
79
- </UCard>
73
+ class="flex flex-col gap-2 border-t border-sb-line pt-4"
74
+ >
75
+ <h3 class="text-sm font-bold">Rechnungsadresse</h3>
76
+ <AddressDetail
77
+ :address="userDefaultBillingAddress"
78
+ :with-edit-button="withEditButton"
79
+ @update:address="handleAddressUpdate"
80
+ />
81
+ </div>
82
+ </div>
80
83
  </template>
@@ -1,123 +1,117 @@
1
1
  <script setup lang="ts">
2
2
  import * as z from "zod";
3
3
  import { ApiClientError } from "@shopware/api-client";
4
- import type { FormSubmitEvent } from "@nuxt/ui";
5
4
 
6
- const { isLoggedIn, login, user } = useUser();
7
- const toast = useToast();
5
+ /**
6
+ * Login of the presets (#443), same checks and call as User/LoginForm.vue
7
+ * with the base components; errors show at the fields and above the form.
8
+ */
9
+ const emit = defineEmits<{ "login-success": [email: string] }>();
8
10
 
9
- const props = withDefaults(
10
- defineProps<{
11
- title?: string;
12
- icon?: string;
13
- withRegisterHint?: boolean;
14
- }>(),
15
- {
16
- title: "",
17
- icon: "",
18
- withRegisterHint: false,
19
- },
20
- );
21
-
22
- const emit = defineEmits<{
23
- "login-success": [data: string];
24
- }>();
25
-
26
- const { title, icon } = toRefs(props);
27
-
28
- if (isLoggedIn.value) {
29
- navigateTo({ path: "/konto" });
30
- }
31
-
32
- const fields = [
33
- {
34
- name: "email",
35
- type: "text" as const,
36
- label: "Email",
37
- placeholder: "Email-Adresse eingeben",
38
- required: true,
39
- },
40
- {
41
- name: "password",
42
- label: "Passwort",
43
- type: "password" as const,
44
- placeholder: "Passwort eingeben",
45
- required: true,
46
- },
47
- ];
11
+ const { login } = useUser();
48
12
 
49
13
  const schema = z.object({
50
- email: z.string().email("Email Adresse nicht gültig"),
51
- password: z.string().min(8, "Mindestens 8 Zeichen"),
14
+ email: z.string().email("Bitte geben Sie eine gültige E-Mail-Adresse ein."),
15
+ password: z.string().min(8, "Das Passwort hat mindestens 8 Zeichen."),
52
16
  });
53
17
 
54
- type Schema = z.output<typeof schema>;
18
+ const state = reactive({ email: "", password: "" });
19
+ const errors = ref<Partial<Record<"email" | "password", string>>>({});
20
+ const loginError = ref<string | null>(null);
21
+ const submitting = ref(false);
22
+ const alertBox = ref<HTMLElement | null>(null);
55
23
 
56
- async function onSubmit(payload: FormSubmitEvent<Schema>) {
24
+ async function onSubmit() {
25
+ loginError.value = null;
26
+ const result = schema.safeParse(state);
27
+ if (!result.success) {
28
+ const next: typeof errors.value = {};
29
+ for (const issue of result.error.issues) {
30
+ const key = issue.path[0] as "email" | "password";
31
+ next[key] ??= issue.message;
32
+ }
33
+ errors.value = next;
34
+ return;
35
+ }
36
+ errors.value = {};
37
+ submitting.value = true;
57
38
  try {
58
- await login({
59
- username: payload.data.email,
60
- password: payload.data.password,
61
- });
62
- toast.add({
63
- title:
64
- "Hallo " + user.value?.firstName + " " + user.value?.lastName + "!",
65
- description: "Erfolgreich angemeldet.",
66
- color: "success",
67
- });
68
- emit("login-success", payload.data.email);
39
+ await login({ username: state.email, password: state.password });
40
+ emit("login-success", state.email);
69
41
  } catch (error) {
70
42
  console.error("Login failed:", error);
71
- let description = "Bitte überprüfen Sie Ihre Zugangsdaten.";
43
+ let message = "Bitte überprüfen Sie Ihre Zugangsdaten.";
72
44
  if (error instanceof ApiClientError) {
73
- const errors = error.details?.errors;
74
- if (Array.isArray(errors) && errors.length > 0) {
75
- description = errors
76
- .map((e) => e.detail || e.title)
45
+ const details = error.details?.errors;
46
+ if (Array.isArray(details) && details.length > 0) {
47
+ message = details
48
+ .map((detail) => detail.detail || detail.title)
77
49
  .filter(Boolean)
78
50
  .join("\n");
79
51
  }
80
52
  }
81
- toast.add({
82
- title: "Login fehlgeschlagen",
83
- description,
84
- color: "error",
85
- });
53
+ loginError.value = message;
54
+ await nextTick();
55
+ alertBox.value?.focus();
56
+ } finally {
57
+ submitting.value = false;
86
58
  }
87
59
  }
88
60
  </script>
89
61
 
90
62
  <template>
91
- <UAuthForm
92
- :schema="schema"
93
- :title="title"
94
- :icon="icon"
95
- :fields="fields"
96
- :submit="{
97
- label: 'Anmelden',
98
- }"
99
- @submit="onSubmit"
63
+ <form
64
+ novalidate
65
+ class="flex flex-col gap-4 font-body text-sb-ink"
66
+ @submit.prevent="onSubmit"
100
67
  >
101
- <template v-if="withRegisterHint" #description>
102
- Noch kein Konto erstellt?
103
- <ULink to="registrierung" class="text-primary font-medium"
104
- >Jetzt erstellen</ULink
105
- >.
106
- </template>
107
- <template #password-hint>
108
- <ULink
109
- to="passwort-vergessen"
110
- class="text-primary font-medium"
111
- tabindex="-1"
112
- >Passwort vergessen?</ULink
113
- >
114
- </template>
115
- <template #footer>
116
- Bei Anmeldung stimmst du unseren
117
- <ULink to="datenschutz" class="text-primary font-medium"
118
- >Datenschutzbestimmungen</ULink
119
- >
120
- zu.
121
- </template>
122
- </UAuthForm>
68
+ <div
69
+ v-if="loginError"
70
+ ref="alertBox"
71
+ role="alert"
72
+ tabindex="-1"
73
+ class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm whitespace-pre-line"
74
+ >
75
+ <strong class="block text-base">Anmeldung fehlgeschlagen</strong>
76
+ {{ loginError }}
77
+ </div>
78
+ <SbField
79
+ v-slot="{ id, describedBy, invalid }"
80
+ label="E-Mail"
81
+ :error="errors.email"
82
+ >
83
+ <SbInput
84
+ :id="id"
85
+ v-model="state.email"
86
+ name="email"
87
+ type="email"
88
+ autocomplete="username"
89
+ :aria-describedby="describedBy"
90
+ :invalid="invalid"
91
+ />
92
+ </SbField>
93
+ <SbField
94
+ v-slot="{ id, describedBy, invalid }"
95
+ label="Passwort"
96
+ :error="errors.password"
97
+ >
98
+ <SbInput
99
+ :id="id"
100
+ v-model="state.password"
101
+ name="password"
102
+ type="password"
103
+ autocomplete="current-password"
104
+ :aria-describedby="describedBy"
105
+ :invalid="invalid"
106
+ />
107
+ </SbField>
108
+ <NuxtLink
109
+ to="/passwort-vergessen"
110
+ class="inline-flex min-h-11 items-center self-start text-sm font-semibold text-sb-primary-ink underline underline-offset-4 focus-visible:outline-3 focus-visible:outline-sb-focus"
111
+ >Passwort vergessen?</NuxtLink
112
+ >
113
+ <SbButton type="submit" size="lg" block :loading="submitting"
114
+ >Anmelden</SbButton
115
+ >
116
+ </form>
123
117
  </template>