@alexgorbatchev/shadcn 0.0.103 → 0.0.104
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-n593jqmw.js → chunk-e1hkq1mw.js} +346 -312
- package/dist/components/DescriptionList.d.ts +18 -0
- package/dist/components/json-render/index.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -1
- package/dist/prototype.js +1 -1
- package/llms/components/data-display/DescriptionList.md +56 -0
- package/llms.txt +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IDensityProps } from "../density/types.js";
|
|
2
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
3
|
+
type DescriptionListProps = ComponentProps<"dl"> & IDensityProps;
|
|
4
|
+
/**
|
|
5
|
+
* A stacked description list: each item puts its term on one line and its details under it, full width, in reading
|
|
6
|
+
* order at every width. Use it for question-and-answer summaries and other term/value pairs whose terms can be long.
|
|
7
|
+
*/
|
|
8
|
+
declare function DescriptionList({ density, className, ...props }: DescriptionListProps): ReactElement;
|
|
9
|
+
type DescriptionListItemProps = ComponentProps<"div"> & IDensityProps;
|
|
10
|
+
/** One term and its details; HTML allows a `div` to group them inside a `dl`. */
|
|
11
|
+
declare function DescriptionListItem({ density, className, ...props }: DescriptionListItemProps): ReactElement;
|
|
12
|
+
type DescriptionTermProps = ComponentProps<"dt"> & IDensityProps;
|
|
13
|
+
declare function DescriptionTerm({ density, className, ...props }: DescriptionTermProps): ReactElement;
|
|
14
|
+
type DescriptionDetailsProps = ComponentProps<"dd"> & IDensityProps;
|
|
15
|
+
/** The details keep their line breaks, so multi-line text reads as it was written. */
|
|
16
|
+
declare function DescriptionDetails({ density, className, ...props }: DescriptionDetailsProps): ReactElement;
|
|
17
|
+
export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails };
|
|
18
|
+
export type { DescriptionListProps, DescriptionListItemProps, DescriptionTermProps, DescriptionDetailsProps };
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,8 @@ export type { TableTextAlign, TableVisibility } from "./components/Table.js";
|
|
|
73
73
|
export { OptionSelect } from "./components/OptionSelect.js";
|
|
74
74
|
export type { OptionSelectOption, OptionSelectProps } from "./components/OptionSelect.js";
|
|
75
75
|
export { Kbd, KbdGroup } from "./components/Kbd.js";
|
|
76
|
+
export { DescriptionList, DescriptionListItem, DescriptionTerm, DescriptionDetails, } from "./components/DescriptionList.js";
|
|
77
|
+
export type { DescriptionListProps, DescriptionListItemProps, DescriptionTermProps, DescriptionDetailsProps, } from "./components/DescriptionList.js";
|
|
76
78
|
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, } from "./components/Item.js";
|
|
77
79
|
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, } from "./components/Pagination.js";
|
|
78
80
|
export { ScrollArea, ScrollBar } from "./components/ScrollArea.js";
|
package/dist/index.js
CHANGED
|
@@ -49,6 +49,10 @@ import {
|
|
|
49
49
|
ButtonGroup2,
|
|
50
50
|
ButtonGroupText2,
|
|
51
51
|
ButtonGroupSeparator2,
|
|
52
|
+
DescriptionList2,
|
|
53
|
+
DescriptionListItem2,
|
|
54
|
+
DescriptionTerm2,
|
|
55
|
+
DescriptionDetails2,
|
|
52
56
|
ItemGroup2,
|
|
53
57
|
ItemSeparator2,
|
|
54
58
|
Item2,
|
|
@@ -169,7 +173,7 @@ import {
|
|
|
169
173
|
StatusTracker2,
|
|
170
174
|
DashboardLayout2,
|
|
171
175
|
BillingUsage2
|
|
172
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-e1hkq1mw.js";
|
|
173
177
|
import {
|
|
174
178
|
Combobox2,
|
|
175
179
|
ComboboxValue2,
|
|
@@ -588,6 +592,10 @@ export {
|
|
|
588
592
|
DashboardLayout2 as DashboardLayout,
|
|
589
593
|
DataViewer2 as DataViewer,
|
|
590
594
|
DensityProvider2 as DensityProvider,
|
|
595
|
+
DescriptionDetails2 as DescriptionDetails,
|
|
596
|
+
DescriptionList2 as DescriptionList,
|
|
597
|
+
DescriptionListItem2 as DescriptionListItem,
|
|
598
|
+
DescriptionTerm2 as DescriptionTerm,
|
|
591
599
|
Dialog2 as Dialog,
|
|
592
600
|
DialogClose2 as DialogClose,
|
|
593
601
|
DialogContent2 as DialogContent,
|
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.104",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# DescriptionList
|
|
2
|
+
|
|
3
|
+
Story: @alexgorbatchev/shadcn/components/data-display/DescriptionList
|
|
4
|
+
Source: src/components/stories/data-display/DescriptionList.stories.tsx
|
|
5
|
+
|
|
6
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/DescriptionList.stories.tsx)
|
|
7
|
+
|
|
8
|
+
## Public imports
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { DescriptionDetails, DescriptionList, DescriptionListItem, DescriptionTerm } from "@alexgorbatchev/shadcn";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Supporting imports
|
|
15
|
+
|
|
16
|
+
```tsx
|
|
17
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Default component
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
DescriptionList
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Default args
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
{ "aria-label": "Answers sent" }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Default render
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
renderList
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
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.
|
|
41
|
+
|
|
42
|
+
### Stacked
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
{}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Narrow
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
{
|
|
52
|
+
render: (args) => (<div data-testid="narrow" className="w-48">
|
|
53
|
+
{renderList(args)}
|
|
54
|
+
</div>)
|
|
55
|
+
}
|
|
56
|
+
```
|
package/llms.txt
CHANGED
|
@@ -341,6 +341,7 @@ 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
|
+
- [DescriptionList](./llms/components/data-display/DescriptionList.md)
|
|
344
345
|
- [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.
|
|
345
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.
|
|
346
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.
|