@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
@@ -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>