@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
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
interface IActionBarProps extends ComponentProps<"div"> {
|
|
3
|
+
/**
|
|
4
|
+
* Sticks the bar to the bottom of its scrolling container while the content it ends continues below the visible area;
|
|
5
|
+
* where the content ends, the bar rests in place.
|
|
6
|
+
*/
|
|
7
|
+
sticky?: boolean;
|
|
8
|
+
/** Set while the bar is stuck, for its compact form: tighter spacing and no resting top padding. */
|
|
9
|
+
stuck?: boolean;
|
|
10
|
+
/** The surface the bar covers while stuck, so content scrolling under it stays hidden. */
|
|
11
|
+
surface?: "background" | "card";
|
|
12
|
+
/**
|
|
13
|
+
* A decorative meter along the bar's top edge, from 0 to 1. It is hidden from assistive technology: state the value in
|
|
14
|
+
* text, because screen readers report progress changes on their own.
|
|
15
|
+
*/
|
|
16
|
+
progress?: number;
|
|
17
|
+
}
|
|
18
|
+
/** The bar that ends a form or a task: its status, what its action does and the action, in rows. */
|
|
19
|
+
declare function ActionBar({ sticky, stuck, surface, progress, className, children, ...props }: IActionBarProps): ReactElement;
|
|
20
|
+
interface IActionBarRowProps extends ComponentProps<"div"> {
|
|
21
|
+
/** How the row distributes its items; `between` puts the last item, usually the primary action, at the end. */
|
|
22
|
+
justify?: "start" | "between" | "end";
|
|
23
|
+
/** `end` aligns items to the row's bottom, so an action lines up with the last line of a multi-line status. */
|
|
24
|
+
align?: "center" | "end";
|
|
25
|
+
/** Whether items wrap onto further lines; a one-row bar sets it false. */
|
|
26
|
+
wrap?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** One row of an `ActionBar`. */
|
|
29
|
+
declare function ActionBarRow({ justify, align, wrap, className, ...props }: IActionBarRowProps): ReactElement;
|
|
30
|
+
export { ActionBar, ActionBarRow };
|
|
31
|
+
export type { IActionBarProps, IActionBarRowProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
interface IErrorSummaryProps extends Omit<ComponentProps<"section">, "title"> {
|
|
3
|
+
/** Names what is missing, such as "3 answers needed". */
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
/** The heading level of the title within the page. */
|
|
6
|
+
headingLevel?: 2 | 3 | 4;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The list of problems that stop a form from completing, at the top of the form: a heading, then one link per problem
|
|
10
|
+
* that takes the person to its field.
|
|
11
|
+
*/
|
|
12
|
+
declare function ErrorSummary({ title, headingLevel, className, children, ...props }: IErrorSummaryProps): ReactElement;
|
|
13
|
+
interface IErrorSummaryItemProps {
|
|
14
|
+
/** Moves to the problem's field: opens whatever hides it, then focuses it. */
|
|
15
|
+
onSelect: () => void;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/** One problem in an `ErrorSummary`: a link-styled button that goes to its field. */
|
|
19
|
+
declare function ErrorSummaryItem({ onSelect, children }: IErrorSummaryItemProps): ReactElement;
|
|
20
|
+
export { ErrorSummary, ErrorSummaryItem };
|
|
21
|
+
export type { IErrorSummaryProps, IErrorSummaryItemProps };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactElement, type ReactNode } from "react";
|
|
2
|
+
/** A list of a document's parts, each a button that goes to its part, grouped into titled sections. */
|
|
3
|
+
declare function Outline({ className, ...props }: ComponentProps<"div">): ReactElement;
|
|
4
|
+
interface IOutlineSectionProps {
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** A short summary beside the title, such as "3 of 4 answered". */
|
|
7
|
+
meta?: ReactNode;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** A titled group of `OutlineItem`s, named by its title. */
|
|
11
|
+
declare function OutlineSection({ title, meta, children }: IOutlineSectionProps): ReactElement;
|
|
12
|
+
interface IOutlineItemProps {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** The part's state, such as "Not answered". */
|
|
15
|
+
state?: ReactNode;
|
|
16
|
+
onSelect: () => void;
|
|
17
|
+
}
|
|
18
|
+
/** One part in an `OutlineSection`: a button with the part's name and state that goes to it. */
|
|
19
|
+
declare function OutlineItem({ label, state, onSelect }: IOutlineItemProps): ReactElement;
|
|
20
|
+
export { Outline, OutlineSection, OutlineItem };
|
|
@@ -45,16 +45,18 @@ import {
|
|
|
45
45
|
ComboboxChips2,
|
|
46
46
|
ComboboxChip2,
|
|
47
47
|
ComboboxChipsInput2,
|
|
48
|
-
useComboboxAnchor2
|
|
49
|
-
|
|
50
|
-
NumberFieldGroup2,
|
|
51
|
-
NumberFieldInput2
|
|
52
|
-
} from "../../chunk-23ppkypt.js";
|
|
48
|
+
useComboboxAnchor2
|
|
49
|
+
} from "../../chunk-me64e034.js";
|
|
53
50
|
import {
|
|
54
51
|
Badge2
|
|
55
52
|
} from "../../chunk-9t530p75.js";
|
|
56
53
|
import"../../chunk-9k5b62qf.js";
|
|
57
54
|
import"../../chunk-mm3a9s11.js";
|
|
55
|
+
import {
|
|
56
|
+
NumberField2,
|
|
57
|
+
NumberFieldGroup2,
|
|
58
|
+
NumberFieldInput2
|
|
59
|
+
} from "../../chunk-38barrma.js";
|
|
58
60
|
import {
|
|
59
61
|
ScrollArea2
|
|
60
62
|
} from "../../chunk-f9sm5zpv.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ReactElement } from "react";
|
|
2
|
+
import type { IDensityProps } from "../../density/types.js";
|
|
3
|
+
import type { IImageRect } from "./types.js";
|
|
4
|
+
export interface IImageRegionFieldsProps extends IDensityProps {
|
|
5
|
+
region: IImageRect;
|
|
6
|
+
onRegionChange: (region: IImageRect) => void;
|
|
7
|
+
/** Accessible name of the group. Defaults to "Region". */
|
|
8
|
+
label?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A placed region's Left, Top, Width and Height as four percent fields that take typed values, for steps finer than
|
|
13
|
+
* the arrow keys' 5%. Values outside the image are pulled back inside it.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ImageRegionFields({ region, onRegionChange, label, className, density, }: IImageRegionFieldsProps): ReactElement;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import type { IImageRect } from "./types.js";
|
|
3
3
|
export interface IImageRegionSelectProps {
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/** The placed region, drawn until it changes or is removed. */
|
|
5
|
+
region?: IImageRect;
|
|
6
|
+
/** Receives each placed region in normalized image coordinates, each value from 0 to 1. */
|
|
7
|
+
onRegionChange: (region: IImageRect) => void;
|
|
6
8
|
}
|
|
7
9
|
/**
|
|
8
|
-
* Region tool for an `ImageViewer` overlay
|
|
9
|
-
*
|
|
10
|
-
*
|
|
10
|
+
* Region tool for an `ImageViewer` overlay. A drag with one pointer draws a region; a click without a drag places a
|
|
11
|
+
* region half the image's size centred on the click, and a second click before anything else changes it makes the two
|
|
12
|
+
* clicks opposite corners, the non-drag alternative WCAG 2.5.7 asks for. Pair it with `applyImageRegionKey` and
|
|
13
|
+
* `placeImageRegion` on the stage's keys and `ImageRegionFields` for typed values. Render it only while the person has
|
|
14
|
+
* turned a region tool on, so pans and pinches stay navigation otherwise. Its pointer is kept from panning the stage; a
|
|
15
|
+
* second finger cancels the drawing and pinch-zooms instead.
|
|
11
16
|
*/
|
|
12
|
-
export declare function ImageRegionSelect({
|
|
17
|
+
export declare function ImageRegionSelect({ region, onRegionChange }: IImageRegionSelectProps): ReactElement;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IImageRect, INormalizedImagePoint } from "./types.js";
|
|
2
|
+
/** How far one arrow press moves or resizes a placed region, as a fraction of the image. */
|
|
3
|
+
export declare const IMAGE_REGION_STEP = 0.05;
|
|
4
|
+
/** The smallest width or height a placed region keeps, as a fraction of the image. */
|
|
5
|
+
export declare const MIN_IMAGE_REGION_SIZE = 0.01;
|
|
6
|
+
/** Keeps a region inside the image and at least the minimum size. */
|
|
7
|
+
export declare function clampImageRegion(region: IImageRect): IImageRect;
|
|
8
|
+
/**
|
|
9
|
+
* Places a region half the image's width and height, centred on `center` and kept inside the image. Without a center
|
|
10
|
+
* it sits in the image's middle, as Enter places it on a focused stage.
|
|
11
|
+
*/
|
|
12
|
+
export declare function placeImageRegion(center?: INormalizedImagePoint): IImageRect;
|
|
13
|
+
/** The region whose opposite corners are two clicked points. */
|
|
14
|
+
export declare function getImageRegionFromCorners(first: INormalizedImagePoint, second: INormalizedImagePoint): IImageRect;
|
|
15
|
+
/**
|
|
16
|
+
* Applies an arrow key to a placed region: an arrow moves it by one step and Shift with an arrow resizes it, growing
|
|
17
|
+
* to the right and down and shrinking from there. Returns undefined for any other key, so the stage keeps panning.
|
|
18
|
+
*/
|
|
19
|
+
export declare function applyImageRegionKey(region: IImageRect, key: string, isResize: boolean, step?: number): IImageRect | undefined;
|
|
20
|
+
/** A region's text form, which is also its accessible name: "Region 60% × 50% at 25%, 25%". */
|
|
21
|
+
export declare function formatImageRegion(region: IImageRect): string;
|
|
@@ -6,6 +6,9 @@ export { ImageZoomControl } from "./ImageZoomControl.js";
|
|
|
6
6
|
export type { IImageZoomControlProps } from "./ImageZoomControl.js";
|
|
7
7
|
export { ImageRegionSelect } from "./ImageRegionSelect.js";
|
|
8
8
|
export type { IImageRegionSelectProps } from "./ImageRegionSelect.js";
|
|
9
|
+
export { ImageRegionFields } from "./ImageRegionFields.js";
|
|
10
|
+
export type { IImageRegionFieldsProps } from "./ImageRegionFields.js";
|
|
11
|
+
export { IMAGE_REGION_STEP, MIN_IMAGE_REGION_SIZE, applyImageRegionKey, clampImageRegion, formatImageRegion, getImageRegionFromCorners, placeImageRegion, } from "./imageRegion.js";
|
|
9
12
|
export { FramedImage } from "./FramedImage.js";
|
|
10
13
|
export type { FramedImageSize, IFramedImageProps } from "./FramedImage.js";
|
|
11
14
|
export { ImageComparison } from "./ImageComparison.js";
|