@alexgorbatchev/shadcn 0.0.95 → 0.0.97
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-bdsdkjcq.js → chunk-1vqyxxma.js} +1 -1
- package/dist/{chunk-j2tm6kjm.js → chunk-20ebs5z7.js} +1 -1
- package/dist/{chunk-25g7d9m7.js → chunk-22ybn8qf.js} +1 -1
- package/dist/chunk-2jsgsjas.js +27 -0
- package/dist/{chunk-q0qa9d0w.js → chunk-59emaywr.js} +1 -1
- package/dist/{chunk-fnqdw884.js → chunk-5xkfbnap.js} +1 -1
- package/dist/{chunk-afegpa2s.js → chunk-6s630syb.js} +1 -1
- package/dist/{chunk-fkxhe17e.js → chunk-6z6qn9zr.js} +1 -1
- package/dist/{chunk-tz7zjkw3.js → chunk-b2sn56jy.js} +1 -1
- package/dist/{chunk-w67bf59k.js → chunk-cjbh4fp5.js} +1 -1
- package/dist/{chunk-r73tntkx.js → chunk-h3a6hmnb.js} +1 -1
- package/dist/{chunk-kt1ra60a.js → chunk-j62723nh.js} +1 -1
- package/dist/{chunk-fg1h007n.js → chunk-m7rs4v5x.js} +4 -3
- package/dist/{chunk-6fj02yzp.js → chunk-paswgbzy.js} +3 -3
- package/dist/{chunk-s8qhybtb.js → chunk-pj739h1d.js} +1 -1
- package/dist/{chunk-k1428vt3.js → chunk-q6ay6f5f.js} +1 -1
- package/dist/{chunk-2sx5jnyv.js → chunk-qs48ad08.js} +1 -1
- package/dist/{chunk-4p4vggpr.js → chunk-r3yp5xm2.js} +1 -1
- package/dist/{chunk-5rzhnmv6.js → chunk-r63yrdr2.js} +1 -1
- package/dist/{chunk-mjxhvwgg.js → chunk-tzf47swm.js} +4 -4
- package/dist/{chunk-hyhr09xy.js → chunk-v3ep6b3p.js} +1 -1
- package/dist/{chunk-77zbd22x.js → chunk-w9mmcpfj.js} +2 -2
- package/dist/{chunk-wrm689qy.js → chunk-wgvpxw3p.js} +8 -8
- package/dist/{chunk-kq3348h4.js → chunk-xfx55ter.js} +2 -2
- package/dist/{chunk-t6gbcj27.js → chunk-xyttc32e.js} +2 -1
- package/dist/{chunk-nssz3p32.js → chunk-zz3egmv4.js} +1 -1
- package/dist/components/Breadcrumb.d.ts +9 -2
- package/dist/components/assistant-ui/elements/CommandPalette.js +3 -3
- package/dist/components/assistant-ui/elements/GenerativeUi.js +4 -4
- package/dist/components/assistant-ui/elements/Image.js +2 -2
- package/dist/components/assistant-ui/elements/ImageGallery.js +2 -2
- package/dist/components/assistant-ui/elements/MermaidDiagram.js +3 -3
- package/dist/components/assistant-ui/elements/MermaidZoom.js +2 -2
- package/dist/components/assistant-ui/elements/ModelSelector.js +9 -9
- package/dist/components/assistant-ui/elements/ModelSelectorContent.js +8 -8
- package/dist/components/assistant-ui/elements/ModelSelectorEmpty.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorFocusAnchor.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorGroup.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorItem.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorList.js +5 -5
- package/dist/components/assistant-ui/elements/ModelSelectorSearch.js +3 -3
- package/dist/components/assistant-ui/elements/ModelSelectorSeparator.js +3 -3
- package/dist/components/assistant-ui/index.js +17 -17
- package/dist/components/assistant-ui/native/AssistantModal.js +5 -5
- package/dist/components/assistant-ui/native/AssistantSidebar.js +5 -5
- package/dist/components/assistant-ui/native/AttachmentPreview.js +2 -2
- package/dist/components/assistant-ui/native/McpConfigDialog.js +2 -2
- package/dist/components/assistant-ui/native/MermaidDiagram.js +4 -4
- package/dist/components/assistant-ui/native/ModelSelector.js +11 -11
- package/dist/components/assistant-ui/native/Thread.js +4 -4
- package/dist/components/assistant-ui/native/index.js +20 -20
- package/dist/components/command/index.js +2 -2
- package/dist/components/image-viewer/FramedImage.d.ts +16 -0
- package/dist/components/image-viewer/ImageRegionSelect.d.ts +12 -0
- package/dist/components/image-viewer/ImageViewer.d.ts +32 -7
- package/dist/components/image-viewer/ImageViewport.d.ts +20 -5
- package/dist/components/image-viewer/ImageZoomControl.d.ts +18 -0
- package/dist/components/image-viewer/ImageZoomToggle.d.ts +1 -1
- package/dist/components/image-viewer/getImageStageSize.d.ts +2 -1
- package/dist/components/image-viewer/imageZoom.d.ts +26 -0
- package/dist/components/image-viewer/index.d.ts +9 -2
- package/dist/components/image-viewer/index.js +637 -185
- package/dist/components/image-viewer/types.d.ts +13 -2
- package/dist/components/json-render/index.js +7 -5
- package/dist/index.js +2 -2
- package/dist/prototype.js +1 -1
- package/dist/theme.css +5 -0
- package/llms/components/data-display/FramedImage.md +66 -0
- package/llms/components/data-display/ImageComparison.md +3 -3
- package/llms/components/data-display/ImageViewer.md +28 -9
- package/llms/components/data-display/ImageZoomToggle.md +3 -3
- package/llms/components/navigation/Breadcrumb.md +26 -0
- package/llms/components/overlays/Dialog.md +17 -0
- package/llms.txt +4 -3
- package/package.json +1 -1
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import type { StackDirection } from "../../layout/types.js";
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* `fit` scales the image down to show all of it; `fit-width` fills the viewport's width and scrolls vertically; a
|
|
4
|
+
* number is a scale in rendered CSS pixels per natural image pixel, from the fitted scale up to 4 (400%), so `1` shows
|
|
5
|
+
* the image at its natural size.
|
|
6
|
+
*/
|
|
7
|
+
export type ImageZoom = "fit" | "fit-width" | number;
|
|
8
|
+
/** Scales of the two fitted zooms of an image in a viewport. */
|
|
9
|
+
export interface IImageZoomScales {
|
|
10
|
+
/** Shows the whole image, never upscaled past its natural size. */
|
|
11
|
+
fit: number;
|
|
12
|
+
/** Fills the viewport's width, upscaled up to 4. */
|
|
13
|
+
fitWidth: number;
|
|
14
|
+
}
|
|
4
15
|
/** How ImageComparison presents the before and after images. */
|
|
5
16
|
export type ImageComparisonMode = "toggle" | "swipe" | "side-by-side";
|
|
6
17
|
/** Side-by-side pane arrangement: `horizontal` places panes left and right, `vertical` top and bottom. */
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PaginationPrevious2,
|
|
27
27
|
PaginationNext2,
|
|
28
28
|
PaginationEllipsis2
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-m7rs4v5x.js";
|
|
30
30
|
import {
|
|
31
31
|
MenuPopup,
|
|
32
32
|
MenuItem2,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
DialogHeader2,
|
|
45
45
|
DialogTitle2,
|
|
46
46
|
DialogDescription2
|
|
47
|
-
} from "../../chunk-
|
|
47
|
+
} from "../../chunk-xyttc32e.js";
|
|
48
48
|
import"../../chunk-f9sm5zpv.js";
|
|
49
49
|
import {
|
|
50
50
|
Popover2,
|
|
@@ -161,6 +161,9 @@ import {
|
|
|
161
161
|
CarouselPrevious2,
|
|
162
162
|
CarouselNext2
|
|
163
163
|
} from "../../chunk-xfz7r7dk.js";
|
|
164
|
+
import {
|
|
165
|
+
FramedImage2
|
|
166
|
+
} from "../../chunk-2jsgsjas.js";
|
|
164
167
|
import {
|
|
165
168
|
componentDefinitions2
|
|
166
169
|
} from "../../chunk-p8bdmafq.js";
|
|
@@ -535,12 +538,11 @@ var JsonText = ({ props }) => {
|
|
|
535
538
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
536
539
|
var JsonImage = ({ props }) => {
|
|
537
540
|
if (props.src) {
|
|
538
|
-
return /* @__PURE__ */ jsx14(
|
|
541
|
+
return /* @__PURE__ */ jsx14(FramedImage2, {
|
|
539
542
|
src: props.src,
|
|
540
543
|
alt: props.alt ?? "",
|
|
541
544
|
width: props.width ?? undefined,
|
|
542
|
-
height: props.height ?? undefined
|
|
543
|
-
className: "rounded max-w-full"
|
|
545
|
+
height: props.height ?? undefined
|
|
544
546
|
});
|
|
545
547
|
}
|
|
546
548
|
return /* @__PURE__ */ jsx14("div", {
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
StatusTracker2,
|
|
166
166
|
DashboardLayout2,
|
|
167
167
|
BillingUsage2
|
|
168
|
-
} from "./chunk-
|
|
168
|
+
} from "./chunk-m7rs4v5x.js";
|
|
169
169
|
import {
|
|
170
170
|
Combobox2,
|
|
171
171
|
ComboboxValue2,
|
|
@@ -416,7 +416,7 @@ import {
|
|
|
416
416
|
DialogFooter2,
|
|
417
417
|
DialogTitle2,
|
|
418
418
|
DialogDescription2
|
|
419
|
-
} from "./chunk-
|
|
419
|
+
} from "./chunk-xyttc32e.js";
|
|
420
420
|
import {
|
|
421
421
|
InputGroup2,
|
|
422
422
|
InputGroupAddon2,
|
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.97",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
package/dist/theme.css
CHANGED
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
--color-ring: var(--ring);
|
|
36
36
|
--color-frame-edge: var(--frame-edge);
|
|
37
37
|
--color-frame-halo: var(--frame-halo);
|
|
38
|
+
--color-media-edge: var(--media-edge);
|
|
38
39
|
--color-backdrop: var(--backdrop);
|
|
39
40
|
--color-terminal-background: var(--terminal-background);
|
|
40
41
|
--color-sidebar: var(--sidebar, var(--background));
|
|
@@ -131,6 +132,7 @@
|
|
|
131
132
|
--input: #6f7783;
|
|
132
133
|
--ring: #ff5cd6;
|
|
133
134
|
--frame-edge: rgb(255 255 255 / 0.24);
|
|
135
|
+
--media-edge: var(--input);
|
|
134
136
|
--frame-halo: rgb(0 0 0 / 0.92);
|
|
135
137
|
--backdrop: rgb(4 5 7 / 0.7);
|
|
136
138
|
--terminal-background: #0b0c0f;
|
|
@@ -170,6 +172,7 @@
|
|
|
170
172
|
--input: #6f7783;
|
|
171
173
|
--ring: #ff5cd6;
|
|
172
174
|
--frame-edge: rgb(255 255 255 / 0.24);
|
|
175
|
+
--media-edge: var(--input);
|
|
173
176
|
--frame-halo: rgb(0 0 0 / 0.92);
|
|
174
177
|
--backdrop: rgb(4 5 7 / 0.7);
|
|
175
178
|
--terminal-background: #0b0c0f;
|
|
@@ -209,6 +212,7 @@
|
|
|
209
212
|
--input: #747c88;
|
|
210
213
|
--ring: #b8168c;
|
|
211
214
|
--frame-edge: rgb(0 0 0 / 0.42);
|
|
215
|
+
--media-edge: var(--input);
|
|
212
216
|
--frame-halo: rgb(255 255 255 / 0.95);
|
|
213
217
|
--backdrop: rgb(10 12 16 / 0.55);
|
|
214
218
|
--terminal-background: #ffffff;
|
|
@@ -226,6 +230,7 @@
|
|
|
226
230
|
--faint-foreground: var(--muted-foreground);
|
|
227
231
|
--destructive-soft: color-mix(in oklab, var(--destructive) 15%, transparent);
|
|
228
232
|
--frame-edge: var(--border);
|
|
233
|
+
--media-edge: var(--muted-foreground);
|
|
229
234
|
--frame-halo: transparent;
|
|
230
235
|
--terminal-background: var(--background);
|
|
231
236
|
--ag-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# FramedImage
|
|
2
|
+
|
|
3
|
+
Import from `@alexgorbatchev/shadcn/image-viewer`. FramedImage shows a screenshot or other supplied image as evidence: a 1px edge in the `media-edge` token, which keeps at least 3:1 against the page in both themes, so a white image in the light theme and a black one in the dark theme still show where they end. `size="intrinsic"` (the default) keeps the image's own size within its column and at most 70% of the viewport height, scaled and never cropped; `size="fill"` fills its container's width, as in a row of thumbnails. It takes every `<img>` attribute.
|
|
4
|
+
|
|
5
|
+
Story: @alexgorbatchev/shadcn/components/data-display/FramedImage
|
|
6
|
+
Source: src/components/stories/data-display/FramedImage.stories.tsx
|
|
7
|
+
|
|
8
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/FramedImage.stories.tsx)
|
|
9
|
+
|
|
10
|
+
## Public imports
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { FramedImage } from "@alexgorbatchev/shadcn/image-viewer";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Default component
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
FramedImage
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Story controls
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
{ size: { control: "inline-radio", options: ["intrinsic", "fill"] } }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Default args
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
{ src: fixture_largeScreenshot, alt: "Dashboard screenshot" }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Default render
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
(args) => (<div className="w-full max-w-3xl">
|
|
38
|
+
<FramedImage {...args}/>
|
|
39
|
+
</div>)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Examples
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
### Intrinsic
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
{}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### TallCappedAtSeventyPercentOfTheViewport
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
{
|
|
56
|
+
args: { src: fixture_tallScreenshot, alt: "Tall page" }
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Fill
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
{
|
|
64
|
+
args: { size: "fill" }
|
|
65
|
+
}
|
|
66
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ImageComparison
|
|
2
2
|
|
|
3
|
-
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
|
|
3
|
+
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 when zoomed. Every mode starts fitted and offers original size (zoom `1`); the focused stage also takes the ImageViewer stage keys, Mod+wheel and pinch, and its name ends with the zoom percent. 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.
|
|
4
4
|
|
|
5
5
|
Story: @alexgorbatchev/shadcn/components/data-display/ImageComparison
|
|
6
6
|
Source: src/components/stories/data-display/ImageComparison.stories.tsx
|
|
@@ -32,7 +32,7 @@ ImageComparison
|
|
|
32
32
|
{
|
|
33
33
|
defaultMode: { control: "inline-radio", options: ["toggle", "swipe", "side-by-side"] },
|
|
34
34
|
defaultOrientation: { control: "inline-radio", options: ["horizontal", "vertical"] },
|
|
35
|
-
defaultZoom: { control: "inline-radio", options: ["fit",
|
|
35
|
+
defaultZoom: { control: "inline-radio", options: ["fit", 1, 2] },
|
|
36
36
|
defaultShowDifferences: { control: "boolean" },
|
|
37
37
|
showToolbar: { control: "boolean" },
|
|
38
38
|
density: { control: "select", options: ["compact", "comfortable"] },
|
|
@@ -124,7 +124,7 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
124
124
|
|
|
125
125
|
```tsx
|
|
126
126
|
{
|
|
127
|
-
args: { defaultZoom:
|
|
127
|
+
args: { defaultZoom: 1 }
|
|
128
128
|
}
|
|
129
129
|
```
|
|
130
130
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ImageViewer
|
|
2
2
|
|
|
3
|
-
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`
|
|
3
|
+
Import from `@alexgorbatchev/shadcn/image-viewer`. ImageViewer fills the container it is given, such as a `DialogContent size="fullscreen"` body, and shows one framed image in a native scroll viewport. `fit` scales the image down proportionally to fit both dimensions, centered and without scrollbars, and never upscales it; `fit-width` fills the width and scrolls vertically; a number is a scale from the fitted one up to 4 (400%), so `1` shows natural size. Without `zoom` or `defaultZoom` it opens at `fit`, or at `fit-width` for an image much taller than the stage, and never narrower than `openingWidth`. Zooming keeps the viewed center. The stage, named "<alt>, <percent>", owns its gestures: a drag pans, two fingers pinch-zoom and Mod+wheel zooms around the pointer, so a touch never reaches overlay content unless it handles the pointer itself, such as `ImageRegionSelect`; while focused it takes + or = (zoom in), − (zoom out), 0 (fit), 1 (100%) and arrows (pan while larger than the stage), and `onStageKeyDown` runs first to add or replace keys. `showZoomControl` shows the zoom bar (Fit, Fit width, −, percent, +) in a toolbar row, and `toolbar` adds further controls to that row. `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.
|
|
4
4
|
|
|
5
5
|
Story: @alexgorbatchev/shadcn/components/data-display/ImageViewer
|
|
6
6
|
Source: src/components/stories/data-display/ImageViewer.stories.tsx
|
|
@@ -10,8 +10,8 @@ Source: src/components/stories/data-display/ImageViewer.stories.tsx
|
|
|
10
10
|
## Public imports
|
|
11
11
|
|
|
12
12
|
```tsx
|
|
13
|
-
import { ImageViewer, ImageZoomToggle, getNormalizedImagePoint, type IImageViewerProps, type INormalizedImagePoint, type ImageZoom } from "@alexgorbatchev/shadcn/image-viewer";
|
|
14
|
-
import { Button, Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@alexgorbatchev/shadcn";
|
|
13
|
+
import { ImageRegionMarker, ImageRegionSelect, ImageViewer, ImageZoomToggle, getNormalizedImagePoint, type IImageRect, type IImageViewerProps, type INormalizedImagePoint, type ImageZoom } from "@alexgorbatchev/shadcn/image-viewer";
|
|
14
|
+
import { Button, Toggle, Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@alexgorbatchev/shadcn";
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Supporting imports
|
|
@@ -30,7 +30,7 @@ ImageViewer
|
|
|
30
30
|
|
|
31
31
|
```tsx
|
|
32
32
|
{
|
|
33
|
-
defaultZoom: { control: "inline-radio", options: ["fit", "
|
|
33
|
+
defaultZoom: { control: "inline-radio", options: ["fit", "fit-width", 1, 2] },
|
|
34
34
|
showZoomControl: { control: "boolean" },
|
|
35
35
|
density: { control: "select", options: ["compact", "comfortable"] },
|
|
36
36
|
}
|
|
@@ -57,14 +57,24 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
57
57
|
### FitToScreen
|
|
58
58
|
|
|
59
59
|
```tsx
|
|
60
|
-
{
|
|
60
|
+
{
|
|
61
|
+
args: { defaultZoom: "fit" }
|
|
62
|
+
}
|
|
61
63
|
```
|
|
62
64
|
|
|
63
65
|
### OriginalSize
|
|
64
66
|
|
|
65
67
|
```tsx
|
|
66
68
|
{
|
|
67
|
-
args: { defaultZoom:
|
|
69
|
+
args: { defaultZoom: 1 }
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### OpensTallImagesAtFitWidth
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
{
|
|
77
|
+
args: { src: fixture_tallScreenshot, alt: "Tall page", openingWidth: 400 }
|
|
68
78
|
}
|
|
69
79
|
```
|
|
70
80
|
|
|
@@ -76,11 +86,11 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
76
86
|
}
|
|
77
87
|
```
|
|
78
88
|
|
|
79
|
-
###
|
|
89
|
+
### ZoomBar
|
|
80
90
|
|
|
81
91
|
```tsx
|
|
82
92
|
{
|
|
83
|
-
args: { showZoomControl: true }
|
|
93
|
+
args: { showZoomControl: true, defaultZoom: "fit" }
|
|
84
94
|
}
|
|
85
95
|
```
|
|
86
96
|
|
|
@@ -88,7 +98,16 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
88
98
|
|
|
89
99
|
```tsx
|
|
90
100
|
{
|
|
91
|
-
args: { showZoomControl: true, defaultZoom:
|
|
101
|
+
args: { showZoomControl: true, defaultZoom: 1 }
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### RegionTool
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
{
|
|
109
|
+
args: { defaultZoom: "fit" },
|
|
110
|
+
render: (args) => <RegionToolExample {...args}/>
|
|
92
111
|
}
|
|
93
112
|
```
|
|
94
113
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ImageZoomToggle
|
|
2
2
|
|
|
3
|
-
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`.
|
|
3
|
+
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`. Original size sets zoom `1`; other numeric zooms, such as 150% from the ImageViewer zoom bar, press neither option. `label` names the group (default "Zoom"); `size`, `orientation`, `layout`, `disabled`, and `density` follow ToggleGroup.
|
|
4
4
|
|
|
5
5
|
Story: @alexgorbatchev/shadcn/components/data-display/ImageZoomToggle
|
|
6
6
|
Source: src/components/stories/data-display/ImageZoomToggle.stories.tsx
|
|
@@ -29,7 +29,7 @@ ImageZoomToggle
|
|
|
29
29
|
|
|
30
30
|
```tsx
|
|
31
31
|
{
|
|
32
|
-
zoom: { control: "inline-radio", options: ["fit",
|
|
32
|
+
zoom: { control: "inline-radio", options: ["fit", 1, 2] },
|
|
33
33
|
size: { control: "select", options: ["sm", "default", "lg"] },
|
|
34
34
|
orientation: { control: "inline-radio", options: ["horizontal", "vertical"] },
|
|
35
35
|
layout: { control: "inline-radio", options: ["content", "fill"] },
|
|
@@ -69,7 +69,7 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
69
69
|
|
|
70
70
|
```tsx
|
|
71
71
|
{
|
|
72
|
-
args: { orientation: "vertical", layout: "fill", label: "Screenshot zoom", zoom:
|
|
72
|
+
args: { orientation: "vertical", layout: "fill", label: "Screenshot zoom", zoom: 1 }
|
|
73
73
|
}
|
|
74
74
|
```
|
|
75
75
|
|
|
@@ -157,3 +157,29 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
157
157
|
args: { dir: "rtl" }
|
|
158
158
|
}
|
|
159
159
|
```
|
|
160
|
+
|
|
161
|
+
### Truncated
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
{
|
|
165
|
+
render: (args) => (<div className="w-80">
|
|
166
|
+
<Breadcrumb {...args}>
|
|
167
|
+
<BreadcrumbList overflow="truncate">
|
|
168
|
+
<BreadcrumbItem>
|
|
169
|
+
<BreadcrumbLink href="#project" title={LONG_PROJECT}>
|
|
170
|
+
{LONG_PROJECT}
|
|
171
|
+
</BreadcrumbLink>
|
|
172
|
+
</BreadcrumbItem>
|
|
173
|
+
<BreadcrumbSeparator />
|
|
174
|
+
<BreadcrumbItem>
|
|
175
|
+
<BreadcrumbLink href="#interviews">Interviews</BreadcrumbLink>
|
|
176
|
+
</BreadcrumbItem>
|
|
177
|
+
<BreadcrumbSeparator />
|
|
178
|
+
<BreadcrumbItem>
|
|
179
|
+
<BreadcrumbPage>Interview 35</BreadcrumbPage>
|
|
180
|
+
</BreadcrumbItem>
|
|
181
|
+
</BreadcrumbList>
|
|
182
|
+
</Breadcrumb>
|
|
183
|
+
</div>)
|
|
184
|
+
}
|
|
185
|
+
```
|
|
@@ -75,6 +75,23 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
### LongTitleBesideClose
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
{
|
|
82
|
+
render: (args) => (<Dialog {...args} defaultOpen>
|
|
83
|
+
<DialogContent size="fullscreen">
|
|
84
|
+
<DialogHeader>
|
|
85
|
+
<DialogTitle className="truncate">
|
|
86
|
+
{"Deploy monitor screenshot during the incident on the payments cluster, with every panel expanded. ".repeat(6)}
|
|
87
|
+
</DialogTitle>
|
|
88
|
+
<DialogDescription>A long title truncates before the Close button.</DialogDescription>
|
|
89
|
+
</DialogHeader>
|
|
90
|
+
</DialogContent>
|
|
91
|
+
</Dialog>)
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
78
95
|
### Default
|
|
79
96
|
|
|
80
97
|
```tsx
|
package/llms.txt
CHANGED
|
@@ -341,11 +341,12 @@ Generated from the public package exports and Storybook sources.
|
|
|
341
341
|
- [DataGridSelectCell](./llms/components/data-display/DataGridSelectCell.md)
|
|
342
342
|
- [DataGridSelectHeader](./llms/components/data-display/DataGridSelectHeader.md)
|
|
343
343
|
- [DataViewer](./llms/components/data-display/DataViewer.md)
|
|
344
|
+
- [FramedImage](./llms/components/data-display/FramedImage.md): Import from `@alexgorbatchev/shadcn/image-viewer`. FramedImage shows a screenshot or other supplied image as evidence: a 1px edge in the `media-edge` token, which keeps at least 3:1 against the page in both themes, so a white image in the light theme and a black one in the dark theme still show where they end. `size="intrinsic"` (the default) keeps the image's own size within its column and at most 70% of the viewport height, scaled and never cropped; `size="fill"` fills its container's width, as in a row of thumbnails. It takes every `<img>` attribute.
|
|
344
345
|
- [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
|
-
- [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
|
|
346
|
+
- [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 when zoomed. Every mode starts fitted and offers original size (zoom `1`); the focused stage also takes the ImageViewer stage keys, Mod+wheel and pinch, and its name ends with the zoom percent. 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
347
|
- [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 `region` (left, top, width, height in pixels or any CSS length) over a positioned image box. `ImageRegionMarkerBadge` pins an interactive control, such as a comment count, beside the marker with the same outline and halo; place it with `position`, and pass `interactive={false}` while another gesture owns the pointer. The theme's `target-emphasis` utility is the matching two-tone mark for a jump target on the page.
|
|
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`
|
|
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`.
|
|
348
|
+
- [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 framed image in a native scroll viewport. `fit` scales the image down proportionally to fit both dimensions, centered and without scrollbars, and never upscales it; `fit-width` fills the width and scrolls vertically; a number is a scale from the fitted one up to 4 (400%), so `1` shows natural size. Without `zoom` or `defaultZoom` it opens at `fit`, or at `fit-width` for an image much taller than the stage, and never narrower than `openingWidth`. Zooming keeps the viewed center. The stage, named "<alt>, <percent>", owns its gestures: a drag pans, two fingers pinch-zoom and Mod+wheel zooms around the pointer, so a touch never reaches overlay content unless it handles the pointer itself, such as `ImageRegionSelect`; while focused it takes + or = (zoom in), − (zoom out), 0 (fit), 1 (100%) and arrows (pan while larger than the stage), and `onStageKeyDown` runs first to add or replace keys. `showZoomControl` shows the zoom bar (Fit, Fit width, −, percent, +) in a toolbar row, and `toolbar` adds further controls to that row. `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.
|
|
349
|
+
- [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`. Original size sets zoom `1`; other numeric zooms, such as 150% from the ImageViewer zoom bar, press neither option. `label` names the group (default "Zoom"); `size`, `orientation`, `layout`, `disabled`, and `density` follow ToggleGroup.
|
|
349
350
|
- [Item](./llms/components/data-display/Item.md)
|
|
350
351
|
- [JsonRender](./llms/components/data-display/JsonRender.md)
|
|
351
352
|
- [JsonViewer](./llms/components/data-display/JsonViewer.md)
|