@revenexx/cover 0.2.18 → 0.2.19

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.
@@ -5,7 +5,7 @@ const localePath = useLocalePath();
5
5
  </script>
6
6
 
7
7
  <template>
8
- <div class="border border-default py-6 px-8 rounded-lg flex flex-col self-start">
8
+ <div class="border border-default py-6 px-8 rounded-lg flex flex-col self-start lg:sticky lg:top-10">
9
9
  <h2 class="text-xl font-semibold text-highlighted">
10
10
  {{ t('auth.login.existingCustomer') }}
11
11
  </h2>
@@ -105,88 +105,82 @@ async function onSubmit(): Promise<void> {
105
105
 
106
106
  <template>
107
107
  <div class="bg-elevated py-6 px-6 sm:px-8 rounded-lg">
108
- <h2 class="text-xl font-semibold text-highlighted">
109
- {{ registrationEnabled ? t('auth.register.title') : t('auth.register.disabled.title') }}
110
- </h2>
108
+ <div class="rounded-lg bg-default shadow-sm p-6 mb-4">
109
+ <h2 class="text-xl font-semibold text-highlighted">
110
+ {{ registrationEnabled ? t('auth.register.title') : t('auth.register.disabled.title') }}
111
+ </h2>
111
112
 
112
- <!-- Registration closed by the tenant — no form, just a notice. -->
113
- <p
114
- v-if="!registrationEnabled"
115
- class="pt-6 text-sm text-muted"
116
- >
117
- {{ t('auth.register.disabled.description') }}
118
- </p>
113
+ <!-- Registration closed by the tenant — no form, just a notice. -->
114
+ <p
115
+ v-if="!registrationEnabled"
116
+ class="pt-6 text-sm text-muted"
117
+ >
118
+ {{ t('auth.register.disabled.description') }}
119
+ </p>
119
120
 
120
- <!-- Path selection (new vs. existing customer) -->
121
- <fieldset
122
- v-if="registrationEnabled"
123
- class="pt-6"
124
- >
125
- <legend class="text-sm font-medium text-highlighted">
126
- {{ t('auth.register.modes.title') }}
127
- </legend>
128
- <div class="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-3">
129
- <button
130
- v-for="option in modes"
131
- :key="option.value"
132
- type="button"
133
- tabindex="0"
134
- class="text-left rounded-lg border p-4 transition-colors cursor-pointer"
135
- :class="state.mode === option.value
136
- ? 'border-(--ui-primary) bg-primary/5 ring-1 ring-(--ui-primary)'
137
- : 'border-(--ui-border) hover:border-(--ui-border-accented)'"
138
- :aria-pressed="state.mode === option.value"
139
- @click="state.mode = option.value"
140
- >
141
- <span class="flex items-center gap-2">
142
- <UIcon
143
- :name="icon(option.icon)"
144
- class="size-5"
145
- :class="state.mode === option.value ? 'text-primary' : 'text-muted'"
146
- />
147
- <span class="text-sm font-semibold text-highlighted">
148
- {{ t(`auth.register.modes.${option.value}.title`) }}
121
+ <!-- Path selection (new vs. existing customer) -->
122
+ <fieldset
123
+ v-if="registrationEnabled"
124
+ class="pt-6"
125
+ >
126
+ <legend class="text-sm font-medium text-highlighted">
127
+ {{ t('auth.register.modes.title') }}
128
+ </legend>
129
+ <div class="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-3">
130
+ <button
131
+ v-for="option in modes"
132
+ :key="option.value"
133
+ type="button"
134
+ tabindex="0"
135
+ class="text-left rounded-lg border p-4 transition-colors cursor-pointer"
136
+ :class="state.mode === option.value
137
+ ? 'border-(--ui-primary) bg-primary/5 ring-1 ring-(--ui-primary)'
138
+ : 'border-(--ui-border) hover:border-(--ui-border-accented)'"
139
+ :aria-pressed="state.mode === option.value"
140
+ @click="state.mode = option.value"
141
+ >
142
+ <span class="flex items-center gap-2">
143
+ <UIcon
144
+ :name="icon(option.icon)"
145
+ class="size-5"
146
+ :class="state.mode === option.value ? 'text-primary' : 'text-muted'"
147
+ />
148
+ <span class="text-sm font-semibold text-highlighted">
149
+ {{ t(`auth.register.modes.${option.value}.title`) }}
150
+ </span>
151
+ </span>
152
+ <span class="mt-1.5 block text-xs text-muted">
153
+ {{ t(`auth.register.modes.${option.value}.description`) }}
149
154
  </span>
150
- </span>
151
- <span class="mt-1.5 block text-xs text-muted">
152
- {{ t(`auth.register.modes.${option.value}.description`) }}
153
- </span>
154
- </button>
155
- </div>
156
- </fieldset>
155
+ </button>
156
+ </div>
157
+ </fieldset>
158
+ </div>
157
159
 
158
160
  <FormKit
159
161
  v-if="registrationEnabled"
160
162
  type="form"
161
163
  :actions="false"
162
- class="space-y-7 pt-7"
163
164
  @submit="onSubmit"
164
165
  >
165
166
  <!-- Company -->
166
- <section class="space-y-4">
167
- <h3 class="text-xs font-semibold uppercase tracking-wide text-muted">
167
+ <section class="space-y-4 rounded-lg bg-default shadow-sm p-6">
168
+ <h3 class="text-xl font-semibold text-highlighted">
168
169
  {{ t('auth.register.sections.company') }}
169
170
  </h3>
170
- <FormKit
171
- v-model="state.company"
172
- type="text"
173
- :label="t('auth.register.fields.company')"
174
- name="company"
175
- validation="required|companyName"
176
- :validation-messages="{ companyName: t('validation.invalidCompanyName') }"
177
- :help="t('auth.register.companyRequiredHint')"
178
- autocomplete="organization"
179
- />
180
171
  <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
181
172
  <FormKit
182
- v-if="state.mode === 'existing'"
183
- v-model="state.customerNumber"
173
+ v-model="state.company"
184
174
  type="text"
185
- :label="t('auth.register.fields2.customerNumber')"
186
- name="customerNumber"
187
- validation="required"
188
- :help="t('auth.register.fields2.customerNumberHint')"
175
+ :label="t('auth.register.fields.company')"
176
+ name="company"
177
+ validation="required|companyName"
178
+ :validation-messages="{ companyName: t('validation.invalidCompanyName') }"
179
+ :help="t('auth.register.companyRequiredHint')"
180
+ autocomplete="organization"
189
181
  />
182
+ </div>
183
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
190
184
  <FormKit
191
185
  v-model="state.vatId"
192
186
  type="text"
@@ -196,15 +190,74 @@ async function onSubmit(): Promise<void> {
196
190
  :help="t('auth.register.fields2.vatIdHint')"
197
191
  placeholder="DE123456789"
198
192
  />
193
+ <FormKit
194
+ v-if="state.mode === 'existing'"
195
+ v-model="state.customerNumber"
196
+ type="text"
197
+ :label="t('auth.register.fields2.customerNumber')"
198
+ name="customerNumber"
199
+ validation="required"
200
+ :help="t('auth.register.fields2.customerNumberHint')"
201
+ />
202
+ </div>
203
+ </section>
204
+
205
+ <!-- Contact person -->
206
+ <section class="space-y-4 rounded-lg bg-default shadow-sm p-6">
207
+ <h3 class="text-xl font-semibold text-highlighted">
208
+ {{ t('auth.register.sections.contact') }}
209
+ </h3>
210
+ <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
211
+ <FormKit
212
+ v-model="state.salutation"
213
+ type="select"
214
+ :label="t('auth.register.fields2.salutation')"
215
+ name="salutation"
216
+ :options="salutationItems"
217
+ />
218
+ <FormKit
219
+ v-model="state.firstName"
220
+ type="text"
221
+ :label="t('auth.register.fields.firstName')"
222
+ name="firstName"
223
+ validation="required"
224
+ autocomplete="given-name"
225
+ />
226
+ <FormKit
227
+ v-model="state.lastName"
228
+ type="text"
229
+ :label="t('auth.register.fields.lastName')"
230
+ name="lastName"
231
+ validation="required"
232
+ autocomplete="family-name"
233
+ />
234
+ </div>
235
+ <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
236
+ <FormKit
237
+ v-model="state.jobTitle"
238
+ type="text"
239
+ :label="t('auth.register.fields2.jobTitle')"
240
+ name="jobTitle"
241
+ :help="t('auth.register.fields2.jobTitleHint')"
242
+ autocomplete="organization-title"
243
+ />
244
+ <FormKit
245
+ v-model="state.phone"
246
+ type="tel"
247
+ :label="t('auth.register.fields2.phone')"
248
+ name="phone"
249
+ :help="t('auth.register.fields2.phoneHint')"
250
+ autocomplete="tel"
251
+ />
199
252
  </div>
200
253
  </section>
201
254
 
202
255
  <!-- Billing address (new customers only) -->
203
256
  <section
204
257
  v-if="state.mode === 'new'"
205
- class="space-y-4"
258
+ class="space-y-4 rounded-lg bg-default shadow-sm p-6"
206
259
  >
207
- <h3 class="text-xs font-semibold uppercase tracking-wide text-muted">
260
+ <h3 class="text-xl font-semibold text-highlighted">
208
261
  {{ t('auth.register.sections.address') }}
209
262
  </h3>
210
263
  <div class="grid grid-cols-3 gap-4">
@@ -256,59 +309,9 @@ async function onSubmit(): Promise<void> {
256
309
  />
257
310
  </section>
258
311
 
259
- <!-- Contact person -->
260
- <section class="space-y-4">
261
- <h3 class="text-xs font-semibold uppercase tracking-wide text-muted">
262
- {{ t('auth.register.sections.contact') }}
263
- </h3>
264
- <div class="grid grid-cols-1 sm:grid-cols-3 gap-4">
265
- <FormKit
266
- v-model="state.salutation"
267
- type="select"
268
- :label="t('auth.register.fields2.salutation')"
269
- name="salutation"
270
- :options="salutationItems"
271
- />
272
- <FormKit
273
- v-model="state.firstName"
274
- type="text"
275
- :label="t('auth.register.fields.firstName')"
276
- name="firstName"
277
- validation="required"
278
- autocomplete="given-name"
279
- />
280
- <FormKit
281
- v-model="state.lastName"
282
- type="text"
283
- :label="t('auth.register.fields.lastName')"
284
- name="lastName"
285
- validation="required"
286
- autocomplete="family-name"
287
- />
288
- </div>
289
- <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
290
- <FormKit
291
- v-model="state.jobTitle"
292
- type="text"
293
- :label="t('auth.register.fields2.jobTitle')"
294
- name="jobTitle"
295
- :help="t('auth.register.fields2.jobTitleHint')"
296
- autocomplete="organization-title"
297
- />
298
- <FormKit
299
- v-model="state.phone"
300
- type="tel"
301
- :label="t('auth.register.fields2.phone')"
302
- name="phone"
303
- :help="t('auth.register.fields2.phoneHint')"
304
- autocomplete="tel"
305
- />
306
- </div>
307
- </section>
308
-
309
312
  <!-- Account credentials -->
310
- <section class="space-y-4">
311
- <h3 class="text-xs font-semibold uppercase tracking-wide text-muted">
313
+ <section class="space-y-4 rounded-lg bg-default shadow-sm p-6">
314
+ <h3 class="text-xl font-semibold text-highlighted">
312
315
  {{ t('auth.register.sections.account') }}
313
316
  </h3>
314
317
  <FormKit
@@ -350,6 +353,7 @@ async function onSubmit(): Promise<void> {
350
353
  validation="accepted"
351
354
  :validation-messages="{ accepted: t('validation.termsRequired') }"
352
355
  :help="t('auth.register.fields.acceptTermsDescription')"
356
+ outer-class="rounded-lg bg-default shadow-sm p-6"
353
357
  />
354
358
 
355
359
  <UAlert
@@ -60,7 +60,7 @@ const availabilityColor = computed(() => {
60
60
  switch (availability.value?.state) {
61
61
  case "in-stock": return "bg-success";
62
62
  case "partial": return "bg-warning";
63
- default: return "bg-error";
63
+ default: return "bg-[oklch(0.88_0.2_98.38)]";
64
64
  }
65
65
  });
66
66
 
@@ -115,7 +115,7 @@ const hintColor = (type: string) =>
115
115
  />
116
116
  </div>
117
117
 
118
- <div class="flex items-start gap-3">
118
+ <div class="flex flex-wrap md:flex-nowrap items-start gap-3">
119
119
  <!-- Selector + drag handle -->
120
120
  <div
121
121
  v-if="!readonly"
@@ -178,6 +178,18 @@ const hintColor = (type: string) =>
178
178
  class="text-xs text-muted"
179
179
  >{{ item.name2 }}</span>
180
180
 
181
+ <!-- Delivery / availability -->
182
+ <span
183
+ v-if="availability"
184
+ class="inline-flex items-center gap-1.5 text-xs text-muted"
185
+ >
186
+ <span
187
+ class="size-2 rounded-full"
188
+ :class="availabilityColor"
189
+ />
190
+ {{ t(`cart.availability.${availability.state}`, { count: availability.availableQuantity, days: availability.deliveryDays ?? 0 }) }}
191
+ </span>
192
+
181
193
  <!-- Cost center: shown and edited right at the position -->
182
194
  <button
183
195
  v-if="showCostCenter && !readonly"
@@ -260,8 +272,14 @@ const hintColor = (type: string) =>
260
272
  </button>
261
273
  </div>
262
274
 
263
- <!-- Quantity + availability -->
264
- <div class="flex flex-col items-end gap-1.5 shrink-0">
275
+ <!-- Forces quantity/price/functions onto their own row below 768px -->
276
+ <div
277
+ class="basis-full md:hidden"
278
+ aria-hidden="true"
279
+ />
280
+
281
+ <!-- Quantity -->
282
+ <div class="flex items-center shrink-0">
265
283
  <div
266
284
  v-if="!readonly"
267
285
  class="flex items-center gap-1"
@@ -300,22 +318,13 @@ const hintColor = (type: string) =>
300
318
  <span
301
319
  v-else
302
320
  class="text-sm text-highlighted"
303
- >{{ line?.adjustedQuantity ?? item.quantity }}</span>
304
- <span class="text-xs text-muted">{{ item.unit ?? t('cart.position.defaultUnit') }}</span>
305
- <span
306
- v-if="availability"
307
- class="inline-flex items-center gap-1.5 text-xs text-muted"
308
321
  >
309
- <span
310
- class="size-2 rounded-full"
311
- :class="availabilityColor"
312
- />
313
- {{ t(`cart.availability.${availability.state}`, { count: availability.availableQuantity, days: availability.deliveryDays ?? 0 }) }}
322
+ {{ line?.adjustedQuantity ?? item.quantity }}
314
323
  </span>
315
324
  </div>
316
325
 
317
326
  <!-- Price block -->
318
- <div class="flex flex-col items-end gap-0.5 w-32 shrink-0">
327
+ <div class="flex flex-col items-end gap-0.5 w-44 shrink-0 ms-auto md:ms-0">
319
328
  <template v-if="line?.priceLabel">
320
329
  <UBadge
321
330
  color="neutral"
@@ -328,12 +337,12 @@ const hintColor = (type: string) =>
328
337
  {{ formatCurrency(line?.lineTotal ?? item.price * item.quantity) }}
329
338
  </span>
330
339
  <span class="text-xs text-muted">
331
- {{ t('cart.position.perUnit', { price: formatCurrency(line?.unitPrice ?? item.price) }) }}
340
+ {{ formatCurrency(line?.unitPrice ?? item.price) }} / {{ item.unit ?? t('cart.position.defaultUnit') }}
332
341
  </span>
333
342
  <span
334
343
  v-for="surcharge in line?.surcharges ?? []"
335
344
  :key="surcharge.name"
336
- class="text-xs text-dimmed"
345
+ class="text-xs text-muted text-right whitespace-nowrap"
337
346
  >
338
347
  + {{ surcharge.name }} {{ formatCurrency(surcharge.amountPerUnit) }}
339
348
  </span>
@@ -84,7 +84,7 @@ function add(suggestion: (typeof suggestions.value)[number]): void {
84
84
  <template>
85
85
  <section
86
86
  v-if="suggestions.length"
87
- class="print:hidden"
87
+ class="print:hidden mb-11"
88
88
  >
89
89
  <h2 class="flex items-center gap-2 text-sm font-semibold text-highlighted mb-3">
90
90
  <UIcon
@@ -93,16 +93,31 @@ function add(suggestion: (typeof suggestions.value)[number]): void {
93
93
  />
94
94
  {{ t('cart.boost.reorderTitle') }}
95
95
  </h2>
96
- <div class="flex gap-3 overflow-x-auto pb-2 -mx-1 px-1">
97
- <CartRecommendCard
98
- v-for="suggestion in suggestions"
99
- :key="suggestion.id"
100
- :name="suggestion.name"
101
- :image="suggestion.image"
102
- :sku="suggestion.sku"
103
- :price="suggestion.price"
104
- @add="add(suggestion)"
105
- />
106
- </div>
96
+ <UCarousel
97
+ :items="suggestions"
98
+ arrows
99
+ dots
100
+ align="start"
101
+ :ui="{
102
+ item: 'basis-auto',
103
+ dot: 'rounded-none bg-primary/30 data-[state=active]:bg-primary',
104
+ arrows: 'hidden md:block',
105
+ prev: 'size-11 justify-center start-2 sm:start-2 disabled:text-dimmed disabled:ring-default',
106
+ next: 'size-11 justify-center end-2 sm:end-2 disabled:text-dimmed disabled:ring-default',
107
+ }"
108
+ :prev="{ color: 'primary' }"
109
+ :next="{ color: 'primary' }"
110
+ class="px-0 md:px-16 pb-8"
111
+ >
112
+ <template #default="{ item }">
113
+ <CartRecommendCard
114
+ :name="item.name"
115
+ :image="item.image"
116
+ :sku="item.sku"
117
+ :price="item.price"
118
+ @add="add(item)"
119
+ />
120
+ </template>
121
+ </UCarousel>
107
122
  </section>
108
123
  </template>
@@ -36,7 +36,7 @@ onMounted(() => {
36
36
  hydrated.value = true;
37
37
  });
38
38
 
39
- const { items, requisitions, isEmpty, itemCount } = storeToRefs(cart);
39
+ const { items, requisitions, isEmpty } = storeToRefs(cart);
40
40
 
41
41
  const freeItems = computed(() => items.value.filter(i => !i.requisitionId));
42
42
  const itemsByRequisition = computed(() => {
@@ -54,10 +54,6 @@ const itemsByRequisition = computed(() => {
54
54
  // Keep the selection in sync when positions leave the cart.
55
55
  watch(items, () => selection.prune(), { deep: true });
56
56
 
57
- const cartItemCount = computed(() =>
58
- t("cart.page.itemCount", itemCount.value, { count: itemCount.value }),
59
- );
60
-
61
57
  const quickAddOpen = ref(false);
62
58
 
63
59
  /* ---- loadable requisitions (orderer side, spec: hinzufügen) -------- */
@@ -262,9 +258,6 @@ const messageColor = (severity: string) =>
262
258
  </section>
263
259
 
264
260
  <aside class="lg:col-span-4 lg:sticky lg:top-24">
265
- <p class="text-xs text-muted mb-2">
266
- {{ cartItemCount }}
267
- </p>
268
261
  <CartSummaryPanel />
269
262
  </aside>
270
263
  </div>
@@ -13,10 +13,21 @@ import type {
13
13
  export const useProductDetail = (id: MaybeRefOrGetter<string>) => {
14
14
  const { public: { locale, taxIncludedPrices } } = useRuntimeConfig();
15
15
  const currency = useDisplayCurrency();
16
+ const { locale: activeLocale } = useI18n();
16
17
 
17
18
  const { data: detail, status, error, refresh } = useFetch<ProductDetail | null>(
18
19
  () => productApi.detail(toValue(id)),
19
20
  {
21
+ // The BFF resolves the locale from `x-locale` first. Without this
22
+ // header it falls through to the browser's Accept-Language, so a
23
+ // German browser saw German product text on the /en pages while the
24
+ // UI and <html lang> had already switched.
25
+ headers: computed(() => ({ "x-locale": activeLocale.value })),
26
+ // An explicit key: without one this fetch's result is not carried
27
+ // in the SSR payload, so the client refetches on hydration and
28
+ // renders "product not found" over a correctly server-rendered page
29
+ // until it resolves.
30
+ key: () => `product-detail:${toValue(id)}`,
20
31
  default: () => null,
21
32
  },
22
33
  );
@@ -36,7 +36,7 @@ export interface ListingResponse {
36
36
  export function useProductListing(options: ProductListingOptions) {
37
37
  const route = useRoute();
38
38
  const router = useRouter();
39
- const { t } = useI18n();
39
+ const { t, locale } = useI18n();
40
40
  const { productsPerPage } = useRuntimeConfig().public;
41
41
 
42
42
  // Static facets (configured by the calling page) plus dynamic
@@ -135,6 +135,10 @@ export function useProductListing(options: ProductListingOptions) {
135
135
  key: `listing:${options.key}`,
136
136
  method: "POST",
137
137
  body: requestBody,
138
+ // Same reason as useProductDetail: the search route filters the
139
+ // index by locale, and without this header it uses the browser's
140
+ // Accept-Language instead of the locale the visitor selected.
141
+ headers: computed(() => ({ "x-locale": locale.value })),
138
142
  immediate: false,
139
143
  watch: false,
140
144
  },
@@ -15,7 +15,7 @@
15
15
  "passwordConfirmPlaceholder": "Passwort wiederholen",
16
16
  "firstName": "Vorname",
17
17
  "lastName": "Nachname",
18
- "company": "Unternehmen",
18
+ "company": "Firma",
19
19
  "companyHint": "Optional – Ihr Unternehmen oder Ihre Organisation",
20
20
  "acceptTerms": "Ich akzeptiere die AGB",
21
21
  "acceptTermsDescription": "Mit der Erstellung eines Kontos stimmen Sie unseren AGB und der Datenschutzerklärung zu. (Demo-Hinweis – es wird kein tatsächlicher Vertrag geschlossen.)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revenexx/cover",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
4
4
  "description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
Binary file
Binary file