@alexgorbatchev/shadcn 0.0.104 → 0.0.106
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-38barrma.js +110 -0
- package/dist/{chunk-p8bdmafq.js → chunk-j7fvvgyp.js} +2 -2
- package/dist/{chunk-23ppkypt.js → chunk-me64e034.js} +1 -100
- package/dist/{chunk-e1hkq1mw.js → chunk-rxmcz0j1.js} +617 -481
- package/dist/components/ActionBar.d.ts +31 -0
- package/dist/components/ErrorSummary.d.ts +21 -0
- package/dist/components/Outline.d.ts +20 -0
- package/dist/components/data-grid/index.js +7 -5
- package/dist/components/image-viewer/ImageRegionFields.d.ts +15 -0
- package/dist/components/image-viewer/ImageRegionSelect.d.ts +11 -6
- package/dist/components/image-viewer/imageRegion.d.ts +21 -0
- package/dist/components/image-viewer/index.d.ts +3 -0
- package/dist/components/image-viewer/index.js +247 -92
- package/dist/components/json-render/JsonDropdownMenu.d.ts +4 -0
- package/dist/components/json-render/JsonForm.d.ts +90 -0
- package/dist/components/json-render/catalog.js +1 -1
- package/dist/components/json-render/index.d.ts +2 -0
- package/dist/components/json-render/index.js +487 -228
- package/dist/index.d.ts +5 -0
- package/dist/index.js +26 -10
- package/dist/prototype.js +1 -1
- package/llms/components/data-display/ImageViewer.md +2 -2
- package/llms/components/data-display/JsonRenderForm.md +99 -0
- package/llms/components/feedback/ErrorSummary.md +46 -0
- package/llms/components/layout/ActionBar.md +65 -0
- package/llms/components/navigation/Outline.md +42 -0
- package/llms.txt +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -36,6 +36,11 @@ export { useDropTarget } from "./hooks/useDropTarget.js";
|
|
|
36
36
|
export type { IDragDropItem, IDragSourceOptions, IDragSource, IDropTargetOptions, IDropTarget, } from "./drag-drop/types.js";
|
|
37
37
|
export { EmptyState } from "./components/EmptyState.js";
|
|
38
38
|
export { PageMessage } from "./components/PageMessage.js";
|
|
39
|
+
export { ActionBar, ActionBarRow } from "./components/ActionBar.js";
|
|
40
|
+
export type { IActionBarProps, IActionBarRowProps } from "./components/ActionBar.js";
|
|
41
|
+
export { ErrorSummary, ErrorSummaryItem } from "./components/ErrorSummary.js";
|
|
42
|
+
export type { IErrorSummaryProps, IErrorSummaryItemProps } from "./components/ErrorSummary.js";
|
|
43
|
+
export { Outline, OutlineSection, OutlineItem } from "./components/Outline.js";
|
|
39
44
|
export { DataViewer, formatDataLabel } from "./components/DataViewer.js";
|
|
40
45
|
export type { DataViewerProps } from "./components/DataViewer.js";
|
|
41
46
|
export { JsonViewer } from "./components/JsonViewer.js";
|
package/dist/index.js
CHANGED
|
@@ -17,6 +17,13 @@ import {
|
|
|
17
17
|
OptionCard2,
|
|
18
18
|
EmptyState3,
|
|
19
19
|
PageMessage2,
|
|
20
|
+
ActionBar2,
|
|
21
|
+
ActionBarRow2,
|
|
22
|
+
ErrorSummary2,
|
|
23
|
+
ErrorSummaryItem2,
|
|
24
|
+
Outline2,
|
|
25
|
+
OutlineSection2,
|
|
26
|
+
OutlineItem2,
|
|
20
27
|
formatDataLabel2,
|
|
21
28
|
DataViewer2,
|
|
22
29
|
JsonViewer2,
|
|
@@ -173,7 +180,7 @@ import {
|
|
|
173
180
|
StatusTracker2,
|
|
174
181
|
DashboardLayout2,
|
|
175
182
|
BillingUsage2
|
|
176
|
-
} from "./chunk-
|
|
183
|
+
} from "./chunk-rxmcz0j1.js";
|
|
177
184
|
import {
|
|
178
185
|
Combobox2,
|
|
179
186
|
ComboboxValue2,
|
|
@@ -190,15 +197,8 @@ import {
|
|
|
190
197
|
ComboboxChips2,
|
|
191
198
|
ComboboxChip2,
|
|
192
199
|
ComboboxChipsInput2,
|
|
193
|
-
useComboboxAnchor2
|
|
194
|
-
|
|
195
|
-
NumberFieldGroup2,
|
|
196
|
-
NumberFieldInput2,
|
|
197
|
-
NumberFieldDecrement2,
|
|
198
|
-
NumberFieldIncrement2,
|
|
199
|
-
NumberFieldScrubArea2,
|
|
200
|
-
NumberFieldScrubAreaCursor2
|
|
201
|
-
} from "./chunk-23ppkypt.js";
|
|
200
|
+
useComboboxAnchor2
|
|
201
|
+
} from "./chunk-me64e034.js";
|
|
202
202
|
import {
|
|
203
203
|
Tabs2,
|
|
204
204
|
tabsListVariants2,
|
|
@@ -214,6 +214,15 @@ import {
|
|
|
214
214
|
DropTarget2,
|
|
215
215
|
Kanban2
|
|
216
216
|
} from "./chunk-02220n6y.js";
|
|
217
|
+
import {
|
|
218
|
+
NumberField2,
|
|
219
|
+
NumberFieldGroup2,
|
|
220
|
+
NumberFieldInput2,
|
|
221
|
+
NumberFieldDecrement2,
|
|
222
|
+
NumberFieldIncrement2,
|
|
223
|
+
NumberFieldScrubArea2,
|
|
224
|
+
NumberFieldScrubAreaCursor2
|
|
225
|
+
} from "./chunk-38barrma.js";
|
|
217
226
|
import {
|
|
218
227
|
Toolbar2,
|
|
219
228
|
ToolbarButton2,
|
|
@@ -488,6 +497,8 @@ export {
|
|
|
488
497
|
AccordionItem2 as AccordionItem,
|
|
489
498
|
AccordionTrigger2 as AccordionTrigger,
|
|
490
499
|
AccountMenu2 as AccountMenu,
|
|
500
|
+
ActionBar2 as ActionBar,
|
|
501
|
+
ActionBarRow2 as ActionBarRow,
|
|
491
502
|
ActionsMenu2 as ActionsMenu,
|
|
492
503
|
ActionsMenuContextContent2 as ActionsMenuContextContent,
|
|
493
504
|
ActionsMenuContextTarget2 as ActionsMenuContextTarget,
|
|
@@ -644,6 +655,8 @@ export {
|
|
|
644
655
|
EmptyMedia2 as EmptyMedia,
|
|
645
656
|
EmptyState3 as EmptyState,
|
|
646
657
|
EmptyTitle2 as EmptyTitle,
|
|
658
|
+
ErrorSummary2 as ErrorSummary,
|
|
659
|
+
ErrorSummaryItem2 as ErrorSummaryItem,
|
|
647
660
|
Field2 as Field,
|
|
648
661
|
FieldContent2 as FieldContent,
|
|
649
662
|
FieldDescription2 as FieldDescription,
|
|
@@ -755,6 +768,9 @@ export {
|
|
|
755
768
|
OptionCard2 as OptionCard,
|
|
756
769
|
OptionCardGroup2 as OptionCardGroup,
|
|
757
770
|
OptionSelect2 as OptionSelect,
|
|
771
|
+
Outline2 as Outline,
|
|
772
|
+
OutlineItem2 as OutlineItem,
|
|
773
|
+
OutlineSection2 as OutlineSection,
|
|
758
774
|
PageHeader2 as PageHeader,
|
|
759
775
|
PageIntro2 as PageIntro,
|
|
760
776
|
PageMessage2 as PageMessage,
|
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.106",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -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 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, which wraps onto further rows when its controls do not fit. `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.
|
|
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, which wraps onto further rows when its controls do not fit. `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. `ImageRegionSelect` is a region tool for the overlay: a drag draws a region, a click places a half-size region centred on it and a second click makes the two clicks opposite corners; it reports each region through `onRegionChange` and draws the placed `region` with its text form (`formatImageRegion`, "Region 60% × 50% at 25%, 25%") as its accessible name. For keyboard placement, `placeImageRegion()` gives the half-size region in the middle and `applyImageRegionKey(region, key, shiftKey)` moves it by 5% with arrows or resizes it with Shift+arrows from `onStageKeyDown`; `ImageRegionFields` shows Left, Top, Width and Height as percent fields that take typed values.
|
|
4
4
|
|
|
5
5
|
Story: @alexgorbatchev/shadcn/components/data-display/ImageViewer
|
|
6
6
|
Source: src/components/stories/data-display/ImageViewer.stories.tsx
|
|
@@ -10,7 +10,7 @@ Source: src/components/stories/data-display/ImageViewer.stories.tsx
|
|
|
10
10
|
## Public imports
|
|
11
11
|
|
|
12
12
|
```tsx
|
|
13
|
-
import {
|
|
13
|
+
import { ImageRegionFields, ImageRegionSelect, applyImageRegionKey, formatImageRegion, placeImageRegion, ImageViewer, ImageZoomToggle, getNormalizedImagePoint, type IImageRect, type IImageViewerProps, type INormalizedImagePoint, type ImageZoom } from "@alexgorbatchev/shadcn/image-viewer";
|
|
14
14
|
import { Button, Toggle, Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from "@alexgorbatchev/shadcn";
|
|
15
15
|
```
|
|
16
16
|
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# JsonRenderForm
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/data-display/JsonRenderForm
|
|
4
|
+
Source: src/components/stories/data-display/JsonRenderForm.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/JsonRenderForm.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
import { components, componentDefinitions, JsonFormProvider, stripRequiredMark, useJsonReveal, type JsonFormMode } from "@alexgorbatchev/shadcn/json-render";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Supporting imports
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { useEffect, useState, type ReactElement } from "react";
|
|
19
|
+
import { createStateStore, defineCatalog, type Spec } from "@json-render/core";
|
|
20
|
+
import { JSONUIProvider, Renderer, defineRegistry } from "@json-render/react";
|
|
21
|
+
import { schema } from "@json-render/react/schema";
|
|
22
|
+
import { z } from "zod";
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Default component
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
JsonFormExample
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
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.
|
|
34
|
+
|
|
35
|
+
### RequiredAndMessages
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
{
|
|
39
|
+
args: {
|
|
40
|
+
spec: answerSpec,
|
|
41
|
+
state: { answers: { company: "", notes: "", plan: "", frequency: "", agree: false, alerts: false, volume: 0 } },
|
|
42
|
+
errors: { "/answers/company": "Company name: Enter a name" },
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### LockedKeepsReadingControls
|
|
48
|
+
|
|
49
|
+
```tsx
|
|
50
|
+
{
|
|
51
|
+
args: { spec: answerSpec, state: { answers }, mode: "locked" }
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### ReadOnlyValues
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
{
|
|
59
|
+
args: { spec: answerSpec, state: { answers }, mode: "values" }
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### DropdownMenuChoice
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
{
|
|
67
|
+
args: { spec: answerSpec, state: { answers: {} } }
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### RevealOpensHidingContainers
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
{
|
|
75
|
+
args: {
|
|
76
|
+
reveal: ["inSection", "inTab"],
|
|
77
|
+
spec: {
|
|
78
|
+
root: "tabs",
|
|
79
|
+
elements: {
|
|
80
|
+
tabs: {
|
|
81
|
+
type: "Tabs",
|
|
82
|
+
props: {
|
|
83
|
+
tabs: [
|
|
84
|
+
{ value: "overview", label: "Overview" },
|
|
85
|
+
{ value: "decide", label: "Decide" },
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
children: ["overview", "decide"],
|
|
89
|
+
},
|
|
90
|
+
overview: { type: "Text", props: { text: "Overview panel" } },
|
|
91
|
+
decide: { type: "Stack", props: {}, children: ["inTab", "section"] },
|
|
92
|
+
inTab: { type: "RevealProbe", props: { name: "inTab" } },
|
|
93
|
+
section: { type: "Collapsible", props: { title: "Advanced" }, children: ["inSection"] },
|
|
94
|
+
inSection: { type: "RevealProbe", props: { name: "inSection" } },
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ErrorSummary
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/feedback/ErrorSummary
|
|
4
|
+
Source: src/components/stories/feedback/ErrorSummary.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/feedback/ErrorSummary.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ErrorSummary, ErrorSummaryItem } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
ErrorSummary
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Default
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: {
|
|
29
|
+
title: "2 answers needed",
|
|
30
|
+
children: (<>
|
|
31
|
+
<ErrorSummaryItem onSelect={goToDescription}>
|
|
32
|
+
Describe the company in one sentence: Describe the company
|
|
33
|
+
</ErrorSummaryItem>
|
|
34
|
+
<ErrorSummaryItem onSelect={goToDeadline}>Launch deadline: Enter a deadline</ErrorSummaryItem>
|
|
35
|
+
</>),
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### NestedHeading
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
{
|
|
44
|
+
args: { ...Default.args, headingLevel: 3 }
|
|
45
|
+
}
|
|
46
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# ActionBar
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/layout/ActionBar
|
|
4
|
+
Source: src/components/stories/layout/ActionBar.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/layout/ActionBar.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { ActionBar, ActionBarRow, Button } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
ActionBar
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### AtRest
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: { progress: 7 / 11, role: "region", "aria-label": "Hand back Round 1", children: <Rows /> }
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### OneRowWithoutWrapping
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
{
|
|
36
|
+
args: {
|
|
37
|
+
children: (<ActionBarRow justify="between" align="end" wrap={false}>
|
|
38
|
+
<span>7 of 11</span>
|
|
39
|
+
<Button type="button">I’m done</Button>
|
|
40
|
+
</ActionBarRow>),
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### StuckToTheBottom
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
{
|
|
49
|
+
args: { sticky: true, stuck: true, surface: "card", progress: 2, children: <Rows /> },
|
|
50
|
+
decorators: [
|
|
51
|
+
(Story) => (<div data-testid="scroller" className="h-48 overflow-auto bg-card" data-scroll="intentional">
|
|
52
|
+
<div className="h-96">Content above the bar</div>
|
|
53
|
+
<Story />
|
|
54
|
+
</div>),
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### WithoutMeter
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
{
|
|
63
|
+
args: { progress: undefined, children: <Rows /> }
|
|
64
|
+
}
|
|
65
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Outline
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/navigation/Outline
|
|
4
|
+
Source: src/components/stories/navigation/Outline.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/navigation/Outline.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { Outline, OutlineItem, OutlineSection } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Default component
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
Outline
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
### Default
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
{
|
|
28
|
+
args: {
|
|
29
|
+
className: "max-w-72",
|
|
30
|
+
children: (<>
|
|
31
|
+
<OutlineSection title="Basics" meta="2 of 3 answered">
|
|
32
|
+
<OutlineItem label="Company name" state="Answered" onSelect={fn()}/>
|
|
33
|
+
<OutlineItem label="Describe the company in one sentence" state="Not answered" onSelect={fn()}/>
|
|
34
|
+
<OutlineItem label="Primary audience" state="Answered" onSelect={fn()}/>
|
|
35
|
+
</OutlineSection>
|
|
36
|
+
<OutlineSection title="Voice">
|
|
37
|
+
<OutlineItem label="Technical jargon" onSelect={goToJargon}/>
|
|
38
|
+
</OutlineSection>
|
|
39
|
+
</>),
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
package/llms.txt
CHANGED
|
@@ -346,10 +346,11 @@ Generated from the public package exports and Storybook sources.
|
|
|
346
346
|
- [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.
|
|
347
347
|
- [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.
|
|
348
348
|
- [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.
|
|
349
|
-
- [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, which wraps onto further rows when its controls do not fit. `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
|
+
- [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, which wraps onto further rows when its controls do not fit. `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. `ImageRegionSelect` is a region tool for the overlay: a drag draws a region, a click places a half-size region centred on it and a second click makes the two clicks opposite corners; it reports each region through `onRegionChange` and draws the placed `region` with its text form (`formatImageRegion`, "Region 60% × 50% at 25%, 25%") as its accessible name. For keyboard placement, `placeImageRegion()` gives the half-size region in the middle and `applyImageRegionKey(region, key, shiftKey)` moves it by 5% with arrows or resizes it with Shift+arrows from `onStageKeyDown`; `ImageRegionFields` shows Left, Top, Width and Height as percent fields that take typed values.
|
|
350
350
|
- [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.
|
|
351
351
|
- [Item](./llms/components/data-display/Item.md)
|
|
352
352
|
- [JsonRender](./llms/components/data-display/JsonRender.md)
|
|
353
|
+
- [JsonRenderForm](./llms/components/data-display/JsonRenderForm.md)
|
|
353
354
|
- [JsonViewer](./llms/components/data-display/JsonViewer.md)
|
|
354
355
|
- [Kbd](./llms/components/data-display/Kbd.md)
|
|
355
356
|
- [Meter](./llms/components/data-display/Meter.md)
|
|
@@ -381,6 +382,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
381
382
|
- [Alert](./llms/components/feedback/Alert.md)
|
|
382
383
|
- [Empty](./llms/components/feedback/Empty.md)
|
|
383
384
|
- [EmptyState](./llms/components/feedback/EmptyState.md)
|
|
385
|
+
- [ErrorSummary](./llms/components/feedback/ErrorSummary.md)
|
|
384
386
|
- [PageMessage](./llms/components/feedback/PageMessage.md)
|
|
385
387
|
- [Progress](./llms/components/feedback/Progress.md)
|
|
386
388
|
- [Skeleton](./llms/components/feedback/Skeleton.md)
|
|
@@ -425,6 +427,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
425
427
|
## layout
|
|
426
428
|
|
|
427
429
|
- [Accordion](./llms/components/layout/Accordion.md)
|
|
430
|
+
- [ActionBar](./llms/components/layout/ActionBar.md)
|
|
428
431
|
- [AppShell](./llms/components/layout/AppShell.md)
|
|
429
432
|
- [AspectRatio](./llms/components/layout/AspectRatio.md)
|
|
430
433
|
- [BillingUsage](./llms/components/layout/BillingUsage.md)
|
|
@@ -459,6 +462,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
459
462
|
- [DropdownMenu](./llms/components/navigation/DropdownMenu.md)
|
|
460
463
|
- [Menubar](./llms/components/navigation/Menubar.md)
|
|
461
464
|
- [NavigationMenu](./llms/components/navigation/NavigationMenu.md)
|
|
465
|
+
- [Outline](./llms/components/navigation/Outline.md)
|
|
462
466
|
- [Pagination](./llms/components/navigation/Pagination.md)
|
|
463
467
|
- [Sidebar](./llms/components/navigation/Sidebar.md)
|
|
464
468
|
- [Tabs](./llms/components/navigation/Tabs.md)
|