@kurbo/dkit 0.4.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.
- package/README.md +24 -0
- package/dist/bin.js +8066 -0
- package/dist/bin.js.map +1 -0
- package/package.json +58 -0
- package/vendor/registry/blocks/blog-detail/module.json +27 -0
- package/vendor/registry/blocks/blog-detail/ui/minimal/next/blog-detail.tsx +26 -0
- package/vendor/registry/blocks/blog-detail/ui/minimal/nuxt/BlogDetail.vue +27 -0
- package/vendor/registry/blocks/blog-detail/ui/shadcn/next/blog-detail.tsx +106 -0
- package/vendor/registry/blocks/blog-detail/ui/shadcn/nuxt/BlogDetail.vue +116 -0
- package/vendor/registry/blocks/blog-list/module.json +26 -0
- package/vendor/registry/blocks/blog-list/ui/minimal/next/blog-list.tsx +130 -0
- package/vendor/registry/blocks/blog-list/ui/minimal/nuxt/BlogList.vue +62 -0
- package/vendor/registry/blocks/blog-list/ui/shadcn/next/blog-list.tsx +109 -0
- package/vendor/registry/blocks/blog-list/ui/shadcn/nuxt/BlogList.vue +100 -0
- package/vendor/registry/blocks/blog-list-cards/module.json +27 -0
- package/vendor/registry/blocks/blog-list-cards/ui/minimal/next/blog-list-cards.tsx +130 -0
- package/vendor/registry/blocks/blog-list-cards/ui/minimal/nuxt/BlogListCards.vue +114 -0
- package/vendor/registry/blocks/blog-list-cards/ui/shadcn/next/blog-list-cards.tsx +119 -0
- package/vendor/registry/blocks/blog-list-cards/ui/shadcn/nuxt/BlogListCards.vue +113 -0
- package/vendor/registry/blocks/booking-form-ui/module.json +15 -0
- package/vendor/registry/blocks/booking-form-ui/ui/minimal/next/booking-form.tsx +89 -0
- package/vendor/registry/blocks/booking-form-ui/ui/shadcn/next/booking-form.tsx +92 -0
- package/vendor/registry/blocks/contact-form-ui/module.json +27 -0
- package/vendor/registry/blocks/contact-form-ui/ui/minimal/next/contact-form.tsx +45 -0
- package/vendor/registry/blocks/contact-form-ui/ui/minimal/nuxt/ContactForm.vue +79 -0
- package/vendor/registry/blocks/contact-form-ui/ui/shadcn/next/contact-form.tsx +55 -0
- package/vendor/registry/blocks/contact-form-ui/ui/shadcn/nuxt/ContactForm.vue +92 -0
- package/vendor/registry/blocks/faq-list/module.json +15 -0
- package/vendor/registry/blocks/faq-list/ui/minimal/next/faq-list.tsx +78 -0
- package/vendor/registry/blocks/faq-list/ui/shadcn/next/faq-list.tsx +77 -0
- package/vendor/registry/blocks/maintenance-gate/module.json +13 -0
- package/vendor/registry/blocks/maintenance-gate/ui/minimal/next/maintenance-gate.tsx +135 -0
- package/vendor/registry/blocks/maintenance-gate/ui/shadcn/next/maintenance-gate.tsx +87 -0
- package/vendor/registry/blocks/nav-footer/module.json +13 -0
- package/vendor/registry/blocks/nav-footer/ui/minimal/next/nav-footer.tsx +55 -0
- package/vendor/registry/blocks/nav-footer/ui/shadcn/next/nav-footer.tsx +41 -0
- package/vendor/registry/blocks/nav-header/module.json +14 -0
- package/vendor/registry/blocks/nav-header/ui/minimal/next/nav-header.tsx +244 -0
- package/vendor/registry/blocks/nav-header/ui/shadcn/next/nav-header-client.tsx +185 -0
- package/vendor/registry/blocks/nav-header/ui/shadcn/next/nav-header.tsx +12 -0
- package/vendor/registry/blocks/page-detail/module.json +26 -0
- package/vendor/registry/blocks/page-detail/ui/minimal/next/page-detail.tsx +26 -0
- package/vendor/registry/blocks/page-detail/ui/minimal/nuxt/PageDetail.vue +26 -0
- package/vendor/registry/blocks/page-detail/ui/shadcn/next/page-detail.tsx +61 -0
- package/vendor/registry/blocks/page-detail/ui/shadcn/nuxt/PageDetail.vue +62 -0
- package/vendor/registry/blocks/project-detail/module.json +15 -0
- package/vendor/registry/blocks/project-detail/ui/minimal/next/project-detail.tsx +58 -0
- package/vendor/registry/blocks/project-detail/ui/shadcn/next/project-detail.tsx +91 -0
- package/vendor/registry/blocks/project-list/module.json +14 -0
- package/vendor/registry/blocks/project-list/ui/minimal/next/project-list.tsx +104 -0
- package/vendor/registry/blocks/project-list/ui/shadcn/next/project-list.tsx +81 -0
- package/vendor/registry/blocks/project-list-cards/module.json +15 -0
- package/vendor/registry/blocks/project-list-cards/ui/minimal/next/project-list-cards.tsx +125 -0
- package/vendor/registry/blocks/project-list-cards/ui/shadcn/next/project-list-cards.tsx +94 -0
- package/vendor/registry/blocks/projects-carousel/module.json +15 -0
- package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel-client.tsx +239 -0
- package/vendor/registry/blocks/projects-carousel/ui/minimal/next/projects-carousel.tsx +24 -0
- package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel-client.tsx +102 -0
- package/vendor/registry/blocks/projects-carousel/ui/shadcn/next/projects-carousel.tsx +24 -0
- package/vendor/registry/blocks/service-detail/module.json +15 -0
- package/vendor/registry/blocks/service-detail/ui/minimal/next/service-detail.tsx +49 -0
- package/vendor/registry/blocks/service-detail/ui/shadcn/next/service-detail.tsx +75 -0
- package/vendor/registry/blocks/service-list/module.json +14 -0
- package/vendor/registry/blocks/service-list/ui/minimal/next/service-list.tsx +103 -0
- package/vendor/registry/blocks/service-list/ui/shadcn/next/service-list.tsx +80 -0
- package/vendor/registry/blocks/service-list-cards/module.json +15 -0
- package/vendor/registry/blocks/service-list-cards/ui/minimal/next/service-list-cards.tsx +124 -0
- package/vendor/registry/blocks/service-list-cards/ui/shadcn/next/service-list-cards.tsx +92 -0
- package/vendor/registry/blocks/site-brand/module.json +13 -0
- package/vendor/registry/blocks/site-brand/ui/minimal/next/site-brand.tsx +61 -0
- package/vendor/registry/blocks/site-brand/ui/shadcn/next/site-brand.tsx +48 -0
- package/vendor/registry/blocks/site-logo/module.json +13 -0
- package/vendor/registry/blocks/site-logo/ui/minimal/next/site-logo.tsx +37 -0
- package/vendor/registry/blocks/site-logo/ui/shadcn/next/site-logo.tsx +34 -0
- package/vendor/registry/blocks/social-links/module.json +13 -0
- package/vendor/registry/blocks/social-links/ui/minimal/next/social-links.tsx +55 -0
- package/vendor/registry/blocks/social-links/ui/shadcn/next/social-links.tsx +46 -0
- package/vendor/registry/blocks/team-detail/module.json +15 -0
- package/vendor/registry/blocks/team-detail/ui/minimal/next/team-detail.tsx +113 -0
- package/vendor/registry/blocks/team-detail/ui/shadcn/next/team-detail.tsx +77 -0
- package/vendor/registry/blocks/team-list/module.json +14 -0
- package/vendor/registry/blocks/team-list/ui/minimal/next/team-list.tsx +113 -0
- package/vendor/registry/blocks/team-list/ui/shadcn/next/team-list.tsx +77 -0
- package/vendor/registry/blocks/team-list-cards/module.json +15 -0
- package/vendor/registry/blocks/team-list-cards/ui/minimal/next/team-list-cards.tsx +111 -0
- package/vendor/registry/blocks/team-list-cards/ui/shadcn/next/team-list-cards.tsx +83 -0
- package/vendor/registry/blocks/testimonials-carousel/module.json +15 -0
- package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel-client.tsx +230 -0
- package/vendor/registry/blocks/testimonials-carousel/ui/minimal/next/testimonials-carousel.tsx +23 -0
- package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel-client.tsx +91 -0
- package/vendor/registry/blocks/testimonials-carousel/ui/shadcn/next/testimonials-carousel.tsx +23 -0
- package/vendor/registry/blocks/testimonials-list/module.json +14 -0
- package/vendor/registry/blocks/testimonials-list/ui/minimal/next/testimonials-list.tsx +109 -0
- package/vendor/registry/blocks/testimonials-list/ui/shadcn/next/testimonials-list.tsx +72 -0
- package/vendor/registry/blocks/testimonials-list-cards/module.json +15 -0
- package/vendor/registry/blocks/testimonials-list-cards/ui/minimal/next/testimonials-list-cards.tsx +114 -0
- package/vendor/registry/blocks/testimonials-list-cards/ui/shadcn/next/testimonials-list-cards.tsx +72 -0
- package/vendor/registry/core/languages/policies.json +25 -0
- package/vendor/registry/core/languages/seed.json +16 -0
- package/vendor/registry/core/languages/snapshot.json +94 -0
- package/vendor/registry/modules/blog/access/policies.json +49 -0
- package/vendor/registry/modules/blog/access/policies.multilocale.json +67 -0
- package/vendor/registry/modules/blog/lib.multilocale.ts +552 -0
- package/vendor/registry/modules/blog/lib.ts +346 -0
- package/vendor/registry/modules/blog/module.json +50 -0
- package/vendor/registry/modules/blog/schema/snapshot.json +701 -0
- package/vendor/registry/modules/blog/schema/snapshot.multilocale.json +884 -0
- package/vendor/registry/modules/blog/services/ATTRIBUTION.md +8 -0
- package/vendor/registry/modules/blog/services/assets/ada-lovelace-avatar.jpg +0 -0
- package/vendor/registry/modules/blog/services/assets/hello-from-dkit-cover.jpg +0 -0
- package/vendor/registry/modules/blog/services/seed.json +70 -0
- package/vendor/registry/modules/blog/services/seed.multilocale.json +90 -0
- package/vendor/registry/modules/blog/types.multilocale.ts +96 -0
- package/vendor/registry/modules/blog/types.ts +62 -0
- package/vendor/registry/modules/booking-form/access/policies.json +25 -0
- package/vendor/registry/modules/booking-form/access/policies.multilocale.json +27 -0
- package/vendor/registry/modules/booking-form/lib.multilocale.ts +71 -0
- package/vendor/registry/modules/booking-form/lib.ts +77 -0
- package/vendor/registry/modules/booking-form/module.json +32 -0
- package/vendor/registry/modules/booking-form/schema/snapshot.json +294 -0
- package/vendor/registry/modules/booking-form/schema/snapshot.multilocale.json +467 -0
- package/vendor/registry/modules/booking-form/services/flows.json +19 -0
- package/vendor/registry/modules/booking-form/types.multilocale.ts +29 -0
- package/vendor/registry/modules/booking-form/types.ts +27 -0
- package/vendor/registry/modules/contact-form/access/policies.json +25 -0
- package/vendor/registry/modules/contact-form/access/policies.multilocale.json +27 -0
- package/vendor/registry/modules/contact-form/lib.multilocale.ts +65 -0
- package/vendor/registry/modules/contact-form/lib.ts +67 -0
- package/vendor/registry/modules/contact-form/module.json +32 -0
- package/vendor/registry/modules/contact-form/schema/snapshot.json +193 -0
- package/vendor/registry/modules/contact-form/schema/snapshot.multilocale.json +293 -0
- package/vendor/registry/modules/contact-form/services/flows.json +19 -0
- package/vendor/registry/modules/contact-form/types.multilocale.ts +21 -0
- package/vendor/registry/modules/contact-form/types.ts +19 -0
- package/vendor/registry/modules/faq/access/policies.json +25 -0
- package/vendor/registry/modules/faq/access/policies.multilocale.json +18 -0
- package/vendor/registry/modules/faq/lib.multilocale.ts +120 -0
- package/vendor/registry/modules/faq/lib.ts +73 -0
- package/vendor/registry/modules/faq/module.json +31 -0
- package/vendor/registry/modules/faq/schema/snapshot.json +180 -0
- package/vendor/registry/modules/faq/schema/snapshot.multilocale.json +116 -0
- package/vendor/registry/modules/faq/services/seed.json +38 -0
- package/vendor/registry/modules/faq/services/seed.multilocale.json +32 -0
- package/vendor/registry/modules/faq/types.multilocale.ts +31 -0
- package/vendor/registry/modules/faq/types.ts +17 -0
- package/vendor/registry/modules/navigation/access/policies.json +31 -0
- package/vendor/registry/modules/navigation/access/policies.multilocale.json +51 -0
- package/vendor/registry/modules/navigation/lib.multilocale.ts +198 -0
- package/vendor/registry/modules/navigation/lib.ts +252 -0
- package/vendor/registry/modules/navigation/module.json +46 -0
- package/vendor/registry/modules/navigation/schema/snapshot.json +453 -0
- package/vendor/registry/modules/navigation/schema/snapshot.multilocale.json +864 -0
- package/vendor/registry/modules/navigation/services/seed.json +103 -0
- package/vendor/registry/modules/navigation/services/seed.multilocale.json +88 -0
- package/vendor/registry/modules/navigation/types.multilocale.ts +60 -0
- package/vendor/registry/modules/navigation/types.ts +44 -0
- package/vendor/registry/modules/pages/access/policies.json +25 -0
- package/vendor/registry/modules/pages/access/policies.multilocale.json +18 -0
- package/vendor/registry/modules/pages/lib.multilocale.ts +166 -0
- package/vendor/registry/modules/pages/lib.ts +123 -0
- package/vendor/registry/modules/pages/module.json +39 -0
- package/vendor/registry/modules/pages/schema/snapshot.json +247 -0
- package/vendor/registry/modules/pages/schema/snapshot.multilocale.json +187 -0
- package/vendor/registry/modules/pages/services/seed.json +24 -0
- package/vendor/registry/modules/pages/services/seed.multilocale.json +34 -0
- package/vendor/registry/modules/pages/types.multilocale.ts +37 -0
- package/vendor/registry/modules/pages/types.ts +21 -0
- package/vendor/registry/modules/projects/access/policies.json +31 -0
- package/vendor/registry/modules/projects/access/policies.multilocale.json +43 -0
- package/vendor/registry/modules/projects/lib.multilocale.ts +111 -0
- package/vendor/registry/modules/projects/lib.ts +138 -0
- package/vendor/registry/modules/projects/module.json +48 -0
- package/vendor/registry/modules/projects/schema/snapshot.json +348 -0
- package/vendor/registry/modules/projects/schema/snapshot.multilocale.json +577 -0
- package/vendor/registry/modules/projects/services/ATTRIBUTION.md +7 -0
- package/vendor/registry/modules/projects/services/assets/brand-identity-cover.jpg +0 -0
- package/vendor/registry/modules/projects/services/seed.json +40 -0
- package/vendor/registry/modules/projects/services/seed.multilocale.json +31 -0
- package/vendor/registry/modules/projects/types.multilocale.ts +38 -0
- package/vendor/registry/modules/projects/types.ts +28 -0
- package/vendor/registry/modules/services/access/policies.json +31 -0
- package/vendor/registry/modules/services/access/policies.multilocale.json +43 -0
- package/vendor/registry/modules/services/lib.multilocale.ts +109 -0
- package/vendor/registry/modules/services/lib.ts +134 -0
- package/vendor/registry/modules/services/module.json +47 -0
- package/vendor/registry/modules/services/schema/snapshot.json +305 -0
- package/vendor/registry/modules/services/schema/snapshot.multilocale.json +510 -0
- package/vendor/registry/modules/services/services/ATTRIBUTION.md +8 -0
- package/vendor/registry/modules/services/services/assets/design-development.jpg +0 -0
- package/vendor/registry/modules/services/services/assets/strategy-consulting.jpg +0 -0
- package/vendor/registry/modules/services/services/seed.json +44 -0
- package/vendor/registry/modules/services/services/seed.multilocale.json +31 -0
- package/vendor/registry/modules/services/types.multilocale.ts +36 -0
- package/vendor/registry/modules/services/types.ts +26 -0
- package/vendor/registry/modules/settings/access/policies.json +31 -0
- package/vendor/registry/modules/settings/access/policies.multilocale.json +43 -0
- package/vendor/registry/modules/settings/lib.multilocale.ts +158 -0
- package/vendor/registry/modules/settings/lib.ts +259 -0
- package/vendor/registry/modules/settings/module.json +33 -0
- package/vendor/registry/modules/settings/schema/snapshot.json +315 -0
- package/vendor/registry/modules/settings/schema/snapshot.multilocale.json +586 -0
- package/vendor/registry/modules/settings/services/assets/dkit-logo.svg +4 -0
- package/vendor/registry/modules/settings/services/seed.json +31 -0
- package/vendor/registry/modules/settings/services/seed.multilocale.json +42 -0
- package/vendor/registry/modules/settings/types.multilocale.ts +72 -0
- package/vendor/registry/modules/settings/types.ts +94 -0
- package/vendor/registry/modules/team/access/policies.json +31 -0
- package/vendor/registry/modules/team/access/policies.multilocale.json +43 -0
- package/vendor/registry/modules/team/lib.multilocale.ts +88 -0
- package/vendor/registry/modules/team/lib.ts +120 -0
- package/vendor/registry/modules/team/module.json +47 -0
- package/vendor/registry/modules/team/schema/snapshot.json +295 -0
- package/vendor/registry/modules/team/schema/snapshot.multilocale.json +525 -0
- package/vendor/registry/modules/team/services/ATTRIBUTION.md +8 -0
- package/vendor/registry/modules/team/services/assets/morgan-lee-photo.jpg +0 -0
- package/vendor/registry/modules/team/services/assets/taylor-kim-photo.jpg +0 -0
- package/vendor/registry/modules/team/services/seed.json +52 -0
- package/vendor/registry/modules/team/services/seed.multilocale.json +30 -0
- package/vendor/registry/modules/team/types.multilocale.ts +33 -0
- package/vendor/registry/modules/team/types.ts +27 -0
- package/vendor/registry/modules/testimonials/access/policies.json +31 -0
- package/vendor/registry/modules/testimonials/access/policies.multilocale.json +43 -0
- package/vendor/registry/modules/testimonials/lib.multilocale.ts +93 -0
- package/vendor/registry/modules/testimonials/lib.ts +85 -0
- package/vendor/registry/modules/testimonials/module.json +41 -0
- package/vendor/registry/modules/testimonials/schema/snapshot.json +248 -0
- package/vendor/registry/modules/testimonials/schema/snapshot.multilocale.json +462 -0
- package/vendor/registry/modules/testimonials/services/ATTRIBUTION.md +8 -0
- package/vendor/registry/modules/testimonials/services/assets/jane-doe-avatar.jpg +0 -0
- package/vendor/registry/modules/testimonials/services/assets/sample-author-avatar.jpg +0 -0
- package/vendor/registry/modules/testimonials/services/seed.json +49 -0
- package/vendor/registry/modules/testimonials/services/seed.multilocale.json +30 -0
- package/vendor/registry/modules/testimonials/types.multilocale.ts +27 -0
- package/vendor/registry/modules/testimonials/types.ts +22 -0
- package/vendor/registry/registry.json +832 -0
- package/vendor/registry/shared/helpers.ts +16 -0
- package/vendor/registry/shared/i18n.ts +74 -0
- package/vendor/registry/shared/minimal.css +83 -0
- package/vendor/registry/shared/paths.ts +50 -0
- package/vendor/registry/shared/prose.css +113 -0
- package/vendor/registry/tsconfig.json +49 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSettings,
|
|
3
|
+
siteLogoUrl,
|
|
4
|
+
siteSocialLinks,
|
|
5
|
+
socialLinkLabel,
|
|
6
|
+
socialLinkProps,
|
|
7
|
+
} from "@/lib/dkit/settings";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Layout wrapper: when `maintenance_mode` is on, render a full-page notice
|
|
11
|
+
* instead of `children`. Pass `bypass` to force the live site (e.g. preview).
|
|
12
|
+
*/
|
|
13
|
+
export async function MaintenanceGate({
|
|
14
|
+
children,
|
|
15
|
+
bypass = false,
|
|
16
|
+
active,
|
|
17
|
+
title,
|
|
18
|
+
message,
|
|
19
|
+
}: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
bypass?: boolean;
|
|
22
|
+
/** Force on/off — overrides settings when set (useful for previews). */
|
|
23
|
+
active?: boolean;
|
|
24
|
+
title?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
}) {
|
|
27
|
+
const settings = await getSettings();
|
|
28
|
+
const on = active ?? Boolean(settings?.maintenance_mode);
|
|
29
|
+
if (bypass || !on || !settings) {
|
|
30
|
+
return <>{children}</>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const name = settings.site_name?.trim() || "We'll be back soon";
|
|
34
|
+
const heading = title?.trim() || "Under maintenance";
|
|
35
|
+
const body =
|
|
36
|
+
message?.trim() ||
|
|
37
|
+
settings.tagline?.trim() ||
|
|
38
|
+
"We're making improvements. Please check back shortly.";
|
|
39
|
+
const logo = siteLogoUrl(settings);
|
|
40
|
+
const email = settings.contact_email?.trim();
|
|
41
|
+
const socials = siteSocialLinks(settings);
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="dkit-maintenance-gate">
|
|
45
|
+
<style>{`
|
|
46
|
+
.dkit-maintenance-gate {
|
|
47
|
+
min-height: 100vh;
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
padding: 3rem 1.25rem;
|
|
52
|
+
text-align: center;
|
|
53
|
+
}
|
|
54
|
+
.dkit-maintenance-gate__inner {
|
|
55
|
+
max-width: 28rem;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
align-items: center;
|
|
59
|
+
gap: 1.25rem;
|
|
60
|
+
}
|
|
61
|
+
.dkit-maintenance-gate__brand {
|
|
62
|
+
margin: 0;
|
|
63
|
+
font-size: 0.75rem;
|
|
64
|
+
letter-spacing: 0.2em;
|
|
65
|
+
text-transform: uppercase;
|
|
66
|
+
color: #666;
|
|
67
|
+
}
|
|
68
|
+
.dkit-maintenance-gate__title {
|
|
69
|
+
margin: 0;
|
|
70
|
+
font-size: 1.875rem;
|
|
71
|
+
font-weight: 600;
|
|
72
|
+
line-height: 1.2;
|
|
73
|
+
}
|
|
74
|
+
.dkit-maintenance-gate__body {
|
|
75
|
+
margin: 0;
|
|
76
|
+
color: #555;
|
|
77
|
+
line-height: 1.6;
|
|
78
|
+
}
|
|
79
|
+
.dkit-maintenance-gate__logo {
|
|
80
|
+
height: 2.5rem;
|
|
81
|
+
width: auto;
|
|
82
|
+
}
|
|
83
|
+
.dkit-maintenance-gate__email {
|
|
84
|
+
color: #555;
|
|
85
|
+
font-size: 0.875rem;
|
|
86
|
+
}
|
|
87
|
+
.dkit-maintenance-gate__social {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-wrap: wrap;
|
|
90
|
+
justify-content: center;
|
|
91
|
+
gap: 0.75rem 1.25rem;
|
|
92
|
+
list-style: none;
|
|
93
|
+
margin: 0;
|
|
94
|
+
padding: 0;
|
|
95
|
+
}
|
|
96
|
+
.dkit-maintenance-gate__social a {
|
|
97
|
+
color: #555;
|
|
98
|
+
font-size: 0.875rem;
|
|
99
|
+
text-decoration: none;
|
|
100
|
+
}
|
|
101
|
+
.dkit-maintenance-gate__social a:hover {
|
|
102
|
+
text-decoration: underline;
|
|
103
|
+
color: inherit;
|
|
104
|
+
}
|
|
105
|
+
`}</style>
|
|
106
|
+
<div className="dkit-maintenance-gate__inner">
|
|
107
|
+
{logo ? (
|
|
108
|
+
<img className="dkit-maintenance-gate__logo" src={logo} alt="" />
|
|
109
|
+
) : null}
|
|
110
|
+
<p className="dkit-maintenance-gate__brand">{name}</p>
|
|
111
|
+
<h1 className="dkit-maintenance-gate__title">{heading}</h1>
|
|
112
|
+
<p className="dkit-maintenance-gate__body">{body}</p>
|
|
113
|
+
{email ? (
|
|
114
|
+
<a className="dkit-maintenance-gate__email" href={`mailto:${email}`}>
|
|
115
|
+
{email}
|
|
116
|
+
</a>
|
|
117
|
+
) : null}
|
|
118
|
+
{socials.length > 0 ? (
|
|
119
|
+
<ul className="dkit-maintenance-gate__social">
|
|
120
|
+
{socials.map((link) => {
|
|
121
|
+
const props = socialLinkProps(link);
|
|
122
|
+
return (
|
|
123
|
+
<li key={`${link.platform}-${link.href}`}>
|
|
124
|
+
<a {...props} data-platform={link.platform}>
|
|
125
|
+
{socialLinkLabel(link)}
|
|
126
|
+
</a>
|
|
127
|
+
</li>
|
|
128
|
+
);
|
|
129
|
+
})}
|
|
130
|
+
</ul>
|
|
131
|
+
) : null}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSettings,
|
|
3
|
+
siteLogoUrl,
|
|
4
|
+
siteSocialLinks,
|
|
5
|
+
socialLinkLabel,
|
|
6
|
+
socialLinkProps,
|
|
7
|
+
} from "@/lib/dkit/settings";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Layout wrapper: when `maintenance_mode` is on, render a full-page notice
|
|
11
|
+
* instead of `children`. Pass `bypass` to force the live site (e.g. preview).
|
|
12
|
+
*/
|
|
13
|
+
export async function MaintenanceGate({
|
|
14
|
+
children,
|
|
15
|
+
bypass = false,
|
|
16
|
+
active,
|
|
17
|
+
title,
|
|
18
|
+
message,
|
|
19
|
+
}: {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/** Skip the gate even when maintenance_mode is true. */
|
|
22
|
+
bypass?: boolean;
|
|
23
|
+
/** Force on/off — overrides settings when set (useful for previews). */
|
|
24
|
+
active?: boolean;
|
|
25
|
+
title?: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
}) {
|
|
28
|
+
const settings = await getSettings();
|
|
29
|
+
const on = active ?? Boolean(settings?.maintenance_mode);
|
|
30
|
+
if (bypass || !on || !settings) {
|
|
31
|
+
return <>{children}</>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const name = settings.site_name?.trim() || "We'll be back soon";
|
|
35
|
+
const heading = title?.trim() || "Under maintenance";
|
|
36
|
+
const body =
|
|
37
|
+
message?.trim() ||
|
|
38
|
+
settings.tagline?.trim() ||
|
|
39
|
+
"We're making improvements. Please check back shortly.";
|
|
40
|
+
const logo = siteLogoUrl(settings);
|
|
41
|
+
const email = settings.contact_email?.trim();
|
|
42
|
+
const socials = siteSocialLinks(settings);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<div className="flex min-h-svh flex-col items-center justify-center bg-background px-6 py-16 text-center">
|
|
46
|
+
<div className="mx-auto flex w-full max-w-md flex-col items-center gap-6">
|
|
47
|
+
{logo ? (
|
|
48
|
+
// eslint-disable-next-line @next/next/no-img-element
|
|
49
|
+
<img src={logo} alt="" className="h-10 w-auto" />
|
|
50
|
+
) : null}
|
|
51
|
+
<p className="text-xs font-medium tracking-[0.2em] text-primary uppercase">
|
|
52
|
+
{name}
|
|
53
|
+
</p>
|
|
54
|
+
<h1 className="text-3xl font-semibold tracking-tight text-foreground sm:text-4xl">
|
|
55
|
+
{heading}
|
|
56
|
+
</h1>
|
|
57
|
+
<p className="text-base leading-relaxed text-muted-foreground">{body}</p>
|
|
58
|
+
{email ? (
|
|
59
|
+
<a
|
|
60
|
+
href={`mailto:${email}`}
|
|
61
|
+
className="text-sm text-muted-foreground underline-offset-4 hover:text-foreground hover:underline"
|
|
62
|
+
>
|
|
63
|
+
{email}
|
|
64
|
+
</a>
|
|
65
|
+
) : null}
|
|
66
|
+
{socials.length > 0 ? (
|
|
67
|
+
<ul className="flex flex-wrap items-center justify-center gap-x-4 gap-y-2">
|
|
68
|
+
{socials.map((link) => {
|
|
69
|
+
const props = socialLinkProps(link);
|
|
70
|
+
return (
|
|
71
|
+
<li key={`${link.platform}-${link.href}`}>
|
|
72
|
+
<a
|
|
73
|
+
{...props}
|
|
74
|
+
data-platform={link.platform}
|
|
75
|
+
className="text-sm text-muted-foreground hover:text-foreground"
|
|
76
|
+
>
|
|
77
|
+
{socialLinkLabel(link)}
|
|
78
|
+
</a>
|
|
79
|
+
</li>
|
|
80
|
+
);
|
|
81
|
+
})}
|
|
82
|
+
</ul>
|
|
83
|
+
) : null}
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "dkit:block",
|
|
3
|
+
"id": "nav-footer",
|
|
4
|
+
"title": "Nav footer",
|
|
5
|
+
"description": "Footer menu link row — no brand/socials; compose with site-brand / social-links yourself",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"frameworks": ["next"],
|
|
8
|
+
"uiKits": ["shadcn", "minimal"],
|
|
9
|
+
"slot": "footer",
|
|
10
|
+
"registryDependencies": ["navigation"],
|
|
11
|
+
"dependencies": ["@directus/sdk"],
|
|
12
|
+
"layers": ["ui"]
|
|
13
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNavMenuByKey,
|
|
3
|
+
navLinkProps,
|
|
4
|
+
type NavItem,
|
|
5
|
+
} from "@/lib/dkit/navigation";
|
|
6
|
+
|
|
7
|
+
function FooterLinks({ items }: { items: NavItem[] }) {
|
|
8
|
+
return (
|
|
9
|
+
<ul className="dkit-nav-footer__links">
|
|
10
|
+
{items.map((item) => {
|
|
11
|
+
const link = navLinkProps(item);
|
|
12
|
+
return (
|
|
13
|
+
<li key={item.id}>
|
|
14
|
+
<a {...link}>{item.label}</a>
|
|
15
|
+
</li>
|
|
16
|
+
);
|
|
17
|
+
})}
|
|
18
|
+
</ul>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Footer menu links only — compose with SiteBrand / SocialLinks yourself. */
|
|
23
|
+
export async function NavFooter({
|
|
24
|
+
menuKey = "footer",
|
|
25
|
+
}: {
|
|
26
|
+
menuKey?: string;
|
|
27
|
+
}) {
|
|
28
|
+
const menu = await getNavMenuByKey(menuKey);
|
|
29
|
+
const items: NavItem[] = menu?.items ?? [];
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<nav className="dkit-nav-footer" aria-label="Footer">
|
|
33
|
+
<style>{`
|
|
34
|
+
.dkit-nav-footer__links {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-wrap: wrap;
|
|
37
|
+
gap: 0.75rem 1.25rem;
|
|
38
|
+
list-style: none;
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
}
|
|
42
|
+
.dkit-nav-footer__links a {
|
|
43
|
+
color: #555;
|
|
44
|
+
text-decoration: none;
|
|
45
|
+
font-size: 0.875rem;
|
|
46
|
+
}
|
|
47
|
+
.dkit-nav-footer__links a:hover {
|
|
48
|
+
text-decoration: underline;
|
|
49
|
+
color: inherit;
|
|
50
|
+
}
|
|
51
|
+
`}</style>
|
|
52
|
+
<FooterLinks items={items} />
|
|
53
|
+
</nav>
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNavMenuByKey,
|
|
3
|
+
navLinkProps,
|
|
4
|
+
type NavItem,
|
|
5
|
+
} from "@/lib/dkit/navigation";
|
|
6
|
+
|
|
7
|
+
function FooterLinks({ items }: { items: NavItem[] }) {
|
|
8
|
+
return (
|
|
9
|
+
<ul className="flex flex-wrap gap-x-6 gap-y-2">
|
|
10
|
+
{items.map((item) => {
|
|
11
|
+
const link = navLinkProps(item);
|
|
12
|
+
return (
|
|
13
|
+
<li key={item.id}>
|
|
14
|
+
<a
|
|
15
|
+
{...link}
|
|
16
|
+
className="text-sm text-muted-foreground transition-colors hover:text-foreground"
|
|
17
|
+
>
|
|
18
|
+
{item.label}
|
|
19
|
+
</a>
|
|
20
|
+
</li>
|
|
21
|
+
);
|
|
22
|
+
})}
|
|
23
|
+
</ul>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Footer menu links only — compose with SiteBrand / SocialLinks yourself. */
|
|
28
|
+
export async function NavFooter({
|
|
29
|
+
menuKey = "footer",
|
|
30
|
+
}: {
|
|
31
|
+
menuKey?: string;
|
|
32
|
+
}) {
|
|
33
|
+
const menu = await getNavMenuByKey(menuKey);
|
|
34
|
+
const items: NavItem[] = menu?.items ?? [];
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<nav aria-label="Footer">
|
|
38
|
+
<FooterLinks items={items} />
|
|
39
|
+
</nav>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "dkit:block",
|
|
3
|
+
"id": "nav-header",
|
|
4
|
+
"title": "Nav header",
|
|
5
|
+
"description": "Primary menu nav (desktop + mobile) — no brand; compose with site-brand yourself",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"frameworks": ["next"],
|
|
8
|
+
"uiKits": ["shadcn", "minimal"],
|
|
9
|
+
"shadcnComponents": ["button", "navigation-menu"],
|
|
10
|
+
"slot": "header",
|
|
11
|
+
"registryDependencies": ["navigation"],
|
|
12
|
+
"dependencies": ["@directus/sdk", "lucide-react"],
|
|
13
|
+
"layers": ["ui"]
|
|
14
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getNavMenuByKey,
|
|
3
|
+
navLinkProps,
|
|
4
|
+
type NavItem,
|
|
5
|
+
} from "@/lib/dkit/navigation";
|
|
6
|
+
|
|
7
|
+
function NavAnchor({ item }: { item: NavItem }) {
|
|
8
|
+
const props = navLinkProps(item);
|
|
9
|
+
return <a {...props}>{item.label}</a>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function ItemList({
|
|
13
|
+
items,
|
|
14
|
+
variant,
|
|
15
|
+
}: {
|
|
16
|
+
items: NavItem[];
|
|
17
|
+
variant: "desktop" | "mobile";
|
|
18
|
+
}) {
|
|
19
|
+
return (
|
|
20
|
+
<ul className="dkit-nav-header__list">
|
|
21
|
+
{items.map((item) => {
|
|
22
|
+
const children = item.children?.filter(Boolean) ?? [];
|
|
23
|
+
const hasChildren = children.length > 0;
|
|
24
|
+
return (
|
|
25
|
+
<li
|
|
26
|
+
key={item.id}
|
|
27
|
+
className={
|
|
28
|
+
hasChildren ? "dkit-nav-header__item--has-children" : undefined
|
|
29
|
+
}
|
|
30
|
+
>
|
|
31
|
+
{hasChildren && variant === "desktop" ? (
|
|
32
|
+
<span className="dkit-nav-header__trigger">{item.label}</span>
|
|
33
|
+
) : (
|
|
34
|
+
<NavAnchor item={item} />
|
|
35
|
+
)}
|
|
36
|
+
{hasChildren ? (
|
|
37
|
+
<ul className="dkit-nav-header__children">
|
|
38
|
+
{children.map((child) => (
|
|
39
|
+
<li key={child.id}>
|
|
40
|
+
<NavAnchor item={child} />
|
|
41
|
+
</li>
|
|
42
|
+
))}
|
|
43
|
+
</ul>
|
|
44
|
+
) : null}
|
|
45
|
+
</li>
|
|
46
|
+
);
|
|
47
|
+
})}
|
|
48
|
+
</ul>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Primary nav only — compose with SiteBrand / SocialLinks yourself.
|
|
54
|
+
* Desktop: CSS hover/focus dropdown for nested items.
|
|
55
|
+
* Mobile: in-flow `<details>` panel.
|
|
56
|
+
*/
|
|
57
|
+
export async function NavHeader({
|
|
58
|
+
menuKey = "primary",
|
|
59
|
+
}: {
|
|
60
|
+
menuKey?: string;
|
|
61
|
+
}) {
|
|
62
|
+
const menu = await getNavMenuByKey(menuKey);
|
|
63
|
+
const items = menu?.items ?? [];
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<nav className="dkit-nav-header" aria-label="Primary">
|
|
67
|
+
<style>{`
|
|
68
|
+
.dkit-nav-header {
|
|
69
|
+
position: relative;
|
|
70
|
+
display: flex;
|
|
71
|
+
width: 100%;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
align-items: flex-end;
|
|
74
|
+
overflow: visible;
|
|
75
|
+
}
|
|
76
|
+
.dkit-nav-header__list {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
align-items: center;
|
|
80
|
+
gap: 0.75rem 1.25rem;
|
|
81
|
+
list-style: none;
|
|
82
|
+
margin: 0;
|
|
83
|
+
padding: 0;
|
|
84
|
+
}
|
|
85
|
+
.dkit-nav-header__list a,
|
|
86
|
+
.dkit-nav-header__trigger {
|
|
87
|
+
color: inherit;
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
}
|
|
90
|
+
.dkit-nav-header__list a:hover,
|
|
91
|
+
.dkit-nav-header__trigger:hover {
|
|
92
|
+
text-decoration: underline;
|
|
93
|
+
}
|
|
94
|
+
.dkit-nav-header__trigger {
|
|
95
|
+
display: inline-flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
gap: 0.35rem;
|
|
98
|
+
cursor: default;
|
|
99
|
+
}
|
|
100
|
+
.dkit-nav-header__trigger::after {
|
|
101
|
+
content: "";
|
|
102
|
+
display: inline-block;
|
|
103
|
+
width: 0.3rem;
|
|
104
|
+
height: 0.3rem;
|
|
105
|
+
border-right: 1.5px solid currentColor;
|
|
106
|
+
border-bottom: 1.5px solid currentColor;
|
|
107
|
+
transform: rotate(45deg) translateY(-1px);
|
|
108
|
+
}
|
|
109
|
+
.dkit-nav-header__children {
|
|
110
|
+
list-style: none;
|
|
111
|
+
margin: 0;
|
|
112
|
+
padding: 0;
|
|
113
|
+
}
|
|
114
|
+
.dkit-nav-header__desktop {
|
|
115
|
+
display: none;
|
|
116
|
+
overflow: visible;
|
|
117
|
+
}
|
|
118
|
+
.dkit-nav-header__mobile {
|
|
119
|
+
width: 100%;
|
|
120
|
+
text-align: right;
|
|
121
|
+
}
|
|
122
|
+
.dkit-nav-header__mobile summary {
|
|
123
|
+
display: inline-flex;
|
|
124
|
+
align-items: center;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
list-style: none;
|
|
127
|
+
font-size: 0.875rem;
|
|
128
|
+
line-height: 1;
|
|
129
|
+
padding: 0.45rem 0.7rem;
|
|
130
|
+
border: 1px solid #ddd;
|
|
131
|
+
border-radius: 0.375rem;
|
|
132
|
+
background: #fff;
|
|
133
|
+
user-select: none;
|
|
134
|
+
}
|
|
135
|
+
.dkit-nav-header__mobile summary::-webkit-details-marker {
|
|
136
|
+
display: none;
|
|
137
|
+
}
|
|
138
|
+
.dkit-nav-header__mobile summary::after {
|
|
139
|
+
content: "";
|
|
140
|
+
display: inline-block;
|
|
141
|
+
width: 0.35rem;
|
|
142
|
+
height: 0.35rem;
|
|
143
|
+
margin-left: 0.45rem;
|
|
144
|
+
border-right: 1.5px solid currentColor;
|
|
145
|
+
border-bottom: 1.5px solid currentColor;
|
|
146
|
+
transform: rotate(45deg) translateY(-1px);
|
|
147
|
+
}
|
|
148
|
+
.dkit-nav-header__mobile[open] summary::after {
|
|
149
|
+
transform: rotate(-135deg) translateY(-1px);
|
|
150
|
+
}
|
|
151
|
+
.dkit-nav-header__panel {
|
|
152
|
+
width: 100%;
|
|
153
|
+
margin-top: 0.75rem;
|
|
154
|
+
padding-top: 0.75rem;
|
|
155
|
+
border-top: 1px solid #ddd;
|
|
156
|
+
text-align: left;
|
|
157
|
+
}
|
|
158
|
+
.dkit-nav-header__mobile .dkit-nav-header__list {
|
|
159
|
+
flex-direction: column;
|
|
160
|
+
flex-wrap: nowrap;
|
|
161
|
+
align-items: stretch;
|
|
162
|
+
gap: 0;
|
|
163
|
+
}
|
|
164
|
+
.dkit-nav-header__mobile .dkit-nav-header__list > li > a {
|
|
165
|
+
display: block;
|
|
166
|
+
padding: 0.55rem 0.15rem;
|
|
167
|
+
font-size: 0.9375rem;
|
|
168
|
+
}
|
|
169
|
+
.dkit-nav-header__mobile .dkit-nav-header__children {
|
|
170
|
+
margin: 0 0 0.25rem;
|
|
171
|
+
padding: 0 0 0 0.85rem;
|
|
172
|
+
border-left: 1px solid #ddd;
|
|
173
|
+
}
|
|
174
|
+
.dkit-nav-header__mobile .dkit-nav-header__children a {
|
|
175
|
+
display: block;
|
|
176
|
+
padding: 0.4rem 0.15rem;
|
|
177
|
+
font-size: 0.875rem;
|
|
178
|
+
color: #555;
|
|
179
|
+
}
|
|
180
|
+
@media (min-width: 768px) {
|
|
181
|
+
.dkit-nav-header {
|
|
182
|
+
display: block;
|
|
183
|
+
width: auto;
|
|
184
|
+
}
|
|
185
|
+
.dkit-nav-header__desktop {
|
|
186
|
+
display: block;
|
|
187
|
+
}
|
|
188
|
+
.dkit-nav-header__mobile {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
.dkit-nav-header__desktop .dkit-nav-header__item--has-children {
|
|
192
|
+
position: relative;
|
|
193
|
+
}
|
|
194
|
+
.dkit-nav-header__desktop .dkit-nav-header__children {
|
|
195
|
+
display: none;
|
|
196
|
+
position: absolute;
|
|
197
|
+
z-index: 40;
|
|
198
|
+
top: 100%;
|
|
199
|
+
left: 0;
|
|
200
|
+
min-width: 10rem;
|
|
201
|
+
padding: 0.4rem;
|
|
202
|
+
padding-top: 0.55rem;
|
|
203
|
+
border: 1px solid #ddd;
|
|
204
|
+
border-radius: 0.375rem;
|
|
205
|
+
background: #fff;
|
|
206
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 8%);
|
|
207
|
+
}
|
|
208
|
+
/* Hover bridge so the gap above the panel doesn't close the menu */
|
|
209
|
+
.dkit-nav-header__desktop .dkit-nav-header__children::before {
|
|
210
|
+
content: "";
|
|
211
|
+
position: absolute;
|
|
212
|
+
left: 0;
|
|
213
|
+
right: 0;
|
|
214
|
+
top: -0.5rem;
|
|
215
|
+
height: 0.5rem;
|
|
216
|
+
}
|
|
217
|
+
.dkit-nav-header__desktop .dkit-nav-header__children a {
|
|
218
|
+
display: block;
|
|
219
|
+
padding: 0.4rem 0.55rem;
|
|
220
|
+
border-radius: 0.25rem;
|
|
221
|
+
white-space: nowrap;
|
|
222
|
+
}
|
|
223
|
+
.dkit-nav-header__desktop .dkit-nav-header__children a:hover {
|
|
224
|
+
background: #f5f5f5;
|
|
225
|
+
text-decoration: none;
|
|
226
|
+
}
|
|
227
|
+
.dkit-nav-header__desktop .dkit-nav-header__item--has-children:hover > .dkit-nav-header__children,
|
|
228
|
+
.dkit-nav-header__desktop .dkit-nav-header__item--has-children:focus-within > .dkit-nav-header__children {
|
|
229
|
+
display: block;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
`}</style>
|
|
233
|
+
<div className="dkit-nav-header__desktop">
|
|
234
|
+
<ItemList items={items} variant="desktop" />
|
|
235
|
+
</div>
|
|
236
|
+
<details className="dkit-nav-header__mobile">
|
|
237
|
+
<summary>Menu</summary>
|
|
238
|
+
<div className="dkit-nav-header__panel">
|
|
239
|
+
<ItemList items={items} variant="mobile" />
|
|
240
|
+
</div>
|
|
241
|
+
</details>
|
|
242
|
+
</nav>
|
|
243
|
+
);
|
|
244
|
+
}
|