@alexgorbatchev/shadcn 0.0.123 → 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-8x9hkznc.js → chunk-8ja1nk62.js} +1 -1
- package/dist/chunk-bvzjbk43.js +48 -0
- package/dist/{chunk-wjs8ks1h.js → chunk-dhtk1cfw.js} +2 -1
- package/dist/{chunk-5eswhdbp.js → chunk-kx91d0g6.js} +223 -146
- 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/assistant-ui/native/ThreadListSidebar.js +2 -2
- package/dist/components/assistant-ui/native/index.js +2 -2
- package/dist/components/json-render/index.js +3 -2
- package/dist/components/tree/index.js +6 -20
- package/dist/index.d.ts +6 -0
- package/dist/index.js +14 -2
- 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/components/overlays/Sheet.md +38 -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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ThreadListSidebar2
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-8ja1nk62.js";
|
|
4
4
|
import"../../../chunk-645t7r1c.js";
|
|
5
5
|
import"../../../chunk-9t5h5ps3.js";
|
|
6
6
|
import"../../../chunk-4bjqbky7.js";
|
|
7
|
-
import"../../../chunk-
|
|
7
|
+
import"../../../chunk-dhtk1cfw.js";
|
|
8
8
|
import"../../../chunk-1fzwfn11.js";
|
|
9
9
|
import"../../../chunk-m4geb1s5.js";
|
|
10
10
|
import"../../../chunk-tcefvfr8.js";
|
|
@@ -201,10 +201,10 @@ import {
|
|
|
201
201
|
TaskTray2
|
|
202
202
|
} from "../../../chunk-rgdesh1z.js";
|
|
203
203
|
import"../../../chunk-4bjqbky7.js";
|
|
204
|
-
import"../../../chunk-
|
|
204
|
+
import"../../../chunk-dhtk1cfw.js";
|
|
205
205
|
import {
|
|
206
206
|
ThreadListSidebar2
|
|
207
|
-
} from "../../../chunk-
|
|
207
|
+
} from "../../../chunk-8ja1nk62.js";
|
|
208
208
|
import {
|
|
209
209
|
useVoiceTranscript2,
|
|
210
210
|
VoiceConversation2
|
|
@@ -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,
|
|
@@ -153,10 +153,11 @@ import {
|
|
|
153
153
|
import"../../chunk-7vnpp3ya.js";
|
|
154
154
|
import"../../chunk-m4geb1s5.js";
|
|
155
155
|
import"../../chunk-9ecf92s6.js";
|
|
156
|
-
import"../../chunk-
|
|
156
|
+
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";
|
|
@@ -371,7 +378,7 @@ import {
|
|
|
371
378
|
SidebarMenuSub2,
|
|
372
379
|
SidebarMenuSubItem2,
|
|
373
380
|
SidebarMenuSubButton2
|
|
374
|
-
} from "./chunk-
|
|
381
|
+
} from "./chunk-dhtk1cfw.js";
|
|
375
382
|
import {
|
|
376
383
|
Avatar2,
|
|
377
384
|
AvatarImage2,
|
|
@@ -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
|
+
```
|