@prosophia/lab-minimal 0.0.4 → 0.0.5
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/dist/index.d.mts +29 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +120 -121
- package/dist/index.mjs +119 -121
- package/dist/layouts/index.js +40 -48
- package/dist/layouts/index.mjs +40 -48
- package/package.json +1 -1
- package/dist/index.css +0 -1060
- package/dist/layouts/index.css +0 -444
package/dist/layouts/index.js
CHANGED
|
@@ -42,19 +42,13 @@ var import_next_themes2 = require("next-themes");
|
|
|
42
42
|
var import_link = __toESM(require("next/link"));
|
|
43
43
|
var import_react2 = require("react");
|
|
44
44
|
var import_navigation = require("next/navigation");
|
|
45
|
-
|
|
46
|
-
// src/components/Layout.module.css
|
|
47
|
-
var Layout_default = {};
|
|
45
|
+
var import_Layout = __toESM(require("./Layout.module.css"));
|
|
48
46
|
|
|
49
47
|
// src/components/ThemeToggle.tsx
|
|
50
48
|
var import_next_themes = require("next-themes");
|
|
51
49
|
var import_react = require("react");
|
|
52
50
|
var import_framer_motion = require("framer-motion");
|
|
53
|
-
|
|
54
|
-
// src/components/ThemeToggle.module.css
|
|
55
|
-
var ThemeToggle_default = {};
|
|
56
|
-
|
|
57
|
-
// src/components/ThemeToggle.tsx
|
|
51
|
+
var import_ThemeToggle = __toESM(require("./ThemeToggle.module.css"));
|
|
58
52
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
59
53
|
function ThemeToggle() {
|
|
60
54
|
const { theme, setTheme, resolvedTheme } = (0, import_next_themes.useTheme)();
|
|
@@ -63,7 +57,7 @@ function ThemeToggle() {
|
|
|
63
57
|
setMounted(true);
|
|
64
58
|
}, []);
|
|
65
59
|
if (!mounted) {
|
|
66
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className:
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_ThemeToggle.default.togglePlaceholder });
|
|
67
61
|
}
|
|
68
62
|
const isDark = resolvedTheme === "dark";
|
|
69
63
|
const toggleTheme = () => {
|
|
@@ -72,12 +66,12 @@ function ThemeToggle() {
|
|
|
72
66
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
73
67
|
import_framer_motion.motion.button,
|
|
74
68
|
{
|
|
75
|
-
className:
|
|
69
|
+
className: import_ThemeToggle.default.toggle,
|
|
76
70
|
onClick: toggleTheme,
|
|
77
71
|
"aria-label": `Switch to ${isDark ? "light" : "dark"} mode`,
|
|
78
72
|
whileTap: { scale: 0.95 },
|
|
79
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className:
|
|
80
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${
|
|
73
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: import_ThemeToggle.default.track, children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${import_ThemeToggle.default.icon} ${import_ThemeToggle.default.sunIcon} ${!isDark ? import_ThemeToggle.default.iconActive : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
81
75
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "5" }),
|
|
82
76
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
83
77
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
@@ -91,12 +85,12 @@ function ThemeToggle() {
|
|
|
91
85
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
92
86
|
import_framer_motion.motion.span,
|
|
93
87
|
{
|
|
94
|
-
className:
|
|
88
|
+
className: import_ThemeToggle.default.thumb,
|
|
95
89
|
animate: { x: isDark ? 26 : 0 },
|
|
96
90
|
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
97
91
|
}
|
|
98
92
|
),
|
|
99
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${import_ThemeToggle.default.icon} ${import_ThemeToggle.default.moonIcon} ${isDark ? import_ThemeToggle.default.iconActive : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) })
|
|
100
94
|
] })
|
|
101
95
|
}
|
|
102
96
|
);
|
|
@@ -148,8 +142,8 @@ function Header({ settings }) {
|
|
|
148
142
|
if (href === "/") return pathname === "/";
|
|
149
143
|
return pathname.startsWith(href);
|
|
150
144
|
};
|
|
151
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("header", { className: `${
|
|
152
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_link.default, { href: "/", className:
|
|
145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("header", { className: `${import_Layout.default.header} ${scrolled ? import_Layout.default.headerScrolled : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: import_Layout.default.navContainer, children: [
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_link.default, { href: "/", className: import_Layout.default.navLogo, "aria-label": "Go to homepage", children: [
|
|
153
147
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
154
148
|
"svg",
|
|
155
149
|
{
|
|
@@ -195,37 +189,37 @@ function Header({ settings }) {
|
|
|
195
189
|
),
|
|
196
190
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
|
|
197
191
|
settings.labName || "Research",
|
|
198
|
-
settings.labNameAccent && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className:
|
|
192
|
+
settings.labNameAccent && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: import_Layout.default.navLogoAccent, children: [
|
|
199
193
|
" ",
|
|
200
194
|
settings.labNameAccent
|
|
201
195
|
] })
|
|
202
196
|
] })
|
|
203
197
|
] }),
|
|
204
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { className:
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("nav", { className: import_Layout.default.desktopNav, "aria-label": "Main navigation", children: navLinks.map((link) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
205
199
|
import_link.default,
|
|
206
200
|
{
|
|
207
201
|
href: link.href,
|
|
208
|
-
className: `${
|
|
202
|
+
className: `${import_Layout.default.navLink} ${isActive(link.href) ? import_Layout.default.navLinkActive : ""}`,
|
|
209
203
|
children: link.label
|
|
210
204
|
},
|
|
211
205
|
link.href
|
|
212
206
|
)) }),
|
|
213
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className:
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: import_Layout.default.navActions, children: [
|
|
214
208
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ThemeToggle, {}),
|
|
215
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_link.default, { href: "/contact", className:
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_link.default, { href: "/contact", className: import_Layout.default.navCta, children: "Contact Us" })
|
|
216
210
|
] }),
|
|
217
211
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
218
212
|
"button",
|
|
219
213
|
{
|
|
220
|
-
className:
|
|
214
|
+
className: import_Layout.default.menuButton,
|
|
221
215
|
onClick: () => setMenuOpen(!menuOpen),
|
|
222
216
|
"aria-label": menuOpen ? "Close menu" : "Open menu",
|
|
223
217
|
"aria-expanded": menuOpen,
|
|
224
218
|
"aria-controls": "mobile-menu",
|
|
225
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className:
|
|
226
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${
|
|
227
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${
|
|
228
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${
|
|
219
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: import_Layout.default.menuButtonLines, children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${import_Layout.default.menuLine} ${menuOpen ? import_Layout.default.menuLineOpen1 : ""}` }),
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${import_Layout.default.menuLine} ${menuOpen ? import_Layout.default.menuLineOpen2 : ""}` }),
|
|
222
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: `${import_Layout.default.menuLine} ${menuOpen ? import_Layout.default.menuLineOpen3 : ""}` })
|
|
229
223
|
] })
|
|
230
224
|
}
|
|
231
225
|
),
|
|
@@ -233,13 +227,13 @@ function Header({ settings }) {
|
|
|
233
227
|
"div",
|
|
234
228
|
{
|
|
235
229
|
id: "mobile-menu",
|
|
236
|
-
className: `${
|
|
230
|
+
className: `${import_Layout.default.mobileMenu} ${menuOpen ? import_Layout.default.mobileMenuOpen : ""}`,
|
|
237
231
|
"aria-hidden": !menuOpen,
|
|
238
232
|
children: [
|
|
239
233
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
240
234
|
"div",
|
|
241
235
|
{
|
|
242
|
-
className:
|
|
236
|
+
className: import_Layout.default.mobileMenuOverlay,
|
|
243
237
|
onClick: () => setMenuOpen(false),
|
|
244
238
|
"aria-hidden": "true"
|
|
245
239
|
}
|
|
@@ -247,14 +241,14 @@ function Header({ settings }) {
|
|
|
247
241
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
248
242
|
"nav",
|
|
249
243
|
{
|
|
250
|
-
className:
|
|
244
|
+
className: import_Layout.default.mobileMenuContent,
|
|
251
245
|
"aria-label": "Mobile navigation",
|
|
252
246
|
children: [
|
|
253
247
|
navLinks.map((link, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
254
248
|
import_link.default,
|
|
255
249
|
{
|
|
256
250
|
href: link.href,
|
|
257
|
-
className: `${
|
|
251
|
+
className: `${import_Layout.default.mobileNavLink} ${isActive(link.href) ? import_Layout.default.mobileNavLinkActive : ""}`,
|
|
258
252
|
style: { animationDelay: `${index * 50}ms` },
|
|
259
253
|
tabIndex: menuOpen ? 0 : -1,
|
|
260
254
|
children: link.label
|
|
@@ -265,7 +259,7 @@ function Header({ settings }) {
|
|
|
265
259
|
import_link.default,
|
|
266
260
|
{
|
|
267
261
|
href: "/contact",
|
|
268
|
-
className:
|
|
262
|
+
className: import_Layout.default.mobileNavCta,
|
|
269
263
|
style: { animationDelay: `${navLinks.length * 50}ms` },
|
|
270
264
|
tabIndex: menuOpen ? 0 : -1,
|
|
271
265
|
children: "Contact Us"
|
|
@@ -282,9 +276,7 @@ function Header({ settings }) {
|
|
|
282
276
|
|
|
283
277
|
// src/components/Footer.tsx
|
|
284
278
|
var import_link2 = __toESM(require("next/link"));
|
|
285
|
-
|
|
286
|
-
// src/components/Footer.module.css
|
|
287
|
-
var Footer_default = {};
|
|
279
|
+
var import_Footer = __toESM(require("./Footer.module.css"));
|
|
288
280
|
|
|
289
281
|
// src/lib/utils.ts
|
|
290
282
|
function isValidExternalUrl(url) {
|
|
@@ -299,49 +291,49 @@ function isValidExternalUrl(url) {
|
|
|
299
291
|
|
|
300
292
|
// src/components/Footer.tsx
|
|
301
293
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
302
|
-
var SocialIcon = ({ href, children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", className:
|
|
294
|
+
var SocialIcon = ({ href, children }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", className: import_Footer.default.socialIcon, children });
|
|
303
295
|
function Footer({ settings }) {
|
|
304
296
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
305
297
|
const showPrivacy = settings?.showPrivacyPolicy !== false;
|
|
306
298
|
const showTerms = settings?.showTerms !== false;
|
|
307
299
|
const hasLegalLinks = showPrivacy || showTerms;
|
|
308
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("footer", { className:
|
|
309
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
310
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
311
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_link2.default, { href: "/", className:
|
|
300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("footer", { className: import_Footer.default.footerWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerContainer, children: [
|
|
301
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.mainFooter, children: [
|
|
302
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerAbout, children: [
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_link2.default, { href: "/", className: import_Footer.default.footerLogo, children: [
|
|
312
304
|
settings?.labName || "Cavendish",
|
|
313
305
|
" ",
|
|
314
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className:
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: import_Footer.default.logoAccent, children: settings?.labNameAccent || "Lab" })
|
|
315
307
|
] }),
|
|
316
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className:
|
|
317
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: import_Footer.default.footerDescription, children: settings?.labNameDescription || "Advancing the frontiers of physics and our understanding of the universe." }),
|
|
309
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.socials, children: [
|
|
318
310
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SocialIcon, { href: "#", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" }) }) }),
|
|
319
311
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SocialIcon, { href: "#", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24h-6.617l-5.21-6.817-6.044 6.817h-3.308l7.73-8.835-7.73-10.668h6.78l4.522 6.312 5.59-6.312z" }) }) })
|
|
320
312
|
] })
|
|
321
313
|
] }),
|
|
322
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
323
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
314
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerLinksGrid, children: [
|
|
315
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerColumn, children: [
|
|
324
316
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { children: "Quick Links" }),
|
|
325
317
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/research", children: "Research" }),
|
|
326
318
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/publications", children: "Publications" }),
|
|
327
319
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/pictures", children: "Gallery" })
|
|
328
320
|
] }),
|
|
329
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
321
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerColumn, children: [
|
|
330
322
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { children: "About" }),
|
|
331
323
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/news", children: "News" }),
|
|
332
324
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/people", children: "Our Team" }),
|
|
333
325
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/contact", children: "Contact" })
|
|
334
326
|
] }),
|
|
335
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
327
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerColumn, children: [
|
|
336
328
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h4", { children: "Resources" }),
|
|
337
329
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "https://www.cam.ac.uk/", children: "University" }),
|
|
338
330
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "#", children: "Careers" })
|
|
339
331
|
] })
|
|
340
332
|
] })
|
|
341
333
|
] }),
|
|
342
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.footerBottomBar, children: [
|
|
343
335
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: settings?.footerText || `\xA9 ${currentYear} The Research Group. All Rights Reserved.` }),
|
|
344
|
-
hasLegalLinks && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className:
|
|
336
|
+
hasLegalLinks && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: import_Footer.default.legalLinks, children: [
|
|
345
337
|
showPrivacy && (settings?.privacyPolicyUrl && isValidExternalUrl(settings.privacyPolicyUrl) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: settings.privacyPolicyUrl, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/privacy", children: "Privacy Policy" })),
|
|
346
338
|
showTerms && (settings?.termsUrl && isValidExternalUrl(settings.termsUrl) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("a", { href: settings.termsUrl, target: "_blank", rel: "noopener noreferrer", children: "Terms & Conditions" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_link2.default, { href: "/terms", children: "Terms & Conditions" }))
|
|
347
339
|
] })
|
package/dist/layouts/index.mjs
CHANGED
|
@@ -6,19 +6,13 @@ import { ThemeProvider, useTheme as useTheme2 } from "next-themes";
|
|
|
6
6
|
import Link from "next/link";
|
|
7
7
|
import { useState as useState2, useEffect as useEffect2, useCallback } from "react";
|
|
8
8
|
import { usePathname } from "next/navigation";
|
|
9
|
-
|
|
10
|
-
// src/components/Layout.module.css
|
|
11
|
-
var Layout_default = {};
|
|
9
|
+
import styles2 from "./Layout.module.css";
|
|
12
10
|
|
|
13
11
|
// src/components/ThemeToggle.tsx
|
|
14
12
|
import { useTheme } from "next-themes";
|
|
15
13
|
import { useEffect, useState } from "react";
|
|
16
14
|
import { motion } from "framer-motion";
|
|
17
|
-
|
|
18
|
-
// src/components/ThemeToggle.module.css
|
|
19
|
-
var ThemeToggle_default = {};
|
|
20
|
-
|
|
21
|
-
// src/components/ThemeToggle.tsx
|
|
15
|
+
import styles from "./ThemeToggle.module.css";
|
|
22
16
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
23
17
|
function ThemeToggle() {
|
|
24
18
|
const { theme, setTheme, resolvedTheme } = useTheme();
|
|
@@ -27,7 +21,7 @@ function ThemeToggle() {
|
|
|
27
21
|
setMounted(true);
|
|
28
22
|
}, []);
|
|
29
23
|
if (!mounted) {
|
|
30
|
-
return /* @__PURE__ */ jsx("div", { className:
|
|
24
|
+
return /* @__PURE__ */ jsx("div", { className: styles.togglePlaceholder });
|
|
31
25
|
}
|
|
32
26
|
const isDark = resolvedTheme === "dark";
|
|
33
27
|
const toggleTheme = () => {
|
|
@@ -36,12 +30,12 @@ function ThemeToggle() {
|
|
|
36
30
|
return /* @__PURE__ */ jsx(
|
|
37
31
|
motion.button,
|
|
38
32
|
{
|
|
39
|
-
className:
|
|
33
|
+
className: styles.toggle,
|
|
40
34
|
onClick: toggleTheme,
|
|
41
35
|
"aria-label": `Switch to ${isDark ? "light" : "dark"} mode`,
|
|
42
36
|
whileTap: { scale: 0.95 },
|
|
43
|
-
children: /* @__PURE__ */ jsxs("span", { className:
|
|
44
|
-
/* @__PURE__ */ jsx("span", { className: `${
|
|
37
|
+
children: /* @__PURE__ */ jsxs("span", { className: styles.track, children: [
|
|
38
|
+
/* @__PURE__ */ jsx("span", { className: `${styles.icon} ${styles.sunIcon} ${!isDark ? styles.iconActive : ""}`, children: /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
45
39
|
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "5" }),
|
|
46
40
|
/* @__PURE__ */ jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
47
41
|
/* @__PURE__ */ jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
@@ -55,12 +49,12 @@ function ThemeToggle() {
|
|
|
55
49
|
/* @__PURE__ */ jsx(
|
|
56
50
|
motion.span,
|
|
57
51
|
{
|
|
58
|
-
className:
|
|
52
|
+
className: styles.thumb,
|
|
59
53
|
animate: { x: isDark ? 26 : 0 },
|
|
60
54
|
transition: { type: "spring", stiffness: 500, damping: 30 }
|
|
61
55
|
}
|
|
62
56
|
),
|
|
63
|
-
/* @__PURE__ */ jsx("span", { className: `${
|
|
57
|
+
/* @__PURE__ */ jsx("span", { className: `${styles.icon} ${styles.moonIcon} ${isDark ? styles.iconActive : ""}`, children: /* @__PURE__ */ jsx("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }) })
|
|
64
58
|
] })
|
|
65
59
|
}
|
|
66
60
|
);
|
|
@@ -112,8 +106,8 @@ function Header({ settings }) {
|
|
|
112
106
|
if (href === "/") return pathname === "/";
|
|
113
107
|
return pathname.startsWith(href);
|
|
114
108
|
};
|
|
115
|
-
return /* @__PURE__ */ jsx2("header", { className: `${
|
|
116
|
-
/* @__PURE__ */ jsxs2(Link, { href: "/", className:
|
|
109
|
+
return /* @__PURE__ */ jsx2("header", { className: `${styles2.header} ${scrolled ? styles2.headerScrolled : ""}`, children: /* @__PURE__ */ jsxs2("div", { className: styles2.navContainer, children: [
|
|
110
|
+
/* @__PURE__ */ jsxs2(Link, { href: "/", className: styles2.navLogo, "aria-label": "Go to homepage", children: [
|
|
117
111
|
/* @__PURE__ */ jsxs2(
|
|
118
112
|
"svg",
|
|
119
113
|
{
|
|
@@ -159,37 +153,37 @@ function Header({ settings }) {
|
|
|
159
153
|
),
|
|
160
154
|
/* @__PURE__ */ jsxs2("span", { children: [
|
|
161
155
|
settings.labName || "Research",
|
|
162
|
-
settings.labNameAccent && /* @__PURE__ */ jsxs2("span", { className:
|
|
156
|
+
settings.labNameAccent && /* @__PURE__ */ jsxs2("span", { className: styles2.navLogoAccent, children: [
|
|
163
157
|
" ",
|
|
164
158
|
settings.labNameAccent
|
|
165
159
|
] })
|
|
166
160
|
] })
|
|
167
161
|
] }),
|
|
168
|
-
/* @__PURE__ */ jsx2("nav", { className:
|
|
162
|
+
/* @__PURE__ */ jsx2("nav", { className: styles2.desktopNav, "aria-label": "Main navigation", children: navLinks.map((link) => /* @__PURE__ */ jsx2(
|
|
169
163
|
Link,
|
|
170
164
|
{
|
|
171
165
|
href: link.href,
|
|
172
|
-
className: `${
|
|
166
|
+
className: `${styles2.navLink} ${isActive(link.href) ? styles2.navLinkActive : ""}`,
|
|
173
167
|
children: link.label
|
|
174
168
|
},
|
|
175
169
|
link.href
|
|
176
170
|
)) }),
|
|
177
|
-
/* @__PURE__ */ jsxs2("div", { className:
|
|
171
|
+
/* @__PURE__ */ jsxs2("div", { className: styles2.navActions, children: [
|
|
178
172
|
/* @__PURE__ */ jsx2(ThemeToggle, {}),
|
|
179
|
-
/* @__PURE__ */ jsx2(Link, { href: "/contact", className:
|
|
173
|
+
/* @__PURE__ */ jsx2(Link, { href: "/contact", className: styles2.navCta, children: "Contact Us" })
|
|
180
174
|
] }),
|
|
181
175
|
/* @__PURE__ */ jsx2(
|
|
182
176
|
"button",
|
|
183
177
|
{
|
|
184
|
-
className:
|
|
178
|
+
className: styles2.menuButton,
|
|
185
179
|
onClick: () => setMenuOpen(!menuOpen),
|
|
186
180
|
"aria-label": menuOpen ? "Close menu" : "Open menu",
|
|
187
181
|
"aria-expanded": menuOpen,
|
|
188
182
|
"aria-controls": "mobile-menu",
|
|
189
|
-
children: /* @__PURE__ */ jsxs2("span", { className:
|
|
190
|
-
/* @__PURE__ */ jsx2("span", { className: `${
|
|
191
|
-
/* @__PURE__ */ jsx2("span", { className: `${
|
|
192
|
-
/* @__PURE__ */ jsx2("span", { className: `${
|
|
183
|
+
children: /* @__PURE__ */ jsxs2("span", { className: styles2.menuButtonLines, children: [
|
|
184
|
+
/* @__PURE__ */ jsx2("span", { className: `${styles2.menuLine} ${menuOpen ? styles2.menuLineOpen1 : ""}` }),
|
|
185
|
+
/* @__PURE__ */ jsx2("span", { className: `${styles2.menuLine} ${menuOpen ? styles2.menuLineOpen2 : ""}` }),
|
|
186
|
+
/* @__PURE__ */ jsx2("span", { className: `${styles2.menuLine} ${menuOpen ? styles2.menuLineOpen3 : ""}` })
|
|
193
187
|
] })
|
|
194
188
|
}
|
|
195
189
|
),
|
|
@@ -197,13 +191,13 @@ function Header({ settings }) {
|
|
|
197
191
|
"div",
|
|
198
192
|
{
|
|
199
193
|
id: "mobile-menu",
|
|
200
|
-
className: `${
|
|
194
|
+
className: `${styles2.mobileMenu} ${menuOpen ? styles2.mobileMenuOpen : ""}`,
|
|
201
195
|
"aria-hidden": !menuOpen,
|
|
202
196
|
children: [
|
|
203
197
|
/* @__PURE__ */ jsx2(
|
|
204
198
|
"div",
|
|
205
199
|
{
|
|
206
|
-
className:
|
|
200
|
+
className: styles2.mobileMenuOverlay,
|
|
207
201
|
onClick: () => setMenuOpen(false),
|
|
208
202
|
"aria-hidden": "true"
|
|
209
203
|
}
|
|
@@ -211,14 +205,14 @@ function Header({ settings }) {
|
|
|
211
205
|
/* @__PURE__ */ jsxs2(
|
|
212
206
|
"nav",
|
|
213
207
|
{
|
|
214
|
-
className:
|
|
208
|
+
className: styles2.mobileMenuContent,
|
|
215
209
|
"aria-label": "Mobile navigation",
|
|
216
210
|
children: [
|
|
217
211
|
navLinks.map((link, index) => /* @__PURE__ */ jsx2(
|
|
218
212
|
Link,
|
|
219
213
|
{
|
|
220
214
|
href: link.href,
|
|
221
|
-
className: `${
|
|
215
|
+
className: `${styles2.mobileNavLink} ${isActive(link.href) ? styles2.mobileNavLinkActive : ""}`,
|
|
222
216
|
style: { animationDelay: `${index * 50}ms` },
|
|
223
217
|
tabIndex: menuOpen ? 0 : -1,
|
|
224
218
|
children: link.label
|
|
@@ -229,7 +223,7 @@ function Header({ settings }) {
|
|
|
229
223
|
Link,
|
|
230
224
|
{
|
|
231
225
|
href: "/contact",
|
|
232
|
-
className:
|
|
226
|
+
className: styles2.mobileNavCta,
|
|
233
227
|
style: { animationDelay: `${navLinks.length * 50}ms` },
|
|
234
228
|
tabIndex: menuOpen ? 0 : -1,
|
|
235
229
|
children: "Contact Us"
|
|
@@ -246,9 +240,7 @@ function Header({ settings }) {
|
|
|
246
240
|
|
|
247
241
|
// src/components/Footer.tsx
|
|
248
242
|
import Link2 from "next/link";
|
|
249
|
-
|
|
250
|
-
// src/components/Footer.module.css
|
|
251
|
-
var Footer_default = {};
|
|
243
|
+
import styles3 from "./Footer.module.css";
|
|
252
244
|
|
|
253
245
|
// src/lib/utils.ts
|
|
254
246
|
function isValidExternalUrl(url) {
|
|
@@ -263,49 +255,49 @@ function isValidExternalUrl(url) {
|
|
|
263
255
|
|
|
264
256
|
// src/components/Footer.tsx
|
|
265
257
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
266
|
-
var SocialIcon = ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, target: "_blank", rel: "noopener noreferrer", className:
|
|
258
|
+
var SocialIcon = ({ href, children }) => /* @__PURE__ */ jsx3("a", { href, target: "_blank", rel: "noopener noreferrer", className: styles3.socialIcon, children });
|
|
267
259
|
function Footer({ settings }) {
|
|
268
260
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
269
261
|
const showPrivacy = settings?.showPrivacyPolicy !== false;
|
|
270
262
|
const showTerms = settings?.showTerms !== false;
|
|
271
263
|
const hasLegalLinks = showPrivacy || showTerms;
|
|
272
|
-
return /* @__PURE__ */ jsx3("footer", { className:
|
|
273
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
274
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
275
|
-
/* @__PURE__ */ jsxs3(Link2, { href: "/", className:
|
|
264
|
+
return /* @__PURE__ */ jsx3("footer", { className: styles3.footerWrapper, children: /* @__PURE__ */ jsxs3("div", { className: styles3.footerContainer, children: [
|
|
265
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.mainFooter, children: [
|
|
266
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerAbout, children: [
|
|
267
|
+
/* @__PURE__ */ jsxs3(Link2, { href: "/", className: styles3.footerLogo, children: [
|
|
276
268
|
settings?.labName || "Cavendish",
|
|
277
269
|
" ",
|
|
278
|
-
/* @__PURE__ */ jsx3("span", { className:
|
|
270
|
+
/* @__PURE__ */ jsx3("span", { className: styles3.logoAccent, children: settings?.labNameAccent || "Lab" })
|
|
279
271
|
] }),
|
|
280
|
-
/* @__PURE__ */ jsx3("p", { className:
|
|
281
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
272
|
+
/* @__PURE__ */ jsx3("p", { className: styles3.footerDescription, children: settings?.labNameDescription || "Advancing the frontiers of physics and our understanding of the universe." }),
|
|
273
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.socials, children: [
|
|
282
274
|
/* @__PURE__ */ jsx3(SocialIcon, { href: "#", children: /* @__PURE__ */ jsx3("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx3("path", { d: "M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" }) }) }),
|
|
283
275
|
/* @__PURE__ */ jsx3(SocialIcon, { href: "#", children: /* @__PURE__ */ jsx3("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx3("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24h-6.617l-5.21-6.817-6.044 6.817h-3.308l7.73-8.835-7.73-10.668h6.78l4.522 6.312 5.59-6.312z" }) }) })
|
|
284
276
|
] })
|
|
285
277
|
] }),
|
|
286
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
287
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
278
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerLinksGrid, children: [
|
|
279
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerColumn, children: [
|
|
288
280
|
/* @__PURE__ */ jsx3("h4", { children: "Quick Links" }),
|
|
289
281
|
/* @__PURE__ */ jsx3(Link2, { href: "/research", children: "Research" }),
|
|
290
282
|
/* @__PURE__ */ jsx3(Link2, { href: "/publications", children: "Publications" }),
|
|
291
283
|
/* @__PURE__ */ jsx3(Link2, { href: "/pictures", children: "Gallery" })
|
|
292
284
|
] }),
|
|
293
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
285
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerColumn, children: [
|
|
294
286
|
/* @__PURE__ */ jsx3("h4", { children: "About" }),
|
|
295
287
|
/* @__PURE__ */ jsx3(Link2, { href: "/news", children: "News" }),
|
|
296
288
|
/* @__PURE__ */ jsx3(Link2, { href: "/people", children: "Our Team" }),
|
|
297
289
|
/* @__PURE__ */ jsx3(Link2, { href: "/contact", children: "Contact" })
|
|
298
290
|
] }),
|
|
299
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
291
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerColumn, children: [
|
|
300
292
|
/* @__PURE__ */ jsx3("h4", { children: "Resources" }),
|
|
301
293
|
/* @__PURE__ */ jsx3(Link2, { href: "https://www.cam.ac.uk/", children: "University" }),
|
|
302
294
|
/* @__PURE__ */ jsx3(Link2, { href: "#", children: "Careers" })
|
|
303
295
|
] })
|
|
304
296
|
] })
|
|
305
297
|
] }),
|
|
306
|
-
/* @__PURE__ */ jsxs3("div", { className:
|
|
298
|
+
/* @__PURE__ */ jsxs3("div", { className: styles3.footerBottomBar, children: [
|
|
307
299
|
/* @__PURE__ */ jsx3("p", { children: settings?.footerText || `\xA9 ${currentYear} The Research Group. All Rights Reserved.` }),
|
|
308
|
-
hasLegalLinks && /* @__PURE__ */ jsxs3("div", { className:
|
|
300
|
+
hasLegalLinks && /* @__PURE__ */ jsxs3("div", { className: styles3.legalLinks, children: [
|
|
309
301
|
showPrivacy && (settings?.privacyPolicyUrl && isValidExternalUrl(settings.privacyPolicyUrl) ? /* @__PURE__ */ jsx3("a", { href: settings.privacyPolicyUrl, target: "_blank", rel: "noopener noreferrer", children: "Privacy Policy" }) : /* @__PURE__ */ jsx3(Link2, { href: "/privacy", children: "Privacy Policy" })),
|
|
310
302
|
showTerms && (settings?.termsUrl && isValidExternalUrl(settings.termsUrl) ? /* @__PURE__ */ jsx3("a", { href: settings.termsUrl, target: "_blank", rel: "noopener noreferrer", children: "Terms & Conditions" }) : /* @__PURE__ */ jsx3(Link2, { href: "/terms", children: "Terms & Conditions" }))
|
|
311
303
|
] })
|