@alexgorbatchev/shadcn 0.0.154 → 0.0.156
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-9e1yb90r.js → chunk-5ez5vgkn.js} +2 -2
- package/dist/{chunk-a08meqj4.js → chunk-g2amqz9q.js} +16 -13
- package/dist/{chunk-ncskzkqr.js → chunk-hbhpnc1m.js} +1 -1
- package/dist/{chunk-v64bc7ky.js → chunk-j6mh013a.js} +1 -1
- package/dist/{chunk-5q0670jv.js → chunk-tgkc06q4.js} +1 -1
- package/dist/{chunk-ywr2pqhc.js → chunk-xndv627n.js} +1 -1
- package/dist/components/Field.d.ts +5 -2
- package/dist/components/assistant-ui/elements/EditMessage.js +2 -2
- package/dist/components/assistant-ui/elements/ElicitationForm.js +2 -2
- package/dist/components/assistant-ui/elements/FeedbackDialog.js +2 -2
- package/dist/components/assistant-ui/elements/ModelPicker.js +2 -2
- package/dist/components/assistant-ui/index.js +5 -5
- package/dist/components/event-calendar/index.js +1 -1
- package/dist/components/image-viewer/ImageComparison.d.ts +23 -6
- package/dist/components/image-viewer/ImageComparisonToolbar.d.ts +6 -3
- package/dist/components/image-viewer/ImageDifferenceOverlay.d.ts +6 -2
- package/dist/components/image-viewer/ImageGallery.d.ts +16 -4
- package/dist/components/image-viewer/ImageRegionMarker.d.ts +3 -1
- package/dist/components/image-viewer/ImageRegionSelect.d.ts +4 -2
- package/dist/components/image-viewer/index.js +595 -206
- package/dist/components/input-otp/index.js +1 -1
- package/dist/components/json-render/index.js +2 -2
- package/dist/components/text-diff/index.js +5 -4
- package/dist/components/tree/Tree.d.ts +3 -1
- package/dist/components/tree/TreeItem.d.ts +3 -1
- package/dist/components/tree/TreeSelect.d.ts +3 -1
- package/dist/components/tree/index.js +18 -6
- package/dist/index.js +2 -2
- package/dist/prototype.js +1 -1
- package/llms/components/data-display/ImageComparison.md +14 -1
- package/llms/components/data-display/ImageGallery.md +9 -1
- package/llms/components/navigation/TreeSelect.md +10 -0
- package/llms.txt +2 -2
- package/package.json +1 -1
|
@@ -50,13 +50,13 @@ var fieldVariants = cva("group/field flex w-full gap-2 data-[invalid=true]:text-
|
|
|
50
50
|
orientation: "vertical"
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
|
-
function Field2({ density, className, orientation = "vertical", ...props }) {
|
|
53
|
+
function Field2({ density, className, orientation = "vertical", grow = false, ...props }) {
|
|
54
54
|
return /* @__PURE__ */ jsx("div", {
|
|
55
55
|
role: "group",
|
|
56
56
|
"data-density": density,
|
|
57
57
|
"data-slot": "field",
|
|
58
58
|
"data-orientation": orientation,
|
|
59
|
-
className: cn2(fieldVariants({ orientation }), className),
|
|
59
|
+
className: cn2(fieldVariants({ orientation }), grow && "min-h-0 flex-1", className),
|
|
60
60
|
...props
|
|
61
61
|
});
|
|
62
62
|
}
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
Field2,
|
|
72
72
|
FieldLabel2,
|
|
73
73
|
FieldDescription2
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5ez5vgkn.js";
|
|
75
75
|
import {
|
|
76
76
|
Textarea2
|
|
77
77
|
} from "./chunk-p51p95er.js";
|
|
@@ -351,19 +351,22 @@ function FormDialog2({
|
|
|
351
351
|
const isFullscreen = size === "fullscreen";
|
|
352
352
|
const body = /* @__PURE__ */ jsxs2(Fragment, {
|
|
353
353
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ jsx4(ScrollArea2, {
|
|
355
355
|
density,
|
|
356
356
|
grow: isFullscreen,
|
|
357
|
-
children:
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
357
|
+
children: /* @__PURE__ */ jsxs2("div", {
|
|
358
|
+
className: cn2("flex flex-col gap-panel", isFullscreen && "min-h-full"),
|
|
359
|
+
children: [
|
|
360
|
+
children,
|
|
361
|
+
error && /* @__PURE__ */ jsx4(Alert2, {
|
|
362
|
+
variant: "destructive",
|
|
363
|
+
density,
|
|
364
|
+
children: /* @__PURE__ */ jsx4(AlertDescription2, {
|
|
365
|
+
children: error
|
|
366
|
+
})
|
|
364
367
|
})
|
|
365
|
-
|
|
366
|
-
|
|
368
|
+
]
|
|
369
|
+
})
|
|
367
370
|
}),
|
|
368
371
|
/* @__PURE__ */ jsxs2(DialogFooter2, {
|
|
369
372
|
density,
|
|
@@ -1682,7 +1685,7 @@ function BreadcrumbLink2({ analytics, density, className, render, ...props }) {
|
|
|
1682
1685
|
return useRender3({
|
|
1683
1686
|
defaultTagName: "a",
|
|
1684
1687
|
props: mergeProps3({
|
|
1685
|
-
className: cn2("inline-block cursor-pointer border-b border-input leading-6 transition-colors hover:border-foreground hover:text-foreground", className)
|
|
1688
|
+
className: cn2("inline-block cursor-pointer rounded-xs border-b border-input px-0.5 -mx-0.5 leading-6 transition-colors outline-none hover:border-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring", className)
|
|
1686
1689
|
}, { ...props, onClick }),
|
|
1687
1690
|
render,
|
|
1688
1691
|
state: {
|
|
@@ -1909,7 +1912,7 @@ function Item2({
|
|
|
1909
1912
|
}
|
|
1910
1913
|
});
|
|
1911
1914
|
}
|
|
1912
|
-
var itemMediaVariants = cva2("flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none", {
|
|
1915
|
+
var itemMediaVariants = cva2("flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&:last-child:not(:first-child)]:translate-y-0 [&:last-child:not(:first-child)]:self-center [&_svg]:pointer-events-none", {
|
|
1913
1916
|
variants: {
|
|
1914
1917
|
variant: {
|
|
1915
1918
|
default: "bg-transparent",
|
|
@@ -15,8 +15,11 @@ declare function FieldGroup({ density, className, columns, ...props }: FieldGrou
|
|
|
15
15
|
declare const fieldVariants: (props?: ({
|
|
16
16
|
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
17
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
-
type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants> & IDensityProps
|
|
19
|
-
|
|
18
|
+
type FieldProps = ComponentProps<"div"> & VariantProps<typeof fieldVariants> & IDensityProps & {
|
|
19
|
+
/** Stretch inside a flex container (for example, a fullscreen FormDialog holding a growing picker). */
|
|
20
|
+
grow?: boolean;
|
|
21
|
+
};
|
|
22
|
+
declare function Field({ density, className, orientation, grow, ...props }: FieldProps): ReactElement;
|
|
20
23
|
type FieldContentProps = ComponentProps<"div"> & IDensityProps;
|
|
21
24
|
declare function FieldContent({ density, className, ...props }: FieldContentProps): ReactElement;
|
|
22
25
|
type FieldLabelProps = ComponentProps<typeof Label> & IDensityProps & {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EditMessage2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-tgkc06q4.js";
|
|
4
4
|
import"../../../chunk-vxvaaptq.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-5ez5vgkn.js";
|
|
6
6
|
import"../../../chunk-jc3cbwyg.js";
|
|
7
7
|
import"../../../chunk-4m2x9jfb.js";
|
|
8
8
|
import"../../../chunk-p51p95er.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ElicitationForm2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-hbhpnc1m.js";
|
|
4
4
|
import"../../../chunk-vxvaaptq.js";
|
|
5
5
|
import"../../../chunk-kgqe8gpb.js";
|
|
6
6
|
import"../../../chunk-m98d89xc.js";
|
|
7
|
-
import"../../../chunk-
|
|
7
|
+
import"../../../chunk-5ez5vgkn.js";
|
|
8
8
|
import"../../../chunk-jc3cbwyg.js";
|
|
9
9
|
import"../../../chunk-4m2x9jfb.js";
|
|
10
10
|
import"../../../chunk-7vg045gd.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FeedbackDialog2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-j6mh013a.js";
|
|
4
4
|
import"../../../chunk-pbyj8rja.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-5ez5vgkn.js";
|
|
6
6
|
import"../../../chunk-jc3cbwyg.js";
|
|
7
7
|
import"../../../chunk-4m2x9jfb.js";
|
|
8
8
|
import"../../../chunk-p51p95er.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ModelPicker2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-xndv627n.js";
|
|
4
4
|
import"../../../chunk-kgqe8gpb.js";
|
|
5
|
-
import"../../../chunk-
|
|
5
|
+
import"../../../chunk-5ez5vgkn.js";
|
|
6
6
|
import"../../../chunk-jc3cbwyg.js";
|
|
7
7
|
import"../../../chunk-dbe9ppwf.js";
|
|
8
8
|
import"../../../chunk-4m2x9jfb.js";
|
|
@@ -226,15 +226,15 @@ import {
|
|
|
226
226
|
} from "../../chunk-fvxzrt3b.js";
|
|
227
227
|
import"../../chunk-4m2x9jfb.js";
|
|
228
228
|
import"../../chunk-52aadmkc.js";
|
|
229
|
-
import"../../chunk-
|
|
229
|
+
import"../../chunk-5ez5vgkn.js";
|
|
230
230
|
import {
|
|
231
231
|
EditMessage2
|
|
232
|
-
} from "../../chunk-
|
|
232
|
+
} from "../../chunk-tgkc06q4.js";
|
|
233
233
|
import"../../chunk-kgqe8gpb.js";
|
|
234
234
|
import"../../chunk-m98d89xc.js";
|
|
235
235
|
import {
|
|
236
236
|
ElicitationForm2
|
|
237
|
-
} from "../../chunk-
|
|
237
|
+
} from "../../chunk-hbhpnc1m.js";
|
|
238
238
|
import"../../chunk-4e96tpw0.js";
|
|
239
239
|
import {
|
|
240
240
|
EmptyState2
|
|
@@ -262,7 +262,7 @@ import {
|
|
|
262
262
|
import"../../chunk-pbyj8rja.js";
|
|
263
263
|
import {
|
|
264
264
|
FeedbackDialog2
|
|
265
|
-
} from "../../chunk-
|
|
265
|
+
} from "../../chunk-j6mh013a.js";
|
|
266
266
|
import {
|
|
267
267
|
FileRoot2,
|
|
268
268
|
FileIconDisplay2,
|
|
@@ -373,7 +373,7 @@ import {
|
|
|
373
373
|
} from "../../chunk-k872qrgx.js";
|
|
374
374
|
import {
|
|
375
375
|
ModelPicker2
|
|
376
|
-
} from "../../chunk-
|
|
376
|
+
} from "../../chunk-xndv627n.js";
|
|
377
377
|
import"../../chunk-kp3jgjng.js";
|
|
378
378
|
import {
|
|
379
379
|
ModelSelectorRoot2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
1
|
+
import { type KeyboardEvent, type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { IDensityProps } from "../../density/types.js";
|
|
3
|
-
import type { IImageComparisonSource, ImageComparisonMode, ImageComparisonOrientation, ImageComparisonSide, ImageZoom } from "./types.js";
|
|
3
|
+
import type { IImageComparisonSource, IImageDiff, IImageDiffRegion, ImageComparisonMode, ImageComparisonOrientation, ImageComparisonSide, ImageZoom } from "./types.js";
|
|
4
4
|
export interface IImageComparisonProps extends IDensityProps {
|
|
5
5
|
before: IImageComparisonSource;
|
|
6
6
|
after: IImageComparisonSource;
|
|
@@ -18,9 +18,9 @@ export interface IImageComparisonProps extends IDensityProps {
|
|
|
18
18
|
/** Initial image shown in `toggle` mode when uncontrolled. Defaults to `after`. */
|
|
19
19
|
defaultSide?: ImageComparisonSide;
|
|
20
20
|
onSideChange?: (side: ImageComparisonSide) => void;
|
|
21
|
-
/** Controlled side-by-side arrangement. */
|
|
21
|
+
/** Controlled side-by-side arrangement. Omit to choose from the stage shape (vertical when taller than wide). */
|
|
22
22
|
orientation?: ImageComparisonOrientation;
|
|
23
|
-
/** Initial side-by-side arrangement when uncontrolled.
|
|
23
|
+
/** Initial side-by-side arrangement when uncontrolled. Omit to choose automatically from the stage shape. */
|
|
24
24
|
defaultOrientation?: ImageComparisonOrientation;
|
|
25
25
|
onOrientationChange?: (orientation: ImageComparisonOrientation) => void;
|
|
26
26
|
/** Controlled zoom shared by every mode. */
|
|
@@ -35,12 +35,29 @@ 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
|
+
/** Further controls in the toolbar row after the comparison controls, such as comment actions. */
|
|
39
|
+
toolbar?: ReactNode;
|
|
40
|
+
/** Content positioned over the before image (before pane in side-by-side, stage in toggle and swipe). */
|
|
41
|
+
beforeOverlay?: ReactNode;
|
|
42
|
+
/** Content positioned over the after image (after pane in side-by-side, stage in toggle and swipe). */
|
|
43
|
+
afterOverlay?: ReactNode;
|
|
44
|
+
/** Content positioned above the single stage in toggle and swipe modes, such as an active region tool. */
|
|
45
|
+
stageOverlay?: ReactNode;
|
|
46
|
+
/** Renders a Comment button on each highlighted changed region and calls this when activated. */
|
|
47
|
+
onCommentDifference?: (region: IImageDiffRegion, index: number, diff: IImageDiff) => void;
|
|
48
|
+
/** Receives swipe divider position updates (0–100, percent showing the before image). */
|
|
49
|
+
onSwipePositionChange?: (position: number) => void;
|
|
50
|
+
/** Runs before the stage keys while a comparison viewport has focus; call `preventDefault()` to replace a key. */
|
|
51
|
+
onStageKeyDown?: (event: KeyboardEvent<HTMLDivElement>, side: ImageComparisonSide) => void;
|
|
52
|
+
/** Further `aria-keyshortcuts` handled through `onStageKeyDown`, such as "R Enter". */
|
|
53
|
+
stageKeyShortcuts?: string;
|
|
38
54
|
/** Accessible name of the comparison. Defaults to "Image comparison". */
|
|
39
55
|
label?: string;
|
|
40
56
|
}
|
|
41
57
|
/**
|
|
42
58
|
* Compares before and after images by toggling, swiping a divider, or showing them side by side. Every mode starts
|
|
43
59
|
* fitted to the available space and offers original size with scrolling. A differently sized before image is drawn
|
|
44
|
-
* inside the after image's box. Highlighting differences compares pixels on first use
|
|
60
|
+
* inside the after image's box. Highlighting differences compares pixels on first use, caches the result per pair, and
|
|
61
|
+
* steps through changed regions with buttons or N / Shift+N.
|
|
45
62
|
*/
|
|
46
|
-
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, label, density, }: IImageComparisonProps): ReactElement;
|
|
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactElement } from "react";
|
|
1
|
+
import { type ReactElement, type ReactNode } from "react";
|
|
2
2
|
import type { IDensityProps } from "../../density/types.js";
|
|
3
3
|
import type { IImageSize, ImageComparisonMode, ImageComparisonOrientation, ImageComparisonSide, ImageDifferenceState, ImageZoom } from "./types.js";
|
|
4
4
|
interface IImageComparisonToolbarProps extends IDensityProps {
|
|
@@ -13,12 +13,15 @@ interface IImageComparisonToolbarProps extends IDensityProps {
|
|
|
13
13
|
showDifferences: boolean;
|
|
14
14
|
onShowDifferencesChange: (showDifferences: boolean) => void;
|
|
15
15
|
differences: ImageDifferenceState;
|
|
16
|
+
activeRegionIndex: number;
|
|
17
|
+
onStepChange: (delta: -1 | 1) => void;
|
|
16
18
|
onPeekChange: (isPeeking: boolean) => void;
|
|
17
19
|
beforeLabel: string;
|
|
18
20
|
afterLabel: string;
|
|
19
21
|
beforeSize?: IImageSize;
|
|
20
22
|
afterSize?: IImageSize;
|
|
23
|
+
toolbar?: ReactNode;
|
|
21
24
|
}
|
|
22
|
-
/** Comparison controls
|
|
23
|
-
export declare function ImageComparisonToolbar({ mode, onModeChange, side, onSideChange, orientation, onOrientationChange, zoom, onZoomChange, showDifferences, onShowDifferencesChange, differences, onPeekChange, beforeLabel, afterLabel, beforeSize, afterSize, density, }: IImageComparisonToolbarProps): ReactElement;
|
|
25
|
+
/** 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;
|
|
24
27
|
export {};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
|
-
import type { IImageDiff } from "./types.js";
|
|
2
|
+
import type { IImageDiff, IImageDiffRegion } from "./types.js";
|
|
3
3
|
interface IImageDifferenceOverlayProps {
|
|
4
4
|
diff: IImageDiff;
|
|
5
|
+
/** Index of the currently stepped-to changed region, emphasized more strongly than the rest. */
|
|
6
|
+
activeIndex?: number;
|
|
7
|
+
/** Renders a compact Comment affordance on each outlined changed region when provided. */
|
|
8
|
+
onCommentRegion?: (region: IImageDiffRegion, index: number) => void;
|
|
5
9
|
}
|
|
6
10
|
/** Outlines changed regions over the after image box; percentages keep the outlines aligned at every zoom level. */
|
|
7
|
-
export declare function ImageDifferenceOverlay({ diff }: IImageDifferenceOverlayProps): ReactElement;
|
|
11
|
+
export declare function ImageDifferenceOverlay({ diff, activeIndex, onCommentRegion, }: IImageDifferenceOverlayProps): ReactElement;
|
|
8
12
|
export {};
|
|
@@ -31,11 +31,23 @@ export interface IImageGalleryProps extends IDensityProps {
|
|
|
31
31
|
onStageKeyDown?: (event: KeyboardEvent<HTMLDivElement>) => void;
|
|
32
32
|
/** Further `aria-keyshortcuts` of the stage, such as "R". */
|
|
33
33
|
stageKeyShortcuts?: string;
|
|
34
|
+
/** Controlled side-by-side mode showing every item together with synchronized scrolling. */
|
|
35
|
+
compareAll?: boolean;
|
|
36
|
+
/** Initial side-by-side mode when uncontrolled. Defaults to `false`. */
|
|
37
|
+
defaultCompareAll?: boolean;
|
|
38
|
+
onCompareAllChange?: (compareAll: boolean) => void;
|
|
39
|
+
/** Offers the Compare all toggle when there are at least two items. Enabled automatically when `renderItemFooter`, `compareAll`, or `onCompareAllChange` is passed. */
|
|
40
|
+
allowCompareAll?: boolean;
|
|
41
|
+
/** Label of the Compare all toggle button. Defaults to "Compare all". */
|
|
42
|
+
compareAllLabel?: string;
|
|
43
|
+
/** Footer rendered below each item in Compare all mode, such as a per-option Choose button. */
|
|
44
|
+
renderItemFooter?: (item: IImageGalleryItem, index: number) => ReactNode;
|
|
34
45
|
}
|
|
35
46
|
/**
|
|
36
47
|
* Steps through a set of images in one `ImageViewer`, keeping its zoom and viewed position, so the same area of each
|
|
37
|
-
* image can be compared. The toolbar holds the zoom bar, Previous, "2 of 3" and Next,
|
|
38
|
-
* step on the focused stage only at Fit, where arrows do not pan.
|
|
39
|
-
*
|
|
48
|
+
* image can be compared. The toolbar holds the zoom bar, Previous, "2 of 3" and Next, an optional Compare all toggle,
|
|
49
|
+
* then `toolbar`; Left and Right step on the focused stage only at Fit, where arrows do not pan. Compare all shows
|
|
50
|
+
* every item side by side with synchronized scrolling and optional per-item footers. Compose it inside `MediaShell`
|
|
51
|
+
* and name the shell after the shown item.
|
|
40
52
|
*/
|
|
41
|
-
export declare function ImageGallery({ items, index, onIndexChange, openingWidth, label, previousLabel, nextLabel, toolbar, overlay, imageRef, stageRef, onStageKeyDown, stageKeyShortcuts, density, }: IImageGalleryProps): ReactElement;
|
|
53
|
+
export declare function ImageGallery({ items, index, onIndexChange, openingWidth, label, previousLabel, nextLabel, toolbar, overlay, imageRef, stageRef, onStageKeyDown, stageKeyShortcuts, compareAll: compareAllProp, defaultCompareAll, onCompareAllChange, allowCompareAll, compareAllLabel, renderItemFooter, density, }: IImageGalleryProps): ReactElement;
|
|
@@ -21,6 +21,8 @@ export interface IImageRegionBadgePosition {
|
|
|
21
21
|
export interface IImageRegionMarkerProps extends ComponentProps<"div"> {
|
|
22
22
|
/** Which kind of region the marker outlines. Defaults to `comment`. */
|
|
23
23
|
variant?: ImageRegionMarkerVariant;
|
|
24
|
+
/** Emphasizes the currently focused or stepped-to marker above its siblings. */
|
|
25
|
+
active?: boolean;
|
|
24
26
|
/** The region's box inside the positioned image box. Lets consumers place the marker without passing `style`. */
|
|
25
27
|
region?: IImageRegionBox;
|
|
26
28
|
}
|
|
@@ -29,7 +31,7 @@ export interface IImageRegionMarkerProps extends ComponentProps<"div"> {
|
|
|
29
31
|
* any CSS length, such as percentages of the positioned image box). Children render inside the marker's box, such as
|
|
30
32
|
* an `ImageRegionMarkerBadge` pinned to one of its corners.
|
|
31
33
|
*/
|
|
32
|
-
export declare function ImageRegionMarker({ variant, region, className, style, ...props }: IImageRegionMarkerProps): ReactElement;
|
|
34
|
+
export declare function ImageRegionMarker({ variant, active, region, className, style, ...props }: IImageRegionMarkerProps): ReactElement;
|
|
33
35
|
export interface IImageRegionMarkerBadgeProps extends ComponentProps<"div"> {
|
|
34
36
|
/** Where the badge sits relative to its marker's box. */
|
|
35
37
|
position?: IImageRegionBadgePosition;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
|
-
import type { IImageRect } from "./types.js";
|
|
2
|
+
import type { IImageRect, INormalizedImagePoint } from "./types.js";
|
|
3
3
|
export interface IImageRegionSelectProps {
|
|
4
4
|
/** The placed region, drawn until it changes or is removed. */
|
|
5
5
|
region?: IImageRect;
|
|
6
6
|
/** Receives each placed region in normalized image coordinates, each value from 0 to 1. */
|
|
7
7
|
onRegionChange: (region: IImageRect) => void;
|
|
8
|
+
/** Runs when a new drag or click starts on the image, with its normalized start point. */
|
|
9
|
+
onStart?: (point: INormalizedImagePoint) => void;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Region tool for an `ImageViewer` overlay. A drag with one pointer draws a region; a click without a drag places a
|
|
@@ -14,4 +16,4 @@ export interface IImageRegionSelectProps {
|
|
|
14
16
|
* turned a region tool on, so pans and pinches stay navigation otherwise. Its pointer is kept from panning the stage; a
|
|
15
17
|
* second finger cancels the drawing and pinch-zooms instead.
|
|
16
18
|
*/
|
|
17
|
-
export declare function ImageRegionSelect({ region, onRegionChange }: IImageRegionSelectProps): ReactElement;
|
|
19
|
+
export declare function ImageRegionSelect({ region, onRegionChange, onStart }: IImageRegionSelectProps): ReactElement;
|