@alexgorbatchev/shadcn 0.0.162 → 0.0.163
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/{chunk-zyt63zrh.js → chunk-aw5f97jz.js} +1 -1
- package/dist/{chunk-hev911n9.js → chunk-cjfd69vt.js} +2 -2
- package/dist/{chunk-46p9pkw1.js → chunk-nx931ac3.js} +1 -1
- package/dist/{chunk-y7jv23qt.js → chunk-rghpa4yc.js} +1 -1
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/ScheduleCard.js +2 -2
- package/dist/components/assistant-ui/elements/SettingsPanel.js +2 -2
- package/dist/components/assistant-ui/index.js +4 -4
- package/dist/components/image-viewer/ImageComparison.d.ts +3 -1
- package/dist/components/image-viewer/ImageComparisonToolbar.d.ts +5 -2
- package/dist/components/image-viewer/index.js +110 -83
- package/dist/components/json-render/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/prototype.js +1 -1
- package/package.json +1 -1
|
@@ -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-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-
|
|
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-6 data-[size=default]:w-10 data-[size=sm]:h-4 data-[size=sm]:w-7 data-checked:border-primary data-checked:bg-primary data-unchecked:bg-muted 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.5 block -translate-y-1/2 rounded-xs bg-foreground ring-0 transition-[inset-inline-start,background-color] group-data-[size=default]/switch:size-
|
|
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-4 group-data-[size=sm]/switch:size-2.5 data-checked:bg-primary-foreground group-data-[size=default]/switch:data-checked:start-[calc(100%-1rem-2px)] group-data-[size=sm]/switch:data-checked:start-[calc(100%-0.625rem-2px)]"
|
|
23
23
|
})
|
|
24
24
|
});
|
|
25
25
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ElicitationForm2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-nx931ac3.js";
|
|
4
4
|
import"../../../chunk-vxvaaptq.js";
|
|
5
5
|
import"../../../chunk-kgqe8gpb.js";
|
|
6
|
-
import"../../../chunk-
|
|
6
|
+
import"../../../chunk-cjfd69vt.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-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-rghpa4yc.js";
|
|
4
|
+
import"../../../chunk-cjfd69vt.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-
|
|
3
|
+
} from "../../../chunk-aw5f97jz.js";
|
|
4
4
|
import"../../../chunk-7cq1s2ey.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-cjfd69vt.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-
|
|
234
|
+
import"../../chunk-cjfd69vt.js";
|
|
235
235
|
import {
|
|
236
236
|
ElicitationForm2
|
|
237
|
-
} from "../../chunk-
|
|
237
|
+
} from "../../chunk-nx931ac3.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-
|
|
502
|
+
} from "../../chunk-rghpa4yc.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-
|
|
512
|
+
} from "../../chunk-aw5f97jz.js";
|
|
513
513
|
import {
|
|
514
514
|
SharedConversation2
|
|
515
515
|
} from "../../chunk-fxh3wgg9.js";
|
|
@@ -35,6 +35,8 @@ export interface IImageComparisonProps extends IDensityProps {
|
|
|
35
35
|
onShowDifferencesChange?: (showDifferences: boolean) => void;
|
|
36
36
|
/** Shows the comparison controls. Defaults to true. */
|
|
37
37
|
showToolbar?: boolean;
|
|
38
|
+
/** Uses the incremental zoom control (Fit, Fit width, −, %, +) instead of the two-way Fit/Original toggle. */
|
|
39
|
+
showZoomControl?: boolean;
|
|
38
40
|
/** Further controls in the toolbar row after the comparison controls, such as comment actions. */
|
|
39
41
|
toolbar?: ReactNode;
|
|
40
42
|
/** Content positioned over the before image (before pane in side-by-side, stage in toggle and swipe). */
|
|
@@ -60,4 +62,4 @@ export interface IImageComparisonProps extends IDensityProps {
|
|
|
60
62
|
* inside the after image's box. Highlighting differences compares pixels on first use, caches the result per pair, and
|
|
61
63
|
* steps through changed regions with buttons or N / Shift+N.
|
|
62
64
|
*/
|
|
63
|
-
export declare function ImageComparison({ before, after, beforeLabel, afterLabel, mode: modeProp, defaultMode, onModeChange, side: sideProp, defaultSide, onSideChange, orientation: orientationProp, defaultOrientation, onOrientationChange, zoom: zoomProp, defaultZoom, onZoomChange, showDifferences: showDifferencesProp, defaultShowDifferences, onShowDifferencesChange, showToolbar, toolbar, beforeOverlay, afterOverlay, stageOverlay, onCommentDifference, onSwipePositionChange, onStageKeyDown, stageKeyShortcuts, label, density, }: IImageComparisonProps): ReactElement;
|
|
65
|
+
export declare function ImageComparison({ before, after, beforeLabel, afterLabel, mode: modeProp, defaultMode, onModeChange, side: sideProp, defaultSide, onSideChange, orientation: orientationProp, defaultOrientation, onOrientationChange, zoom: zoomProp, defaultZoom, onZoomChange, showDifferences: showDifferencesProp, defaultShowDifferences, onShowDifferencesChange, showToolbar, showZoomControl, toolbar, beforeOverlay, afterOverlay, stageOverlay, onCommentDifference, onSwipePositionChange, onStageKeyDown, stageKeyShortcuts, label, density, }: IImageComparisonProps): ReactElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { IDensityProps } from "../../density/types.js";
|
|
3
|
-
import type { IImageSize, ImageComparisonMode, ImageComparisonOrientation, ImageComparisonSide, ImageDifferenceState, ImageZoom } from "./types.js";
|
|
3
|
+
import type { IImageSize, IImageZoomScales, ImageComparisonMode, ImageComparisonOrientation, ImageComparisonSide, ImageDifferenceState, ImageZoom } from "./types.js";
|
|
4
4
|
interface IImageComparisonToolbarProps extends IDensityProps {
|
|
5
5
|
mode: ImageComparisonMode;
|
|
6
6
|
onModeChange: (mode: ImageComparisonMode) => void;
|
|
@@ -10,6 +10,9 @@ interface IImageComparisonToolbarProps extends IDensityProps {
|
|
|
10
10
|
onOrientationChange: (orientation: ImageComparisonOrientation) => void;
|
|
11
11
|
zoom: ImageZoom;
|
|
12
12
|
onZoomChange: (zoom: ImageZoom) => void;
|
|
13
|
+
showZoomControl?: boolean;
|
|
14
|
+
zoomScale?: number;
|
|
15
|
+
zoomScales?: IImageZoomScales;
|
|
13
16
|
showDifferences: boolean;
|
|
14
17
|
onShowDifferencesChange: (showDifferences: boolean) => void;
|
|
15
18
|
differences: ImageDifferenceState;
|
|
@@ -24,5 +27,5 @@ interface IImageComparisonToolbarProps extends IDensityProps {
|
|
|
24
27
|
toolbar?: ReactNode;
|
|
25
28
|
}
|
|
26
29
|
/** Comparison controls in a single horizontal wrapping toolbar row above the stage so images get the full width. */
|
|
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;
|
|
30
|
+
export declare function ImageComparisonToolbar({ mode, onModeChange, side, onSideChange, orientation, onOrientationChange, zoom, onZoomChange, showZoomControl, zoomScale, zoomScales, showDifferences, onShowDifferencesChange, differences, activeRegionIndex, onStepChange, onCommentActiveDifference, onPeekChange, beforeLabel, afterLabel, beforeSize, afterSize, toolbar, density, }: IImageComparisonToolbarProps): ReactElement;
|
|
28
31
|
export {};
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
} from "../../chunk-d22t4qx6.js";
|
|
49
49
|
import {
|
|
50
50
|
Switch2
|
|
51
|
-
} from "../../chunk-
|
|
51
|
+
} from "../../chunk-cjfd69vt.js";
|
|
52
52
|
import"../../chunk-5mydsjp3.js";
|
|
53
53
|
|
|
54
54
|
// src/components/image-viewer/ImageViewer.tsx
|
|
@@ -409,25 +409,25 @@ function ImageViewport({
|
|
|
409
409
|
"data-slot": "image-viewport-scroll-hint",
|
|
410
410
|
"data-edge": "left",
|
|
411
411
|
"aria-hidden": "true",
|
|
412
|
-
className: "pointer-events-none absolute inset-y-0 left-0 w-5 bg-gradient-to-r from-black/45 via-black/15 to-transparent dark:from-black/
|
|
412
|
+
className: "pointer-events-none absolute inset-y-0 left-0 w-5 bg-gradient-to-r from-black/45 via-black/15 to-transparent dark:from-black/75 dark:via-black/30 dark:shadow-[inset_8px_0_12px_-8px_rgba(255,255,255,0.28)]"
|
|
413
413
|
}),
|
|
414
414
|
scrollHints.right && /* @__PURE__ */ jsx("div", {
|
|
415
415
|
"data-slot": "image-viewport-scroll-hint",
|
|
416
416
|
"data-edge": "right",
|
|
417
417
|
"aria-hidden": "true",
|
|
418
|
-
className: "pointer-events-none absolute inset-y-0 right-0 w-5 bg-gradient-to-l from-black/45 via-black/15 to-transparent dark:from-black/
|
|
418
|
+
className: "pointer-events-none absolute inset-y-0 right-0 w-5 bg-gradient-to-l from-black/45 via-black/15 to-transparent dark:from-black/75 dark:via-black/30 dark:shadow-[inset_-8px_0_12px_-8px_rgba(255,255,255,0.28)]"
|
|
419
419
|
}),
|
|
420
420
|
scrollHints.top && /* @__PURE__ */ jsx("div", {
|
|
421
421
|
"data-slot": "image-viewport-scroll-hint",
|
|
422
422
|
"data-edge": "top",
|
|
423
423
|
"aria-hidden": "true",
|
|
424
|
-
className: "pointer-events-none absolute inset-x-0 top-0 h-5 bg-gradient-to-b from-black/45 via-black/15 to-transparent dark:from-black/
|
|
424
|
+
className: "pointer-events-none absolute inset-x-0 top-0 h-5 bg-gradient-to-b from-black/45 via-black/15 to-transparent dark:from-black/75 dark:via-black/30 dark:shadow-[inset_0_8px_12px_-8px_rgba(255,255,255,0.28)]"
|
|
425
425
|
}),
|
|
426
426
|
scrollHints.bottom && /* @__PURE__ */ jsx("div", {
|
|
427
427
|
"data-slot": "image-viewport-scroll-hint",
|
|
428
428
|
"data-edge": "bottom",
|
|
429
429
|
"aria-hidden": "true",
|
|
430
|
-
className: "pointer-events-none absolute inset-x-0 bottom-0 h-5 bg-gradient-to-t from-black/45 via-black/15 to-transparent dark:from-black/
|
|
430
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 h-5 bg-gradient-to-t from-black/45 via-black/15 to-transparent dark:from-black/75 dark:via-black/30 dark:shadow-[inset_0_-8px_12px_-8px_rgba(255,255,255,0.28)]"
|
|
431
431
|
})
|
|
432
432
|
]
|
|
433
433
|
});
|
|
@@ -788,7 +788,13 @@ function prepareDiagramSvg(svg, ownerDocument, options) {
|
|
|
788
788
|
imported.style.height = "100%";
|
|
789
789
|
} else {
|
|
790
790
|
imported.removeAttribute("height");
|
|
791
|
-
|
|
791
|
+
if (size.width > 0) {
|
|
792
|
+
imported.setAttribute("width", String(size.width));
|
|
793
|
+
imported.style.width = "100%";
|
|
794
|
+
imported.style.maxWidth = `${size.width}px`;
|
|
795
|
+
} else {
|
|
796
|
+
imported.style.maxWidth = "100%";
|
|
797
|
+
}
|
|
792
798
|
imported.style.height = "auto";
|
|
793
799
|
imported.style.marginInline = "auto";
|
|
794
800
|
}
|
|
@@ -914,7 +920,7 @@ function DiagramViewer({
|
|
|
914
920
|
children: [
|
|
915
921
|
(showZoomControl || toolbar !== undefined) && /* @__PURE__ */ jsxs5("div", {
|
|
916
922
|
"data-slot": "diagram-viewer-toolbar",
|
|
917
|
-
className: "flex shrink-0 flex-wrap items-center gap-control-gap *:shrink-0",
|
|
923
|
+
className: "flex shrink-0 flex-wrap items-center gap-control-gap *:shrink-0 [@media(max-height:280px)]:flex-nowrap [@media(max-height:280px)]:overflow-x-auto",
|
|
918
924
|
children: [
|
|
919
925
|
showZoomControl && /* @__PURE__ */ jsx5(ImageZoomControl, {
|
|
920
926
|
zoom: shownZoom,
|
|
@@ -937,7 +943,7 @@ function DiagramViewer({
|
|
|
937
943
|
stageKeyShortcuts,
|
|
938
944
|
children: /* @__PURE__ */ jsx5("div", {
|
|
939
945
|
"data-slot": "diagram-viewer-frame",
|
|
940
|
-
className: "size-full bg-card
|
|
946
|
+
className: "size-full bg-card",
|
|
941
947
|
children: /* @__PURE__ */ jsx5(DiagramSurface, {
|
|
942
948
|
svg,
|
|
943
949
|
label,
|
|
@@ -1820,6 +1826,9 @@ function ImageComparisonToolbar({
|
|
|
1820
1826
|
onOrientationChange,
|
|
1821
1827
|
zoom,
|
|
1822
1828
|
onZoomChange,
|
|
1829
|
+
showZoomControl = false,
|
|
1830
|
+
zoomScale,
|
|
1831
|
+
zoomScales,
|
|
1823
1832
|
showDifferences,
|
|
1824
1833
|
onShowDifferencesChange,
|
|
1825
1834
|
differences,
|
|
@@ -1846,7 +1855,7 @@ function ImageComparisonToolbar({
|
|
|
1846
1855
|
"aria-label": "Comparison controls",
|
|
1847
1856
|
"data-slot": "image-comparison-toolbar",
|
|
1848
1857
|
"data-density": density,
|
|
1849
|
-
className: "flex shrink-0 flex-wrap items-center gap-
|
|
1858
|
+
className: "flex shrink-0 flex-wrap items-center gap-1.5 border-b border-border py-2",
|
|
1850
1859
|
children: [
|
|
1851
1860
|
/* @__PURE__ */ jsx12(ToolbarSection, {
|
|
1852
1861
|
title: "Mode",
|
|
@@ -1916,20 +1925,28 @@ function ImageComparisonToolbar({
|
|
|
1916
1925
|
children: [
|
|
1917
1926
|
/* @__PURE__ */ jsxs10(ToggleGroupItem2, {
|
|
1918
1927
|
value: "horizontal",
|
|
1928
|
+
"aria-label": "Horizontal",
|
|
1919
1929
|
children: [
|
|
1920
1930
|
/* @__PURE__ */ jsx12(Columns2Icon, {
|
|
1921
1931
|
"data-icon": "inline-start"
|
|
1922
1932
|
}),
|
|
1923
|
-
"
|
|
1933
|
+
/* @__PURE__ */ jsx12("span", {
|
|
1934
|
+
className: "hidden @md:inline",
|
|
1935
|
+
children: "Horizontal"
|
|
1936
|
+
})
|
|
1924
1937
|
]
|
|
1925
1938
|
}),
|
|
1926
1939
|
/* @__PURE__ */ jsxs10(ToggleGroupItem2, {
|
|
1927
1940
|
value: "vertical",
|
|
1941
|
+
"aria-label": "Vertical",
|
|
1928
1942
|
children: [
|
|
1929
1943
|
/* @__PURE__ */ jsx12(Rows2Icon, {
|
|
1930
1944
|
"data-icon": "inline-start"
|
|
1931
1945
|
}),
|
|
1932
|
-
"
|
|
1946
|
+
/* @__PURE__ */ jsx12("span", {
|
|
1947
|
+
className: "hidden @md:inline",
|
|
1948
|
+
children: "Vertical"
|
|
1949
|
+
})
|
|
1933
1950
|
]
|
|
1934
1951
|
})
|
|
1935
1952
|
]
|
|
@@ -1938,7 +1955,13 @@ function ImageComparisonToolbar({
|
|
|
1938
1955
|
/* @__PURE__ */ jsx12(ToolbarSection, {
|
|
1939
1956
|
title: "Zoom",
|
|
1940
1957
|
titleId: `${id}-zoom`,
|
|
1941
|
-
children: /* @__PURE__ */ jsx12(
|
|
1958
|
+
children: showZoomControl ? /* @__PURE__ */ jsx12(ImageZoomControl, {
|
|
1959
|
+
zoom,
|
|
1960
|
+
scale: zoomScale,
|
|
1961
|
+
scales: zoomScales,
|
|
1962
|
+
onZoomChange,
|
|
1963
|
+
density
|
|
1964
|
+
}) : /* @__PURE__ */ jsx12(ImageZoomToggle, {
|
|
1942
1965
|
zoom,
|
|
1943
1966
|
onZoomChange,
|
|
1944
1967
|
density
|
|
@@ -1969,26 +1992,37 @@ function ImageComparisonToolbar({
|
|
|
1969
1992
|
children: `Hold to show ${side === "before" ? "after" : "before"}`
|
|
1970
1993
|
}),
|
|
1971
1994
|
/* @__PURE__ */ jsxs10("div", {
|
|
1972
|
-
className: "flex
|
|
1995
|
+
className: "flex shrink-0 items-center gap-1.5",
|
|
1973
1996
|
children: [
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
children: "Highlight differences"
|
|
1988
|
-
})
|
|
1989
|
-
]
|
|
1997
|
+
/* @__PURE__ */ jsx12(Switch2, {
|
|
1998
|
+
id: `${id}-differences`,
|
|
1999
|
+
"aria-labelledby": `${id}-differences-label`,
|
|
2000
|
+
"aria-describedby": `${id}-differences-status`,
|
|
2001
|
+
checked: showDifferences && !isUnavailable,
|
|
2002
|
+
disabled: isUnavailable,
|
|
2003
|
+
onCheckedChange: onShowDifferencesChange
|
|
2004
|
+
}),
|
|
2005
|
+
/* @__PURE__ */ jsx12("label", {
|
|
2006
|
+
id: `${id}-differences-label`,
|
|
2007
|
+
htmlFor: `${id}-differences`,
|
|
2008
|
+
className: "cursor-pointer text-sm leading-none font-medium whitespace-nowrap select-none",
|
|
2009
|
+
children: "Highlight differences"
|
|
1990
2010
|
}),
|
|
1991
|
-
|
|
2011
|
+
/* @__PURE__ */ jsx12("p", {
|
|
2012
|
+
id: `${id}-differences-status`,
|
|
2013
|
+
role: "status",
|
|
2014
|
+
className: hasStepper || !statusText ? "sr-only" : "text-xs text-muted-foreground",
|
|
2015
|
+
children: statusText
|
|
2016
|
+
})
|
|
2017
|
+
]
|
|
2018
|
+
}),
|
|
2019
|
+
hasStepper && /* @__PURE__ */ jsxs10("div", {
|
|
2020
|
+
role: "group",
|
|
2021
|
+
"aria-label": "Changed regions",
|
|
2022
|
+
"data-slot": "image-comparison-stepper",
|
|
2023
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
2024
|
+
children: [
|
|
2025
|
+
/* @__PURE__ */ jsxs10("span", {
|
|
1992
2026
|
"data-slot": "image-comparison-legend",
|
|
1993
2027
|
className: "flex items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground",
|
|
1994
2028
|
children: [
|
|
@@ -1996,69 +2030,53 @@ function ImageComparisonToolbar({
|
|
|
1996
2030
|
"aria-hidden": "true",
|
|
1997
2031
|
className: "mx-[3px] size-2.5 shrink-0 rounded-xs bg-warning/10 ring-1 ring-background outline-2 outline-offset-1 outline-warning"
|
|
1998
2032
|
}),
|
|
1999
|
-
"
|
|
2033
|
+
/* @__PURE__ */ jsx12("span", {
|
|
2034
|
+
className: "hidden @md:inline",
|
|
2035
|
+
children: "Changed region"
|
|
2036
|
+
})
|
|
2000
2037
|
]
|
|
2001
2038
|
}),
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
"data-slot": "image-comparison-stepper",
|
|
2006
|
-
className: "flex flex-wrap items-center gap-1.5",
|
|
2039
|
+
/* @__PURE__ */ jsxs10("span", {
|
|
2040
|
+
"data-slot": "image-comparison-change-count",
|
|
2041
|
+
className: "text-xs whitespace-nowrap text-muted-foreground tabular-nums",
|
|
2007
2042
|
children: [
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
}),
|
|
2013
|
-
/* @__PURE__ */ jsxs10("span", {
|
|
2014
|
-
"data-slot": "image-comparison-change-count",
|
|
2015
|
-
className: "text-xs whitespace-nowrap text-muted-foreground tabular-nums",
|
|
2016
|
-
children: [
|
|
2017
|
-
"Change ",
|
|
2018
|
-
activeRegionIndex + 1,
|
|
2019
|
-
" of ",
|
|
2020
|
-
regionCount
|
|
2021
|
-
]
|
|
2022
|
-
}),
|
|
2023
|
-
/* @__PURE__ */ jsx12(Button2, {
|
|
2024
|
-
variant: "outline",
|
|
2025
|
-
size: "icon-sm",
|
|
2026
|
-
density,
|
|
2027
|
-
"aria-label": "Previous change",
|
|
2028
|
-
"aria-keyshortcuts": "Shift+N",
|
|
2029
|
-
onClick: () => onStepChange(-1),
|
|
2030
|
-
children: /* @__PURE__ */ jsx12(ChevronLeftIcon2, {})
|
|
2031
|
-
}),
|
|
2032
|
-
/* @__PURE__ */ jsx12(Button2, {
|
|
2033
|
-
variant: "outline",
|
|
2034
|
-
size: "icon-sm",
|
|
2035
|
-
density,
|
|
2036
|
-
"aria-label": "Next change",
|
|
2037
|
-
"aria-keyshortcuts": "N",
|
|
2038
|
-
onClick: () => onStepChange(1),
|
|
2039
|
-
children: /* @__PURE__ */ jsx12(ChevronRightIcon2, {})
|
|
2040
|
-
}),
|
|
2041
|
-
onCommentActiveDifference && /* @__PURE__ */ jsx12(Button2, {
|
|
2042
|
-
variant: "outline",
|
|
2043
|
-
size: "sm",
|
|
2044
|
-
density,
|
|
2045
|
-
"aria-label": `Comment on change ${activeRegionIndex + 1} of ${regionCount}`,
|
|
2046
|
-
onClick: onCommentActiveDifference,
|
|
2047
|
-
children: "Comment on change"
|
|
2048
|
-
})
|
|
2043
|
+
"Change ",
|
|
2044
|
+
activeRegionIndex + 1,
|
|
2045
|
+
" of ",
|
|
2046
|
+
regionCount
|
|
2049
2047
|
]
|
|
2050
2048
|
}),
|
|
2051
|
-
/* @__PURE__ */ jsx12(
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2049
|
+
/* @__PURE__ */ jsx12(Button2, {
|
|
2050
|
+
variant: "outline",
|
|
2051
|
+
size: "icon-sm",
|
|
2052
|
+
density,
|
|
2053
|
+
"aria-label": "Previous change",
|
|
2054
|
+
"aria-keyshortcuts": "Shift+N",
|
|
2055
|
+
onClick: () => onStepChange(-1),
|
|
2056
|
+
children: /* @__PURE__ */ jsx12(ChevronLeftIcon2, {})
|
|
2057
|
+
}),
|
|
2058
|
+
/* @__PURE__ */ jsx12(Button2, {
|
|
2059
|
+
variant: "outline",
|
|
2060
|
+
size: "icon-sm",
|
|
2061
|
+
density,
|
|
2062
|
+
"aria-label": "Next change",
|
|
2063
|
+
"aria-keyshortcuts": "N",
|
|
2064
|
+
onClick: () => onStepChange(1),
|
|
2065
|
+
children: /* @__PURE__ */ jsx12(ChevronRightIcon2, {})
|
|
2066
|
+
}),
|
|
2067
|
+
onCommentActiveDifference && /* @__PURE__ */ jsx12(Button2, {
|
|
2068
|
+
variant: "outline",
|
|
2069
|
+
size: "sm",
|
|
2070
|
+
density,
|
|
2071
|
+
"aria-label": `Comment on change ${activeRegionIndex + 1} of ${regionCount}`,
|
|
2072
|
+
onClick: onCommentActiveDifference,
|
|
2073
|
+
children: "Comment on change"
|
|
2056
2074
|
})
|
|
2057
2075
|
]
|
|
2058
2076
|
}),
|
|
2059
2077
|
toolbar && /* @__PURE__ */ jsx12("div", {
|
|
2060
2078
|
"data-slot": "image-comparison-toolbar-extra",
|
|
2061
|
-
className: "flex min-w-0 flex-wrap items-center gap-
|
|
2079
|
+
className: "flex min-w-0 flex-wrap items-center gap-1.5",
|
|
2062
2080
|
children: toolbar
|
|
2063
2081
|
}),
|
|
2064
2082
|
sizeMismatch && /* @__PURE__ */ jsx12("p", {
|
|
@@ -2441,6 +2459,7 @@ function ImageComparison({
|
|
|
2441
2459
|
defaultShowDifferences = false,
|
|
2442
2460
|
onShowDifferencesChange,
|
|
2443
2461
|
showToolbar = true,
|
|
2462
|
+
showZoomControl = false,
|
|
2444
2463
|
toolbar,
|
|
2445
2464
|
beforeOverlay,
|
|
2446
2465
|
afterOverlay,
|
|
@@ -2507,6 +2526,11 @@ ${after.src}`;
|
|
|
2507
2526
|
const expectedScrollRef = useRef8(new WeakMap);
|
|
2508
2527
|
const center = useRef8({ x: 0.5, y: 0.5 });
|
|
2509
2528
|
const stageSize = useElementSize(stageRef);
|
|
2529
|
+
const singleViewportSize = useElementSize(singleViewportRef);
|
|
2530
|
+
const afterViewportSize = useElementSize(afterViewportRef);
|
|
2531
|
+
const activeViewportSize = mode === "side-by-side" ? afterViewportSize : singleViewportSize;
|
|
2532
|
+
const zoomScales = afterImage.size && activeViewportSize ? getImageZoomScales(afterImage.size, activeViewportSize) : undefined;
|
|
2533
|
+
const zoomScale = zoomScales ? resolveImageZoomScale(zoom, zoomScales) : undefined;
|
|
2510
2534
|
const autoOrientation = stageSize && stageSize.height > stageSize.width ? "vertical" : "horizontal";
|
|
2511
2535
|
const orientation = chosenOrientation ?? autoOrientation;
|
|
2512
2536
|
const failedLabel = afterImage.status === "error" ? afterLabel : beforeImage.status === "error" ? beforeLabel : undefined;
|
|
@@ -2805,6 +2829,9 @@ ${after.src}`;
|
|
|
2805
2829
|
onOrientationChange: setOrientation,
|
|
2806
2830
|
zoom,
|
|
2807
2831
|
onZoomChange: setZoom,
|
|
2832
|
+
showZoomControl,
|
|
2833
|
+
zoomScale,
|
|
2834
|
+
zoomScales,
|
|
2808
2835
|
showDifferences,
|
|
2809
2836
|
onShowDifferencesChange: setShowDifferences,
|
|
2810
2837
|
differences,
|
package/dist/index.js
CHANGED
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.
|
|
2054
|
+
version: "0.0.163",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact, comfortable, and touch densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|