@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
@@ -44,6 +44,17 @@ const formattedPrice = computed(() => {
44
44
  : "";
45
45
  });
46
46
 
47
+ // Presets: stepper that turns into a remove button at 1 (#443).
48
+ const options = computed(
49
+ () =>
50
+ ((props.cartItem?.type === "container"
51
+ ? props.cartItem?.children?.[0]?.payload?.options
52
+ : props.cartItem?.payload?.options) ?? []) as {
53
+ group: string;
54
+ option: string;
55
+ }[],
56
+ );
57
+
47
58
  const handleRemoveItem = () => {
48
59
  if (!props.cartItem) return;
49
60
  removeLineItem(props.cartItem);
@@ -51,72 +62,46 @@ const handleRemoveItem = () => {
51
62
  </script>
52
63
 
53
64
  <template>
54
- <div class="cart-item">
55
- <div v-if="cartItem" class="flex flex-col gap-4">
56
- <!-- Main content row -->
57
- <div class="flex flex-row justify-between items-center gap-4">
58
- <!-- Left section: Title and variations -->
59
- <div class="flex flex-row items-center gap-4 flex-1 min-w-0">
60
- <div class="flex-1 min-w-0">
61
- <h3 class="text-md">
62
- <span v-if="!withQuantityInput" class="mr-2">
63
- {{ quantity }}x
64
- </span>
65
- <span class="font-semibold">{{ cartItem.label }}</span>
66
- </h3>
67
-
68
- <p
69
- v-for="option in cartItem?.type === 'container'
70
- ? cartItem?.children?.[0]?.payload?.options
71
- : cartItem?.payload?.options"
72
- :key="option.group + option.option"
73
- class="text-sm text-pretty text-muted mt-1"
74
- >
75
- {{ option.group }}: {{ option.option }}
76
- </p>
77
- </div>
78
- </div>
79
-
80
- <!-- Right section: Price -->
81
- <div class="font-medium whitespace-nowrap">
82
- {{ formattedPrice }}
83
- </div>
84
- </div>
85
-
86
- <!-- Quantity input and delete button row -->
87
- <div v-if="withQuantityInput" class="flex flex-row items-center gap-2">
88
- <UInputNumber
89
- v-model="quantity"
90
- :min="1"
91
- :max="100"
92
- class="max-w-46"
93
- aria-label="Menge"
94
- />
95
- <UButton
96
- v-if="withDeleteButton"
97
- icon="i-lucide-trash"
98
- variant="soft"
99
- color="neutral"
100
- aria-label="Artikel entfernen"
101
- :disabled="isMutating"
102
- @click="handleRemoveItem"
103
- />
104
- </div>
105
- <!-- Delete button alone if no quantity input -->
106
- <UButton
65
+ <div class="cart-item font-body text-sb-ink">
66
+ <div
67
+ v-if="cartItem"
68
+ class="grid grid-cols-[minmax(0,1fr)_auto] items-start gap-x-3 gap-y-2 border-b border-sb-line py-4"
69
+ >
70
+ <h3 class="text-base font-bold">
71
+ <span v-if="!withQuantityInput" class="tabular-nums"
72
+ >{{ quantity }}×
73
+ </span>
74
+ {{ cartItem.label }}
75
+ </h3>
76
+ <span class="font-semibold tabular-nums">{{ formattedPrice }}</span>
77
+ <p
78
+ v-for="option in options"
79
+ :key="option.group + option.option"
80
+ class="col-span-full text-sm text-sb-ink-muted"
81
+ >
82
+ {{ option.group }}: {{ option.option }}
83
+ </p>
84
+ <SbStepper
85
+ v-if="withQuantityInput"
86
+ v-model="quantity"
87
+ class="col-span-full justify-self-start"
88
+ :item-name="cartItem.label ?? 'Artikel'"
89
+ :max="100"
90
+ :removable="withDeleteButton"
91
+ @remove="handleRemoveItem"
92
+ />
93
+ <SbIconButton
107
94
  v-else-if="withDeleteButton"
108
- icon="i-lucide-trash"
109
- variant="outline"
110
- color="error"
111
- aria-label="Artikel entfernen"
95
+ class="col-span-full justify-self-start"
96
+ :label="`${cartItem.label} entfernen`"
112
97
  :disabled="isMutating"
113
98
  @click="handleRemoveItem"
114
- />
115
- </div>
116
-
117
- <!-- Empty state -->
118
- <div v-else class="text-center py-4">
119
- <p class="text-muted">Warenkorb ist leer...</p>
99
+ >
100
+ <SbIcon name="trash" />
101
+ </SbIconButton>
120
102
  </div>
103
+ <p v-else class="py-4 text-center text-sb-ink-muted">
104
+ Der Warenkorb ist leer.
105
+ </p>
121
106
  </div>
122
107
  </template>
@@ -21,8 +21,14 @@ const emit = defineEmits(["go-to-cart"]);
21
21
  </script>
22
22
 
23
23
  <template>
24
- <div class="flex flex-col gap-4 h-full justify-between">
25
- <div class="flex flex-col gap-4">
24
+ <div class="flex h-full flex-col justify-between gap-5 font-body text-sb-ink">
25
+ <div v-if="isEmpty" class="flex flex-col items-start gap-3 py-2">
26
+ <p class="text-sb-ink-muted">Der Warenkorb ist noch leer.</p>
27
+ <SbButton variant="secondary" to="/" @click="emit('go-to-cart')"
28
+ >Zur Speisekarte</SbButton
29
+ >
30
+ </div>
31
+ <div v-else class="flex flex-col">
26
32
  <CartItem
27
33
  v-for="lineItem in cart?.lineItems ?? []"
28
34
  :key="lineItem.id"
@@ -31,33 +37,40 @@ const emit = defineEmits(["go-to-cart"]);
31
37
  :with-delete-button="withDeleteButton"
32
38
  />
33
39
  </div>
34
- <div class="flex flex-col gap-4">
35
- <!-- Suggestions right above the total, on the confirmation step only (#338). -->
36
- <LazyCartUpsell v-if="withUpsell && !isEmpty" />
37
- <div class="flex flex-row justify-between">
38
- <template v-if="shippingTotal === 0">
39
- <div class="text-success font-medium">
40
- Versandkostenfreie Lieferung
41
- </div>
42
- </template>
43
- <template v-else>
44
- <div>Versandkosten:</div>
45
- <div>{{ getFormattedPrice(shippingTotal) }}</div>
46
- </template>
47
- </div>
48
- <div class="flex flex-row justify-between font-bold">
49
- <div>Summe:</div>
50
- <div>{{ getFormattedPrice(cart?.price.totalPrice) }}</div>
51
- </div>
52
- <UButton
40
+ <div v-if="!isEmpty" class="flex flex-col gap-3">
41
+ <LazyCartUpsell v-if="withUpsell" />
42
+ <dl class="flex flex-col gap-2 text-[15px] tabular-nums">
43
+ <div class="flex justify-between text-sb-ink-muted">
44
+ <dt>Lieferung</dt>
45
+ <dd
46
+ :class="
47
+ shippingTotal === 0 ? 'font-semibold text-sb-primary-ink' : ''
48
+ "
49
+ >
50
+ {{
51
+ shippingTotal === 0
52
+ ? "kostenlos"
53
+ : getFormattedPrice(shippingTotal)
54
+ }}
55
+ </dd>
56
+ </div>
57
+ <div
58
+ class="flex justify-between border-t border-sb-line pt-2.5 text-lg font-bold"
59
+ >
60
+ <dt>Gesamt</dt>
61
+ <dd>{{ getFormattedPrice(cart?.price.totalPrice) }}</dd>
62
+ </div>
63
+ </dl>
64
+ <SbButton
53
65
  v-if="withToCartButton"
54
- :disabled="isEmpty"
55
66
  block
56
67
  size="lg"
57
- label="Bestellung aufgeben"
58
- to="/bestellung"
68
+ to="/bestellung/kasse"
59
69
  @click="emit('go-to-cart')"
60
- />
70
+ >
71
+ Zur Kasse
72
+ <template #trailing><SbIcon name="chevron-right" /></template>
73
+ </SbButton>
61
74
  </div>
62
75
  </div>
63
76
  </template>
@@ -25,82 +25,44 @@ const products = computed(() =>
25
25
 
26
26
  const productName = (product: Schemas["Product"]) =>
27
27
  product.translated?.name ?? product.name;
28
+
29
+ // Presets: compact rows that fit the narrow order card (#443).
28
30
  </script>
29
31
 
30
32
  <template>
31
- <!-- Tinted box with offer cards, so the suggestions do not read as line items. -->
32
33
  <section
33
34
  v-if="products.length > 0"
34
35
  aria-labelledby="cart-upsell-title"
35
- class="flex flex-col gap-3 rounded-lg bg-primary/5 p-3 ring ring-primary/20"
36
+ class="flex flex-col gap-1 rounded-sb-card bg-sb-muted p-4 font-body text-sb-ink"
36
37
  >
37
- <div>
38
- <h3
39
- id="cart-upsell-title"
40
- class="flex items-center gap-1.5 font-bold text-highlighted"
41
- >
42
- <UIcon name="i-lucide-sparkles" class="size-4 text-primary" />
43
- Dazu passt
44
- </h3>
45
- <p class="text-sm text-muted">
46
- Mit einem Klick zur Bestellung hinzufügen.
47
- </p>
48
- </div>
49
- <!-- One suggestion spans the full width; with more the next one peeks in. -->
50
- <ul
51
- class="flex snap-x snap-mandatory gap-3 overflow-x-auto [scrollbar-width:thin]"
38
+ <h3
39
+ id="cart-upsell-title"
40
+ class="text-xs font-bold tracking-[0.14em] text-sb-accent uppercase"
52
41
  >
42
+ Dazu passt
43
+ </h3>
44
+ <ul class="flex flex-col">
53
45
  <li
54
46
  v-for="product in products"
55
47
  :key="product.id"
56
- class="flex shrink-0 snap-start overflow-hidden rounded-lg bg-default shadow-sm ring ring-default"
57
- :class="products.length > 1 ? 'w-[85%]' : 'w-full'"
48
+ class="flex items-center gap-3 border-b border-sb-line py-2.5 last:border-0"
58
49
  >
59
- <!-- Decorative: the name is right next to it. -->
60
- <img
61
- v-if="product.cover?.media?.url"
62
- :src="product.cover.media.url"
63
- :srcset="mediaSrcSet(product.cover.media)"
64
- sizes="(min-width: 40rem) 144px, 112px"
65
- alt=""
66
- loading="lazy"
67
- decoding="async"
68
- class="size-28 shrink-0 object-cover sm:size-36"
69
- />
70
- <div
71
- v-else
72
- class="flex size-28 shrink-0 items-center justify-center bg-gradient-to-b from-brand-100 to-brand-200 text-brand-600 sm:size-36"
73
- aria-hidden="true"
50
+ <span class="flex min-w-0 flex-1 flex-col">
51
+ <span class="font-semibold">{{ productName(product) }}</span>
52
+ <span class="text-sm text-sb-ink-muted tabular-nums">{{
53
+ getFormattedPrice(product.calculatedPrice.totalPrice)
54
+ }}</span>
55
+ </span>
56
+ <SbIconButton
57
+ variant="tint"
58
+ :label="`${productName(product)} in den Warenkorb`"
59
+ :disabled="!productIsAvailable(product) || isAdding(product.id)"
60
+ @click="addUpsellProduct(product)"
74
61
  >
75
- <UIcon name="i-lucide-utensils-crossed" class="size-8" />
76
- </div>
77
- <div class="flex min-w-0 flex-1 flex-col gap-0.5 p-3">
78
- <span class="text-xs font-semibold text-primary">
79
- #{{ product.productNumber }}
80
- </span>
81
- <span
82
- class="line-clamp-2 text-sm font-semibold text-highlighted sm:text-base"
83
- >
84
- {{ productName(product) }}
85
- </span>
86
- <div class="mt-auto flex items-center justify-between gap-2 pt-1">
87
- <span class="font-bold text-highlighted">
88
- {{ getFormattedPrice(product.calculatedPrice.totalPrice) }}
89
- </span>
90
- <UButton
91
- icon="i-lucide-plus"
92
- variant="subtle"
93
- class="shrink-0"
94
- :aria-label="`${productName(product)} in den Warenkorb`"
95
- :loading="isAdding(product.id)"
96
- :disabled="!productIsAvailable(product) || isAdding(product.id)"
97
- @click="addUpsellProduct(product)"
98
- >
99
- <span class="hidden sm:inline">Hinzufügen</span>
100
- </UButton>
101
- </div>
102
- </div>
62
+ <SbIcon name="plus" />
63
+ </SbIconButton>
103
64
  </li>
104
65
  </ul>
105
66
  </section>
67
+ <!-- Tinted box with offer cards, so the suggestions do not read as line items. -->
106
68
  </template>
@@ -1,6 +1,5 @@
1
1
  <script setup lang="ts">
2
2
  import type { Schemas } from "#shopware";
3
- import type { BreadcrumbItem } from "#ui/components/Breadcrumb.vue";
4
3
 
5
4
  const props = defineProps<{
6
5
  categoryId: string | undefined;
@@ -38,7 +37,7 @@ const { data } = await useAsyncData(cacheKey, async () => {
38
37
  return response.data;
39
38
  });
40
39
 
41
- const items = computed<BreadcrumbItem[]>(() => {
40
+ const items = computed<{ label?: string; to: string }[]>(() => {
42
41
  if (!data.value) return [{ label: "Kategorie", to: "#" }];
43
42
  return data.value?.map((item: Schemas["Breadcrumb"]) => {
44
43
  return {
@@ -69,5 +68,32 @@ watchEffect(() => {
69
68
  </script>
70
69
 
71
70
  <template>
72
- <UBreadcrumb :items="items" />
71
+ <nav aria-label="Brotkrumen" class="mb-2 font-body text-sm">
72
+ <ol class="flex flex-wrap items-center gap-1 text-sb-ink-muted">
73
+ <li
74
+ v-for="(item, index) in items"
75
+ :key="item.to"
76
+ class="flex items-center gap-1"
77
+ >
78
+ <SbIcon
79
+ v-if="index > 0"
80
+ name="chevron-right"
81
+ :size="14"
82
+ class="text-sb-ink-muted"
83
+ />
84
+ <NuxtLink
85
+ v-if="index < items.length - 1"
86
+ :to="item.to"
87
+ class="inline-flex min-h-11 items-center font-semibold text-sb-primary-ink underline-offset-4 hover:underline focus-visible:outline-3 focus-visible:outline-sb-focus"
88
+ >{{ item.label }}</NuxtLink
89
+ >
90
+ <span
91
+ v-else
92
+ aria-current="page"
93
+ class="inline-flex min-h-11 items-center font-semibold text-sb-ink"
94
+ >{{ item.label }}</span
95
+ >
96
+ </li>
97
+ </ol>
98
+ </nav>
73
99
  </template>
@@ -1,55 +1,34 @@
1
1
  <script setup lang="ts">
2
2
  import type { Schemas } from "#shopware";
3
3
 
4
- defineProps<{
4
+ /** One property group of the menu filter (#445), as a checkbox list. */
5
+ const props = defineProps<{
5
6
  filter: Schemas["PropertyGroup"];
6
7
  modelValue: string[];
7
8
  }>();
8
9
 
9
- defineEmits<{
10
+ const emit = defineEmits<{
10
11
  "update:modelValue": [value: string[]];
11
12
  }>();
13
+
14
+ function toggle(id: string, checked: boolean) {
15
+ const next = props.modelValue.filter((value) => value !== id);
16
+ if (checked) next.push(id);
17
+ emit("update:modelValue", next);
18
+ }
12
19
  </script>
13
20
 
14
21
  <template>
15
- <UCollapsible class="flex flex-col gap-2 w-48" :default-open="true">
16
- <UButton
17
- :label="filter.translated.name"
18
- color="neutral"
19
- variant="subtle"
20
- trailing-icon="i-lucide-chevron-down"
21
- block
22
- :ui="{
23
- trailingIcon:
24
- 'group-data-[state=open]:rotate-180 transition-transform duration-200',
25
- }"
22
+ <fieldset class="flex flex-col font-body text-sb-ink">
23
+ <legend class="mb-1 font-bold">
24
+ {{ filter.translated?.name ?? filter.name }}
25
+ </legend>
26
+ <SbCheckbox
27
+ v-for="option in filter.options ?? []"
28
+ :key="option.id"
29
+ :model-value="modelValue.includes(option.id)"
30
+ :label="option.translated?.name ?? option.name ?? ''"
31
+ @update:model-value="(checked: boolean) => toggle(option.id, checked)"
26
32
  />
27
-
28
- <template #content>
29
- <UCheckboxGroup
30
- :model-value="modelValue"
31
- :items="filter.options"
32
- value-key="id"
33
- label-key="translated.name"
34
- @update:model-value="$emit('update:modelValue', $event)"
35
- >
36
- <template
37
- v-if="
38
- (filter.displayType ?? filter.translated.displayType) === 'media'
39
- "
40
- #label="{ item }"
41
- >
42
- <div class="flex items-center gap-1.5">
43
- <NuxtImg
44
- v-if="item.media?.url"
45
- :src="item.media.url"
46
- :alt="item.translated.name"
47
- class="h-4 w-4 object-contain"
48
- />
49
- <span>{{ item.translated.name }}</span>
50
- </div>
51
- </template>
52
- </UCheckboxGroup>
53
- </template>
54
- </UCollapsible>
33
+ </fieldset>
55
34
  </template>