braid-ui 1.0.3 → 1.0.5

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/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var React13 = require('react');
4
- var reactDom = require('react-dom');
5
- var reactSlot = require('@radix-ui/react-slot');
6
4
  var classVarianceAuthority = require('class-variance-authority');
7
5
  var clsx = require('clsx');
8
6
  var tailwindMerge = require('tailwind-merge');
9
7
  var jsxRuntime = require('react/jsx-runtime');
8
+ var reactSlot = require('@radix-ui/react-slot');
10
9
  var lucideReact = require('lucide-react');
10
+ var reactDom = require('react-dom');
11
11
  var SelectPrimitive = require('@radix-ui/react-select');
12
12
  var DialogPrimitive = require('@radix-ui/react-dialog');
13
13
  var reactRouterDom = require('react-router-dom');
@@ -56,10 +56,218 @@ var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespace(PopoverPrimitiv
56
56
  var TabsPrimitive__namespace = /*#__PURE__*/_interopNamespace(TabsPrimitive);
57
57
  var ToastPrimitives__namespace = /*#__PURE__*/_interopNamespace(ToastPrimitives);
58
58
 
59
- // src/components/alerts/AlertDocuments.tsx
59
+ // src/components/ui/form-card.tsx
60
60
  function cn(...inputs) {
61
61
  return tailwindMerge.twMerge(clsx.clsx(inputs));
62
62
  }
63
+ var cardVariants = classVarianceAuthority.cva(
64
+ "rounded-lg border bg-card text-card-foreground transition-all duration-200",
65
+ {
66
+ variants: {
67
+ variant: {
68
+ default: "shadow-sm",
69
+ elevated: "shadow-md hover:shadow-lg",
70
+ outlined: "border-2 shadow-none",
71
+ ghost: "border-transparent shadow-none bg-transparent",
72
+ subtle: "border-border/75 shadow-none"
73
+ },
74
+ size: {
75
+ sm: "p-3",
76
+ md: "p-4",
77
+ lg: "p-6",
78
+ none: "p-0"
79
+ },
80
+ fullHeight: {
81
+ true: "h-full flex flex-col",
82
+ false: ""
83
+ },
84
+ interactive: {
85
+ true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
86
+ false: ""
87
+ }
88
+ },
89
+ defaultVariants: {
90
+ variant: "default",
91
+ size: "none",
92
+ fullHeight: false,
93
+ interactive: false
94
+ }
95
+ }
96
+ );
97
+ var Card = React13__namespace.forwardRef(
98
+ ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
99
+ "div",
100
+ {
101
+ ref,
102
+ className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
103
+ ...props
104
+ }
105
+ )
106
+ );
107
+ Card.displayName = "Card";
108
+ var cardHeaderVariants = classVarianceAuthority.cva(
109
+ "flex flex-col space-y-1.5",
110
+ {
111
+ variants: {
112
+ size: {
113
+ sm: "px-3 pt-3 pb-2",
114
+ md: "px-4 pt-4 pb-3",
115
+ lg: "px-6 pt-6 pb-4"
116
+ },
117
+ align: {
118
+ start: "items-start",
119
+ center: "items-center",
120
+ end: "items-end"
121
+ },
122
+ direction: {
123
+ row: "flex-row justify-between items-center space-y-0 space-x-4",
124
+ column: "flex-col space-y-1.5"
125
+ }
126
+ },
127
+ defaultVariants: {
128
+ size: "lg",
129
+ align: "start",
130
+ direction: "column"
131
+ }
132
+ }
133
+ );
134
+ var CardHeader = React13__namespace.forwardRef(
135
+ ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
136
+ "div",
137
+ {
138
+ ref,
139
+ className: cn(cardHeaderVariants({ size, align, direction }), className),
140
+ ...props
141
+ }
142
+ )
143
+ );
144
+ CardHeader.displayName = "CardHeader";
145
+ var cardTitleVariants = classVarianceAuthority.cva(
146
+ "font-semibold leading-none tracking-tight",
147
+ {
148
+ variants: {
149
+ size: {
150
+ sm: "text-base",
151
+ md: "text-lg",
152
+ lg: "text-xl"
153
+ }
154
+ },
155
+ defaultVariants: {
156
+ size: "md"
157
+ }
158
+ }
159
+ );
160
+ var CardTitle = React13__namespace.forwardRef(
161
+ ({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
162
+ "h3",
163
+ {
164
+ ref,
165
+ className: cn(cardTitleVariants({ size }), className),
166
+ ...props
167
+ }
168
+ )
169
+ );
170
+ CardTitle.displayName = "CardTitle";
171
+ var CardDescription = React13__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
172
+ "p",
173
+ {
174
+ ref,
175
+ className: cn("text-sm text-muted-foreground", className),
176
+ ...props
177
+ }
178
+ ));
179
+ CardDescription.displayName = "CardDescription";
180
+ var cardContentVariants = classVarianceAuthority.cva(
181
+ "",
182
+ {
183
+ variants: {
184
+ size: {
185
+ sm: "px-3 pb-2",
186
+ md: "px-4 pb-3",
187
+ lg: "px-6 pb-4"
188
+ },
189
+ fullHeight: {
190
+ true: "flex-1",
191
+ false: ""
192
+ }
193
+ },
194
+ defaultVariants: {
195
+ size: "lg",
196
+ fullHeight: false
197
+ }
198
+ }
199
+ );
200
+ var CardContent = React13__namespace.forwardRef(
201
+ ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
202
+ "div",
203
+ {
204
+ ref,
205
+ className: cn(cardContentVariants({ size, fullHeight }), className),
206
+ ...props
207
+ }
208
+ )
209
+ );
210
+ CardContent.displayName = "CardContent";
211
+ var cardFooterVariants = classVarianceAuthority.cva(
212
+ "flex items-center pt-0",
213
+ {
214
+ variants: {
215
+ size: {
216
+ sm: "p-3 pt-0",
217
+ md: "p-4 pt-0",
218
+ lg: "p-6 pt-0"
219
+ },
220
+ justify: {
221
+ start: "justify-start",
222
+ center: "justify-center",
223
+ end: "justify-end",
224
+ between: "justify-between"
225
+ }
226
+ },
227
+ defaultVariants: {
228
+ size: "lg",
229
+ justify: "start"
230
+ }
231
+ }
232
+ );
233
+ var CardFooter = React13__namespace.forwardRef(
234
+ ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
235
+ "div",
236
+ {
237
+ ref,
238
+ className: cn(cardFooterVariants({ size, justify }), className),
239
+ ...props
240
+ }
241
+ )
242
+ );
243
+ CardFooter.displayName = "CardFooter";
244
+ var FormCard = React13__namespace.forwardRef(
245
+ ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
246
+ Card,
247
+ {
248
+ ref,
249
+ variant,
250
+ fullHeight: true,
251
+ className: cn("", className),
252
+ ...props,
253
+ children: [
254
+ /* @__PURE__ */ jsxRuntime.jsxs(
255
+ CardHeader,
256
+ {
257
+ direction: headerActions ? "row" : "column",
258
+ size: "md",
259
+ children: [
260
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: title }) }),
261
+ headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: headerActions })
262
+ ]
263
+ }
264
+ ),
265
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { size: "md", fullHeight: true, children })
266
+ ]
267
+ }
268
+ )
269
+ );
270
+ FormCard.displayName = "FormCard";
63
271
  var buttonVariants = classVarianceAuthority.cva(
64
272
  "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
65
273
  {
@@ -99,171 +307,92 @@ var Button = React13__namespace.forwardRef(
99
307
  }
100
308
  );
101
309
  Button.displayName = "Button";
102
- var TOAST_LIMIT = 1;
103
- var TOAST_REMOVE_DELAY = 1e6;
104
- var count = 0;
105
- function genId() {
106
- count = (count + 1) % Number.MAX_SAFE_INTEGER;
107
- return count.toString();
108
- }
109
- var toastTimeouts = /* @__PURE__ */ new Map();
110
- var addToRemoveQueue = (toastId) => {
111
- if (toastTimeouts.has(toastId)) {
112
- return;
113
- }
114
- const timeout = setTimeout(() => {
115
- toastTimeouts.delete(toastId);
116
- dispatch({
117
- type: "REMOVE_TOAST",
118
- toastId
119
- });
120
- }, TOAST_REMOVE_DELAY);
121
- toastTimeouts.set(toastId, timeout);
122
- };
123
- var reducer = (state, action) => {
124
- switch (action.type) {
125
- case "ADD_TOAST":
126
- return {
127
- ...state,
128
- toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
129
- };
130
- case "UPDATE_TOAST":
131
- return {
132
- ...state,
133
- toasts: state.toasts.map(
134
- (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
135
- )
136
- };
137
- case "DISMISS_TOAST": {
138
- const { toastId } = action;
139
- if (toastId) {
140
- addToRemoveQueue(toastId);
141
- } else {
142
- state.toasts.forEach((toast4) => {
143
- addToRemoveQueue(toast4.id);
144
- });
145
- }
146
- return {
147
- ...state,
148
- toasts: state.toasts.map(
149
- (t) => t.id === toastId || toastId === void 0 ? {
150
- ...t,
151
- open: false
152
- } : t
153
- )
154
- };
155
- }
156
- case "REMOVE_TOAST":
157
- if (action.toastId === void 0) {
158
- return {
159
- ...state,
160
- toasts: []
161
- };
162
- }
163
- return {
164
- ...state,
165
- toasts: state.toasts.filter((t) => t.id !== action.toastId)
166
- };
167
- }
168
- };
169
- var listeners = [];
170
- var memoryState = { toasts: [] };
171
- function dispatch(action) {
172
- memoryState = reducer(memoryState, action);
173
- listeners.forEach((listener) => {
174
- listener(memoryState);
175
- });
176
- }
177
- function toast({ ...props }) {
178
- const id = genId();
179
- const update = (props2) => dispatch({
180
- type: "UPDATE_TOAST",
181
- toast: { ...props2, id }
182
- });
183
- const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
184
- dispatch({
185
- type: "ADD_TOAST",
186
- toast: {
187
- ...props,
188
- id,
189
- open: true,
190
- onOpenChange: (open) => {
191
- if (!open) dismiss();
192
- }
193
- }
194
- });
195
- return {
196
- id,
197
- dismiss,
198
- update
199
- };
200
- }
201
- function useToast() {
202
- const [state, setState] = React13__namespace.useState(memoryState);
203
- React13__namespace.useEffect(() => {
204
- listeners.push(setState);
205
- return () => {
206
- const index = listeners.indexOf(setState);
207
- if (index > -1) {
208
- listeners.splice(index, 1);
209
- }
210
- };
211
- }, [state]);
212
- return {
213
- ...state,
214
- toast,
215
- dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
216
- };
217
- }
218
- var inputVariants = classVarianceAuthority.cva(
219
- "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
310
+ var badgeVariants = classVarianceAuthority.cva(
311
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
220
312
  {
221
313
  variants: {
222
314
  variant: {
223
- default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
224
- error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
225
- success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
226
- disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
227
- readonly: "border border-form-border bg-muted/50 cursor-default"
228
- },
229
- size: {
230
- default: "h-10",
231
- sm: "h-9",
232
- lg: "h-11"
315
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
316
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
317
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
318
+ outline: "text-foreground",
319
+ success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
320
+ warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
321
+ // Business type specific variants
322
+ business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
323
+ individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
324
+ government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
325
+ nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
326
+ // Business entity type variants
327
+ corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
328
+ llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
329
+ partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
330
+ sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
331
+ // Status variants
332
+ active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
333
+ inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
334
+ pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
335
+ suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
336
+ // Alert type subtle variants
337
+ "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
338
+ "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
339
+ "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
340
+ "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
233
341
  }
234
342
  },
235
343
  defaultVariants: {
236
- variant: "default",
237
- size: "default"
344
+ variant: "default"
238
345
  }
239
346
  }
240
347
  );
241
- var EnhancedInput = React13__namespace.forwardRef(
242
- ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
243
- const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
244
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
245
- label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
246
- label,
247
- props.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
348
+ function Badge({ className, variant, ...props }) {
349
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
350
+ }
351
+ var AlertTimeline = ({ events }) => {
352
+ const getIcon = (action) => {
353
+ if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
354
+ if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
355
+ if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
356
+ if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
357
+ if (action.includes("Rejected")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-4 w-4" });
358
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
359
+ };
360
+ const getStatusColor2 = (status) => {
361
+ switch (status) {
362
+ case "Unassigned":
363
+ return "text-destructive";
364
+ case "Closed":
365
+ return "text-success";
366
+ case "In Progress":
367
+ return "text-warning";
368
+ default:
369
+ return "text-muted-foreground";
370
+ }
371
+ };
372
+ if (events.length === 0) {
373
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
374
+ }
375
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
376
+ index !== events.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
377
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
378
+ "absolute left-0 top-0 flex-none",
379
+ getStatusColor2(event.status)
380
+ ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
381
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
382
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
383
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
384
+ "by ",
385
+ event.user
248
386
  ] }),
249
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
250
- /* @__PURE__ */ jsxRuntime.jsx(
251
- "input",
252
- {
253
- className: cn(inputVariants({ variant: inputVariant, size, className })),
254
- ref,
255
- ...props
256
- }
257
- ),
258
- isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
387
+ event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
388
+ event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
389
+ "Status: ",
390
+ event.status
259
391
  ] }),
260
- hint && !error && !success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
261
- error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error }),
262
- success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-success", children: success })
263
- ] });
264
- }
265
- );
266
- EnhancedInput.displayName = "EnhancedInput";
392
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
393
+ ] })
394
+ ] }, event.id)) });
395
+ };
267
396
  var textareaVariants = classVarianceAuthority.cva(
268
397
  "flex min-h-[80px] w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground transition-form resize-y",
269
398
  {
@@ -360,179 +489,208 @@ var EnhancedSelect = React13__namespace.forwardRef(({ variant, label, hint, erro
360
489
  ] });
361
490
  });
362
491
  EnhancedSelect.displayName = "EnhancedSelect";
363
- var AlertDocuments = ({ alertId, documents }) => {
364
- const [isUploading, setIsUploading] = React13.useState(false);
365
- const [showUploadDialog, setShowUploadDialog] = React13.useState(false);
366
- const [selectedFile, setSelectedFile] = React13.useState(null);
367
- const [documentName, setDocumentName] = React13.useState("");
368
- const [description, setDescription] = React13.useState("");
369
- const [documentType, setDocumentType] = React13.useState("");
370
- const handleFileSelect = (e) => {
371
- const file = e.target.files?.[0];
372
- if (!file) return;
373
- setSelectedFile(file);
374
- setDocumentName(file.name);
375
- };
376
- const handleUploadSubmit = () => {
377
- if (!selectedFile || !documentName || !documentType) {
378
- toast({
379
- title: "Missing Information",
380
- description: "Please fill in all required fields",
381
- variant: "destructive"
382
- });
383
- return;
384
- }
385
- setIsUploading(true);
386
- setTimeout(() => {
387
- ({
388
- size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
389
- uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
390
- });
391
- toast({
392
- title: "Upload Successful",
393
- description: `${documentName} uploaded successfully`
394
- });
395
- setIsUploading(false);
396
- setShowUploadDialog(false);
397
- resetForm();
398
- }, 1e3);
399
- };
400
- const resetForm = () => {
401
- setSelectedFile(null);
402
- setDocumentName("");
403
- setDescription("");
404
- setDocumentType("");
405
- const fileInput = document.getElementById("file-upload");
406
- if (fileInput) fileInput.value = "";
407
- };
408
- const handleCancelUpload = () => {
409
- setShowUploadDialog(false);
410
- resetForm();
411
- };
412
- const isImageType = (name) => {
413
- const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
414
- return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
415
- };
416
- const getFileIcon = (type) => {
417
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
418
- };
419
- const getFileTypeColor = (type) => {
420
- switch (type.toUpperCase()) {
421
- case "PDF":
422
- return "text-red-500";
423
- case "DOCX":
424
- case "DOC":
425
- return "text-blue-500";
426
- case "XLSX":
427
- case "XLS":
428
- return "text-green-500";
429
- case "JPG":
430
- case "JPEG":
431
- case "PNG":
432
- return "text-purple-500";
433
- default:
434
- return "text-muted-foreground";
492
+ var TOAST_LIMIT = 1;
493
+ var TOAST_REMOVE_DELAY = 1e6;
494
+ var count = 0;
495
+ function genId() {
496
+ count = (count + 1) % Number.MAX_SAFE_INTEGER;
497
+ return count.toString();
498
+ }
499
+ var toastTimeouts = /* @__PURE__ */ new Map();
500
+ var addToRemoveQueue = (toastId) => {
501
+ if (toastTimeouts.has(toastId)) {
502
+ return;
503
+ }
504
+ const timeout = setTimeout(() => {
505
+ toastTimeouts.delete(toastId);
506
+ dispatch({
507
+ type: "REMOVE_TOAST",
508
+ toastId
509
+ });
510
+ }, TOAST_REMOVE_DELAY);
511
+ toastTimeouts.set(toastId, timeout);
512
+ };
513
+ var reducer = (state, action) => {
514
+ switch (action.type) {
515
+ case "ADD_TOAST":
516
+ return {
517
+ ...state,
518
+ toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT)
519
+ };
520
+ case "UPDATE_TOAST":
521
+ return {
522
+ ...state,
523
+ toasts: state.toasts.map(
524
+ (t) => t.id === action.toast.id ? { ...t, ...action.toast } : t
525
+ )
526
+ };
527
+ case "DISMISS_TOAST": {
528
+ const { toastId } = action;
529
+ if (toastId) {
530
+ addToRemoveQueue(toastId);
531
+ } else {
532
+ state.toasts.forEach((toast4) => {
533
+ addToRemoveQueue(toast4.id);
534
+ });
535
+ }
536
+ return {
537
+ ...state,
538
+ toasts: state.toasts.map(
539
+ (t) => t.id === toastId || toastId === void 0 ? {
540
+ ...t,
541
+ open: false
542
+ } : t
543
+ )
544
+ };
545
+ }
546
+ case "REMOVE_TOAST":
547
+ if (action.toastId === void 0) {
548
+ return {
549
+ ...state,
550
+ toasts: []
551
+ };
552
+ }
553
+ return {
554
+ ...state,
555
+ toasts: state.toasts.filter((t) => t.id !== action.toastId)
556
+ };
557
+ }
558
+ };
559
+ var listeners = [];
560
+ var memoryState = { toasts: [] };
561
+ function dispatch(action) {
562
+ memoryState = reducer(memoryState, action);
563
+ listeners.forEach((listener) => {
564
+ listener(memoryState);
565
+ });
566
+ }
567
+ function toast({ ...props }) {
568
+ const id = genId();
569
+ const update = (props2) => dispatch({
570
+ type: "UPDATE_TOAST",
571
+ toast: { ...props2, id }
572
+ });
573
+ const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
574
+ dispatch({
575
+ type: "ADD_TOAST",
576
+ toast: {
577
+ ...props,
578
+ id,
579
+ open: true,
580
+ onOpenChange: (open) => {
581
+ if (!open) dismiss();
582
+ }
435
583
  }
584
+ });
585
+ return {
586
+ id,
587
+ dismiss,
588
+ update
589
+ };
590
+ }
591
+ function useToast() {
592
+ const [state, setState] = React13__namespace.useState(memoryState);
593
+ React13__namespace.useEffect(() => {
594
+ listeners.push(setState);
595
+ return () => {
596
+ const index = listeners.indexOf(setState);
597
+ if (index > -1) {
598
+ listeners.splice(index, 1);
599
+ }
600
+ };
601
+ }, [state]);
602
+ return {
603
+ ...state,
604
+ toast,
605
+ dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId })
606
+ };
607
+ }
608
+ var NOTE_TYPE_OPTIONS = [
609
+ { value: "RFI Note", label: "RFI Note" },
610
+ { value: "Internal Note", label: "Internal Note" }
611
+ ];
612
+ var AlertNotes = ({ alertId, notes }) => {
613
+ const [showNoteDialog, setShowNoteDialog] = React13.useState(false);
614
+ const [newNote, setNewNote] = React13.useState("");
615
+ const [noteType, setNoteType] = React13.useState("RFI Note");
616
+ const [isSubmitting, setIsSubmitting] = React13.useState(false);
617
+ const resetForm = () => {
618
+ setNewNote("");
619
+ setNoteType("RFI Note");
620
+ };
621
+ const handleCancelNote = () => {
622
+ setShowNoteDialog(false);
623
+ resetForm();
624
+ };
625
+ const handleAddNote = async () => {
626
+ if (!newNote.trim()) {
627
+ toast({
628
+ title: "Error",
629
+ description: "Please enter a note before submitting",
630
+ variant: "destructive"
631
+ });
632
+ return;
633
+ }
634
+ setIsSubmitting(true);
635
+ setTimeout(() => {
636
+ toast({
637
+ title: "Note Added",
638
+ description: "Your note has been added successfully"
639
+ });
640
+ setShowNoteDialog(false);
641
+ resetForm();
642
+ setIsSubmitting(false);
643
+ }, 500);
644
+ };
645
+ const handleDeleteNote = (noteId, noteContent) => {
646
+ toast({
647
+ title: "Note Deleted",
648
+ description: `Note deleted successfully`
649
+ });
650
+ console.log("Deleting note:", noteId);
436
651
  };
437
- const documentTypeOptions = [
438
- { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
439
- { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
440
- { value: "PASSPORT", label: "Passport" },
441
- { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
442
- { value: "BANK_STATEMENT", label: "Bank Statement" },
443
- { value: "BUSINESS_LICENSE", label: "Business License" },
444
- { value: "TAX_DOCUMENT", label: "Tax Document" },
445
- { value: "OTHER", label: "Other" }
446
- ];
447
652
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
448
- showUploadDialog && reactDom.createPortal(
653
+ showNoteDialog && reactDom.createPortal(
449
654
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
450
655
  /* @__PURE__ */ jsxRuntime.jsx(
451
656
  "div",
452
657
  {
453
658
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
454
- onClick: handleCancelUpload
659
+ onClick: handleCancelNote
455
660
  }
456
661
  ),
457
662
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
458
663
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
459
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
664
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
460
665
  /* @__PURE__ */ jsxRuntime.jsx(
461
666
  Button,
462
667
  {
463
668
  variant: "ghost",
464
669
  size: "sm",
465
670
  className: "h-8 w-8 p-0",
466
- onClick: handleCancelUpload,
671
+ onClick: handleCancelNote,
467
672
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
468
673
  }
469
674
  )
470
675
  ] }),
471
676
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
472
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
473
- /* @__PURE__ */ jsxRuntime.jsx(
474
- "input",
475
- {
476
- type: "file",
477
- id: "file-upload-dialog",
478
- className: "hidden",
479
- onChange: handleFileSelect,
480
- disabled: isUploading
481
- }
482
- ),
483
- /* @__PURE__ */ jsxRuntime.jsxs(
484
- "label",
485
- {
486
- htmlFor: "file-upload-dialog",
487
- className: cn(
488
- "cursor-pointer flex flex-col items-center gap-2",
489
- isUploading && "opacity-50 cursor-not-allowed"
490
- ),
491
- children: [
492
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
493
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
494
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
495
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
496
- ] })
497
- ]
498
- }
499
- )
500
- ] }),
501
- selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
502
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
503
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
504
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
505
- (selectedFile.size / 1024 / 1024).toFixed(2),
506
- " MB"
507
- ] })
508
- ] }),
509
677
  /* @__PURE__ */ jsxRuntime.jsx(
510
- EnhancedInput,
678
+ EnhancedSelect,
511
679
  {
512
- label: "Document name",
513
- value: documentName,
514
- onChange: (e) => setDocumentName(e.target.value),
515
- placeholder: "Enter document name"
680
+ label: "Note Type",
681
+ value: noteType,
682
+ onValueChange: (value) => setNoteType(value),
683
+ options: NOTE_TYPE_OPTIONS
516
684
  }
517
685
  ),
518
686
  /* @__PURE__ */ jsxRuntime.jsx(
519
687
  EnhancedTextarea,
520
688
  {
521
- label: "Description",
522
- value: description,
523
- onChange: (e) => setDescription(e.target.value),
524
- placeholder: "Enter document description (optional)",
525
- rows: 3
526
- }
527
- ),
528
- /* @__PURE__ */ jsxRuntime.jsx(
529
- EnhancedSelect,
530
- {
531
- label: "Document type",
532
- value: documentType,
533
- onValueChange: setDocumentType,
534
- placeholder: "Select document type",
535
- options: documentTypeOptions
689
+ label: "Note",
690
+ placeholder: "Enter your note here...",
691
+ value: newNote,
692
+ onChange: (e) => setNewNote(e.target.value),
693
+ rows: 6
536
694
  }
537
695
  )
538
696
  ] }),
@@ -541,8 +699,8 @@ var AlertDocuments = ({ alertId, documents }) => {
541
699
  Button,
542
700
  {
543
701
  variant: "outline",
544
- onClick: handleCancelUpload,
545
- disabled: isUploading,
702
+ onClick: handleCancelNote,
703
+ disabled: isSubmitting,
546
704
  className: "flex-1",
547
705
  children: "Cancel"
548
706
  }
@@ -550,10 +708,10 @@ var AlertDocuments = ({ alertId, documents }) => {
550
708
  /* @__PURE__ */ jsxRuntime.jsx(
551
709
  Button,
552
710
  {
553
- onClick: handleUploadSubmit,
554
- disabled: isUploading,
711
+ onClick: handleAddNote,
712
+ disabled: isSubmitting || !newNote.trim(),
555
713
  className: "flex-1",
556
- children: isUploading ? "Uploading..." : "Upload"
714
+ children: isSubmitting ? "Adding..." : "Add Note"
557
715
  }
558
716
  )
559
717
  ] })
@@ -561,224 +719,280 @@ var AlertDocuments = ({ alertId, documents }) => {
561
719
  ] }),
562
720
  document.body
563
721
  ),
564
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
722
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
565
723
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
566
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
724
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
567
725
  /* @__PURE__ */ jsxRuntime.jsxs(
568
726
  Button,
569
727
  {
570
- onClick: () => setShowUploadDialog(true),
728
+ onClick: () => setShowNoteDialog(true),
571
729
  variant: "ghost",
572
730
  size: "sm",
573
731
  className: "gap-2 text-primary hover:text-primary",
574
732
  children: [
575
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
576
- "Upload"
733
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
734
+ "Add Note"
577
735
  ]
578
736
  }
579
737
  )
580
738
  ] }),
581
- documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
582
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
583
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
584
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
739
+ notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
740
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
741
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No notes yet" })
742
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxRuntime.jsxs(
585
743
  "div",
586
744
  {
587
- className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
745
+ className: "border rounded-lg p-4 bg-muted/30",
588
746
  children: [
589
- isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
590
- "img",
591
- {
592
- src: doc.url,
593
- alt: doc.name,
594
- className: "w-full h-48 object-cover"
595
- }
596
- ) }),
597
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
598
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
599
- !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
600
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
601
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
602
- /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
603
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
604
- ] }),
605
- doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
606
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
607
- doc.size,
608
- " \u2022 Uploaded by ",
609
- doc.uploadedBy,
610
- " \u2022 ",
611
- new Date(doc.uploadedAt).toLocaleDateString()
612
- ] })
613
- ] })
747
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
748
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
749
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
750
+ /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
614
751
  ] }),
615
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
616
- /* @__PURE__ */ jsxRuntime.jsx(
617
- Button,
618
- {
619
- variant: "ghost",
620
- size: "sm",
621
- className: "h-8 w-8 p-0",
622
- onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
623
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
624
- }
625
- ),
626
- /* @__PURE__ */ jsxRuntime.jsx(
627
- Button,
628
- {
629
- variant: "ghost",
630
- size: "sm",
631
- className: "h-8 w-8 p-0",
632
- onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
633
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
634
- }
635
- ),
752
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
753
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
636
754
  /* @__PURE__ */ jsxRuntime.jsx(
637
755
  Button,
638
756
  {
639
757
  variant: "ghost",
640
758
  size: "sm",
641
759
  className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
642
- onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
760
+ onClick: () => handleDeleteNote(note.id, note.content),
643
761
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
644
762
  }
645
763
  )
646
764
  ] })
647
- ] })
765
+ ] }),
766
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: note.content })
648
767
  ]
649
768
  },
650
- doc.id
769
+ note.id
651
770
  )) })
652
771
  ] })
653
772
  ] });
654
773
  };
655
- var badgeVariants = classVarianceAuthority.cva(
656
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
774
+ var inputVariants = classVarianceAuthority.cva(
775
+ "flex w-full rounded-md bg-form-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground transition-form",
657
776
  {
658
777
  variants: {
659
778
  variant: {
660
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
661
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
662
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
663
- outline: "text-foreground",
664
- success: "border-transparent bg-success text-success-foreground hover:bg-success/80",
665
- warning: "border-transparent bg-warning text-warning-foreground hover:bg-warning/80",
666
- // Business type specific variants
667
- business: "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-300",
668
- individual: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
669
- government: "border-purple-200 bg-purple-50 text-purple-700 hover:bg-purple-100 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-300",
670
- nonprofit: "border-orange-200 bg-orange-50 text-orange-700 hover:bg-orange-100 dark:border-orange-800 dark:bg-orange-950 dark:text-orange-300",
671
- // Business entity type variants
672
- corporation: "border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-300",
673
- llc: "border-teal-200 bg-teal-50 text-teal-700 hover:bg-teal-100 dark:border-teal-800 dark:bg-teal-950 dark:text-teal-300",
674
- partnership: "border-indigo-200 bg-indigo-50 text-indigo-700 hover:bg-indigo-100 dark:border-indigo-800 dark:bg-indigo-950 dark:text-indigo-300",
675
- sole_proprietorship: "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300",
676
- // Status variants
677
- active: "border-green-200 bg-green-50 text-green-700 hover:bg-green-100 dark:border-green-800 dark:bg-green-950 dark:text-green-300",
678
- inactive: "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300",
679
- pending: "border-yellow-200 bg-yellow-50 text-yellow-700 hover:bg-yellow-100 dark:border-yellow-800 dark:bg-yellow-950 dark:text-yellow-300",
680
- suspended: "border-gray-200 bg-gray-50 text-gray-700 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300",
681
- // Alert type subtle variants
682
- "alert-ofac": "border-red-200 bg-red-50 text-red-700 hover:bg-red-100 dark:border-red-800 dark:bg-red-950 dark:text-red-300 font-medium",
683
- "alert-dual": "border-emerald-200 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-300 font-medium",
684
- "alert-monitoring": "border-amber-200 bg-amber-50 text-amber-700 hover:bg-amber-100 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-300 font-medium",
685
- "alert-error": "border-rose-200 bg-rose-50 text-rose-700 hover:bg-rose-100 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-300 font-medium"
779
+ default: "border border-form-border focus-visible:border-form-border-focus focus-visible:outline-none focus-visible:shadow-form-focus",
780
+ error: "border border-form-border-error focus-visible:border-form-border-error focus-visible:outline-none focus-visible:shadow-form-error",
781
+ success: "border border-form-border-success focus-visible:border-form-border-success focus-visible:outline-none",
782
+ disabled: "border border-form-border bg-muted cursor-not-allowed opacity-50",
783
+ readonly: "border border-form-border bg-muted/50 cursor-default"
784
+ },
785
+ size: {
786
+ default: "h-10",
787
+ sm: "h-9",
788
+ lg: "h-11"
686
789
  }
687
790
  },
688
791
  defaultVariants: {
689
- variant: "default"
792
+ variant: "default",
793
+ size: "default"
690
794
  }
691
795
  }
692
796
  );
693
- function Badge({ className, variant, ...props }) {
694
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
695
- }
696
- var NOTE_TYPE_OPTIONS = [
697
- { value: "RFI Note", label: "RFI Note" },
698
- { value: "Internal Note", label: "Internal Note" }
699
- ];
700
- var AlertNotes = ({ alertId, notes }) => {
701
- const [showNoteDialog, setShowNoteDialog] = React13.useState(false);
702
- const [newNote, setNewNote] = React13.useState("");
703
- const [noteType, setNoteType] = React13.useState("RFI Note");
704
- const [isSubmitting, setIsSubmitting] = React13.useState(false);
705
- const resetForm = () => {
706
- setNewNote("");
707
- setNoteType("RFI Note");
708
- };
709
- const handleCancelNote = () => {
710
- setShowNoteDialog(false);
711
- resetForm();
797
+ var EnhancedInput = React13__namespace.forwardRef(
798
+ ({ className, variant, size, label, hint, error, success, isLoading, ...props }, ref) => {
799
+ const inputVariant = error ? "error" : success ? "success" : props.disabled ? "disabled" : props.readOnly ? "readonly" : variant;
800
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
801
+ label && /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: [
802
+ label,
803
+ props.required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive ml-1", children: "*" })
804
+ ] }),
805
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
806
+ /* @__PURE__ */ jsxRuntime.jsx(
807
+ "input",
808
+ {
809
+ className: cn(inputVariants({ variant: inputVariant, size, className })),
810
+ ref,
811
+ ...props
812
+ }
813
+ ),
814
+ isLoading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-3 top-1/2 transform -translate-y-1/2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-primary border-t-transparent" }) })
815
+ ] }),
816
+ hint && !error && !success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: hint }),
817
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-destructive", children: error }),
818
+ success && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-success", children: success })
819
+ ] });
820
+ }
821
+ );
822
+ EnhancedInput.displayName = "EnhancedInput";
823
+ var AlertDocuments = ({ alertId, documents }) => {
824
+ const [isUploading, setIsUploading] = React13.useState(false);
825
+ const [showUploadDialog, setShowUploadDialog] = React13.useState(false);
826
+ const [selectedFile, setSelectedFile] = React13.useState(null);
827
+ const [documentName, setDocumentName] = React13.useState("");
828
+ const [description, setDescription] = React13.useState("");
829
+ const [documentType, setDocumentType] = React13.useState("");
830
+ const handleFileSelect = (e) => {
831
+ const file = e.target.files?.[0];
832
+ if (!file) return;
833
+ setSelectedFile(file);
834
+ setDocumentName(file.name);
712
835
  };
713
- const handleAddNote = async () => {
714
- if (!newNote.trim()) {
836
+ const handleUploadSubmit = () => {
837
+ if (!selectedFile || !documentName || !documentType) {
715
838
  toast({
716
- title: "Error",
717
- description: "Please enter a note before submitting",
839
+ title: "Missing Information",
840
+ description: "Please fill in all required fields",
718
841
  variant: "destructive"
719
842
  });
720
843
  return;
721
844
  }
722
- setIsSubmitting(true);
845
+ setIsUploading(true);
723
846
  setTimeout(() => {
847
+ ({
848
+ size: `${(selectedFile.size / 1024 / 1024).toFixed(1)} MB`,
849
+ uploadedAt: (/* @__PURE__ */ new Date()).toISOString()
850
+ });
724
851
  toast({
725
- title: "Note Added",
726
- description: "Your note has been added successfully"
852
+ title: "Upload Successful",
853
+ description: `${documentName} uploaded successfully`
727
854
  });
728
- setShowNoteDialog(false);
855
+ setIsUploading(false);
856
+ setShowUploadDialog(false);
729
857
  resetForm();
730
- setIsSubmitting(false);
731
- }, 500);
858
+ }, 1e3);
732
859
  };
733
- const handleDeleteNote = (noteId, noteContent) => {
734
- toast({
735
- title: "Note Deleted",
736
- description: `Note deleted successfully`
737
- });
738
- console.log("Deleting note:", noteId);
860
+ const resetForm = () => {
861
+ setSelectedFile(null);
862
+ setDocumentName("");
863
+ setDescription("");
864
+ setDocumentType("");
865
+ const fileInput = document.getElementById("file-upload");
866
+ if (fileInput) fileInput.value = "";
867
+ };
868
+ const handleCancelUpload = () => {
869
+ setShowUploadDialog(false);
870
+ resetForm();
871
+ };
872
+ const isImageType = (name) => {
873
+ const imageExtensions = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp"];
874
+ return imageExtensions.some((ext) => name.toLowerCase().endsWith(ext));
875
+ };
876
+ const getFileIcon = (type) => {
877
+ return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-5 w-5" });
878
+ };
879
+ const getFileTypeColor = (type) => {
880
+ switch (type.toUpperCase()) {
881
+ case "PDF":
882
+ return "text-red-500";
883
+ case "DOCX":
884
+ case "DOC":
885
+ return "text-blue-500";
886
+ case "XLSX":
887
+ case "XLS":
888
+ return "text-green-500";
889
+ case "JPG":
890
+ case "JPEG":
891
+ case "PNG":
892
+ return "text-purple-500";
893
+ default:
894
+ return "text-muted-foreground";
895
+ }
739
896
  };
897
+ const documentTypeOptions = [
898
+ { value: "ID_DOCUMENT_FRONT", label: "ID Document (Front)" },
899
+ { value: "ID_DOCUMENT_BACK", label: "ID Document (Back)" },
900
+ { value: "PASSPORT", label: "Passport" },
901
+ { value: "PROOF_OF_ADDRESS", label: "Proof of Address" },
902
+ { value: "BANK_STATEMENT", label: "Bank Statement" },
903
+ { value: "BUSINESS_LICENSE", label: "Business License" },
904
+ { value: "TAX_DOCUMENT", label: "Tax Document" },
905
+ { value: "OTHER", label: "Other" }
906
+ ];
740
907
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
741
- showNoteDialog && reactDom.createPortal(
908
+ showUploadDialog && reactDom.createPortal(
742
909
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4", children: [
743
910
  /* @__PURE__ */ jsxRuntime.jsx(
744
911
  "div",
745
912
  {
746
913
  className: "fixed inset-0 bg-background/80 backdrop-blur-sm",
747
- onClick: handleCancelNote
914
+ onClick: handleCancelUpload
748
915
  }
749
916
  ),
750
917
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative bg-card border rounded-lg shadow-lg max-w-lg w-full p-6 z-[101]", children: [
751
918
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-6", children: [
752
- /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Add Note" }),
919
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-2xl font-bold", children: "Upload Document" }),
753
920
  /* @__PURE__ */ jsxRuntime.jsx(
754
921
  Button,
755
922
  {
756
923
  variant: "ghost",
757
924
  size: "sm",
758
925
  className: "h-8 w-8 p-0",
759
- onClick: handleCancelNote,
926
+ onClick: handleCancelUpload,
760
927
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
761
928
  }
762
929
  )
763
930
  ] }),
764
931
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
932
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-2 border-dashed rounded-lg p-6 text-center hover:border-primary/50 transition-colors", children: [
933
+ /* @__PURE__ */ jsxRuntime.jsx(
934
+ "input",
935
+ {
936
+ type: "file",
937
+ id: "file-upload-dialog",
938
+ className: "hidden",
939
+ onChange: handleFileSelect,
940
+ disabled: isUploading
941
+ }
942
+ ),
943
+ /* @__PURE__ */ jsxRuntime.jsxs(
944
+ "label",
945
+ {
946
+ htmlFor: "file-upload-dialog",
947
+ className: cn(
948
+ "cursor-pointer flex flex-col items-center gap-2",
949
+ isUploading && "opacity-50 cursor-not-allowed"
950
+ ),
951
+ children: [
952
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-8 w-8 text-muted-foreground" }),
953
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
954
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-foreground", children: selectedFile ? "Change file" : "Click to upload or drag and drop" }),
955
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: "PDF, DOC, DOCX, JPG, PNG up to 10MB" })
956
+ ] })
957
+ ]
958
+ }
959
+ )
960
+ ] }),
961
+ selectedFile && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3 bg-muted/50 rounded-lg", children: [
962
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: "Selected file:" }),
963
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: selectedFile.name }),
964
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
965
+ (selectedFile.size / 1024 / 1024).toFixed(2),
966
+ " MB"
967
+ ] })
968
+ ] }),
765
969
  /* @__PURE__ */ jsxRuntime.jsx(
766
- EnhancedSelect,
970
+ EnhancedInput,
767
971
  {
768
- label: "Note Type",
769
- value: noteType,
770
- onValueChange: (value) => setNoteType(value),
771
- options: NOTE_TYPE_OPTIONS
972
+ label: "Document name",
973
+ value: documentName,
974
+ onChange: (e) => setDocumentName(e.target.value),
975
+ placeholder: "Enter document name"
772
976
  }
773
977
  ),
774
978
  /* @__PURE__ */ jsxRuntime.jsx(
775
979
  EnhancedTextarea,
776
980
  {
777
- label: "Note",
778
- placeholder: "Enter your note here...",
779
- value: newNote,
780
- onChange: (e) => setNewNote(e.target.value),
781
- rows: 6
981
+ label: "Description",
982
+ value: description,
983
+ onChange: (e) => setDescription(e.target.value),
984
+ placeholder: "Enter document description (optional)",
985
+ rows: 3
986
+ }
987
+ ),
988
+ /* @__PURE__ */ jsxRuntime.jsx(
989
+ EnhancedSelect,
990
+ {
991
+ label: "Document type",
992
+ value: documentType,
993
+ onValueChange: setDocumentType,
994
+ placeholder: "Select document type",
995
+ options: documentTypeOptions
782
996
  }
783
997
  )
784
998
  ] }),
@@ -787,8 +1001,8 @@ var AlertNotes = ({ alertId, notes }) => {
787
1001
  Button,
788
1002
  {
789
1003
  variant: "outline",
790
- onClick: handleCancelNote,
791
- disabled: isSubmitting,
1004
+ onClick: handleCancelUpload,
1005
+ disabled: isUploading,
792
1006
  className: "flex-1",
793
1007
  children: "Cancel"
794
1008
  }
@@ -796,10 +1010,10 @@ var AlertNotes = ({ alertId, notes }) => {
796
1010
  /* @__PURE__ */ jsxRuntime.jsx(
797
1011
  Button,
798
1012
  {
799
- onClick: handleAddNote,
800
- disabled: isSubmitting || !newNote.trim(),
1013
+ onClick: handleUploadSubmit,
1014
+ disabled: isUploading,
801
1015
  className: "flex-1",
802
- children: isSubmitting ? "Adding..." : "Add Note"
1016
+ children: isUploading ? "Uploading..." : "Upload"
803
1017
  }
804
1018
  )
805
1019
  ] })
@@ -807,311 +1021,97 @@ var AlertNotes = ({ alertId, notes }) => {
807
1021
  ] }),
808
1022
  document.body
809
1023
  ),
810
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1024
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-3", children: [
811
1025
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
812
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Note History" }),
1026
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-sm font-medium text-foreground", children: "Uploaded Documents" }),
813
1027
  /* @__PURE__ */ jsxRuntime.jsxs(
814
1028
  Button,
815
1029
  {
816
- onClick: () => setShowNoteDialog(true),
1030
+ onClick: () => setShowUploadDialog(true),
817
1031
  variant: "ghost",
818
1032
  size: "sm",
819
1033
  className: "gap-2 text-primary hover:text-primary",
820
1034
  children: [
821
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "h-4 w-4" }),
822
- "Add Note"
1035
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Upload, { className: "h-4 w-4" }),
1036
+ "Upload"
823
1037
  ]
824
1038
  }
825
1039
  )
826
1040
  ] }),
827
- notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
828
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
829
- /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No notes yet" })
830
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: notes.map((note) => /* @__PURE__ */ jsxRuntime.jsxs(
1041
+ documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-8 text-muted-foreground", children: [
1042
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
1043
+ /* @__PURE__ */ jsxRuntime.jsx("p", { children: "No documents uploaded yet" })
1044
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-2", children: documents.map((doc) => /* @__PURE__ */ jsxRuntime.jsxs(
831
1045
  "div",
832
1046
  {
833
- className: "border rounded-lg p-4 bg-muted/30",
1047
+ className: "border rounded-lg hover:bg-muted/30 transition-colors overflow-hidden",
834
1048
  children: [
835
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-4 mb-2", children: [
836
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
837
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-medium text-sm text-foreground", children: note.user }),
838
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: note.type === "RFI Note" ? "default" : "outline", children: note.type })
1049
+ isImageType(doc.name) && doc.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full bg-muted/50", children: /* @__PURE__ */ jsxRuntime.jsx(
1050
+ "img",
1051
+ {
1052
+ src: doc.url,
1053
+ alt: doc.name,
1054
+ className: "w-full h-48 object-cover"
1055
+ }
1056
+ ) }),
1057
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between p-3", children: [
1058
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
1059
+ !isImageType(doc.name) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(getFileTypeColor(doc.type)), children: getFileIcon(doc.type) }),
1060
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
1061
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
1062
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-medium text-sm truncate", children: doc.name }),
1063
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("text-xs px-2 py-0.5 rounded-full bg-muted", getFileTypeColor(doc.type)), children: doc.type })
1064
+ ] }),
1065
+ doc.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground mt-1", children: doc.description }),
1066
+ /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground mt-1", children: [
1067
+ doc.size,
1068
+ " \u2022 Uploaded by ",
1069
+ doc.uploadedBy,
1070
+ " \u2022 ",
1071
+ new Date(doc.uploadedAt).toLocaleDateString()
1072
+ ] })
1073
+ ] })
839
1074
  ] }),
840
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
841
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground whitespace-nowrap", children: note.timestamp }),
1075
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
842
1076
  /* @__PURE__ */ jsxRuntime.jsx(
843
1077
  Button,
844
1078
  {
845
1079
  variant: "ghost",
846
1080
  size: "sm",
847
- className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
848
- onClick: () => handleDeleteNote(note.id, note.content),
849
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
1081
+ className: "h-8 w-8 p-0",
1082
+ onClick: () => toast({ title: "Preview", description: `Viewing ${doc.name}` }),
1083
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "h-4 w-4" })
850
1084
  }
851
- )
852
- ] })
853
- ] }),
854
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-foreground", children: note.content })
855
- ]
856
- },
857
- note.id
858
- )) })
859
- ] })
860
- ] });
861
- };
862
- var AlertTimeline = ({ events }) => {
863
- const getIcon = (action) => {
864
- if (action.includes("Created")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
865
- if (action.includes("Assigned")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserPlus, { className: "h-4 w-4" });
866
- if (action.includes("Updated") || action.includes("Modified")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" });
867
- if (action.includes("Closed") || action.includes("Resolved")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCircle, { className: "h-4 w-4" });
868
- if (action.includes("Rejected")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XCircle, { className: "h-4 w-4" });
869
- return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Circle, { className: "h-4 w-4" });
870
- };
871
- const getStatusColor2 = (status) => {
872
- switch (status) {
873
- case "Unassigned":
874
- return "text-destructive";
875
- case "Closed":
876
- return "text-success";
877
- case "In Progress":
878
- return "text-warning";
879
- default:
880
- return "text-muted-foreground";
881
- }
882
- };
883
- if (events.length === 0) {
884
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-8 text-muted-foreground", children: "No timeline events yet" });
885
- }
886
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: events.map((event, index) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative pl-6 pb-3", children: [
887
- index !== events.length - 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-[7px] top-5 bottom-0 w-[2px] bg-border" }),
888
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
889
- "absolute left-0 top-0 flex-none",
890
- getStatusColor2(event.status)
891
- ), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-4", children: getIcon(event.action) }) }),
892
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-0.5", children: [
893
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium text-foreground", children: event.action }),
894
- /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground", children: [
895
- "by ",
896
- event.user
897
- ] }),
898
- event.details && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: event.details }),
899
- event.status && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: cn("text-xs font-medium", getStatusColor2(event.status)), children: [
900
- "Status: ",
901
- event.status
902
- ] }),
903
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground/70 pt-0.5", children: event.timestamp })
904
- ] })
905
- ] }, event.id)) });
906
- };
907
- var cardVariants = classVarianceAuthority.cva(
908
- "rounded-lg border bg-card text-card-foreground transition-all duration-200",
909
- {
910
- variants: {
911
- variant: {
912
- default: "shadow-sm",
913
- elevated: "shadow-md hover:shadow-lg",
914
- outlined: "border-2 shadow-none",
915
- ghost: "border-transparent shadow-none bg-transparent",
916
- subtle: "border-border/75 shadow-none"
917
- },
918
- size: {
919
- sm: "p-3",
920
- md: "p-4",
921
- lg: "p-6",
922
- none: "p-0"
923
- },
924
- fullHeight: {
925
- true: "h-full flex flex-col",
926
- false: ""
927
- },
928
- interactive: {
929
- true: "cursor-pointer hover:shadow-md hover:scale-[1.02]",
930
- false: ""
931
- }
932
- },
933
- defaultVariants: {
934
- variant: "default",
935
- size: "none",
936
- fullHeight: false,
937
- interactive: false
938
- }
939
- }
940
- );
941
- var Card = React13__namespace.forwardRef(
942
- ({ className, variant, size, fullHeight, interactive, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
943
- "div",
944
- {
945
- ref,
946
- className: cn(cardVariants({ variant, size, fullHeight, interactive }), className),
947
- ...props
948
- }
949
- )
950
- );
951
- Card.displayName = "Card";
952
- var cardHeaderVariants = classVarianceAuthority.cva(
953
- "flex flex-col space-y-1.5",
954
- {
955
- variants: {
956
- size: {
957
- sm: "px-3 pt-3 pb-2",
958
- md: "px-4 pt-4 pb-3",
959
- lg: "px-6 pt-6 pb-4"
960
- },
961
- align: {
962
- start: "items-start",
963
- center: "items-center",
964
- end: "items-end"
965
- },
966
- direction: {
967
- row: "flex-row justify-between items-center space-y-0 space-x-4",
968
- column: "flex-col space-y-1.5"
969
- }
970
- },
971
- defaultVariants: {
972
- size: "lg",
973
- align: "start",
974
- direction: "column"
975
- }
976
- }
977
- );
978
- var CardHeader = React13__namespace.forwardRef(
979
- ({ className, size, align, direction, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
980
- "div",
981
- {
982
- ref,
983
- className: cn(cardHeaderVariants({ size, align, direction }), className),
984
- ...props
985
- }
986
- )
987
- );
988
- CardHeader.displayName = "CardHeader";
989
- var cardTitleVariants = classVarianceAuthority.cva(
990
- "font-semibold leading-none tracking-tight",
991
- {
992
- variants: {
993
- size: {
994
- sm: "text-base",
995
- md: "text-lg",
996
- lg: "text-xl"
997
- }
998
- },
999
- defaultVariants: {
1000
- size: "md"
1001
- }
1002
- }
1003
- );
1004
- var CardTitle = React13__namespace.forwardRef(
1005
- ({ className, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1006
- "h3",
1007
- {
1008
- ref,
1009
- className: cn(cardTitleVariants({ size }), className),
1010
- ...props
1011
- }
1012
- )
1013
- );
1014
- CardTitle.displayName = "CardTitle";
1015
- var CardDescription = React13__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1016
- "p",
1017
- {
1018
- ref,
1019
- className: cn("text-sm text-muted-foreground", className),
1020
- ...props
1021
- }
1022
- ));
1023
- CardDescription.displayName = "CardDescription";
1024
- var cardContentVariants = classVarianceAuthority.cva(
1025
- "",
1026
- {
1027
- variants: {
1028
- size: {
1029
- sm: "px-3 pb-2",
1030
- md: "px-4 pb-3",
1031
- lg: "px-6 pb-4"
1032
- },
1033
- fullHeight: {
1034
- true: "flex-1",
1035
- false: ""
1036
- }
1037
- },
1038
- defaultVariants: {
1039
- size: "lg",
1040
- fullHeight: false
1041
- }
1042
- }
1043
- );
1044
- var CardContent = React13__namespace.forwardRef(
1045
- ({ className, size, fullHeight, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1046
- "div",
1047
- {
1048
- ref,
1049
- className: cn(cardContentVariants({ size, fullHeight }), className),
1050
- ...props
1051
- }
1052
- )
1053
- );
1054
- CardContent.displayName = "CardContent";
1055
- var cardFooterVariants = classVarianceAuthority.cva(
1056
- "flex items-center pt-0",
1057
- {
1058
- variants: {
1059
- size: {
1060
- sm: "p-3 pt-0",
1061
- md: "p-4 pt-0",
1062
- lg: "p-6 pt-0"
1063
- },
1064
- justify: {
1065
- start: "justify-start",
1066
- center: "justify-center",
1067
- end: "justify-end",
1068
- between: "justify-between"
1069
- }
1070
- },
1071
- defaultVariants: {
1072
- size: "lg",
1073
- justify: "start"
1074
- }
1075
- }
1076
- );
1077
- var CardFooter = React13__namespace.forwardRef(
1078
- ({ className, size, justify, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1079
- "div",
1080
- {
1081
- ref,
1082
- className: cn(cardFooterVariants({ size, justify }), className),
1083
- ...props
1084
- }
1085
- )
1086
- );
1087
- CardFooter.displayName = "CardFooter";
1088
- var FormCard = React13__namespace.forwardRef(
1089
- ({ title, description, children, headerActions, className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
1090
- Card,
1091
- {
1092
- ref,
1093
- variant,
1094
- fullHeight: true,
1095
- className: cn("", className),
1096
- ...props,
1097
- children: [
1098
- /* @__PURE__ */ jsxRuntime.jsxs(
1099
- CardHeader,
1100
- {
1101
- direction: headerActions ? "row" : "column",
1102
- size: "md",
1103
- children: [
1104
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-1", children: /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: title }) }),
1105
- headerActions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-2", children: headerActions })
1106
- ]
1107
- }
1108
- ),
1109
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { size: "md", fullHeight: true, children })
1110
- ]
1111
- }
1112
- )
1113
- );
1114
- FormCard.displayName = "FormCard";
1085
+ ),
1086
+ /* @__PURE__ */ jsxRuntime.jsx(
1087
+ Button,
1088
+ {
1089
+ variant: "ghost",
1090
+ size: "sm",
1091
+ className: "h-8 w-8 p-0",
1092
+ onClick: () => toast({ title: "Download", description: `Downloading ${doc.name}` }),
1093
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { className: "h-4 w-4" })
1094
+ }
1095
+ ),
1096
+ /* @__PURE__ */ jsxRuntime.jsx(
1097
+ Button,
1098
+ {
1099
+ variant: "ghost",
1100
+ size: "sm",
1101
+ className: "h-8 w-8 p-0 text-muted-foreground hover:text-foreground",
1102
+ onClick: () => toast({ title: "Delete", description: `Deleted ${doc.name}` }),
1103
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "h-4 w-4" })
1104
+ }
1105
+ )
1106
+ ] })
1107
+ ] })
1108
+ ]
1109
+ },
1110
+ doc.id
1111
+ )) })
1112
+ ] })
1113
+ ] });
1114
+ };
1115
1115
  var InfoField = ({ label, value, layout = "vertical", className }) => {
1116
1116
  if (layout === "horizontal") {
1117
1117
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex items-start gap-3 ${className || ""}`, children: [
@@ -1424,6 +1424,184 @@ var ContextSection = ({ alert }) => {
1424
1424
  ] }) })
1425
1425
  ] });
1426
1426
  };
1427
+ var EditableInfoField = ({
1428
+ label,
1429
+ value,
1430
+ options,
1431
+ onChange,
1432
+ placeholder = "Select...",
1433
+ renderValue,
1434
+ className
1435
+ }) => {
1436
+ const [isEditing, setIsEditing] = React13.useState(false);
1437
+ const handleChange = (newValue) => {
1438
+ onChange(newValue);
1439
+ setIsEditing(false);
1440
+ };
1441
+ if (isEditing) {
1442
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
1443
+ EnhancedSelect,
1444
+ {
1445
+ label,
1446
+ value: value || "",
1447
+ onValueChange: handleChange,
1448
+ options,
1449
+ placeholder
1450
+ }
1451
+ ) });
1452
+ }
1453
+ const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
1454
+ return /* @__PURE__ */ jsxRuntime.jsx(
1455
+ "div",
1456
+ {
1457
+ className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
1458
+ onClick: () => setIsEditing(true),
1459
+ role: "button",
1460
+ tabIndex: 0,
1461
+ onKeyDown: (e) => {
1462
+ if (e.key === "Enter" || e.key === " ") {
1463
+ e.preventDefault();
1464
+ setIsEditing(true);
1465
+ }
1466
+ },
1467
+ children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label, value: displayValue })
1468
+ }
1469
+ );
1470
+ };
1471
+
1472
+ // src/lib/utils/alert-utils.ts
1473
+ var getTypeBadgeVariant = (type) => {
1474
+ switch (type) {
1475
+ case "Ofac":
1476
+ return "alert-ofac";
1477
+ case "Dual Approval":
1478
+ return "alert-dual";
1479
+ case "Transaction Monitoring":
1480
+ return "alert-monitoring";
1481
+ case "Transaction Processing Error":
1482
+ return "alert-error";
1483
+ default:
1484
+ return "outline";
1485
+ }
1486
+ };
1487
+ var getStatusColor = (status) => {
1488
+ switch (status) {
1489
+ case "Unassigned":
1490
+ return "text-destructive";
1491
+ case "Closed":
1492
+ return "text-success";
1493
+ case "In Progress":
1494
+ return "text-warning";
1495
+ default:
1496
+ return "";
1497
+ }
1498
+ };
1499
+
1500
+ // src/lib/constants.ts
1501
+ var COUNTRY_OPTIONS = [
1502
+ { value: "US", label: "United States" },
1503
+ { value: "CA", label: "Canada" },
1504
+ { value: "GB", label: "United Kingdom" },
1505
+ { value: "DE", label: "Germany" },
1506
+ { value: "FR", label: "France" }
1507
+ ];
1508
+ var FI_ID_TYPE_OPTIONS = [
1509
+ { value: "bic", label: "BIC" },
1510
+ { value: "swift", label: "SWIFT" },
1511
+ { value: "aba", label: "ABA" },
1512
+ { value: "iban", label: "IBAN" },
1513
+ { value: "routing", label: "Routing Number" }
1514
+ ];
1515
+ var ADDRESS_TYPE_OPTIONS = {
1516
+ FI: [
1517
+ { value: "headquarters", label: "Headquarters" },
1518
+ { value: "branch", label: "Branch Office" },
1519
+ { value: "correspondent", label: "Correspondent Bank" }
1520
+ ]
1521
+ };
1522
+ var RFI_STATUS_OPTIONS = [
1523
+ { value: "Completed", label: "Completed" },
1524
+ { value: "Provided", label: "Provided" },
1525
+ { value: "Pending", label: "Pending" }
1526
+ ];
1527
+ var ASSIGNEE_OPTIONS = [
1528
+ { value: "John Smith", label: "John Smith" },
1529
+ { value: "Sarah Johnson", label: "Sarah Johnson" },
1530
+ { value: "Michael Chen", label: "Michael Chen" },
1531
+ { value: "approverdev", label: "approverdev" },
1532
+ { value: "Unassigned", label: "Unassigned" }
1533
+ ];
1534
+ var AlertDetailView = ({
1535
+ alert,
1536
+ rfiStatus,
1537
+ assignee,
1538
+ onRfiStatusChange,
1539
+ onAssigneeChange
1540
+ }) => {
1541
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
1542
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
1543
+ /* @__PURE__ */ jsxRuntime.jsx(
1544
+ FormCard,
1545
+ {
1546
+ title: "Alert Information",
1547
+ headerActions: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }),
1548
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
1549
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Alert ID", value: alert.id }),
1550
+ /* @__PURE__ */ jsxRuntime.jsx(
1551
+ InfoField,
1552
+ {
1553
+ label: "Type",
1554
+ value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
1555
+ }
1556
+ ),
1557
+ /* @__PURE__ */ jsxRuntime.jsx(
1558
+ InfoField,
1559
+ {
1560
+ label: "Status",
1561
+ value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
1562
+ }
1563
+ ),
1564
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: alert.createdAt }),
1565
+ /* @__PURE__ */ jsxRuntime.jsx(
1566
+ InfoField,
1567
+ {
1568
+ label: "Context Type",
1569
+ value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", children: alert.contextType })
1570
+ }
1571
+ ),
1572
+ /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
1573
+ /* @__PURE__ */ jsxRuntime.jsx(
1574
+ EditableInfoField,
1575
+ {
1576
+ label: "Assignee",
1577
+ value: assignee,
1578
+ options: ASSIGNEE_OPTIONS,
1579
+ onChange: onAssigneeChange,
1580
+ placeholder: "Unassigned"
1581
+ }
1582
+ ),
1583
+ /* @__PURE__ */ jsxRuntime.jsx(
1584
+ EditableInfoField,
1585
+ {
1586
+ label: "RFI Status",
1587
+ value: rfiStatus,
1588
+ options: RFI_STATUS_OPTIONS,
1589
+ onChange: onRfiStatusChange,
1590
+ placeholder: "Select status",
1591
+ renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", children: value })
1592
+ }
1593
+ ),
1594
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Description", value: alert.description }) })
1595
+ ] })
1596
+ }
1597
+ ),
1598
+ /* @__PURE__ */ jsxRuntime.jsx(ContextSection, { alert }),
1599
+ /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsxRuntime.jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
1600
+ /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
1601
+ ] }),
1602
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
1603
+ ] });
1604
+ };
1427
1605
 
1428
1606
  // src/assets/braid-logo.png
1429
1607
  var braid_logo_default = "./braid-logo-343BOQZ2.png";
@@ -3092,41 +3270,6 @@ var ACHTransferSection = ({ isEditing, onToggleEdit, className, hideActions }) =
3092
3270
  }
3093
3271
  );
3094
3272
  };
3095
-
3096
- // src/lib/constants.ts
3097
- var COUNTRY_OPTIONS = [
3098
- { value: "US", label: "United States" },
3099
- { value: "CA", label: "Canada" },
3100
- { value: "GB", label: "United Kingdom" },
3101
- { value: "DE", label: "Germany" },
3102
- { value: "FR", label: "France" }
3103
- ];
3104
- var FI_ID_TYPE_OPTIONS = [
3105
- { value: "bic", label: "BIC" },
3106
- { value: "swift", label: "SWIFT" },
3107
- { value: "aba", label: "ABA" },
3108
- { value: "iban", label: "IBAN" },
3109
- { value: "routing", label: "Routing Number" }
3110
- ];
3111
- var ADDRESS_TYPE_OPTIONS = {
3112
- FI: [
3113
- { value: "headquarters", label: "Headquarters" },
3114
- { value: "branch", label: "Branch Office" },
3115
- { value: "correspondent", label: "Correspondent Bank" }
3116
- ]
3117
- };
3118
- var RFI_STATUS_OPTIONS = [
3119
- { value: "Completed", label: "Completed" },
3120
- { value: "Provided", label: "Provided" },
3121
- { value: "Pending", label: "Pending" }
3122
- ];
3123
- var ASSIGNEE_OPTIONS = [
3124
- { value: "John Smith", label: "John Smith" },
3125
- { value: "Sarah Johnson", label: "Sarah Johnson" },
3126
- { value: "Michael Chen", label: "Michael Chen" },
3127
- { value: "approverdev", label: "approverdev" },
3128
- { value: "Unassigned", label: "Unassigned" }
3129
- ];
3130
3273
  var AddressForm = ({
3131
3274
  title,
3132
3275
  description,
@@ -4824,6 +4967,75 @@ var ListPage = React13__namespace.forwardRef(
4824
4967
  }
4825
4968
  );
4826
4969
  ListPage.displayName = "ListPage";
4970
+ var StatementHeader = ({ data, onEdit }) => {
4971
+ return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
4972
+ /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
4973
+ /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Summary" }),
4974
+ /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
4975
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-2" }),
4976
+ "Edit"
4977
+ ] })
4978
+ ] }),
4979
+ /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
4980
+ /* @__PURE__ */ jsxRuntime.jsx(
4981
+ InfoField,
4982
+ {
4983
+ label: "Account",
4984
+ value: data.account,
4985
+ layout: "horizontal"
4986
+ }
4987
+ ),
4988
+ /* @__PURE__ */ jsxRuntime.jsx(
4989
+ InfoField,
4990
+ {
4991
+ label: "Product ID",
4992
+ value: data.productId,
4993
+ layout: "horizontal"
4994
+ }
4995
+ ),
4996
+ /* @__PURE__ */ jsxRuntime.jsx(
4997
+ InfoField,
4998
+ {
4999
+ label: "Program ID",
5000
+ value: data.programId,
5001
+ layout: "horizontal"
5002
+ }
5003
+ ),
5004
+ /* @__PURE__ */ jsxRuntime.jsx(
5005
+ InfoField,
5006
+ {
5007
+ label: "Start Date",
5008
+ value: data.startDate,
5009
+ layout: "horizontal"
5010
+ }
5011
+ ),
5012
+ /* @__PURE__ */ jsxRuntime.jsx(
5013
+ InfoField,
5014
+ {
5015
+ label: "End Date",
5016
+ value: data.endDate,
5017
+ layout: "horizontal"
5018
+ }
5019
+ ),
5020
+ /* @__PURE__ */ jsxRuntime.jsx(
5021
+ InfoField,
5022
+ {
5023
+ label: "Starting Balance",
5024
+ value: data.startingBalance,
5025
+ layout: "horizontal"
5026
+ }
5027
+ ),
5028
+ /* @__PURE__ */ jsxRuntime.jsx(
5029
+ InfoField,
5030
+ {
5031
+ label: "Ending Balance",
5032
+ value: data.endingBalance,
5033
+ layout: "horizontal"
5034
+ }
5035
+ )
5036
+ ] }) })
5037
+ ] });
5038
+ };
4827
5039
  var ACHDetailsSection = ({ data }) => {
4828
5040
  const formatCurrency = (value) => {
4829
5041
  return new Intl.NumberFormat("en-US", {
@@ -5368,50 +5580,6 @@ var DropdownMenuSeparator = React13__namespace.forwardRef(({ className, ...props
5368
5580
  }
5369
5581
  ));
5370
5582
  DropdownMenuSeparator.displayName = DropdownMenuPrimitive__namespace.Separator.displayName;
5371
- var EditableInfoField = ({
5372
- label,
5373
- value,
5374
- options,
5375
- onChange,
5376
- placeholder = "Select...",
5377
- renderValue,
5378
- className
5379
- }) => {
5380
- const [isEditing, setIsEditing] = React13.useState(false);
5381
- const handleChange = (newValue) => {
5382
- onChange(newValue);
5383
- setIsEditing(false);
5384
- };
5385
- if (isEditing) {
5386
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
5387
- EnhancedSelect,
5388
- {
5389
- label,
5390
- value: value || "",
5391
- onValueChange: handleChange,
5392
- options,
5393
- placeholder
5394
- }
5395
- ) });
5396
- }
5397
- const displayValue = value ? renderValue ? renderValue(value) : value : placeholder;
5398
- return /* @__PURE__ */ jsxRuntime.jsx(
5399
- "div",
5400
- {
5401
- className: cn("cursor-pointer transition-colors hover:bg-muted/50 rounded-md -mx-2 px-2 -my-1 py-1", className),
5402
- onClick: () => setIsEditing(true),
5403
- role: "button",
5404
- tabIndex: 0,
5405
- onKeyDown: (e) => {
5406
- if (e.key === "Enter" || e.key === " ") {
5407
- e.preventDefault();
5408
- setIsEditing(true);
5409
- }
5410
- },
5411
- children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label, value: displayValue })
5412
- }
5413
- );
5414
- };
5415
5583
  var EntityCard = React13__namespace.forwardRef(
5416
5584
  ({
5417
5585
  entity,
@@ -6557,105 +6725,6 @@ var useAlertDetail = (id) => {
6557
6725
  handleAssigneeChange
6558
6726
  };
6559
6727
  };
6560
-
6561
- // src/lib/utils/alert-utils.ts
6562
- var getTypeBadgeVariant = (type) => {
6563
- switch (type) {
6564
- case "Ofac":
6565
- return "alert-ofac";
6566
- case "Dual Approval":
6567
- return "alert-dual";
6568
- case "Transaction Monitoring":
6569
- return "alert-monitoring";
6570
- case "Transaction Processing Error":
6571
- return "alert-error";
6572
- default:
6573
- return "outline";
6574
- }
6575
- };
6576
- var getStatusColor = (status) => {
6577
- switch (status) {
6578
- case "Unassigned":
6579
- return "text-destructive";
6580
- case "Closed":
6581
- return "text-success";
6582
- case "In Progress":
6583
- return "text-warning";
6584
- default:
6585
- return "";
6586
- }
6587
- };
6588
- var AlertDetailView = ({
6589
- alert,
6590
- rfiStatus,
6591
- assignee,
6592
- onRfiStatusChange,
6593
- onAssigneeChange
6594
- }) => {
6595
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col lg:flex-row gap-6", children: [
6596
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 grid grid-cols-1 lg:grid-cols-2 gap-6", children: [
6597
- /* @__PURE__ */ jsxRuntime.jsx(
6598
- FormCard,
6599
- {
6600
- title: "Alert Information",
6601
- headerActions: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4" }) }),
6602
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
6603
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Alert ID", value: alert.id }),
6604
- /* @__PURE__ */ jsxRuntime.jsx(
6605
- InfoField,
6606
- {
6607
- label: "Type",
6608
- value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: getTypeBadgeVariant(alert.type), children: alert.type })
6609
- }
6610
- ),
6611
- /* @__PURE__ */ jsxRuntime.jsx(
6612
- InfoField,
6613
- {
6614
- label: "Status",
6615
- value: /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("font-medium", getStatusColor(alert.status)), children: alert.status })
6616
- }
6617
- ),
6618
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Created At", value: alert.createdAt }),
6619
- /* @__PURE__ */ jsxRuntime.jsx(
6620
- InfoField,
6621
- {
6622
- label: "Context Type",
6623
- value: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "outline", children: alert.contextType })
6624
- }
6625
- ),
6626
- /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Context ID", value: alert.contextId || "N/A" }),
6627
- /* @__PURE__ */ jsxRuntime.jsx(
6628
- EditableInfoField,
6629
- {
6630
- label: "Assignee",
6631
- value: assignee,
6632
- options: ASSIGNEE_OPTIONS,
6633
- onChange: onAssigneeChange,
6634
- placeholder: "Unassigned"
6635
- }
6636
- ),
6637
- /* @__PURE__ */ jsxRuntime.jsx(
6638
- EditableInfoField,
6639
- {
6640
- label: "RFI Status",
6641
- value: rfiStatus,
6642
- options: RFI_STATUS_OPTIONS,
6643
- onChange: onRfiStatusChange,
6644
- placeholder: "Select status",
6645
- renderValue: (value) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", children: value })
6646
- }
6647
- ),
6648
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2", children: /* @__PURE__ */ jsxRuntime.jsx(InfoField, { label: "Description", value: alert.description }) })
6649
- ] })
6650
- }
6651
- ),
6652
- /* @__PURE__ */ jsxRuntime.jsx(ContextSection, { alert }),
6653
- /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Notes", children: /* @__PURE__ */ jsxRuntime.jsx(AlertNotes, { alertId: alert.id, notes: alert.notes || [] }) }),
6654
- /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Documents", children: /* @__PURE__ */ jsxRuntime.jsx(AlertDocuments, { alertId: alert.id, documents: alert.documents || [] }) })
6655
- ] }),
6656
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "lg:w-64", children: /* @__PURE__ */ jsxRuntime.jsx(FormCard, { title: "Status Timeline", className: "h-full", children: /* @__PURE__ */ jsxRuntime.jsx(AlertTimeline, { events: alert.timeline || [] }) }) })
6657
- ] });
6658
- };
6659
6728
  var AlertDetail = () => {
6660
6729
  const { id } = reactRouterDom.useParams();
6661
6730
  const navigate = reactRouterDom.useNavigate();
@@ -7860,75 +7929,6 @@ var NotFound = () => {
7860
7929
  ] }) });
7861
7930
  };
7862
7931
  var NotFound_default = NotFound;
7863
- var StatementHeader = ({ data, onEdit }) => {
7864
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { children: [
7865
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { direction: "row", children: [
7866
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { size: "md", children: "Statement Summary" }),
7867
- /* @__PURE__ */ jsxRuntime.jsxs(Button, { variant: "outline", size: "sm", onClick: onEdit, children: [
7868
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit, { className: "h-4 w-4 mr-2" }),
7869
- "Edit"
7870
- ] })
7871
- ] }),
7872
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6", children: [
7873
- /* @__PURE__ */ jsxRuntime.jsx(
7874
- InfoField,
7875
- {
7876
- label: "Account",
7877
- value: data.account,
7878
- layout: "horizontal"
7879
- }
7880
- ),
7881
- /* @__PURE__ */ jsxRuntime.jsx(
7882
- InfoField,
7883
- {
7884
- label: "Product ID",
7885
- value: data.productId,
7886
- layout: "horizontal"
7887
- }
7888
- ),
7889
- /* @__PURE__ */ jsxRuntime.jsx(
7890
- InfoField,
7891
- {
7892
- label: "Program ID",
7893
- value: data.programId,
7894
- layout: "horizontal"
7895
- }
7896
- ),
7897
- /* @__PURE__ */ jsxRuntime.jsx(
7898
- InfoField,
7899
- {
7900
- label: "Start Date",
7901
- value: data.startDate,
7902
- layout: "horizontal"
7903
- }
7904
- ),
7905
- /* @__PURE__ */ jsxRuntime.jsx(
7906
- InfoField,
7907
- {
7908
- label: "End Date",
7909
- value: data.endDate,
7910
- layout: "horizontal"
7911
- }
7912
- ),
7913
- /* @__PURE__ */ jsxRuntime.jsx(
7914
- InfoField,
7915
- {
7916
- label: "Starting Balance",
7917
- value: data.startingBalance,
7918
- layout: "horizontal"
7919
- }
7920
- ),
7921
- /* @__PURE__ */ jsxRuntime.jsx(
7922
- InfoField,
7923
- {
7924
- label: "Ending Balance",
7925
- value: data.endingBalance,
7926
- layout: "horizontal"
7927
- }
7928
- )
7929
- ] }) })
7930
- ] });
7931
- };
7932
7932
 
7933
7933
  // src/lib/mock-data/statement-data.ts
7934
7934
  var mockStatementHeader = {
@@ -9598,6 +9598,7 @@ exports.ACHTransferSection = ACHTransferSection;
9598
9598
  exports.AccountCard = AccountCard;
9599
9599
  exports.AddressForm = AddressForm;
9600
9600
  exports.AlertDetail = AlertDetail_default;
9601
+ exports.AlertDetailView = AlertDetailView;
9601
9602
  exports.AlertDocuments = AlertDocuments;
9602
9603
  exports.AlertNotes = AlertNotes;
9603
9604
  exports.AlertTimeline = AlertTimeline;
@@ -9728,6 +9729,7 @@ exports.SidebarSeparator = SidebarSeparator;
9728
9729
  exports.SidebarTrigger = SidebarTrigger;
9729
9730
  exports.Stack = Stack;
9730
9731
  exports.Statement = Statement;
9732
+ exports.StatementHeader = StatementHeader;
9731
9733
  exports.StatusBadge = StatusBadge;
9732
9734
  exports.Tabs = Tabs;
9733
9735
  exports.TabsContent = TabsContent;
@@ -9758,6 +9760,7 @@ exports.inputVariants = inputVariants;
9758
9760
  exports.reducer = reducer;
9759
9761
  exports.textareaVariants = textareaVariants;
9760
9762
  exports.toast = toast;
9763
+ exports.useAlertDetail = useAlertDetail;
9761
9764
  exports.useEditState = useEditState;
9762
9765
  exports.useFormWithEditState = useFormWithEditState;
9763
9766
  exports.useIsMobile = useIsMobile;