nucleus-core-ts 0.8.7 → 0.8.8
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/client.js +1 -1
- package/dist/fe/components/AbstractAnimatedBackground/index.js +437 -0
- package/dist/fe/components/AuthorizationPage/components/AuthorizationPage.js +841 -0
- package/dist/fe/components/AuthorizationPage/components/ClaimList.js +100 -0
- package/dist/fe/components/AuthorizationPage/components/RoleClaimEditor.js +232 -0
- package/dist/fe/components/AuthorizationPage/components/RoleList.js +115 -0
- package/dist/fe/components/AuthorizationPage/index.js +6 -0
- package/dist/fe/components/AuthorizationPage/store/index.js +117 -0
- package/dist/fe/components/AuthorizationPage/theme/index.js +137 -0
- package/dist/fe/components/AuthorizationPage/types/index.js +1 -0
- package/dist/fe/components/Button/components/Button.js +158 -0
- package/dist/fe/components/Button/components/ButtonSpinner.js +52 -0
- package/dist/fe/components/Button/index.js +3 -0
- package/dist/fe/components/Button/theme/index.js +186 -0
- package/dist/fe/components/Button/types/index.js +1 -0
- package/dist/fe/components/Button/utils/cn.js +5 -0
- package/dist/fe/components/Captcha/components/Captcha.js +311 -0
- package/dist/fe/components/Captcha/index.js +2 -0
- package/dist/fe/components/Captcha/theme.js +52 -0
- package/dist/fe/components/Captcha/types.js +1 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordForm.js +242 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordHeader.js +39 -0
- package/dist/fe/components/ChangePasswordPage/components/ChangePasswordPage.js +60 -0
- package/dist/fe/components/ChangePasswordPage/index.js +5 -0
- package/dist/fe/components/ChangePasswordPage/store/index.js +44 -0
- package/dist/fe/components/ChangePasswordPage/theme/index.js +87 -0
- package/dist/fe/components/ChangePasswordPage/types/index.js +1 -0
- package/dist/fe/components/Checkbox/components/Checkbox.js +115 -0
- package/dist/fe/components/Checkbox/components/CheckboxIcon.js +119 -0
- package/dist/fe/components/Checkbox/components/SwitchTrack.js +178 -0
- package/dist/fe/components/Checkbox/index.js +4 -0
- package/dist/fe/components/Checkbox/theme/index.js +221 -0
- package/dist/fe/components/Checkbox/types/index.js +1 -0
- package/dist/fe/components/Checkbox/utils/cn.js +5 -0
- package/dist/fe/components/DataTable/DataTable.js +225 -0
- package/dist/fe/components/DataTable/components/ActionCell.js +26 -0
- package/dist/fe/components/DataTable/components/DataCell.js +76 -0
- package/dist/fe/components/DataTable/components/EditableCell.js +221 -0
- package/dist/fe/components/DataTable/components/EmptyState.js +29 -0
- package/dist/fe/components/DataTable/components/HeaderCell.js +64 -0
- package/dist/fe/components/DataTable/components/InfiniteScrollTrigger.js +66 -0
- package/dist/fe/components/DataTable/components/LoadingSpinner.js +19 -0
- package/dist/fe/components/DataTable/components/ResizeHandle.js +41 -0
- package/dist/fe/components/DataTable/components/SelectionCell.js +105 -0
- package/dist/fe/components/DataTable/components/SkeletonRow.js +56 -0
- package/dist/fe/components/DataTable/components/SkeletonTable.js +83 -0
- package/dist/fe/components/DataTable/components/SortIcon.js +39 -0
- package/dist/fe/components/DataTable/components/TableHeader.js +49 -0
- package/dist/fe/components/DataTable/components/TableRow.js +118 -0
- package/dist/fe/components/DataTable/components/index.js +14 -0
- package/dist/fe/components/DataTable/hooks/index.js +2 -0
- package/dist/fe/components/DataTable/hooks/useAutoFitColumn.js +23 -0
- package/dist/fe/components/DataTable/hooks/useResizeColumn.js +122 -0
- package/dist/fe/components/DataTable/index.js +3 -0
- package/dist/fe/components/DataTable/store/index.js +97 -0
- package/dist/fe/components/DataTable/theme/index.js +144 -0
- package/dist/fe/components/DataTable/types/index.js +1 -0
- package/dist/fe/components/DataTable/utils/cn.js +5 -0
- package/dist/fe/components/DatePicker/components/CalendarGrid.js +95 -0
- package/dist/fe/components/DatePicker/components/CalendarHeader.js +152 -0
- package/dist/fe/components/DatePicker/components/DatePicker.js +381 -0
- package/dist/fe/components/DatePicker/components/MonthYearSelector.js +93 -0
- package/dist/fe/components/DatePicker/index.js +7 -0
- package/dist/fe/components/DatePicker/locales/index.js +1113 -0
- package/dist/fe/components/DatePicker/theme/index.js +315 -0
- package/dist/fe/components/DatePicker/types/index.js +1 -0
- package/dist/fe/components/DatePicker/utils/cn.js +5 -0
- package/dist/fe/components/DatePicker/utils/date.js +132 -0
- package/dist/fe/components/DevicesPage/components/DeviceCard.js +251 -0
- package/dist/fe/components/DevicesPage/components/DevicesHeader.js +42 -0
- package/dist/fe/components/DevicesPage/components/DevicesPage.js +450 -0
- package/dist/fe/components/DevicesPage/index.js +5 -0
- package/dist/fe/components/DevicesPage/store/index.js +55 -0
- package/dist/fe/components/DevicesPage/theme/index.js +131 -0
- package/dist/fe/components/DevicesPage/types/index.js +1 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.js +214 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordHeader.js +42 -0
- package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.js +59 -0
- package/dist/fe/components/ForgotPasswordPage/index.js +5 -0
- package/dist/fe/components/ForgotPasswordPage/store/index.js +28 -0
- package/dist/fe/components/ForgotPasswordPage/theme/index.js +87 -0
- package/dist/fe/components/ForgotPasswordPage/types/index.js +1 -0
- package/dist/fe/components/FormBuilder/components/FormBuilder.js +156 -0
- package/dist/fe/components/FormBuilder/components/FormField.js +218 -0
- package/dist/fe/components/FormBuilder/hooks/useFormBuilder.js +152 -0
- package/dist/fe/components/FormBuilder/index.js +4 -0
- package/dist/fe/components/FormBuilder/theme/index.js +134 -0
- package/dist/fe/components/FormBuilder/types/index.js +1 -0
- package/dist/fe/components/FormBuilder/utils/cn.js +5 -0
- package/dist/fe/components/FormBuilder/utils/fieldMapping.js +216 -0
- package/dist/fe/components/FormBuilder/utils/validation.js +78 -0
- package/dist/fe/components/LoginPage/components/LoginForm.js +214 -0
- package/dist/fe/components/LoginPage/components/LoginHeader.js +24 -0
- package/dist/fe/components/LoginPage/components/LoginPage.js +138 -0
- package/dist/fe/components/LoginPage/index.js +5 -0
- package/dist/fe/components/LoginPage/store/index.js +59 -0
- package/dist/fe/components/LoginPage/theme/index.js +98 -0
- package/dist/fe/components/LoginPage/types/index.js +1 -0
- package/dist/fe/components/MagicLinkVerifyPage/components/MagicLinkVerifyPage.js +200 -0
- package/dist/fe/components/MagicLinkVerifyPage/index.js +3 -0
- package/dist/fe/components/MagicLinkVerifyPage/store.js +20 -0
- package/dist/fe/components/MagicLinkVerifyPage/theme.js +36 -0
- package/dist/fe/components/MagicLinkVerifyPage/types.js +1 -0
- package/dist/fe/components/NucleusEntityShowcase.js +1409 -0
- package/dist/fe/components/NucleusTextInput/components/FloatingLabel.js +56 -0
- package/dist/fe/components/NucleusTextInput/components/InputIcons.js +258 -0
- package/dist/fe/components/NucleusTextInput/components/NucleusTextInput.js +321 -0
- package/dist/fe/components/NucleusTextInput/components/PasswordStrengthIndicator.js +104 -0
- package/dist/fe/components/NucleusTextInput/components/TypewriterText.js +56 -0
- package/dist/fe/components/NucleusTextInput/index.js +7 -0
- package/dist/fe/components/NucleusTextInput/theme/index.js +121 -0
- package/dist/fe/components/NucleusTextInput/types/index.js +1 -0
- package/dist/fe/components/NucleusTextInput/utils/cn.js +5 -0
- package/dist/fe/components/NucleusTextInput/utils/format.js +62 -0
- package/dist/fe/components/NucleusTextInput/utils/validation.js +191 -0
- package/dist/fe/components/ProfilePage/components/AddressCard.js +196 -0
- package/dist/fe/components/ProfilePage/components/PhoneCard.js +206 -0
- package/dist/fe/components/ProfilePage/components/ProfileHeader.js +150 -0
- package/dist/fe/components/ProfilePage/components/ProfilePage.js +1336 -0
- package/dist/fe/components/ProfilePage/index.js +6 -0
- package/dist/fe/components/ProfilePage/store/index.js +115 -0
- package/dist/fe/components/ProfilePage/theme/index.js +168 -0
- package/dist/fe/components/ProfilePage/types/index.js +1 -0
- package/dist/fe/components/RangePicker/components/RangePicker.js +338 -0
- package/dist/fe/components/RangePicker/components/RangeThumb.js +68 -0
- package/dist/fe/components/RangePicker/components/RangeTooltip.js +45 -0
- package/dist/fe/components/RangePicker/components/RangeTrack.js +32 -0
- package/dist/fe/components/RangePicker/index.js +5 -0
- package/dist/fe/components/RangePicker/theme/index.js +88 -0
- package/dist/fe/components/RangePicker/types/index.js +1 -0
- package/dist/fe/components/RangePicker/utils/cn.js +3 -0
- package/dist/fe/components/RegisterPage/components/PasswordStrengthIndicator.js +107 -0
- package/dist/fe/components/RegisterPage/components/RegisterForm.js +322 -0
- package/dist/fe/components/RegisterPage/components/RegisterHeader.js +23 -0
- package/dist/fe/components/RegisterPage/components/RegisterPage.js +85 -0
- package/dist/fe/components/RegisterPage/index.js +6 -0
- package/dist/fe/components/RegisterPage/store/index.js +106 -0
- package/dist/fe/components/RegisterPage/theme/index.js +128 -0
- package/dist/fe/components/RegisterPage/types/index.js +1 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.js +347 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordHeader.js +42 -0
- package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.js +61 -0
- package/dist/fe/components/ResetPasswordPage/index.js +5 -0
- package/dist/fe/components/ResetPasswordPage/store/index.js +36 -0
- package/dist/fe/components/ResetPasswordPage/theme/index.js +99 -0
- package/dist/fe/components/ResetPasswordPage/types/index.js +1 -0
- package/dist/fe/components/SearchBox/components/SearchBox.js +271 -0
- package/dist/fe/components/SearchBox/components/SearchBoxDropdown.js +87 -0
- package/dist/fe/components/SearchBox/index.js +5 -0
- package/dist/fe/components/SearchBox/theme/index.js +184 -0
- package/dist/fe/components/SearchBox/types/index.js +1 -0
- package/dist/fe/components/SearchBox/utils/cn.js +5 -0
- package/dist/fe/components/SearchBox/utils/debounce.js +22 -0
- package/dist/fe/components/SearchBox/utils/sanitize.js +48 -0
- package/dist/fe/components/SelectBox/components/SelectBox.js +364 -0
- package/dist/fe/components/SelectBox/components/SelectDropdown.js +92 -0
- package/dist/fe/components/SelectBox/components/SelectOptionItem.js +43 -0
- package/dist/fe/components/SelectBox/components/SelectTrigger.js +22 -0
- package/dist/fe/components/SelectBox/index.js +5 -0
- package/dist/fe/components/SelectBox/theme/index.js +98 -0
- package/dist/fe/components/SelectBox/types/index.js +1 -0
- package/dist/fe/components/SelectBox/utils/cn.js +3 -0
- package/dist/fe/components/SetPasswordPage/components/PasswordStrengthIndicator.js +107 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.js +142 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordHeader.js +23 -0
- package/dist/fe/components/SetPasswordPage/components/SetPasswordPage.js +263 -0
- package/dist/fe/components/SetPasswordPage/index.js +7 -0
- package/dist/fe/components/SetPasswordPage/store/index.js +79 -0
- package/dist/fe/components/SetPasswordPage/theme/index.js +98 -0
- package/dist/fe/components/SetPasswordPage/types/index.js +12 -0
- package/dist/fe/components/UsersPage/components/InviteUserModal.js +262 -0
- package/dist/fe/components/UsersPage/components/Pagination.js +147 -0
- package/dist/fe/components/UsersPage/components/RoleAssignmentModal.js +186 -0
- package/dist/fe/components/UsersPage/components/StatsCards.js +124 -0
- package/dist/fe/components/UsersPage/components/UserDetailDrawer.js +444 -0
- package/dist/fe/components/UsersPage/components/UserFilters.js +142 -0
- package/dist/fe/components/UsersPage/components/UserListItem.js +125 -0
- package/dist/fe/components/UsersPage/components/UserListSkeleton.js +40 -0
- package/dist/fe/components/UsersPage/components/UsersPage.js +556 -0
- package/dist/fe/components/UsersPage/index.js +10 -0
- package/dist/fe/components/UsersPage/store/index.js +151 -0
- package/dist/fe/components/UsersPage/theme/index.js +231 -0
- package/dist/fe/components/UsersPage/types/index.js +1 -0
- package/dist/fe/components/VerifyEmailPage/components/VerifyEmailPage.js +290 -0
- package/dist/fe/components/VerifyEmailPage/index.js +3 -0
- package/dist/fe/components/VerifyEmailPage/store/index.js +45 -0
- package/dist/fe/components/VerifyEmailPage/theme/index.js +52 -0
- package/dist/fe/components/VerifyEmailPage/types/index.js +1 -0
- package/dist/fe/hooks/useNucleusEntity.js +247 -0
- package/dist/fe/index.js +28 -157
- package/dist/fe/types/index.js +1 -0
- package/dist/fe/utils/cn.js +5 -0
- package/dist/fe/utils/columnUtils.js +189 -0
- package/dist/fe/utils/endpointKeys.js +44 -0
- package/dist/index.js +1 -1
- package/dist/src/Client/Proxy/httpProxy.js +1 -0
- package/dist/src/Client/Proxy/index.js +1 -1
- package/dist/src/Client/Proxy/server.js +1 -0
- package/dist/src/Client/Proxy/types.js +1 -0
- package/dist/src/Client/Proxy/utils.js +1 -0
- package/dist/src/Client/Proxy/wsProxy.js +1 -0
- package/package.json +1 -1
- package/scripts/build.ts +32 -16
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useGSAP } from "@gsap/react";
|
|
4
|
+
import gsap from "gsap";
|
|
5
|
+
import { useEffect, useEffectEvent, useRef, useState } from "react";
|
|
6
|
+
import { cn } from "../../../utils/cn";
|
|
7
|
+
import { AbstractAnimatedBackground } from "../../AbstractAnimatedBackground";
|
|
8
|
+
import { Button } from "../../Button";
|
|
9
|
+
import { useDevicesStore } from "../store";
|
|
10
|
+
import { devicesPageTheme } from "../theme";
|
|
11
|
+
import { DeviceCard } from "./DeviceCard";
|
|
12
|
+
import { DevicesHeader } from "./DevicesHeader";
|
|
13
|
+
gsap.registerPlugin(useGSAP);
|
|
14
|
+
export function DevicesPage({ variant: _variant = "default", title = "Active Devices", subtitle = "Manage devices that have access to your account", sessionsAction, sessionRevokeAction, sessionRevokeAllAction, sessionsStatsAction, sessionsPendingAction, sessionApproveAction, sessionRejectAction, onDeviceRevoked, onAllDevicesRevoked, onDeviceApproved, onDeviceRejected, showBackground = false, showStats = true, showPendingDevices = true, allowRevokeAll = true, allowRevokeCurrent = false, className }) {
|
|
15
|
+
const theme = devicesPageTheme;
|
|
16
|
+
const containerRef = useRef(null);
|
|
17
|
+
const cardRef = useRef(null);
|
|
18
|
+
const [showConfirmModal, setShowConfirmModal] = useState(false);
|
|
19
|
+
const [pendingRevoke, setPendingRevoke] = useState(null);
|
|
20
|
+
const [pendingDevices, setPendingDevices] = useState([]);
|
|
21
|
+
const [approvingDevice, setApprovingDevice] = useState(null);
|
|
22
|
+
const store = useDevicesStore();
|
|
23
|
+
const fetchSessions = useEffectEvent(()=>{
|
|
24
|
+
store.setLoading(true);
|
|
25
|
+
store.setError(null);
|
|
26
|
+
sessionsAction.start({
|
|
27
|
+
payload: undefined,
|
|
28
|
+
onAfterHandle: (data)=>{
|
|
29
|
+
const response = data;
|
|
30
|
+
if (response?.data?.sessions) {
|
|
31
|
+
store.setDevices(response.data.sessions);
|
|
32
|
+
store.setCurrentSessionId(response.data.currentSessionId || null);
|
|
33
|
+
}
|
|
34
|
+
store.setLoading(false);
|
|
35
|
+
},
|
|
36
|
+
onErrorHandle: (error)=>{
|
|
37
|
+
store.setError(error instanceof Error ? error.message : "Failed to load devices");
|
|
38
|
+
store.setLoading(false);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
const fetchStats = useEffectEvent(()=>{
|
|
43
|
+
if (!sessionsStatsAction) return;
|
|
44
|
+
sessionsStatsAction.start({
|
|
45
|
+
payload: undefined,
|
|
46
|
+
onAfterHandle: (data)=>{
|
|
47
|
+
const response = data;
|
|
48
|
+
if (response?.data) {
|
|
49
|
+
store.setStats(response.data);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
onErrorHandle: ()=>{}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
const fetchPendingDevices = useEffectEvent(()=>{
|
|
56
|
+
if (!sessionsPendingAction || !showPendingDevices) return;
|
|
57
|
+
sessionsPendingAction.start({
|
|
58
|
+
payload: undefined,
|
|
59
|
+
onAfterHandle: (data)=>{
|
|
60
|
+
const response = data;
|
|
61
|
+
if (response?.data?.sessions) {
|
|
62
|
+
setPendingDevices(response.data.sessions);
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
onErrorHandle: ()=>{}
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
const handleApprove = (device)=>{
|
|
69
|
+
if (!sessionApproveAction || !device.approvalToken) return;
|
|
70
|
+
setApprovingDevice(device.id);
|
|
71
|
+
sessionApproveAction.start({
|
|
72
|
+
payload: {
|
|
73
|
+
token: device.approvalToken
|
|
74
|
+
},
|
|
75
|
+
onAfterHandle: ()=>{
|
|
76
|
+
setPendingDevices((prev)=>prev.filter((d)=>d.id !== device.id));
|
|
77
|
+
setApprovingDevice(null);
|
|
78
|
+
onDeviceApproved?.(device.id);
|
|
79
|
+
fetchSessions();
|
|
80
|
+
},
|
|
81
|
+
onErrorHandle: ()=>{
|
|
82
|
+
setApprovingDevice(null);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const handleReject = (device)=>{
|
|
87
|
+
if (!sessionRejectAction || !device.approvalToken) return;
|
|
88
|
+
setApprovingDevice(device.id);
|
|
89
|
+
sessionRejectAction.start({
|
|
90
|
+
payload: {
|
|
91
|
+
token: device.approvalToken
|
|
92
|
+
},
|
|
93
|
+
onAfterHandle: ()=>{
|
|
94
|
+
setPendingDevices((prev)=>prev.filter((d)=>d.id !== device.id));
|
|
95
|
+
setApprovingDevice(null);
|
|
96
|
+
onDeviceRejected?.(device.id);
|
|
97
|
+
},
|
|
98
|
+
onErrorHandle: ()=>{
|
|
99
|
+
setApprovingDevice(null);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
useEffect(()=>{
|
|
104
|
+
fetchSessions();
|
|
105
|
+
if (showStats) {
|
|
106
|
+
fetchStats();
|
|
107
|
+
}
|
|
108
|
+
if (showPendingDevices) {
|
|
109
|
+
fetchPendingDevices();
|
|
110
|
+
}
|
|
111
|
+
}, [
|
|
112
|
+
showStats,
|
|
113
|
+
showPendingDevices
|
|
114
|
+
]);
|
|
115
|
+
useGSAP(()=>{
|
|
116
|
+
if (!cardRef.current) return;
|
|
117
|
+
gsap.fromTo(cardRef.current, {
|
|
118
|
+
opacity: 0,
|
|
119
|
+
y: 30
|
|
120
|
+
}, {
|
|
121
|
+
opacity: 1,
|
|
122
|
+
y: 0,
|
|
123
|
+
duration: 0.6,
|
|
124
|
+
ease: "power3.out"
|
|
125
|
+
});
|
|
126
|
+
}, {
|
|
127
|
+
scope: containerRef
|
|
128
|
+
});
|
|
129
|
+
const handleRevoke = (sessionId)=>{
|
|
130
|
+
setPendingRevoke(sessionId);
|
|
131
|
+
setShowConfirmModal(true);
|
|
132
|
+
};
|
|
133
|
+
const confirmRevoke = ()=>{
|
|
134
|
+
if (!pendingRevoke) return;
|
|
135
|
+
store.setRevoking(pendingRevoke);
|
|
136
|
+
setShowConfirmModal(false);
|
|
137
|
+
sessionRevokeAction.start({
|
|
138
|
+
payload: {
|
|
139
|
+
_sessionId: pendingRevoke,
|
|
140
|
+
reason: "user_revoked"
|
|
141
|
+
},
|
|
142
|
+
onAfterHandle: ()=>{
|
|
143
|
+
store.removeDevice(pendingRevoke);
|
|
144
|
+
store.setRevoking(null);
|
|
145
|
+
onDeviceRevoked?.(pendingRevoke);
|
|
146
|
+
setPendingRevoke(null);
|
|
147
|
+
},
|
|
148
|
+
onErrorHandle: (error)=>{
|
|
149
|
+
store.setError(error instanceof Error ? error.message : "Failed to revoke device");
|
|
150
|
+
store.setRevoking(null);
|
|
151
|
+
setPendingRevoke(null);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
const handleRevokeAll = ()=>{
|
|
156
|
+
store.setRevokingAll(true);
|
|
157
|
+
sessionRevokeAllAction.start({
|
|
158
|
+
payload: {
|
|
159
|
+
excludeCurrent: true,
|
|
160
|
+
reason: "user_revoked_all"
|
|
161
|
+
},
|
|
162
|
+
onAfterHandle: ()=>{
|
|
163
|
+
store.clearAllDevices(true);
|
|
164
|
+
store.setRevokingAll(false);
|
|
165
|
+
onAllDevicesRevoked?.();
|
|
166
|
+
},
|
|
167
|
+
onErrorHandle: (error)=>{
|
|
168
|
+
store.setError(error instanceof Error ? error.message : "Failed to revoke all devices");
|
|
169
|
+
store.setRevokingAll(false);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
const otherDevicesCount = store.devices.filter((d)=>d.id !== store.currentSessionId).length;
|
|
174
|
+
return /*#__PURE__*/ _jsxs("main", {
|
|
175
|
+
ref: containerRef,
|
|
176
|
+
className: cn(theme.container.base, className),
|
|
177
|
+
"aria-label": "Devices management page",
|
|
178
|
+
children: [
|
|
179
|
+
showBackground && /*#__PURE__*/ _jsx(AbstractAnimatedBackground, {}),
|
|
180
|
+
/*#__PURE__*/ _jsx("div", {
|
|
181
|
+
className: theme.container.wrapper,
|
|
182
|
+
children: /*#__PURE__*/ _jsxs("article", {
|
|
183
|
+
ref: cardRef,
|
|
184
|
+
className: cn(theme.card.base, theme.card.padding, theme.card.background, theme.card.border, theme.card.shadow, theme.card.rounded),
|
|
185
|
+
children: [
|
|
186
|
+
/*#__PURE__*/ _jsx(DevicesHeader, {
|
|
187
|
+
title: title,
|
|
188
|
+
subtitle: subtitle,
|
|
189
|
+
totalDevices: store.devices.length,
|
|
190
|
+
onRevokeAll: handleRevokeAll,
|
|
191
|
+
isRevokingAll: store.isRevokingAll,
|
|
192
|
+
allowRevokeAll: allowRevokeAll && otherDevicesCount > 0
|
|
193
|
+
}),
|
|
194
|
+
showStats && store.stats && /*#__PURE__*/ _jsxs("div", {
|
|
195
|
+
className: theme.stats.container,
|
|
196
|
+
children: [
|
|
197
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
198
|
+
className: theme.stats.item,
|
|
199
|
+
children: [
|
|
200
|
+
/*#__PURE__*/ _jsx("p", {
|
|
201
|
+
className: theme.stats.value,
|
|
202
|
+
children: store.stats.activeSessions
|
|
203
|
+
}),
|
|
204
|
+
/*#__PURE__*/ _jsx("p", {
|
|
205
|
+
className: theme.stats.label,
|
|
206
|
+
children: "Active Sessions"
|
|
207
|
+
})
|
|
208
|
+
]
|
|
209
|
+
}),
|
|
210
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
211
|
+
className: theme.stats.item,
|
|
212
|
+
children: [
|
|
213
|
+
/*#__PURE__*/ _jsx("p", {
|
|
214
|
+
className: theme.stats.value,
|
|
215
|
+
children: store.stats.uniqueDevices
|
|
216
|
+
}),
|
|
217
|
+
/*#__PURE__*/ _jsx("p", {
|
|
218
|
+
className: theme.stats.label,
|
|
219
|
+
children: "Unique Devices"
|
|
220
|
+
})
|
|
221
|
+
]
|
|
222
|
+
}),
|
|
223
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
224
|
+
className: theme.stats.item,
|
|
225
|
+
children: [
|
|
226
|
+
/*#__PURE__*/ _jsx("p", {
|
|
227
|
+
className: theme.stats.value,
|
|
228
|
+
children: store.stats.uniqueIpAddresses
|
|
229
|
+
}),
|
|
230
|
+
/*#__PURE__*/ _jsx("p", {
|
|
231
|
+
className: theme.stats.label,
|
|
232
|
+
children: "IP Addresses"
|
|
233
|
+
})
|
|
234
|
+
]
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
}),
|
|
238
|
+
store.error && /*#__PURE__*/ _jsx("div", {
|
|
239
|
+
className: theme.error.container,
|
|
240
|
+
children: /*#__PURE__*/ _jsx("p", {
|
|
241
|
+
className: theme.error.text,
|
|
242
|
+
children: store.error
|
|
243
|
+
})
|
|
244
|
+
}),
|
|
245
|
+
showPendingDevices && pendingDevices.length > 0 && /*#__PURE__*/ _jsxs("section", {
|
|
246
|
+
className: "mb-8",
|
|
247
|
+
children: [
|
|
248
|
+
/*#__PURE__*/ _jsxs("h2", {
|
|
249
|
+
className: "text-lg font-semibold text-amber-600 mb-4 flex items-center gap-2",
|
|
250
|
+
children: [
|
|
251
|
+
/*#__PURE__*/ _jsx("span", {
|
|
252
|
+
className: "inline-block w-2 h-2 bg-amber-500 rounded-full animate-pulse"
|
|
253
|
+
}),
|
|
254
|
+
"Pending Approval (",
|
|
255
|
+
pendingDevices.length,
|
|
256
|
+
")"
|
|
257
|
+
]
|
|
258
|
+
}),
|
|
259
|
+
/*#__PURE__*/ _jsx("div", {
|
|
260
|
+
className: theme.deviceList.grid,
|
|
261
|
+
children: pendingDevices.map((device)=>/*#__PURE__*/ _jsxs("div", {
|
|
262
|
+
className: "bg-amber-50 border border-amber-200 rounded-xl p-4 dark:bg-amber-900/20 dark:border-amber-800",
|
|
263
|
+
children: [
|
|
264
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
265
|
+
className: "flex items-start gap-3 mb-3",
|
|
266
|
+
children: [
|
|
267
|
+
/*#__PURE__*/ _jsx("div", {
|
|
268
|
+
className: "p-2 bg-amber-100 rounded-lg dark:bg-amber-800",
|
|
269
|
+
children: /*#__PURE__*/ _jsxs("svg", {
|
|
270
|
+
className: "w-5 h-5 text-amber-600",
|
|
271
|
+
fill: "none",
|
|
272
|
+
viewBox: "0 0 24 24",
|
|
273
|
+
stroke: "currentColor",
|
|
274
|
+
"aria-hidden": "true",
|
|
275
|
+
children: [
|
|
276
|
+
/*#__PURE__*/ _jsx("title", {
|
|
277
|
+
children: "Device"
|
|
278
|
+
}),
|
|
279
|
+
/*#__PURE__*/ _jsx("path", {
|
|
280
|
+
strokeLinecap: "round",
|
|
281
|
+
strokeLinejoin: "round",
|
|
282
|
+
strokeWidth: 2,
|
|
283
|
+
d: "M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
})
|
|
287
|
+
}),
|
|
288
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
289
|
+
children: [
|
|
290
|
+
/*#__PURE__*/ _jsx("p", {
|
|
291
|
+
className: "font-medium text-gray-900 dark:text-white",
|
|
292
|
+
children: device.deviceName || "Unknown Device"
|
|
293
|
+
}),
|
|
294
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
295
|
+
className: "text-sm text-gray-500",
|
|
296
|
+
children: [
|
|
297
|
+
device.browserName,
|
|
298
|
+
" • ",
|
|
299
|
+
device.osName
|
|
300
|
+
]
|
|
301
|
+
})
|
|
302
|
+
]
|
|
303
|
+
})
|
|
304
|
+
]
|
|
305
|
+
}),
|
|
306
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
307
|
+
className: "text-sm text-gray-600 dark:text-gray-400 mb-4",
|
|
308
|
+
children: [
|
|
309
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
310
|
+
children: [
|
|
311
|
+
"IP: ",
|
|
312
|
+
device.ipAddress || "Unknown"
|
|
313
|
+
]
|
|
314
|
+
}),
|
|
315
|
+
/*#__PURE__*/ _jsxs("p", {
|
|
316
|
+
children: [
|
|
317
|
+
"Requested:",
|
|
318
|
+
" ",
|
|
319
|
+
device.approvalRequestedAt ? new Date(device.approvalRequestedAt).toLocaleString() : "Unknown"
|
|
320
|
+
]
|
|
321
|
+
})
|
|
322
|
+
]
|
|
323
|
+
}),
|
|
324
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
325
|
+
className: "flex gap-2",
|
|
326
|
+
children: [
|
|
327
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
328
|
+
variant: "primary",
|
|
329
|
+
size: "sm",
|
|
330
|
+
onClick: ()=>handleApprove(device),
|
|
331
|
+
disabled: approvingDevice === device.id,
|
|
332
|
+
className: "flex-1 bg-green-600 hover:bg-green-700",
|
|
333
|
+
children: approvingDevice === device.id ? "..." : "✓ Approve"
|
|
334
|
+
}),
|
|
335
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
336
|
+
variant: "outline",
|
|
337
|
+
size: "sm",
|
|
338
|
+
onClick: ()=>handleReject(device),
|
|
339
|
+
disabled: approvingDevice === device.id,
|
|
340
|
+
className: "flex-1 text-red-600 border-red-200 hover:bg-red-50",
|
|
341
|
+
children: approvingDevice === device.id ? "..." : "✗ Reject"
|
|
342
|
+
})
|
|
343
|
+
]
|
|
344
|
+
})
|
|
345
|
+
]
|
|
346
|
+
}, device.id))
|
|
347
|
+
})
|
|
348
|
+
]
|
|
349
|
+
}),
|
|
350
|
+
store.isLoading ? /*#__PURE__*/ _jsxs("div", {
|
|
351
|
+
className: theme.loading.container,
|
|
352
|
+
children: [
|
|
353
|
+
/*#__PURE__*/ _jsx("div", {
|
|
354
|
+
className: theme.loading.spinner
|
|
355
|
+
}),
|
|
356
|
+
/*#__PURE__*/ _jsx("p", {
|
|
357
|
+
className: theme.loading.text,
|
|
358
|
+
children: "Loading devices..."
|
|
359
|
+
})
|
|
360
|
+
]
|
|
361
|
+
}) : store.devices.length === 0 ? /*#__PURE__*/ _jsxs("div", {
|
|
362
|
+
className: theme.deviceList.empty.container,
|
|
363
|
+
children: [
|
|
364
|
+
/*#__PURE__*/ _jsxs("svg", {
|
|
365
|
+
className: theme.deviceList.empty.icon,
|
|
366
|
+
fill: "none",
|
|
367
|
+
viewBox: "0 0 24 24",
|
|
368
|
+
stroke: "currentColor",
|
|
369
|
+
"aria-hidden": "true",
|
|
370
|
+
children: [
|
|
371
|
+
/*#__PURE__*/ _jsx("title", {
|
|
372
|
+
children: "No devices"
|
|
373
|
+
}),
|
|
374
|
+
/*#__PURE__*/ _jsx("path", {
|
|
375
|
+
strokeLinecap: "round",
|
|
376
|
+
strokeLinejoin: "round",
|
|
377
|
+
strokeWidth: 1,
|
|
378
|
+
d: "M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"
|
|
379
|
+
})
|
|
380
|
+
]
|
|
381
|
+
}),
|
|
382
|
+
/*#__PURE__*/ _jsx("p", {
|
|
383
|
+
className: theme.deviceList.empty.text,
|
|
384
|
+
children: "No active devices found"
|
|
385
|
+
})
|
|
386
|
+
]
|
|
387
|
+
}) : /*#__PURE__*/ _jsx("section", {
|
|
388
|
+
className: theme.deviceList.container,
|
|
389
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
390
|
+
className: theme.deviceList.grid,
|
|
391
|
+
children: store.devices.map((device)=>/*#__PURE__*/ _jsx(DeviceCard, {
|
|
392
|
+
device: device,
|
|
393
|
+
isCurrent: device.id === store.currentSessionId || device.isCurrent,
|
|
394
|
+
onRevoke: device.id !== store.currentSessionId && !device.isCurrent || allowRevokeCurrent ? handleRevoke : undefined,
|
|
395
|
+
isRevoking: store.isRevoking === device.id
|
|
396
|
+
}, device.id))
|
|
397
|
+
})
|
|
398
|
+
})
|
|
399
|
+
]
|
|
400
|
+
})
|
|
401
|
+
}),
|
|
402
|
+
showConfirmModal && /*#__PURE__*/ _jsx("div", {
|
|
403
|
+
className: theme.modal.overlay,
|
|
404
|
+
onClick: ()=>setShowConfirmModal(false),
|
|
405
|
+
onKeyDown: (e)=>e.key === "Escape" && setShowConfirmModal(false),
|
|
406
|
+
role: "dialog",
|
|
407
|
+
"aria-modal": "true",
|
|
408
|
+
"aria-labelledby": "confirm-modal-title",
|
|
409
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
410
|
+
className: theme.modal.container,
|
|
411
|
+
onClick: (e)=>e.stopPropagation(),
|
|
412
|
+
onKeyDown: (e)=>e.stopPropagation(),
|
|
413
|
+
role: "document",
|
|
414
|
+
children: [
|
|
415
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
416
|
+
id: "confirm-modal-title",
|
|
417
|
+
className: theme.modal.title,
|
|
418
|
+
children: "Revoke Device Access"
|
|
419
|
+
}),
|
|
420
|
+
/*#__PURE__*/ _jsx("p", {
|
|
421
|
+
className: theme.modal.message,
|
|
422
|
+
children: "Are you sure you want to revoke access for this device? The user will be logged out immediately."
|
|
423
|
+
}),
|
|
424
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
425
|
+
className: theme.modal.actions,
|
|
426
|
+
children: [
|
|
427
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
428
|
+
variant: "outline",
|
|
429
|
+
size: "sm",
|
|
430
|
+
onClick: ()=>{
|
|
431
|
+
setShowConfirmModal(false);
|
|
432
|
+
setPendingRevoke(null);
|
|
433
|
+
},
|
|
434
|
+
children: "Cancel"
|
|
435
|
+
}),
|
|
436
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
437
|
+
variant: "primary",
|
|
438
|
+
size: "sm",
|
|
439
|
+
onClick: confirmRevoke,
|
|
440
|
+
className: "bg-red-600 hover:bg-red-700",
|
|
441
|
+
children: "Revoke Access"
|
|
442
|
+
})
|
|
443
|
+
]
|
|
444
|
+
})
|
|
445
|
+
]
|
|
446
|
+
})
|
|
447
|
+
})
|
|
448
|
+
]
|
|
449
|
+
});
|
|
450
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DeviceCard } from "./components/DeviceCard";
|
|
2
|
+
export { DevicesHeader } from "./components/DevicesHeader";
|
|
3
|
+
export { DevicesPage } from "./components/DevicesPage";
|
|
4
|
+
export { useDevicesStore } from "./store";
|
|
5
|
+
export { devicesPageTheme, extendDevicesPageTheme } from "./theme";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { batch, createStore } from "h-state";
|
|
3
|
+
const initialState = {
|
|
4
|
+
devices: [],
|
|
5
|
+
currentSessionId: null,
|
|
6
|
+
isLoading: false,
|
|
7
|
+
isRevoking: null,
|
|
8
|
+
isRevokingAll: false,
|
|
9
|
+
error: null,
|
|
10
|
+
stats: null
|
|
11
|
+
};
|
|
12
|
+
export const { useStore: useDevicesStore } = createStore(initialState, {
|
|
13
|
+
setDevices: (store)=>(devices)=>{
|
|
14
|
+
store.devices = devices;
|
|
15
|
+
},
|
|
16
|
+
setCurrentSessionId: (store)=>(sessionId)=>{
|
|
17
|
+
store.currentSessionId = sessionId;
|
|
18
|
+
},
|
|
19
|
+
setLoading: (store)=>(value)=>{
|
|
20
|
+
store.isLoading = value;
|
|
21
|
+
},
|
|
22
|
+
setRevoking: (store)=>(sessionId)=>{
|
|
23
|
+
store.isRevoking = sessionId;
|
|
24
|
+
},
|
|
25
|
+
setRevokingAll: (store)=>(value)=>{
|
|
26
|
+
store.isRevokingAll = value;
|
|
27
|
+
},
|
|
28
|
+
setError: (store)=>(error)=>{
|
|
29
|
+
store.error = error;
|
|
30
|
+
},
|
|
31
|
+
setStats: (store)=>(stats)=>{
|
|
32
|
+
store.stats = stats;
|
|
33
|
+
},
|
|
34
|
+
removeDevice: (store)=>(sessionId)=>{
|
|
35
|
+
store.devices = store.devices.filter((d)=>d.id !== sessionId);
|
|
36
|
+
},
|
|
37
|
+
clearAllDevices: (store)=>(excludeCurrent)=>{
|
|
38
|
+
if (excludeCurrent && store.currentSessionId) {
|
|
39
|
+
store.devices = store.devices.filter((d)=>d.id === store.currentSessionId);
|
|
40
|
+
} else {
|
|
41
|
+
store.devices = [];
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
reset: (store)=>()=>{
|
|
45
|
+
batch(()=>{
|
|
46
|
+
store.devices = [];
|
|
47
|
+
store.currentSessionId = null;
|
|
48
|
+
store.isLoading = false;
|
|
49
|
+
store.isRevoking = null;
|
|
50
|
+
store.isRevokingAll = false;
|
|
51
|
+
store.error = null;
|
|
52
|
+
store.stats = null;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export const devicesPageTheme = {
|
|
2
|
+
container: {
|
|
3
|
+
base: "relative min-h-screen w-full",
|
|
4
|
+
wrapper: "relative z-10 w-full max-w-6xl mx-auto px-4 py-8 sm:px-6 lg:px-8"
|
|
5
|
+
},
|
|
6
|
+
card: {
|
|
7
|
+
base: "w-full",
|
|
8
|
+
padding: "p-6 sm:p-8",
|
|
9
|
+
background: "bg-white/80 dark:bg-zinc-900/80 backdrop-blur-xl",
|
|
10
|
+
border: "border border-white/20 dark:border-zinc-800/50",
|
|
11
|
+
shadow: "shadow-xl shadow-black/5 dark:shadow-black/20",
|
|
12
|
+
rounded: "rounded-2xl"
|
|
13
|
+
},
|
|
14
|
+
header: {
|
|
15
|
+
container: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 mb-8",
|
|
16
|
+
titleWrapper: "flex-1",
|
|
17
|
+
title: "text-2xl sm:text-3xl font-bold text-zinc-900 dark:text-white",
|
|
18
|
+
subtitle: "mt-1 text-sm sm:text-base text-zinc-600 dark:text-zinc-400",
|
|
19
|
+
badge: "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400 ml-3",
|
|
20
|
+
actions: "flex-shrink-0"
|
|
21
|
+
},
|
|
22
|
+
stats: {
|
|
23
|
+
container: "grid grid-cols-3 gap-4 mb-8 p-4 rounded-xl bg-zinc-50 dark:bg-zinc-800/50",
|
|
24
|
+
item: "text-center",
|
|
25
|
+
value: "text-2xl font-bold text-zinc-900 dark:text-white",
|
|
26
|
+
label: "text-xs text-zinc-500 dark:text-zinc-400 mt-1"
|
|
27
|
+
},
|
|
28
|
+
deviceList: {
|
|
29
|
+
container: "mt-6",
|
|
30
|
+
grid: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
31
|
+
empty: {
|
|
32
|
+
container: "flex flex-col items-center justify-center py-12 text-center",
|
|
33
|
+
icon: "w-16 h-16 text-zinc-300 dark:text-zinc-600 mb-4",
|
|
34
|
+
text: "text-zinc-500 dark:text-zinc-400"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
deviceCard: {
|
|
38
|
+
base: "group relative flex flex-col transition-all duration-200",
|
|
39
|
+
padding: "p-4 sm:p-5",
|
|
40
|
+
background: "bg-white dark:bg-zinc-800/60",
|
|
41
|
+
backgroundCurrent: "bg-blue-50/50 dark:bg-blue-900/10",
|
|
42
|
+
border: "border border-zinc-200 dark:border-zinc-700/50",
|
|
43
|
+
borderCurrent: "border-blue-300 dark:border-blue-700/50",
|
|
44
|
+
shadow: "shadow-sm",
|
|
45
|
+
rounded: "rounded-xl",
|
|
46
|
+
hover: "hover:shadow-md hover:border-zinc-300 dark:hover:border-zinc-600",
|
|
47
|
+
header: {
|
|
48
|
+
container: "flex items-start gap-3 mb-3",
|
|
49
|
+
icon: "flex-shrink-0 w-10 h-10 rounded-lg bg-zinc-100 dark:bg-zinc-700 flex items-center justify-center text-zinc-500 dark:text-zinc-400",
|
|
50
|
+
iconCurrent: "bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400",
|
|
51
|
+
info: "flex-1 min-w-0",
|
|
52
|
+
deviceName: "font-medium text-zinc-900 dark:text-white truncate",
|
|
53
|
+
deviceType: "text-xs text-zinc-500 dark:text-zinc-400 mt-0.5"
|
|
54
|
+
},
|
|
55
|
+
details: {
|
|
56
|
+
container: "space-y-2 text-sm",
|
|
57
|
+
row: "flex items-center justify-between",
|
|
58
|
+
label: "text-zinc-500 dark:text-zinc-400",
|
|
59
|
+
value: "text-zinc-700 dark:text-zinc-300 truncate ml-2 text-right"
|
|
60
|
+
},
|
|
61
|
+
footer: {
|
|
62
|
+
container: "flex items-center justify-between mt-4 pt-4 border-t border-zinc-100 dark:border-zinc-700/50",
|
|
63
|
+
currentBadge: "inline-flex items-center px-2 py-1 rounded-md text-xs font-medium bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400",
|
|
64
|
+
revokeButton: "text-xs text-red-600 dark:text-red-400 hover:text-red-700 dark:hover:text-red-300 font-medium transition-colors"
|
|
65
|
+
},
|
|
66
|
+
trustScore: {
|
|
67
|
+
container: "mt-3",
|
|
68
|
+
bar: "h-1.5 w-full bg-zinc-200 dark:bg-zinc-700 rounded-full overflow-hidden",
|
|
69
|
+
barFill: "h-full rounded-full transition-all duration-300",
|
|
70
|
+
label: "text-xs text-zinc-500 dark:text-zinc-400 mt-1"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
modal: {
|
|
74
|
+
overlay: "fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",
|
|
75
|
+
container: "bg-white dark:bg-zinc-800 rounded-2xl shadow-2xl max-w-md w-full p-6",
|
|
76
|
+
title: "text-lg font-semibold text-zinc-900 dark:text-white mb-2",
|
|
77
|
+
message: "text-sm text-zinc-600 dark:text-zinc-400 mb-6",
|
|
78
|
+
actions: "flex gap-3 justify-end"
|
|
79
|
+
},
|
|
80
|
+
loading: {
|
|
81
|
+
container: "flex flex-col items-center justify-center py-12",
|
|
82
|
+
spinner: "w-8 h-8 border-2 border-zinc-200 border-t-blue-600 rounded-full animate-spin",
|
|
83
|
+
text: "mt-4 text-sm text-zinc-500 dark:text-zinc-400"
|
|
84
|
+
},
|
|
85
|
+
error: {
|
|
86
|
+
container: "p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",
|
|
87
|
+
text: "text-sm text-red-600 dark:text-red-400"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export function extendDevicesPageTheme(overrides) {
|
|
91
|
+
return {
|
|
92
|
+
...devicesPageTheme,
|
|
93
|
+
...overrides,
|
|
94
|
+
container: {
|
|
95
|
+
...devicesPageTheme.container,
|
|
96
|
+
...overrides.container
|
|
97
|
+
},
|
|
98
|
+
card: {
|
|
99
|
+
...devicesPageTheme.card,
|
|
100
|
+
...overrides.card
|
|
101
|
+
},
|
|
102
|
+
header: {
|
|
103
|
+
...devicesPageTheme.header,
|
|
104
|
+
...overrides.header
|
|
105
|
+
},
|
|
106
|
+
stats: {
|
|
107
|
+
...devicesPageTheme.stats,
|
|
108
|
+
...overrides.stats
|
|
109
|
+
},
|
|
110
|
+
deviceList: {
|
|
111
|
+
...devicesPageTheme.deviceList,
|
|
112
|
+
...overrides.deviceList
|
|
113
|
+
},
|
|
114
|
+
deviceCard: {
|
|
115
|
+
...devicesPageTheme.deviceCard,
|
|
116
|
+
...overrides.deviceCard
|
|
117
|
+
},
|
|
118
|
+
modal: {
|
|
119
|
+
...devicesPageTheme.modal,
|
|
120
|
+
...overrides.modal
|
|
121
|
+
},
|
|
122
|
+
loading: {
|
|
123
|
+
...devicesPageTheme.loading,
|
|
124
|
+
...overrides.loading
|
|
125
|
+
},
|
|
126
|
+
error: {
|
|
127
|
+
...devicesPageTheme.error,
|
|
128
|
+
...overrides.error
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|