@alexgorbatchev/shadcn 0.0.124 → 0.0.125
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-bvzjbk43.js +48 -0
- package/dist/{chunk-xdher2cd.js → chunk-kx91d0g6.js} +222 -145
- package/dist/components/DescriptionList.d.ts +16 -6
- package/dist/components/Heading.d.ts +1 -1
- package/dist/components/PageHeader.d.ts +7 -2
- package/dist/components/PageIntro.d.ts +7 -2
- package/dist/components/Quote.d.ts +16 -0
- package/dist/components/SkipLink.d.ts +14 -0
- package/dist/components/StatusDot.d.ts +18 -0
- package/dist/components/json-render/index.js +2 -1
- package/dist/components/tree/index.js +6 -20
- package/dist/index.d.ts +6 -0
- package/dist/index.js +13 -1
- package/dist/prototype.js +1 -1
- package/dist/typeset.css +4 -1
- package/llms/components/data-display/DescriptionList.md +16 -0
- package/llms/components/data-display/Heading.md +18 -2
- package/llms/components/data-display/Quote.md +90 -0
- package/llms/components/data-display/StatusDot.md +80 -0
- package/llms/components/layout/PageHeader.md +8 -0
- package/llms/components/layout/PageIntro.md +8 -0
- package/llms/components/navigation/SkipLink.md +63 -0
- package/llms.txt +4 -1
- package/package.json +1 -1
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import type { IDensityProps } from "../density/types.js";
|
|
2
2
|
import type { ComponentProps, ReactElement } from "react";
|
|
3
|
-
type
|
|
3
|
+
import type { StackDirection } from "../layout/types.js";
|
|
4
|
+
type DescriptionListProps = ComponentProps<"dl"> & IDensityProps & {
|
|
5
|
+
/**
|
|
6
|
+
* `vertical` (the default) stacks each term above its details. `horizontal` puts the term at the start and the
|
|
7
|
+
* details at the end of one row, for short pairs such as a shortcut and its keys; a row too narrow for both wraps.
|
|
8
|
+
*/
|
|
9
|
+
orientation?: StackDirection;
|
|
10
|
+
};
|
|
4
11
|
/**
|
|
5
|
-
* A
|
|
6
|
-
* order at every width
|
|
12
|
+
* A description list. Stacked by default: each item puts its term on one line and its details under it, full width,
|
|
13
|
+
* in reading order at every width, for question-and-answer summaries and other pairs whose terms can be long.
|
|
7
14
|
*/
|
|
8
|
-
declare function DescriptionList({ density, className, ...props }: DescriptionListProps): ReactElement;
|
|
15
|
+
declare function DescriptionList({ density, orientation, className, ...props }: DescriptionListProps): ReactElement;
|
|
9
16
|
type DescriptionListItemProps = ComponentProps<"div"> & IDensityProps;
|
|
10
17
|
/** One term and its details; HTML allows a `div` to group them inside a `dl`. */
|
|
11
18
|
declare function DescriptionListItem({ density, className, ...props }: DescriptionListItemProps): ReactElement;
|
|
12
|
-
type DescriptionTermProps = ComponentProps<"dt"> & IDensityProps
|
|
13
|
-
|
|
19
|
+
type DescriptionTermProps = ComponentProps<"dt"> & IDensityProps & {
|
|
20
|
+
/** `muted` (the default) suits a question above its answer; `default` suits a label that is the primary text. */
|
|
21
|
+
tone?: "muted" | "default";
|
|
22
|
+
};
|
|
23
|
+
declare function DescriptionTerm({ density, tone, className, ...props }: DescriptionTermProps): ReactElement;
|
|
14
24
|
type DescriptionDetailsProps = ComponentProps<"dd"> & IDensityProps;
|
|
15
25
|
/** The details keep their line breaks, so multi-line text reads as it was written. */
|
|
16
26
|
declare function DescriptionDetails({ density, className, ...props }: DescriptionDetailsProps): ReactElement;
|
|
@@ -2,7 +2,7 @@ import type { ReactElement } from "react";
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
import type { Density, IDensityProps } from "../density/types.js";
|
|
4
4
|
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
-
type HeadingSize = "sm" | "base" | "lg" | "xl";
|
|
5
|
+
type HeadingSize = "sm" | "base" | "lg" | "xl" | "2xl" | "3xl";
|
|
6
6
|
type HeadingState = {
|
|
7
7
|
slot: "heading";
|
|
8
8
|
level: HeadingLevel;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from "react";
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { IDensityProps } from "../density/types.js";
|
|
3
|
+
import type { HeadingSize } from "./Heading.js";
|
|
3
4
|
type PageHeaderProps = IDensityProps & {
|
|
4
5
|
title: string;
|
|
6
|
+
/** The title's visual size. Defaults to `xl`; a page's own title can take a display size such as `3xl`. */
|
|
7
|
+
titleSize?: HeadingSize;
|
|
8
|
+
/** Props for the title's `h1`, such as a `ref` and `tabIndex={-1}` so the app can move focus to it. */
|
|
9
|
+
headingProps?: Omit<ComponentProps<"h1">, "children">;
|
|
5
10
|
/** Context above the page title without introducing another heading. */
|
|
6
11
|
eyebrow?: ReactNode;
|
|
7
12
|
description?: ReactNode;
|
|
8
13
|
breadcrumbs?: ReactNode;
|
|
9
14
|
actions?: ReactNode;
|
|
10
15
|
};
|
|
11
|
-
declare function PageHeader({ title, eyebrow, description, breadcrumbs, actions, density }: PageHeaderProps): ReactElement;
|
|
16
|
+
declare function PageHeader({ title, titleSize, headingProps, eyebrow, description, breadcrumbs, actions, density, }: PageHeaderProps): ReactElement;
|
|
12
17
|
export { PageHeader };
|
|
13
18
|
export type { PageHeaderProps };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from "react";
|
|
1
|
+
import type { ComponentProps, ReactElement, ReactNode } from "react";
|
|
2
2
|
import type { IDensityProps } from "../density/types.js";
|
|
3
|
+
import type { HeadingSize } from "./Heading.js";
|
|
3
4
|
type PageIntroHighlight = {
|
|
4
5
|
title: string;
|
|
5
6
|
description: ReactNode;
|
|
@@ -7,6 +8,10 @@ type PageIntroHighlight = {
|
|
|
7
8
|
};
|
|
8
9
|
type PageIntroProps = IDensityProps & {
|
|
9
10
|
title: string;
|
|
11
|
+
/** The title's visual size. Defaults to `2xl`; match the app's page titles with a display size such as `3xl`. */
|
|
12
|
+
titleSize?: HeadingSize;
|
|
13
|
+
/** Props for the title's `h1`, such as a `ref` and `tabIndex={-1}` so the app can move focus to it. */
|
|
14
|
+
headingProps?: Omit<ComponentProps<"h1">, "children">;
|
|
10
15
|
/** One inviting sentence on what this page is for. */
|
|
11
16
|
description: ReactNode;
|
|
12
17
|
/** Context above the page title without introducing another heading. */
|
|
@@ -17,6 +22,6 @@ type PageIntroProps = IDensityProps & {
|
|
|
17
22
|
/** Short items naming what people can do here, laid out in as many columns as the intro's width allows. */
|
|
18
23
|
highlights?: readonly PageIntroHighlight[];
|
|
19
24
|
};
|
|
20
|
-
declare function PageIntro({ title, description, eyebrow, icon, actions, highlights, density }: PageIntroProps): ReactElement;
|
|
25
|
+
declare function PageIntro({ title, titleSize, headingProps, description, eyebrow, icon, actions, highlights, density, }: PageIntroProps): ReactElement;
|
|
21
26
|
export { PageIntro };
|
|
22
27
|
export type { PageIntroHighlight, PageIntroProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
import type { IDensityProps } from "../density/types.js";
|
|
4
|
+
declare const quoteVariants: (props?: ({
|
|
5
|
+
size?: "compact" | "default" | null | undefined;
|
|
6
|
+
clamp?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
type QuoteProps = ComponentProps<"blockquote"> & VariantProps<typeof quoteVariants> & IDensityProps;
|
|
9
|
+
/**
|
|
10
|
+
* Text quoted from elsewhere, such as the passage a comment targets or the message a reply answers. A logical
|
|
11
|
+
* start rule marks it as a quote in both reading directions; `compact` fits message footers and bubbles, and `clamp`
|
|
12
|
+
* stops a long quote after two lines.
|
|
13
|
+
*/
|
|
14
|
+
declare function Quote({ size, clamp, density, className, ...props }: QuoteProps): ReactElement;
|
|
15
|
+
export { Quote, quoteVariants };
|
|
16
|
+
export type { QuoteProps };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
import { ButtonLink } from "./ButtonLink.js";
|
|
3
|
+
type SkipLinkProps = Omit<ComponentProps<typeof ButtonLink>, "variant" | "size" | "href"> & {
|
|
4
|
+
/** The id of the element to skip to. Pass `onClick` as well when the app moves focus itself. */
|
|
5
|
+
targetId: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The first stop for keyboard users: a link to the main content, hidden until it receives keyboard focus, then shown
|
|
9
|
+
* as an outline button pinned to the top start corner. It jumps to `targetId`; an `onClick` that calls
|
|
10
|
+
* `preventDefault` lets the app move focus itself, such as to the page's heading.
|
|
11
|
+
*/
|
|
12
|
+
declare function SkipLink({ targetId, className, children, ...props }: SkipLinkProps): ReactElement;
|
|
13
|
+
export { SkipLink };
|
|
14
|
+
export type { SkipLinkProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentProps, ReactElement } from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const statusDotVariants: (props?: ({
|
|
4
|
+
tone?: "primary" | "muted" | null | undefined;
|
|
5
|
+
placement?: "inline" | "corner" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
type StatusDotProps = Omit<ComponentProps<"span">, "children"> & VariantProps<typeof statusDotVariants> & {
|
|
8
|
+
/** A number beside the dot, such as the new items it rolls up; omitted for a single item. */
|
|
9
|
+
count?: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* A small status dot for "new" or "waiting", with an optional count. Drawn as an SVG fill in `currentColor`, so forced
|
|
13
|
+
* colors keep it visible. It is decorative and hidden from assistive technology: say what it means in nearby text or
|
|
14
|
+
* the control's accessible name.
|
|
15
|
+
*/
|
|
16
|
+
declare function StatusDot({ tone, placement, count, className, ...props }: StatusDotProps): ReactElement;
|
|
17
|
+
export { StatusDot, statusDotVariants };
|
|
18
|
+
export type { StatusDotProps };
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PaginationPrevious2,
|
|
27
27
|
PaginationNext2,
|
|
28
28
|
PaginationEllipsis2
|
|
29
|
-
} from "../../chunk-
|
|
29
|
+
} from "../../chunk-kx91d0g6.js";
|
|
30
30
|
import {
|
|
31
31
|
MenuPopup,
|
|
32
32
|
MenuItem2,
|
|
@@ -157,6 +157,7 @@ import"../../chunk-dhtk1cfw.js";
|
|
|
157
157
|
import"../../chunk-tcefvfr8.js";
|
|
158
158
|
import"../../chunk-38barrma.js";
|
|
159
159
|
import"../../chunk-0ef27nx1.js";
|
|
160
|
+
import"../../chunk-bvzjbk43.js";
|
|
160
161
|
import {
|
|
161
162
|
Carousel2,
|
|
162
163
|
CarouselContent2,
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
cn2
|
|
6
6
|
} from "../../chunk-en44w1pn.js";
|
|
7
|
+
import {
|
|
8
|
+
StatusDot2
|
|
9
|
+
} from "../../chunk-bvzjbk43.js";
|
|
7
10
|
import"../../chunk-8ssktt4b.js";
|
|
8
11
|
import"../../chunk-e6hk39ev.js";
|
|
9
12
|
import"../../chunk-x90xmrba.js";
|
|
@@ -88,27 +91,10 @@ function TreeItemStatusIcon({ status, className }) {
|
|
|
88
91
|
});
|
|
89
92
|
}
|
|
90
93
|
function TreeItemDot({ count, className }) {
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
"aria-hidden": "true",
|
|
94
|
+
return /* @__PURE__ */ jsx(StatusDot2, {
|
|
93
95
|
"data-slot": "tree-item-dot",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/* @__PURE__ */ jsx("svg", {
|
|
97
|
-
viewBox: "0 0 8 8",
|
|
98
|
-
className: "size-2 shrink-0",
|
|
99
|
-
focusable: "false",
|
|
100
|
-
children: /* @__PURE__ */ jsx("circle", {
|
|
101
|
-
cx: "4",
|
|
102
|
-
cy: "4",
|
|
103
|
-
r: "4",
|
|
104
|
-
fill: "currentColor"
|
|
105
|
-
})
|
|
106
|
-
}),
|
|
107
|
-
count !== undefined && /* @__PURE__ */ jsx("span", {
|
|
108
|
-
"data-slot": "tree-item-dot-count",
|
|
109
|
-
children: count
|
|
110
|
-
})
|
|
111
|
-
]
|
|
96
|
+
count,
|
|
97
|
+
className
|
|
112
98
|
});
|
|
113
99
|
}
|
|
114
100
|
function isRowControl(event) {
|
package/dist/index.d.ts
CHANGED
|
@@ -127,6 +127,12 @@ export { Text } from "./components/Text.js";
|
|
|
127
127
|
export type { TextProps, TextSize, TextTone, TextWeight } from "./components/Text.js";
|
|
128
128
|
export type { TextAlign } from "./typography/types.js";
|
|
129
129
|
export { Heading } from "./components/Heading.js";
|
|
130
|
+
export { Quote, quoteVariants } from "./components/Quote.js";
|
|
131
|
+
export type { QuoteProps } from "./components/Quote.js";
|
|
132
|
+
export { SkipLink } from "./components/SkipLink.js";
|
|
133
|
+
export type { SkipLinkProps } from "./components/SkipLink.js";
|
|
134
|
+
export { StatusDot, statusDotVariants } from "./components/StatusDot.js";
|
|
135
|
+
export type { StatusDotProps } from "./components/StatusDot.js";
|
|
130
136
|
export type { HeadingProps, HeadingLevel, HeadingSize } from "./components/Heading.js";
|
|
131
137
|
export { WeatherSummary } from "./components/WeatherSummary.js";
|
|
132
138
|
export type { IWeatherDay, TemperatureUnit, WeatherCondition, WeatherSummaryProps, } from "./components/WeatherSummary.js";
|
package/dist/index.js
CHANGED
|
@@ -164,6 +164,9 @@ import {
|
|
|
164
164
|
Container2,
|
|
165
165
|
Text2,
|
|
166
166
|
Heading2,
|
|
167
|
+
quoteVariants2,
|
|
168
|
+
Quote2,
|
|
169
|
+
SkipLink2,
|
|
167
170
|
WeatherSummary2,
|
|
168
171
|
WeatherForecast2,
|
|
169
172
|
PageHeader2,
|
|
@@ -181,7 +184,7 @@ import {
|
|
|
181
184
|
StatusTracker2,
|
|
182
185
|
DashboardLayout2,
|
|
183
186
|
BillingUsage2
|
|
184
|
-
} from "./chunk-
|
|
187
|
+
} from "./chunk-kx91d0g6.js";
|
|
185
188
|
import {
|
|
186
189
|
Combobox2,
|
|
187
190
|
ComboboxValue2,
|
|
@@ -232,6 +235,10 @@ import {
|
|
|
232
235
|
ToolbarGroup2,
|
|
233
236
|
ToolbarSeparator2
|
|
234
237
|
} from "./chunk-0ef27nx1.js";
|
|
238
|
+
import {
|
|
239
|
+
statusDotVariants2,
|
|
240
|
+
StatusDot2
|
|
241
|
+
} from "./chunk-bvzjbk43.js";
|
|
235
242
|
import {
|
|
236
243
|
Slider2
|
|
237
244
|
} from "./chunk-7cq1s2ey.js";
|
|
@@ -795,6 +802,7 @@ export {
|
|
|
795
802
|
ProgressLabel2 as ProgressLabel,
|
|
796
803
|
ProgressTrack2 as ProgressTrack,
|
|
797
804
|
ProgressValue2 as ProgressValue,
|
|
805
|
+
Quote2 as Quote,
|
|
798
806
|
RadioGroup2 as RadioGroup,
|
|
799
807
|
RadioGroupItem2 as RadioGroupItem,
|
|
800
808
|
ReviewList2 as ReviewList,
|
|
@@ -845,11 +853,13 @@ export {
|
|
|
845
853
|
SidebarSeparator2 as SidebarSeparator,
|
|
846
854
|
SidebarTrigger2 as SidebarTrigger,
|
|
847
855
|
Skeleton2 as Skeleton,
|
|
856
|
+
SkipLink2 as SkipLink,
|
|
848
857
|
Slider2 as Slider,
|
|
849
858
|
Spinner2 as Spinner,
|
|
850
859
|
Stack2 as Stack,
|
|
851
860
|
StarRating2 as StarRating,
|
|
852
861
|
StatCard2 as StatCard,
|
|
862
|
+
StatusDot2 as StatusDot,
|
|
853
863
|
StatusTracker2 as StatusTracker,
|
|
854
864
|
Stepper2 as Stepper,
|
|
855
865
|
StepperContent2 as StepperContent,
|
|
@@ -911,6 +921,8 @@ export {
|
|
|
911
921
|
formatDataLabel2 as formatDataLabel,
|
|
912
922
|
markerVariants2 as markerVariants,
|
|
913
923
|
navigationMenuTriggerStyle2 as navigationMenuTriggerStyle,
|
|
924
|
+
quoteVariants2 as quoteVariants,
|
|
925
|
+
statusDotVariants2 as statusDotVariants,
|
|
914
926
|
tabsListVariants2 as tabsListVariants,
|
|
915
927
|
toggleVariants2 as toggleVariants,
|
|
916
928
|
useComboboxAnchor2 as useComboboxAnchor,
|
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.125",
|
|
2055
2055
|
description: "Sharp, monospace React components with compact and comfortable densities.",
|
|
2056
2056
|
license: "MIT",
|
|
2057
2057
|
repository: {
|
package/dist/typeset.css
CHANGED
|
@@ -198,8 +198,11 @@
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/* GFM task lists. */
|
|
201
|
-
&:where(
|
|
201
|
+
&:where(li.task-list-item) {
|
|
202
202
|
list-style-type: none;
|
|
203
|
+
}
|
|
204
|
+
/* A list of only task items needs no bullet column; a mixed list keeps it for its plain items. */
|
|
205
|
+
&:where(ul.contains-task-list:not(:has(> li:not(.task-list-item)))) {
|
|
203
206
|
padding-inline-start: 0.25em;
|
|
204
207
|
}
|
|
205
208
|
&:where(li.task-list-item > input[type="checkbox"]) {
|
|
@@ -54,3 +54,19 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
54
54
|
</div>)
|
|
55
55
|
}
|
|
56
56
|
```
|
|
57
|
+
|
|
58
|
+
### Horizontal
|
|
59
|
+
|
|
60
|
+
```tsx
|
|
61
|
+
{
|
|
62
|
+
args: { "aria-label": "Shortcuts" },
|
|
63
|
+
render: (args) => (<div className="w-96">
|
|
64
|
+
<DescriptionList {...args} orientation="horizontal">
|
|
65
|
+
{shortcuts.map(({ action, keys }) => (<DescriptionListItem key={action}>
|
|
66
|
+
<DescriptionTerm tone="default">{action}</DescriptionTerm>
|
|
67
|
+
<DescriptionDetails>{keys}</DescriptionDetails>
|
|
68
|
+
</DescriptionListItem>))}
|
|
69
|
+
</DescriptionList>
|
|
70
|
+
</div>)
|
|
71
|
+
}
|
|
72
|
+
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Heading
|
|
2
2
|
|
|
3
|
-
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.
|
|
3
|
+
Heading renders `h1`–`h6` from the required `level` so the document outline stays correct, while `size` (sm, base, lg, xl, and the display sizes 2xl and 3xl for a page's own title) sets the visual size independently. Sizes default by level: 1 xl, 2 lg, 3 base, 4–6 sm. `truncate` keeps one line.
|
|
4
4
|
|
|
5
5
|
Story: @alexgorbatchev/shadcn/components/data-display/Heading
|
|
6
6
|
Source: src/components/stories/data-display/Heading.stories.tsx
|
|
@@ -24,7 +24,7 @@ Heading
|
|
|
24
24
|
```tsx
|
|
25
25
|
{
|
|
26
26
|
level: { control: "select", options: [1, 2, 3, 4, 5, 6] },
|
|
27
|
-
size: { control: "select", options: ["sm", "base", "lg", "xl"] },
|
|
27
|
+
size: { control: "select", options: ["sm", "base", "lg", "xl", "2xl", "3xl"] },
|
|
28
28
|
}
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -64,6 +64,22 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
64
64
|
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
+
### DisplaySizes
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
{
|
|
71
|
+
render: () => (<>
|
|
72
|
+
<Heading level={1} size="3xl">
|
|
73
|
+
Page title
|
|
74
|
+
</Heading>
|
|
75
|
+
<Heading level={1} size="2xl">
|
|
76
|
+
Smaller page title
|
|
77
|
+
</Heading>
|
|
78
|
+
<Heading level={1}>Default page</Heading>
|
|
79
|
+
</>)
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
67
83
|
### Truncated
|
|
68
84
|
|
|
69
85
|
```tsx
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Quote
|
|
2
|
+
|
|
3
|
+
Quote marks text quoted from elsewhere, such as the passage a comment targets or the message a reply answers, with a start rule that follows the reading direction. `size` is `default` for panels and composers and `compact` for message footers, bubbles and rows; `clamp` stops a long quote after two lines.
|
|
4
|
+
|
|
5
|
+
Story: @alexgorbatchev/shadcn/components/data-display/Quote
|
|
6
|
+
Source: src/components/stories/data-display/Quote.stories.tsx
|
|
7
|
+
|
|
8
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/Quote.stories.tsx)
|
|
9
|
+
|
|
10
|
+
## Public imports
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { Quote } from "@alexgorbatchev/shadcn";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Default component
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
Quote
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Story controls
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
{
|
|
26
|
+
size: { control: "select", options: ["default", "compact"] },
|
|
27
|
+
clamp: { control: "boolean" },
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Default args
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
{ children: "Keep the sidebar compact and the toolbar visible." }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
### Default
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
{
|
|
45
|
+
args: { "aria-label": "Replying to" }
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Compact
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
{
|
|
53
|
+
render: () => (<>
|
|
54
|
+
<Quote aria-label="Default quote">Default size</Quote>
|
|
55
|
+
<Quote aria-label="Compact quote" size="compact">
|
|
56
|
+
Compact size
|
|
57
|
+
</Quote>
|
|
58
|
+
</>)
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Clamped
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
{
|
|
66
|
+
args: {
|
|
67
|
+
clamp: true,
|
|
68
|
+
"aria-label": "Clamped quote",
|
|
69
|
+
children: "A long passage quoted from the page that goes on well past two lines in a narrow column, so the quote stops after two lines instead of pushing the comment it belongs to far down the panel.",
|
|
70
|
+
},
|
|
71
|
+
decorators: [
|
|
72
|
+
(Story) => (<div className="w-56">
|
|
73
|
+
<Story />
|
|
74
|
+
</div>),
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### RightToLeft
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
{
|
|
83
|
+
args: { "aria-label": "RTL quote" },
|
|
84
|
+
decorators: [
|
|
85
|
+
(Story) => (<div dir="rtl">
|
|
86
|
+
<Story />
|
|
87
|
+
</div>),
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# StatusDot
|
|
2
|
+
|
|
3
|
+
StatusDot marks something new or waiting with a small SVG dot in `currentColor`, so forced colors keep it. `tone` is `primary` for new or waiting and `muted` for quieter states; `count` adds a number; `placement="corner"` pins it to the top end corner of a positioned parent such as an icon button. It is hidden from assistive technology, so say what it means in nearby text or the control's name.
|
|
4
|
+
|
|
5
|
+
Story: @alexgorbatchev/shadcn/components/data-display/StatusDot
|
|
6
|
+
Source: src/components/stories/data-display/StatusDot.stories.tsx
|
|
7
|
+
|
|
8
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/data-display/StatusDot.stories.tsx)
|
|
9
|
+
|
|
10
|
+
## Public imports
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { Button, StatusDot } from "@alexgorbatchev/shadcn";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Supporting imports
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import { BellIcon } from "lucide-react";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Default component
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
StatusDot
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Story controls
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
{
|
|
32
|
+
tone: { control: "select", options: ["primary", "muted"] },
|
|
33
|
+
placement: { control: "select", options: ["inline", "corner"] },
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Examples
|
|
38
|
+
|
|
39
|
+
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.
|
|
40
|
+
|
|
41
|
+
### Inline
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
{
|
|
45
|
+
render: (args) => (<p className="flex items-center gap-2 text-sm">
|
|
46
|
+
<StatusDot {...args}/>
|
|
47
|
+
Needs your answers
|
|
48
|
+
</p>)
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Tones
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
{
|
|
56
|
+
render: () => (<div className="flex items-center gap-4 text-sm">
|
|
57
|
+
<StatusDot data-testid="primary"/>
|
|
58
|
+
<StatusDot data-testid="muted" tone="muted"/>
|
|
59
|
+
</div>)
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### WithCount
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
{
|
|
67
|
+
args: { count: 3 }
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Corner
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
{
|
|
75
|
+
render: () => (<Button variant="outline" size="icon" aria-label="Notifications, unread" className="relative">
|
|
76
|
+
<BellIcon aria-hidden="true"/>
|
|
77
|
+
<StatusDot placement="corner"/>
|
|
78
|
+
</Button>)
|
|
79
|
+
}
|
|
80
|
+
```
|
|
@@ -100,3 +100,11 @@ Storybook CSF excerpts. Default args and render apply unless overridden. Local h
|
|
|
100
100
|
]
|
|
101
101
|
}
|
|
102
102
|
```
|
|
103
|
+
|
|
104
|
+
### FocusableDisplayTitle
|
|
105
|
+
|
|
106
|
+
```tsx
|
|
107
|
+
{
|
|
108
|
+
args: { titleSize: "3xl", headingProps: { tabIndex: -1, id: "intro-title" } }
|
|
109
|
+
}
|
|
110
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SkipLink
|
|
2
|
+
|
|
3
|
+
SkipLink is the first Tab stop: a link to the main content that stays hidden until it has keyboard focus, then shows as an outline button pinned to the top start corner. It jumps to `targetId`; an `onClick` that calls `preventDefault` lets the app move focus itself.
|
|
4
|
+
|
|
5
|
+
Story: @alexgorbatchev/shadcn/components/navigation/SkipLink
|
|
6
|
+
Source: src/components/stories/navigation/SkipLink.stories.tsx
|
|
7
|
+
|
|
8
|
+
[Full source and local helpers](https://github.com/alexgorbatchev/shadcn/blob/main/src/components/stories/navigation/SkipLink.stories.tsx)
|
|
9
|
+
|
|
10
|
+
## Public imports
|
|
11
|
+
|
|
12
|
+
```tsx
|
|
13
|
+
import { SkipLink } from "@alexgorbatchev/shadcn";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Default component
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
SkipLink
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Default args
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
{ targetId: "main-content", children: "Skip to content" }
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Default render
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
(args) => (<>
|
|
32
|
+
<SkipLink {...args}/>
|
|
33
|
+
<nav aria-label="Site">
|
|
34
|
+
<a href="#home">Home</a>
|
|
35
|
+
</nav>
|
|
36
|
+
<main id="main-content" tabIndex={-1}>
|
|
37
|
+
<h1>Main content</h1>
|
|
38
|
+
</main>
|
|
39
|
+
</>)
|
|
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
|
+
### HiddenUntilFocused
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
{}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### AppManagedFocus
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
{
|
|
56
|
+
args: {
|
|
57
|
+
onClick: fn((event) => {
|
|
58
|
+
event.preventDefault();
|
|
59
|
+
event.currentTarget.ownerDocument.getElementById("main-content")?.focus();
|
|
60
|
+
}),
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
package/llms.txt
CHANGED
|
@@ -343,7 +343,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
343
343
|
- [DataViewer](./llms/components/data-display/DataViewer.md)
|
|
344
344
|
- [DescriptionList](./llms/components/data-display/DescriptionList.md)
|
|
345
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.
|
|
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
|
+
- [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, and the display sizes 2xl and 3xl for a page's own title) 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
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.
|
|
@@ -354,9 +354,11 @@ Generated from the public package exports and Storybook sources.
|
|
|
354
354
|
- [JsonViewer](./llms/components/data-display/JsonViewer.md)
|
|
355
355
|
- [Kbd](./llms/components/data-display/Kbd.md)
|
|
356
356
|
- [Meter](./llms/components/data-display/Meter.md)
|
|
357
|
+
- [Quote](./llms/components/data-display/Quote.md): Quote marks text quoted from elsewhere, such as the passage a comment targets or the message a reply answers, with a start rule that follows the reading direction. `size` is `default` for panels and composers and `compact` for message footers, bubbles and rows; `clamp` stops a long quote after two lines.
|
|
357
358
|
- [ReviewList](./llms/components/data-display/ReviewList.md)
|
|
358
359
|
- [Sparkline](./llms/components/data-display/Sparkline.md)
|
|
359
360
|
- [StatCard](./llms/components/data-display/StatCard.md)
|
|
361
|
+
- [StatusDot](./llms/components/data-display/StatusDot.md): StatusDot marks something new or waiting with a small SVG dot in `currentColor`, so forced colors keep it. `tone` is `primary` for new or waiting and `muted` for quieter states; `count` adds a number; `placement="corner"` pins it to the top end corner of a positioned parent such as an icon button. It is hidden from assistive technology, so say what it means in nearby text or the control's name.
|
|
360
362
|
- [StatusTracker](./llms/components/data-display/StatusTracker.md)
|
|
361
363
|
- [Table](./llms/components/data-display/Table.md)
|
|
362
364
|
- [TableResponsive](./llms/components/data-display/TableResponsive.md)
|
|
@@ -467,6 +469,7 @@ Generated from the public package exports and Storybook sources.
|
|
|
467
469
|
- [Outline](./llms/components/navigation/Outline.md)
|
|
468
470
|
- [Pagination](./llms/components/navigation/Pagination.md)
|
|
469
471
|
- [Sidebar](./llms/components/navigation/Sidebar.md)
|
|
472
|
+
- [SkipLink](./llms/components/navigation/SkipLink.md): SkipLink is the first Tab stop: a link to the main content that stays hidden until it has keyboard focus, then shows as an outline button pinned to the top start corner. It jumps to `targetId`; an `onClick` that calls `preventDefault` lets the app move focus itself.
|
|
470
473
|
- [Tabs](./llms/components/navigation/Tabs.md)
|
|
471
474
|
- [Tree](./llms/components/navigation/Tree.md)
|
|
472
475
|
- [WorkspaceSwitcher](./llms/components/navigation/WorkspaceSwitcher.md)
|