@revenexx/cover 0.3.1 → 0.3.2
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { ShopContact } from "../../../config/navigation";
|
|
3
|
+
import { footerLinks as defaultFooterLinks, legalLinks as defaultLegalLinks, shopContact as noContact } from "../../../config/navigation";
|
|
3
4
|
|
|
4
5
|
// Consumers replace the footer columns / legal links, in priority order:
|
|
5
6
|
// per-request live menus (useState, e.g. the Blokkli theme from the pages app)
|
|
@@ -15,6 +16,9 @@ const liveFooterLinks = useState<{ heading: string; links: { label: string; to:
|
|
|
15
16
|
const liveLegalLinks = useState<{ label: string; to: string }[] | null>("cover:nav:legalLinks", () => null);
|
|
16
17
|
const footerLinks = computed(() => liveFooterLinks.value ?? (appConfig.footerLinks as typeof defaultFooterLinks | undefined) ?? defaultFooterLinks);
|
|
17
18
|
const legalLinks = computed(() => liveLegalLinks.value ?? (appConfig.legalLinks as typeof defaultLegalLinks | undefined) ?? defaultLegalLinks);
|
|
19
|
+
// The shop's own contact details. The design system holds none, so a storefront
|
|
20
|
+
// that states nothing prints nothing rather than somebody else's address.
|
|
21
|
+
const shopContact = computed<ShopContact>(() => (appConfig.shopContact as ShopContact | undefined) ?? noContact);
|
|
18
22
|
|
|
19
23
|
const { icon } = useIcons();
|
|
20
24
|
const localePath = useLocalePath();
|
|
@@ -34,8 +38,14 @@ const year = new Date().getFullYear();
|
|
|
34
38
|
<p class="text-sm/6 text-muted dark:text-white/90">
|
|
35
39
|
{{ t('footer.tagline') }}
|
|
36
40
|
</p>
|
|
37
|
-
<address
|
|
38
|
-
|
|
41
|
+
<address
|
|
42
|
+
v-if="shopContact.address || shopContact.phone || shopContact.email"
|
|
43
|
+
class="not-italic flex flex-col gap-2.5 text-sm"
|
|
44
|
+
>
|
|
45
|
+
<span
|
|
46
|
+
v-if="shopContact.address"
|
|
47
|
+
class="flex items-start gap-2"
|
|
48
|
+
>
|
|
39
49
|
<UIcon
|
|
40
50
|
:name="icon('location')"
|
|
41
51
|
class="size-4 mt-0.5 shrink-0 text-(--ui-primary)"
|
|
@@ -43,6 +53,7 @@ const year = new Date().getFullYear();
|
|
|
43
53
|
<span class="text-muted dark:text-white/90">{{ shopContact.address }}</span>
|
|
44
54
|
</span>
|
|
45
55
|
<a
|
|
56
|
+
v-if="shopContact.phone"
|
|
46
57
|
:href="`tel:${shopContact.phone.replace(/\s/g, '')}`"
|
|
47
58
|
class="flex items-center gap-2 text-sm text-muted dark:text-white/90
|
|
48
59
|
hover:text-default dark:hover:text-white transition-colors"
|
|
@@ -54,6 +65,7 @@ const year = new Date().getFullYear();
|
|
|
54
65
|
{{ shopContact.phone }}
|
|
55
66
|
</a>
|
|
56
67
|
<a
|
|
68
|
+
v-if="shopContact.email"
|
|
57
69
|
:href="`mailto:${shopContact.email}`"
|
|
58
70
|
class="flex items-center gap-2 text-sm text-muted dark:text-white/90
|
|
59
71
|
hover:text-default dark:hover:text-white transition-colors"
|
package/app/config/navigation.ts
CHANGED
|
@@ -47,11 +47,27 @@ export const legalLinks = [
|
|
|
47
47
|
{ label: "Cookie Policy", to: "/legal/cookies" },
|
|
48
48
|
];
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
/**
|
|
51
|
+
* A storefront's own contact details, as the footer and the focus layout print
|
|
52
|
+
* them. Every field is optional and the design system supplies NONE of them:
|
|
53
|
+
* this is a fact about the shop, not about the design system, and a default
|
|
54
|
+
* here is printed by every storefront that never overrode it (RX-789 — the
|
|
55
|
+
* default used to be an invented San Francisco address, and it stood under a
|
|
56
|
+
* German shop for months).
|
|
57
|
+
*
|
|
58
|
+
* A storefront states what it has, in `app.config.ts`:
|
|
59
|
+
*
|
|
60
|
+
* shopContact: { address: "…", phone: "…", email: "…" }
|
|
61
|
+
*
|
|
62
|
+
* What it does not state is not printed.
|
|
63
|
+
*/
|
|
64
|
+
export interface ShopContact {
|
|
65
|
+
address?: string;
|
|
66
|
+
phone?: string;
|
|
67
|
+
email?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const shopContact: ShopContact = {};
|
|
55
71
|
|
|
56
72
|
/* ------------------------------------------------------------------ */
|
|
57
73
|
/* Storefront chrome — structure adopted from the relation prototype */
|
package/app/layouts/focus.vue
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { ShopContact } from "../config/navigation";
|
|
3
|
+
import { legalLinks as defaultLegalLinks, shopContact as noContact } from "../config/navigation";
|
|
3
4
|
|
|
4
5
|
// Distraction-free layout for conversion-critical pages — authentication
|
|
5
6
|
// (login, register, recovery) and the checkout funnel. No shop chrome:
|
|
6
7
|
// logo + back link on top, the page content, and a slim footer with the
|
|
7
8
|
// essential links (contact + legal).
|
|
8
9
|
const appConfig = useAppConfig();
|
|
10
|
+
// The shop's own support address, stated by the storefront or not at all.
|
|
11
|
+
const shopContact = computed<ShopContact>(() => (appConfig.shopContact as ShopContact | undefined) ?? noContact);
|
|
9
12
|
const legalLinks = computed(() => (appConfig.legalLinks as typeof defaultLegalLinks | undefined) ?? defaultLegalLinks);
|
|
10
13
|
const { t } = useI18n();
|
|
11
14
|
const localePath = useLocalePath();
|
|
@@ -59,6 +62,7 @@ const tinted = computed(() => /\/checkout(\/|$)/.test(route.path));
|
|
|
59
62
|
aria-label="Legal"
|
|
60
63
|
>
|
|
61
64
|
<a
|
|
65
|
+
v-if="shopContact.email"
|
|
62
66
|
:href="`mailto:${shopContact.email}`"
|
|
63
67
|
class="text-xs text-dimmed hover:text-default transition-colors"
|
|
64
68
|
>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/cover",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
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",
|