@seip/bluebird-js 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,201 +1,201 @@
1
- /**
2
- * Shared application layout for Bluebird.js written in React JSX.
3
- * Provides the global HTML shell, header navigation, aside menu, and footer.
4
- *
5
- * @param {Object} context
6
- * @param {any} context.body - Main content rendered by the view.
7
- * @param {Object} [context.head={}] - Head metadata (title, description, canonical, etc.).
8
- * @param {Object} [context.ctx={}] - Request context ({ req, res, user, locals }).
9
- */
10
- export default function MainLayout({ body, head = {}, ctx = {} }) {
11
- const currentPath = ctx.req?.path || "/";
12
- const user = ctx.user || ctx.req?.user;
13
-
14
- const isActive = (path) =>
15
- currentPath === path
16
- ? "bg-sky-500/15 text-sky-400 border border-sky-500/30 font-semibold"
17
- : "text-slate-400 hover:text-slate-100 hover:bg-slate-800/60";
18
-
19
- const tailwindThemeCss = `
20
- @custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));
21
- @theme {
22
- --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
23
- }
24
- `;
25
-
26
- return (
27
- <html lang="en" className="dark" data-theme="dark">
28
- <head>
29
- <meta charSet="UTF-8" />
30
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
31
- <title>{head.title || "Blue Bird Framework"}</title>
32
- <link rel="canonical" href={head.canonical || "https://seip25.github.io/bluebird-js/"} />
33
- <meta
34
- name="description"
35
- content={
36
- head.description ||
37
- "Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with React SSR and modern JavaScript."
38
- }
39
- />
40
- <meta
41
- name="keywords"
42
- content={
43
- head.keywords ||
44
- "Blue Bird, Express.js, Node.js, React SSR, Partial Rendering, Performance, Nginx, Redis"
45
- }
46
- />
47
- <meta name="author" content="Seip25" />
48
- <link rel="icon" href="/images/favicon.ico" />
49
- <link rel="preconnect" href="https://fonts.googleapis.com" />
50
- <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
51
- <link
52
- href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
53
- rel="stylesheet"
54
- />
55
- <script src="/js/tailwind.js"></script>
56
- <style type="text/tailwindcss">{tailwindThemeCss}</style>
57
- <script src="/js/bluebird-client.js" defer></script>
58
- </head>
59
- <body
60
- data-layout="main"
61
- className="min-h-screen flex flex-col bg-slate-950 text-slate-100 font-sans antialiased selection:bg-sky-500/30"
62
- >
63
- <header className="border-b border-slate-800/80 bg-slate-950/80 backdrop-blur-md sticky top-0 z-30 px-6 py-4">
64
- <nav className="flex items-center justify-between max-w-7xl mx-auto">
65
- <a
66
- href="/"
67
- className="flex items-center gap-2.5 text-slate-100 hover:text-sky-400 transition-colors"
68
- >
69
- <svg
70
- width="28"
71
- height="28"
72
- viewBox="0 0 24 24"
73
- fill="none"
74
- stroke="currentColor"
75
- strokeWidth="2"
76
- strokeLinecap="round"
77
- strokeLinejoin="round"
78
- className="text-sky-400"
79
- >
80
- <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
81
- </svg>
82
- <strong className="text-xl font-bold bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
83
- Blue Bird
84
- </strong>
85
- </a>
86
- <div className="flex items-center gap-3">
87
- <a
88
- href="https://github.com/seip25/bluebird-js"
89
- target="_blank"
90
- className="px-3 py-1.5 rounded-lg border border-slate-700/80 bg-slate-900/60 text-xs font-medium text-slate-300 hover:text-white hover:bg-slate-800 transition-all flex items-center gap-1.5"
91
- >
92
- <span>★</span> GitHub
93
- </a>
94
- </div>
95
- </nav>
96
- </header>
97
-
98
- <main
99
- data-bb-outlet="true"
100
- className="flex-1 max-w-7xl w-full mx-auto px-4 md:px-6 py-8 flex flex-col md:flex-row gap-8"
101
- >
102
- <aside className="w-full md:w-60 shrink-0 flex flex-col gap-1.5 p-4 rounded-2xl border border-slate-800/80 bg-slate-900/40 h-fit">
103
- <h4 className="px-3 py-1 text-xs font-bold uppercase tracking-wider text-slate-400 mb-1">
104
- Menu
105
- </h4>
106
- <a href="/" className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/")}`}>
107
- Home
108
- </a>
109
- <a
110
- href="/about"
111
- className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/about")}`}
112
- >
113
- About
114
- </a>
115
- <a
116
- href="/login"
117
- className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/login")}`}
118
- >
119
- Login
120
- </a>
121
- <a
122
- href="/dashboard"
123
- className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/dashboard")}`}
124
- >
125
- Dashboard
126
- </a>
127
- <div className="my-2 border-t border-slate-800/80"></div>
128
- <a
129
- href="https://seip25.github.io/bluebird-js"
130
- target="_blank"
131
- className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
132
- >
133
- Documentation
134
- </a>
135
- <a
136
- href="https://github.com/seip25/bluebird-js"
137
- target="_blank"
138
- className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
139
- >
140
- GitHub Repository
141
- </a>
142
- {user ? (
143
- <a
144
- href="/logout"
145
- data-no-prefetch="true"
146
- role="button"
147
- className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-red-500/15 text-red-400 border border-red-500/30 hover:bg-red-500/25 transition-colors"
148
- >
149
- Sign Out
150
- </a>
151
- ) : (
152
- <a
153
- href="https://github.com/seip25/bluebird-js"
154
- target="_blank"
155
- role="button"
156
- className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-slate-800 text-slate-200 border border-slate-700 hover:bg-slate-700 hover:text-white transition-colors"
157
- >
158
- Star on GitHub
159
- </a>
160
- )}
161
- </aside>
162
-
163
- <div className="page-content flex-1 min-w-0">{body}</div>
164
- </main>
165
-
166
- <footer className="border-t border-slate-800/80 bg-slate-950 py-8 px-6 mt-auto">
167
- <div className="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-4 text-xs text-slate-400">
168
- <p>
169
- Powered by{" "}
170
- <strong className="bg-gradient-to-r from-sky-400 to-indigo-400 bg-clip-text text-transparent font-semibold">
171
- Blue Bird Framework
172
- </strong>
173
- </p>
174
- <div className="flex items-center gap-4">
175
- <a href="/" className="hover:text-slate-200 transition-colors">
176
- Home
177
- </a>
178
- <a href="/about" className="hover:text-slate-200 transition-colors">
179
- About
180
- </a>
181
- <a href="/login" className="hover:text-slate-200 transition-colors">
182
- Login
183
- </a>
184
- <a href="/dashboard" className="hover:text-slate-200 transition-colors">
185
- Dashboard
186
- </a>
187
- <a
188
- href="https://github.com/seip25/bluebird-js"
189
- target="_blank"
190
- className="hover:text-sky-400 transition-colors"
191
- >
192
- ★ GitHub
193
- </a>
194
- </div>
195
- </div>
196
- </footer>
197
- </body>
198
- </html>
199
- );
200
- }
201
-
1
+ /**
2
+ * Shared application layout for Bluebird.js written in React JSX.
3
+ * Provides the global HTML shell, header navigation, aside menu, and footer.
4
+ *
5
+ * @param {Object} context
6
+ * @param {any} context.body - Main content rendered by the view.
7
+ * @param {Object} [context.head={}] - Head metadata (title, description, canonical, etc.).
8
+ * @param {Object} [context.ctx={}] - Request context ({ req, res, user, locals }).
9
+ */
10
+ export default function MainLayout({ body, head = {}, ctx = {} }) {
11
+ const currentPath = ctx.req?.path || "/";
12
+ const user = ctx.user || ctx.req?.user;
13
+
14
+ const isActive = (path) =>
15
+ currentPath === path
16
+ ? "bg-sky-500/15 text-sky-400 border border-sky-500/30 font-semibold"
17
+ : "text-slate-400 hover:text-slate-100 hover:bg-slate-800/60";
18
+
19
+ const tailwindThemeCss = `
20
+ @custom-variant dark (&:where(.dark, .dark *, [data-theme="dark"], [data-theme="dark"] *));
21
+ @theme {
22
+ --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
23
+ }
24
+ `;
25
+
26
+ return (
27
+ <html lang="en" className="dark" data-theme="dark">
28
+ <head>
29
+ <meta charSet="UTF-8" />
30
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
31
+ <title>{head.title || "Blue Bird Framework"}</title>
32
+ <link rel="canonical" href={head.canonical || "https://seip25.github.io/bluebird-js/"} />
33
+ <meta
34
+ name="description"
35
+ content={
36
+ head.description ||
37
+ "Blue Bird is a fast, structured, and opinionated Express.js framework for developers who want visual elegance and performance with React SSR and modern JavaScript."
38
+ }
39
+ />
40
+ <meta
41
+ name="keywords"
42
+ content={
43
+ head.keywords ||
44
+ "Blue Bird, Express.js, Node.js, React SSR, Partial Rendering, Performance, Nginx, Redis"
45
+ }
46
+ />
47
+ <meta name="author" content="Seip25" />
48
+ <link rel="icon" href="/images/favicon.ico" />
49
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
50
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
51
+ <link
52
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
53
+ rel="stylesheet"
54
+ />
55
+ <script src="/js/tailwind.js"></script>
56
+ <style type="text/tailwindcss">{tailwindThemeCss}</style>
57
+ <script src="/js/bluebird-client.js" defer></script>
58
+ </head>
59
+ <body
60
+ data-layout="main"
61
+ className="min-h-screen flex flex-col bg-slate-950 text-slate-100 font-sans antialiased selection:bg-sky-500/30"
62
+ >
63
+ <header className="border-b border-slate-800/80 bg-slate-950/80 backdrop-blur-md sticky top-0 z-30 px-6 py-4">
64
+ <nav className="flex items-center justify-between max-w-7xl mx-auto">
65
+ <a
66
+ href="/"
67
+ className="flex items-center gap-2.5 text-slate-100 hover:text-sky-400 transition-colors"
68
+ >
69
+ <svg
70
+ width="28"
71
+ height="28"
72
+ viewBox="0 0 24 24"
73
+ fill="none"
74
+ stroke="currentColor"
75
+ strokeWidth="2"
76
+ strokeLinecap="round"
77
+ strokeLinejoin="round"
78
+ className="text-sky-400"
79
+ >
80
+ <path d="M12 19l9 2-9-18-9 18 9-2zm0 0v-8" />
81
+ </svg>
82
+ <strong className="text-xl font-bold bg-gradient-to-r from-sky-400 via-blue-500 to-indigo-400 bg-clip-text text-transparent">
83
+ Blue Bird
84
+ </strong>
85
+ </a>
86
+ <div className="flex items-center gap-3">
87
+ <a
88
+ href="https://github.com/seip25/bluebird-js"
89
+ target="_blank"
90
+ className="px-3 py-1.5 rounded-lg border border-slate-700/80 bg-slate-900/60 text-xs font-medium text-slate-300 hover:text-white hover:bg-slate-800 transition-all flex items-center gap-1.5"
91
+ >
92
+ <span>★</span> GitHub
93
+ </a>
94
+ </div>
95
+ </nav>
96
+ </header>
97
+
98
+ <main
99
+ data-bb-outlet="true"
100
+ className="flex-1 max-w-7xl w-full mx-auto px-4 md:px-6 py-8 flex flex-col md:flex-row gap-8"
101
+ >
102
+ <aside className="w-full md:w-60 shrink-0 flex flex-col gap-1.5 p-4 rounded-2xl border border-slate-800/80 bg-slate-900/40 h-fit">
103
+ <h4 className="px-3 py-1 text-xs font-bold uppercase tracking-wider text-slate-400 mb-1">
104
+ Menu
105
+ </h4>
106
+ <a href="/" className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/")}`}>
107
+ Home
108
+ </a>
109
+ <a
110
+ href="/about"
111
+ className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/about")}`}
112
+ >
113
+ About
114
+ </a>
115
+ <a
116
+ href="/login"
117
+ className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/login")}`}
118
+ >
119
+ Login
120
+ </a>
121
+ <a
122
+ href="/dashboard"
123
+ className={`px-3 py-2 rounded-lg text-sm transition-colors ${isActive("/dashboard")}`}
124
+ >
125
+ Dashboard
126
+ </a>
127
+ <div className="my-2 border-t border-slate-800/80"></div>
128
+ <a
129
+ href="https://seip25.github.io/bluebird-js"
130
+ target="_blank"
131
+ className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
132
+ >
133
+ Documentation
134
+ </a>
135
+ <a
136
+ href="https://github.com/seip25/bluebird-js"
137
+ target="_blank"
138
+ className="px-3 py-2 rounded-lg text-sm text-slate-400 hover:text-slate-100 hover:bg-slate-800/60 transition-colors"
139
+ >
140
+ GitHub Repository
141
+ </a>
142
+ {user ? (
143
+ <a
144
+ href="/logout"
145
+ data-no-prefetch="true"
146
+ role="button"
147
+ className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-red-500/15 text-red-400 border border-red-500/30 hover:bg-red-500/25 transition-colors"
148
+ >
149
+ Sign Out
150
+ </a>
151
+ ) : (
152
+ <a
153
+ href="https://github.com/seip25/bluebird-js"
154
+ target="_blank"
155
+ role="button"
156
+ className="mt-3 px-3 py-2 text-center rounded-lg text-xs font-semibold bg-slate-800 text-slate-200 border border-slate-700 hover:bg-slate-700 hover:text-white transition-colors"
157
+ >
158
+ Star on GitHub
159
+ </a>
160
+ )}
161
+ </aside>
162
+
163
+ <div className="page-content flex-1 min-w-0">{body}</div>
164
+ </main>
165
+
166
+ <footer className="border-t border-slate-800/80 bg-slate-950 py-8 px-6 mt-auto">
167
+ <div className="max-w-7xl mx-auto flex flex-col md:flex-row items-center justify-between gap-4 text-xs text-slate-400">
168
+ <p>
169
+ Powered by{" "}
170
+ <strong className="bg-gradient-to-r from-sky-400 to-indigo-400 bg-clip-text text-transparent font-semibold">
171
+ Blue Bird Framework
172
+ </strong>
173
+ </p>
174
+ <div className="flex items-center gap-4">
175
+ <a href="/" className="hover:text-slate-200 transition-colors">
176
+ Home
177
+ </a>
178
+ <a href="/about" className="hover:text-slate-200 transition-colors">
179
+ About
180
+ </a>
181
+ <a href="/login" className="hover:text-slate-200 transition-colors">
182
+ Login
183
+ </a>
184
+ <a href="/dashboard" className="hover:text-slate-200 transition-colors">
185
+ Dashboard
186
+ </a>
187
+ <a
188
+ href="https://github.com/seip25/bluebird-js"
189
+ target="_blank"
190
+ className="hover:text-sky-400 transition-colors"
191
+ >
192
+ ★ GitHub
193
+ </a>
194
+ </div>
195
+ </div>
196
+ </footer>
197
+ </body>
198
+ </html>
199
+ );
200
+ }
201
+