@checkstack/ui 1.4.0 → 1.5.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/CHANGELOG.md +11 -0
- package/package.json +1 -1
- package/src/components/NotFound.tsx +154 -0
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @checkstack/ui
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3da7582: Fix favicon not loading in production container and add NotFound page
|
|
8
|
+
|
|
9
|
+
- **Backend**: Fix static file serving so root-level files like `/favicon.svg` are served from the dist directory before the SPA fallback catches them
|
|
10
|
+
- **UI**: Add `NotFound` component with stacked-checkmark logo, physics-inspired falling "4" animation, and low-power device fallback
|
|
11
|
+
- **Frontend**: Add catch-all `*` route to display the NotFound page for unmatched routes, and add the Checkstack logo to the navbar
|
|
12
|
+
- **Favicon**: Redesign with stacked checkmarks in the brand purple/indigo palette
|
|
13
|
+
|
|
3
14
|
## 1.4.0
|
|
4
15
|
|
|
5
16
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import React, { useState, useEffect, useMemo } from "react";
|
|
2
|
+
import { useNavigate } from "react-router-dom";
|
|
3
|
+
import { ArrowLeft } from "lucide-react";
|
|
4
|
+
import { cn } from "../utils";
|
|
5
|
+
import { usePerformance } from "./PerformanceProvider";
|
|
6
|
+
|
|
7
|
+
/** Rotating tech-insider quips shown on the 404 page. */
|
|
8
|
+
const NOT_FOUND_QUIPS = [
|
|
9
|
+
// DevOps / infra humor
|
|
10
|
+
"Looks like this route didn't pass the health check.",
|
|
11
|
+
"This endpoint has an uptime of exactly 0%.",
|
|
12
|
+
"We checked the stack. This page isn't in it.",
|
|
13
|
+
"Our monitoring confirms: this page is down. Permanently.",
|
|
14
|
+
"This page was last seen in a git stash from 2019.",
|
|
15
|
+
String.raw`Incident report: page not found. Severity: ¯\_(ツ)_/¯`,
|
|
16
|
+
"DNS resolved. TCP connected. Page? Gone.",
|
|
17
|
+
"kubectl get page — error: resource not found.",
|
|
18
|
+
"This page is in a pending state. It may never resolve.",
|
|
19
|
+
"The deployment was successful. The page was not.",
|
|
20
|
+
"This route has been deprecated without notice.",
|
|
21
|
+
"Alert triggered: page_exists = false.",
|
|
22
|
+
// Programming jokes
|
|
23
|
+
"The page you're looking for is in another castle.",
|
|
24
|
+
"404: The page was found, then garbage collected.",
|
|
25
|
+
"Segfault at 0x00000404.",
|
|
26
|
+
"The page exists in the dev environment, we promise.",
|
|
27
|
+
"Works on my machine ™",
|
|
28
|
+
"Have you tried turning the URL off and on again?",
|
|
29
|
+
"This page is not a bug, it's an undocumented feature.",
|
|
30
|
+
"Error 404: Coffee not found. Page also missing.",
|
|
31
|
+
"git log --all --oneline | grep 'this page' → no results.",
|
|
32
|
+
// Pop culture references
|
|
33
|
+
"These aren't the pages you're looking for. — Obi-Wan Kenobi",
|
|
34
|
+
"I am inevitable. This page is not. — Thanos",
|
|
35
|
+
"One does not simply navigate to a page that doesn't exist.",
|
|
36
|
+
"In case I don't see ya: good afternoon, good evening, and good 404.",
|
|
37
|
+
"It's a feature, not a bug. — Every PM ever",
|
|
38
|
+
"Ah yes, the 404. The page that lived… briefly.",
|
|
39
|
+
"I've seen things you people wouldn't believe. But not this page.",
|
|
40
|
+
"To 404, or not to 404. That is the question.",
|
|
41
|
+
"Houston, we have a 404.",
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
export const NotFound: React.FC<{
|
|
45
|
+
message?: string;
|
|
46
|
+
className?: string;
|
|
47
|
+
}> = ({ message, className }) => {
|
|
48
|
+
const { isLowPower } = usePerformance();
|
|
49
|
+
const navigate = useNavigate();
|
|
50
|
+
const [hasFallen, setHasFallen] = useState(false);
|
|
51
|
+
|
|
52
|
+
const quip = useMemo(
|
|
53
|
+
() =>
|
|
54
|
+
message ??
|
|
55
|
+
NOT_FOUND_QUIPS[Math.floor(Math.random() * NOT_FOUND_QUIPS.length)],
|
|
56
|
+
[message],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (isLowPower) return;
|
|
61
|
+
const timer = setTimeout(() => setHasFallen(true), 1800);
|
|
62
|
+
return () => clearTimeout(timer);
|
|
63
|
+
}, [isLowPower]);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div
|
|
67
|
+
className={cn(
|
|
68
|
+
"flex flex-col items-center justify-center min-h-[60vh] p-8 select-none overflow-hidden",
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
>
|
|
72
|
+
{/* Physics keyframes for the falling "4" */}
|
|
73
|
+
{!isLowPower && (
|
|
74
|
+
<style>{`
|
|
75
|
+
@keyframes wobble-fall {
|
|
76
|
+
0% { transform: rotate(0deg) translateY(0); }
|
|
77
|
+
15% { transform: rotate(-2deg) translateY(0); }
|
|
78
|
+
30% { transform: rotate(3deg) translateY(0); }
|
|
79
|
+
42% { transform: rotate(6deg) translateY(2px); }
|
|
80
|
+
65% { transform: rotate(55deg) translateY(30px); }
|
|
81
|
+
78% { transform: rotate(80deg) translateY(50px); }
|
|
82
|
+
86% { transform: rotate(72deg) translateY(45px); }
|
|
83
|
+
93% { transform: rotate(78deg) translateY(52px); }
|
|
84
|
+
100% { transform: rotate(76deg) translateY(50px); opacity: 0.25; }
|
|
85
|
+
}
|
|
86
|
+
`}</style>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{/* 404 display */}
|
|
90
|
+
<div className="relative mb-8">
|
|
91
|
+
{/* Glow effect */}
|
|
92
|
+
{!isLowPower && (
|
|
93
|
+
<div
|
|
94
|
+
className="absolute inset-0 blur-3xl opacity-15 bg-primary rounded-full scale-150"
|
|
95
|
+
aria-hidden="true"
|
|
96
|
+
/>
|
|
97
|
+
)}
|
|
98
|
+
<div className="relative grid grid-cols-[1fr_auto_1fr] items-center">
|
|
99
|
+
<span className="text-center text-[8rem] md:text-[12rem] font-black leading-none tabular-nums text-muted-foreground/50">
|
|
100
|
+
4
|
|
101
|
+
</span>
|
|
102
|
+
{/* Checkstack logo as the "0" */}
|
|
103
|
+
<div className="flex items-center justify-center w-28 h-28 md:w-44 md:h-44 mx-1 md:mx-3">
|
|
104
|
+
<img
|
|
105
|
+
src="/favicon.svg"
|
|
106
|
+
alt=""
|
|
107
|
+
aria-hidden="true"
|
|
108
|
+
className="w-full h-full"
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
<span
|
|
112
|
+
className="text-center text-[8rem] md:text-[12rem] font-black leading-none tabular-nums text-muted-foreground/50"
|
|
113
|
+
style={
|
|
114
|
+
!isLowPower && hasFallen
|
|
115
|
+
? {
|
|
116
|
+
animation:
|
|
117
|
+
"wobble-fall 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards",
|
|
118
|
+
transformOrigin: "bottom left",
|
|
119
|
+
}
|
|
120
|
+
: undefined
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
4
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
{/* Text content */}
|
|
129
|
+
<div className="text-center space-y-3 max-w-md">
|
|
130
|
+
<h2 className="text-xl md:text-2xl font-semibold text-foreground">
|
|
131
|
+
Route not found
|
|
132
|
+
</h2>
|
|
133
|
+
<p className="text-sm md:text-base text-muted-foreground leading-relaxed">
|
|
134
|
+
{quip}
|
|
135
|
+
</p>
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
{/* Action */}
|
|
139
|
+
<button
|
|
140
|
+
type="button"
|
|
141
|
+
onClick={() => navigate("/")}
|
|
142
|
+
className={cn(
|
|
143
|
+
"mt-8 inline-flex items-center gap-2 px-5 py-2.5 rounded-lg text-sm font-medium cursor-pointer",
|
|
144
|
+
"bg-primary/10 text-primary border border-primary/20",
|
|
145
|
+
"hover:bg-primary/20 hover:border-primary/30",
|
|
146
|
+
!isLowPower && "transition-colors duration-200",
|
|
147
|
+
)}
|
|
148
|
+
>
|
|
149
|
+
<ArrowLeft className="w-4 h-4" />
|
|
150
|
+
Back to Dashboard
|
|
151
|
+
</button>
|
|
152
|
+
</div>
|
|
153
|
+
);
|
|
154
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./components/Card";
|
|
|
4
4
|
export * from "./components/Label";
|
|
5
5
|
export * from "./components/NavItem";
|
|
6
6
|
export * from "./components/AccessDenied";
|
|
7
|
+
export * from "./components/NotFound";
|
|
7
8
|
export * from "./components/AccessGate";
|
|
8
9
|
export * from "./components/SectionHeader";
|
|
9
10
|
export * from "./components/StatusCard";
|