@alexgorbatchev/shadcn 0.0.88 → 0.0.90
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-e6mnfecj.js → chunk-dbxmw9ya.js} +12 -2
- package/dist/{chunk-k8119w3b.js → chunk-kr38ww4n.js} +1 -1
- package/dist/{chunk-tpesmyp0.js → chunk-yd3h2yx1.js} +1 -1
- package/dist/components/MenuParts.d.ts +1 -1
- package/dist/components/assistant-ui/elements/RegenerateMenu.js +2 -2
- package/dist/components/assistant-ui/index.js +2 -2
- package/dist/components/image-viewer/ImageRegionMarker.d.ts +24 -0
- package/dist/components/image-viewer/index.d.ts +2 -0
- package/dist/components/image-viewer/index.js +60 -29
- package/dist/components/json-render/index.js +2 -2
- package/dist/index.js +2 -2
- package/dist/menu/types.d.ts +6 -0
- package/dist/prototype.js +1 -1
- package/dist/theme.css +17 -0
- package/llms/components/data-display/ImageRegionMarker.md +89 -0
- package/llms/components/navigation/DropdownMenu.md +29 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -78,7 +78,7 @@ import { Menu as MenuPrimitive2 } from "@base-ui/react/menu";
|
|
|
78
78
|
import { ChevronRightIcon, CheckIcon } from "lucide-react";
|
|
79
79
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
80
80
|
"use client";
|
|
81
|
-
var menuItemClassName = "group/menu-item relative flex cursor-default items-center data-has-reason:flex-wrap data-has-reason:data-disabled:pointer-events-auto data-has-reason:data-disabled:opacity-100 data-has-reason:data-disabled:text-muted-foreground gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
|
|
81
|
+
var menuItemClassName = "group/menu-item relative flex cursor-default items-center data-has-description:flex-wrap data-has-reason:flex-wrap data-has-reason:data-disabled:pointer-events-auto data-has-reason:data-disabled:opacity-100 data-has-reason:data-disabled:text-muted-foreground gap-control-gap rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:ps-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive";
|
|
82
82
|
function MenuGroup2({ ...props }) {
|
|
83
83
|
return /* @__PURE__ */ jsx2(MenuPrimitive2.Group, {
|
|
84
84
|
"data-slot": "menu-group",
|
|
@@ -100,12 +100,14 @@ function MenuItem2({
|
|
|
100
100
|
className,
|
|
101
101
|
inset,
|
|
102
102
|
variant = "default",
|
|
103
|
+
description,
|
|
103
104
|
disabledReason,
|
|
104
105
|
onDisabledSelect,
|
|
105
106
|
children,
|
|
106
107
|
...props
|
|
107
108
|
}) {
|
|
108
109
|
const trackedOnClick = useAnalyticsCallback("MenuItem", analytics, { name: "ui.activate" }, props.onClick);
|
|
110
|
+
const descriptionId = useId();
|
|
109
111
|
const reasonId = useId();
|
|
110
112
|
const disabledSelect = disabledReason ? {
|
|
111
113
|
onClickCapture: (event) => {
|
|
@@ -124,15 +126,23 @@ function MenuItem2({
|
|
|
124
126
|
"data-slot": "menu-item",
|
|
125
127
|
"data-inset": inset,
|
|
126
128
|
"data-variant": variant,
|
|
129
|
+
"data-has-description": description ? "" : undefined,
|
|
127
130
|
"data-has-reason": disabledReason ? "" : undefined,
|
|
128
131
|
className: (state) => cn2(menuItemClassName, typeof className === "function" ? className(state) : className),
|
|
129
132
|
...props,
|
|
130
133
|
disabled: Boolean(disabledReason) || props.disabled,
|
|
131
|
-
"aria-describedby": [props["aria-describedby"], disabledReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined,
|
|
134
|
+
"aria-describedby": [props["aria-describedby"], description ? descriptionId : undefined, disabledReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined,
|
|
132
135
|
onClick: trackedOnClick,
|
|
133
136
|
...disabledSelect,
|
|
134
137
|
children: [
|
|
135
138
|
children,
|
|
139
|
+
description && /* @__PURE__ */ jsx2("span", {
|
|
140
|
+
id: descriptionId,
|
|
141
|
+
"aria-hidden": true,
|
|
142
|
+
"data-slot": "menu-item-description",
|
|
143
|
+
className: "basis-full text-xs text-muted-foreground group-has-[>svg]/menu-item:ps-6",
|
|
144
|
+
children: description
|
|
145
|
+
}),
|
|
136
146
|
disabledReason && /* @__PURE__ */ jsx2("span", {
|
|
137
147
|
id: reasonId,
|
|
138
148
|
"data-slot": "menu-item-reason",
|
|
@@ -5,7 +5,7 @@ import { type ComponentProps, type ReactElement } from "react";
|
|
|
5
5
|
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
6
6
|
declare function MenuGroup({ ...props }: MenuPrimitive.Group.Props): ReactElement;
|
|
7
7
|
declare function MenuLabel({ density, className, inset, ...props }: MenuLabelProps): ReactElement;
|
|
8
|
-
declare function MenuItem({ analytics, density, className, inset, variant, disabledReason, onDisabledSelect, children, ...props }: MenuItemProps & IAnalyticsProps): ReactElement;
|
|
8
|
+
declare function MenuItem({ analytics, density, className, inset, variant, description, disabledReason, onDisabledSelect, children, ...props }: MenuItemProps & IAnalyticsProps): ReactElement;
|
|
9
9
|
type MenuLinkItemProps = MenuPrimitive.LinkItem.Props & IDensityProps & IAnalyticsProps & {
|
|
10
10
|
inset?: boolean;
|
|
11
11
|
variant?: "default" | "destructive";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RegenerateMenu2
|
|
3
|
-
} from "../../../chunk-
|
|
4
|
-
import"../../../chunk-
|
|
3
|
+
} from "../../../chunk-yd3h2yx1.js";
|
|
4
|
+
import"../../../chunk-dbxmw9ya.js";
|
|
5
5
|
import"../../../chunk-32t5kc0y.js";
|
|
6
6
|
import"../../../chunk-x90xmrba.js";
|
|
7
7
|
import"../../../chunk-jpvw9xqy.js";
|
|
@@ -481,10 +481,10 @@ import {
|
|
|
481
481
|
import {
|
|
482
482
|
RecommendationCard2
|
|
483
483
|
} from "../../chunk-nqgpzqmk.js";
|
|
484
|
-
import"../../chunk-
|
|
484
|
+
import"../../chunk-dbxmw9ya.js";
|
|
485
485
|
import {
|
|
486
486
|
RegenerateMenu2
|
|
487
|
-
} from "../../chunk-
|
|
487
|
+
} from "../../chunk-yd3h2yx1.js";
|
|
488
488
|
import {
|
|
489
489
|
ResearchReport2
|
|
490
490
|
} from "../../chunk-fdhssr0q.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const imageRegionMarkerVariants: (props?: ({
|
|
4
|
+
variant?: "difference" | "draft" | "comment" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
export type ImageRegionMarkerVariant = NonNullable<VariantProps<typeof imageRegionMarkerVariants>["variant"]>;
|
|
7
|
+
export interface IImageRegionMarkerProps extends ComponentProps<"div"> {
|
|
8
|
+
/** Which kind of region the marker outlines. Defaults to `comment`. */
|
|
9
|
+
variant?: ImageRegionMarkerVariant;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Outlines a region drawn over an image. Position it with `style` (`left`, `top`, `width`, `height`, in pixels or
|
|
13
|
+
* percentages of the positioned image box). Children render inside the marker's box, such as an
|
|
14
|
+
* `ImageRegionMarkerBadge` pinned to one of its corners.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ImageRegionMarker({ variant, className, ...props }: IImageRegionMarkerProps): ReactElement;
|
|
17
|
+
export type IImageRegionMarkerBadgeProps = ComponentProps<"div">;
|
|
18
|
+
/**
|
|
19
|
+
* Holds an interactive control, such as a comment-count button, beside an `ImageRegionMarker`. It carries the
|
|
20
|
+
* marker's outline and halo, so its edge stays visible on light and dark screenshots. Position it with `style`
|
|
21
|
+
* relative to the marker's box; it receives pointer events although the marker does not.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ImageRegionMarkerBadge({ className, ...props }: IImageRegionMarkerBadgeProps): ReactElement;
|
|
24
|
+
export {};
|
|
@@ -7,3 +7,5 @@ export type { IImageComparisonProps } from "./ImageComparison.js";
|
|
|
7
7
|
export { computeImageDiff } from "./computeImageDiff.js";
|
|
8
8
|
export { getNormalizedImagePoint } from "./getNormalizedImagePoint.js";
|
|
9
9
|
export type { IImageComparisonSource, IImageDiff, IImageDiffOptions, IImageDiffRegion, IImagePixels, IImageRect, IImageSize, INormalizedImagePoint, ImageComparisonMode, ImageComparisonOrientation, ImageZoom, } from "./types.js";
|
|
10
|
+
export { ImageRegionMarker, ImageRegionMarkerBadge } from "./ImageRegionMarker.js";
|
|
11
|
+
export type { IImageRegionMarkerBadgeProps, IImageRegionMarkerProps, ImageRegionMarkerVariant, } from "./ImageRegionMarker.js";
|
|
@@ -475,19 +475,48 @@ function ImageComparisonToolbar({
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
-
// src/components/image-viewer/
|
|
478
|
+
// src/components/image-viewer/ImageRegionMarker.tsx
|
|
479
|
+
import { cva } from "class-variance-authority";
|
|
479
480
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
481
|
+
var imageRegionMarkerVariants = cva("pointer-events-none absolute rounded-xs shadow-[0_0_0_4px_var(--background)] ring-1 ring-background outline-2 outline-offset-1 forced-colors:outline-[Highlight]", {
|
|
482
|
+
variants: {
|
|
483
|
+
variant: {
|
|
484
|
+
comment: "bg-primary/10 outline-primary",
|
|
485
|
+
draft: "bg-primary/10 outline-dashed outline-primary",
|
|
486
|
+
difference: "bg-warning/10 outline-warning"
|
|
487
|
+
}
|
|
488
|
+
},
|
|
489
|
+
defaultVariants: { variant: "comment" }
|
|
490
|
+
});
|
|
491
|
+
function ImageRegionMarker({ variant, className, ...props }) {
|
|
492
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
493
|
+
"data-slot": "image-region-marker",
|
|
494
|
+
"data-variant": variant ?? "comment",
|
|
495
|
+
className: cn2(imageRegionMarkerVariants({ variant }), className),
|
|
496
|
+
...props
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
function ImageRegionMarkerBadge({ className, ...props }) {
|
|
500
|
+
return /* @__PURE__ */ jsx5("div", {
|
|
501
|
+
"data-slot": "image-region-marker-badge",
|
|
502
|
+
className: cn2("pointer-events-auto absolute z-10 rounded-sm shadow-[0_0_0_4px_var(--background)] outline-2 outline-primary forced-colors:outline-[Highlight]", className),
|
|
503
|
+
...props
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// src/components/image-viewer/ImageDifferenceOverlay.tsx
|
|
508
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
480
509
|
function toPercent(value, total) {
|
|
481
510
|
return `${value / total * 100}%`;
|
|
482
511
|
}
|
|
483
512
|
function ImageDifferenceOverlay({ diff }) {
|
|
484
|
-
return /* @__PURE__ */
|
|
513
|
+
return /* @__PURE__ */ jsx6("div", {
|
|
485
514
|
"data-slot": "image-difference-overlay",
|
|
486
515
|
"aria-hidden": "true",
|
|
487
516
|
className: "pointer-events-none absolute inset-0",
|
|
488
|
-
children: diff.regions.map((region) => /* @__PURE__ */
|
|
517
|
+
children: diff.regions.map((region) => /* @__PURE__ */ jsx6(ImageRegionMarker, {
|
|
489
518
|
"data-slot": "image-difference-region",
|
|
490
|
-
|
|
519
|
+
variant: "difference",
|
|
491
520
|
style: {
|
|
492
521
|
left: toPercent(region.x, diff.width),
|
|
493
522
|
top: toPercent(region.y, diff.height),
|
|
@@ -502,16 +531,16 @@ function ImageDifferenceOverlay({ diff }) {
|
|
|
502
531
|
import { DirectionProvider } from "@base-ui/react/direction-provider";
|
|
503
532
|
import { Slider as SliderPrimitive } from "@base-ui/react/slider";
|
|
504
533
|
import { ChevronsLeftRightIcon } from "lucide-react";
|
|
505
|
-
import { jsx as
|
|
534
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
506
535
|
function ImageSwipeDivider({
|
|
507
536
|
value,
|
|
508
537
|
onValueChange,
|
|
509
538
|
beforeLabel,
|
|
510
539
|
afterLabel
|
|
511
540
|
}) {
|
|
512
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx7(DirectionProvider, {
|
|
513
542
|
direction: "ltr",
|
|
514
|
-
children: /* @__PURE__ */
|
|
543
|
+
children: /* @__PURE__ */ jsx7(SliderPrimitive.Root, {
|
|
515
544
|
dir: "ltr",
|
|
516
545
|
"data-slot": "image-swipe-divider",
|
|
517
546
|
value,
|
|
@@ -521,7 +550,7 @@ function ImageSwipeDivider({
|
|
|
521
550
|
step: 1,
|
|
522
551
|
largeStep: 10,
|
|
523
552
|
className: "pointer-events-none absolute inset-0",
|
|
524
|
-
children: /* @__PURE__ */
|
|
553
|
+
children: /* @__PURE__ */ jsx7(SliderPrimitive.Control, {
|
|
525
554
|
className: "pointer-events-none absolute inset-0",
|
|
526
555
|
children: /* @__PURE__ */ jsxs4(SliderPrimitive.Thumb, {
|
|
527
556
|
"data-slot": "image-swipe-divider-handle",
|
|
@@ -529,14 +558,14 @@ function ImageSwipeDivider({
|
|
|
529
558
|
getAriaValueText: (_formatted, current) => `${beforeLabel} ${current}%, ${afterLabel} ${100 - current}%`,
|
|
530
559
|
className: "group/divider pointer-events-auto flex h-full w-6 cursor-ew-resize touch-none flex-col items-center justify-center select-none",
|
|
531
560
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
561
|
+
/* @__PURE__ */ jsx7("span", {
|
|
533
562
|
"aria-hidden": "true",
|
|
534
563
|
className: "absolute inset-y-0 start-1/2 w-0.5 -translate-x-1/2 bg-foreground ring-1 ring-background"
|
|
535
564
|
}),
|
|
536
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ jsx7("span", {
|
|
537
566
|
"aria-hidden": "true",
|
|
538
567
|
className: "relative flex h-8 w-5 items-center justify-center rounded-sm border border-border bg-background text-foreground shadow-frame group-has-[:focus-visible]/divider:border-ring group-has-[:focus-visible]/divider:ring-1 group-has-[:focus-visible]/divider:ring-ring group-data-dragging/divider:border-ring",
|
|
539
|
-
children: /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ jsx7(ChevronsLeftRightIcon, {
|
|
540
569
|
className: "size-3.5"
|
|
541
570
|
})
|
|
542
571
|
})
|
|
@@ -802,14 +831,14 @@ function useImageDifferences({
|
|
|
802
831
|
}
|
|
803
832
|
|
|
804
833
|
// src/components/image-viewer/ImageComparison.tsx
|
|
805
|
-
import { jsx as
|
|
834
|
+
import { jsx as jsx8, jsxs as jsxs5, Fragment } from "react/jsx-runtime";
|
|
806
835
|
function ComparisonPane({ header, children }) {
|
|
807
836
|
return /* @__PURE__ */ jsxs5("div", {
|
|
808
837
|
"data-slot": "image-comparison-pane",
|
|
809
838
|
"data-scroll": "none",
|
|
810
839
|
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
811
840
|
children: [
|
|
812
|
-
/* @__PURE__ */
|
|
841
|
+
/* @__PURE__ */ jsx8("div", {
|
|
813
842
|
"data-slot": "image-comparison-pane-header",
|
|
814
843
|
className: "flex h-control shrink-0 items-center justify-between gap-2 px-control-x text-xs font-medium text-muted-foreground",
|
|
815
844
|
children: header
|
|
@@ -884,7 +913,7 @@ ${after.src}`,
|
|
|
884
913
|
afterRef
|
|
885
914
|
});
|
|
886
915
|
const isShowingBefore = mode === "toggle" && isPeeking;
|
|
887
|
-
const overlay = showDifferences && differences.status === "ready" ? /* @__PURE__ */
|
|
916
|
+
const overlay = showDifferences && differences.status === "ready" ? /* @__PURE__ */ jsx8(ImageDifferenceOverlay, {
|
|
888
917
|
diff: differences.diff
|
|
889
918
|
}) : null;
|
|
890
919
|
const fallback = failedLabel ? /* @__PURE__ */ jsxs5("p", {
|
|
@@ -925,7 +954,7 @@ ${after.src}`,
|
|
|
925
954
|
}
|
|
926
955
|
}
|
|
927
956
|
function renderAfterImage(className) {
|
|
928
|
-
return /* @__PURE__ */
|
|
957
|
+
return /* @__PURE__ */ jsx8("img", {
|
|
929
958
|
ref: afterRef,
|
|
930
959
|
src: after.src,
|
|
931
960
|
alt: after.alt,
|
|
@@ -938,7 +967,7 @@ ${after.src}`,
|
|
|
938
967
|
});
|
|
939
968
|
}
|
|
940
969
|
function renderBeforeImage(className, style) {
|
|
941
|
-
return /* @__PURE__ */
|
|
970
|
+
return /* @__PURE__ */ jsx8("img", {
|
|
942
971
|
ref: beforeRef,
|
|
943
972
|
src: before.src,
|
|
944
973
|
alt: before.alt,
|
|
@@ -957,8 +986,8 @@ ${after.src}`,
|
|
|
957
986
|
"data-slot": "image-comparison-panes",
|
|
958
987
|
className: cn2("flex min-h-0 min-w-0 flex-1", orientation === "vertical" ? "flex-col" : "flex-row"),
|
|
959
988
|
children: [
|
|
960
|
-
/* @__PURE__ */
|
|
961
|
-
header: /* @__PURE__ */
|
|
989
|
+
/* @__PURE__ */ jsx8(ComparisonPane, {
|
|
990
|
+
header: /* @__PURE__ */ jsx8("span", {
|
|
962
991
|
children: beforeLabel
|
|
963
992
|
}),
|
|
964
993
|
children: /* @__PURE__ */ jsxs5(ImageViewport, {
|
|
@@ -975,11 +1004,11 @@ ${after.src}`,
|
|
|
975
1004
|
]
|
|
976
1005
|
})
|
|
977
1006
|
}),
|
|
978
|
-
/* @__PURE__ */
|
|
1007
|
+
/* @__PURE__ */ jsx8(Separator2, {
|
|
979
1008
|
orientation: orientation === "vertical" ? "horizontal" : "vertical"
|
|
980
1009
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
header: /* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ jsx8(ComparisonPane, {
|
|
1011
|
+
header: /* @__PURE__ */ jsx8("span", {
|
|
983
1012
|
children: afterLabel
|
|
984
1013
|
}),
|
|
985
1014
|
children: /* @__PURE__ */ jsxs5(ImageViewport, {
|
|
@@ -999,13 +1028,13 @@ ${after.src}`,
|
|
|
999
1028
|
]
|
|
1000
1029
|
});
|
|
1001
1030
|
} else if (mode === "swipe") {
|
|
1002
|
-
content = /* @__PURE__ */
|
|
1031
|
+
content = /* @__PURE__ */ jsx8(ComparisonPane, {
|
|
1003
1032
|
header: /* @__PURE__ */ jsxs5(Fragment, {
|
|
1004
1033
|
children: [
|
|
1005
|
-
/* @__PURE__ */
|
|
1034
|
+
/* @__PURE__ */ jsx8("span", {
|
|
1006
1035
|
children: beforeLabel
|
|
1007
1036
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1037
|
+
/* @__PURE__ */ jsx8("span", {
|
|
1009
1038
|
children: afterLabel
|
|
1010
1039
|
})
|
|
1011
1040
|
]
|
|
@@ -1020,7 +1049,7 @@ ${after.src}`,
|
|
|
1020
1049
|
renderAfterImage(),
|
|
1021
1050
|
renderBeforeImage(undefined, { clipPath: `inset(0 ${100 - position}% 0 0)` }),
|
|
1022
1051
|
overlay,
|
|
1023
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ jsx8(ImageSwipeDivider, {
|
|
1024
1053
|
value: position,
|
|
1025
1054
|
onValueChange: setPosition,
|
|
1026
1055
|
beforeLabel,
|
|
@@ -1031,7 +1060,7 @@ ${after.src}`,
|
|
|
1031
1060
|
});
|
|
1032
1061
|
} else {
|
|
1033
1062
|
const showingLabel = isShowingBefore ? beforeLabel : afterLabel;
|
|
1034
|
-
content = /* @__PURE__ */
|
|
1063
|
+
content = /* @__PURE__ */ jsx8(ComparisonPane, {
|
|
1035
1064
|
header: /* @__PURE__ */ jsxs5("span", {
|
|
1036
1065
|
"data-slot": "image-comparison-showing",
|
|
1037
1066
|
"aria-live": "polite",
|
|
@@ -1054,7 +1083,7 @@ ${after.src}`,
|
|
|
1054
1083
|
})
|
|
1055
1084
|
});
|
|
1056
1085
|
}
|
|
1057
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ jsx8("div", {
|
|
1058
1087
|
role: "group",
|
|
1059
1088
|
"aria-label": label,
|
|
1060
1089
|
"data-slot": "image-comparison",
|
|
@@ -1068,13 +1097,13 @@ ${after.src}`,
|
|
|
1068
1097
|
children: /* @__PURE__ */ jsxs5("div", {
|
|
1069
1098
|
className: "flex min-h-0 min-w-0 flex-1 flex-col @3xl:flex-row",
|
|
1070
1099
|
children: [
|
|
1071
|
-
/* @__PURE__ */
|
|
1100
|
+
/* @__PURE__ */ jsx8("div", {
|
|
1072
1101
|
"data-slot": "image-comparison-stage",
|
|
1073
1102
|
"data-scroll": "none",
|
|
1074
1103
|
className: "flex min-h-0 min-w-0 flex-1",
|
|
1075
1104
|
children: content
|
|
1076
1105
|
}),
|
|
1077
|
-
showToolbar && /* @__PURE__ */
|
|
1106
|
+
showToolbar && /* @__PURE__ */ jsx8(ImageComparisonToolbar, {
|
|
1078
1107
|
mode,
|
|
1079
1108
|
onModeChange: setMode,
|
|
1080
1109
|
orientation,
|
|
@@ -1107,6 +1136,8 @@ function getNormalizedImagePoint(point, box) {
|
|
|
1107
1136
|
}
|
|
1108
1137
|
export {
|
|
1109
1138
|
ImageComparison,
|
|
1139
|
+
ImageRegionMarker,
|
|
1140
|
+
ImageRegionMarkerBadge,
|
|
1110
1141
|
ImageViewer,
|
|
1111
1142
|
ImageZoomToggle,
|
|
1112
1143
|
computeImageDiff,
|
|
@@ -31,13 +31,13 @@ import {
|
|
|
31
31
|
DrawerHeader2,
|
|
32
32
|
DrawerTitle2,
|
|
33
33
|
DrawerDescription2
|
|
34
|
-
} from "../../chunk-
|
|
34
|
+
} from "../../chunk-kr38ww4n.js";
|
|
35
35
|
import {
|
|
36
36
|
MenuPopup,
|
|
37
37
|
MenuItem2,
|
|
38
38
|
DropdownMenu2,
|
|
39
39
|
DropdownMenuTrigger2
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-dbxmw9ya.js";
|
|
41
41
|
import {
|
|
42
42
|
Alert2,
|
|
43
43
|
AlertTitle2,
|
package/dist/index.js
CHANGED
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
StatusTracker2,
|
|
177
177
|
DashboardLayout2,
|
|
178
178
|
BillingUsage2
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-kr38ww4n.js";
|
|
180
180
|
import {
|
|
181
181
|
Combobox2,
|
|
182
182
|
ComboboxValue2,
|
|
@@ -249,7 +249,7 @@ import {
|
|
|
249
249
|
MenuShortcut2,
|
|
250
250
|
DropdownMenu2,
|
|
251
251
|
DropdownMenuTrigger2
|
|
252
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-dbxmw9ya.js";
|
|
253
253
|
import {
|
|
254
254
|
Empty2,
|
|
255
255
|
EmptyHeader2,
|
package/dist/menu/types.d.ts
CHANGED
|
@@ -5,6 +5,12 @@ interface IMenuInsetProps extends IDensityProps {
|
|
|
5
5
|
}
|
|
6
6
|
interface IMenuItemOptions extends IMenuInsetProps {
|
|
7
7
|
variant?: "default" | "destructive";
|
|
8
|
+
/**
|
|
9
|
+
* Shows a short secondary line under the label, such as what the item changes, that the item references through
|
|
10
|
+
* `aria-describedby` as its accessible description rather than as part of its name. With `disabledReason`, the
|
|
11
|
+
* description comes first.
|
|
12
|
+
*/
|
|
13
|
+
description?: string;
|
|
8
14
|
/**
|
|
9
15
|
* Disables the item while keeping it reachable with the arrow keys, and shows why as visible secondary text that
|
|
10
16
|
* the item references through `aria-describedby`.
|
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.90",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
package/dist/theme.css
CHANGED
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
--ag-panel-padding-sm: 12px;
|
|
97
97
|
--ag-field-gap: 20px;
|
|
98
98
|
--ag-section-gap: 32px;
|
|
99
|
+
/* Target emphasis: a dark and a light line that keep 3:1 against any content in every theme, so they stay fixed. */
|
|
100
|
+
--target-emphasis: #4a0a3a;
|
|
101
|
+
--target-emphasis-contrast: #ffffff;
|
|
99
102
|
color-scheme: dark;
|
|
100
103
|
--background: #121417;
|
|
101
104
|
--foreground: #eceff3;
|
|
@@ -648,3 +651,17 @@
|
|
|
648
651
|
}
|
|
649
652
|
}
|
|
650
653
|
}
|
|
654
|
+
|
|
655
|
+
/* Marks the target a jump went to: a light 2px line against the element, then a dark 2px line outside it. Against any
|
|
656
|
+
colour one of the two keeps at least 3:1. Forced colours drop the shadow, so both lines become one Highlight
|
|
657
|
+
outline. */
|
|
658
|
+
@utility target-emphasis {
|
|
659
|
+
outline: 2px solid var(--target-emphasis);
|
|
660
|
+
outline-offset: 2px;
|
|
661
|
+
box-shadow: 0 0 0 2px var(--target-emphasis-contrast);
|
|
662
|
+
|
|
663
|
+
@media (forced-colors: active) {
|
|
664
|
+
outline: 4px solid Highlight;
|
|
665
|
+
outline-offset: 0;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# ImageRegionMarker
|
|
2
|
+
|
|
3
|
+
Import from `@alexgorbatchev/shadcn/image-viewer`. Outlines a region over an image: a 2px outline 1px outside the region over a 4px halo in the page background, so the outline keeps 3:1 against any screenshot in both themes; forced colours draw it in Highlight. Variants: `comment` (a saved comment's region), `draft` (dashed, a region being drawn) and `difference` (changed pixels, used by ImageComparison's Highlight differences). Position it with `style` over a positioned image box. `ImageRegionMarkerBadge` pins an interactive control, such as a comment count, beside the marker with the same outline and halo. The theme's `target-emphasis` utility is the matching two-tone mark for a jump target on the page.
|
|
4
|
+
|
|
5
|
+
Story: @alexgorbatchev/shadcn/components/data-display/ImageRegionMarker
|
|
6
|
+
Source: src/components/stories/data-display/ImageRegionMarker.stories.tsx
|
|
7
|
+
|
|
8
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/ImageRegionMarker.stories.tsx)
|
|
9
|
+
|
|
10
|
+
## Public imports
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { Button } from "@alexgorbatchev/shadcn";
|
|
14
|
+
import { ImageRegionMarker, ImageRegionMarkerBadge } from "@alexgorbatchev/shadcn/image-viewer";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Default component
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
ImageRegionMarker
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Story controls
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
{ variant: { control: "inline-radio", options: ["comment", "draft", "difference"] } }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Default args
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
{ variant: "comment" }
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Default render
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
(args) => (<div className="flex flex-wrap gap-6">
|
|
39
|
+
{screenshots.map((screenshot) => (<figure key={screenshot.label} className="flex flex-col gap-2">
|
|
40
|
+
<div role="img" aria-label={screenshot.label} className="relative h-40 w-72" style={{ background: screenshot.background }}>
|
|
41
|
+
<ImageRegionMarker {...args} style={{ left: "20%", top: "35%", width: "45%", height: "30%" }}>
|
|
42
|
+
<ImageRegionMarkerBadge style={{ left: "calc(100% + 8px)", top: -32 }}>
|
|
43
|
+
<Button size="sm" variant="secondary" aria-label={`Open comments on ${screenshot.label}`}>
|
|
44
|
+
3
|
|
45
|
+
</Button>
|
|
46
|
+
</ImageRegionMarkerBadge>
|
|
47
|
+
</ImageRegionMarker>
|
|
48
|
+
</div>
|
|
49
|
+
<figcaption className="text-sm text-muted-foreground">{screenshot.label}</figcaption>
|
|
50
|
+
</figure>))}
|
|
51
|
+
</div>)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Examples
|
|
55
|
+
|
|
56
|
+
Storybook CSF excerpts. Default args and render apply unless overridden. Local helpers, fixtures, decorators, and providers may be required; these are reference excerpts, not standalone consumer modules. Interaction tests are omitted.
|
|
57
|
+
|
|
58
|
+
### Comment
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
{}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Draft
|
|
65
|
+
|
|
66
|
+
```tsx
|
|
67
|
+
{
|
|
68
|
+
args: { variant: "draft" }
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Difference
|
|
73
|
+
|
|
74
|
+
```tsx
|
|
75
|
+
{
|
|
76
|
+
args: { variant: "difference" }
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### TargetEmphasis
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
{
|
|
84
|
+
render: () => (<div className="flex flex-col gap-6 p-4">
|
|
85
|
+
<p className="w-fit target-emphasis">A paragraph a jump landed on keeps a two-tone mark until you move on.</p>
|
|
86
|
+
<div className="h-24 w-72 target-emphasis" style={{ background: "#1e293b" }} role="img" aria-label="Dark chart"/>
|
|
87
|
+
</div>)
|
|
88
|
+
}
|
|
89
|
+
```
|
|
@@ -632,6 +632,35 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
632
632
|
}
|
|
633
633
|
```
|
|
634
634
|
|
|
635
|
+
### Descriptions
|
|
636
|
+
|
|
637
|
+
```tsx
|
|
638
|
+
{
|
|
639
|
+
render: function Render() {
|
|
640
|
+
const [action, setAction] = useState("None");
|
|
641
|
+
return (<>
|
|
642
|
+
<DropdownMenu>
|
|
643
|
+
<DropdownMenuTrigger render={<Button variant="outline"/>}>Track actions</DropdownMenuTrigger>
|
|
644
|
+
<DropdownMenuContent>
|
|
645
|
+
<DropdownMenuGroup>
|
|
646
|
+
<DropdownMenuItem description="writes into the files" onClick={() => setAction("File tags")}>
|
|
647
|
+
<FileIcon />
|
|
648
|
+
File tags…
|
|
649
|
+
</DropdownMenuItem>
|
|
650
|
+
<DropdownMenuItem description="moves the file" disabledReason="One track only">
|
|
651
|
+
<SaveIcon />
|
|
652
|
+
Move audio file…
|
|
653
|
+
</DropdownMenuItem>
|
|
654
|
+
<DropdownMenuItem description="reads the audio again">Analyze…</DropdownMenuItem>
|
|
655
|
+
</DropdownMenuGroup>
|
|
656
|
+
</DropdownMenuContent>
|
|
657
|
+
</DropdownMenu>
|
|
658
|
+
<output aria-label="Menu action">{action}</output>
|
|
659
|
+
</>);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
635
664
|
### AtPoint
|
|
636
665
|
|
|
637
666
|
```tsx
|
package/llms.txt
CHANGED
|
@@ -343,6 +343,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
343
343
|
- [DataViewer](./llms/components/data-display/DataViewer.md)
|
|
344
344
|
- [Heading](./llms/components/data-display/Heading.md): Heading renders `h1`–`h6` from the required `level` so the document outline stays correct, while `size` (sm, base, lg, xl) sets the visual size independently. Sizes default by level: 1 xl, 2 lg, 3 base, 4–6 sm. `truncate` keeps one line.
|
|
345
345
|
- [ImageComparison](./llms/components/data-display/ImageComparison.md): Import from `@alexgorbatchev/shadcn/image-viewer`. ImageComparison fills its container and compares `before` and `after` images (`{ src, alt, crossOrigin? }`) labelled by `beforeLabel` and `afterLabel` (default "Before" and "After"). `toggle` (the default) shows the after image and the "Hold to show before" button shows the before image while a pointer, Space, or Enter is held. `swipe` stacks both images; the divider is a slider (0–100, arrows ±1, Page Up/Page Down ±10, Home/End) whose handle drags with pointer capture. `side-by-side` shows labelled panes left and right (`horizontal`) or top and bottom (`vertical`) that scroll in sync at original size. Every mode starts fitted and offers original size. A differently sized before image is drawn inside the after image box, and the toolbar reports the mismatch. "Highlight differences" compares pixels on first use, caches the result per image pair, outlines changed regions, and summarizes them; it is disabled with a reason when pixels cannot be read. `mode`, `orientation`, `zoom`, and `showDifferences` are controllable with matching `default*` and `on*Change` props; `showToolbar={false}` hides the controls, which sit beside wide comparisons and below narrow ones.
|
|
346
|
+
- [ImageRegionMarker](./llms/components/data-display/ImageRegionMarker.md): Import from `@alexgorbatchev/shadcn/image-viewer`. Outlines a region over an image: a 2px outline 1px outside the region over a 4px halo in the page background, so the outline keeps 3:1 against any screenshot in both themes; forced colours draw it in Highlight. Variants: `comment` (a saved comment's region), `draft` (dashed, a region being drawn) and `difference` (changed pixels, used by ImageComparison's Highlight differences). Position it with `style` over a positioned image box. `ImageRegionMarkerBadge` pins an interactive control, such as a comment count, beside the marker with the same outline and halo. The theme's `target-emphasis` utility is the matching two-tone mark for a jump target on the page.
|
|
346
347
|
- [ImageViewer](./llms/components/data-display/ImageViewer.md): Import from `@alexgorbatchev/shadcn/image-viewer`. ImageViewer fills the container it is given, such as a `DialogContent size="fullscreen"` body, and shows one image in a native scroll viewport. `fit` (the default) scales the image down proportionally to fit both dimensions, centered and without scrollbars, and never upscales it; `original` shows natural size in CSS pixels, centered on axes where it is smaller and scrolling where it is larger. Switching zoom keeps the viewed center. Control zoom with `zoom` and `onZoomChange`, or leave it uncontrolled with `defaultZoom`; place `ImageZoomToggle` in a header or toolbar, or set `showZoomControl` for the built-in toggle. `overlay` renders content sized and positioned exactly over the rendered image at every zoom, `imageRef` and `overlayRef` expose the rendered image box, and `getNormalizedImagePoint(event, box)` maps pointer coordinates to 0–1 image coordinates.
|
|
347
348
|
- [ImageZoomToggle](./llms/components/data-display/ImageZoomToggle.md): Import from `@alexgorbatchev/shadcn/image-viewer`. A two-option toggle for ImageViewer and ImageComparison zoom that consumers place in a header or toolbar. "Fit to screen" and "Original size" are pressed-state toggles with constant names, so assistive technology announces the active zoom through `aria-pressed`. One option always stays pressed. `label` names the group (default "Zoom"); `size`, `orientation`, `layout`, `disabled`, and `density` follow ToggleGroup.
|
|
348
349
|
- [Item](./llms/components/data-display/Item.md)
|