@striae-org/striae 3.0.4
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/.env.example +100 -0
- package/LICENSE +190 -0
- package/NOTICE +18 -0
- package/README.md +133 -0
- package/app/components/actions/case-export/core-export.ts +328 -0
- package/app/components/actions/case-export/data-processing.ts +167 -0
- package/app/components/actions/case-export/download-handlers.ts +900 -0
- package/app/components/actions/case-export/index.ts +41 -0
- package/app/components/actions/case-export/metadata-helpers.ts +107 -0
- package/app/components/actions/case-export/types-constants.ts +56 -0
- package/app/components/actions/case-export/validation-utils.ts +25 -0
- package/app/components/actions/case-export.ts +4 -0
- package/app/components/actions/case-import/annotation-import.ts +35 -0
- package/app/components/actions/case-import/confirmation-import.ts +363 -0
- package/app/components/actions/case-import/image-operations.ts +61 -0
- package/app/components/actions/case-import/index.ts +39 -0
- package/app/components/actions/case-import/orchestrator.ts +420 -0
- package/app/components/actions/case-import/storage-operations.ts +270 -0
- package/app/components/actions/case-import/validation.ts +189 -0
- package/app/components/actions/case-import/zip-processing.ts +413 -0
- package/app/components/actions/case-manage.ts +524 -0
- package/app/components/actions/case-review.ts +4 -0
- package/app/components/actions/confirm-export.ts +351 -0
- package/app/components/actions/generate-pdf.ts +210 -0
- package/app/components/actions/image-manage.ts +385 -0
- package/app/components/actions/notes-manage.ts +33 -0
- package/app/components/actions/signout.module.css +15 -0
- package/app/components/actions/signout.tsx +50 -0
- package/app/components/audit/user-audit-viewer.tsx +975 -0
- package/app/components/audit/user-audit.module.css +568 -0
- package/app/components/auth/auth-provider.tsx +78 -0
- package/app/components/auth/mfa-enrollment.module.css +268 -0
- package/app/components/auth/mfa-enrollment.tsx +398 -0
- package/app/components/auth/mfa-verification.module.css +251 -0
- package/app/components/auth/mfa-verification.tsx +295 -0
- package/app/components/button/button.module.css +63 -0
- package/app/components/button/button.tsx +46 -0
- package/app/components/canvas/box-annotations/box-annotations.module.css +170 -0
- package/app/components/canvas/box-annotations/box-annotations.tsx +634 -0
- package/app/components/canvas/canvas.module.css +314 -0
- package/app/components/canvas/canvas.tsx +449 -0
- package/app/components/canvas/confirmation/confirmation.module.css +187 -0
- package/app/components/canvas/confirmation/confirmation.tsx +214 -0
- package/app/components/colors/colors.module.css +59 -0
- package/app/components/colors/colors.tsx +68 -0
- package/app/components/form/base-form.tsx +21 -0
- package/app/components/form/form-button.tsx +28 -0
- package/app/components/form/form-field.tsx +53 -0
- package/app/components/form/form-message.tsx +17 -0
- package/app/components/form/form-toggle.tsx +23 -0
- package/app/components/form/form.module.css +427 -0
- package/app/components/form/index.ts +6 -0
- package/app/components/icon/icon.module.css +3 -0
- package/app/components/icon/icon.tsx +27 -0
- package/app/components/icon/icons.svg +102 -0
- package/app/components/icon/manifest.json +110 -0
- package/app/components/sidebar/case-export/case-export.module.css +386 -0
- package/app/components/sidebar/case-export/case-export.tsx +317 -0
- package/app/components/sidebar/case-import/case-import.module.css +626 -0
- package/app/components/sidebar/case-import/case-import.tsx +404 -0
- package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +72 -0
- package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +72 -0
- package/app/components/sidebar/case-import/components/ConfirmationPreviewSection.tsx +71 -0
- package/app/components/sidebar/case-import/components/ExistingCaseSection.tsx +40 -0
- package/app/components/sidebar/case-import/components/FileSelector.tsx +161 -0
- package/app/components/sidebar/case-import/components/ProgressSection.tsx +46 -0
- package/app/components/sidebar/case-import/hooks/useFilePreview.ts +101 -0
- package/app/components/sidebar/case-import/hooks/useImportExecution.ts +152 -0
- package/app/components/sidebar/case-import/hooks/useImportState.ts +88 -0
- package/app/components/sidebar/case-import/index.ts +18 -0
- package/app/components/sidebar/case-import/utils/file-validation.ts +43 -0
- package/app/components/sidebar/cases/case-sidebar.tsx +827 -0
- package/app/components/sidebar/cases/cases-modal.module.css +166 -0
- package/app/components/sidebar/cases/cases-modal.tsx +201 -0
- package/app/components/sidebar/cases/cases.module.css +713 -0
- package/app/components/sidebar/files/files-modal.module.css +209 -0
- package/app/components/sidebar/files/files-modal.tsx +239 -0
- package/app/components/sidebar/hash/hash-utility.module.css +366 -0
- package/app/components/sidebar/hash/hash-utility.tsx +982 -0
- package/app/components/sidebar/notes/notes-modal.tsx +51 -0
- package/app/components/sidebar/notes/notes-sidebar.tsx +491 -0
- package/app/components/sidebar/notes/notes.module.css +360 -0
- package/app/components/sidebar/sidebar-container.tsx +149 -0
- package/app/components/sidebar/sidebar.module.css +321 -0
- package/app/components/sidebar/sidebar.tsx +215 -0
- package/app/components/sidebar/upload/image-upload-zone.module.css +123 -0
- package/app/components/sidebar/upload/image-upload-zone.tsx +330 -0
- package/app/components/theme-provider/theme-provider.tsx +131 -0
- package/app/components/theme-provider/theme.ts +155 -0
- package/app/components/toast/toast.module.css +137 -0
- package/app/components/toast/toast.tsx +56 -0
- package/app/components/toolbar/toolbar-color-selector.module.css +171 -0
- package/app/components/toolbar/toolbar-color-selector.tsx +129 -0
- package/app/components/toolbar/toolbar.module.css +42 -0
- package/app/components/toolbar/toolbar.tsx +167 -0
- package/app/components/user/delete-account.module.css +274 -0
- package/app/components/user/delete-account.tsx +471 -0
- package/app/components/user/inactivity-warning.module.css +145 -0
- package/app/components/user/inactivity-warning.tsx +84 -0
- package/app/components/user/manage-profile.module.css +190 -0
- package/app/components/user/manage-profile.tsx +253 -0
- package/app/components/user/mfa-phone-update.tsx +739 -0
- package/app/config-example/admin-service.json +13 -0
- package/app/config-example/config.json +17 -0
- package/app/config-example/firebase.ts +21 -0
- package/app/config-example/inactivity.ts +13 -0
- package/app/config-example/meta-config.json +6 -0
- package/app/contexts/auth.context.ts +12 -0
- package/app/entry.client.tsx +12 -0
- package/app/entry.server.tsx +44 -0
- package/app/hooks/useInactivityTimeout.ts +110 -0
- package/app/root.tsx +170 -0
- package/app/routes/_index.tsx +16 -0
- package/app/routes/auth/emailActionHandler.module.css +232 -0
- package/app/routes/auth/emailActionHandler.tsx +405 -0
- package/app/routes/auth/emailVerification.tsx +120 -0
- package/app/routes/auth/login.module.css +523 -0
- package/app/routes/auth/login.tsx +654 -0
- package/app/routes/auth/passwordReset.module.css +274 -0
- package/app/routes/auth/passwordReset.tsx +154 -0
- package/app/routes/auth/route.ts +16 -0
- package/app/routes/mobile-prevented/mobilePrevented.module.css +47 -0
- package/app/routes/mobile-prevented/mobilePrevented.tsx +26 -0
- package/app/routes/mobile-prevented/route.ts +14 -0
- package/app/routes/striae/striae.module.css +30 -0
- package/app/routes/striae/striae.tsx +417 -0
- package/app/services/audit-export.service.ts +755 -0
- package/app/services/audit.service.ts +1454 -0
- package/app/services/firebase-errors.ts +106 -0
- package/app/services/firebase.ts +15 -0
- package/app/styles/legal-pages.module.css +113 -0
- package/app/styles/root.module.css +146 -0
- package/app/tailwind.css +225 -0
- package/app/types/annotations.ts +45 -0
- package/app/types/audit.ts +301 -0
- package/app/types/case.ts +90 -0
- package/app/types/export.ts +8 -0
- package/app/types/file.ts +30 -0
- package/app/types/import.ts +107 -0
- package/app/types/index.ts +24 -0
- package/app/types/user.ts +38 -0
- package/app/utils/SHA256.ts +461 -0
- package/app/utils/annotation-timestamp.ts +25 -0
- package/app/utils/audit-export-signature.ts +117 -0
- package/app/utils/auth-action-settings.ts +48 -0
- package/app/utils/auth.ts +34 -0
- package/app/utils/batch-operations.ts +135 -0
- package/app/utils/confirmation-signature.ts +193 -0
- package/app/utils/data-operations.ts +871 -0
- package/app/utils/device-detection.ts +5 -0
- package/app/utils/html-sanitizer.ts +80 -0
- package/app/utils/id-generator.ts +36 -0
- package/app/utils/meta.ts +48 -0
- package/app/utils/mfa-phone.ts +97 -0
- package/app/utils/mfa.ts +79 -0
- package/app/utils/password-policy.ts +28 -0
- package/app/utils/permissions.ts +562 -0
- package/app/utils/signature-utils.ts +160 -0
- package/app/utils/style.ts +83 -0
- package/app/utils/version.ts +5 -0
- package/firebase.json +11 -0
- package/functions/[[path]].ts +10 -0
- package/package.json +138 -0
- package/postcss.config.js +6 -0
- package/public/.well-known/publickey.info@striae.org.asc +17 -0
- package/public/.well-known/security.txt +7 -0
- package/public/_headers +28 -0
- package/public/_routes.json +13 -0
- package/public/assets/striae.jpg +0 -0
- package/public/clear.jpg +0 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.svg +9 -0
- package/public/icon-256.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/logo-dark.png +0 -0
- package/public/manifest.json +25 -0
- package/public/oin-badge.png +0 -0
- package/public/shortcut.png +0 -0
- package/public/social-image.png +0 -0
- package/public/striae-ascii.txt +10 -0
- package/scripts/deploy-all.sh +100 -0
- package/scripts/deploy-config.sh +940 -0
- package/scripts/deploy-pages.sh +34 -0
- package/scripts/deploy-worker-secrets.sh +215 -0
- package/scripts/dev.cjs +23 -0
- package/scripts/install-workers.sh +88 -0
- package/scripts/run-eslint.cjs +35 -0
- package/scripts/update-compatibility-dates.cjs +124 -0
- package/scripts/update-markdown-versions.cjs +43 -0
- package/tailwind.config.ts +22 -0
- package/tsconfig.json +33 -0
- package/vite.config.ts +35 -0
- package/worker-configuration.d.ts +7490 -0
- package/workers/audit-worker/package.json +17 -0
- package/workers/audit-worker/src/audit-worker.example.ts +195 -0
- package/workers/audit-worker/worker-configuration.d.ts +7448 -0
- package/workers/audit-worker/wrangler.jsonc.example +29 -0
- package/workers/data-worker/package.json +17 -0
- package/workers/data-worker/src/data-worker.example.ts +267 -0
- package/workers/data-worker/src/signature-utils.ts +79 -0
- package/workers/data-worker/src/signing-payload-utils.ts +290 -0
- package/workers/data-worker/worker-configuration.d.ts +7448 -0
- package/workers/data-worker/wrangler.jsonc.example +30 -0
- package/workers/image-worker/package.json +17 -0
- package/workers/image-worker/src/image-worker.example.ts +180 -0
- package/workers/image-worker/worker-configuration.d.ts +7447 -0
- package/workers/image-worker/wrangler.jsonc.example +22 -0
- package/workers/keys-worker/package.json +17 -0
- package/workers/keys-worker/src/keys.example.ts +66 -0
- package/workers/keys-worker/src/keys.ts +66 -0
- package/workers/keys-worker/worker-configuration.d.ts +7447 -0
- package/workers/keys-worker/wrangler.jsonc.example +22 -0
- package/workers/pdf-worker/package.json +17 -0
- package/workers/pdf-worker/src/format-striae.ts +534 -0
- package/workers/pdf-worker/src/pdf-worker.example.ts +119 -0
- package/workers/pdf-worker/src/report-types.ts +69 -0
- package/workers/pdf-worker/worker-configuration.d.ts +7448 -0
- package/workers/pdf-worker/wrangler.jsonc.example +26 -0
- package/workers/user-worker/package.json +17 -0
- package/workers/user-worker/src/user-worker.example.ts +636 -0
- package/workers/user-worker/worker-configuration.d.ts +7448 -0
- package/workers/user-worker/wrangler.jsonc.example +29 -0
- package/wrangler.toml.example +8 -0
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/* User Audit Trail Viewer Styles */
|
|
2
|
+
|
|
3
|
+
.overlay {
|
|
4
|
+
position: fixed;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
background: rgba(0, 0, 0, 0.7);
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
z-index: 1000;
|
|
14
|
+
padding: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.modal {
|
|
18
|
+
background: var(--background);
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
width: 90%;
|
|
21
|
+
max-width: 1000px;
|
|
22
|
+
max-height: 90vh;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.header {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
align-items: center;
|
|
33
|
+
padding: 20px;
|
|
34
|
+
border-bottom: 1px solid color-mix(in lab, var(--textLight) 20%, transparent);
|
|
35
|
+
background: var(--backgroundLight);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.headerActions {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
gap: 16px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.exportButtons {
|
|
45
|
+
display: flex;
|
|
46
|
+
gap: 8px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.exportButton {
|
|
50
|
+
background: var(--primary);
|
|
51
|
+
color: white;
|
|
52
|
+
border: none;
|
|
53
|
+
padding: 8px 12px;
|
|
54
|
+
border-radius: 6px;
|
|
55
|
+
font-size: 0.875rem;
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: all var(--durationS) var(--bezierFastoutSlowin);
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 4px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.exportButton:hover {
|
|
65
|
+
background: color-mix(in lab, var(--primary) 85%, var(--black));
|
|
66
|
+
box-shadow: 0 2px 6px color-mix(in lab, var(--primary) 30%, transparent);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.exportButton:active {
|
|
70
|
+
transform: translateY(0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.title {
|
|
74
|
+
margin: 0;
|
|
75
|
+
color: var(--textTitle);
|
|
76
|
+
font-size: 1.5rem;
|
|
77
|
+
font-weight: var(--fontWeightMedium);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.closeButton {
|
|
81
|
+
background: none;
|
|
82
|
+
border: none;
|
|
83
|
+
font-size: 1.5rem;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
padding: 8px;
|
|
86
|
+
color: var(--textLight);
|
|
87
|
+
transition: color var(--durationS) var(--bezierFastoutSlowin);
|
|
88
|
+
border-radius: 4px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.closeButton:hover {
|
|
92
|
+
color: var(--text);
|
|
93
|
+
background: color-mix(in lab, var(--textLight) 10%, transparent);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.content {
|
|
97
|
+
flex: 1;
|
|
98
|
+
overflow-y: auto;
|
|
99
|
+
padding: 20px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Loading & Error States */
|
|
103
|
+
.loading, .error {
|
|
104
|
+
text-align: center;
|
|
105
|
+
padding: 40px 20px;
|
|
106
|
+
color: var(--textBody);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.spinner {
|
|
110
|
+
width: 40px;
|
|
111
|
+
height: 40px;
|
|
112
|
+
border: 3px solid color-mix(in lab, var(--primary) 20%, transparent);
|
|
113
|
+
border-top: 3px solid var(--primary);
|
|
114
|
+
border-radius: 50%;
|
|
115
|
+
animation: spin 1s linear infinite;
|
|
116
|
+
margin: 0 auto 16px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@keyframes spin {
|
|
120
|
+
0% { transform: rotate(0deg); }
|
|
121
|
+
100% { transform: rotate(360deg); }
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.error {
|
|
125
|
+
color: var(--error);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.retryButton {
|
|
129
|
+
background: var(--primary);
|
|
130
|
+
color: white;
|
|
131
|
+
border: none;
|
|
132
|
+
padding: 8px 16px;
|
|
133
|
+
border-radius: 4px;
|
|
134
|
+
cursor: pointer;
|
|
135
|
+
font-size: 0.9rem;
|
|
136
|
+
margin-top: 12px;
|
|
137
|
+
transition: background-color var(--durationS) var(--bezierFastoutSlowin);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.retryButton:hover {
|
|
141
|
+
background: color-mix(in lab, var(--primary) 85%, var(--black));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Summary Section */
|
|
145
|
+
.summary {
|
|
146
|
+
margin-bottom: 24px;
|
|
147
|
+
padding: 16px;
|
|
148
|
+
background: var(--backgroundLight);
|
|
149
|
+
border-radius: 6px;
|
|
150
|
+
border: 1px solid color-mix(in lab, var(--textLight) 20%, transparent);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Common heading styles */
|
|
154
|
+
.summary h3,
|
|
155
|
+
.entriesList h3 {
|
|
156
|
+
margin: 0 0 16px 0;
|
|
157
|
+
color: var(--textTitle);
|
|
158
|
+
font-size: 1.2rem;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.summaryGrid {
|
|
162
|
+
display: grid;
|
|
163
|
+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
|
164
|
+
gap: 12px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.summaryItem {
|
|
168
|
+
display: flex;
|
|
169
|
+
justify-content: space-between;
|
|
170
|
+
align-items: center;
|
|
171
|
+
padding: 8px 12px;
|
|
172
|
+
background: var(--background);
|
|
173
|
+
border-radius: 4px;
|
|
174
|
+
border: 1px solid color-mix(in lab, var(--textLight) 15%, transparent);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.label {
|
|
178
|
+
color: var(--textBody);
|
|
179
|
+
font-weight: 500;
|
|
180
|
+
font-size: 0.9rem;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.value {
|
|
184
|
+
color: var(--text);
|
|
185
|
+
font-weight: var(--fontWeightMedium);
|
|
186
|
+
font-size: 0.9rem;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.value.warning {
|
|
190
|
+
color: var(--error);
|
|
191
|
+
font-weight: var(--fontWeightBold);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.warning {
|
|
195
|
+
color: var(--error);
|
|
196
|
+
font-weight: var(--fontWeightBold);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Standalone classes for dynamic assignment */
|
|
200
|
+
.success {
|
|
201
|
+
border-color: color-mix(in lab, var(--success) 40%, transparent);
|
|
202
|
+
background: color-mix(in lab, var(--success) 3%, transparent);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.failure {
|
|
206
|
+
border-color: color-mix(in lab, var(--error) 40%, transparent);
|
|
207
|
+
background: color-mix(in lab, var(--error) 3%, transparent);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.blocked {
|
|
211
|
+
border-color: color-mix(in lab, var(--error) 60%, transparent);
|
|
212
|
+
background: color-mix(in lab, var(--error) 5%, transparent);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.low {
|
|
216
|
+
background: color-mix(in lab, var(--success) 15%, transparent);
|
|
217
|
+
color: var(--success);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.medium {
|
|
221
|
+
background: color-mix(in lab, var(--warning) 15%, transparent);
|
|
222
|
+
color: var(--warning);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.high {
|
|
226
|
+
background: color-mix(in lab, var(--error) 15%, transparent);
|
|
227
|
+
color: var(--error);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.critical {
|
|
231
|
+
background: color-mix(in lab, var(--error) 25%, transparent);
|
|
232
|
+
color: var(--error);
|
|
233
|
+
font-weight: var(--fontWeightBold);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* User Information Section */
|
|
237
|
+
.userInfoContent {
|
|
238
|
+
display: flex;
|
|
239
|
+
flex-direction: column;
|
|
240
|
+
gap: 8px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.userInfoItem {
|
|
244
|
+
color: var(--textBody);
|
|
245
|
+
font-size: 0.9rem;
|
|
246
|
+
line-height: 1.4;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.userInfoItem strong {
|
|
250
|
+
color: var(--text);
|
|
251
|
+
font-weight: var(--fontWeightMedium);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Filters */
|
|
255
|
+
.filters {
|
|
256
|
+
display: flex;
|
|
257
|
+
gap: 16px;
|
|
258
|
+
flex-wrap: wrap;
|
|
259
|
+
margin-bottom: 24px;
|
|
260
|
+
padding: 16px;
|
|
261
|
+
background: color-mix(in lab, var(--backgroundLight) 50%, transparent);
|
|
262
|
+
border-radius: 6px;
|
|
263
|
+
border: 1px solid color-mix(in lab, var(--textLight) 15%, transparent);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.filterGroup {
|
|
267
|
+
display: flex;
|
|
268
|
+
flex-direction: column;
|
|
269
|
+
gap: 4px;
|
|
270
|
+
min-width: 140px;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.filterGroup label {
|
|
274
|
+
font-size: 0.85rem;
|
|
275
|
+
color: var(--textBody);
|
|
276
|
+
font-weight: 500;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.filterSelect {
|
|
280
|
+
padding: 6px 8px;
|
|
281
|
+
border: 1px solid color-mix(in lab, var(--textLight) 30%, transparent);
|
|
282
|
+
border-radius: 4px;
|
|
283
|
+
background: var(--background);
|
|
284
|
+
color: var(--text);
|
|
285
|
+
font-size: 0.9rem;
|
|
286
|
+
min-width: 120px;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.customDateRange {
|
|
290
|
+
display: flex;
|
|
291
|
+
flex-direction: column;
|
|
292
|
+
gap: 12px;
|
|
293
|
+
width: 100%;
|
|
294
|
+
padding: 12px 0 8px 0;
|
|
295
|
+
border-top: 1px solid color-mix(in lab, var(--textLight) 20%, transparent);
|
|
296
|
+
margin-top: 8px;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.customDateInputs {
|
|
300
|
+
display: flex;
|
|
301
|
+
gap: 12px;
|
|
302
|
+
flex-wrap: wrap;
|
|
303
|
+
width: 100%;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.filterInput {
|
|
307
|
+
padding: 6px 8px;
|
|
308
|
+
border: 1px solid color-mix(in lab, var(--textLight) 30%, transparent);
|
|
309
|
+
border-radius: 4px;
|
|
310
|
+
background: var(--background);
|
|
311
|
+
color: var(--text);
|
|
312
|
+
font-size: 0.9rem;
|
|
313
|
+
min-width: 140px;
|
|
314
|
+
font-family: inherit;
|
|
315
|
+
flex: 1;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.filterInput:focus {
|
|
319
|
+
outline: none;
|
|
320
|
+
border-color: var(--primary);
|
|
321
|
+
box-shadow: 0 0 0 2px color-mix(in lab, var(--primary) 20%, transparent);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.filterInput:disabled {
|
|
325
|
+
background: color-mix(in lab, var(--background) 95%, var(--text));
|
|
326
|
+
color: color-mix(in lab, var(--text) 50%, transparent);
|
|
327
|
+
cursor: not-allowed;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.inputWithButton {
|
|
331
|
+
display: flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
position: relative;
|
|
334
|
+
flex: 1;
|
|
335
|
+
gap: 8px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.caseFilterButtons {
|
|
339
|
+
display: flex;
|
|
340
|
+
gap: 4px;
|
|
341
|
+
align-items: center;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.filterButton {
|
|
345
|
+
background: var(--primary);
|
|
346
|
+
color: white;
|
|
347
|
+
border: none;
|
|
348
|
+
padding: 6px 12px;
|
|
349
|
+
border-radius: 4px;
|
|
350
|
+
font-size: 0.875rem;
|
|
351
|
+
font-weight: 500;
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
transition: all var(--durationS) var(--bezierFastoutSlowin);
|
|
354
|
+
white-space: nowrap;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.filterButton:hover {
|
|
358
|
+
background: color-mix(in lab, var(--primary) 85%, var(--black));
|
|
359
|
+
box-shadow: 0 2px 6px color-mix(in lab, var(--primary) 30%, transparent);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.filterButton:active {
|
|
363
|
+
transform: translateY(0);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.clearButton {
|
|
367
|
+
background: var(--error);
|
|
368
|
+
color: white;
|
|
369
|
+
border: none;
|
|
370
|
+
padding: 6px 12px;
|
|
371
|
+
border-radius: 4px;
|
|
372
|
+
font-size: 0.875rem;
|
|
373
|
+
font-weight: 500;
|
|
374
|
+
cursor: pointer;
|
|
375
|
+
transition: all var(--durationS) var(--bezierFastoutSlowin);
|
|
376
|
+
white-space: nowrap;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.clearButton:hover {
|
|
380
|
+
background: color-mix(in lab, var(--error) 85%, var(--black));
|
|
381
|
+
box-shadow: 0 2px 6px color-mix(in lab, var(--error) 30%, transparent);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
.clearButton:active {
|
|
385
|
+
transform: translateY(0);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.activeFilter {
|
|
389
|
+
margin-top: 4px;
|
|
390
|
+
color: var(--textLight);
|
|
391
|
+
font-size: 0.875rem;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.activeFilter strong {
|
|
395
|
+
color: var(--primary);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.dateRangeButtons {
|
|
399
|
+
display: flex;
|
|
400
|
+
gap: 8px;
|
|
401
|
+
align-items: center;
|
|
402
|
+
margin-top: 8px;
|
|
403
|
+
padding-top: 8px;
|
|
404
|
+
border-top: 1px solid color-mix(in lab, var(--textLight) 20%, transparent);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* Entries List */
|
|
408
|
+
.entry {
|
|
409
|
+
margin-bottom: 12px;
|
|
410
|
+
border-radius: 6px;
|
|
411
|
+
border: 1px solid;
|
|
412
|
+
overflow: hidden;
|
|
413
|
+
transition: box-shadow var(--durationS) var(--bezierFastoutSlowin);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.entry:hover {
|
|
417
|
+
box-shadow: 0 2px 8px color-mix(in lab, var(--textLight) 20%, transparent);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.entry.success {
|
|
421
|
+
border-color: color-mix(in lab, var(--success) 40%, transparent);
|
|
422
|
+
background: color-mix(in lab, var(--success) 3%, transparent);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
.entry.failure {
|
|
426
|
+
border-color: color-mix(in lab, var(--error) 40%, transparent);
|
|
427
|
+
background: color-mix(in lab, var(--error) 3%, transparent);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.entry.warning {
|
|
431
|
+
border-color: color-mix(in lab, var(--warning) 40%, transparent);
|
|
432
|
+
background: color-mix(in lab, var(--warning) 3%, transparent);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.entry.blocked {
|
|
436
|
+
border-color: color-mix(in lab, var(--error) 60%, transparent);
|
|
437
|
+
background: color-mix(in lab, var(--error) 5%, transparent);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.entryHeader {
|
|
441
|
+
display: flex;
|
|
442
|
+
align-items: center;
|
|
443
|
+
gap: 12px;
|
|
444
|
+
padding: 10px 14px;
|
|
445
|
+
background: color-mix(in lab, var(--backgroundLight) 50%, transparent);
|
|
446
|
+
border-bottom: 1px solid color-mix(in lab, var(--textLight) 15%, transparent);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.entryIcons {
|
|
450
|
+
display: flex;
|
|
451
|
+
gap: 4px;
|
|
452
|
+
align-items: center;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.actionIcon {
|
|
456
|
+
font-size: 1rem;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.statusIcon {
|
|
460
|
+
font-size: 1rem;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.entryTitle {
|
|
464
|
+
flex: 1;
|
|
465
|
+
display: flex;
|
|
466
|
+
align-items: center;
|
|
467
|
+
gap: 8px;
|
|
468
|
+
flex-wrap: wrap;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.action {
|
|
472
|
+
background: var(--primary);
|
|
473
|
+
color: white;
|
|
474
|
+
padding: 2px 6px;
|
|
475
|
+
border-radius: 10px;
|
|
476
|
+
font-size: 0.7rem;
|
|
477
|
+
font-weight: var(--fontWeightMedium);
|
|
478
|
+
text-transform: uppercase;
|
|
479
|
+
letter-spacing: 0.5px;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.fileName {
|
|
483
|
+
color: var(--textBody);
|
|
484
|
+
font-size: 0.85rem;
|
|
485
|
+
max-width: 200px;
|
|
486
|
+
white-space: nowrap;
|
|
487
|
+
overflow: hidden;
|
|
488
|
+
text-overflow: ellipsis;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.entryTimestamp {
|
|
492
|
+
color: var(--textLight);
|
|
493
|
+
font-size: 0.8rem;
|
|
494
|
+
white-space: nowrap;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/* Entry Details */
|
|
498
|
+
.entryDetails {
|
|
499
|
+
padding: 12px 14px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.detailRow {
|
|
503
|
+
display: flex;
|
|
504
|
+
align-items: center;
|
|
505
|
+
margin-bottom: 6px;
|
|
506
|
+
gap: 8px;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.detailRow:last-child {
|
|
510
|
+
margin-bottom: 0;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.detailLabel {
|
|
514
|
+
color: var(--textBody);
|
|
515
|
+
font-size: 0.85rem;
|
|
516
|
+
font-weight: 500;
|
|
517
|
+
min-width: max-content;
|
|
518
|
+
flex-shrink: 0;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.detailValue {
|
|
522
|
+
color: var(--text);
|
|
523
|
+
font-size: 0.85rem;
|
|
524
|
+
word-break: break-word;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.severity {
|
|
528
|
+
font-weight: var(--fontWeightMedium);
|
|
529
|
+
padding: 2px 6px;
|
|
530
|
+
border-radius: 10px;
|
|
531
|
+
font-size: 0.7rem;
|
|
532
|
+
text-transform: uppercase;
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.severity.low {
|
|
536
|
+
background: color-mix(in lab, var(--success) 15%, transparent);
|
|
537
|
+
color: var(--success);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
.severity.medium {
|
|
541
|
+
background: color-mix(in lab, var(--warning) 15%, transparent);
|
|
542
|
+
color: var(--warning);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.severity.high {
|
|
546
|
+
background: color-mix(in lab, var(--error) 15%, transparent);
|
|
547
|
+
color: var(--error);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
.severity.critical {
|
|
551
|
+
background: color-mix(in lab, var(--error) 25%, transparent);
|
|
552
|
+
color: var(--error);
|
|
553
|
+
font-weight: var(--fontWeightBold);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
.noEntries {
|
|
557
|
+
text-align: center;
|
|
558
|
+
padding: 32px 16px;
|
|
559
|
+
color: var(--textLight);
|
|
560
|
+
font-style: italic;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
.noData {
|
|
564
|
+
text-align: center;
|
|
565
|
+
padding: 32px 16px;
|
|
566
|
+
color: var(--textLight);
|
|
567
|
+
font-style: italic;
|
|
568
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { User } from 'firebase/auth';
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { auth } from '~/services/firebase';
|
|
4
|
+
import { useInactivityTimeout } from '~/hooks/useInactivityTimeout';
|
|
5
|
+
import { INACTIVITY_CONFIG } from '~/config/inactivity';
|
|
6
|
+
import { AuthContext } from '~/contexts/auth.context';
|
|
7
|
+
import { InactivityWarning } from '~/components/user/inactivity-warning';
|
|
8
|
+
import { auditService } from '~/services/audit.service';
|
|
9
|
+
import { generateUniqueId } from '~/utils/id-generator';
|
|
10
|
+
|
|
11
|
+
interface AuthProviderProps {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function AuthProvider({ children }: AuthProviderProps) {
|
|
16
|
+
const [user, setUser] = useState<User | null>(null);
|
|
17
|
+
const [showInactivityWarning, setShowInactivityWarning] = useState(false);
|
|
18
|
+
const [remainingSeconds, setRemainingSeconds] = useState(0);
|
|
19
|
+
|
|
20
|
+
const { extendSession } = useInactivityTimeout({
|
|
21
|
+
enabled: !!user,
|
|
22
|
+
onWarning: () => {
|
|
23
|
+
setRemainingSeconds(INACTIVITY_CONFIG.WARNING_MINUTES * 60);
|
|
24
|
+
setShowInactivityWarning(true);
|
|
25
|
+
},
|
|
26
|
+
onTimeout: () => {
|
|
27
|
+
setShowInactivityWarning(false);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
return auth.onAuthStateChanged((user) => {
|
|
33
|
+
setUser(user);
|
|
34
|
+
if (!user) {
|
|
35
|
+
setShowInactivityWarning(false);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
39
|
+
|
|
40
|
+
const handleExtendSession = () => {
|
|
41
|
+
setShowInactivityWarning(false);
|
|
42
|
+
extendSession();
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const handleSignOutNow = async () => {
|
|
46
|
+
setShowInactivityWarning(false);
|
|
47
|
+
|
|
48
|
+
// Log timeout logout audit before signing out
|
|
49
|
+
if (user) {
|
|
50
|
+
try {
|
|
51
|
+
const sessionId = `session_${user.uid}_timeout_${Date.now()}_${generateUniqueId(8)}`;
|
|
52
|
+
await auditService.logUserLogout(
|
|
53
|
+
user,
|
|
54
|
+
sessionId,
|
|
55
|
+
INACTIVITY_CONFIG.TIMEOUT_MINUTES * 60, // sessionDuration in seconds
|
|
56
|
+
'timeout'
|
|
57
|
+
);
|
|
58
|
+
} catch (auditError) {
|
|
59
|
+
console.error('Failed to log timeout logout audit:', auditError);
|
|
60
|
+
// Continue with logout even if audit logging fails
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
auth.signOut();
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<AuthContext.Provider value={{ user, setUser }}>
|
|
69
|
+
{children}
|
|
70
|
+
<InactivityWarning
|
|
71
|
+
isOpen={showInactivityWarning}
|
|
72
|
+
remainingSeconds={remainingSeconds}
|
|
73
|
+
onExtendSession={handleExtendSession}
|
|
74
|
+
onSignOut={handleSignOutNow}
|
|
75
|
+
/>
|
|
76
|
+
</AuthContext.Provider>
|
|
77
|
+
);
|
|
78
|
+
}
|