@okjt/dashboard 0.2.1 → 0.3.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/dist/AccountMenu.js +2 -2
- package/dist/AdminBulkActions.js +2 -2
- package/dist/AdminCard.js +1 -1
- package/dist/AdminFloatingToolbar.js +4 -4
- package/dist/AdminListPanel.js +1 -1
- package/dist/AdminModal.js +1 -1
- package/dist/AdminPagination.js +1 -1
- package/dist/AdminSidePanel.js +7 -7
- package/dist/AdminSummaryCards.js +1 -1
- package/dist/AdminToolbarFilters.js +2 -2
- package/dist/AdminToolbarSearch.js +1 -1
- package/dist/AdminTutorial.js +2 -2
- package/dist/AuthContext.js +2 -2
- package/dist/DashboardHeader.js +70 -55
- package/dist/DashboardProvider.js +27 -1
- package/dist/DashboardShell.js +33 -6
- package/dist/DashboardSidebar.js +20 -14
- package/dist/NotificationsBell.js +2 -2
- package/dist/ShareModal.js +1 -1
- package/dist/VerifyEmailPage.js +6 -3
- package/dist/VersionHistoryDrawer.js +2 -2
- package/package.json +2 -2
package/dist/AccountMenu.js
CHANGED
|
@@ -27,7 +27,7 @@ function AccountMenu({ compactLinks = [], links = [], roleText, extra, fallbackN
|
|
|
27
27
|
"aria-haspopup": "menu",
|
|
28
28
|
"aria-expanded": open,
|
|
29
29
|
"aria-label": `Account menu for ${user?.name || fallbackName.toLowerCase()}`,
|
|
30
|
-
className: "flex items-center gap-2 p-1 pr-2 rounded-full hover:bg-
|
|
30
|
+
className: "flex items-center gap-2 p-1 pr-2 rounded-full hover:bg-contrast/5 transition-colors",
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ jsx("span", { className: "w-8 h-8 rounded-full flex items-center justify-center text-white text-sm font-medium bg-accent", children: initial }),
|
|
33
33
|
/* @__PURE__ */ jsx("span", { className: "hidden xl:block max-w-[8rem] truncate text-sm font-medium text-body", children: user?.name || fallbackName }),
|
|
@@ -43,7 +43,7 @@ function AccountMenu({ compactLinks = [], links = [], roleText, extra, fallbackN
|
|
|
43
43
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
44
44
|
exit: { opacity: 0, y: 8, scale: 0.97 },
|
|
45
45
|
transition: { duration: 0.15 },
|
|
46
|
-
className: "absolute right-0 top-full mt-2 w-64 bg-
|
|
46
|
+
className: "absolute right-0 top-full mt-2 w-64 bg-surface rounded-2xl shadow-xl border border-tone-100 py-2 z-50",
|
|
47
47
|
children: [
|
|
48
48
|
/* @__PURE__ */ jsxs("div", { className: "px-4 py-2 border-b border-tone-100 mb-1", children: [
|
|
49
49
|
/* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-tone-800 truncate", children: user?.name || fallbackName }),
|
package/dist/AdminBulkActions.js
CHANGED
|
@@ -66,7 +66,7 @@ function AdminBulkActions({ selectedCount = 0, onClearSelection, actions: allAct
|
|
|
66
66
|
initial: { opacity: 0, y: 8, scale: 0.96 },
|
|
67
67
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
68
68
|
exit: { opacity: 0, y: 8, scale: 0.96 },
|
|
69
|
-
className: "absolute right-0 bottom-full mb-2 min-w-[10rem] bg-
|
|
69
|
+
className: "absolute right-0 bottom-full mb-2 min-w-[10rem] bg-surface rounded-xl shadow-xl border border-tone-100 py-2 overflow-hidden z-20",
|
|
70
70
|
children: overflowActions.map((action) => {
|
|
71
71
|
const Icon = action.icon;
|
|
72
72
|
return /* @__PURE__ */ jsxs(
|
|
@@ -94,7 +94,7 @@ function AdminBulkActions({ selectedCount = 0, onClearSelection, actions: allAct
|
|
|
94
94
|
{
|
|
95
95
|
"aria-label": "Clear selection",
|
|
96
96
|
onClick: onClearSelection,
|
|
97
|
-
className: "p-2 rounded-lg text-tone-400 hover:text-tone-600 hover:bg-
|
|
97
|
+
className: "p-2 rounded-lg text-tone-400 hover:text-tone-600 hover:bg-surface transition-colors",
|
|
98
98
|
title: "Clear selection",
|
|
99
99
|
children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
|
|
100
100
|
}
|
package/dist/AdminCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
function AdminCard({ children, className = "", padding = true }) {
|
|
3
|
-
return /* @__PURE__ */ jsx("div", { className: `bg-
|
|
3
|
+
return /* @__PURE__ */ jsx("div", { className: `bg-surface rounded-2xl shadow-sm border border-tone-100 ${padding ? "p-4 sm:p-5" : ""} ${className}`, children });
|
|
4
4
|
}
|
|
5
5
|
export {
|
|
6
6
|
AdminCard as default
|
|
@@ -36,7 +36,7 @@ function AdminFloatingToolbar({
|
|
|
36
36
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
37
37
|
exit: { opacity: 0, y: 20, scale: 0.96 },
|
|
38
38
|
transition: { type: "spring", stiffness: 300, damping: 25 },
|
|
39
|
-
className: `fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] sm:bottom-6 left-1/2 lg:left-[calc(50%+
|
|
39
|
+
className: `fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] sm:bottom-6 left-1/2 lg:left-[calc(50%+var(--okjt-sidebar-w,280px)/2)] -translate-x-1/2 ${z} w-max max-w-[calc(100vw-1rem)] sm:max-w-[calc(100vw-1.5rem)] lg:max-w-[calc(100vw-var(--okjt-sidebar-w,280px)-1.5rem)] ${wrapperClassName}`,
|
|
40
40
|
children: /* @__PURE__ */ jsxs(
|
|
41
41
|
"div",
|
|
42
42
|
{
|
|
@@ -83,7 +83,7 @@ function AdminFloatingToolbar({
|
|
|
83
83
|
initial: { opacity: 0, y: 8, scale: 0.96 },
|
|
84
84
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
85
85
|
exit: { opacity: 0, y: 8, scale: 0.96 },
|
|
86
|
-
className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 min-w-[10rem] bg-
|
|
86
|
+
className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-2 min-w-[10rem] bg-surface rounded-xl shadow-xl border border-tone-100 py-2 overflow-hidden",
|
|
87
87
|
children: overflowActions.map((action) => {
|
|
88
88
|
const Icon = action.icon;
|
|
89
89
|
return /* @__PURE__ */ jsxs(
|
|
@@ -111,7 +111,7 @@ function AdminFloatingToolbar({
|
|
|
111
111
|
{
|
|
112
112
|
"aria-label": "Hide toolbar",
|
|
113
113
|
onClick: () => setVisible(false),
|
|
114
|
-
className: "p-2 rounded-xl text-tone-400 hover:text-tone-600 hover:bg-
|
|
114
|
+
className: "p-2 rounded-xl text-tone-400 hover:text-tone-600 hover:bg-surface/60 transition-colors",
|
|
115
115
|
title: "Hide toolbar",
|
|
116
116
|
children: /* @__PURE__ */ jsx(ChevronDown, { className: "w-4 h-4" })
|
|
117
117
|
}
|
|
@@ -130,7 +130,7 @@ function AdminFloatingToolbar({
|
|
|
130
130
|
whileHover: { scale: 1.05 },
|
|
131
131
|
whileTap: { scale: 0.95 },
|
|
132
132
|
onClick: () => setVisible(true),
|
|
133
|
-
className: `fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] sm:bottom-6 left-1/2 lg:left-[calc(50%+
|
|
133
|
+
className: `fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] sm:bottom-6 left-1/2 lg:left-[calc(50%+var(--okjt-sidebar-w,280px)/2)] -translate-x-1/2 ${z} p-2.5 rounded-full bg-surface/90 border border-tone-200 shadow-lg text-accent hover:bg-surface transition-colors ${wrapperClassName}`,
|
|
134
134
|
title: narrowed ? "Show toolbar (search or filters active)" : "Show toolbar",
|
|
135
135
|
children: [
|
|
136
136
|
/* @__PURE__ */ jsx(ChevronUp, { className: "w-5 h-5" }),
|
package/dist/AdminListPanel.js
CHANGED
|
@@ -7,7 +7,7 @@ function AdminListPanel({
|
|
|
7
7
|
className = "",
|
|
8
8
|
bodyClassName = ""
|
|
9
9
|
}) {
|
|
10
|
-
const chrome = plain ? "" : "bg-
|
|
10
|
+
const chrome = plain ? "" : "bg-surface rounded-2xl shadow-sm border border-tone-100 overflow-hidden";
|
|
11
11
|
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col fit:flex-1 fit:min-h-0 ${chrome} ${className}`, children: [
|
|
12
12
|
header && /* @__PURE__ */ jsx("div", { className: "shrink-0", children: header }),
|
|
13
13
|
/* @__PURE__ */ jsx(
|
package/dist/AdminModal.js
CHANGED
|
@@ -10,7 +10,7 @@ function AdminModal({ isOpen, onClose, title, children, size = "md" }) {
|
|
|
10
10
|
xl: "max-w-xl",
|
|
11
11
|
"2xl": "max-w-2xl"
|
|
12
12
|
};
|
|
13
|
-
return /* @__PURE__ */ jsx(Overlay, { onClose, closeOnBackdrop: false, children: /* @__PURE__ */ jsxs("div", { className: `bg-
|
|
13
|
+
return /* @__PURE__ */ jsx(Overlay, { onClose, closeOnBackdrop: false, children: /* @__PURE__ */ jsxs("div", { className: `bg-surface rounded-2xl w-full ${sizeClasses[size]} p-6 shadow-xl animate-in zoom-in duration-200`, children: [
|
|
14
14
|
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center mb-6", children: [
|
|
15
15
|
/* @__PURE__ */ jsx("h2", { className: "text-xl font-medium text-body", children: title }),
|
|
16
16
|
/* @__PURE__ */ jsx("button", { onClick: onClose, "aria-label": "Close dialog", className: "p-1 hover:bg-tone-100 rounded-lg transition-colors", children: /* @__PURE__ */ jsx(X, { className: "w-5 h-5 text-tone-400" }) })
|
package/dist/AdminPagination.js
CHANGED
|
@@ -26,7 +26,7 @@ function AdminPagination({
|
|
|
26
26
|
if (totalItems === 0) return null;
|
|
27
27
|
const from = (currentPage - 1) * pageSize + 1;
|
|
28
28
|
const to = Math.min(currentPage * pageSize, totalItems);
|
|
29
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 bg-
|
|
29
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3 bg-surface px-4 py-2.5", children: [
|
|
30
30
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 text-sm text-tone-600", children: [
|
|
31
31
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
32
32
|
/* @__PURE__ */ jsx("span", { className: "font-medium", children: from }),
|
package/dist/AdminSidePanel.js
CHANGED
|
@@ -84,8 +84,8 @@ function ItemRow({ item, active, leading, selecting, checked, onClick }) {
|
|
|
84
84
|
"aria-pressed": selecting ? checked : void 0,
|
|
85
85
|
className: `flex-1 min-w-0 text-left flex gap-3 p-2 rounded-xl transition-colors border ${selecting && checked ? "bg-accent/[0.07] border-accent/30" : !selecting && active ? "bg-accent/[0.07] border-accent/20" : "border-transparent hover:bg-tone-50"}`,
|
|
86
86
|
children: [
|
|
87
|
-
selecting && /* @__PURE__ */ jsx("span", { className: `mt-0.5 w-4 h-4 rounded border flex items-center justify-center shrink-0 ${checked ? "bg-accent border-accent text-white" : "border-tone-300 bg-
|
|
88
|
-
Icon && /* @__PURE__ */ jsx("span", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${active ? "bg-
|
|
87
|
+
selecting && /* @__PURE__ */ jsx("span", { className: `mt-0.5 w-4 h-4 rounded border flex items-center justify-center shrink-0 ${checked ? "bg-accent border-accent text-white" : "border-tone-300 bg-surface"}`, "aria-hidden": "true", children: checked && /* @__PURE__ */ jsx(Check, { className: "w-3 h-3", strokeWidth: 3 }) }),
|
|
88
|
+
Icon && /* @__PURE__ */ jsx("span", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${active ? "bg-surface shadow-sm" : "bg-tone-50"}`, children: /* @__PURE__ */ jsx(Icon, { className: `w-4 h-4 ${active ? "text-accent" : "text-tone-500"}`, "aria-hidden": "true" }) }),
|
|
89
89
|
/* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
90
90
|
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
|
|
91
91
|
/* @__PURE__ */ jsx("span", { className: `text-sm font-medium truncate ${!selecting && active ? "text-accent-dark" : item.muted ? "text-tone-400" : "text-tone-800"}`, children: item.label }),
|
|
@@ -152,7 +152,7 @@ function DraggableRow({ entry, onDrop, onMove, renderRow }) {
|
|
|
152
152
|
dragListener: false,
|
|
153
153
|
dragControls: controls,
|
|
154
154
|
onDragEnd: onDrop,
|
|
155
|
-
className: "relative bg-
|
|
155
|
+
className: "relative bg-surface rounded-xl",
|
|
156
156
|
whileDrag: { scale: 1.02, boxShadow: "0 8px 24px rgba(0,0,0,0.08)", zIndex: 1 },
|
|
157
157
|
children: renderRow(entry, handle)
|
|
158
158
|
}
|
|
@@ -216,7 +216,7 @@ function BulkBar({ selection, actions }) {
|
|
|
216
216
|
" selected"
|
|
217
217
|
] }),
|
|
218
218
|
/* @__PURE__ */ jsx("button", { type: "button", onClick: selection.toggleAll, className: "text-accent-dark hover:underline", children: selected.length === selectable.length && selectable.length > 0 ? "Select none" : "Select all" }),
|
|
219
|
-
/* @__PURE__ */ jsx("button", { type: "button", onClick: selection.stop, className: "ml-auto px-2 py-1 rounded-lg font-medium text-tone-600 hover:bg-
|
|
219
|
+
/* @__PURE__ */ jsx("button", { type: "button", onClick: selection.stop, className: "ml-auto px-2 py-1 rounded-lg font-medium text-tone-600 hover:bg-surface", children: "Done" })
|
|
220
220
|
] }),
|
|
221
221
|
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: actions.map((entry) => /* @__PURE__ */ jsx(
|
|
222
222
|
Button,
|
|
@@ -259,7 +259,7 @@ function SidePanelRail({ panel, onExpand }) {
|
|
|
259
259
|
{
|
|
260
260
|
"aria-label": panel.title,
|
|
261
261
|
"data-side-panel": "collapsed",
|
|
262
|
-
className: "hidden lg:flex flex-col items-center gap-1.5 w-12 shrink-0 py-2 lg:sticky lg:top-20 self-start lg:max-h-[calc(100dvh-6.5rem)] overflow-y-auto scrollbar-hide bg-
|
|
262
|
+
className: "hidden lg:flex flex-col items-center gap-1.5 w-12 shrink-0 py-2 lg:sticky lg:top-20 self-start lg:max-h-[calc(100dvh-6.5rem)] overflow-y-auto scrollbar-hide bg-surface rounded-2xl shadow-sm border border-tone-100",
|
|
263
263
|
children: [
|
|
264
264
|
/* @__PURE__ */ jsx(
|
|
265
265
|
"button",
|
|
@@ -316,7 +316,7 @@ function SidePanelAside({ panel }) {
|
|
|
316
316
|
{
|
|
317
317
|
"aria-label": panel.title,
|
|
318
318
|
"data-side-panel": true,
|
|
319
|
-
className: "hidden lg:flex flex-col w-80 xl:w-[22rem] shrink-0 lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)] fit:max-h-full self-start fit:self-stretch bg-
|
|
319
|
+
className: "hidden lg:flex flex-col w-80 xl:w-[22rem] shrink-0 lg:sticky lg:top-20 lg:max-h-[calc(100dvh-6.5rem)] fit:max-h-full self-start fit:self-stretch bg-surface rounded-2xl shadow-sm border border-tone-100 overflow-hidden",
|
|
320
320
|
children: [
|
|
321
321
|
/* @__PURE__ */ jsxs("div", { className: "shrink-0 p-4 pb-3 space-y-3 border-b border-tone-100", children: [
|
|
322
322
|
/* @__PURE__ */ jsxs(PanelHeader, { panel, children: [
|
|
@@ -397,7 +397,7 @@ function BottomSheet({ panel, manage, onClose }) {
|
|
|
397
397
|
onDragEnd: (_, info) => {
|
|
398
398
|
if (info.offset.y > 90 || info.velocity.y > 500) onClose();
|
|
399
399
|
},
|
|
400
|
-
className: "w-full max-h-[78dvh] bg-
|
|
400
|
+
className: "w-full max-h-[78dvh] bg-surface rounded-t-3xl shadow-2xl flex flex-col pb-[env(safe-area-inset-bottom)]",
|
|
401
401
|
onClick: (e) => e.stopPropagation(),
|
|
402
402
|
children: [
|
|
403
403
|
/* @__PURE__ */ jsxs(
|
|
@@ -24,7 +24,7 @@ function AdminSummaryCards({ cards = [], columns = 4 }) {
|
|
|
24
24
|
animate: { opacity: 1, y: 0 },
|
|
25
25
|
transition: { delay: index * 0.05, duration: 0.2 },
|
|
26
26
|
"aria-pressed": stat.onClick ? !!stat.active : void 0,
|
|
27
|
-
className: `px-3.5 py-3 rounded-2xl bg-
|
|
27
|
+
className: `px-3.5 py-3 rounded-2xl bg-surface 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
28
|
style: { boxShadow: "0 4px 20px color-mix(in srgb, var(--color-accent) 8%, transparent)" },
|
|
29
29
|
children: [
|
|
30
30
|
/* @__PURE__ */ jsx(
|
|
@@ -55,7 +55,7 @@ function AdminToolbarFilters({ filters }) {
|
|
|
55
55
|
onClick: () => setOpen((v) => !v),
|
|
56
56
|
"aria-haspopup": "dialog",
|
|
57
57
|
"aria-expanded": open,
|
|
58
|
-
className: `flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all border ${activeCount > 0 ? "bg-accent/10 text-accent-dark border-accent/30" : "bg-
|
|
58
|
+
className: `flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium transition-all border ${activeCount > 0 ? "bg-accent/10 text-accent-dark border-accent/30" : "bg-surface/80 text-body hover:bg-surface border-tone-200/60"}`,
|
|
59
59
|
title: "Filter & sort",
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "w-4 h-4" }),
|
|
@@ -73,7 +73,7 @@ function AdminToolbarFilters({ filters }) {
|
|
|
73
73
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
74
74
|
exit: { opacity: 0, y: 8, scale: 0.97 },
|
|
75
75
|
transition: { duration: 0.15 },
|
|
76
|
-
className: "absolute bottom-full left-0 mb-3 w-[min(20rem,calc(100vw-2rem))] max-h-[60vh] overflow-y-auto bg-
|
|
76
|
+
className: "absolute bottom-full left-0 mb-3 w-[min(20rem,calc(100vw-2rem))] max-h-[60vh] overflow-y-auto bg-surface rounded-2xl shadow-2xl border border-tone-100 p-4 space-y-4 text-left",
|
|
77
77
|
children: [
|
|
78
78
|
groups.map((group) => /* @__PURE__ */ jsxs("div", { children: [
|
|
79
79
|
/* @__PURE__ */ jsx("p", { className: "text-[11px] font-semibold uppercase tracking-wider text-tone-500 mb-2", children: group.label || "Show" }),
|
|
@@ -38,7 +38,7 @@ function AdminToolbarSearch({ placeholder = "Search...", value, onChange }) {
|
|
|
38
38
|
placeholder,
|
|
39
39
|
"aria-label": placeholder,
|
|
40
40
|
title: "Search (press / to focus)",
|
|
41
|
-
className: "w-28 sm:w-52 xl:w-60 pl-9 pr-8 py-2 sm:py-2.5 rounded-xl border border-tone-200/60 bg-
|
|
41
|
+
className: "w-28 sm:w-52 xl:w-60 pl-9 pr-8 py-2 sm:py-2.5 rounded-xl border border-tone-200/60 bg-surface/80 text-sm text-tone-700 focus:bg-surface focus:outline-none focus:ring-2 focus:ring-accent/30 focus:border-accent [&::-webkit-search-cancel-button]:hidden"
|
|
42
42
|
}
|
|
43
43
|
),
|
|
44
44
|
query && /* @__PURE__ */ jsx(
|
package/dist/AdminTutorial.js
CHANGED
|
@@ -140,7 +140,7 @@ function AdminTutorial({ steps, onComplete, isRestarted = false }) {
|
|
|
140
140
|
initial: { opacity: 0, scale: 0.95 },
|
|
141
141
|
animate: { opacity: 1, scale: 1 },
|
|
142
142
|
style: boxStyle,
|
|
143
|
-
className: "absolute w-[calc(100%-48px)] max-w-sm max-h-[calc(100vh-32px)] flex flex-col bg-
|
|
143
|
+
className: "absolute w-[calc(100%-48px)] max-w-sm max-h-[calc(100vh-32px)] flex flex-col bg-surface rounded-3xl shadow-2xl overflow-hidden pointer-events-auto border-2 border-accent/30",
|
|
144
144
|
children: [
|
|
145
145
|
/* @__PURE__ */ jsx("div", { className: "h-1.5 w-full bg-tone-100", children: /* @__PURE__ */ jsx(
|
|
146
146
|
motion.div,
|
|
@@ -182,7 +182,7 @@ function AdminTutorial({ steps, onComplete, isRestarted = false }) {
|
|
|
182
182
|
},
|
|
183
183
|
currentStep
|
|
184
184
|
) }) }),
|
|
185
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-t border-tone-100 bg-
|
|
185
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-t border-tone-100 bg-surface rounded-b-3xl", children: [
|
|
186
186
|
/* @__PURE__ */ jsxs("div", { className: "flex gap-1.5", children: [
|
|
187
187
|
/* @__PURE__ */ jsx(
|
|
188
188
|
Button,
|
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/DashboardHeader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { usePermissions } from "@okjt/ui";
|
|
|
5
5
|
import { useCollaboration } from "./CollaborationContext.js";
|
|
6
6
|
import CollaboratorAvatars from "./CollaboratorAvatars.js";
|
|
7
7
|
import { useDashboard } from "./DashboardProvider.js";
|
|
8
|
-
function DashboardHeader({ onMenuClick, onRestartTutorial, titleSlotRef, statusSlotRef }) {
|
|
8
|
+
function DashboardHeader({ onMenuClick, onRestartTutorial, titleSlotRef, statusSlotRef, menuExpanded }) {
|
|
9
9
|
const { pathname } = useLocation();
|
|
10
10
|
const { presence, othersHere, openHistory, setShareOpen, badges } = useCollaboration();
|
|
11
11
|
const hasNews = Object.values(badges).some(Boolean);
|
|
@@ -16,27 +16,29 @@ function DashboardHeader({ onMenuClick, onRestartTutorial, titleSlotRef, statusS
|
|
|
16
16
|
"header",
|
|
17
17
|
{
|
|
18
18
|
id: "header",
|
|
19
|
-
className:
|
|
19
|
+
className: `sticky top-0 z-30 h-16 ${shell.headerClass} flex items-center justify-between gap-3`,
|
|
20
20
|
style: {
|
|
21
21
|
background: shell.headerBackground,
|
|
22
22
|
backdropFilter: "blur(10px)",
|
|
23
23
|
borderBottom: shell.headerBorder
|
|
24
24
|
},
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
26
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center ${shell.headerStartClass}`, children: [
|
|
27
27
|
/* @__PURE__ */ jsxs(
|
|
28
28
|
"button",
|
|
29
29
|
{
|
|
30
30
|
onClick: onMenuClick,
|
|
31
31
|
"aria-label": hasNews ? "Open sidebar menu (new changes)" : "Open sidebar menu",
|
|
32
|
-
|
|
32
|
+
"aria-expanded": shell.collapsible ? menuExpanded : void 0,
|
|
33
|
+
className: `${shell.collapsible ? "" : "lg:hidden "}relative p-2 rounded-lg shrink-0 ${shell.menuButtonClass}`,
|
|
33
34
|
children: [
|
|
34
|
-
/* @__PURE__ */ jsx(Menu, { className: "w-6 h-6 text-body" }),
|
|
35
|
-
hasNews && /* @__PURE__ */ jsx("span", { className:
|
|
35
|
+
shell.MenuIcon ? /* @__PURE__ */ jsx(shell.MenuIcon, {}) : /* @__PURE__ */ jsx(Menu, { className: "w-6 h-6 text-body" }),
|
|
36
|
+
hasNews && /* @__PURE__ */ jsx("span", { className: `absolute top-1.5 right-1.5 w-2 h-2 rounded-full bg-accent ring-2 ring-paper ${shell.collapsible ? "lg:hidden" : ""}`, "aria-hidden": "true" })
|
|
36
37
|
]
|
|
37
38
|
}
|
|
38
39
|
),
|
|
39
|
-
/* @__PURE__ */ jsx("div", { ref: titleSlotRef, className:
|
|
40
|
+
/* @__PURE__ */ jsx("div", { ref: titleSlotRef, className: `min-w-0 ${shell.HeaderStart ? "empty:hidden" : "flex-1"}` }),
|
|
41
|
+
shell.HeaderStart && /* @__PURE__ */ jsx(shell.HeaderStart, {}),
|
|
40
42
|
othersHere.length > 0 && /* @__PURE__ */ jsxs(
|
|
41
43
|
"button",
|
|
42
44
|
{
|
|
@@ -51,7 +53,7 @@ function DashboardHeader({ onMenuClick, onRestartTutorial, titleSlotRef, statusS
|
|
|
51
53
|
}
|
|
52
54
|
)
|
|
53
55
|
] }),
|
|
54
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: `flex items-center ${shell.headerEndClass}`, children: [
|
|
55
57
|
!canEdit && /* @__PURE__ */ jsx(
|
|
56
58
|
"span",
|
|
57
59
|
{
|
|
@@ -80,54 +82,67 @@ function DashboardHeader({ onMenuClick, onRestartTutorial, titleSlotRef, statusS
|
|
|
80
82
|
link.path
|
|
81
83
|
);
|
|
82
84
|
}) }),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
className: "hidden md:flex p-1 rounded-full hover:bg-black/5",
|
|
89
|
-
"aria-label": `${presence.length} collaborator${presence.length === 1 ? "" : "s"} online`,
|
|
90
|
-
children: /* @__PURE__ */ jsx(CollaboratorAvatars, { people: presence, max: 3 })
|
|
85
|
+
shell.Search && /* @__PURE__ */ jsx(shell.Search, {}),
|
|
86
|
+
shell.headerActions.map((action, i) => {
|
|
87
|
+
if (typeof action === "function" || typeof action === "object") {
|
|
88
|
+
const Action = action;
|
|
89
|
+
return /* @__PURE__ */ jsx(Action, {}, `own-${i}`);
|
|
91
90
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
91
|
+
if (action === "online") return presence.length > 0 && // Who's online (click for the share panel)
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
"button",
|
|
94
|
+
{
|
|
95
|
+
type: "button",
|
|
96
|
+
onClick: () => setShareOpen(true),
|
|
97
|
+
className: "hidden md:flex p-1 rounded-full hover:bg-contrast/5",
|
|
98
|
+
"aria-label": `${presence.length} collaborator${presence.length === 1 ? "" : "s"} online`,
|
|
99
|
+
children: /* @__PURE__ */ jsx(CollaboratorAvatars, { people: presence, max: 3 })
|
|
100
|
+
},
|
|
101
|
+
"online"
|
|
102
|
+
);
|
|
103
|
+
if (action === "share") return /* @__PURE__ */ jsxs(
|
|
104
|
+
"button",
|
|
105
|
+
{
|
|
106
|
+
id: "header-share",
|
|
107
|
+
type: "button",
|
|
108
|
+
onClick: () => setShareOpen(true),
|
|
109
|
+
"aria-label": "Share dashboard",
|
|
110
|
+
title: "Share \u2014 invite collaborators",
|
|
111
|
+
className: `flex items-center gap-2 p-2 xl:px-3 rounded-xl text-sm font-medium transition-colors ${shell.headerButtonClass}`,
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsx(Share2, { className: "w-5 h-5" }),
|
|
114
|
+
/* @__PURE__ */ jsx("span", { className: "hidden xl:inline", children: "Share" })
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
"share"
|
|
118
|
+
);
|
|
119
|
+
if (action === "history") return /* @__PURE__ */ jsx(
|
|
120
|
+
"button",
|
|
121
|
+
{
|
|
122
|
+
id: "header-history",
|
|
123
|
+
type: "button",
|
|
124
|
+
onClick: openHistory,
|
|
125
|
+
"aria-label": "Version history",
|
|
126
|
+
title: "Version history",
|
|
127
|
+
className: `p-2 rounded-xl transition-colors ${shell.headerButtonClass}`,
|
|
128
|
+
children: /* @__PURE__ */ jsx(History, { className: "w-5 h-5" })
|
|
129
|
+
},
|
|
130
|
+
"history"
|
|
131
|
+
);
|
|
132
|
+
if (action === "tour") return /* @__PURE__ */ jsx(
|
|
133
|
+
"button",
|
|
134
|
+
{
|
|
135
|
+
"aria-label": "Restart Dashboard Tour",
|
|
136
|
+
id: "header-restart",
|
|
137
|
+
onClick: onRestartTutorial,
|
|
138
|
+
className: "hidden sm:block p-2 rounded-xl text-muted hover:bg-contrast/5 transition-colors",
|
|
139
|
+
title: "Restart Dashboard Tour",
|
|
140
|
+
children: /* @__PURE__ */ jsx(Info, { className: "w-5 h-5" })
|
|
141
|
+
},
|
|
142
|
+
"tour"
|
|
143
|
+
);
|
|
144
|
+
return null;
|
|
145
|
+
}),
|
|
131
146
|
shell.Notifications && /* @__PURE__ */ jsx(shell.Notifications, {}),
|
|
132
147
|
shell.AccountMenu && /* @__PURE__ */ jsx(shell.AccountMenu, { compactLinks: quickLinks })
|
|
133
148
|
] })
|
|
@@ -30,7 +30,33 @@ const DEFAULT_SHELL = {
|
|
|
30
30
|
badgeClass: "bg-accent-soft text-body",
|
|
31
31
|
Banner: null,
|
|
32
32
|
Notifications: null,
|
|
33
|
-
AccountMenu: null
|
|
33
|
+
AccountMenu: null,
|
|
34
|
+
// The frame's shape and look (defaults: Naoa's).
|
|
35
|
+
sidebarWidth: 280,
|
|
36
|
+
collapsible: false,
|
|
37
|
+
railWidth: 80,
|
|
38
|
+
sidebarClass: "",
|
|
39
|
+
logoBoxClass: "p-4",
|
|
40
|
+
logoClass: "h-10 w-auto",
|
|
41
|
+
railLogoClass: "h-9 w-12 object-contain",
|
|
42
|
+
navTitleClass: "px-3 mb-1 text-[10px] font-bold uppercase tracking-[0.18em] text-white/50",
|
|
43
|
+
navItemClass: "px-3 py-2 rounded-lg",
|
|
44
|
+
navActiveClass: "text-accent-dark bg-white shadow-sm",
|
|
45
|
+
navIdleClass: "text-white/75 hover:text-accent-dark hover:bg-white",
|
|
46
|
+
navLabelClass: "font-medium truncate",
|
|
47
|
+
navClass: "py-2 px-3",
|
|
48
|
+
headerClass: "px-3 sm:px-6",
|
|
49
|
+
headerStartClass: "gap-2 sm:gap-4 min-w-0 flex-1",
|
|
50
|
+
headerEndClass: "gap-1 sm:gap-2 shrink-0",
|
|
51
|
+
menuButtonClass: "hover:bg-contrast/5",
|
|
52
|
+
MenuIcon: null,
|
|
53
|
+
mainClass: "p-4 sm:p-6",
|
|
54
|
+
headerButtonClass: "text-soft hover:bg-accent/10 hover:text-accent",
|
|
55
|
+
headerActions: ["online", "share", "history", "tour"],
|
|
56
|
+
HeaderStart: null,
|
|
57
|
+
Search: null,
|
|
58
|
+
HistoryDrawer: null,
|
|
59
|
+
ShareModal: null
|
|
34
60
|
};
|
|
35
61
|
function DashboardProvider({ dashboard, children }) {
|
|
36
62
|
return /* @__PURE__ */ jsx(DashboardContext.Provider, { value: dashboard, children });
|
package/dist/DashboardShell.js
CHANGED
|
@@ -20,12 +20,22 @@ function ResetSearchOnNavigate({ pathname }) {
|
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
22
|
function CollaborationPanels() {
|
|
23
|
+
const { shell } = useDashboard();
|
|
23
24
|
const { shareOpen, setShareOpen, historyOpen, closeHistory, module, notifyDataRestored } = useCollaboration();
|
|
24
25
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
/* @__PURE__ */ jsx(ShareModal, { isOpen: shareOpen, onClose: () => setShareOpen(false) }),
|
|
26
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: historyOpen && /* @__PURE__ */ jsx(VersionHistoryDrawer, { module, onClose: closeHistory, onRestored: notifyDataRestored }) })
|
|
26
|
+
shell.ShareModal ? /* @__PURE__ */ jsx(shell.ShareModal, { open: shareOpen, onClose: () => setShareOpen(false) }) : /* @__PURE__ */ jsx(ShareModal, { isOpen: shareOpen, onClose: () => setShareOpen(false) }),
|
|
27
|
+
shell.HistoryDrawer ? /* @__PURE__ */ jsx(shell.HistoryDrawer, { open: historyOpen, onClose: closeHistory, module, onRestored: notifyDataRestored }) : /* @__PURE__ */ jsx(AnimatePresence, { children: historyOpen && /* @__PURE__ */ jsx(VersionHistoryDrawer, { module, onClose: closeHistory, onRestored: notifyDataRestored }) })
|
|
27
28
|
] });
|
|
28
29
|
}
|
|
30
|
+
const COLLAPSED_KEY = "okjt.sidebar.collapsed";
|
|
31
|
+
const readCollapsed = () => {
|
|
32
|
+
try {
|
|
33
|
+
return localStorage.getItem(COLLAPSED_KEY) === "1";
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const isWide = () => typeof window !== "undefined" && window.matchMedia?.("(min-width: 1024px)").matches;
|
|
29
39
|
function PageContent({ pathname, children }) {
|
|
30
40
|
const { dataVersion } = useCollaboration();
|
|
31
41
|
return /* @__PURE__ */ jsx(
|
|
@@ -42,6 +52,18 @@ function PageContent({ pathname, children }) {
|
|
|
42
52
|
function DashboardShell({ children }) {
|
|
43
53
|
const { shell, tutorialSteps } = useDashboard();
|
|
44
54
|
const [sidebarOpen, setSidebarOpen] = useState(false);
|
|
55
|
+
const [collapsed, setCollapsed] = useState(() => shell.collapsible && readCollapsed());
|
|
56
|
+
const onMenuClick = () => {
|
|
57
|
+
if (!shell.collapsible || !isWide()) return setSidebarOpen(true);
|
|
58
|
+
setCollapsed((was) => {
|
|
59
|
+
try {
|
|
60
|
+
localStorage.setItem(COLLAPSED_KEY, was ? "0" : "1");
|
|
61
|
+
} catch {
|
|
62
|
+
}
|
|
63
|
+
return !was;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
const sidebarWidth = collapsed ? shell.railWidth : shell.sidebarWidth;
|
|
45
67
|
const [restartTutorial, setRestartTutorial] = useState(false);
|
|
46
68
|
const location = useLocation();
|
|
47
69
|
const [titleSlot, setTitleSlot] = useState(null);
|
|
@@ -50,6 +72,10 @@ function DashboardShell({ children }) {
|
|
|
50
72
|
document.documentElement.classList.add("admin-theme");
|
|
51
73
|
return () => document.documentElement.classList.remove("admin-theme");
|
|
52
74
|
}, []);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
document.documentElement.style.setProperty("--okjt-sidebar-w", `${sidebarWidth}px`);
|
|
77
|
+
return () => document.documentElement.style.removeProperty("--okjt-sidebar-w");
|
|
78
|
+
}, [sidebarWidth]);
|
|
53
79
|
return /* @__PURE__ */ jsx(MotionConfig, { reducedMotion: "user", children: /* @__PURE__ */ jsx(SearchProvider, { children: /* @__PURE__ */ jsx(AdminChromeProvider, { value: { titleSlot, statusSlot }, children: /* @__PURE__ */ jsxs(CollaborationProvider, { children: [
|
|
54
80
|
/* @__PURE__ */ jsx(ResetSearchOnNavigate, { pathname: location.pathname }),
|
|
55
81
|
/* @__PURE__ */ jsxs(
|
|
@@ -58,12 +84,13 @@ function DashboardShell({ children }) {
|
|
|
58
84
|
className: "min-h-screen",
|
|
59
85
|
style: { background: shell.background },
|
|
60
86
|
children: [
|
|
61
|
-
/* @__PURE__ */ jsx(DashboardSidebar, { isOpen: sidebarOpen, onClose: () => setSidebarOpen(false) }),
|
|
62
|
-
/* @__PURE__ */ jsxs("div", { className: "lg:ml-[280px]", children: [
|
|
87
|
+
/* @__PURE__ */ jsx(DashboardSidebar, { isOpen: sidebarOpen, onClose: () => setSidebarOpen(false), collapsed }),
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "lg:ml-[var(--okjt-sidebar-w,280px)]", children: [
|
|
63
89
|
/* @__PURE__ */ jsx(
|
|
64
90
|
DashboardHeader,
|
|
65
91
|
{
|
|
66
|
-
onMenuClick
|
|
92
|
+
onMenuClick,
|
|
93
|
+
menuExpanded: !collapsed,
|
|
67
94
|
onRestartTutorial: () => setRestartTutorial((prev) => !prev),
|
|
68
95
|
titleSlotRef: setTitleSlot,
|
|
69
96
|
statusSlotRef: setStatusSlot
|
|
@@ -81,7 +108,7 @@ function DashboardShell({ children }) {
|
|
|
81
108
|
},
|
|
82
109
|
restartTutorial ? "restarted" : "initial"
|
|
83
110
|
),
|
|
84
|
-
/* @__PURE__ */ jsx("main", {
|
|
111
|
+
/* @__PURE__ */ jsx("main", { id: "main-content", tabIndex: -1, className: shell.mainClass, children: /* @__PURE__ */ jsx(PageContent, { pathname: location.pathname, children }) })
|
|
85
112
|
] })
|
|
86
113
|
]
|
|
87
114
|
}
|
package/dist/DashboardSidebar.js
CHANGED
|
@@ -6,11 +6,12 @@ import { useCollaboration } from "./CollaborationContext.js";
|
|
|
6
6
|
import CollaboratorAvatars from "./CollaboratorAvatars.js";
|
|
7
7
|
import { useDashboard } from "./DashboardProvider.js";
|
|
8
8
|
import { useModules } from "./modules.js";
|
|
9
|
-
function DashboardSidebar({ isOpen, onClose }) {
|
|
9
|
+
function DashboardSidebar({ isOpen, onClose, collapsed = false }) {
|
|
10
10
|
const location = useLocation();
|
|
11
11
|
const { home, shell } = useDashboard();
|
|
12
12
|
const { moduleForPath } = useModules();
|
|
13
13
|
const { badges, presence } = useCollaboration();
|
|
14
|
+
const rail = collapsed && !isOpen;
|
|
14
15
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
16
|
/* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(
|
|
16
17
|
motion.div,
|
|
@@ -25,19 +26,19 @@ function DashboardSidebar({ isOpen, onClose }) {
|
|
|
25
26
|
/* @__PURE__ */ jsx(
|
|
26
27
|
motion.aside,
|
|
27
28
|
{
|
|
28
|
-
className: `admin-sidebar fixed left-0 top-0 h-full z-50 lg:translate-x-0 ${isOpen ? "translate-x-0" : "-translate-x-full"} transition-transform lg:transition-none`,
|
|
29
|
+
className: `admin-sidebar fixed left-0 top-0 h-full z-50 lg:translate-x-0 ${shell.sidebarClass} ${isOpen ? "translate-x-0" : "-translate-x-full"} transition-transform lg:transition-none`,
|
|
29
30
|
style: {
|
|
30
|
-
width:
|
|
31
|
+
width: rail ? shell.railWidth : shell.sidebarWidth,
|
|
31
32
|
background: shell.sidebarBackground
|
|
32
33
|
},
|
|
33
34
|
children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col h-full", children: [
|
|
34
|
-
/* @__PURE__ */ jsxs("div", { className: "p-4 flex items-center justify-center relative
|
|
35
|
+
/* @__PURE__ */ jsxs("div", { className: `${rail ? "p-2 py-4" : shell.logoBoxClass} flex items-center justify-center relative`, children: [
|
|
35
36
|
/* @__PURE__ */ jsx(Link, { to: shell.logo.to, className: "flex items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
36
37
|
"img",
|
|
37
38
|
{
|
|
38
39
|
src: shell.logo.src,
|
|
39
40
|
alt: shell.logo.alt,
|
|
40
|
-
className:
|
|
41
|
+
className: rail ? shell.railLogoClass : shell.logoClass
|
|
41
42
|
}
|
|
42
43
|
) }),
|
|
43
44
|
/* @__PURE__ */ jsx(
|
|
@@ -50,9 +51,10 @@ function DashboardSidebar({ isOpen, onClose }) {
|
|
|
50
51
|
}
|
|
51
52
|
)
|
|
52
53
|
] }),
|
|
53
|
-
/* @__PURE__ */ jsx("nav", { "aria-label": "Main", className:
|
|
54
|
-
section.title && /* @__PURE__ */ jsx("p", { className:
|
|
55
|
-
/* @__PURE__ */ jsx("
|
|
54
|
+
/* @__PURE__ */ jsx("nav", { "aria-label": "Main", className: `flex-1 ${shell.navClass} overflow-y-auto`, style: { scrollbarWidth: "thin", scrollbarColor: shell.sidebarScrollbar }, children: shell.nav.map((section, sectionIndex) => /* @__PURE__ */ jsxs("div", { className: sectionIndex > 0 ? "mt-4" : "", children: [
|
|
55
|
+
section.title && !rail && /* @__PURE__ */ jsx("p", { className: shell.navTitleClass, children: section.title }),
|
|
56
|
+
section.title && rail && /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: "mx-3 mb-2 h-px bg-white/10" }),
|
|
57
|
+
/* @__PURE__ */ jsx("ul", { className: "space-y-0.5", "aria-label": section.title || void 0, children: section.items.map((item) => {
|
|
56
58
|
const isActive = location.pathname === item.path || item.path !== home.path && location.pathname.startsWith(item.path);
|
|
57
59
|
const moduleKey = moduleForPath(item.path)?.key;
|
|
58
60
|
const newCount = isActive ? 0 : badges[moduleKey] || 0;
|
|
@@ -65,16 +67,20 @@ function DashboardSidebar({ isOpen, onClose }) {
|
|
|
65
67
|
to: item.path,
|
|
66
68
|
onClick: () => onClose(),
|
|
67
69
|
"aria-current": isActive ? "page" : void 0,
|
|
68
|
-
"aria-label": label !== item.label ? label : void 0,
|
|
69
|
-
|
|
70
|
+
"aria-label": rail || label !== item.label ? label : void 0,
|
|
71
|
+
title: rail ? item.label : void 0,
|
|
72
|
+
className: `flex items-center ${rail ? "justify-center" : "gap-3"} ${shell.navItemClass} transition-all text-sm focus-visible:outline-2 focus-visible:outline-white ${isActive ? shell.navActiveClass : shell.navIdleClass}`,
|
|
70
73
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
73
|
-
|
|
74
|
+
rail ? /* @__PURE__ */ jsxs("span", { className: "relative flex flex-shrink-0", children: [
|
|
75
|
+
/* @__PURE__ */ jsx(item.icon, { className: "w-4 h-4", "aria-hidden": "true" }),
|
|
76
|
+
newCount > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "absolute -right-1 -top-1 h-2 w-2 rounded-full bg-accent" })
|
|
77
|
+
] }) : /* @__PURE__ */ jsx(item.icon, { className: "w-4 h-4 flex-shrink-0", "aria-hidden": "true" }),
|
|
78
|
+
!rail && /* @__PURE__ */ jsx("span", { className: shell.navLabelClass, children: item.label }),
|
|
79
|
+
!rail && (here.length > 0 || newCount > 0) && /* @__PURE__ */ jsxs("span", { className: "ml-auto flex items-center gap-1.5 shrink-0", "aria-hidden": "true", children: [
|
|
74
80
|
/* @__PURE__ */ jsx(CollaboratorAvatars, { people: here, size: "xs", max: 2 }),
|
|
75
81
|
newCount > 0 && /* @__PURE__ */ jsx("span", { className: `min-w-[1.25rem] h-5 px-1.5 rounded-full ${shell.badgeClass} text-[10px] font-bold flex items-center justify-center`, children: newCount > 99 ? "99+" : newCount })
|
|
76
82
|
] }),
|
|
77
|
-
isActive && /* @__PURE__ */ jsx(
|
|
83
|
+
isActive && !rail && /* @__PURE__ */ jsx(
|
|
78
84
|
motion.div,
|
|
79
85
|
{
|
|
80
86
|
layoutId: "sidebar-indicator",
|
|
@@ -89,7 +89,7 @@ function NotificationsBell() {
|
|
|
89
89
|
"aria-label": unreadCount > 0 ? `Notifications, ${unreadCount} unread` : "Notifications",
|
|
90
90
|
"aria-haspopup": "true",
|
|
91
91
|
"aria-expanded": showNotifications,
|
|
92
|
-
className: "relative p-2 rounded-xl hover:bg-
|
|
92
|
+
className: "relative p-2 rounded-xl hover:bg-contrast/5",
|
|
93
93
|
children: [
|
|
94
94
|
/* @__PURE__ */ jsx(Bell, { className: "w-5 h-5 text-soft" }),
|
|
95
95
|
/* @__PURE__ */ jsx(
|
|
@@ -108,7 +108,7 @@ function NotificationsBell() {
|
|
|
108
108
|
initial: { opacity: 0, y: 10, scale: 0.95 },
|
|
109
109
|
animate: { opacity: 1, y: 0, scale: 1 },
|
|
110
110
|
exit: { opacity: 0, y: 10, scale: 0.95 },
|
|
111
|
-
className: "absolute top-full right-0 mt-2 w-80 bg-
|
|
111
|
+
className: "absolute top-full right-0 mt-2 w-80 bg-surface rounded-2xl shadow-xl border border-tone-100 py-2 z-50 overflow-hidden",
|
|
112
112
|
children: [
|
|
113
113
|
/* @__PURE__ */ jsxs("div", { className: "px-4 py-2 border-b border-tone-50 flex justify-between items-center", children: [
|
|
114
114
|
/* @__PURE__ */ jsx("span", { className: "text-tone-800 font-medium", children: "Notifications" }),
|
package/dist/ShareModal.js
CHANGED
|
@@ -11,7 +11,7 @@ import { CollaboratorAvatar } from "./CollaboratorAvatars.js";
|
|
|
11
11
|
import { useDashboard } from "./DashboardProvider.js";
|
|
12
12
|
import { useModules } from "./modules.js";
|
|
13
13
|
const EMPTY_FORM = { name: "", email: "", message: "", role: "editor" };
|
|
14
|
-
const selectClass = "px-2 py-1.5 rounded-lg border border-tone-200 bg-
|
|
14
|
+
const selectClass = "px-2 py-1.5 rounded-lg border border-tone-200 bg-surface text-xs text-tone-700 focus:outline-none focus:ring-2 focus:ring-accent/20";
|
|
15
15
|
function CopyField({ value, label }) {
|
|
16
16
|
const [copied, setCopied] = useState(false);
|
|
17
17
|
const copy = async () => {
|
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
|
{
|
|
@@ -110,7 +110,7 @@ function VersionHistoryDrawer({ module, onClose, onRestored }) {
|
|
|
110
110
|
exit: { x: "100%" },
|
|
111
111
|
transition: { type: "spring", damping: 32, stiffness: 300 },
|
|
112
112
|
onClick: (e) => e.stopPropagation(),
|
|
113
|
-
className: "h-full w-full max-w-md bg-
|
|
113
|
+
className: "h-full w-full max-w-md bg-surface shadow-2xl flex flex-col",
|
|
114
114
|
children: [
|
|
115
115
|
/* @__PURE__ */ jsxs("div", { className: "shrink-0 px-4 py-3 border-b border-tone-100 space-y-3", children: [
|
|
116
116
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -147,7 +147,7 @@ function VersionHistoryDrawer({ module, onClose, onRestored }) {
|
|
|
147
147
|
const header = day !== lastDay ? day : null;
|
|
148
148
|
lastDay = day;
|
|
149
149
|
return /* @__PURE__ */ jsxs("li", { children: [
|
|
150
|
-
header && /* @__PURE__ */ jsx("h3", { className: "sticky top-0 z-10 bg-
|
|
150
|
+
header && /* @__PURE__ */ jsx("h3", { className: "sticky top-0 z-10 bg-surface/95 backdrop-blur pt-3 pb-1 text-[11px] font-bold uppercase tracking-wider text-tone-500", children: header }),
|
|
151
151
|
/* @__PURE__ */ jsx("ul", { className: "divide-y divide-tone-100", children: /* @__PURE__ */ jsx(
|
|
152
152
|
Entry,
|
|
153
153
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okjt/dashboard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
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",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"test": "node build.mjs && vitest run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@okjt/ui": "^0.
|
|
26
|
+
"@okjt/ui": "^0.2.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@tanstack/react-query": ">=5",
|