@alexgorbatchev/shadcn 0.0.158 → 0.0.159

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.
@@ -14,12 +14,12 @@ function Switch2({ analytics, density, className, size = "default", ...props })
14
14
  "data-density": density,
15
15
  "data-slot": "switch",
16
16
  "data-size": size,
17
- className: (state) => cn2("peer group/switch relative inline-flex shrink-0 items-center rounded-sm border border-transparent transition-colors outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50", typeof className === "function" ? className(state) : className),
17
+ className: (state) => cn2("peer group/switch relative inline-flex shrink-0 items-center rounded-sm border border-input transition-colors outline-none group-has-[:focus-visible]/field-label:border-transparent group-has-[:focus-visible]/field-label:ring-0 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive data-[size=default]:h-5 data-[size=default]:w-9 data-[size=sm]:h-4 data-[size=sm]:w-7 data-checked:border-primary data-checked:bg-primary data-unchecked:bg-input data-disabled:cursor-not-allowed data-disabled:opacity-50", typeof className === "function" ? className(state) : className),
18
18
  ...props,
19
19
  onCheckedChange: trackedOnCheckedChange,
20
20
  children: /* @__PURE__ */ jsx(SwitchPrimitive.Thumb, {
21
21
  "data-slot": "switch-thumb",
22
- className: "pointer-events-none absolute top-1/2 start-0 block -translate-y-1/2 rounded-sm bg-primary-foreground ring-0 transition-[inset-inline-start] group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:start-[calc(100%-1rem)] group-data-[size=sm]/switch:data-checked:start-[calc(100%-0.75rem)]"
22
+ className: "pointer-events-none absolute top-1/2 start-0.5 block -translate-y-1/2 rounded-xs bg-foreground ring-0 transition-[inset-inline-start,background-color] group-data-[size=default]/switch:size-3.5 group-data-[size=sm]/switch:size-2.5 data-checked:bg-primary-foreground group-data-[size=default]/switch:data-checked:start-[calc(100%-0.875rem-2px)] group-data-[size=sm]/switch:data-checked:start-[calc(100%-0.625rem-2px)]"
23
23
  })
24
24
  });
25
25
  }
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-jc3cbwyg.js";
29
29
  import {
30
30
  Switch2
31
- } from "./chunk-m98d89xc.js";
31
+ } from "./chunk-dv0rz8r9.js";
32
32
  import {
33
33
  useReceiptFocus
34
34
  } from "./chunk-vxvaaptq.js";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-en44w1pn.js";
4
4
  import {
5
5
  Switch2
6
- } from "./chunk-m98d89xc.js";
6
+ } from "./chunk-dv0rz8r9.js";
7
7
  import {
8
8
  paper,
9
9
  field,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-en44w1pn.js";
4
4
  import {
5
5
  Switch2
6
- } from "./chunk-m98d89xc.js";
6
+ } from "./chunk-dv0rz8r9.js";
7
7
  import {
8
8
  Button2
9
9
  } from "./chunk-2sx8m8b2.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  ElicitationForm2
3
- } from "../../../chunk-hbhpnc1m.js";
3
+ } from "../../../chunk-fnfaa0zx.js";
4
4
  import"../../../chunk-vxvaaptq.js";
5
5
  import"../../../chunk-kgqe8gpb.js";
6
- import"../../../chunk-m98d89xc.js";
6
+ import"../../../chunk-dv0rz8r9.js";
7
7
  import"../../../chunk-5ez5vgkn.js";
8
8
  import"../../../chunk-jc3cbwyg.js";
9
9
  import"../../../chunk-4m2x9jfb.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  ScheduleCard2
3
- } from "../../../chunk-gx8z1f8n.js";
4
- import"../../../chunk-m98d89xc.js";
3
+ } from "../../../chunk-j0sw6cn8.js";
4
+ import"../../../chunk-dv0rz8r9.js";
5
5
  import"../../../chunk-5mydsjp3.js";
6
6
  import"../../../chunk-8ssktt4b.js";
7
7
  import"../../../chunk-7ny0vyek.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  SettingsPanel2
3
- } from "../../../chunk-4cv28c46.js";
3
+ } from "../../../chunk-zh1vby37.js";
4
4
  import"../../../chunk-7cq1s2ey.js";
5
- import"../../../chunk-m98d89xc.js";
5
+ import"../../../chunk-dv0rz8r9.js";
6
6
  import"../../../chunk-p51p95er.js";
7
7
  import"../../../chunk-7jpsybag.js";
8
8
  import"../../../chunk-2sx8m8b2.js";
@@ -231,10 +231,10 @@ import {
231
231
  EditMessage2
232
232
  } from "../../chunk-tgkc06q4.js";
233
233
  import"../../chunk-kgqe8gpb.js";
234
- import"../../chunk-m98d89xc.js";
234
+ import"../../chunk-dv0rz8r9.js";
235
235
  import {
236
236
  ElicitationForm2
237
- } from "../../chunk-hbhpnc1m.js";
237
+ } from "../../chunk-fnfaa0zx.js";
238
238
  import"../../chunk-4e96tpw0.js";
239
239
  import {
240
240
  EmptyState2
@@ -499,7 +499,7 @@ import {
499
499
  } from "../../chunk-x4rwh3pv.js";
500
500
  import {
501
501
  ScheduleCard2
502
- } from "../../chunk-gx8z1f8n.js";
502
+ } from "../../chunk-j0sw6cn8.js";
503
503
  import {
504
504
  ScoreBreakdown2
505
505
  } from "../../chunk-cqwg3q9q.js";
@@ -509,7 +509,7 @@ import {
509
509
  import"../../chunk-7cq1s2ey.js";
510
510
  import {
511
511
  SettingsPanel2
512
- } from "../../chunk-4cv28c46.js";
512
+ } from "../../chunk-zh1vby37.js";
513
513
  import {
514
514
  SharedConversation2
515
515
  } from "../../chunk-fxh3wgg9.js";
@@ -15,6 +15,7 @@ interface IImageComparisonToolbarProps extends IDensityProps {
15
15
  differences: ImageDifferenceState;
16
16
  activeRegionIndex: number;
17
17
  onStepChange: (delta: -1 | 1) => void;
18
+ onCommentActiveDifference?: () => void;
18
19
  onPeekChange: (isPeeking: boolean) => void;
19
20
  beforeLabel: string;
20
21
  afterLabel: string;
@@ -23,5 +24,5 @@ interface IImageComparisonToolbarProps extends IDensityProps {
23
24
  toolbar?: ReactNode;
24
25
  }
25
26
  /** Comparison controls in a single horizontal wrapping toolbar row above the stage so images get the full width. */
26
- export declare function ImageComparisonToolbar({ mode, onModeChange, side, onSideChange, orientation, onOrientationChange, zoom, onZoomChange, showDifferences, onShowDifferencesChange, differences, activeRegionIndex, onStepChange, onPeekChange, beforeLabel, afterLabel, beforeSize, afterSize, toolbar, density, }: IImageComparisonToolbarProps): ReactElement;
27
+ export declare function ImageComparisonToolbar({ mode, onModeChange, side, onSideChange, orientation, onOrientationChange, zoom, onZoomChange, showDifferences, onShowDifferencesChange, differences, activeRegionIndex, onStepChange, onCommentActiveDifference, onPeekChange, beforeLabel, afterLabel, beforeSize, afterSize, toolbar, density, }: IImageComparisonToolbarProps): ReactElement;
27
28
  export {};
@@ -1,12 +1,10 @@
1
1
  import type { ReactElement } from "react";
2
- import type { IImageDiff, IImageDiffRegion } from "./types.js";
2
+ import type { IImageDiff } from "./types.js";
3
3
  interface IImageDifferenceOverlayProps {
4
4
  diff: IImageDiff;
5
5
  /** Index of the currently stepped-to changed region, emphasized more strongly than the rest. */
6
6
  activeIndex?: number;
7
- /** Renders a compact Comment affordance on each outlined changed region when provided. */
8
- onCommentRegion?: (region: IImageDiffRegion, index: number) => void;
9
7
  }
10
8
  /** Outlines changed regions over the after image box; percentages keep the outlines aligned at every zoom level. */
11
- export declare function ImageDifferenceOverlay({ diff, activeIndex, onCommentRegion, }: IImageDifferenceOverlayProps): ReactElement;
9
+ export declare function ImageDifferenceOverlay({ diff, activeIndex }: IImageDifferenceOverlayProps): ReactElement;
12
10
  export {};
@@ -7,6 +7,10 @@ export interface IImageGalleryItem {
7
7
  alt: string;
8
8
  /** The item's name, used in the step announcement: "Bold · 2 of 3". */
9
9
  label: string;
10
+ /** Short consequence or caption shown on the item's card in Compare all mode. */
11
+ description?: string;
12
+ /** Highlights this card in Compare all mode as the currently selected choice. */
13
+ selected?: boolean;
10
14
  }
11
15
  export interface IImageGalleryProps extends IDensityProps {
12
16
  items: readonly IImageGalleryItem[];
@@ -23,6 +23,8 @@ interface IImageViewportProps {
23
23
  onStageKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
24
24
  /** Further `aria-keyshortcuts` the stage handles through `onStageKeyDown`, such as "R". */
25
25
  stageKeyShortcuts?: string;
26
+ /** Allows vertical touch scrolling of an enclosing list while fitted (nothing to pan). */
27
+ allowVerticalScroll?: boolean;
26
28
  }
27
29
  /**
28
30
  * Native scroll viewport that centers an image box. Fit zoom never scrolls; larger zooms scroll on any axis where the
@@ -34,5 +36,5 @@ interface IImageViewportProps {
34
36
  * content that handles a pointer itself, such as a region tool, calls `preventDefault()` on its `pointerdown`, which
35
37
  * keeps that pointer from panning while a second finger still pinches.
36
38
  */
37
- export declare function ImageViewport({ label, zoom, naturalSize, center, children, fallback, viewportRef, onViewportScroll, onZoomChange, onStageKeyDown, stageKeyShortcuts, }: IImageViewportProps): ReactElement;
39
+ export declare function ImageViewport({ label, zoom, naturalSize, center, children, fallback, viewportRef, onViewportScroll, onZoomChange, onStageKeyDown, stageKeyShortcuts, allowVerticalScroll, }: IImageViewportProps): ReactElement;
38
40
  export {};
@@ -33,6 +33,9 @@ import {
33
33
  import {
34
34
  FramedImage2
35
35
  } from "../../chunk-2jsgsjas.js";
36
+ import {
37
+ Badge2
38
+ } from "../../chunk-dbe9ppwf.js";
36
39
  import {
37
40
  Dialog2,
38
41
  DialogContent2,
@@ -42,7 +45,7 @@ import {
42
45
  } from "../../chunk-d22t4qx6.js";
43
46
  import {
44
47
  Switch2
45
- } from "../../chunk-m98d89xc.js";
48
+ } from "../../chunk-dv0rz8r9.js";
46
49
  import"../../chunk-5mydsjp3.js";
47
50
 
48
51
  // src/components/image-viewer/ImageViewer.tsx
@@ -160,7 +163,8 @@ function ImageViewport({
160
163
  onViewportScroll,
161
164
  onZoomChange,
162
165
  onStageKeyDown,
163
- stageKeyShortcuts
166
+ stageKeyShortcuts,
167
+ allowVerticalScroll = false
164
168
  }) {
165
169
  const elementRef = useRef(null);
166
170
  const stageRef = useRef(null);
@@ -389,7 +393,7 @@ function ImageViewport({
389
393
  onPointerUp: handlePointerEnd,
390
394
  onPointerCancel: handlePointerEnd,
391
395
  onClickCapture: handleClickCapture,
392
- className: cn2("flex min-h-0 min-w-0 flex-1 touch-none overscroll-contain outline-none select-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset data-pannable:cursor-grab data-panning:cursor-grabbing", zoom === "fit" ? "overflow-hidden" : "overflow-auto"),
396
+ className: cn2("flex min-h-0 min-w-0 flex-1 overscroll-contain outline-none select-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset data-pannable:cursor-grab data-panning:cursor-grabbing", allowVerticalScroll && zoom === "fit" ? "touch-pan-y" : "touch-none", zoom === "fit" ? "overflow-hidden" : "overflow-auto"),
393
397
  children: fallback ?? /* @__PURE__ */ jsx("div", {
394
398
  ref: stageRef,
395
399
  "data-slot": "image-stage",
@@ -402,25 +406,25 @@ function ImageViewport({
402
406
  "data-slot": "image-viewport-scroll-hint",
403
407
  "data-edge": "left",
404
408
  "aria-hidden": "true",
405
- className: "pointer-events-none absolute inset-y-0 left-0 w-5 border-l-2 border-primary/50 bg-gradient-to-r from-black/25 to-transparent"
409
+ className: "pointer-events-none absolute inset-y-0 left-0 w-5 border-l border-foreground/30 bg-gradient-to-r from-black/35 via-black/15 to-transparent dark:from-black/55 dark:via-black/20"
406
410
  }),
407
411
  scrollHints.right && /* @__PURE__ */ jsx("div", {
408
412
  "data-slot": "image-viewport-scroll-hint",
409
413
  "data-edge": "right",
410
414
  "aria-hidden": "true",
411
- className: "pointer-events-none absolute inset-y-0 right-0 w-5 border-r-2 border-primary/50 bg-gradient-to-l from-black/25 to-transparent"
415
+ className: "pointer-events-none absolute inset-y-0 right-0 w-5 border-r border-foreground/30 bg-gradient-to-l from-black/35 via-black/15 to-transparent dark:from-black/55 dark:via-black/20"
412
416
  }),
413
417
  scrollHints.top && /* @__PURE__ */ jsx("div", {
414
418
  "data-slot": "image-viewport-scroll-hint",
415
419
  "data-edge": "top",
416
420
  "aria-hidden": "true",
417
- className: "pointer-events-none absolute inset-x-0 top-0 h-5 border-t-2 border-primary/50 bg-gradient-to-b from-black/25 to-transparent"
421
+ className: "pointer-events-none absolute inset-x-0 top-0 h-5 border-t border-foreground/30 bg-gradient-to-b from-black/35 via-black/15 to-transparent dark:from-black/55 dark:via-black/20"
418
422
  }),
419
423
  scrollHints.bottom && /* @__PURE__ */ jsx("div", {
420
424
  "data-slot": "image-viewport-scroll-hint",
421
425
  "data-edge": "bottom",
422
426
  "aria-hidden": "true",
423
- className: "pointer-events-none absolute inset-x-0 bottom-0 h-5 border-b-2 border-primary/50 bg-gradient-to-t from-black/25 to-transparent"
427
+ className: "pointer-events-none absolute inset-x-0 bottom-0 h-5 border-b border-foreground/30 bg-gradient-to-t from-black/35 via-black/15 to-transparent dark:from-black/55 dark:via-black/20"
424
428
  })
425
429
  ]
426
430
  });
@@ -741,7 +745,7 @@ var imageRegionMarkerVariants = cva("pointer-events-none absolute rounded-xs sha
741
745
  variant: {
742
746
  comment: "bg-primary/10 outline-primary",
743
747
  draft: "bg-primary/10 outline-dashed outline-primary",
744
- difference: "bg-warning/10 outline-warning"
748
+ difference: "bg-warning/5 outline-dashed outline-offset-[3px] outline-warning/75"
745
749
  }
746
750
  },
747
751
  defaultVariants: { variant: "comment" }
@@ -758,7 +762,7 @@ function ImageRegionMarker({
758
762
  "data-slot": "image-region-marker",
759
763
  "data-variant": variant ?? "comment",
760
764
  "data-active": active ? "" : undefined,
761
- className: cn2(imageRegionMarkerVariants({ variant }), active && "z-10 outline-[3px]", active && variant === "difference" && "bg-warning/20", className),
765
+ className: cn2(imageRegionMarkerVariants({ variant }), active && "z-10 outline-[3px]", active && variant === "difference" && "bg-warning/25 shadow-[0_0_0_5px_var(--background)] outline-solid outline-warning", className),
762
766
  style: region ? { ...style, ...region } : style,
763
767
  ...props
764
768
  });
@@ -956,42 +960,62 @@ function CompareAllPane({
956
960
  return /* @__PURE__ */ jsxs6("section", {
957
961
  "aria-label": item.label,
958
962
  "data-slot": "image-gallery-compare-pane",
959
- className: "flex min-h-64 min-w-0 flex-col overflow-hidden rounded-md border border-border bg-background @2xl:min-h-0",
963
+ "data-selected": item.selected ? "" : undefined,
964
+ className: cn2("flex min-w-0 flex-col overflow-hidden rounded-md border bg-background", item.selected ? "border-primary ring-1 ring-primary" : "border-border"),
960
965
  children: [
961
- /* @__PURE__ */ jsx8("div", {
966
+ /* @__PURE__ */ jsxs6("div", {
962
967
  "data-slot": "image-gallery-compare-header",
963
- className: "flex h-control shrink-0 items-center justify-between gap-2 border-b border-border px-control-x text-xs font-medium text-muted-foreground",
964
- children: /* @__PURE__ */ jsx8("span", {
965
- className: "truncate",
966
- children: item.label
967
- })
968
+ className: "flex h-control shrink-0 items-center justify-between gap-2 border-b border-border px-control-x text-xs font-medium text-foreground",
969
+ children: [
970
+ /* @__PURE__ */ jsx8("span", {
971
+ className: "truncate",
972
+ children: item.label
973
+ }),
974
+ item.selected && /* @__PURE__ */ jsx8(Badge2, {
975
+ variant: "default",
976
+ children: "Chosen"
977
+ })
978
+ ]
968
979
  }),
969
- /* @__PURE__ */ jsx8(ImageViewport, {
970
- label: item.label,
971
- zoom,
972
- naturalSize: image.size,
973
- center,
974
- onZoomChange,
975
- viewportRef,
976
- onViewportScroll,
977
- fallback: image.status === "error" ? /* @__PURE__ */ jsx8("p", {
978
- className: "m-auto p-panel text-center text-sm text-muted-foreground",
979
- children: "Image could not be loaded."
980
- }) : undefined,
981
- children: /* @__PURE__ */ jsx8("img", {
982
- src: item.src,
983
- alt: item.alt,
984
- draggable: false,
985
- "data-slot": "image-gallery-compare-image",
986
- className: "block size-full outline-1 -outline-offset-1 outline-media-edge select-none",
987
- onLoad: imageHandlers.onLoad,
988
- onError: imageHandlers.onError
980
+ /* @__PURE__ */ jsx8("div", {
981
+ className: cn2("flex min-h-0 w-full shrink-0", zoom === "fit" ? "aspect-[16/10]" : "h-[min(60dvh,32rem)]"),
982
+ children: /* @__PURE__ */ jsx8(ImageViewport, {
983
+ label: item.label,
984
+ zoom,
985
+ naturalSize: image.size,
986
+ center,
987
+ onZoomChange,
988
+ viewportRef,
989
+ onViewportScroll,
990
+ allowVerticalScroll: true,
991
+ fallback: image.status === "error" ? /* @__PURE__ */ jsx8("p", {
992
+ className: "m-auto p-panel text-center text-sm text-muted-foreground",
993
+ children: "Image could not be loaded."
994
+ }) : undefined,
995
+ children: /* @__PURE__ */ jsx8("img", {
996
+ src: item.src,
997
+ alt: item.alt,
998
+ draggable: false,
999
+ "data-slot": "image-gallery-compare-image",
1000
+ className: "block size-full outline-1 -outline-offset-1 outline-media-edge select-none",
1001
+ onLoad: imageHandlers.onLoad,
1002
+ onError: imageHandlers.onError
1003
+ })
989
1004
  })
990
1005
  }),
991
- footer !== undefined && footer !== null && /* @__PURE__ */ jsx8("div", {
1006
+ (item.description || footer !== undefined && footer !== null) && /* @__PURE__ */ jsxs6("div", {
992
1007
  "data-slot": "image-gallery-compare-footer",
993
- className: "flex shrink-0 items-center justify-between gap-2 border-t border-border p-2",
994
- children: footer
1008
+ className: "flex shrink-0 flex-col gap-2 border-t border-border p-panel-sm",
1009
+ children: [
1010
+ item.description && /* @__PURE__ */ jsx8("p", {
1011
+ className: "text-xs text-muted-foreground",
1012
+ children: item.description
1013
+ }),
1014
+ footer !== undefined && footer !== null && /* @__PURE__ */ jsx8("div", {
1015
+ className: "flex items-center justify-between gap-2",
1016
+ children: footer
1017
+ })
1018
+ ]
995
1019
  })
996
1020
  ]
997
1021
  });
@@ -1107,7 +1131,7 @@ function ImageGallery({
1107
1131
  }),
1108
1132
  /* @__PURE__ */ jsx8("div", {
1109
1133
  "data-slot": "image-gallery-compare-grid",
1110
- className: cn2("grid min-h-0 min-w-0 flex-1 grid-cols-1 gap-3 overflow-y-auto @2xl:overflow-hidden", count === 2 ? "@2xl:grid-cols-2" : "@xl:grid-cols-2 @3xl:grid-cols-3"),
1134
+ className: cn2("grid min-h-0 min-w-0 flex-1 content-start grid-cols-1 gap-3 overflow-y-auto pb-2", count === 2 ? "@2xl:grid-cols-2" : "@xl:grid-cols-2 @3xl:grid-cols-3"),
1111
1135
  children: items.map((entry, entryIndex) => /* @__PURE__ */ jsx8(CompareAllPane, {
1112
1136
  item: entry,
1113
1137
  zoom: compareZoom,
@@ -1305,6 +1329,7 @@ function ImageComparisonToolbar({
1305
1329
  differences,
1306
1330
  activeRegionIndex,
1307
1331
  onStepChange,
1332
+ onCommentActiveDifference,
1308
1333
  onPeekChange,
1309
1334
  beforeLabel,
1310
1335
  afterLabel,
@@ -1325,7 +1350,7 @@ function ImageComparisonToolbar({
1325
1350
  "aria-label": "Comparison controls",
1326
1351
  "data-slot": "image-comparison-toolbar",
1327
1352
  "data-density": density,
1328
- className: "flex shrink-0 flex-wrap items-center gap-x-2 gap-y-2 border-b border-border px-panel-sm py-2",
1353
+ className: "flex shrink-0 flex-wrap items-center gap-x-2 gap-y-2 border-b border-border py-2",
1329
1354
  children: [
1330
1355
  /* @__PURE__ */ jsx10(ToolbarSection, {
1331
1356
  title: "Mode",
@@ -1482,8 +1507,13 @@ function ImageComparisonToolbar({
1482
1507
  role: "group",
1483
1508
  "aria-label": "Changed regions",
1484
1509
  "data-slot": "image-comparison-stepper",
1485
- className: "flex items-center gap-1.5",
1510
+ className: "flex flex-wrap items-center gap-1.5",
1486
1511
  children: [
1512
+ /* @__PURE__ */ jsx10("span", {
1513
+ "aria-hidden": "true",
1514
+ className: "text-muted-foreground",
1515
+ children: "·"
1516
+ }),
1487
1517
  /* @__PURE__ */ jsxs8("span", {
1488
1518
  "data-slot": "image-comparison-change-count",
1489
1519
  className: "text-xs whitespace-nowrap text-muted-foreground tabular-nums",
@@ -1511,6 +1541,14 @@ function ImageComparisonToolbar({
1511
1541
  "aria-keyshortcuts": "N",
1512
1542
  onClick: () => onStepChange(1),
1513
1543
  children: /* @__PURE__ */ jsx10(ChevronRightIcon2, {})
1544
+ }),
1545
+ onCommentActiveDifference && /* @__PURE__ */ jsx10(Button2, {
1546
+ variant: "outline",
1547
+ size: "sm",
1548
+ density,
1549
+ "aria-label": `Comment on change ${activeRegionIndex + 1} of ${regionCount}`,
1550
+ onClick: onCommentActiveDifference,
1551
+ children: "Comment"
1514
1552
  })
1515
1553
  ]
1516
1554
  }),
@@ -1537,42 +1575,22 @@ import { jsx as jsx11 } from "react/jsx-runtime";
1537
1575
  function toPercent2(value, total) {
1538
1576
  return `${value / total * 100}%`;
1539
1577
  }
1540
- function ImageDifferenceOverlay({
1541
- diff,
1542
- activeIndex,
1543
- onCommentRegion
1544
- }) {
1545
- const count = diff.regions.length;
1578
+ function ImageDifferenceOverlay({ diff, activeIndex }) {
1546
1579
  return /* @__PURE__ */ jsx11("div", {
1547
1580
  "data-slot": "image-difference-overlay",
1548
- "aria-hidden": onCommentRegion ? undefined : "true",
1581
+ "aria-hidden": "true",
1549
1582
  className: "pointer-events-none absolute inset-0",
1550
- children: diff.regions.map((region, index) => {
1551
- const isNearRight = (region.x + region.width) / diff.width > 0.8;
1552
- return /* @__PURE__ */ jsx11(ImageRegionMarker, {
1553
- "data-slot": "image-difference-region",
1554
- variant: "difference",
1555
- active: index === activeIndex,
1556
- region: {
1557
- left: toPercent2(region.x, diff.width),
1558
- top: toPercent2(region.y, diff.height),
1559
- width: toPercent2(region.width, diff.width),
1560
- height: toPercent2(region.height, diff.height)
1561
- },
1562
- children: onCommentRegion && /* @__PURE__ */ jsx11(ImageRegionMarkerBadge, {
1563
- "data-slot": "image-difference-comment",
1564
- position: isNearRight ? { left: "0", top: "calc(100% + 6px)" } : { left: "calc(100% + 6px)", top: "0" },
1565
- children: /* @__PURE__ */ jsx11(Button2, {
1566
- variant: "secondary",
1567
- size: "xs",
1568
- "aria-label": `Comment on change ${index + 1} of ${count}`,
1569
- onPointerDown: (event) => event.stopPropagation(),
1570
- onClick: () => onCommentRegion(region, index),
1571
- children: "Comment"
1572
- })
1573
- })
1574
- }, `${region.x}:${region.y}:${region.width}:${region.height}`);
1575
- })
1583
+ children: diff.regions.map((region, index) => /* @__PURE__ */ jsx11(ImageRegionMarker, {
1584
+ "data-slot": "image-difference-region",
1585
+ variant: "difference",
1586
+ active: index === activeIndex,
1587
+ region: {
1588
+ left: toPercent2(region.x, diff.width),
1589
+ top: toPercent2(region.y, diff.height),
1590
+ width: toPercent2(region.width, diff.width),
1591
+ height: toPercent2(region.height, diff.height)
1592
+ }
1593
+ }, `${region.x}:${region.y}:${region.width}:${region.height}`))
1576
1594
  });
1577
1595
  }
1578
1596
 
@@ -2008,11 +2026,8 @@ ${after.src}`;
2008
2026
  diff: differences.diff,
2009
2027
  activeIndex: clampedActiveIndex
2010
2028
  }) : null;
2011
- const interactiveDiffOverlay = showDifferences && differences.status === "ready" ? /* @__PURE__ */ jsx13(ImageDifferenceOverlay, {
2012
- diff: differences.diff,
2013
- activeIndex: clampedActiveIndex,
2014
- onCommentRegion: onCommentDifference ? (region, index) => onCommentDifference(region, index, differences.diff) : undefined
2015
- }) : null;
2029
+ const activeRegion = regions[clampedActiveIndex];
2030
+ const handleCommentActiveDifference = onCommentDifference && showDifferences && differences.status === "ready" && activeRegion ? () => onCommentDifference(activeRegion, clampedActiveIndex, differences.diff) : undefined;
2016
2031
  const fallback = failedLabel ? /* @__PURE__ */ jsxs10("p", {
2017
2032
  "data-slot": "image-comparison-error",
2018
2033
  className: "m-auto p-panel text-center text-sm text-muted-foreground",
@@ -2193,7 +2208,7 @@ ${after.src}`;
2193
2208
  children: [
2194
2209
  renderAfterImage(),
2195
2210
  afterOverlay,
2196
- interactiveDiffOverlay
2211
+ diffOverlay
2197
2212
  ]
2198
2213
  })
2199
2214
  })
@@ -2226,7 +2241,7 @@ ${after.src}`;
2226
2241
  renderBeforeImage(undefined, { clipPath: `inset(0 ${100 - position}% 0 0)` }),
2227
2242
  beforeOverlay,
2228
2243
  afterOverlay,
2229
- interactiveDiffOverlay,
2244
+ diffOverlay,
2230
2245
  /* @__PURE__ */ jsx13(ImageSwipeDivider, {
2231
2246
  value: position,
2232
2247
  onValueChange: handlePositionChange,
@@ -2263,7 +2278,7 @@ ${after.src}`;
2263
2278
  renderBeforeImage(isShowingBefore ? undefined : "invisible"),
2264
2279
  beforeOverlay,
2265
2280
  afterOverlay,
2266
- interactiveDiffOverlay,
2281
+ diffOverlay,
2267
2282
  stageOverlay
2268
2283
  ]
2269
2284
  })
@@ -2295,6 +2310,7 @@ ${after.src}`;
2295
2310
  differences,
2296
2311
  activeRegionIndex: clampedActiveIndex,
2297
2312
  onStepChange: stepChange,
2313
+ onCommentActiveDifference: handleCommentActiveDifference,
2298
2314
  onPeekChange: setIsPeeking,
2299
2315
  beforeLabel,
2300
2316
  afterLabel,
@@ -75,7 +75,7 @@ import {
75
75
  } from "../../chunk-7cq1s2ey.js";
76
76
  import {
77
77
  Switch2
78
- } from "../../chunk-m98d89xc.js";
78
+ } from "../../chunk-dv0rz8r9.js";
79
79
  import {
80
80
  Textarea2
81
81
  } from "../../chunk-p51p95er.js";
package/dist/index.js CHANGED
@@ -311,7 +311,7 @@ import {
311
311
  } from "./chunk-7vnpp3ya.js";
312
312
  import {
313
313
  Switch2
314
- } from "./chunk-m98d89xc.js";
314
+ } from "./chunk-dv0rz8r9.js";
315
315
  import {
316
316
  Progress2,
317
317
  ProgressTrack2,
package/dist/prototype.js CHANGED
@@ -2051,7 +2051,7 @@ var program = new Command;
2051
2051
  // package.json
2052
2052
  var package_default = {
2053
2053
  name: "@alexgorbatchev/shadcn",
2054
- version: "0.0.158",
2054
+ version: "0.0.159",
2055
2055
  description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
2056
2056
  license: "MIT",
2057
2057
  repository: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexgorbatchev/shadcn",
3
- "version": "0.0.158",
3
+ "version": "0.0.159",
4
4
  "description": "Sharp, monospace React components with compact, comfortable, and touch densities.",
5
5
  "license": "MIT",
6
6
  "repository": {