@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
@@ -22,6 +22,14 @@ const deselected = ref<string[]>(
22
22
  ingredients.value.filter((name) => props.initialDeselected?.includes(name)),
23
23
  );
24
24
 
25
+ const labelId = useId();
26
+
27
+ // SbChip is pressed while the ingredient is included.
28
+ function setIncluded(ingredient: string, included: boolean) {
29
+ if (included === !deselected.value.includes(ingredient)) return;
30
+ toggle(ingredient);
31
+ }
32
+
25
33
  function toggle(ingredient: string) {
26
34
  deselected.value = deselected.value.includes(ingredient)
27
35
  ? deselected.value.filter((name) => name !== ingredient)
@@ -34,32 +42,19 @@ watch(deselected, () => emit("ingredients-deselected", deselected.value), {
34
42
  </script>
35
43
 
36
44
  <template>
37
- <div v-if="ingredients.length > 0" class="flex flex-col gap-2">
38
- <!-- The quick view lists the ingredients only here (no chip row above
39
- repeating them): tapping one removes it from the order. Both states
40
- carry an icon of the same size, so toggling a chip keeps its width
41
- and never rewraps the row (the drawer grew on phones). -->
42
- <div class="flex items-baseline justify-between">
43
- <span class="font-semibold text-highlighted">Zutaten</span>
44
- <span class="text-xs text-muted">antippen zum Entfernen</span>
45
+ <div v-if="ingredients.length > 0" class="flex flex-col gap-2.5">
46
+ <div class="flex items-baseline justify-between gap-3">
47
+ <span :id="labelId" class="font-body font-bold text-sb-ink">Zutaten</span>
48
+ <span class="text-[13px] text-sb-ink-muted">Antippen zum Weglassen</span>
45
49
  </div>
46
- <div
47
- class="flex flex-wrap gap-2"
48
- role="group"
49
- aria-label="Zutaten abwählen"
50
- >
51
- <UButton
50
+ <div class="flex flex-wrap gap-2" role="group" :aria-labelledby="labelId">
51
+ <SbChip
52
52
  v-for="ingredient in ingredients"
53
53
  :key="ingredient"
54
- size="lg"
55
- class="rounded-full"
56
- :class="{ 'line-through': deselected.includes(ingredient) }"
57
- :color="deselected.includes(ingredient) ? 'error' : 'neutral'"
58
- :variant="deselected.includes(ingredient) ? 'subtle' : 'outline'"
59
- :icon="deselected.includes(ingredient) ? 'i-lucide-plus' : 'i-lucide-x'"
60
- :aria-pressed="deselected.includes(ingredient)"
61
54
  :label="ingredient"
62
- @click="toggle(ingredient)"
55
+ variant="ingredient"
56
+ :model-value="!deselected.includes(ingredient)"
57
+ @update:model-value="setIncluded(ingredient, $event)"
63
58
  />
64
59
  </div>
65
60
  </div>
@@ -79,6 +79,10 @@ const onVariantSwitched = (variant: Schemas["Product"]) => {
79
79
  };
80
80
 
81
81
  const onAddToCart = () => emit("product-added");
82
+
83
+ const productName = computed(
84
+ () => selectedProduct.value?.translated?.name ?? "Gericht",
85
+ );
82
86
  </script>
83
87
 
84
88
  <template>
@@ -86,23 +90,31 @@ const onAddToCart = () => emit("product-added");
86
90
  <!-- One placeholder in the shape of the loaded body (options,
87
91
  ingredients, extras), shown until product and extras are both
88
92
  loaded. -->
89
- <div v-if="pending" class="flex flex-col gap-5" aria-busy="true">
93
+ <div
94
+ v-if="pending"
95
+ class="flex flex-col gap-5 motion-safe:animate-pulse"
96
+ aria-busy="true"
97
+ >
90
98
  <div class="flex flex-col gap-2">
91
- <USkeleton class="h-5 w-24" />
92
- <USkeleton class="h-11 w-full" />
99
+ <div class="h-5 w-24 rounded bg-sb-muted" />
100
+ <div class="h-11 w-full rounded bg-sb-muted" />
93
101
  </div>
94
102
  <div class="flex flex-col gap-2">
95
- <USkeleton class="h-5 w-20" />
103
+ <div class="h-5 w-20 rounded bg-sb-muted" />
96
104
  <div class="flex flex-wrap gap-2">
97
- <USkeleton class="h-8 w-20 rounded-full" />
98
- <USkeleton class="h-8 w-24 rounded-full" />
99
- <USkeleton class="h-8 w-16 rounded-full" />
100
- <USkeleton class="h-8 w-28 rounded-full" />
105
+ <div class="h-8 w-20 rounded-full rounded bg-sb-muted" />
106
+ <div class="h-8 w-24 rounded-full rounded bg-sb-muted" />
107
+ <div class="h-8 w-16 rounded-full rounded bg-sb-muted" />
108
+ <div class="h-8 w-28 rounded-full rounded bg-sb-muted" />
101
109
  </div>
102
110
  </div>
103
111
  <div class="flex flex-col gap-3">
104
- <USkeleton class="h-5 w-28" />
105
- <USkeleton v-for="row in 4" :key="row" class="h-7 w-full" />
112
+ <div class="h-5 w-28 rounded bg-sb-muted" />
113
+ <div
114
+ v-for="row in 4"
115
+ :key="row"
116
+ class="h-7 w-full rounded bg-sb-muted"
117
+ />
106
118
  </div>
107
119
  </div>
108
120
  <template v-else-if="productDetails?.configurator">
@@ -125,33 +137,29 @@ const onAddToCart = () => emit("product-added");
125
137
  />
126
138
  </template>
127
139
 
140
+ <!-- -bottom-5/-mb-5 cover the sheet body's bottom padding, which sticky
141
+ positioning keeps free and the list scrolled through (#442). -->
128
142
  <div
129
- class="sticky bottom-0 mt-auto flex items-center gap-3 border-t border-default bg-default pt-4"
143
+ class="sticky -bottom-5 -mx-5 -mb-5 mt-auto flex items-center gap-2.5 border-t border-sb-line bg-sb-surface px-4 pt-3 pb-[max(1.25rem,env(safe-area-inset-bottom))]"
130
144
  >
131
- <UInputNumber
145
+ <SbStepper
132
146
  v-model="selectedQuantity"
133
- size="xl"
134
- aria-label="Anzahl"
135
- :min="1"
147
+ :item-name="productName"
136
148
  :max="100"
137
- :disabled="pending"
138
- class="w-28 shrink-0"
149
+ size="lg"
139
150
  />
140
- <!-- Short label: "In den Warenkorb" wrapped next to the total on phones. -->
141
- <UButton
142
- class="flex-1 justify-between whitespace-nowrap"
143
- size="xl"
144
- icon="i-lucide-shopping-cart"
145
- :disabled="isLoading || pending || !isAvailable"
151
+ <SbButton
152
+ size="lg"
153
+ class="min-h-14 min-w-0 flex-1 justify-between px-5"
154
+ :disabled="pending || !isAvailable"
146
155
  :loading="isLoading"
147
- aria-label="In den Warenkorb"
148
156
  @click="addToCart(onAddToCart)"
149
157
  >
150
- <span>{{ isAvailable ? "Hinzufügen" : "Ausverkauft" }}</span>
151
- <span v-if="isAvailable && !pending" class="font-bold">
158
+ <span>{{ isAvailable ? "In den Warenkorb" : "Ausverkauft" }}</span>
159
+ <span v-if="isAvailable && !pending" class="tabular-nums">
152
160
  {{ getFormattedPrice(total) }}
153
161
  </span>
154
- </UButton>
162
+ </SbButton>
155
163
  </div>
156
164
  </div>
157
165
  </template>
@@ -1,6 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import type { Schemas } from "#shopware";
3
- import { useMediaQuery } from "@vueuse/core";
3
+ import { DialogDescription, DialogTitle } from "reka-ui";
4
4
 
5
5
  const props = defineProps<{
6
6
  product: Schemas["Product"] | undefined;
@@ -11,10 +11,6 @@ const open = defineModel<boolean>("open", { required: true });
11
11
  const { initial, update: updateConfiguration } = useQuickViewConfiguration();
12
12
  const { share, canShare } = useShareLink();
13
13
 
14
- // Bottom sheet on phones, side panel from the lg breakpoint (64rem).
15
- const isDesktop = useMediaQuery("(min-width: 64rem)");
16
- const direction = computed(() => (isDesktop.value ? "right" : "bottom"));
17
-
18
14
  const sortedProperties = computed(
19
15
  () =>
20
16
  props.product?.sortedProperties as Schemas["PropertyGroup"][] | undefined,
@@ -23,6 +19,8 @@ const label = ref(props.product?.translated.name ?? props.product?.name ?? "");
23
19
  const description = ref(props.product?.description);
24
20
  // Follows the selected variant, like the URL (#411).
25
21
  const productNumber = ref(props.product?.productNumber);
22
+ // Built in script: a trailing space in the template would be condensed away.
23
+ const numberLabel = computed(() => `Nr. ${productNumber.value} `);
26
24
 
27
25
  watch(
28
26
  () => props.product,
@@ -34,6 +32,13 @@ watch(
34
32
  },
35
33
  );
36
34
 
35
+ // The base sheet with a bon header (#442).
36
+ const diets = computed(() =>
37
+ getDiets(sortedProperties.value).map((diet) =>
38
+ diet === "vegan" ? "Vegan" : "Vegetarisch",
39
+ ),
40
+ );
41
+
37
42
  function onVariantSelected(variant: Schemas["Product"]) {
38
43
  label.value = variant.translated.name ?? variant.name;
39
44
  description.value = variant.translated.description ?? variant.description;
@@ -42,56 +47,80 @@ function onVariantSelected(variant: Schemas["Product"]) {
42
47
  </script>
43
48
 
44
49
  <template>
45
- <!-- Only the body scrolls: header and footer stay in place without sticky
46
- positioning, and shrink-0 keeps the flex column from squeezing the
47
- header to its min-height (#325). -->
48
- <UDrawer
50
+ <SbSheet
49
51
  v-model:open="open"
50
- :direction="direction"
51
- :close="true"
52
- :ui="{
53
- content: direction === 'right' ? 'w-full max-w-md' : 'max-h-[92vh]',
54
- container: 'overflow-hidden',
55
- header: 'shrink-0 items-start border-b border-default pb-3',
56
- body: 'flex min-h-0 flex-col gap-5 overflow-y-auto',
57
- }"
52
+ :title="label"
53
+ :description="description ?? undefined"
58
54
  >
59
- <template #title>
60
- <span class="flex flex-col gap-0.5">
61
- <span class="text-xs font-semibold text-primary">
62
- #{{ productNumber }}
63
- </span>
64
- <span class="text-xl font-bold text-highlighted">{{ label }}</span>
65
- </span>
55
+ <!-- Long single words ("Camembertkäse") hyphenate (lang="de") or
56
+ break instead of being clipped by the card (#442). -->
57
+ <template #header>
58
+ <div
59
+ class="grid grid-cols-[64px_minmax(0,1fr)] overflow-hidden rounded-sb-card border border-sb-line bg-sb-surface"
60
+ >
61
+ <span
62
+ aria-hidden="true"
63
+ :class="[
64
+ 'flex items-center justify-center border-r-2 border-dashed border-sb-line bg-sb-muted px-1.5 text-center font-display tabular-nums',
65
+ (productNumber?.length ?? 0) <= 3
66
+ ? 'text-xl whitespace-nowrap'
67
+ : (productNumber?.length ?? 0) <= 6
68
+ ? 'text-[15px] whitespace-nowrap'
69
+ : 'text-xs leading-tight [overflow-wrap:anywhere]',
70
+ ]"
71
+ >{{ productNumber }}</span
72
+ >
73
+ <div class="flex min-w-0 flex-col gap-1 px-3.5 py-3">
74
+ <DialogTitle
75
+ class="font-display text-xl leading-tight hyphens-auto [overflow-wrap:anywhere] sm:text-2xl"
76
+ >
77
+ <span class="sr-only">{{ numberLabel }}</span
78
+ >{{ label }}
79
+ </DialogTitle>
80
+ <DialogDescription
81
+ v-if="description || diets.length"
82
+ class="text-sm text-sb-ink-muted"
83
+ >
84
+ <span v-if="diets.length" class="font-semibold text-sb-primary-ink"
85
+ >{{ diets.join(" · ") }}{{ description ? " · " : "" }}</span
86
+ >{{ description }}
87
+ </DialogDescription>
88
+ </div>
89
+ </div>
66
90
  </template>
67
91
  <template #actions>
68
- <UButton
69
- :icon="canShare ? 'i-lucide-share-2' : 'i-lucide-link'"
70
- color="neutral"
71
- variant="ghost"
72
- :aria-label="canShare ? 'Teilen' : 'Link kopieren'"
92
+ <SbIconButton
93
+ :label="canShare ? 'Teilen' : 'Link kopieren'"
73
94
  @click="share({ title: label, productNumber })"
74
- />
95
+ >
96
+ <svg
97
+ width="18"
98
+ height="18"
99
+ viewBox="0 0 24 24"
100
+ fill="none"
101
+ stroke="currentColor"
102
+ stroke-width="2"
103
+ stroke-linecap="round"
104
+ stroke-linejoin="round"
105
+ aria-hidden="true"
106
+ >
107
+ <path d="M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7" />
108
+ <path d="M16 6l-4-4-4 4M12 2v13" />
109
+ </svg>
110
+ </SbIconButton>
75
111
  </template>
76
- <template v-if="description" #description>
77
- {{ description }}
78
- </template>
79
- <template #body>
80
- <!-- Diet badges only: the ingredients are listed once, in the
81
- deselectable "Zutaten" section of ProductDetail. -->
82
- <div class="flex flex-wrap gap-1.5 empty:hidden">
83
- <ProductCardDietBadges :sorted-properties="sortedProperties" />
84
- </div>
85
- <ProductDetail
86
- v-if="product"
87
- :key="product.id"
88
- :product-id="product.id"
89
- :initial-without="initial.without"
90
- :initial-extras="initial.extras"
91
- @product-added="open = false"
92
- @variant-selected="onVariantSelected"
93
- @configuration-changed="updateConfiguration"
94
- />
95
- </template>
96
- </UDrawer>
112
+ <ProductDetail
113
+ v-if="product"
114
+ :key="product.id"
115
+ :product-id="product.id"
116
+ :initial-without="initial.without"
117
+ :initial-extras="initial.extras"
118
+ @product-added="open = false"
119
+ @variant-selected="onVariantSelected"
120
+ @configuration-changed="updateConfiguration"
121
+ />
122
+ </SbSheet>
123
+ <!-- Only the body scrolls: header and footer stay in place without sticky
124
+ positioning, and shrink-0 keeps the flex column from squeezing the
125
+ header to its min-height (#325). -->
97
126
  </template>
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import type { SelectMenuItem } from "@nuxt/ui";
3
2
  import type { Schemas } from "#shopware";
4
3
 
5
- type StoreSelectItem = SelectMenuItem & { value: string };
4
+ type StoreSelectItem = { label: string; value: string };
6
5
 
7
6
  const { apiClient } = useShopwareContext();
8
7
 
@@ -12,7 +11,7 @@ const isMultiChannel = useRuntimeConfig().public.shopBite.feature.multiChannel;
12
11
 
13
12
  const storeUrl = computed(() => config.public.storeUrl);
14
13
 
15
- const { data: salesChannels, pending: status } = useAsyncData(
14
+ const { data: salesChannels } = useAsyncData(
16
15
  "multi-channel-group",
17
16
  async () => {
18
17
  const response = await apiClient.invoke(
@@ -50,38 +49,25 @@ function transform(
50
49
 
51
50
  const salesChannels = group.salesChannels ?? [];
52
51
  return salesChannels.map((channel) => ({
53
- label: channel.name,
52
+ label: channel.name ?? "",
54
53
  value: getBestDomainUrl(channel.domains, storeUrlValue),
55
54
  }));
56
55
  }
57
56
 
58
- const selectedStore = ref<StoreSelectItem>();
59
-
60
- watchEffect(() => {
61
- const scValue = salesChannels?.value as StoreSelectItem[] | undefined;
62
- if (Array.isArray(scValue) && storeUrl.value && !selectedStore.value) {
63
- const matchingChannel = scValue.find(
64
- (channel) => channel?.value === storeUrl.value,
65
- );
66
- if (matchingChannel) {
67
- selectedStore.value = matchingChannel;
68
- }
69
- }
70
- });
71
-
72
- watch(selectedStore, (newStore, oldStore) => {
73
- if (newStore && oldStore && newStore.value !== oldStore.value) {
74
- window.location.href = newStore.value;
75
- }
57
+ // The shop of this storefront; picking another one opens its domain.
58
+ const selectedUrl = computed({
59
+ get: () => storeUrl.value,
60
+ set: (url: string) => {
61
+ if (url && url !== storeUrl.value) window.location.href = url;
62
+ },
76
63
  });
77
64
  </script>
78
65
 
79
66
  <template>
80
- <USelectMenu
81
- v-if="isMultiChannel"
82
- v-model="selectedStore"
83
- :items="salesChannels"
84
- :loading="status"
85
- icon="i-lucide-store"
67
+ <SbSelect
68
+ v-if="isMultiChannel && salesChannels?.length"
69
+ v-model="selectedUrl"
70
+ label="Filiale"
71
+ :options="salesChannels"
86
72
  />
87
73
  </template>
@@ -0,0 +1,70 @@
1
+ <script setup lang="ts">
2
+ import type { RouteLocationRaw } from "vue-router";
3
+
4
+ /**
5
+ * Base button (#440). Renders a NuxtLink when `to` is set, otherwise a
6
+ * <button>. Styled only through the preset tokens; minimum height 44 px.
7
+ */
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ variant?: "primary" | "secondary" | "tint" | "ghost";
11
+ size?: "md" | "lg";
12
+ to?: RouteLocationRaw;
13
+ type?: "button" | "submit" | "reset";
14
+ block?: boolean;
15
+ disabled?: boolean;
16
+ loading?: boolean;
17
+ }>(),
18
+ {
19
+ variant: "primary",
20
+ size: "md",
21
+ to: undefined,
22
+ type: "button",
23
+ block: false,
24
+ disabled: false,
25
+ loading: false,
26
+ },
27
+ );
28
+
29
+ const VARIANTS = {
30
+ primary:
31
+ "bg-sb-primary text-sb-on-primary hover:bg-sb-primary-hover border-transparent",
32
+ secondary: "bg-sb-surface text-sb-ink border-sb-control hover:bg-sb-muted",
33
+ tint: "bg-sb-primary-tint text-sb-primary-ink border-transparent hover:brightness-95",
34
+ ghost:
35
+ "bg-transparent text-sb-primary-ink border-transparent hover:bg-sb-muted",
36
+ } as const;
37
+
38
+ const classes = computed(() => [
39
+ "inline-flex items-center justify-center gap-2 rounded-sb-control border-[1.5px] font-body font-bold whitespace-nowrap transition-colors",
40
+ "focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus",
41
+ "disabled:cursor-not-allowed disabled:opacity-60 aria-disabled:cursor-not-allowed aria-disabled:opacity-60",
42
+ props.size === "lg" ? "min-h-13 px-6 text-base" : "min-h-11 px-4 text-[15px]",
43
+ props.block ? "w-full" : "",
44
+ VARIANTS[props.variant],
45
+ ]);
46
+ </script>
47
+
48
+ <template>
49
+ <NuxtLink
50
+ v-if="to && !disabled"
51
+ :to="to"
52
+ :class="classes"
53
+ :aria-busy="loading || undefined"
54
+ >
55
+ <slot name="leading" />
56
+ <slot />
57
+ <slot name="trailing" />
58
+ </NuxtLink>
59
+ <button
60
+ v-else
61
+ :type="type"
62
+ :class="classes"
63
+ :disabled="disabled || loading"
64
+ :aria-busy="loading || undefined"
65
+ >
66
+ <slot name="leading" />
67
+ <slot />
68
+ <slot name="trailing" />
69
+ </button>
70
+ </template>
@@ -0,0 +1,73 @@
1
+ <script setup lang="ts">
2
+ import { CheckboxIndicator, CheckboxRoot } from "reka-ui";
3
+
4
+ /**
5
+ * Checkbox row with label and optional trailing text, e.g. an extra with
6
+ * its surcharge (#440). The whole row is the label, at least 48 px high.
7
+ */
8
+ const props = withDefaults(
9
+ defineProps<{
10
+ label: string;
11
+ /** shown at the end of the row, e.g. "+1,00 €" */
12
+ trailing?: string;
13
+ /** second line under the label */
14
+ description?: string;
15
+ disabled?: boolean;
16
+ /** without the bottom rule, e.g. as a single checkbox in a form */
17
+ plain?: boolean;
18
+ /** fixed id, e.g. for links from an error summary */
19
+ id?: string;
20
+ invalid?: boolean;
21
+ describedBy?: string;
22
+ }>(),
23
+ {
24
+ trailing: undefined,
25
+ description: undefined,
26
+ disabled: false,
27
+ plain: false,
28
+ id: undefined,
29
+ invalid: false,
30
+ describedBy: undefined,
31
+ },
32
+ );
33
+
34
+ const model = defineModel<boolean>({ default: false });
35
+ const generatedId = useId();
36
+ const id = computed(() => props.id ?? generatedId);
37
+ </script>
38
+
39
+ <template>
40
+ <div
41
+ :class="[
42
+ 'flex min-h-12 items-center gap-3 font-body text-[15px] text-sb-ink',
43
+ plain ? '' : 'border-b border-sb-line',
44
+ ]"
45
+ >
46
+ <CheckboxRoot
47
+ :id="id"
48
+ v-model="model"
49
+ :disabled="disabled"
50
+ :aria-invalid="invalid || undefined"
51
+ :aria-describedby="describedBy"
52
+ class="flex size-[22px] shrink-0 items-center justify-center rounded-md border-2 border-sb-control bg-sb-surface text-sb-on-primary transition-colors focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus aria-invalid:border-sb-danger data-[state=checked]:border-sb-primary data-[state=checked]:bg-sb-primary"
53
+ :class="description ? 'mt-3.5 self-start' : 'self-center'"
54
+ >
55
+ <CheckboxIndicator>
56
+ <SbIcon name="check" :size="14" />
57
+ </CheckboxIndicator>
58
+ </CheckboxRoot>
59
+ <label :for="id" class="flex flex-1 cursor-pointer items-center gap-3 py-3">
60
+ <span class="flex flex-1 flex-col gap-0.5">
61
+ <span
62
+ ><slot>{{ label }}</slot></span
63
+ >
64
+ <span v-if="description" class="text-[13px] text-sb-ink-muted">{{
65
+ description
66
+ }}</span>
67
+ </span>
68
+ <span v-if="trailing" class="text-sb-ink-muted tabular-nums">{{
69
+ trailing
70
+ }}</span>
71
+ </label>
72
+ </div>
73
+ </template>
@@ -0,0 +1,51 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * Toggle chip (#440). `filter`: a listing filter, filled when on.
4
+ * `ingredient`: an ingredient that is on by default; switched off it reads
5
+ * "ohne <name>" and is struck through, so the state is not colour only.
6
+ * Its accessible name stays the ingredient (pressed = included), a name
7
+ * that changes with the state would read as a double negative.
8
+ */
9
+ const props = withDefaults(
10
+ defineProps<{
11
+ label: string;
12
+ variant?: "filter" | "ingredient";
13
+ }>(),
14
+ { variant: "filter" },
15
+ );
16
+
17
+ const pressed = defineModel<boolean>({ default: false });
18
+
19
+ const text = computed(() =>
20
+ props.variant === "ingredient" && !pressed.value
21
+ ? `ohne ${props.label}`
22
+ : props.label,
23
+ );
24
+ </script>
25
+
26
+ <template>
27
+ <button
28
+ type="button"
29
+ :aria-pressed="pressed"
30
+ :aria-label="variant === 'ingredient' ? label : undefined"
31
+ :class="[
32
+ 'inline-flex min-h-11 items-center gap-2 rounded-sb-control border-[1.5px] px-3.5 font-body text-sm font-semibold transition-colors focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus',
33
+ variant === 'filter'
34
+ ? pressed
35
+ ? 'border-sb-ink bg-sb-ink text-sb-surface'
36
+ : 'border-sb-control bg-sb-surface text-sb-ink hover:bg-sb-muted'
37
+ : pressed
38
+ ? 'border-sb-control bg-sb-surface text-sb-ink hover:bg-sb-muted'
39
+ : 'border-dashed border-sb-control bg-transparent text-sb-ink-muted line-through',
40
+ ]"
41
+ @click="pressed = !pressed"
42
+ >
43
+ {{ text }}
44
+ <SbIcon
45
+ v-if="variant === 'ingredient' && pressed"
46
+ name="close"
47
+ :size="14"
48
+ class="text-sb-ink-muted"
49
+ />
50
+ </button>
51
+ </template>
@@ -0,0 +1,82 @@
1
+ <script setup lang="ts" generic="T extends string">
2
+ import { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from "reka-ui";
3
+
4
+ /**
5
+ * Single choice from a list, as rows or as cards (#440): variants and
6
+ * required options in the product sheet, delivery or pickup and payment in
7
+ * the checkout. A radio group with a visible legend.
8
+ */
9
+ withDefaults(
10
+ defineProps<{
11
+ legend: string;
12
+ options: {
13
+ value: T;
14
+ label: string;
15
+ description?: string;
16
+ /** e.g. "inklusive", "+2,00 €" */
17
+ trailing?: string;
18
+ disabled?: boolean;
19
+ }[];
20
+ variant?: "rows" | "cards";
21
+ required?: boolean;
22
+ /** visually hide the legend when a heading already names the group */
23
+ hideLegend?: boolean;
24
+ }>(),
25
+ { variant: "rows", required: false, hideLegend: false },
26
+ );
27
+
28
+ const model = defineModel<T>();
29
+ const legendId = useId();
30
+ </script>
31
+
32
+ <template>
33
+ <RadioGroupRoot
34
+ v-model="model"
35
+ :aria-labelledby="legendId"
36
+ :required="required"
37
+ :class="
38
+ variant === 'cards' ? 'grid gap-3 sm:grid-cols-2' : 'flex flex-col gap-2'
39
+ "
40
+ >
41
+ <span
42
+ :id="legendId"
43
+ :class="
44
+ hideLegend
45
+ ? 'sr-only'
46
+ : 'col-span-full flex items-center justify-between font-body text-base font-bold text-sb-ink'
47
+ "
48
+ >
49
+ {{ legend }}
50
+ <span
51
+ v-if="required"
52
+ class="rounded-full bg-sb-primary px-2.5 py-0.5 text-xs font-bold text-sb-on-primary"
53
+ >Pflicht</span
54
+ >
55
+ </span>
56
+ <RadioGroupItem
57
+ v-for="option in options"
58
+ :key="option.value"
59
+ :value="option.value"
60
+ :disabled="option.disabled"
61
+ class="group flex min-h-13 items-center gap-3 rounded-sb-control border-[1.5px] border-sb-control bg-sb-surface px-4 py-3 text-left font-body text-[15px] text-sb-ink transition-colors hover:bg-sb-muted focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-sb-focus disabled:opacity-60 data-[state=checked]:border-2 data-[state=checked]:border-sb-primary data-[state=checked]:bg-sb-primary-tint"
62
+ >
63
+ <span
64
+ class="flex size-5 shrink-0 items-center justify-center rounded-full border-2 border-sb-control bg-sb-surface group-data-[state=checked]:border-sb-primary"
65
+ aria-hidden="true"
66
+ >
67
+ <RadioGroupIndicator class="size-2.5 rounded-full bg-sb-primary" />
68
+ </span>
69
+ <span class="flex min-w-0 flex-1 flex-col">
70
+ <span class="font-semibold">{{ option.label }}</span>
71
+ <span v-if="option.description" class="text-sm text-sb-ink-muted">{{
72
+ option.description
73
+ }}</span>
74
+ </span>
75
+ <span
76
+ v-if="option.trailing"
77
+ class="text-sm text-sb-ink-muted tabular-nums"
78
+ >{{ option.trailing }}</span
79
+ >
80
+ </RadioGroupItem>
81
+ </RadioGroupRoot>
82
+ </template>