@okjt/dashboard 0.2.0 → 0.2.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.
- package/dist/AdminFloatingToolbar.js +1 -1
- package/dist/AdminPageHero.js +4 -4
- package/dist/AdminSummaryCards.js +1 -1
- package/dist/AdminTutorial.js +3 -2
- package/dist/AuthContext.js +2 -2
- package/dist/AuthLayout.js +2 -2
- package/dist/NotificationsBell.js +1 -1
- package/dist/StatCard.js +1 -1
- package/dist/VerifyEmailPage.js +6 -3
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ function AdminFloatingToolbar({
|
|
|
43
43
|
className: "admin-floating-toolbar flex flex-wrap items-center justify-center gap-1 sm:gap-2 p-1.5 sm:p-2 rounded-2xl border border-white/40 shadow-2xl backdrop-blur-md",
|
|
44
44
|
style: {
|
|
45
45
|
background: "rgba(255, 249, 245, 0.92)",
|
|
46
|
-
boxShadow: "0 12px 40px
|
|
46
|
+
boxShadow: "0 12px 40px color-mix(in srgb, var(--color-body) 18%, transparent)"
|
|
47
47
|
},
|
|
48
48
|
children: [
|
|
49
49
|
searchProps && /* @__PURE__ */ jsx(AdminToolbarSearch, { ...searchProps }),
|
package/dist/AdminPageHero.js
CHANGED
|
@@ -37,7 +37,7 @@ function AdminPageHero({ title, description, breadcrumb, icon }) {
|
|
|
37
37
|
transition: { duration: 0.15 },
|
|
38
38
|
className: "flex items-center gap-2 min-w-0",
|
|
39
39
|
children: [
|
|
40
|
-
icon && /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg flex items-center justify-center shrink-0", style: { background: "
|
|
40
|
+
icon && /* @__PURE__ */ jsx("div", { className: "w-8 h-8 rounded-lg flex items-center justify-center shrink-0", style: { background: "color-mix(in srgb, var(--color-accent) 10%, transparent)" }, children: icon }),
|
|
41
41
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 leading-tight", children: [
|
|
42
42
|
parent && /* @__PURE__ */ jsx("p", { className: "hidden sm:block text-[11px] text-tone-400 truncate", children: parent.path ? /* @__PURE__ */ jsx(Link, { to: parent.path, className: "hover:text-accent", children: parent.label }) : parent.label }),
|
|
43
43
|
/* @__PURE__ */ jsx("p", { className: "text-base font-semibold text-body truncate", children: title })
|
|
@@ -78,7 +78,7 @@ function AdminPageHero({ title, description, breadcrumb, icon }) {
|
|
|
78
78
|
"div",
|
|
79
79
|
{
|
|
80
80
|
className: "w-10 h-10 rounded-xl flex items-center justify-center",
|
|
81
|
-
style: { background: "
|
|
81
|
+
style: { background: "color-mix(in srgb, var(--color-accent) 10%, transparent)" },
|
|
82
82
|
children: icon
|
|
83
83
|
}
|
|
84
84
|
),
|
|
@@ -87,11 +87,11 @@ function AdminPageHero({ title, description, breadcrumb, icon }) {
|
|
|
87
87
|
"h1",
|
|
88
88
|
{
|
|
89
89
|
className: "text-2xl md:text-3xl font-semibold",
|
|
90
|
-
style: { color: "
|
|
90
|
+
style: { color: "var(--color-body)" },
|
|
91
91
|
children: title
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
description && /* @__PURE__ */ jsx("p", { className: "text-sm mt-0.5", style: { color: "
|
|
94
|
+
description && /* @__PURE__ */ jsx("p", { className: "text-sm mt-0.5", style: { color: "var(--color-muted)" }, children: description })
|
|
95
95
|
] })
|
|
96
96
|
] }) })
|
|
97
97
|
] });
|
|
@@ -25,7 +25,7 @@ function AdminSummaryCards({ cards = [], columns = 4 }) {
|
|
|
25
25
|
transition: { delay: index * 0.05, duration: 0.2 },
|
|
26
26
|
"aria-pressed": stat.onClick ? !!stat.active : void 0,
|
|
27
27
|
className: `px-3.5 py-3 rounded-2xl bg-white flex items-center gap-3 text-left min-w-0 transition-shadow ${stat.onClick ? "cursor-pointer hover:ring-2 hover:ring-accent/20" : ""} ${stat.active ? "ring-2 ring-accent/50" : ""}`,
|
|
28
|
-
style: { boxShadow: "0 4px 20px
|
|
28
|
+
style: { boxShadow: "0 4px 20px color-mix(in srgb, var(--color-accent) 8%, transparent)" },
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ jsx(
|
|
31
31
|
"div",
|
package/dist/AdminTutorial.js
CHANGED
|
@@ -13,12 +13,13 @@ function AdminTutorial({ steps, onComplete, isRestarted = false }) {
|
|
|
13
13
|
if (boxRef.current) setBoxHeight(boxRef.current.offsetHeight);
|
|
14
14
|
}, [currentStep, isVisible, coords]);
|
|
15
15
|
useEffect(() => {
|
|
16
|
+
if (!steps?.length) return void 0;
|
|
16
17
|
const isCompleted = localStorage.getItem("admin-tutorial-complete");
|
|
17
18
|
if (!isCompleted || isRestarted) {
|
|
18
19
|
const timer = setTimeout(() => setIsVisible(true), 1e3);
|
|
19
20
|
return () => clearTimeout(timer);
|
|
20
21
|
}
|
|
21
|
-
}, [isRestarted]);
|
|
22
|
+
}, [isRestarted, steps?.length]);
|
|
22
23
|
useEffect(() => {
|
|
23
24
|
if (isVisible) {
|
|
24
25
|
const step2 = steps[currentStep];
|
|
@@ -114,7 +115,7 @@ function AdminTutorial({ steps, onComplete, isRestarted = false }) {
|
|
|
114
115
|
top = Math.min(Math.max(margin, top), vh - margin - boxH);
|
|
115
116
|
return { style: { top, left, width: boxW }, placement: placement2 };
|
|
116
117
|
};
|
|
117
|
-
if (!isVisible) return null;
|
|
118
|
+
if (!isVisible || !steps?.length) return null;
|
|
118
119
|
const step = steps[currentStep];
|
|
119
120
|
const { style: boxStyle, placement } = getBoxStyle();
|
|
120
121
|
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[100] pointer-events-none", children: [
|
package/dist/AuthContext.js
CHANGED
|
@@ -104,9 +104,9 @@ function AuthProvider({ api, extend, children }) {
|
|
|
104
104
|
return { success: false, message: error.response?.data?.message || "Could not resend \u2014 try again." };
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
|
-
const verifyEmail = async ({ id, hash }) => {
|
|
107
|
+
const verifyEmail = async ({ id, hash, expires, signature }) => {
|
|
108
108
|
try {
|
|
109
|
-
const response = await api.post("/email/verify", { id, hash });
|
|
109
|
+
const response = await api.post("/email/verify", { id, hash, expires, signature });
|
|
110
110
|
const { token, user: user2, message: _message, email_verified: _verified, ...extra } = response.data;
|
|
111
111
|
if (token) {
|
|
112
112
|
localStorage.setItem("auth_token", token);
|
package/dist/AuthLayout.js
CHANGED
|
@@ -32,7 +32,7 @@ function AuthLayout({ title, subtitle, children, footer, brand, backLabel = "Bac
|
|
|
32
32
|
}
|
|
33
33
|
) });
|
|
34
34
|
}
|
|
35
|
-
const fieldClass = "w-full h-12 px-5 rounded-full bg-white border border-line text-sm text-ink placeholder:text-[
|
|
35
|
+
const fieldClass = "w-full h-12 px-5 rounded-full bg-white border border-line text-sm text-ink placeholder:text-[var(--okjt-auth-placeholder,var(--color-faint))] shadow-[0_1px_2px_color-mix(in_srgb,var(--color-body)_4%,transparent)] outline-none transition focus:border-[var(--okjt-auth-focus,var(--color-accent))] focus:ring-4 focus:ring-[var(--okjt-auth-focus,var(--color-accent))]/15 read-only:bg-tint read-only:text-muted";
|
|
36
36
|
function AuthField({ id, label, type = "text", error, className = "", inputClassName = "", ...props }) {
|
|
37
37
|
const [visible, setVisible] = useState(false);
|
|
38
38
|
const isPassword = type === "password";
|
|
@@ -70,7 +70,7 @@ function AuthSubmit({ loading, children, ...props }) {
|
|
|
70
70
|
{
|
|
71
71
|
type: "submit",
|
|
72
72
|
disabled: loading,
|
|
73
|
-
className: "w-full h-12 rounded-full text-sm font-semibold text-white bg-gradient-to-r from-accent-dark via-accent-strong to-[
|
|
73
|
+
className: "w-full h-12 rounded-full text-sm font-semibold text-white bg-gradient-to-r from-accent-dark via-accent-strong to-[var(--okjt-auth-glow,var(--color-accent-soft))] shadow-[0_10px_24px_-10px_color-mix(in_srgb,var(--color-accent-strong)_80%,transparent)] transition hover:brightness-105 active:brightness-95 disabled:opacity-70 flex items-center justify-center gap-2 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[var(--okjt-auth-focus,var(--color-accent))]/30",
|
|
74
74
|
...props,
|
|
75
75
|
children: [
|
|
76
76
|
loading && /* @__PURE__ */ jsx(Loader2, { className: "w-4 h-4 animate-spin", "aria-hidden": "true" }),
|
|
@@ -96,7 +96,7 @@ function NotificationsBell() {
|
|
|
96
96
|
"span",
|
|
97
97
|
{
|
|
98
98
|
className: "absolute top-1 right-1 w-2 h-2 rounded-full",
|
|
99
|
-
style: { background: "
|
|
99
|
+
style: { background: "var(--color-accent)", display: unreadCount > 0 ? "block" : "none" }
|
|
100
100
|
}
|
|
101
101
|
)
|
|
102
102
|
]
|
package/dist/StatCard.js
CHANGED
|
@@ -8,7 +8,7 @@ function StatCard({ icon, label, value, color }) {
|
|
|
8
8
|
className: "p-6 rounded-2xl transition-all hover:scale-[1.02]",
|
|
9
9
|
style: {
|
|
10
10
|
background: "white",
|
|
11
|
-
boxShadow: "0 4px 20px
|
|
11
|
+
boxShadow: "0 4px 20px color-mix(in srgb, var(--color-accent) 8%, transparent)"
|
|
12
12
|
},
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
package/dist/VerifyEmailPage.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { useNavigate, useParams } from "react-router-dom";
|
|
3
|
+
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
|
4
4
|
import { useAuth } from "./AuthContext.js";
|
|
5
5
|
import AuthLayout, { AuthError } from "./AuthLayout.js";
|
|
6
6
|
function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath = "/sign-in" }) {
|
|
7
7
|
const { id, hash } = useParams();
|
|
8
|
+
const [params] = useSearchParams();
|
|
9
|
+
const expires = params.get("expires");
|
|
10
|
+
const signature = params.get("signature");
|
|
8
11
|
const navigate = useNavigate();
|
|
9
12
|
const { verifyEmail } = useAuth();
|
|
10
13
|
const [error, setError] = useState(null);
|
|
@@ -12,7 +15,7 @@ function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath =
|
|
|
12
15
|
useEffect(() => {
|
|
13
16
|
let cancelled = false;
|
|
14
17
|
(async () => {
|
|
15
|
-
const result = await verifyEmail({ id, hash });
|
|
18
|
+
const result = await verifyEmail({ id, hash, expires, signature });
|
|
16
19
|
if (cancelled) return;
|
|
17
20
|
if (result.success) {
|
|
18
21
|
setDone(true);
|
|
@@ -24,7 +27,7 @@ function VerifyEmailPage({ layout: Layout = AuthLayout, next = "/", signInPath =
|
|
|
24
27
|
return () => {
|
|
25
28
|
cancelled = true;
|
|
26
29
|
};
|
|
27
|
-
}, [id, hash]);
|
|
30
|
+
}, [id, hash, expires, signature]);
|
|
28
31
|
return /* @__PURE__ */ jsxs(
|
|
29
32
|
Layout,
|
|
30
33
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okjt/dashboard",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Dashboard pages for OKJTech projects: page layout, hero, summary cards, floating toolbar with search and filters, side panel, lists, bulk actions, one way to save, and working together: presence, version history, sharing; the dashboard shell, sign-in pages and account menu",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|