@yamatozhen/design_system 1.0.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.
Files changed (87) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +101 -0
  3. package/package.json +49 -0
  4. package/scripts/postinstall.js +105 -0
  5. package/template/app/ClientNav.tsx +310 -0
  6. package/template/app/globals.css +167 -0
  7. package/template/app/layout.tsx +128 -0
  8. package/template/app/themes/dark-mc.css +51 -0
  9. package/template/app/themes/dark.css +51 -0
  10. package/template/app/themes/light-mc.css +51 -0
  11. package/template/app/themes/light.css +51 -0
  12. package/template/app/themes/theme.css +82 -0
  13. package/template/components/layout/Lightbox/LightboxCard.tsx +100 -0
  14. package/template/components/layout/Lightbox/LightboxGallery.module.css +249 -0
  15. package/template/components/layout/Lightbox/LightboxGallery.tsx +72 -0
  16. package/template/components/layout/Lightbox/LightboxGrid.tsx +186 -0
  17. package/template/components/layout/Lightbox/LightboxModal.module.css +395 -0
  18. package/template/components/layout/Lightbox/LightboxModal.tsx +500 -0
  19. package/template/components/layout/Lightbox/demo.tsx +412 -0
  20. package/template/components/layout/Lightbox/index.ts +30 -0
  21. package/template/components/layout/Lightbox/types.ts +113 -0
  22. package/template/components/layout/Lightbox/useLightboxFilters.ts +140 -0
  23. package/template/components/layout/accordion/Accordion.module.css +149 -0
  24. package/template/components/layout/accordion/Accordion.tsx +114 -0
  25. package/template/components/layout/button/Button.module.css +305 -0
  26. package/template/components/layout/button/ButtonGroup.tsx +503 -0
  27. package/template/components/layout/button/FAB.tsx +118 -0
  28. package/template/components/layout/button/button.tsx +128 -0
  29. package/template/components/layout/button/drop.module.css +229 -0
  30. package/template/components/layout/button/drop.tsx +516 -0
  31. package/template/components/layout/hero/v1/heroSlideshow.module.css +107 -0
  32. package/template/components/layout/hero/v1/heroSlideshow.tsx +233 -0
  33. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.module.css +126 -0
  34. package/template/components/layout/modals/accessibilityModal/AccessibilityModal.tsx +290 -0
  35. package/template/components/layout/modals/alert/Alert.tsx +188 -0
  36. package/template/components/layout/navigation/MioCard.module.css +88 -0
  37. package/template/components/layout/navigation/MioCard.tsx +266 -0
  38. package/template/components/layout/navigation/Wrap.tsx +41 -0
  39. package/template/components/layout/navigation/nav/Nav.module.css +508 -0
  40. package/template/components/layout/navigation/nav/Nav.tsx +167 -0
  41. package/template/components/layout/navigation/nav/NavBar.tsx +419 -0
  42. package/template/components/layout/navigation/nav/NavContext.tsx +259 -0
  43. package/template/components/layout/navigation/nav/NavItem.tsx +173 -0
  44. package/template/components/layout/navigation/nav/NavNew.module.css +373 -0
  45. package/template/components/layout/navigation/nav/NavRail.tsx +315 -0
  46. package/template/components/layout/navigation/nav/NavSection.tsx +102 -0
  47. package/template/components/layout/navigation/nav/NavTab.tsx +25 -0
  48. package/template/components/layout/navigation/nav/navftb/NavFTB.module.css +252 -0
  49. package/template/components/layout/navigation/nav/navftb/NavFTB.tsx +399 -0
  50. package/template/components/layout/navigation/nav/navftb/useTabIndicator.ts +484 -0
  51. package/template/components/layout/navigation/nav/navheader/NavHeader.module.css +59 -0
  52. package/template/components/layout/navigation/nav/navheader/NavHeader.tsx +478 -0
  53. package/template/components/layout/pages/loadingScreen.tsx +102 -0
  54. package/template/components/layout/pages/maintenance/Maintenance.tsx +53 -0
  55. package/template/components/layout/pages/maintenance/maintenance.module.css +163 -0
  56. package/template/components/layout/switch/Switch.module.css +102 -0
  57. package/template/components/layout/switch/Switch.tsx +48 -0
  58. package/template/components/tools/Divider.tsx +11 -0
  59. package/template/components/tools/ProgressiveBlur.tsx +73 -0
  60. package/template/components/tools/ReduceMotionContext.tsx +5 -0
  61. package/template/components/tools/Sinewave.tsx +199 -0
  62. package/template/components/tools/SinewaveProgress.tsx +135 -0
  63. package/template/components/tools/badge/Badge.tsx +28 -0
  64. package/template/components/tools/flubber.d.ts +7 -0
  65. package/template/components/tools/icon/SocialIcons.tsx +88 -0
  66. package/template/components/tools/icon/icon.module.css +0 -0
  67. package/template/components/tools/icon/icon.tsx +125 -0
  68. package/template/components/tools/mobileViewProvider.tsx +58 -0
  69. package/template/components/tools/react-bits/ClickSpark.tsx +177 -0
  70. package/template/components/tools/react-bits/FadeContent.tsx +90 -0
  71. package/template/components/tools/react-bits/GlareHover.tsx +73 -0
  72. package/template/components/tools/react-bits/GradientText/GradientText.css +70 -0
  73. package/template/components/tools/react-bits/GradientText/GradientText.tsx +44 -0
  74. package/template/components/tools/react-bits/Magnet.tsx +118 -0
  75. package/template/components/tools/react-bits/Stepper/Stepper.css +134 -0
  76. package/template/components/tools/react-bits/Stepper/Stepper.tsx +412 -0
  77. package/template/components/tools/ripple/ripple.css +41 -0
  78. package/template/components/tools/ripple/ripple.tsx +53 -0
  79. package/template/components/tools/shape/ShapeLoader.tsx +101 -0
  80. package/template/components/tools/shape/ShapeMorph.tsx +190 -0
  81. package/template/components/tools/shape/ShapePaths.ts +116 -0
  82. package/template/components/tools/switch/Switch.module.css +102 -0
  83. package/template/components/tools/switch/Switch.tsx +48 -0
  84. package/template/components/tools/useBodyScrollLock.tsx +27 -0
  85. package/template/components/tools/useImageColor.ts +47 -0
  86. package/template/components/tools/useNavSheetDrag.tsx +196 -0
  87. package/template/public/fonts/material-symbols/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.woff2 +0 -0
@@ -0,0 +1,478 @@
1
+ "use client";
2
+
3
+ import React, {
4
+ createContext,
5
+ useCallback,
6
+ useContext,
7
+ useEffect,
8
+ useLayoutEffect,
9
+ useId,
10
+ useMemo,
11
+ useRef,
12
+ useState,
13
+ } from "react";
14
+ import { motion, HTMLMotionProps, easeInOut } from "framer-motion";
15
+ import styles from "./NavHeader.module.css";
16
+ import Icon from "@/components/tools/icon/icon";
17
+ import ProgressiveBlur from "@/components/tools/ProgressiveBlur";
18
+ import {
19
+ NavHeaderOverlayContext,
20
+ useNavRail,
21
+ useCollapseOnOutsideInteraction,
22
+ } from "../NavContext";
23
+ import { useBreakpoints } from "@/components/tools/mobileViewProvider";
24
+
25
+ export const HEADER_TRANSITION = {
26
+ type: "spring",
27
+ stiffness: 400,
28
+ damping: 30,
29
+ background: { ease: easeInOut, duration: 0.3 },
30
+ } as const;
31
+
32
+ // ── Types ───────────────────────────────────────────────────────────────────
33
+ export type NavHeaderBodyProps = {
34
+ children?: React.ReactNode;
35
+ style?: React.CSSProperties;
36
+ className?: string;
37
+ /**
38
+ * Route(s) on which the header renders in its expanded (hero) state. Defaults
39
+ * to the home page. Accepts a single path or several; matching is exact for
40
+ * "/" and prefix-based otherwise ("/settings" also covers "/settings/...").
41
+ */
42
+ expandedPaths?: string | string[];
43
+ };
44
+
45
+ export type NavHeaderGroupProps = {
46
+ /** When true, the group stays visible/interactive while a mega menu is open. */
47
+ alwaysVisible?: boolean;
48
+ children?: React.ReactNode;
49
+ style?: React.CSSProperties;
50
+ className?: string;
51
+ };
52
+
53
+ export type NavHeaderTabProps = {
54
+ systemName?: string;
55
+ label: string;
56
+ /** Route pushed when the tab has no mega-menu children. Also used for active match. */
57
+ path?: string;
58
+ /**
59
+ * Extra route(s) that count as "this tab is active" — for section tabs whose
60
+ * sub-pages live elsewhere (e.g. Portfolio active on /projects, /gallery).
61
+ * Exact or prefix match ("/x" matches "/x" and "/x/...").
62
+ */
63
+ match?: string | string[];
64
+ /** Mega-menu content. Having children turns the tab into a menu opener. */
65
+ children?: React.ReactNode;
66
+ onClick?: () => void;
67
+ style?: React.CSSProperties;
68
+ className?: string;
69
+ };
70
+
71
+ /** Header.Logo behaves like a motion.div; logoWrap class + base layout merged in. */
72
+ export type NavHeaderLogoProps = HTMLMotionProps<"div">;
73
+
74
+ // MARK: Header State Context (mega/ collapsed,,,)
75
+ type HeaderStateValue = { collapsed: boolean; megaOpen: boolean };
76
+ const NavHeaderStateContext = createContext<HeaderStateValue>({
77
+ collapsed: true,
78
+ megaOpen: false,
79
+ });
80
+ /** Read header collapse / mega-open state (e.g. to size the logo). */
81
+ export function useNavHeaderState() {
82
+ return useContext(NavHeaderStateContext);
83
+ }
84
+
85
+ // MARK: Tab activation context
86
+ type TabContextValue = {
87
+ activeId: string | null;
88
+ activate: (id: string, content: React.ReactNode) => void;
89
+ close: () => void;
90
+ navigate: (path: string) => void;
91
+ activePath: string;
92
+ };
93
+ const NavHeaderTabContext = createContext<TabContextValue | null>(null);
94
+
95
+ function matchesRoute(matchers: string[], activePath: string): boolean {
96
+ return matchers.some((m) =>
97
+ m === "/"
98
+ ? activePath === "/"
99
+ : activePath === m || activePath.startsWith(m + "/"),
100
+ );
101
+ }
102
+
103
+ //MARK: Header.Logo
104
+ // Carries the logoWrap layout (state-aware) as defaults; any passed style wins.
105
+ // Only one Header.Logo may exist in the whole header body (dev-checked below).
106
+ function NavHeaderLogo({
107
+ className,
108
+ children,
109
+ style,
110
+ ...rest
111
+ }: NavHeaderLogoProps) {
112
+ const { collapsed } = useNavHeaderState();
113
+ return (
114
+ <motion.div
115
+ className={`${styles.logoWrap ?? ""} ${className ?? ""}`}
116
+ style={{
117
+ ...style,
118
+ }}
119
+ {...rest}
120
+ >
121
+ {children}
122
+ </motion.div>
123
+ );
124
+ }
125
+
126
+ //MARK: Header.Tab
127
+ // Renders its own <li className=headerItem>. `children` are NOT rendered here —
128
+ // they're lifted into the mega region by NavHeader when this tab is active.
129
+ //
130
+ // Active rule (only ever ONE active tab):
131
+ // • a mega menu open anywhere → only the opener tab is active (route match
132
+ // is suppressed, so Home loses its active state while Projects is open).
133
+ // • nothing open → active follows the route (path / match).
134
+ function NavHeaderTab({
135
+ systemName,
136
+ label,
137
+ path,
138
+ match,
139
+ children,
140
+ onClick,
141
+ style,
142
+ className,
143
+ }: NavHeaderTabProps) {
144
+ const ctx = useContext(NavHeaderTabContext);
145
+ const id = useId();
146
+ const hasMenu = React.Children.count(children) > 0;
147
+
148
+ const someMegaOpen = ctx?.activeId != null;
149
+ const isOpen = ctx?.activeId === id;
150
+
151
+ const matchers = match
152
+ ? Array.isArray(match)
153
+ ? match
154
+ : [match]
155
+ : path
156
+ ? [path]
157
+ : [];
158
+ const routeActive = !!ctx && matchesRoute(matchers, ctx.activePath);
159
+
160
+ const isActive = someMegaOpen ? isOpen : routeActive;
161
+
162
+ const handleClick = useCallback(() => {
163
+ onClick?.();
164
+ if (hasMenu) {
165
+ // Toggle this tab's mega menu (re-click closes it).
166
+ ctx?.activate(id, children);
167
+ } else {
168
+ // Plain link tab: close any open mega, then route.
169
+ ctx?.close();
170
+ if (path) ctx?.navigate(path);
171
+ }
172
+ }, [onClick, hasMenu, ctx, id, children, path]);
173
+
174
+ return (
175
+ // eslint-disable-next-line jsx-a11y/role-supports-aria-props
176
+ <li
177
+ className={`${styles.headerItem ?? ""} ${isActive ? (styles.active ?? "") : ""} ${className ?? ""}`}
178
+ style={style}
179
+ onClick={handleClick}
180
+ aria-haspopup={hasMenu || undefined}
181
+ aria-expanded={hasMenu ? isOpen : undefined}
182
+ >
183
+ <Icon
184
+ iconBodyStyle={{ margin: hasMenu ? 0 : "0 6px 0 0" }}
185
+ label={label}
186
+ reverse
187
+ systemName={hasMenu ? "keyboard_arrow_down" : undefined}
188
+ />
189
+ </li>
190
+ );
191
+ }
192
+
193
+ // MARK: Header.Group
194
+ // A Header.Logo child is lifted out as a direct flex sibling; every other child
195
+ // (Header.Tab / Button / Drop.Menu) is wrapped in a single <ul className=headerMenu>.
196
+ // !alwaysVisible groups fade + go inert while a mega menu is open.
197
+ function NavHeaderGroup({
198
+ alwaysVisible,
199
+ children,
200
+ style,
201
+ className,
202
+ }: NavHeaderGroupProps) {
203
+ const { megaOpen } = useNavHeaderState();
204
+ const hidden = !alwaysVisible && megaOpen;
205
+
206
+ const { logo, menuChildren } = useMemo(() => {
207
+ let logoEl: React.ReactNode = null;
208
+ const rest: React.ReactNode[] = [];
209
+ React.Children.forEach(children, (child) => {
210
+ if (React.isValidElement(child) && child.type === NavHeaderLogo) {
211
+ logoEl = child;
212
+ } else {
213
+ rest.push(child);
214
+ }
215
+ });
216
+ return { logo: logoEl, menuChildren: rest };
217
+ }, [children]);
218
+
219
+ return (
220
+ <div
221
+ aria-hidden={hidden || undefined}
222
+ className={`${styles.headerGroup ?? ""} ${className ?? ""}`}
223
+ style={{
224
+ display: "flex",
225
+ alignItems: "flex-start",
226
+ opacity: hidden ? 0 : 1,
227
+ pointerEvents: hidden ? "none" : "auto",
228
+ transition:
229
+ "opacity var(--transition-expressive-color), height var(--transition-expressive), width var(--transition-expressive) ",
230
+ ...style,
231
+ }}
232
+ >
233
+ {logo}
234
+ {menuChildren.length > 0 && (
235
+ <ul className={styles.headerMenu ?? ""}>{menuChildren}</ul>
236
+ )}
237
+ </div>
238
+ );
239
+ }
240
+
241
+ //MARK: Nav.Header
242
+ function NavHeaderBody({
243
+ children,
244
+ style,
245
+ className,
246
+ expandedPaths,
247
+ }: NavHeaderBodyProps) {
248
+ const { navigate, activePath } = useNavRail();
249
+ const { isTablet } = useBreakpoints();
250
+
251
+ // Source of truth for the mega menu. id === null means closed.
252
+ const [active, setActive] = useState<{
253
+ id: string | null;
254
+ content: React.ReactNode;
255
+ }>({ id: null, content: null });
256
+
257
+ const megaOpen = active.id != null;
258
+
259
+ const megaContentRef = useRef<HTMLDivElement>(null);
260
+ const [megaHeight, setMegaHeight] = useState(0);
261
+
262
+ useLayoutEffect(() => {
263
+ if (megaOpen && megaContentRef.current) {
264
+ const cap = window.innerHeight * 0.8; // your 50dvh
265
+ setMegaHeight(Math.min(megaContentRef.current.scrollHeight, cap));
266
+ } else {
267
+ setMegaHeight(0);
268
+ }
269
+ }, [megaOpen, active.content]);
270
+
271
+ // Routes that render the header in its expanded (hero) state. Defaults to the
272
+ // home page; pass `expandedPaths` to opt in other routes (single or several).
273
+ const expandMatchers = useMemo(
274
+ () =>
275
+ expandedPaths
276
+ ? Array.isArray(expandedPaths)
277
+ ? expandedPaths
278
+ : [expandedPaths]
279
+ : ["/"],
280
+ [expandedPaths],
281
+ );
282
+
283
+ // Collapse once the page scrolls past 24px; re-expand the hero only within 4px
284
+ // of the very top. The 4–24px range holds the previous state (hysteresis), and
285
+ // scrolling while the mega menu is open latches collapsed — so closing the menu
286
+ // mid-scroll near the top can't flash the hero back before the 24px threshold
287
+ // catches up. Desktop only — the header is hidden on mobile.
288
+ const [scrolled, setScrolled] = useState(false);
289
+ const megaOpenRef = useRef(megaOpen);
290
+ megaOpenRef.current = megaOpen;
291
+ useEffect(() => {
292
+ if (isTablet) return;
293
+ const onScroll = () => {
294
+ const y = window.scrollY;
295
+ setScrolled((prev) =>
296
+ megaOpenRef.current || y > 24 ? true : y < 4 ? false : prev,
297
+ );
298
+ };
299
+ onScroll();
300
+ window.addEventListener("scroll", onScroll, { passive: true });
301
+ return () => window.removeEventListener("scroll", onScroll);
302
+ }, [isTablet]);
303
+
304
+ // An open mega menu always forces the collapsed (compact) header — nothing
305
+ // overrides it. Otherwise the header expands only on an eligible route while
306
+ // still scrolled to the top. Either way the mega region expands directly below
307
+ // the header content in the flex column (see render).
308
+ const collapsed =
309
+ megaOpen || !matchesRoute(expandMatchers, activePath) || scrolled;
310
+
311
+ // Closing only clears the id so `active.content` stays mounted through the
312
+ // collapse animation; the content is nulled in onAnimationComplete once the
313
+ // mega region has finished shrinking to 0 (see render).
314
+ const close = useCallback(
315
+ () => setActive((prev) => ({ ...prev, id: null })),
316
+ [],
317
+ );
318
+ const activate = useCallback((id: string, content: React.ReactNode) => {
319
+ setActive((prev) =>
320
+ prev.id === id ? { ...prev, id: null } : { id, content },
321
+ );
322
+ }, []);
323
+
324
+ // Dev-only: only one Header.Logo allowed in the whole body.
325
+ if (process.env.NODE_ENV !== "production") {
326
+ let logoCount = 0;
327
+ const scan = (nodes: React.ReactNode) =>
328
+ React.Children.forEach(nodes, (c) => {
329
+ if (!React.isValidElement(c)) return;
330
+ if (c.type === NavHeaderLogo) logoCount++;
331
+ const kids = (c.props as { children?: React.ReactNode }).children;
332
+ if (kids) scan(kids);
333
+ });
334
+ scan(children);
335
+ if (logoCount > 1)
336
+ console.warn(
337
+ "Nav.Header: only one Header.Logo may exist in the header body.",
338
+ );
339
+ }
340
+
341
+ const tabContextValue = useMemo<TabContextValue>(
342
+ () => ({ activeId: active.id, activate, close, navigate, activePath }),
343
+ [active.id, activate, close, navigate, activePath],
344
+ );
345
+
346
+ const stateContextValue = useMemo<HeaderStateValue>(
347
+ () => ({ collapsed, megaOpen }),
348
+ [collapsed, megaOpen],
349
+ );
350
+
351
+ // Publish open-state + close handler so Nav.Content's dim (in Nav.tsx) reacts.
352
+ // setOverlay is a stable useState setter → no feedback loop.
353
+ const setOverlay = useContext(NavHeaderOverlayContext)?.setOverlay;
354
+ useEffect(() => {
355
+ setOverlay?.({ isOpen: megaOpen, close });
356
+ }, [megaOpen, close, setOverlay]);
357
+ useEffect(() => () => setOverlay?.(null), [setOverlay]);
358
+
359
+ // Close on scroll / outside pointerdown — desktop only (header is hidden on
360
+ // mobile and must not fight Nav.Bar's listeners).
361
+ const headerRef = useRef<HTMLElement>(null);
362
+ useCollapseOnOutsideInteraction(megaOpen, close, headerRef, !isTablet);
363
+
364
+ return (
365
+ <NavHeaderStateContext.Provider value={stateContextValue}>
366
+ <NavHeaderTabContext.Provider value={tabContextValue}>
367
+ <ProgressiveBlur
368
+ snapTo="top"
369
+ blur={20}
370
+ definition={7}
371
+ style={{
372
+ position: "fixed",
373
+ top: 0,
374
+ left: 0,
375
+ right: 0,
376
+ bottom: "auto",
377
+ minHeight: 108,
378
+ zIndex: 900,
379
+ }}
380
+ />
381
+ <motion.header
382
+ ref={headerRef}
383
+ className={`${styles.headerBody ?? ""} ${megaOpen ? (styles.megaMenu ?? "") : ""} ${className ?? ""}`}
384
+ style={{
385
+ display: "flex",
386
+ flexDirection: "column",
387
+ alignItems: "flex-start",
388
+ position: "fixed",
389
+ width: "100%",
390
+ zIndex: 1010,
391
+ background:
392
+ "linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%)",
393
+ left: 0,
394
+ top: 0,
395
+ ...style,
396
+ }}
397
+ animate={{
398
+ borderRadius: megaOpen ? "0px 0px 36px 36px" : "0px 0px 0px 0px",
399
+ boxShadow: megaOpen
400
+ ? "0 1px 1px rgba(0,0,0,0.1), 0 2px 2px rgba(0,0,0,0.1), 0 4px 4px rgba(0,0,0,0.1)"
401
+ : "0 0 0 rgba(0,0,0,0)",
402
+ }}
403
+ transition={HEADER_TRANSITION}
404
+ >
405
+ <motion.div
406
+ aria-hidden
407
+ initial={false}
408
+ animate={{ opacity: megaOpen ? 1 : 0 }}
409
+ transition={HEADER_TRANSITION.background}
410
+ style={{
411
+ position: "absolute",
412
+ inset: 0,
413
+ zIndex: -1,
414
+ borderRadius: "inherit",
415
+ pointerEvents: "none",
416
+ background: "var(--md-sys-color-surface-container-low)",
417
+ borderBottom: "1px solid var(--globalUIBorderCard)",
418
+ }}
419
+ />
420
+
421
+ {/* Top row: your Header.Group(s) — space-between */}
422
+ <div
423
+ className={styles.headerContent ?? ""}
424
+ style={{
425
+ display: "flex",
426
+ height: "fit-content",
427
+ width: "100%",
428
+ justifyContent: "space-between",
429
+ padding: collapsed ? "12px" : "24px",
430
+ }}
431
+ >
432
+ {children}
433
+ </div>
434
+
435
+ {/* Mega region: the active tab's children render here. */}
436
+ <motion.div
437
+ className={styles.megamenuContent ?? ""}
438
+ style={{
439
+ width: "100%",
440
+ overflow: "hidden",
441
+ paddingLeft: 24,
442
+ paddingRight: 24,
443
+ }}
444
+ initial={false}
445
+ animate={{
446
+ height: megaHeight,
447
+ opacity: megaOpen ? 1 : 0,
448
+ paddingTop: megaOpen ? 24 : 0,
449
+ paddingBottom: megaOpen ? 24 : 0,
450
+ }}
451
+ transition={HEADER_TRANSITION}
452
+ onAnimationComplete={() =>
453
+ setActive((prev) =>
454
+ prev.id === null ? { id: null, content: null } : prev,
455
+ )
456
+ }
457
+ >
458
+ <div ref={megaContentRef}>{active.content}</div>
459
+ </motion.div>
460
+ </motion.header>
461
+ </NavHeaderTabContext.Provider>
462
+ </NavHeaderStateContext.Provider>
463
+ );
464
+ }
465
+
466
+ type NavHeaderComponent = React.FC<NavHeaderBodyProps> & {
467
+ Group: React.FC<NavHeaderGroupProps>;
468
+ Tab: React.FC<NavHeaderTabProps>;
469
+ Logo: React.FC<NavHeaderLogoProps>;
470
+ };
471
+
472
+ const NavHeader = Object.assign(NavHeaderBody, {
473
+ Group: NavHeaderGroup,
474
+ Tab: NavHeaderTab,
475
+ Logo: NavHeaderLogo,
476
+ }) as NavHeaderComponent;
477
+
478
+ export default NavHeader;
@@ -0,0 +1,102 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ import SinewaveProgress from "@/components/tools/SinewaveProgress";
4
+ import { useBreakpoints } from "@/components/tools/mobileViewProvider";
5
+
6
+ export default function LoadingScreen() {
7
+ const { isMobile } = useBreakpoints();
8
+ const [progress, setProgress] = useState(0);
9
+ const [ready, setReady] = useState(false); // real signals resolved
10
+ const [hidden, setHidden] = useState(false); // fade started
11
+ const [gone, setGone] = useState(false); // unmounted
12
+
13
+ // Gate: fonts (incl. Material Symbols) + window load + a minimum on-screen time.
14
+ useEffect(() => {
15
+ const MIN = 900;
16
+ const started = performance.now();
17
+ const windowLoaded =
18
+ document.readyState === "complete"
19
+ ? Promise.resolve()
20
+ : new Promise<void>((res) =>
21
+ window.addEventListener("load", () => res(), { once: true }),
22
+ );
23
+
24
+ let cancelled = false;
25
+ Promise.all([document.fonts.ready, windowLoaded]).then(() => {
26
+ const wait = Math.max(0, MIN - (performance.now() - started));
27
+ setTimeout(() => !cancelled && setReady(true), wait);
28
+ });
29
+ return () => {
30
+ cancelled = true;
31
+ };
32
+ }, []);
33
+
34
+ // Ease to 90 while waiting; snap to 100 once ready.
35
+ useEffect(() => {
36
+ if (ready) {
37
+ setProgress(100);
38
+ return;
39
+ }
40
+ let raf = 0;
41
+ const start = performance.now();
42
+ const tick = (t: number) => {
43
+ const p = Math.min(90, ((t - start) / 1500) * 90);
44
+ setProgress(p);
45
+ if (p < 90) raf = requestAnimationFrame(tick);
46
+ };
47
+ raf = requestAnimationFrame(tick);
48
+ return () => cancelAnimationFrame(raf);
49
+ }, [ready]);
50
+
51
+ if (gone) return null;
52
+
53
+ return (
54
+ <div
55
+ aria-hidden
56
+ onTransitionEnd={(e) => {
57
+ if (hidden && e.propertyName === "opacity") setGone(true);
58
+ }}
59
+ style={{
60
+ position: "fixed",
61
+ inset: 0,
62
+ zIndex: 9999,
63
+ display: "flex",
64
+ flexDirection: "column",
65
+ alignItems: "center",
66
+ justifyContent: "center",
67
+ background: "var(--sys-background)",
68
+ opacity: hidden ? 0 : 1,
69
+ transition: "opacity 600ms ease",
70
+ pointerEvents: hidden ? "none" : "auto",
71
+ gap: 48,
72
+ }}
73
+ >
74
+ {/* space in filename → URL-encode */}
75
+ <h2 style={{ color: "var(--md-sys-color-primary)", fontWeight: 600 }}>
76
+ Company Name
77
+ </h2>
78
+
79
+ <SinewaveProgress
80
+ progress={progress}
81
+ width={174}
82
+ onCollapsed={() => setHidden(true)}
83
+ style={{ marginRight: 18 }}
84
+ />
85
+
86
+ {/* legal footer copy here */}
87
+ <p
88
+ style={{
89
+ color: "var(--md-sys-color-outline-variant)",
90
+ textAlign: "center",
91
+ position: "absolute",
92
+ fontSize: 14,
93
+ bottom: 72,
94
+ padding: isMobile ? 24 : 0,
95
+ }}
96
+ >
97
+ © 2026 <span style={{ color: "red" }}>Company Name</span> — Your company
98
+ Text goes here, <br /> you can add privacy policy and TOA here.
99
+ </p>
100
+ </div>
101
+ );
102
+ }
@@ -0,0 +1,53 @@
1
+ import { Montserrat } from "next/font/google";
2
+ import styles from "./maintenance.module.css";
3
+
4
+ const montserrat = Montserrat({
5
+ subsets: ["latin"],
6
+ variable: "--font-montserrat",
7
+ });
8
+
9
+ export default function Maintenance() {
10
+ return (
11
+ <div className={`${styles.root} ${montserrat.variable}`}>
12
+ {/* background ─ pure CSS, no assets */}
13
+ <div className={styles.bg} aria-hidden="true">
14
+ <span className={`${styles.orb} ${styles.orbA}`} />
15
+ <span className={`${styles.orb} ${styles.orbB}`} />
16
+ <span className={`${styles.orb} ${styles.orbC}`} />
17
+ </div>
18
+ <div className={styles.grain} aria-hidden="true" />
19
+
20
+ <main className={styles.wrap}>
21
+ {/* left ─ copy */}
22
+ <div className={styles.copy}>
23
+ <span className={styles.pill}>
24
+ <span className={styles.dot} /> Be right back
25
+ </span>
26
+ <h1 className={styles.title}>
27
+ Under<br /><em>construction</em>
28
+ </h1>
29
+ <p className={styles.subtitle}>
30
+ I&apos;m tinkering behind the scenes — the site&apos;s getting a
31
+ few upgrades and will be back to normal very soon. Thanks for
32
+ swinging by.
33
+ </p>
34
+ <p className={styles.sig}>— Yamato Zhen</p>
35
+ </div>
36
+
37
+ {/* right ─ glass card + shape */}
38
+ <div className={styles.stage}>
39
+ <div className={styles.card}>
40
+ {/* placeholder shape — swap for your mascot SVG when ready */}
41
+ <div className={styles.blob}>
42
+ <svg className={styles.face} viewBox="0 0 100 64" aria-hidden="true">
43
+ <circle className={styles.eye} cx="34" cy="24" r="7" />
44
+ <circle className={styles.eye} cx="66" cy="24" r="7" />
45
+ <path className={styles.mouth} d="M36 42 Q50 54 64 42" />
46
+ </svg>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </main>
51
+ </div>
52
+ );
53
+ }