@orion-studios/payload-admin-components 0.2.0-beta.0 → 0.2.0-beta.2

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.
@@ -0,0 +1,1128 @@
1
+ 'use client';
2
+ "use client";
3
+
4
+ // src/components/Logo.tsx
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ function Logo() {
7
+ return /* @__PURE__ */ jsxs(
8
+ "div",
9
+ {
10
+ style: {
11
+ display: "flex",
12
+ alignItems: "center",
13
+ gap: 10,
14
+ padding: "4px 0",
15
+ textDecoration: "none",
16
+ transition: "opacity 0.2s ease"
17
+ },
18
+ children: [
19
+ /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ style: {
23
+ width: 32,
24
+ height: 32,
25
+ borderRadius: "var(--admin-radius-sm, 6px)",
26
+ background: "var(--admin-accent, #3b82f6)",
27
+ display: "flex",
28
+ alignItems: "center",
29
+ justifyContent: "center",
30
+ flexShrink: 0
31
+ },
32
+ children: /* @__PURE__ */ jsxs("svg", { width: 18, height: 18, viewBox: "0 0 24 24", fill: "none", stroke: "white", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
33
+ /* @__PURE__ */ jsx("polygon", { points: "12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2" }),
34
+ /* @__PURE__ */ jsx("line", { x1: "12", y1: "22", x2: "12", y2: "15.5" }),
35
+ /* @__PURE__ */ jsx("polyline", { points: "22 8.5 12 15.5 2 8.5" })
36
+ ] })
37
+ }
38
+ ),
39
+ /* @__PURE__ */ jsx(
40
+ "span",
41
+ {
42
+ style: {
43
+ fontSize: 15,
44
+ fontWeight: 700,
45
+ color: "var(--admin-text, #111827)",
46
+ letterSpacing: "-0.01em"
47
+ },
48
+ children: "Orion CMS"
49
+ }
50
+ )
51
+ ]
52
+ }
53
+ );
54
+ }
55
+
56
+ // src/components/Icon.tsx
57
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
58
+ function Icon() {
59
+ return /* @__PURE__ */ jsxs2("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
60
+ /* @__PURE__ */ jsx2("rect", { width: "32", height: "32", rx: "8", fill: "var(--admin-accent, #3b82f6)" }),
61
+ /* @__PURE__ */ jsxs2("g", { transform: "translate(4, 4)", children: [
62
+ /* @__PURE__ */ jsx2("polygon", { points: "12 2 22 8.5 22 15.5 12 22 2 15.5 2 8.5 12 2", fill: "none", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }),
63
+ /* @__PURE__ */ jsx2("line", { x1: "12", y1: "22", x2: "12", y2: "15.5", stroke: "white", strokeWidth: "1.5" }),
64
+ /* @__PURE__ */ jsx2("polyline", { points: "22 8.5 12 15.5 2 8.5", fill: "none", stroke: "white", strokeWidth: "1.5" })
65
+ ] })
66
+ ] });
67
+ }
68
+
69
+ // src/components/Dashboard.tsx
70
+ import { useEffect as useEffect4, useState as useState3 } from "react";
71
+
72
+ // src/components/ThemeSwitcher.tsx
73
+ import { useEffect as useEffect2 } from "react";
74
+
75
+ // src/hooks/useTheme.ts
76
+ import { useCallback, useEffect, useRef, useState } from "react";
77
+ var STORAGE_KEY = "orion-admin-theme";
78
+ var DEFAULT_THEME = "light";
79
+ function applyTheme(theme) {
80
+ document.documentElement.setAttribute("data-theme", theme);
81
+ }
82
+ function getCachedTheme() {
83
+ try {
84
+ const stored = localStorage.getItem(STORAGE_KEY);
85
+ if (stored && ["light", "dark", "brand-light", "brand-dark"].includes(stored)) {
86
+ return stored;
87
+ }
88
+ } catch {
89
+ }
90
+ return null;
91
+ }
92
+ function cacheTheme(theme) {
93
+ try {
94
+ localStorage.setItem(STORAGE_KEY, theme);
95
+ } catch {
96
+ }
97
+ }
98
+ function useTheme() {
99
+ const [theme, setThemeState] = useState(() => {
100
+ if (typeof window === "undefined") return DEFAULT_THEME;
101
+ return getCachedTheme() || DEFAULT_THEME;
102
+ });
103
+ const [isLoading, setIsLoading] = useState(true);
104
+ const debounceRef = useRef(null);
105
+ const userIdRef = useRef(null);
106
+ useEffect(() => {
107
+ const cached = getCachedTheme();
108
+ if (cached) {
109
+ applyTheme(cached);
110
+ setThemeState(cached);
111
+ } else {
112
+ applyTheme(DEFAULT_THEME);
113
+ }
114
+ fetch("/api/users/me", { credentials: "include" }).then((res) => res.json()).then((data) => {
115
+ const user = data?.user || data;
116
+ if (user?.id) {
117
+ userIdRef.current = user.id;
118
+ }
119
+ if (user?.themePreference) {
120
+ const dbTheme = user.themePreference;
121
+ setThemeState(dbTheme);
122
+ applyTheme(dbTheme);
123
+ cacheTheme(dbTheme);
124
+ }
125
+ }).catch(() => {
126
+ }).finally(() => {
127
+ setIsLoading(false);
128
+ });
129
+ }, []);
130
+ const setTheme = useCallback((newTheme) => {
131
+ setThemeState(newTheme);
132
+ applyTheme(newTheme);
133
+ cacheTheme(newTheme);
134
+ if (debounceRef.current) {
135
+ clearTimeout(debounceRef.current);
136
+ }
137
+ debounceRef.current = setTimeout(() => {
138
+ const userId = userIdRef.current;
139
+ if (!userId) return;
140
+ fetch(`/api/users/${userId}`, {
141
+ method: "PATCH",
142
+ credentials: "include",
143
+ headers: { "Content-Type": "application/json" },
144
+ body: JSON.stringify({ themePreference: newTheme })
145
+ }).catch(() => {
146
+ });
147
+ }, 300);
148
+ }, []);
149
+ const isDark = theme === "dark" || theme === "brand-dark";
150
+ const isBrand = theme === "brand-light" || theme === "brand-dark";
151
+ const toggleDarkMode = useCallback(() => {
152
+ if (isBrand) {
153
+ setTheme(isDark ? "brand-light" : "brand-dark");
154
+ } else {
155
+ setTheme(isDark ? "light" : "dark");
156
+ }
157
+ }, [isDark, isBrand, setTheme]);
158
+ const toggleBrandMode = useCallback(() => {
159
+ if (isBrand) {
160
+ setTheme(isDark ? "dark" : "light");
161
+ } else {
162
+ setTheme(isDark ? "brand-dark" : "brand-light");
163
+ }
164
+ }, [isDark, isBrand, setTheme]);
165
+ return {
166
+ theme,
167
+ setTheme,
168
+ isDark,
169
+ isBrand,
170
+ isLoading,
171
+ toggleDarkMode,
172
+ toggleBrandMode
173
+ };
174
+ }
175
+
176
+ // src/components/ThemeSwitcher.tsx
177
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
178
+ var iconSize = 16;
179
+ function SunIcon() {
180
+ return /* @__PURE__ */ jsxs3("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
181
+ /* @__PURE__ */ jsx3("circle", { cx: "12", cy: "12", r: "5" }),
182
+ /* @__PURE__ */ jsx3("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
183
+ /* @__PURE__ */ jsx3("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
184
+ /* @__PURE__ */ jsx3("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
185
+ /* @__PURE__ */ jsx3("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
186
+ /* @__PURE__ */ jsx3("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
187
+ /* @__PURE__ */ jsx3("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
188
+ /* @__PURE__ */ jsx3("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
189
+ /* @__PURE__ */ jsx3("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
190
+ ] });
191
+ }
192
+ function MoonIcon() {
193
+ return /* @__PURE__ */ jsx3("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx3("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
194
+ }
195
+ function PaletteIcon() {
196
+ return /* @__PURE__ */ jsxs3("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
197
+ /* @__PURE__ */ jsx3("circle", { cx: "13.5", cy: "6.5", r: "0.5", fill: "currentColor" }),
198
+ /* @__PURE__ */ jsx3("circle", { cx: "17.5", cy: "10.5", r: "0.5", fill: "currentColor" }),
199
+ /* @__PURE__ */ jsx3("circle", { cx: "8.5", cy: "7.5", r: "0.5", fill: "currentColor" }),
200
+ /* @__PURE__ */ jsx3("circle", { cx: "6.5", cy: "12", r: "0.5", fill: "currentColor" }),
201
+ /* @__PURE__ */ jsx3("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
202
+ ] });
203
+ }
204
+ var buttonBase = {
205
+ display: "flex",
206
+ alignItems: "center",
207
+ justifyContent: "center",
208
+ width: 32,
209
+ height: 32,
210
+ borderRadius: "var(--admin-radius-sm)",
211
+ border: "1px solid var(--admin-border)",
212
+ background: "var(--admin-surface)",
213
+ color: "var(--admin-text-secondary)",
214
+ cursor: "pointer",
215
+ transition: "all 0.2s ease",
216
+ padding: 0
217
+ };
218
+ var buttonActive = {
219
+ ...buttonBase,
220
+ background: "var(--admin-accent-subtle)",
221
+ borderColor: "var(--admin-accent)",
222
+ color: "var(--admin-accent)"
223
+ };
224
+ function ThemeSwitcher() {
225
+ const { isDark, isBrand, toggleDarkMode, toggleBrandMode } = useTheme();
226
+ return /* @__PURE__ */ jsxs3(
227
+ "div",
228
+ {
229
+ style: {
230
+ display: "flex",
231
+ alignItems: "center",
232
+ gap: 6,
233
+ padding: "8px 12px"
234
+ },
235
+ children: [
236
+ /* @__PURE__ */ jsx3(
237
+ "button",
238
+ {
239
+ type: "button",
240
+ onClick: toggleDarkMode,
241
+ style: isDark ? buttonActive : buttonBase,
242
+ title: isDark ? "Switch to light mode" : "Switch to dark mode",
243
+ "aria-label": isDark ? "Switch to light mode" : "Switch to dark mode",
244
+ children: isDark ? /* @__PURE__ */ jsx3(MoonIcon, {}) : /* @__PURE__ */ jsx3(SunIcon, {})
245
+ }
246
+ ),
247
+ /* @__PURE__ */ jsx3(
248
+ "button",
249
+ {
250
+ type: "button",
251
+ onClick: toggleBrandMode,
252
+ style: isBrand ? buttonActive : buttonBase,
253
+ title: isBrand ? "Switch to standard colors" : "Switch to brand colors",
254
+ "aria-label": isBrand ? "Switch to standard colors" : "Switch to brand colors",
255
+ children: /* @__PURE__ */ jsx3(PaletteIcon, {})
256
+ }
257
+ )
258
+ ]
259
+ }
260
+ );
261
+ }
262
+ function ThemeProvider({ children }) {
263
+ useEffect2(() => {
264
+ try {
265
+ const stored = localStorage.getItem("orion-admin-theme");
266
+ if (stored && ["light", "dark", "brand-light", "brand-dark"].includes(stored)) {
267
+ document.documentElement.setAttribute("data-theme", stored);
268
+ } else {
269
+ document.documentElement.setAttribute("data-theme", "light");
270
+ }
271
+ } catch {
272
+ document.documentElement.setAttribute("data-theme", "light");
273
+ }
274
+ }, []);
275
+ return /* @__PURE__ */ jsx3(Fragment, { children });
276
+ }
277
+
278
+ // src/components/HelpTooltip.tsx
279
+ import { useCallback as useCallback2, useEffect as useEffect3, useRef as useRef2, useState as useState2 } from "react";
280
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
281
+ function HelpTooltip({
282
+ content,
283
+ position = "top"
284
+ }) {
285
+ const [isVisible, setIsVisible] = useState2(false);
286
+ const triggerRef = useRef2(null);
287
+ const tooltipRef = useRef2(null);
288
+ const tooltipId = useRef2(`tooltip-${Math.random().toString(36).slice(2, 9)}`);
289
+ const show = useCallback2(() => setIsVisible(true), []);
290
+ const hide = useCallback2(() => setIsVisible(false), []);
291
+ const toggle = useCallback2(() => setIsVisible((v) => !v), []);
292
+ useEffect3(() => {
293
+ if (!isVisible) return;
294
+ const handleKeyDown = (e) => {
295
+ if (e.key === "Escape") setIsVisible(false);
296
+ };
297
+ document.addEventListener("keydown", handleKeyDown);
298
+ return () => document.removeEventListener("keydown", handleKeyDown);
299
+ }, [isVisible]);
300
+ useEffect3(() => {
301
+ if (!isVisible) return;
302
+ const handleClick = (e) => {
303
+ if (triggerRef.current && !triggerRef.current.contains(e.target) && tooltipRef.current && !tooltipRef.current.contains(e.target)) {
304
+ setIsVisible(false);
305
+ }
306
+ };
307
+ document.addEventListener("mousedown", handleClick);
308
+ return () => document.removeEventListener("mousedown", handleClick);
309
+ }, [isVisible]);
310
+ const positionStyles = {
311
+ top: { bottom: "100%", left: "50%", transform: "translateX(-50%)", marginBottom: 8 },
312
+ bottom: { top: "100%", left: "50%", transform: "translateX(-50%)", marginTop: 8 },
313
+ left: { right: "100%", top: "50%", transform: "translateY(-50%)", marginRight: 8 },
314
+ right: { left: "100%", top: "50%", transform: "translateY(-50%)", marginLeft: 8 }
315
+ };
316
+ return /* @__PURE__ */ jsxs4("span", { style: { position: "relative", display: "inline-flex", verticalAlign: "middle", marginLeft: 6 }, children: [
317
+ /* @__PURE__ */ jsx4(
318
+ "button",
319
+ {
320
+ ref: triggerRef,
321
+ type: "button",
322
+ onClick: toggle,
323
+ onMouseEnter: show,
324
+ onMouseLeave: hide,
325
+ onFocus: show,
326
+ onBlur: hide,
327
+ "aria-describedby": isVisible ? tooltipId.current : void 0,
328
+ style: {
329
+ display: "inline-flex",
330
+ alignItems: "center",
331
+ justifyContent: "center",
332
+ width: 18,
333
+ height: 18,
334
+ borderRadius: "50%",
335
+ border: "1.5px solid var(--admin-text-muted)",
336
+ background: "transparent",
337
+ color: "var(--admin-text-muted)",
338
+ fontSize: 11,
339
+ fontWeight: 700,
340
+ cursor: "help",
341
+ padding: 0,
342
+ lineHeight: 1,
343
+ transition: "all 0.15s ease",
344
+ ...isVisible ? {
345
+ borderColor: "var(--admin-accent)",
346
+ color: "var(--admin-accent)",
347
+ background: "var(--admin-accent-subtle)"
348
+ } : {}
349
+ },
350
+ children: "?"
351
+ }
352
+ ),
353
+ isVisible && /* @__PURE__ */ jsx4(
354
+ "div",
355
+ {
356
+ ref: tooltipRef,
357
+ id: tooltipId.current,
358
+ role: "tooltip",
359
+ style: {
360
+ position: "absolute",
361
+ ...positionStyles[position],
362
+ background: "var(--admin-tooltip-bg)",
363
+ color: "var(--admin-tooltip-text)",
364
+ padding: "8px 12px",
365
+ borderRadius: "var(--admin-radius-sm)",
366
+ fontSize: 12,
367
+ lineHeight: 1.5,
368
+ maxWidth: 260,
369
+ minWidth: 160,
370
+ whiteSpace: "normal",
371
+ zIndex: 9999,
372
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
373
+ pointerEvents: "auto",
374
+ animation: "tooltipFadeIn 0.15s ease"
375
+ },
376
+ children: content
377
+ }
378
+ )
379
+ ] });
380
+ }
381
+
382
+ // src/components/StatusBadge.tsx
383
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
384
+ var statusConfig = {
385
+ draft: { label: "Draft" },
386
+ published: { label: "Published" },
387
+ changed: { label: "Changed" }
388
+ };
389
+ function StatusBadge({
390
+ status,
391
+ size = "md"
392
+ }) {
393
+ const config = statusConfig[status];
394
+ const isSm = size === "sm";
395
+ return /* @__PURE__ */ jsxs5(
396
+ "span",
397
+ {
398
+ style: {
399
+ display: "inline-flex",
400
+ alignItems: "center",
401
+ gap: 4,
402
+ padding: isSm ? "2px 8px" : "3px 10px",
403
+ borderRadius: 20,
404
+ fontSize: isSm ? 11 : 12,
405
+ fontWeight: 600,
406
+ lineHeight: 1.4,
407
+ background: `var(--admin-badge-${status}-bg)`,
408
+ color: `var(--admin-badge-${status}-text)`,
409
+ whiteSpace: "nowrap"
410
+ },
411
+ children: [
412
+ /* @__PURE__ */ jsx5(
413
+ "span",
414
+ {
415
+ style: {
416
+ width: isSm ? 5 : 6,
417
+ height: isSm ? 5 : 6,
418
+ borderRadius: "50%",
419
+ background: "currentColor",
420
+ flexShrink: 0
421
+ }
422
+ }
423
+ ),
424
+ config.label
425
+ ]
426
+ }
427
+ );
428
+ }
429
+
430
+ // src/components/Dashboard.tsx
431
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
432
+ function PagesIcon({ size = 24 }) {
433
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
434
+ /* @__PURE__ */ jsx6("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
435
+ /* @__PURE__ */ jsx6("polyline", { points: "14 2 14 8 20 8" }),
436
+ /* @__PURE__ */ jsx6("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
437
+ /* @__PURE__ */ jsx6("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
438
+ /* @__PURE__ */ jsx6("polyline", { points: "10 9 9 9 8 9" })
439
+ ] });
440
+ }
441
+ function MediaIcon({ size = 24 }) {
442
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
443
+ /* @__PURE__ */ jsx6("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
444
+ /* @__PURE__ */ jsx6("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
445
+ /* @__PURE__ */ jsx6("polyline", { points: "21 15 16 10 5 21" })
446
+ ] });
447
+ }
448
+ function SettingsIcon({ size = 24 }) {
449
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
450
+ /* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "3" }),
451
+ /* @__PURE__ */ jsx6("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
452
+ ] });
453
+ }
454
+ function LayoutIcon({ size = 24 }) {
455
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
456
+ /* @__PURE__ */ jsx6("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
457
+ /* @__PURE__ */ jsx6("line", { x1: "3", y1: "9", x2: "21", y2: "9" }),
458
+ /* @__PURE__ */ jsx6("line", { x1: "3", y1: "15", x2: "21", y2: "15" })
459
+ ] });
460
+ }
461
+ function PlusIcon({ size = 16 }) {
462
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
463
+ /* @__PURE__ */ jsx6("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
464
+ /* @__PURE__ */ jsx6("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
465
+ ] });
466
+ }
467
+ function ClockIcon({ size = 14 }) {
468
+ return /* @__PURE__ */ jsxs6("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
469
+ /* @__PURE__ */ jsx6("circle", { cx: "12", cy: "12", r: "10" }),
470
+ /* @__PURE__ */ jsx6("polyline", { points: "12 6 12 12 16 14" })
471
+ ] });
472
+ }
473
+ function getGreeting() {
474
+ const hour = (/* @__PURE__ */ new Date()).getHours();
475
+ if (hour < 12) return "Good morning";
476
+ if (hour < 17) return "Good afternoon";
477
+ return "Good evening";
478
+ }
479
+ function formatRelativeTime(dateStr) {
480
+ const date = new Date(dateStr);
481
+ const now = /* @__PURE__ */ new Date();
482
+ const diffMs = now.getTime() - date.getTime();
483
+ const diffMins = Math.floor(diffMs / 6e4);
484
+ const diffHours = Math.floor(diffMs / 36e5);
485
+ const diffDays = Math.floor(diffMs / 864e5);
486
+ if (diffMins < 1) return "Just now";
487
+ if (diffMins < 60) return `${diffMins}m ago`;
488
+ if (diffHours < 24) return `${diffHours}h ago`;
489
+ if (diffDays < 7) return `${diffDays}d ago`;
490
+ return date.toLocaleDateString();
491
+ }
492
+ function Dashboard() {
493
+ const [userName, setUserName] = useState3("");
494
+ const [recentPages, setRecentPages] = useState3([]);
495
+ const [pageCount, setPageCount] = useState3(null);
496
+ const [mediaCount, setMediaCount] = useState3(null);
497
+ useEffect4(() => {
498
+ fetch("/api/users/me", { credentials: "include" }).then((res) => res.json()).then((data) => {
499
+ const user = data?.user || data;
500
+ setUserName(user?.fullName || user?.email?.split("@")[0] || "");
501
+ }).catch(() => {
502
+ });
503
+ fetch("/api/pages?limit=5&sort=-updatedAt", { credentials: "include" }).then((res) => res.json()).then((data) => {
504
+ setRecentPages(data?.docs || []);
505
+ setPageCount(data?.totalDocs ?? null);
506
+ }).catch(() => {
507
+ });
508
+ fetch("/api/media?limit=0", { credentials: "include" }).then((res) => res.json()).then((data) => {
509
+ setMediaCount(data?.totalDocs ?? null);
510
+ }).catch(() => {
511
+ });
512
+ }, []);
513
+ return /* @__PURE__ */ jsxs6("div", { style: { padding: "32px", maxWidth: 1200, margin: "0 auto" }, children: [
514
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: 32 }, children: [
515
+ /* @__PURE__ */ jsxs6("div", { children: [
516
+ /* @__PURE__ */ jsxs6("h1", { style: { fontSize: 28, fontWeight: 700, color: "var(--admin-text)", margin: "0 0 6px" }, children: [
517
+ getGreeting(),
518
+ userName ? `, ${userName}` : ""
519
+ ] }),
520
+ /* @__PURE__ */ jsx6("p", { style: { fontSize: 15, color: "var(--admin-text-muted)", margin: 0 }, children: "Manage your website content and settings from here." })
521
+ ] }),
522
+ /* @__PURE__ */ jsx6(ThemeSwitcher, {})
523
+ ] }),
524
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 10, marginBottom: 32, flexWrap: "wrap" }, children: [
525
+ /* @__PURE__ */ jsx6(QuickAction, { href: "/admin/collections/pages/create", icon: /* @__PURE__ */ jsx6(PlusIcon, {}), label: "New Page" }),
526
+ /* @__PURE__ */ jsx6(QuickAction, { href: "/admin/collections/media/create", icon: /* @__PURE__ */ jsx6(PlusIcon, {}), label: "Upload Media" }),
527
+ /* @__PURE__ */ jsx6(QuickAction, { href: "/admin/globals/header", icon: /* @__PURE__ */ jsx6(LayoutIcon, { size: 16 }), label: "Edit Navigation" }),
528
+ /* @__PURE__ */ jsx6(QuickAction, { href: "/admin/globals/site-settings", icon: /* @__PURE__ */ jsx6(SettingsIcon, { size: 16 }), label: "Website Settings" })
529
+ ] }),
530
+ /* @__PURE__ */ jsxs6(
531
+ "div",
532
+ {
533
+ style: {
534
+ display: "grid",
535
+ gap: 20,
536
+ gridTemplateColumns: "repeat(auto-fit, minmax(300px, 1fr))",
537
+ marginBottom: 32
538
+ },
539
+ children: [
540
+ /* @__PURE__ */ jsx6(
541
+ ContentCard,
542
+ {
543
+ icon: /* @__PURE__ */ jsx6(PagesIcon, {}),
544
+ title: "Pages",
545
+ description: "Create and manage your website pages",
546
+ count: pageCount,
547
+ countLabel: "pages",
548
+ tooltip: "Pages are the individual sections of your website. Each page has a URL and contains content sections.",
549
+ actions: [
550
+ { label: "View All", href: "/admin/collections/pages" },
551
+ { label: "Create New", href: "/admin/collections/pages/create", primary: true }
552
+ ]
553
+ }
554
+ ),
555
+ /* @__PURE__ */ jsx6(
556
+ ContentCard,
557
+ {
558
+ icon: /* @__PURE__ */ jsx6(MediaIcon, {}),
559
+ title: "Media Library",
560
+ description: "Upload and organize images and files",
561
+ count: mediaCount,
562
+ countLabel: "files",
563
+ tooltip: "Your media library stores all images, documents, and files used across your website.",
564
+ actions: [
565
+ { label: "Browse", href: "/admin/collections/media" },
566
+ { label: "Upload", href: "/admin/collections/media/create", primary: true }
567
+ ]
568
+ }
569
+ ),
570
+ /* @__PURE__ */ jsx6(
571
+ ContentCard,
572
+ {
573
+ icon: /* @__PURE__ */ jsx6(LayoutIcon, {}),
574
+ title: "Site Design",
575
+ description: "Customize your header, footer, and site-wide settings",
576
+ tooltip: "These settings apply to every page on your website \u2014 your navigation menu, footer information, and global SEO settings.",
577
+ actions: [
578
+ { label: "Header & Nav", href: "/admin/globals/header" },
579
+ { label: "Footer", href: "/admin/globals/footer" },
580
+ { label: "Settings", href: "/admin/globals/site-settings", primary: true }
581
+ ]
582
+ }
583
+ )
584
+ ]
585
+ }
586
+ ),
587
+ recentPages.length > 0 && /* @__PURE__ */ jsxs6(
588
+ "div",
589
+ {
590
+ style: {
591
+ background: "var(--admin-card-bg)",
592
+ border: "1px solid var(--admin-card-border)",
593
+ borderRadius: "var(--admin-radius-lg)",
594
+ overflow: "hidden"
595
+ },
596
+ children: [
597
+ /* @__PURE__ */ jsxs6(
598
+ "div",
599
+ {
600
+ style: {
601
+ padding: "16px 20px",
602
+ borderBottom: "1px solid var(--admin-border-subtle)",
603
+ display: "flex",
604
+ alignItems: "center",
605
+ justifyContent: "space-between"
606
+ },
607
+ children: [
608
+ /* @__PURE__ */ jsxs6("h3", { style: { fontSize: 15, fontWeight: 600, color: "var(--admin-text)", margin: 0, display: "flex", alignItems: "center", gap: 6 }, children: [
609
+ /* @__PURE__ */ jsx6(ClockIcon, {}),
610
+ " Recently Edited"
611
+ ] }),
612
+ /* @__PURE__ */ jsx6(
613
+ "a",
614
+ {
615
+ href: "/admin/collections/pages",
616
+ style: { fontSize: 13, color: "var(--admin-accent)", textDecoration: "none", fontWeight: 500 },
617
+ children: "View all"
618
+ }
619
+ )
620
+ ]
621
+ }
622
+ ),
623
+ recentPages.map((page, i) => /* @__PURE__ */ jsxs6(
624
+ "a",
625
+ {
626
+ href: `/admin/collections/pages/${page.id}`,
627
+ style: {
628
+ display: "flex",
629
+ alignItems: "center",
630
+ justifyContent: "space-between",
631
+ padding: "12px 20px",
632
+ textDecoration: "none",
633
+ borderBottom: i < recentPages.length - 1 ? "1px solid var(--admin-border-subtle)" : "none",
634
+ transition: "background-color 0.15s ease"
635
+ },
636
+ onMouseEnter: (e) => {
637
+ e.currentTarget.style.backgroundColor = "var(--admin-surface)";
638
+ },
639
+ onMouseLeave: (e) => {
640
+ e.currentTarget.style.backgroundColor = "transparent";
641
+ },
642
+ children: [
643
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
644
+ /* @__PURE__ */ jsx6(PagesIcon, { size: 16 }),
645
+ /* @__PURE__ */ jsx6("span", { style: { fontSize: 14, fontWeight: 500, color: "var(--admin-text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: page.title || page.slug || "Untitled" })
646
+ ] }),
647
+ /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: 12, flexShrink: 0 }, children: [
648
+ page._status && /* @__PURE__ */ jsx6(StatusBadge, { status: page._status, size: "sm" }),
649
+ /* @__PURE__ */ jsx6("span", { style: { fontSize: 12, color: "var(--admin-text-muted)", whiteSpace: "nowrap" }, children: formatRelativeTime(page.updatedAt) })
650
+ ] })
651
+ ]
652
+ },
653
+ page.id
654
+ ))
655
+ ]
656
+ }
657
+ )
658
+ ] });
659
+ }
660
+ function QuickAction({ href, icon, label }) {
661
+ return /* @__PURE__ */ jsxs6(
662
+ "a",
663
+ {
664
+ href,
665
+ style: {
666
+ display: "inline-flex",
667
+ alignItems: "center",
668
+ gap: 6,
669
+ padding: "8px 16px",
670
+ background: "var(--admin-surface)",
671
+ border: "1px solid var(--admin-border)",
672
+ borderRadius: "var(--admin-radius-md)",
673
+ color: "var(--admin-text)",
674
+ textDecoration: "none",
675
+ fontSize: 13,
676
+ fontWeight: 500,
677
+ transition: "all 0.2s ease",
678
+ whiteSpace: "nowrap"
679
+ },
680
+ onMouseEnter: (e) => {
681
+ e.currentTarget.style.borderColor = "var(--admin-accent)";
682
+ e.currentTarget.style.color = "var(--admin-accent)";
683
+ e.currentTarget.style.background = "var(--admin-accent-subtle)";
684
+ },
685
+ onMouseLeave: (e) => {
686
+ e.currentTarget.style.borderColor = "var(--admin-border)";
687
+ e.currentTarget.style.color = "var(--admin-text)";
688
+ e.currentTarget.style.background = "var(--admin-surface)";
689
+ },
690
+ children: [
691
+ icon,
692
+ label
693
+ ]
694
+ }
695
+ );
696
+ }
697
+ function ContentCard({
698
+ icon,
699
+ title,
700
+ description,
701
+ count,
702
+ countLabel,
703
+ tooltip,
704
+ actions
705
+ }) {
706
+ return /* @__PURE__ */ jsxs6(
707
+ "div",
708
+ {
709
+ style: {
710
+ background: "var(--admin-card-bg)",
711
+ border: "1px solid var(--admin-card-border)",
712
+ borderRadius: "var(--admin-radius-lg)",
713
+ padding: 24,
714
+ display: "flex",
715
+ flexDirection: "column",
716
+ gap: 16,
717
+ boxShadow: "var(--admin-card-shadow)",
718
+ transition: "all 0.2s ease"
719
+ },
720
+ children: [
721
+ /* @__PURE__ */ jsx6("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: /* @__PURE__ */ jsxs6("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
722
+ /* @__PURE__ */ jsx6(
723
+ "div",
724
+ {
725
+ style: {
726
+ width: 40,
727
+ height: 40,
728
+ borderRadius: "var(--admin-radius-md)",
729
+ background: "var(--admin-accent-subtle)",
730
+ color: "var(--admin-accent)",
731
+ display: "flex",
732
+ alignItems: "center",
733
+ justifyContent: "center"
734
+ },
735
+ children: icon
736
+ }
737
+ ),
738
+ /* @__PURE__ */ jsxs6("div", { children: [
739
+ /* @__PURE__ */ jsxs6("h3", { style: { fontSize: 16, fontWeight: 600, color: "var(--admin-text)", margin: 0, display: "flex", alignItems: "center" }, children: [
740
+ title,
741
+ tooltip && /* @__PURE__ */ jsx6(HelpTooltip, { content: tooltip, position: "right" })
742
+ ] }),
743
+ count !== void 0 && count !== null && /* @__PURE__ */ jsxs6("span", { style: { fontSize: 12, color: "var(--admin-text-muted)" }, children: [
744
+ count,
745
+ " ",
746
+ countLabel
747
+ ] })
748
+ ] })
749
+ ] }) }),
750
+ /* @__PURE__ */ jsx6("p", { style: { fontSize: 13, color: "var(--admin-text-muted)", margin: 0, lineHeight: 1.5 }, children: description }),
751
+ actions && actions.length > 0 && /* @__PURE__ */ jsx6("div", { style: { display: "flex", gap: 8, marginTop: "auto", flexWrap: "wrap" }, children: actions.map((action) => /* @__PURE__ */ jsx6(
752
+ "a",
753
+ {
754
+ href: action.href,
755
+ style: {
756
+ display: "inline-flex",
757
+ alignItems: "center",
758
+ padding: "7px 14px",
759
+ borderRadius: "var(--admin-radius-sm)",
760
+ fontSize: 13,
761
+ fontWeight: 500,
762
+ textDecoration: "none",
763
+ transition: "all 0.15s ease",
764
+ ...action.primary ? {
765
+ background: "var(--admin-accent)",
766
+ color: "var(--admin-text-inverse)"
767
+ } : {
768
+ background: "var(--admin-surface)",
769
+ color: "var(--admin-text-secondary)",
770
+ border: "1px solid var(--admin-border)"
771
+ }
772
+ },
773
+ children: action.label
774
+ },
775
+ action.href
776
+ )) })
777
+ ]
778
+ }
779
+ );
780
+ }
781
+
782
+ // src/components/EmptyState.tsx
783
+ import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
784
+ function EmptyState({
785
+ icon,
786
+ title,
787
+ description,
788
+ actionLabel,
789
+ actionHref
790
+ }) {
791
+ return /* @__PURE__ */ jsxs7(
792
+ "div",
793
+ {
794
+ style: {
795
+ display: "flex",
796
+ flexDirection: "column",
797
+ alignItems: "center",
798
+ justifyContent: "center",
799
+ padding: "48px 24px",
800
+ textAlign: "center",
801
+ background: "var(--admin-surface)",
802
+ borderRadius: "var(--admin-radius-lg)",
803
+ border: "1px dashed var(--admin-border)"
804
+ },
805
+ children: [
806
+ icon && /* @__PURE__ */ jsx7(
807
+ "div",
808
+ {
809
+ style: {
810
+ marginBottom: 16,
811
+ color: "var(--admin-text-muted)",
812
+ opacity: 0.6
813
+ },
814
+ children: icon
815
+ }
816
+ ),
817
+ /* @__PURE__ */ jsx7(
818
+ "h3",
819
+ {
820
+ style: {
821
+ fontSize: 18,
822
+ fontWeight: 600,
823
+ color: "var(--admin-text)",
824
+ margin: "0 0 8px"
825
+ },
826
+ children: title
827
+ }
828
+ ),
829
+ /* @__PURE__ */ jsx7(
830
+ "p",
831
+ {
832
+ style: {
833
+ fontSize: 14,
834
+ color: "var(--admin-text-muted)",
835
+ margin: "0 0 20px",
836
+ maxWidth: 400,
837
+ lineHeight: 1.5
838
+ },
839
+ children: description
840
+ }
841
+ ),
842
+ actionLabel && actionHref && /* @__PURE__ */ jsx7(
843
+ "a",
844
+ {
845
+ href: actionHref,
846
+ style: {
847
+ display: "inline-flex",
848
+ alignItems: "center",
849
+ gap: 6,
850
+ padding: "10px 20px",
851
+ background: "var(--admin-accent)",
852
+ color: "var(--admin-text-inverse)",
853
+ borderRadius: "var(--admin-radius-md)",
854
+ textDecoration: "none",
855
+ fontWeight: 600,
856
+ fontSize: 14,
857
+ transition: "all 0.2s ease"
858
+ },
859
+ children: actionLabel
860
+ }
861
+ )
862
+ ]
863
+ }
864
+ );
865
+ }
866
+
867
+ // src/components/BlockPicker.tsx
868
+ import { useState as useState4 } from "react";
869
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
870
+ function BlockPicker({
871
+ blocks,
872
+ onSelect
873
+ }) {
874
+ const [searchQuery, setSearchQuery] = useState4("");
875
+ const filtered = blocks.filter(
876
+ (b) => b.label.toLowerCase().includes(searchQuery.toLowerCase()) || b.slug.toLowerCase().includes(searchQuery.toLowerCase()) || b.description && b.description.toLowerCase().includes(searchQuery.toLowerCase())
877
+ );
878
+ return /* @__PURE__ */ jsxs8("div", { style: { display: "flex", flexDirection: "column", gap: 16 }, children: [
879
+ blocks.length > 4 && /* @__PURE__ */ jsx8(
880
+ "input",
881
+ {
882
+ type: "text",
883
+ placeholder: "Search sections...",
884
+ value: searchQuery,
885
+ onChange: (e) => setSearchQuery(e.target.value),
886
+ style: {
887
+ padding: "10px 14px",
888
+ border: "1px solid var(--admin-input-border)",
889
+ borderRadius: "var(--admin-radius-md)",
890
+ background: "var(--admin-input-bg)",
891
+ color: "var(--admin-text)",
892
+ fontSize: 14,
893
+ outline: "none",
894
+ width: "100%",
895
+ boxSizing: "border-box"
896
+ }
897
+ }
898
+ ),
899
+ /* @__PURE__ */ jsx8(
900
+ "div",
901
+ {
902
+ style: {
903
+ display: "grid",
904
+ gridTemplateColumns: "repeat(auto-fill, minmax(180px, 1fr))",
905
+ gap: 12
906
+ },
907
+ children: filtered.map((block) => /* @__PURE__ */ jsxs8(
908
+ "button",
909
+ {
910
+ type: "button",
911
+ onClick: () => onSelect(block.slug),
912
+ style: {
913
+ display: "flex",
914
+ flexDirection: "column",
915
+ alignItems: "center",
916
+ gap: 10,
917
+ padding: 16,
918
+ background: "var(--admin-card-bg)",
919
+ border: "1px solid var(--admin-card-border)",
920
+ borderRadius: "var(--admin-radius-lg)",
921
+ cursor: "pointer",
922
+ transition: "all 0.2s ease",
923
+ textAlign: "center"
924
+ },
925
+ onMouseEnter: (e) => {
926
+ e.currentTarget.style.borderColor = "var(--admin-accent)";
927
+ e.currentTarget.style.boxShadow = "var(--admin-card-shadow-hover)";
928
+ e.currentTarget.style.transform = "translateY(-2px)";
929
+ },
930
+ onMouseLeave: (e) => {
931
+ e.currentTarget.style.borderColor = "var(--admin-card-border)";
932
+ e.currentTarget.style.boxShadow = "none";
933
+ e.currentTarget.style.transform = "translateY(0)";
934
+ },
935
+ children: [
936
+ /* @__PURE__ */ jsx8(
937
+ "div",
938
+ {
939
+ style: {
940
+ width: 48,
941
+ height: 48,
942
+ borderRadius: "var(--admin-radius-md)",
943
+ background: "var(--admin-accent-subtle)",
944
+ color: "var(--admin-accent)",
945
+ display: "flex",
946
+ alignItems: "center",
947
+ justifyContent: "center",
948
+ fontSize: 24,
949
+ overflow: "hidden"
950
+ },
951
+ children: block.imageURL ? /* @__PURE__ */ jsx8(
952
+ "img",
953
+ {
954
+ src: block.imageURL,
955
+ alt: block.label,
956
+ style: { width: "100%", height: "100%", objectFit: "cover" }
957
+ }
958
+ ) : block.icon ? block.icon : /* @__PURE__ */ jsx8(BlockDefaultIcon, {})
959
+ }
960
+ ),
961
+ /* @__PURE__ */ jsx8(
962
+ "span",
963
+ {
964
+ style: {
965
+ fontSize: 13,
966
+ fontWeight: 600,
967
+ color: "var(--admin-text)",
968
+ lineHeight: 1.3
969
+ },
970
+ children: block.label
971
+ }
972
+ ),
973
+ block.description && /* @__PURE__ */ jsx8(
974
+ "span",
975
+ {
976
+ style: {
977
+ fontSize: 11,
978
+ color: "var(--admin-text-muted)",
979
+ lineHeight: 1.4
980
+ },
981
+ children: block.description
982
+ }
983
+ )
984
+ ]
985
+ },
986
+ block.slug
987
+ ))
988
+ }
989
+ ),
990
+ filtered.length === 0 && /* @__PURE__ */ jsx8("p", { style: { textAlign: "center", color: "var(--admin-text-muted)", fontSize: 14, padding: 20 }, children: "No sections match your search." })
991
+ ] });
992
+ }
993
+ function BlockDefaultIcon() {
994
+ return /* @__PURE__ */ jsxs8("svg", { width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
995
+ /* @__PURE__ */ jsx8("rect", { x: "3", y: "3", width: "7", height: "7" }),
996
+ /* @__PURE__ */ jsx8("rect", { x: "14", y: "3", width: "7", height: "7" }),
997
+ /* @__PURE__ */ jsx8("rect", { x: "14", y: "14", width: "7", height: "7" }),
998
+ /* @__PURE__ */ jsx8("rect", { x: "3", y: "14", width: "7", height: "7" })
999
+ ] });
1000
+ }
1001
+
1002
+ // src/components/SectionTabs.tsx
1003
+ import { useState as useState5 } from "react";
1004
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1005
+ function SectionTabs({
1006
+ tabs,
1007
+ defaultTab = 0
1008
+ }) {
1009
+ const [activeTab, setActiveTab] = useState5(defaultTab);
1010
+ if (tabs.length === 0) return null;
1011
+ return /* @__PURE__ */ jsxs9(
1012
+ "div",
1013
+ {
1014
+ style: {
1015
+ border: "1px solid var(--admin-border)",
1016
+ borderRadius: "var(--admin-radius-lg)",
1017
+ overflow: "hidden",
1018
+ background: "var(--admin-card-bg)"
1019
+ },
1020
+ children: [
1021
+ /* @__PURE__ */ jsx9(
1022
+ "div",
1023
+ {
1024
+ style: {
1025
+ display: "flex",
1026
+ borderBottom: "2px solid var(--admin-border)",
1027
+ background: "var(--admin-surface)",
1028
+ overflowX: "auto",
1029
+ scrollbarWidth: "none"
1030
+ },
1031
+ children: tabs.map((tab, index) => {
1032
+ const isActive = index === activeTab;
1033
+ return /* @__PURE__ */ jsxs9(
1034
+ "button",
1035
+ {
1036
+ type: "button",
1037
+ onClick: () => setActiveTab(index),
1038
+ style: {
1039
+ display: "flex",
1040
+ alignItems: "center",
1041
+ gap: 6,
1042
+ padding: "12px 18px",
1043
+ border: "none",
1044
+ borderBottom: isActive ? "2px solid var(--admin-accent)" : "2px solid transparent",
1045
+ marginBottom: -2,
1046
+ background: "transparent",
1047
+ color: isActive ? "var(--admin-accent)" : "var(--admin-text-muted)",
1048
+ fontWeight: isActive ? 600 : 500,
1049
+ fontSize: 13,
1050
+ cursor: "pointer",
1051
+ transition: "all 0.15s ease",
1052
+ whiteSpace: "nowrap"
1053
+ },
1054
+ children: [
1055
+ tab.icon && /* @__PURE__ */ jsx9("span", { style: { display: "flex", opacity: isActive ? 1 : 0.6 }, children: tab.icon }),
1056
+ tab.label
1057
+ ]
1058
+ },
1059
+ index
1060
+ );
1061
+ })
1062
+ }
1063
+ ),
1064
+ /* @__PURE__ */ jsx9("div", { style: { padding: 20 }, children: tabs[activeTab]?.content })
1065
+ ]
1066
+ }
1067
+ );
1068
+ }
1069
+
1070
+ // src/components/WelcomeHeader.tsx
1071
+ import { jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
1072
+ function WelcomeHeader({
1073
+ title,
1074
+ description,
1075
+ tooltip,
1076
+ actions
1077
+ }) {
1078
+ return /* @__PURE__ */ jsxs10(
1079
+ "div",
1080
+ {
1081
+ style: {
1082
+ display: "flex",
1083
+ alignItems: "flex-start",
1084
+ justifyContent: "space-between",
1085
+ padding: "24px 0",
1086
+ borderBottom: "1px solid var(--admin-border-subtle)",
1087
+ marginBottom: 24
1088
+ },
1089
+ children: [
1090
+ /* @__PURE__ */ jsxs10("div", { children: [
1091
+ /* @__PURE__ */ jsxs10(
1092
+ "h1",
1093
+ {
1094
+ style: {
1095
+ fontSize: 24,
1096
+ fontWeight: 700,
1097
+ color: "var(--admin-text)",
1098
+ margin: 0,
1099
+ display: "flex",
1100
+ alignItems: "center"
1101
+ },
1102
+ children: [
1103
+ title,
1104
+ tooltip && /* @__PURE__ */ jsx10(HelpTooltip, { content: tooltip, position: "right" })
1105
+ ]
1106
+ }
1107
+ ),
1108
+ description && /* @__PURE__ */ jsx10("p", { style: { fontSize: 14, color: "var(--admin-text-muted)", margin: "6px 0 0" }, children: description })
1109
+ ] }),
1110
+ actions && /* @__PURE__ */ jsx10("div", { style: { display: "flex", gap: 8 }, children: actions })
1111
+ ]
1112
+ }
1113
+ );
1114
+ }
1115
+ export {
1116
+ BlockPicker,
1117
+ Dashboard,
1118
+ EmptyState,
1119
+ HelpTooltip,
1120
+ Icon,
1121
+ Logo,
1122
+ SectionTabs,
1123
+ StatusBadge,
1124
+ ThemeProvider,
1125
+ ThemeSwitcher,
1126
+ WelcomeHeader,
1127
+ useTheme
1128
+ };