@shopbite-de/storefront 1.31.3 → 2.0.1

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 (187) hide show
  1. package/.github/workflows/ci.yaml +87 -0
  2. package/.gitignore +5 -0
  3. package/CLAUDE.md +27 -8
  4. package/app/app.vue +10 -6
  5. package/app/assets/css/main.css +103 -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 +24 -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/modules/theme.ts +123 -0
  114. package/nuxt.config.ts +30 -16
  115. package/package.json +6 -8
  116. package/playwright.config.ts +11 -0
  117. package/server/api/listing/[categoryId].get.ts +3 -0
  118. package/shared/theme/presets.ts +303 -0
  119. package/test/a11y/presets.test.ts +225 -0
  120. package/test/layer/nuxt.config.ts +8 -0
  121. package/test/nuxt/AccountPagesPreset.test.ts +191 -0
  122. package/test/nuxt/AuthPagesPreset.test.ts +87 -0
  123. package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
  124. package/test/nuxt/CartItem.test.ts +18 -3
  125. package/test/nuxt/CartUpsell.test.ts +1 -2
  126. package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
  127. package/test/nuxt/CheckoutOnePage.test.ts +115 -0
  128. package/test/nuxt/CheckoutSummary.test.ts +6 -6
  129. package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
  130. package/test/nuxt/ContactFormPreset.test.ts +115 -0
  131. package/test/nuxt/FooterStoreStatus.test.ts +2 -2
  132. package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
  133. package/test/nuxt/HomeFaq.test.ts +3 -2
  134. package/test/nuxt/MenuBonCard.test.ts +122 -0
  135. package/test/nuxt/OrderPagesPreset.test.ts +132 -0
  136. package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
  137. package/test/nuxt/ProductCrossSelling.test.ts +2 -1
  138. package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
  139. package/test/nuxt/ProductSheetPreset.test.ts +105 -0
  140. package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
  141. package/test/nuxt/RegistrationForm.test.ts +89 -270
  142. package/test/nuxt/SbBaseComponents.test.ts +170 -0
  143. package/test/nuxt/SbStars.test.ts +25 -0
  144. package/test/nuxt/useCartMutations.test.ts +3 -17
  145. package/test/nuxt/useCartUpsell.test.ts +1 -1
  146. package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
  147. package/test/nuxt/useShareLink.test.ts +1 -9
  148. package/test/nuxt/useWishlistActions.test.ts +3 -26
  149. package/test/unit/highlight.spec.ts +31 -0
  150. package/test/unit/product.spec.ts +12 -0
  151. package/test/unit/themePresets.spec.ts +61 -0
  152. package/app/app.config.ts +0 -19
  153. package/app/components/AnimatedSection.vue +0 -74
  154. package/app/components/BottomNavi.vue +0 -70
  155. package/app/components/Category/Header.vue +0 -48
  156. package/app/components/Checkout/PaymentMethod.vue +0 -30
  157. package/app/components/Checkout/ShippingMethod.vue +0 -30
  158. package/app/components/Cta.vue +0 -30
  159. package/app/components/Feature/Card.vue +0 -121
  160. package/app/components/Features.vue +0 -42
  161. package/app/components/Footer/Contact.vue +0 -82
  162. package/app/components/Header/Body.vue +0 -82
  163. package/app/components/Header/Right.vue +0 -187
  164. package/app/components/Header/Title.vue +0 -10
  165. package/app/components/Hero.vue +0 -233
  166. package/app/components/Home/MenuCategories.vue +0 -148
  167. package/app/components/ImageGallery.vue +0 -63
  168. package/app/components/Loading.vue +0 -29
  169. package/app/components/Navigation/DesktopLeft.vue +0 -39
  170. package/app/components/Product/Card.vue +0 -177
  171. package/app/components/Product/CardCompact.vue +0 -72
  172. package/app/components/Product/CardDietBadges.vue +0 -43
  173. package/app/components/Product/CardIngredients.vue +0 -35
  174. package/app/components/Product/CardKitchen.vue +0 -34
  175. package/app/components/Product/SearchBar.vue +0 -95
  176. package/app/components/PublicAnnouncement.vue +0 -17
  177. package/app/pages/bestellung/bestaetigen.vue +0 -16
  178. package/app/pages/bestellung/warenkorb.vue +0 -49
  179. package/app/pages/bestellung/zahlung-versand.vue +0 -25
  180. package/test/nuxt/AddressFields.test.ts +0 -222
  181. package/test/nuxt/AnimatedSection.test.ts +0 -67
  182. package/test/nuxt/ContactForm.test.ts +0 -207
  183. package/test/nuxt/FooterContact.test.ts +0 -102
  184. package/test/nuxt/HeaderRight.test.ts +0 -142
  185. package/test/nuxt/Hero.test.ts +0 -126
  186. package/test/nuxt/HomeMenuCategories.test.ts +0 -94
  187. package/test/nuxt/LoginForm.test.ts +0 -159
@@ -1,159 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach } from "vitest";
2
- import { mountSuspended, mockNuxtImport } from "@nuxt/test-utils/runtime";
3
- import { ref } from "vue";
4
- import LoginForm from "@/components/User/LoginForm.vue";
5
- import { ApiClientError } from "@shopware/api-client";
6
-
7
- type LoginFormVm = {
8
- onSubmit: (arg: {
9
- data: { email: string; password: string };
10
- }) => Promise<void>;
11
- };
12
-
13
- vi.mock("@shopware/api-client", () => ({
14
- ApiClientError: class extends Error {
15
- details: unknown;
16
- constructor(details: unknown) {
17
- super("ApiClientError");
18
- this.details = details;
19
- }
20
- },
21
- }));
22
-
23
- vi.mock("@shopware/composables", () => ({
24
- useUser: vi.fn(),
25
- useWishlist: vi.fn(),
26
- }));
27
-
28
- const mockToastAdd = vi.fn();
29
- mockNuxtImport("useToast", () => {
30
- return () => ({
31
- add: mockToastAdd,
32
- });
33
- });
34
-
35
- const loginMock = vi.fn();
36
- const userMock = ref({ firstName: "John", lastName: "Doe" });
37
- const isLoggedInMock = ref(false);
38
-
39
- mockNuxtImport("useUser", () => {
40
- return () => ({
41
- isLoggedIn: isLoggedInMock,
42
- login: loginMock,
43
- user: userMock,
44
- });
45
- });
46
-
47
- mockNuxtImport("useWishlist", () => {
48
- return () => ({
49
- mergeWishlistProducts: vi.fn(),
50
- });
51
- });
52
-
53
- describe("LoginForm", () => {
54
- beforeEach(() => {
55
- vi.clearAllMocks();
56
- loginMock.mockReset();
57
- isLoggedInMock.value = false;
58
- userMock.value = { firstName: "John", lastName: "Doe" };
59
- });
60
-
61
- it("should show success toast on successful login", async () => {
62
- loginMock.mockResolvedValueOnce({});
63
- const wrapper = await mountSuspended(LoginForm);
64
-
65
- // Call onSubmit directly if form trigger is not working in test
66
- await (wrapper.vm as unknown as LoginFormVm).onSubmit({
67
- data: {
68
- email: "test@example.com",
69
- password: "password123",
70
- },
71
- });
72
-
73
- expect(loginMock).toHaveBeenCalledWith({
74
- username: "test@example.com",
75
- password: "password123",
76
- });
77
-
78
- expect(mockToastAdd).toHaveBeenCalledWith(
79
- expect.objectContaining({
80
- title: "Hallo John Doe!",
81
- description: "Erfolgreich angemeldet.",
82
- color: "success",
83
- }),
84
- );
85
- });
86
-
87
- it("should show error toast on failed login", async () => {
88
- loginMock.mockRejectedValueOnce(new Error("Invalid credentials"));
89
- const wrapper = await mountSuspended(LoginForm);
90
-
91
- // Call onSubmit directly if form trigger is not working in test
92
- await (wrapper.vm as unknown as LoginFormVm).onSubmit({
93
- data: {
94
- email: "test@example.com",
95
- password: "wrongpassword",
96
- },
97
- });
98
-
99
- expect(loginMock).toHaveBeenCalled();
100
-
101
- expect(mockToastAdd).toHaveBeenCalledWith(
102
- expect.objectContaining({
103
- title: "Login fehlgeschlagen",
104
- description: "Bitte überprüfen Sie Ihre Zugangsdaten.",
105
- color: "error",
106
- }),
107
- );
108
- });
109
-
110
- it("should show detailed error toast on ApiClientError", async () => {
111
- const apiClientError = new ApiClientError({
112
- errors: [
113
- {
114
- detail: 'The email address "test@example.com" is already in use',
115
- },
116
- ],
117
- } as unknown as ConstructorParameters<typeof ApiClientError>[0]);
118
- loginMock.mockRejectedValueOnce(apiClientError);
119
- const wrapper = await mountSuspended(LoginForm);
120
-
121
- await (wrapper.vm as unknown as LoginFormVm).onSubmit({
122
- data: {
123
- email: "test@example.com",
124
- password: "password123",
125
- },
126
- });
127
-
128
- expect(mockToastAdd).toHaveBeenCalledWith(
129
- expect.objectContaining({
130
- title: "Login fehlgeschlagen",
131
- description: 'The email address "test@example.com" is already in use',
132
- color: "error",
133
- }),
134
- );
135
- });
136
-
137
- it("should handle ApiClientError with missing errors gracefully", async () => {
138
- const apiClientError = new ApiClientError(
139
- {} as unknown as ConstructorParameters<typeof ApiClientError>[0],
140
- );
141
- loginMock.mockRejectedValueOnce(apiClientError);
142
- const wrapper = await mountSuspended(LoginForm);
143
-
144
- await (wrapper.vm as unknown as LoginFormVm).onSubmit({
145
- data: {
146
- email: "test@example.com",
147
- password: "password123",
148
- },
149
- });
150
-
151
- expect(mockToastAdd).toHaveBeenCalledWith(
152
- expect.objectContaining({
153
- title: "Login fehlgeschlagen",
154
- description: "Bitte überprüfen Sie Ihre Zugangsdaten.",
155
- color: "error",
156
- }),
157
- );
158
- });
159
- });