@krak-stack/registry 0.10.13 → 0.10.15

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/lib/docs.js CHANGED
@@ -457,6 +457,7 @@ import { SearchIcon } from "lucide-react";
457
457
 
458
458
  // ../../src/components/ui/dialog.tsx
459
459
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
460
+ import { cn as cn2 } from "cn";
460
461
  import { XIcon } from "lucide-react";
461
462
  import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
462
463
  function Dialog({ ...props }) {
@@ -477,13 +478,14 @@ function DialogOverlay({
477
478
  }) {
478
479
  return /* @__PURE__ */ jsx7(DialogPrimitive.Backdrop, {
479
480
  "data-slot": "dialog-overlay",
480
- className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
481
+ className: cn2("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs", className),
481
482
  ...props
482
483
  });
483
484
  }
484
485
  function DialogContent({
485
486
  className,
486
487
  children,
488
+ showCloseButton = true,
487
489
  ...props
488
490
  }) {
489
491
  return /* @__PURE__ */ jsxs4(DialogPortal, {
@@ -491,16 +493,19 @@ function DialogContent({
491
493
  /* @__PURE__ */ jsx7(DialogOverlay, {}),
492
494
  /* @__PURE__ */ jsxs4(DialogPrimitive.Popup, {
493
495
  "data-slot": "dialog-content",
494
- className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
496
+ className: cn2("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md", className),
495
497
  ...props,
496
498
  children: [
497
499
  children,
498
- /* @__PURE__ */ jsxs4(DialogPrimitive.Close, {
499
- className: "focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none",
500
+ showCloseButton && /* @__PURE__ */ jsxs4(DialogPrimitive.Close, {
501
+ "data-slot": "dialog-close",
502
+ render: /* @__PURE__ */ jsx7(Button, {
503
+ variant: "ghost",
504
+ className: "absolute top-4 right-4",
505
+ size: "icon-sm"
506
+ }),
500
507
  children: [
501
- /* @__PURE__ */ jsx7(XIcon, {
502
- className: "size-4"
503
- }),
508
+ /* @__PURE__ */ jsx7(XIcon, {}),
504
509
  /* @__PURE__ */ jsx7("span", {
505
510
  className: "sr-only",
506
511
  children: "Close"
@@ -515,17 +520,14 @@ function DialogContent({
515
520
  function DialogHeader({ className, ...props }) {
516
521
  return /* @__PURE__ */ jsx7("div", {
517
522
  "data-slot": "dialog-header",
518
- className: cn("grid gap-1.5", className),
523
+ className: cn2("flex flex-col gap-2", className),
519
524
  ...props
520
525
  });
521
526
  }
522
- function DialogTitle({
523
- className,
524
- ...props
525
- }) {
527
+ function DialogTitle({ className, ...props }) {
526
528
  return /* @__PURE__ */ jsx7(DialogPrimitive.Title, {
527
529
  "data-slot": "dialog-title",
528
- className: cn("text-lg font-medium", className),
530
+ className: cn2("leading-none font-medium", className),
529
531
  ...props
530
532
  });
531
533
  }
@@ -535,7 +537,7 @@ function DialogDescription({
535
537
  }) {
536
538
  return /* @__PURE__ */ jsx7(DialogPrimitive.Description, {
537
539
  "data-slot": "dialog-description",
538
- className: cn("text-sm text-muted-foreground", className),
540
+ className: cn2("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3", className),
539
541
  ...props
540
542
  });
541
543
  }
@@ -111,6 +111,7 @@ import { SearchIcon } from "lucide-react";
111
111
 
112
112
  // ../../src/components/ui/dialog.tsx
113
113
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
114
+ import { cn as cn2 } from "cn";
114
115
  import { XIcon } from "lucide-react";
115
116
 
116
117
  // ../../src/components/ui/search-menu.tsx
@@ -111,6 +111,7 @@ import { SearchIcon } from "lucide-react";
111
111
 
112
112
  // ../../src/components/ui/dialog.tsx
113
113
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
114
+ import { cn as cn2 } from "cn";
114
115
  import { XIcon } from "lucide-react";
115
116
 
116
117
  // ../../src/components/ui/search-menu.tsx
@@ -678,6 +678,7 @@ import { SearchIcon } from "lucide-react";
678
678
 
679
679
  // ../../src/components/ui/dialog.tsx
680
680
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
681
+ import { cn as cn2 } from "cn";
681
682
  import { XIcon } from "lucide-react";
682
683
  import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
683
684
  function Dialog({ ...props }) {
@@ -707,17 +708,14 @@ function DialogClose({ ...props }) {
707
708
  function DialogHeader({ className, ...props }) {
708
709
  return /* @__PURE__ */ jsx8("div", {
709
710
  "data-slot": "dialog-header",
710
- className: cn("grid gap-1.5", className),
711
+ className: cn2("flex flex-col gap-2", className),
711
712
  ...props
712
713
  });
713
714
  }
714
- function DialogTitle({
715
- className,
716
- ...props
717
- }) {
715
+ function DialogTitle({ className, ...props }) {
718
716
  return /* @__PURE__ */ jsx8(DialogPrimitive.Title, {
719
717
  "data-slot": "dialog-title",
720
- className: cn("text-lg font-medium", className),
718
+ className: cn2("leading-none font-medium", className),
721
719
  ...props
722
720
  });
723
721
  }
@@ -927,7 +925,7 @@ function InputGroupTextarea({
927
925
  import { mergeProps as mergeProps4 } from "@base-ui/react/merge-props";
928
926
  import { useRender as useRender4 } from "@base-ui/react/use-render";
929
927
  import { cva as cva8 } from "class-variance-authority";
930
- import { cn as cn2 } from "cn";
928
+ import { cn as cn3 } from "cn";
931
929
 
932
930
  // ../../src/components/ui/separator.tsx
933
931
  import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
@@ -962,7 +960,7 @@ function Item({
962
960
  return useRender4({
963
961
  defaultTagName: "div",
964
962
  props: mergeProps4({
965
- className: cn2(itemVariants({ variant, size, className }))
963
+ className: cn3(itemVariants({ variant, size, className }))
966
964
  }, props),
967
965
  render,
968
966
  state: {
@@ -992,42 +990,42 @@ function ItemMedia({
992
990
  return /* @__PURE__ */ jsx13("div", {
993
991
  "data-slot": "item-media",
994
992
  "data-variant": variant,
995
- className: cn2(itemMediaVariants({ variant, className })),
993
+ className: cn3(itemMediaVariants({ variant, className })),
996
994
  ...props
997
995
  });
998
996
  }
999
997
  function ItemContent({ className, ...props }) {
1000
998
  return /* @__PURE__ */ jsx13("div", {
1001
999
  "data-slot": "item-content",
1002
- className: cn2("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", className),
1000
+ className: cn3("flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none", className),
1003
1001
  ...props
1004
1002
  });
1005
1003
  }
1006
1004
  function ItemTitle({ className, ...props }) {
1007
1005
  return /* @__PURE__ */ jsx13("div", {
1008
1006
  "data-slot": "item-title",
1009
- className: cn2("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", className),
1007
+ className: cn3("line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4", className),
1010
1008
  ...props
1011
1009
  });
1012
1010
  }
1013
1011
  function ItemDescription({ className, ...props }) {
1014
1012
  return /* @__PURE__ */ jsx13("p", {
1015
1013
  "data-slot": "item-description",
1016
- className: cn2("line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
1014
+ className: cn3("line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
1017
1015
  ...props
1018
1016
  });
1019
1017
  }
1020
1018
  function ItemActions({ className, ...props }) {
1021
1019
  return /* @__PURE__ */ jsx13("div", {
1022
1020
  "data-slot": "item-actions",
1023
- className: cn2("flex items-center gap-2", className),
1021
+ className: cn3("flex items-center gap-2", className),
1024
1022
  ...props
1025
1023
  });
1026
1024
  }
1027
1025
  function ItemFooter({ className, ...props }) {
1028
1026
  return /* @__PURE__ */ jsx13("div", {
1029
1027
  "data-slot": "item-footer",
1030
- className: cn2("flex basis-full items-center justify-between gap-2", className),
1028
+ className: cn3("flex basis-full items-center justify-between gap-2", className),
1031
1029
  ...props
1032
1030
  });
1033
1031
  }
@@ -1183,7 +1181,7 @@ function PopoverContent({
1183
1181
  }
1184
1182
 
1185
1183
  // ../../src/components/ui/trace.tsx
1186
- import { cn as cn3 } from "cn";
1184
+ import { cn as cn4 } from "cn";
1187
1185
 
1188
1186
  // ../../src/components/ui/collapsible.tsx
1189
1187
  import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
@@ -1213,7 +1211,7 @@ import { jsx as jsx18, jsxs as jsxs6 } from "react/jsx-runtime";
1213
1211
  function Trace({ className, ...props }) {
1214
1212
  return /* @__PURE__ */ jsx18("div", {
1215
1213
  "data-slot": "trace",
1216
- className: cn3("flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50", className),
1214
+ className: cn4("flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50", className),
1217
1215
  ...props
1218
1216
  });
1219
1217
  }
@@ -1225,7 +1223,7 @@ function TraceLine({
1225
1223
  return /* @__PURE__ */ jsx18("span", {
1226
1224
  "data-slot": "trace-line",
1227
1225
  "data-status": status,
1228
- className: cn3("flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer", className),
1226
+ className: cn4("flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer", className),
1229
1227
  ...props
1230
1228
  });
1231
1229
  }
@@ -1233,14 +1231,14 @@ function TraceIcon({ className, ...props }) {
1233
1231
  return /* @__PURE__ */ jsx18("span", {
1234
1232
  "data-slot": "trace-icon",
1235
1233
  "aria-hidden": "true",
1236
- className: cn3("flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1", className),
1234
+ className: cn4("flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1", className),
1237
1235
  ...props
1238
1236
  });
1239
1237
  }
1240
1238
  function TraceTitle({ className, ...props }) {
1241
1239
  return /* @__PURE__ */ jsx18("span", {
1242
1240
  "data-slot": "trace-title",
1243
- className: cn3("min-w-0 truncate motion-reduce:shimmer-none", className),
1241
+ className: cn4("min-w-0 truncate motion-reduce:shimmer-none", className),
1244
1242
  ...props
1245
1243
  });
1246
1244
  }
@@ -1250,7 +1248,7 @@ function TraceDescription({
1250
1248
  }) {
1251
1249
  return /* @__PURE__ */ jsx18("span", {
1252
1250
  "data-slot": "trace-description",
1253
- className: cn3("shrink-0 text-muted-foreground/70 tabular-nums", className),
1251
+ className: cn4("shrink-0 text-muted-foreground/70 tabular-nums", className),
1254
1252
  ...props
1255
1253
  });
1256
1254
  }
@@ -1260,7 +1258,7 @@ function TraceCollapsible({
1260
1258
  }) {
1261
1259
  return /* @__PURE__ */ jsx18(Collapsible, {
1262
1260
  "data-slot": "trace-collapsible",
1263
- className: cn3("flex w-full min-w-0 flex-col", className),
1261
+ className: cn4("flex w-full min-w-0 flex-col", className),
1264
1262
  ...props
1265
1263
  });
1266
1264
  }
@@ -1271,7 +1269,7 @@ function TraceCollapsibleTrigger({
1271
1269
  }) {
1272
1270
  return /* @__PURE__ */ jsxs6(CollapsibleTrigger, {
1273
1271
  "data-slot": "trace-collapsible-trigger",
1274
- className: cn3("group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive", className),
1272
+ className: cn4("group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive", className),
1275
1273
  ...props,
1276
1274
  children: [
1277
1275
  children,
@@ -1293,7 +1291,7 @@ function TraceCollapsibleContent({
1293
1291
  ...props,
1294
1292
  children: /* @__PURE__ */ jsx18("div", {
1295
1293
  "data-slot": "trace-collapsible-content-inner",
1296
- className: cn3("mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground", className),
1294
+ className: cn4("mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground", className),
1297
1295
  children
1298
1296
  })
1299
1297
  });
@@ -0,0 +1,31 @@
1
+ import { Config, Context, Effect, Layer, Schema } from "effect";
2
+ export type ClamAVVerdict = {
3
+ readonly _tag: "Clean";
4
+ } | {
5
+ readonly _tag: "Detected";
6
+ readonly signature: string;
7
+ } | {
8
+ readonly _tag: "Unscannable";
9
+ };
10
+ declare const ClamAVError_base: Schema.Class<ClamAVError, Schema.TaggedStruct<"ClamAVError", {
11
+ readonly reason: Schema.Literals<readonly ["Unavailable", "Timeout", "InvalidReply", "ScanFailed"]>;
12
+ }>, import("effect/Cause").YieldableError>;
13
+ export declare class ClamAVError extends ClamAVError_base {
14
+ }
15
+ type Endpoint = {
16
+ readonly host: string;
17
+ readonly port: number;
18
+ };
19
+ declare const ClamAV_base: Context.ServiceClass<ClamAV, "krak-stack/ClamAV", {
20
+ readonly scan: (input: {
21
+ readonly bytes: Uint8Array;
22
+ }) => Effect.Effect<ClamAVVerdict, ClamAVError>;
23
+ readonly ping: () => Effect.Effect<void, ClamAVError>;
24
+ }>;
25
+ export declare class ClamAV extends ClamAV_base {
26
+ static readonly layerWith: (endpoint: Endpoint) => Layer.Layer<ClamAV, never, never>;
27
+ static readonly layer: Layer.Layer<ClamAV, Config.ConfigError, never>;
28
+ static readonly layerTest: (service: ClamAV["Service"]) => Layer.Layer<ClamAV, never, never>;
29
+ private static readonly make;
30
+ }
31
+ export {};
@@ -0,0 +1,124 @@
1
+ // ../../src/services/clamav/index.ts
2
+ import { createConnection } from "node:net";
3
+ import { Config, Context, Effect, Layer, Schema, Semaphore } from "effect";
4
+
5
+ class ClamAVError extends Schema.TaggedError()("ClamAVError", {
6
+ reason: Schema.Literals([
7
+ "Unavailable",
8
+ "Timeout",
9
+ "InvalidReply",
10
+ "ScanFailed"
11
+ ])
12
+ }) {
13
+ }
14
+ var maxBytes = 100 * 1024 * 1024;
15
+ var request = (endpoint, bytes) => Effect.tryPromise({
16
+ try: (signal) => new Promise((resolve, reject) => {
17
+ const socket = createConnection({ ...endpoint, signal });
18
+ let reply = Buffer.alloc(0);
19
+ let sent = bytes === undefined;
20
+ const fail = (reason) => {
21
+ reject(new ClamAVError({ reason }));
22
+ socket.destroy();
23
+ };
24
+ socket.on("error", () => fail("Unavailable"));
25
+ socket.on("close", () => {
26
+ const end = reply.indexOf(0);
27
+ if (end < 0)
28
+ return fail(reply.length ? "InvalidReply" : "Unavailable");
29
+ if (end !== reply.length - 1)
30
+ return fail("InvalidReply");
31
+ const line = reply.toString("utf8", 0, end);
32
+ if (!sent && line === "stream: OK")
33
+ return fail("InvalidReply");
34
+ resolve(line);
35
+ });
36
+ socket.on("data", (part) => {
37
+ if (reply.length + part.length > 4096)
38
+ return fail("InvalidReply");
39
+ reply = Buffer.concat([reply, part]);
40
+ });
41
+ socket.once("connect", () => {
42
+ if (!bytes) {
43
+ socket.write("zPING\x00");
44
+ return;
45
+ }
46
+ let offset = 0;
47
+ const send = () => {
48
+ if (socket.destroyed)
49
+ return;
50
+ if (offset === bytes.length) {
51
+ sent = true;
52
+ socket.write(Buffer.alloc(4));
53
+ return;
54
+ }
55
+ const size = Math.min(64 * 1024, bytes.length - offset);
56
+ const frame = Buffer.allocUnsafe(4 + size);
57
+ frame.writeUInt32BE(size);
58
+ frame.set(bytes.subarray(offset, offset + size), 4);
59
+ offset += size;
60
+ socket.write(frame, (error) => {
61
+ if (error)
62
+ fail("Unavailable");
63
+ else
64
+ send();
65
+ });
66
+ };
67
+ socket.write("zINSTREAM\x00", (error) => {
68
+ if (error)
69
+ fail("Unavailable");
70
+ else
71
+ send();
72
+ });
73
+ });
74
+ }),
75
+ catch: (error) => error instanceof ClamAVError ? error : new ClamAVError({ reason: "Unavailable" })
76
+ }).pipe(Effect.timeoutOrElse({
77
+ duration: "60 seconds",
78
+ orElse: () => Effect.fail(new ClamAVError({ reason: "Timeout" }))
79
+ }));
80
+
81
+ class ClamAV extends Context.Service()("krak-stack/ClamAV") {
82
+ static layerWith = (endpoint) => Layer.effect(this, ClamAV.make(endpoint));
83
+ static layer = Layer.effect(this, Effect.gen(function* () {
84
+ const host = yield* Config.schema(Schema.NonEmptyString, "CLAMAV_HOST");
85
+ const port = yield* Config.Port("CLAMAV_PORT").pipe(Config.withDefault(3310));
86
+ return yield* ClamAV.make({ host, port });
87
+ }));
88
+ static layerTest = (service) => Layer.succeed(this, service);
89
+ static make = (endpoint) => Effect.gen(function* () {
90
+ const semaphore = yield* Semaphore.make(2);
91
+ const scan = Effect.fn("ClamAV.scan")(function* ({
92
+ bytes
93
+ }) {
94
+ if (bytes.length === 0 || bytes.length > maxBytes)
95
+ return { _tag: "Unscannable" };
96
+ const line = yield* semaphore.withPermit(request(endpoint, bytes));
97
+ if (line === "stream: OK")
98
+ return { _tag: "Clean" };
99
+ if (/^INSTREAM size limit exceeded\.? ERROR$/.test(line))
100
+ return { _tag: "Unscannable" };
101
+ const match = /^stream: ([^\r\n]+) FOUND$/.exec(line);
102
+ if (match) {
103
+ const signature = match[1];
104
+ if (/^Heuristics\.(Limits\.Exceeded|Encrypted)(?:\.|$)/.test(signature)) {
105
+ return { _tag: "Unscannable" };
106
+ }
107
+ return { _tag: "Detected", signature };
108
+ }
109
+ return yield* new ClamAVError({
110
+ reason: line.endsWith(" ERROR") ? "ScanFailed" : "InvalidReply"
111
+ });
112
+ });
113
+ const ping = Effect.fn("ClamAV.ping")(function* () {
114
+ if ((yield* request(endpoint)) !== "PONG") {
115
+ return yield* new ClamAVError({ reason: "InvalidReply" });
116
+ }
117
+ });
118
+ return { scan, ping };
119
+ });
120
+ }
121
+ export {
122
+ ClamAV,
123
+ ClamAVError
124
+ };
@@ -57,6 +57,7 @@ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
57
57
 
58
58
  // ../../src/components/ui/dialog.tsx
59
59
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
60
+ import { cn as cn2 } from "cn";
60
61
  import { XIcon } from "lucide-react";
61
62
  import { jsx as jsx2, jsxs } from "react/jsx-runtime";
62
63
  function Dialog({ ...props }) {
@@ -77,13 +78,14 @@ function DialogOverlay({
77
78
  }) {
78
79
  return /* @__PURE__ */ jsx2(DialogPrimitive.Backdrop, {
79
80
  "data-slot": "dialog-overlay",
80
- className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0", className),
81
+ className: cn2("data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0 fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs", className),
81
82
  ...props
82
83
  });
83
84
  }
84
85
  function DialogContent({
85
86
  className,
86
87
  children,
88
+ showCloseButton = true,
87
89
  ...props
88
90
  }) {
89
91
  return /* @__PURE__ */ jsxs(DialogPortal, {
@@ -91,16 +93,19 @@ function DialogContent({
91
93
  /* @__PURE__ */ jsx2(DialogOverlay, {}),
92
94
  /* @__PURE__ */ jsxs(DialogPrimitive.Popup, {
93
95
  "data-slot": "dialog-content",
94
- className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-6 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className),
96
+ className: cn2("bg-popover text-popover-foreground ring-foreground/10 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl p-6 text-sm ring-1 duration-100 outline-none sm:max-w-md", className),
95
97
  ...props,
96
98
  children: [
97
99
  children,
98
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
99
- className: "focus-visible:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus-visible:ring-2 focus-visible:outline-none disabled:pointer-events-none",
100
+ showCloseButton && /* @__PURE__ */ jsxs(DialogPrimitive.Close, {
101
+ "data-slot": "dialog-close",
102
+ render: /* @__PURE__ */ jsx2(Button, {
103
+ variant: "ghost",
104
+ className: "absolute top-4 right-4",
105
+ size: "icon-sm"
106
+ }),
100
107
  children: [
101
- /* @__PURE__ */ jsx2(XIcon, {
102
- className: "size-4"
103
- }),
108
+ /* @__PURE__ */ jsx2(XIcon, {}),
104
109
  /* @__PURE__ */ jsx2("span", {
105
110
  className: "sr-only",
106
111
  children: "Close"
@@ -115,24 +120,35 @@ function DialogContent({
115
120
  function DialogHeader({ className, ...props }) {
116
121
  return /* @__PURE__ */ jsx2("div", {
117
122
  "data-slot": "dialog-header",
118
- className: cn("grid gap-1.5", className),
119
- ...props
120
- });
121
- }
122
- function DialogFooter({ className, ...props }) {
123
- return /* @__PURE__ */ jsx2("div", {
124
- "data-slot": "dialog-footer",
125
- className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
123
+ className: cn2("flex flex-col gap-2", className),
126
124
  ...props
127
125
  });
128
126
  }
129
- function DialogTitle({
127
+ function DialogFooter({
130
128
  className,
129
+ showCloseButton = false,
130
+ children,
131
131
  ...props
132
132
  }) {
133
+ return /* @__PURE__ */ jsxs("div", {
134
+ "data-slot": "dialog-footer",
135
+ className: cn2("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className),
136
+ ...props,
137
+ children: [
138
+ children,
139
+ showCloseButton && /* @__PURE__ */ jsx2(DialogPrimitive.Close, {
140
+ render: /* @__PURE__ */ jsx2(Button, {
141
+ variant: "outline"
142
+ }),
143
+ children: "Close"
144
+ })
145
+ ]
146
+ });
147
+ }
148
+ function DialogTitle({ className, ...props }) {
133
149
  return /* @__PURE__ */ jsx2(DialogPrimitive.Title, {
134
150
  "data-slot": "dialog-title",
135
- className: cn("text-lg font-medium", className),
151
+ className: cn2("leading-none font-medium", className),
136
152
  ...props
137
153
  });
138
154
  }
@@ -142,7 +158,7 @@ function DialogDescription({
142
158
  }) {
143
159
  return /* @__PURE__ */ jsx2(DialogPrimitive.Description, {
144
160
  "data-slot": "dialog-description",
145
- className: cn("text-sm text-muted-foreground", className),
161
+ className: cn2("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3", className),
146
162
  ...props
147
163
  });
148
164
  }
@@ -411,7 +411,7 @@ function NotificationMenu({
411
411
  className: "flex shrink-0 flex-col gap-2 border-b p-2",
412
412
  children: [
413
413
  /* @__PURE__ */ jsxs2(TabsList, {
414
- className: "grid w-full min-w-0 grid-cols-2",
414
+ className: "w-full min-w-0 gap-2",
415
415
  children: [
416
416
  /* @__PURE__ */ jsxs2(TabsTrigger, {
417
417
  className: "min-w-0",
@@ -525,9 +525,9 @@ function NotificationList({
525
525
  });
526
526
  }
527
527
  return /* @__PURE__ */ jsx7(ScrollArea, {
528
- className: "flex max-h-[min(24rem,60svh)] min-h-0 min-w-0 flex-auto flex-col overflow-hidden [&>[data-slot=scroll-area-viewport]]:h-auto [&>[data-slot=scroll-area-viewport]]:min-h-0 [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:[--notification-scrollbar-gutter:0.375rem]",
528
+ className: "flex max-h-[min(24rem,60svh)] min-h-0 min-w-0 flex-auto flex-col overflow-hidden [&>[data-slot=scroll-area-viewport]]:h-auto [&>[data-slot=scroll-area-viewport]]:min-h-0 [&>[data-slot=scroll-area-viewport][data-has-overflow-y]]:[--notification-scrollbar-gutter:--spacing(2.5)]",
529
529
  children: /* @__PURE__ */ jsx7("div", {
530
- className: "flex min-w-0 flex-col",
530
+ className: "divide-border flex min-w-0 flex-col divide-y pe-[var(--notification-scrollbar-gutter,0px)]",
531
531
  children: notifications.map((notification) => /* @__PURE__ */ jsx7(NotificationListItem, {
532
532
  labels,
533
533
  locale,
@@ -548,15 +548,10 @@ function NotificationListItem({
548
548
  renderItem
549
549
  }) {
550
550
  const unread = !notification.readAt && !notification.archivedAt;
551
- const selectNotification = () => {
552
- if (onNavigate) {
553
- onNavigate(notification);
554
- return;
555
- }
556
- if (notification.href && globalThis.window) {
557
- window.location.assign(notification.href);
558
- }
559
- };
551
+ const { href } = notification;
552
+ const canArchive = !notification.archivedAt && onArchive;
553
+ const rowClassName = cn("h-auto w-full min-w-0 justify-start rounded-none px-3 py-4 text-start [overflow-wrap:anywhere] whitespace-normal", canArchive && "pe-14");
554
+ const actionClassName = cn(rowClassName, "focus-visible:inset-ring-ring/50 focus-visible:ring-0 focus-visible:inset-ring-3 forced-colors:focus-visible:outline-2 forced-colors:focus-visible:-outline-offset-2 forced-colors:focus-visible:outline-solid");
560
555
  const content = renderItem?.(notification) ?? /* @__PURE__ */ jsxs2("span", {
561
556
  className: "flex min-w-0 flex-1 flex-col gap-1",
562
557
  children: [
@@ -584,23 +579,35 @@ function NotificationListItem({
584
579
  ]
585
580
  });
586
581
  return /* @__PURE__ */ jsxs2("div", {
587
- className: cn("group relative min-w-0", unread && "bg-muted/70"),
582
+ className: cn("relative flex min-w-0", unread && "bg-muted/70"),
588
583
  "data-unread": unread || undefined,
589
584
  children: [
590
- /* @__PURE__ */ jsx7(Button, {
591
- className: cn("h-auto w-full min-w-0 cursor-pointer justify-start rounded-none border-0 border-b border-border px-3 py-4 pr-[calc(0.75rem+var(--notification-scrollbar-gutter,0px))] text-left [overflow-wrap:anywhere] whitespace-normal group-last:border-b-0", !notification.archivedAt && onArchive && "pr-[calc(3.5rem+var(--notification-scrollbar-gutter,0px))]"),
592
- onClick: selectNotification,
585
+ href ? /* @__PURE__ */ jsx7("a", {
586
+ className: cn(buttonVariants({ variant: "ghost" }), actionClassName),
587
+ href,
588
+ onClick: (event) => {
589
+ if (!onNavigate || event.defaultPrevented || event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {
590
+ return;
591
+ }
592
+ event.preventDefault();
593
+ onNavigate(notification);
594
+ },
595
+ children: content
596
+ }) : onNavigate ? /* @__PURE__ */ jsx7(Button, {
597
+ className: actionClassName,
598
+ onClick: () => onNavigate(notification),
593
599
  type: "button",
594
600
  variant: "ghost",
595
601
  children: content
602
+ }) : /* @__PURE__ */ jsx7("div", {
603
+ className: cn(rowClassName, "flex items-center text-sm font-medium"),
604
+ children: content
596
605
  }),
597
- !notification.archivedAt && onArchive ? /* @__PURE__ */ jsx7("div", {
598
- className: "absolute top-3 right-[calc(0.5rem+var(--notification-scrollbar-gutter,0px))]",
599
- children: /* @__PURE__ */ jsx7(ArchiveButton, {
600
- label: labels.archiveItem(notificationTitle(notification)),
601
- notificationIds: [notification.id],
602
- onArchive
603
- })
606
+ canArchive ? /* @__PURE__ */ jsx7(ArchiveButton, {
607
+ className: "absolute end-2 top-2",
608
+ label: labels.archiveItem(notificationTitle(notification)),
609
+ notificationIds: [notification.id],
610
+ onArchive: canArchive
604
611
  }) : null
605
612
  ]
606
613
  });
@@ -651,7 +658,7 @@ function ArchiveButton({
651
658
  className,
652
659
  disabled: pending,
653
660
  onClick: () => void archiveNotifications(),
654
- size: showLabel ? "sm" : "icon-sm",
661
+ size: showLabel ? "default" : "icon",
655
662
  title: label,
656
663
  type: "button",
657
664
  variant: showLabel ? "outline" : "ghost",